msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CreateToolhelp32Snapshot and EnumProcessModules won't work o

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI
Author Message
no



Joined: 25 Feb 2008
Posts: 1

PostPosted: Mon Feb 25, 2008 3:17 pm    Post subject: CreateToolhelp32Snapshot and EnumProcessModules won't work o Reply with quote

I previously used CreateToolhelp32Snapshot to get PID of a given
process running and then EnumProcessModules to list the modules
(dll's)running with that process.

however, my programs were solely used in 32 bit environment before. I
wish to be able to utilize the same code to list 64 bit programs list
of modules under a process.

The CreateToolhelp32Snapshot / Process32First / Process32Next works
fine to get the PID of 64 bit apps, but EnumProcessModules /
GetModuleFileNameExA / GetModuleBaseNameA does not work on 64 bit
processes that are running.



I note the following in the MSDN knowledge base regarding
EnumProcessModules:



If this function is called from a 32-bit application running on WOW64,
it can only enumerate the modules of a 32-bit process. To enumerate
the modules of a 64-bit process from an application running on WOW64,
use the CreateToolhelp32Snapshot function.



and then on the CreateToolhelp32Snapshot page of the same site:



CreateToolhelp32Snapshot Function
----------------------------------
If the specified process is a 64-bit process and the caller is a
32-bit process, this call will fail. Note that you can use the
QueryFullProcessImageName function to retrieve the full name of an
executable image for both 32- and 64-bit processes from a 32-bit
process.



I See the information posted for QueryFullProcessImageName but am not
sure how to implement it.

do you do this instead of CreateToolhelp32Snapshot? then what? how do
you access the list of modules running under that process?



i am not sure how to get ahold of the list of modules of a running 64
bit process from a 32 bit application.



for instance:



My application is 32 bit program. I am running it in Vista 64 bit OS.
it tries to access 64 bit program (notepad.exe, for instance) and list
the attached modules of that process (kernel32.dll, for instance) and
also the base address of the .exe and each of the .dll's.



I appreciate any help in this!



best,

Mike

Archived from group: microsoft>public>vb>winapi
Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
EnumProcessModules & 64 bit Hi All, I am trying to enumerate processes on a 64 bit machine using This seems to work OK, but when I try to use to get process information & dependencies, it only returns information for 32 bit apps and

How to know EnumProcessModules API is failing? We have developed a service in VC which calculates time for which a process is run. This is achieved by getting the start and end time of every process on the machine. The information about a process is enumerated using API in a loop.

[?] EnumProcesses vs. CreateToolhelp32Snapshot Hello, What's the difference in usage functions? I don't going to work with win9x. Thanks, Lucy.

CreateToolhelp32Snapshot and enumerating processes I am trying to enumerate processes on NT bases OSs. I am using and Process32Next to enumerate the processes. I then use OpenProcess to retrieve information about the process. This works for 95% of the processes.

Any Work Around for TVM_SETINSERTMARKCOLOR ? When I implement this message it doesn't quite work all the way. The last group of child-nodes in the first and last root nodes remain the default color(white), while all of the other nodes seem to take fine. My question is this, how do I work around this
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group