Debugging Tools for Windows

GetNameByOffset

The GetNameByOffset and GetNameByOffsetWide methods return the name of the symbol at the specified location in the target's virtual address space.

HRESULT
  IDebugSymbols::GetNameByOffset(
    IN ULONG64  Offset,
    OUT OPTIONAL PSTR  NameBuffer,
    IN ULONG  NameBufferSize,
    OUT OPTIONAL PULONG  NameSize,
    OUT OPTIONAL PULONG64  Displacement
    );

HRESULT
  IDebugSymbols3::GetNameByOffsetWide(
    IN ULONG64  Offset,
    OUT OPTIONAL PWSTR  NameBuffer,
    IN ULONG  NameBufferSize,
    OUT OPTIONAL PULONG  NameSize,
    OUT OPTIONAL PULONG64  Displacement
    );

#ifdef UNICODE
#define GetNameByOffsetT GetNameByOffsetWide
#else
#define GetNameByOffsetT GetNameByOffset
#endif

Parameters

Offset
Specifies the location in the target's virtual address space of the symbol whose name is requested. Offset does not need to specify the base location of the symbol; it only needs to specify a location within the symbol's memory allocation.
NameBuffer
Receives the symbol's name. The name is qualified by the module to which the symbol belongs (for example, mymodule!main). If NameBuffer is NULL, this information is not returned.
NameBufferSize
Specifies the size in characters of the buffer NameBuffer.
NameSize
Receives the size in characters of the symbol's name. If NameSize is NULL, this information is not returned.
Displacement
Receives the difference between the value of Offset and the base location of the symbol. If Displacement is NULL, this information is not returned.

Return Value

S_OK
The method was successful.
S_FALSE
The method was successful. However, the buffer was not large enough to hold the symbol's name, so it was truncated.
E_FAIL
No symbol could be found at the specified location.

This method may also return other error values. See Return Values for more details.

Interface Version

GetNameByOffset is available in all versions of IDebugSymbols.

Comments

For more information about symbols and symbol names, see Symbols.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

GetNearNameByOffset, GetOffsetByName

Build machine: CAPEBUILD