SymGetSymFromAddr

The SymGetSymFromAddr function locates the symbol for the specified address.

BOOL SymGetSymFromAddr(
  IN HANDLE hProcess,             
  IN DWORD Address,               
  OUT LPDWORD Displacement,       
  IN OUT PIMAGEHLP_SYMBOL Symbol  
);
 

Parameters

hProcess
Handle to the process that was originally passed to the SymInitialize function.
Address
Specifies the address for which a symbol should be located. The address does not have to be on a symbol boundary. If the address comes after the beginning of a symbol and before the end of the symbol (the beginning of the symbol plus the symbol size), the symbol is found.
Displacement
The displacement from the beginning of the symbol, or zero.
Symbol
Pointer to an IMAGEHLP_SYMBOL structure.

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 SymGetSymFromAddr function locates the symbol for a specified address. The modules are searched for the one the address belongs to. When the module is found, its symbol table is searched for a match. When the symbol is found, the symbol information is copied into the Symbol buffer provided by the caller. The caller must allocate the Symbol buffer properly and fill in the required parameters in the IMAGEHLP_SYMBOL structure before calling SymGetSymFromAddr.

QuickInfo

  Windows NT: Requires version 4.0 or later.
  Windows: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Windows CE: Unsupported.
  Header: Declared in imagehlp.h.
  Import Library: Use imagehlp.lib.

See Also

PE Image Helper (ImageHlp) Overview, Symbol Handler, IMAGEHLP_SYMBOL, SymInitialize