Why I cant use Process32First and Process32Next anymore? I get: error A2006: undefined symbol : Process32First
However, the same project can be compiled with MASM32 v10.
oops...
it looks like only the unicode version has a prototype
appears not to be the only one in kernel32.inc like that, too
for a quick test, add these to the beginning of your program...
IFNDEF Process32First
Process32First PROTO :DWORD,:DWORD
ENDIF
IFNDEF Process32Next
Process32Next PROTO :DWORD,:DWORD
ENDIF
.obj : error LNK2001: unresolved external symbol _Process32First@8
.obj : error LNK2001: unresolved external symbol _Process32Next@8
.exe : fatal error LNK1120: 2 unresolved externals
my mistake - they didn't get imported into kernel32.lib, of course
...and, i forgot the "A"
IFNDEF Process32FirstA
Process32FirstA PROTO :DWORD,:DWORD
ENDIF
IFNDEF Process32First
Process32First TEXTEQU <Process32FirstA>
ENDIF
IFNDEF Process32NextA
Process32NextA PROTO :DWORD,:DWORD
ENDIF
IFNDEF Process32Next
Process32Next TEXTEQU <Process32NextA>
ENDIF
if that doesn't work, we'll have to make a new kernel32.lib
in the mean time, you can use GetProcAddress
Process32First dont have an "A", only "W", still dont help. Can you make new lib?
this worked for me
IFNDEF Process32FirstA
Process32FirstA PROTO :DWORD,:DWORD
ENDIF
IFNDEF Process32First
Process32First TEXTEQU <Process32FirstA>
ENDIF
IFNDEF Process32NextA
Process32NextA PROTO :DWORD,:DWORD
ENDIF
IFNDEF Process32Next
Process32Next TEXTEQU <Process32NextA>
ENDIF
same error as before, unresolved external symbol _Process32FirstA@8
sorry - i thought it worked - i had a pre-existing EXE file in the folder, so i thought it linked properly
the problem with creating a new lib is...
it appears there are several (or many) functions that need to be "fixed"
i don't feel like fixing them all :P
you can make one using inc2lib...
add the ASCII prototypes to kernel32.inc
Process32FirstA PROTO :DWORD,:DWORD
Process32NextA PROTO :DWORD,:DWORD
in the existing kernel32.inc, you will find these aliases...
IFDEF __UNICODE__
Process32First equ <Process32FirstW>
ENDIF
IFDEF __UNICODE__
Process32Next equ <Process32NextW>
ENDIF
modify them like so...
IFDEF __UNICODE__
Process32First equ <Process32FirstW>
ELSE
Process32First equ <Process32FirstA>
ENDIF
IFDEF __UNICODE__
Process32Next equ <Process32NextW>
ELSE
Process32Next equ <Process32NextA>
ENDIF
then use inc2lib to create a new lib
or, you can wait for Hutch to update it :P
he will probably take care of this in the next day or so
Hi Alex,
The problem is that the Process32FirstA and Process32NextA do not exist. The ANSI versions are named Process32First and Process32Next, while the Unicode versions are Process32FirstW and Process32NextW. The Kernek.inc file coming with MASM32 v11 has the following declarations (and I'm the responsible):
Module32FirstW PROTO STDCALL :DWORD,:DWORD
IFDEF __UNICODE__
Module32First equ <Module32FirstW>
ENDIF
Module32NextW PROTO STDCALL :DWORD,:DWORD
IFDEF __UNICODE__
Module32Next equ <Module32NextW>
ENDIF
and according to Microsoft they should be:
Module32First PROTO STDCALL :DWORD,:DWORD
Module32FirstW PROTO STDCALL :DWORD,:DWORD
Module32Next PROTO STDCALL :DWORD,:DWORD
Module32NextW PROTO STDCALL :DWORD,:DWORD
So lines:
Module32First PROTO STDCALL :DWORD,:DWORD
Module32Next PROTO STDCALL :DWORD,:DWORD
are missing.
This is what MSDN says for Module32First (the same applies to Module32Next):
Header
Tlhelp32.h
Library
Kernel32.lib
DLL
Kernel32.dll
Unicode and ANSI names
Module32FirstW (Unicode) and Module32First (ANSI)
Regards,
this should be fixed in the latest SDK
You should also make sure you use the proper structures, the UNICODE and ANSI versions of PROCESSENTRY32 and MODULEENTRY32 are different sizes because of character width (TCHAR).
Where is outCLSID defined?
Mods will probably close this topic now and remove that link since it seems to be source for something malicious and we don't help with that.
For all others who have same prob like me before, here is simple solution:
Change in kernel32.inc
Process32FirstW PROTO STDCALL :DWORD,:DWORD
Process32NextW PROTO STDCALL :DWORD,:DWORD
to
Process32First PROTO STDCALL :DWORD,:DWORD
Process32Next PROTO STDCALL :DWORD,:DWORD
and make a new kernel32.lib or take the one from windows sdk.