Debugging Tools for Windows

GetFieldTypeAndOffset

The GetFieldTypeAndOffset and GetFieldTypeAndOffsetWide methods return the type of a field and its offset within a container.

IDebugSymbols3::GetFieldTypeAndOffset(
    IN ULONG64  Module,
    IN ULONG  ContainerTypeId,
    IN PCSTR  Field,
    OUT OPTIONAL PULONG  FieldTypeId,
    OUT OPTIONAL PULONG  Offset
    );

IDebugSymbols3::GetFieldTypeAndOffsetWide(
    IN ULONG64  Module,
    IN ULONG  ContainerTypeId,
    IN PCWSTR  Field,
    OUT OPTIONAL PULONG  FieldTypeId,
    OUT OPTIONAL PULONG  Offset
    );

#ifdef UNICODE
#define GetFieldTypeAndOffsetT GetFieldTypeAndOffsetWide
#else
#define GetFieldTypeAndOffsetT GetFieldTypeAndOffset
#endif

Parameters

Module
Specifies the module containing the types of both the container and the field.
ContainerTypeId
Specifies the type ID for the container's type. Examples of containers include structures, unions, and classes.
Field
Specifies the name of the field whose type and offset are requested. Subfields may be specified by using a dot-separated path.
FieldTypeId
Receives the type ID of the field.
Offset
Receives the offset of the field Field from the base memory location of an instance of the container.

Return Value

S_OK
The method was successful.
E_NOINTERFACE
The field Field could not be found in the type specified by ContainerTypeId.

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

Interface Version

GetFieldTypeAndOffset and GetFieldTypeAndOffsetWide are available in IDebugSymbols3 and later versions.

Comments

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 type of this field and its location relative to the location of MyStruct structure can be found by passing "MyField.MySubField" as the Field parameter to this method.

For more information about types, see Types. For more information about symbols, see Symbols.

Requirements

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

See Also

GetFieldOffset, GetTypeId

Build machine: CAPEBUILD