SYMBOL_INFOW structure (dbghelp.h)

Contains symbol information.

Syntax

typedef struct _SYMBOL_INFOW {
  ULONG   SizeOfStruct;
  ULONG   TypeIndex;
  ULONG64 Reserved[2];
  ULONG   Index;
  ULONG   Size;
  ULONG64 ModBase;
  ULONG   Flags;
  ULONG64 Value;
  ULONG64 Address;
  ULONG   Register;
  ULONG   Scope;
  ULONG   Tag;
  ULONG   NameLen;
  ULONG   MaxNameLen;
  WCHAR   Name[1];
} SYMBOL_INFOW, *PSYMBOL_INFOW;

Members

SizeOfStruct

The size of the structure, in bytes. This member must be set to sizeof(SYMBOL_INFO). Note that the total size of the data is the SizeOfStruct + (MaxNameLen - 1) * sizeof(TCHAR). The reason to subtract one is that the first character in the name is accounted for in the size of the structure.

TypeIndex

A unique value that identifies the type data that describes the symbol. This value does not persist between sessions.

Reserved[2]

This member is reserved for system use.

Index

The unique value for the symbol. The value associated with a symbol is not guaranteed to be the same each time you run the process.

For PDB symbols, the index value for a symbol is not generated until the symbol is enumerated or retrieved through a search by name or address. The index values for all CodeView and COFF symbols are generated when the symbols are loaded.

Size

The symbol size, in bytes. This value is meaningful only if the module symbols are from a pdb file; otherwise, this value is typically zero and should be ignored.

ModBase

The base address of the module that contains the symbol.

Flags

This member can be one or more of the following values.

Value Meaning
SYMFLAG_CLR_TOKEN
0x00040000
The symbol is a CLR token.
SYMFLAG_CONSTANT
0x00000100
The symbol is a constant.
SYMFLAG_EXPORT
0x00000200
The symbol is from the export table.
SYMFLAG_FORWARDER
0x00000400
The symbol is a forwarder.
SYMFLAG_FRAMEREL
0x00000020
Offsets are frame relative.
SYMFLAG_FUNCTION
0x00000800
The symbol is a known function.
SYMFLAG_ILREL
0x00010000
The symbol address is an offset relative to the beginning of the intermediate language block. This applies to managed code only.
SYMFLAG_LOCAL
0x00000080
The symbol is a local variable.
SYMFLAG_METADATA
0x00020000
The symbol is managed metadata.
SYMFLAG_PARAMETER
0x00000040
The symbol is a parameter.
SYMFLAG_REGISTER
0x00000008
The symbol is a register. The Register member is used.
SYMFLAG_REGREL
0x00000010
Offsets are register relative.
SYMFLAG_SLOT
0x00008000
The symbol is a managed code slot.
SYMFLAG_THUNK
0x00002000
The symbol is a thunk.
SYMFLAG_TLSREL
0x00004000
The symbol is an offset into the TLS data area.
SYMFLAG_VALUEPRESENT
0x00000001
The Value member is used.
SYMFLAG_VIRTUAL
0x00001000
The symbol is a virtual symbol created by the SymAddSymbol function.

Value

The value of a constant.

Address

The virtual address of the start of the symbol.

Register

The register.

Scope

The DIA scope. For more information, see the Debug Interface Access SDK in the Visual Studio documentation. (This resource may not be available in some languages

and countries.)

Tag

The PDB classification. These values are defined in Dbghelp.h in the SymTagEnum enumeration type.

NameLen

The length of the name, in characters, not including the null-terminating character.

MaxNameLen

The size of the Name buffer, in characters. If this member is 0, the Name member is not used.

Name[1]

The name of the symbol. The name can be undecorated if the SYMOPT_UNDNAME option is used with the SymSetOptions function.

Remarks

Note

The dbghelp.h header defines SYMBOL_INFO as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Header dbghelp.h
Redistributable DbgHelp.dll 5.1 or later

See also

SymEnumSymbolsProc

SymFromAddr

SymFromName

SymGetTypeFromName