Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

MODULEENTRY32 structure (tlhelp32.h)

Describes an entry from a list of the modules belonging to the specified process.

Syntax

typedef struct tagMODULEENTRY32 {
 DWORD dwSize;
 DWORD th32ModuleID;
 DWORD th32ProcessID;
 DWORD GlblcntUsage;
 DWORD ProccntUsage;
 BYTE *modBaseAddr;
 DWORD modBaseSize;
 HMODULE hModule;
 char szModule[MAX_MODULE_NAME32 + 1];
 char szExePath[MAX_PATH];
} MODULEENTRY32;

Members

dwSize

The size of the structure, in bytes. Before calling the Module32First function, set this member to sizeof(MODULEENTRY32). If you do not initialize dwSize, Module32First fails.

th32ModuleID

This member is no longer used, and is always set to one.

th32ProcessID

The identifier of the process whose modules are to be examined.

GlblcntUsage

The load count of the module, which is not generally meaningful, and usually equal to 0xFFFF.

ProccntUsage

The load count of the module (same as GlblcntUsage), which is not generally meaningful, and usually equal to 0xFFFF.

modBaseAddr

The base address of the module in the context of the owning process.

modBaseSize

The size of the module, in bytes.

hModule

A handle to the module in the context of the owning process.

szModule[MAX_MODULE_NAME32 + 1]

The module name.

szExePath[MAX_PATH]

The module path.

Remarks

The modBaseAddr and hModule members are valid only in the context of the process specified by th32ProcessID.

Examples

For an example that uses MODULEENTRY32, see Traversing the Module List.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header tlhelp32.h

See also

Module32First

Module32Next


Feedback

Was this page helpful?

Additional resources