Platform SDK: Debugging and Error Handling

SymEnumerateModules

The SymEnumerateModules function enumerates all modules that have been loaded for the process by the SymLoadModule function.

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

BOOL SymEnumerateModules(
  HANDLE hProcess,                                
  PSYM_ENUMMODULES_CALLBACK EnumModulesCallback,  
  PVOID UserContext                               
);

For SymEnumerateModules64, the parameter list is as follows.

BOOL SymEnumerateModules64(
  HANDLE hProcess,                                
  PSYM_ENUMMODULES_CALLBACK64 EnumModulesCallback,
  PVOID UserContext                               
);

Parameters

hProcess
[in] Handle to the process that was originally passed to the SymInitialize function.
EnumModulesCallback
[in] Pointer to the enumeration callback function. This function is called once per module. For more information, see SymEnumModulesCallback.
UserContext
[in] A user-defined value or NULL. This value is simply passed to the callback function. Normally, this parameter is used by an application to pass a pointer to a data structure that lets the callback function establish some type of context.

Return Values

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.

Remarks

The SymEnumerateModules function enumerates all modules that have been loaded for the process by SymLoadModule, even if the symbol loading is deferred. The enumeration callback function is called once for each module and is passed the module information.

Requirements

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

See Also

Debug Help Library Overview, DbgHelp Functions, SymEnumModulesCallback, SymInitialize, SymLoadModule