Home
Tutorials
Code Snippets
Code Samples
Downloads
Links

The Blog
Our Projects
About
Contact

::Add RageStorm to Favorites!::

The Blog | Our Projects | Guest Book | About | Contact

 
Code Snippet - Process Linked Modules
Author:Tornado
Category:Win32API
File Size:897 Bytes
Uploaded at:20-Dec-02 09:27:21 am
Description:
  Retrieves information about the modules a proccess uses.
  
Retrieve the Linked Modules of a process

// dwProcessID is the ID of the desired process
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, dwProcessID);

MODULEENTRY32 module;
module.dwSize = sizeof(module);
if (Module32First(hSnapshot, &module)) // Find first module
{
 do
 {
  // module.th32ModuleID is the ID of this module (not really useful)
  // module.szModule is the module's filename
  // module.szExePath is the full path of the module
  // module.modBaseAddr is the base address (In memory) of the module
  // module.GlbcntUsage is the global usage count for this module (How many times it is used across the system)
  // module.ProccntUsage is the process usage count for this module
  // module.modBaseSize is the memory occupied by the module in memory
 } while(Module32Next(hSnapshot, &module)); // Continue...
}
CloseHandle(hSnapshot); // Clean up
User Contributed Comments(None)
NOTE:
Comments that will hurt anyone in any way will be deleted.
Don't ask for features, advertise or curse.
If you want to leave a message to the author use the contacts,
if you have any question in relation to your comments please use the forum.
Comments which violate any of these requests will be deleted without further
notice. Use the comment system decently.

Post your comment:
Name:
email:
Comment:
::Top 5 Tutorials::
Embedded Python[116865]
2D Rotated Rectangles Collision Detection[88952]
Keyboard Hook[77250]
UDP[65803]
HTTP Proxy[41192]

::Top 5 Samples::
2D ColDet Rotated Rectangles[11557]
PS2 Mouse Driver[6953]
Wave Format Player[5788]
Reading FAT12[5616]
CodeGuru[5355]


All rights reserved to RageStorm © 2009