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 04: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[106775]
2D Rotated Rectangles Collision Detection[79918]
Keyboard Hook[69063]
UDP[53058]
HTTP Proxy[36303]

::Top 5 Samples::
2D ColDet Rotated Rectangles[10638]
PS2 Mouse Driver[6122]
Wave Format Player[5005]
Reading FAT12[4893]
CodeGuru[4579]


All rights reserved to RageStorm © 2009