Skip to content

Type Issues #13

Description

@SynSnipe

Type Issues in Windows side of psutil. I assume something changed in winim but I am uncertain.
Linux compiles and runs without issues.

Nim Version

nim -v
Nim Compiler Version 1.4.4 [Windows: amd64]
Compiled at 2021-02-23
Copyright (c) 2006-2020 by Andreas Rumpf

active boot switches: -d:release

winim version

nimble install winim
Downloading https://github.com/khchen/winim using git
  Verifying dependencies for winim@3.6.0
 Installing winim@3.6.0
   Building winim/winim/winimx.exe using c backend
    Prompt: winim@3.6.0 already exists. Overwrite? [y/N]
    Answer: N

psutil version

nimble install psutil
Downloading https://github.com/juancarlospaco/psutil-nim using git
  Verifying dependencies for psutil@0.6.0
 Installing psutil@0.6.0
    Prompt: psutil@0.6.0 already exists. Overwrite? [y/N]
    Answer: N

compilation output

C:\Users\user\processlist>nim c mytest.nim
Hint: used config file 'C:\nim-1.4.4\config\nim.cfg' [Conf]
Hint: used config file 'C:\nim-1.4.4\config\config.nims' [Conf]
...................................................................................................
C:\Users\user\.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)))

The issues are not limited to this proc. I tried to run down my list of issues that I had as a result of trying to create a windows process list. Unfortunately the type issues go a bit deeper than I understand at this point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions