Platform SDK: Debugging and Error Handling

SymGetSymbolInfo

The SymGetSymbolInfo function retrieves advanced symbol information for a specified symbol. This function is intended for use by Windows 2000 debuggers.

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

BOOL SymGetSymbolInfo(
  HANDLE hProcess,
  DWORD Address,
  IMAGEHLP_TYPES TypeIn,
  PBYTE DataIn,
  IMAGEHLP_TYPES TypeOut,
  PULONG SizeOut,
  PBYTE DataOut
);

For SymGetSymbolInfo64, the parameter list is as follows.

BOOL SymGetSymbolInfo64(
  HANDLE hProcess,
  DWORD64 Address,
  IMAGEHLP_TYPES TypeIn,
  PBYTE DataIn,
  IMAGEHLP_TYPES TypeOut,
  PULONG SizeOut,
  PBYTE DataOut
);

Parameters

hProcess
[in] Handle to the process that was originally passed to the SymInitialize function.
Address
[in] Specifies the address for which a symbol should be found. The address does not need 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.
TypeIn
[in] Specifies the input type. This parameter can be one of the following values.
Value Meaning
IMAGEHLP_TYPEID_IMAGEHLP_SYMBOL The DataIn parameter is a pointer to an IMAGEHLP_SYMBOL structure.
IMAGEHLP_TYPEID_IMAGEHLP_SYMBOL64 The DataIn parameter is a pointer to an IMAGEHLP_SYMBOL64 structure.
IMAGEHLP_TYPEID_NAME The DataIn parameter is a pointer to a string that specifies the symbol name.

DataIn
[in] Pointer to a buffer that specifies the input data. The data type of the buffer is determined by the value of the TypeIn parameter.
TypeOut
[in] Specifies the output type. This parameter can be one of the following values.
Value Meaning
IMAGEHLP_TYPEID_INDEX The function takes the symbol name in DataIn and returns its type index in DataOut.
IMAGEHLP_TYPEID_TYPE_ENUM_INFO The function takes the partial symbol name in DataIn and enumerates all symbols that begin with the same characters. The DataOut parameter is a pointer to a TYPE_ENUM_INFO structure. Each time the function finds a match, it calls the SymTypeNameCallback function specified in the structure.

SizeOut
[in] Specifies the size, in bytes, of the DataOut buffer.
DataOut
[in/out] Pointer to a buffer that receives the data. The data type of the buffer is determined by the value of the TypeOut parameter.

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.

Requirements

  Windows NT/2000: Requires Windows 2000. Available as a redistributable for Windows NT 4.0.
  Windows 95/98: Requires Available as a redistributable for Windows 98.
  Header: Declared in Dbghelp.h.
  Library: Use Dbghelp.lib.

See Also

Debug Help Library Overview, DbgHelp Functions