The MASM Forum

General => The Campus => Topic started by: xandaz on January 11, 2021, 05:13:59 AM

Title: Was tlhelp32.inc/lib excluded from Windows 10?
Post by: xandaz on January 11, 2021, 05:13:59 AM
    I was going to work on a simple program that i made a few years ago that envolved Process32First, etc and noticed that both the lib as the include tlhelp32 weren't available. Is there another way to Enum processes or im looking into the wrong library and include files? Thanks
Title: Re: Was tlhelp32.inc/lib excluded from Windows 10?
Post by: Vortex on January 11, 2021, 05:58:09 AM
Hello,

EnumProcesses function (psapi.h) :

https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-enumprocesses

EnumProcessModules function (psapi.h) :

https://docs.microsoft.com/en-us/windows/win32/api/psapi/nf-psapi-enumprocessmodules

Process32First function (tlhelp32.h) :

https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-process32first
Title: Re: Was tlhelp32.inc/lib excluded from Windows 10?
Post by: xandaz on January 13, 2021, 03:47:55 AM
   Thanks. the Process32FirstW is include in kernel32.inc/lib. There's nomore the tlhelp library and header. Thanks
Title: Re: Was tlhelp32.inc/lib excluded from Windows 10?
Post by: jj2007 on January 13, 2021, 06:47:13 AM
include \masm32\MasmBasic\MasmBasic.inc
Init
Print "ct", Tb$, "ID", Tb$, "path"
For_ ecx=0 To GetProcessArray(?)-1
Print Str$("\n%i\t", ecx), Str$(MbProcID(ecx)), Tb$, MbProc$(ecx)
Next
Inkey CrLf$, "--- hit any key ---"
EndOfCode

ct      ID      path
0       2288    C:\Windows\System32\taskhost.exe
1       2444    C:\Windows\System32\dwm.exe
2       2476    C:\Windows\explorer.exe
...
37      6028    C:\Windows\System32\conhost.exe
--- hit any key ---