Platform SDK: Debugging and Error Handling

SymGetModuleInfo

The SymGetModuleInfo function retrieves the module information of the specified module.

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

BOOL SymGetModuleInfo(
  HANDLE hProcess,              
  DWORD dwAddr,                 
  PIMAGEHLP_MODULE ModuleInfo  
);

For SymGetModuleInfo64, the parameter list is as follows.

BOOL SymGetModuleInfo64(
  HANDLE hProcess,              
  DWORD64 dwAddr,                 
  PIMAGEHLP_MODULE64 ModuleInfo  
);

Parameters

hProcess
[in] Handle to the process that was originally passed to the SymInitialize function.
dwAddr
[in] Specifies the valid, virtual address that is contained in one of the modules loaded by the SymLoadModule function
ModuleInfo
[out] Pointer to an IMAGEHLP_MODULE structure. The SizeOfStruct member must be set to the size of the IMAGEHLP_MODULE structure. An invalid value will result in an error.

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 module table is searched for a module that contains the dwAddr. The module is located based on the load address and size of each module. If a valid module is found, the ModuleInfo parameter is filled with the information about the module.

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, IMAGEHLP_MODULE, SymGetModuleInfoEx, SymInitialize, SymLoadModule