SymGetSymFromAddr

The SymGetSymFromAddr function locates the symbol for a requested address.

BOOL SymGetSymFromAddr(

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

Parameters

hProcess

The process handle that was originally passed to SymInitialize.

Address

The address for which a symbol is requested. 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

A pointer to an IMAGEHLP_SYMBOL structure.

Return Values

If the function succeeds, the return value is TRUE.

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

Remarks

The SymGetSymFromAddr function locates the symbol for a requested 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 the SymGetSymFromAddr function.