Platform SDK: Debugging and Error Handling

SymGetModuleBase

The SymGetModuleBase function retrieves the base address of the module that contains the specified address.

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

DWORD SymGetModuleBase(
  HANDLE hProcess,  
  DWORD dwAddr      
);

For SymGetModuleBase64, the parameter list is as follows.

DWORD SymGetModuleBase64(
  HANDLE hProcess,  
  DWORD64 dwAddr      
);

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.

Return Value

If the function succeeds, the return value is a nonzero virtual address. The value is the base address of the module containing the address specified by the dwAddr parameter.

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

Remarks

The module table is searched for a module that contains dwAddr. The module is located based on the load address and size of each 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, SymInitialize, SymLoadModule