MODULEENTRY32 structure

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;
  TCHAR   szModule[MAX_MODULE_NAME32 + 1];
  TCHAR   szExePath[MAX_PATH];
} MODULEENTRY32, *PMODULEENTRY32;

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

The module name.

szExePath

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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

TlHelp32.h

Unicode and ANSI names

MODULEENTRY32W (Unicode) and MODULEENTRY32 (ANSI)

See also

Module32First
Module32Next

 

 

Community Additions

ADD
Show:
© 2014 Microsoft