SymGetSymFromName

The SymGetSymFromName function locates a symbol for the specified name.

BOOL SymGetSymFromName(
  IN HANDLE hProcess,          
  IN LPSTR Name,               
  OUT PIMAGEHLP_SYMBOL Symbol  
);
 

Parameters

hProcess
Handle to the process that was originally passed to the SymInitialize function.
Name
Pointer to a null-terminated string that specifies the symbol name for which a symbol is to be located.
Symbol
Pointer to an IMAGEHLP_SYMBOL structure.

Return Value

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 SymGetSymFromName function is used to locate a symbol for a specified name. The name can contain a module prefix that isolates the symbol search to a single module's symbol table.

The module prefix is in the form of "module!". The "!" character is the delimiter between the module name and the symbol name. If there is no module prefix, then the search is performed on each module's symbol table in a linear manner, beginning with the first module that is loaded.

Using the module prefix is preferable for two reasons. First, the symbol search occurs much faster. Second, when deferred symbol loading is turned on, the search causes symbols to be loaded for each module that is searched. 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 SymGetSymFromName.

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