Debugging Tools for Windows |
The GetFieldOffset and GetFieldOffsetWide methods return the offset of a field from the base address of an instance of a type.
HRESULT
IDebugSymbols::GetFieldOffset(
IN ULONG64 Module,
IN ULONG TypeId,
IN PCSTR Field,
OUT PULONG Offset
);
HRESULT
IDebugSymbols3::GetFieldOffsetWide(
IN ULONG64 Module,
IN ULONG TypeId,
IN PCWSTR Field,
OUT PULONG Offset
);
#ifdef UNICODE
#define GetFieldOffsetT GetFieldOffsetWide
#else
#define GetFieldOffsetT GetFieldOffset
#endif
This method may also return error values. See Return Values for more details.
GetFieldOffset is available in all versions of IDebugSymbols. GetFieldOffsetWide is available in IDebugSymbols3 and later versions.
An example of a dot-separated path for the Field parameter is as follows. Suppose the MyStruct structure contains a field MyField of type MySubStruct, and the MySubStruct structure contains the field MySubField. Then the location of this field relative to the location of MyStruct structure can be found by setting the Field parameter to "MyField.MySubField".
For more information about types, see Types.
Headers: Defined in Dbgeng.h. Include Dbgeng.h.