Platform SDK: Debugging and Error Handling

EnumerateLoadedModules

The EnumerateLoadedModules function enumerates the loaded modules for the specified process.

This function is implemented as a wrapper that calls EnumerateLoadedModules64. For more information, see New 64-bit Functions.

BOOL EnumerateLoadedModules(
  HANDLE hProcess,
  PENUMLOADED_MODULES_CALLBACK EnumLoadedModulesCallback,
  PVOID UserContext
);

For EnumerateLoadedModules64, the parameter list is as follows.

BOOL EnumerateLoadedModules64(
  HANDLE hProcess,
  PENUMLOADED_MODULES_CALLBACK64 EnumLoadedModulesCallback,
  PVOID UserContext
);

Parameters

hProcess
[in] Handle to the process whose modules will be enumerated.
EnumLoadedModulesCallback
[in] Pointer to an application-defined callback function. For more information, see EnumLoadedModulesProc.
UserContext
[in] User-defined data. This value is passed to the callback function.

Return Value

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.

Requirements

  Windows NT/2000: Requires Windows 2000. Available as a redistributable for Windows NT 4.0.
  Windows 95/98: Requires Available as a redistributable for Windows 98.
  Header: Declared in Dbghelp.h.
  Library: Use Dbghelp.lib.

See Also

Debug Help Library Overview, DbgHelp Functions, EnumLoadedModulesProc