juancarlospaco / psutil-nim

Port of python psutil to Nim
MIT License
28 stars 9 forks source link

Type mismatch at GetModuleBaseName() #23

Open angelside opened 1 year ago

angelside commented 1 year ago

Type mismatch at GetModuleBaseName()

OS: Windows 10 nim version: Nim Compiler Version 1.6.6 [Windows: amd64]

import psutil
.nimble\pkgs\psutil-0.6.0\psutil\psutil_windows.nim(151, 30) Error: type mismatch: got <HANDLE, HMODULE, array[0..259, TCHAR], DWORD>
but expected one of:
proc GetModuleBaseName(hProcess: HANDLE; hModule: HMODULE; lpBaseName: LPWSTR;
                       nSize: DWORD): DWORD
  first type mismatch at position: 3
  required type for lpBaseName: LPWSTR
  but expression 'szProcessName' is of type: array[0..259, TCHAR]

expression: GetModuleBaseName(hProcess, hMod, szProcessName, cast[DWORD](len(szProcessName)))

psutil_windows.nim(151, 30)

            GetModuleBaseName( hProcess, hMod, szProcessName, 
                               cast[DWORD](szProcessName.len) )
fbpyr commented 1 year ago

I get the same error on win10 with nim 1.6.8