MODULEENTRY32W structure (tlhelp32.h)
Describes an entry from a list of the modules belonging to the specified process.
Syntax
typedef struct tagMODULEENTRY32W {
DWORD dwSize;
DWORD th32ModuleID;
DWORD th32ProcessID;
DWORD GlblcntUsage;
DWORD ProccntUsage;
BYTE *modBaseAddr;
DWORD modBaseSize;
HMODULE hModule;
WCHAR szModule[MAX_MODULE_NAME32 + 1];
WCHAR szExePath[MAX_PATH];
} MODULEENTRY32W;
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.
Note
The tlhelp32.h header defines MODULEENTRY32 as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for