News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

CreateToolhelp32Snapshot & 64 bits

Started by dacid, August 14, 2008, 04:38:10 PM

Previous topic - Next topic

dacid

Im coding a 32bit application under 64bits Windows Vista:


invoke CreateToolhelp32Snapshot,TH32CS_SNAPMODULE,dwPID


In a 32bits process works ok, in 64bit fails with "ERROR_PARTIAL_COPY":

MSDN says:

Quote
If the specified process is a 64-bit process and the caller is a 32-bit process, this function fails and the last error code is ERROR_PARTIAL_COPY (299).

more on MSDN:

Quote
TH32CS_SNAPMODULE
....
64-bit Windows:  Using this flag in a 32-bit process includes the 32-bit modules of the process specified in th32ProcessID, while using it in a 64-bit process includes the 64-bit modules. To include the 32-bit modules of the process specified in th32ProcessID from a 64-bit process, use the TH32CS_SNAPMODULE32 flag.

I cant find the value for "TH32CS_SNAPMODULE32" in windows.inc and 'googling' seems to be = 10. ¿Can anyone confirm this?

I tried:


invoke CreateToolhelp32Snapshot,TH32CS_SNAPMODULE32,dwPID


but same error ERROR_PARTIAL_COPY.

TH32CS_SNAPMODULE32

Quote
This flag can be combined with TH32CS_SNAPMODULE or TH32CS_SNAPALL

I tried:


invoke CreateToolhelp32Snapshot,TH32CS_SNAPMODULE or TH32CS_SNAPMODULE32,dwPID


Same result as using TH32CS_SNAPMODULE.

Any ideas?