Debugging Tools for Windows

GetFieldOffset

The GetFieldOffset function returns the offset of a member from the beginning of a structure.

ULONG
GetFieldOffset (
   IN LPCSTR  Type,
   IN LPCSTR  Field,
   OUT PULONG  pOffset
    );

Parameters

Type
Specifies the name of the type of the structure. This can be qualified with a module name, for example, mymodule!mystruct.
Field
Specifies the name of the member in the structure. Submembers can be specified by using a period-separated path, for example, "myfield.mysubfield".
pOffset
Receives the offset of the member from the beginning of an instance of the structure.

Return Value

If the function succeeds, the return value is TRUE; otherwise, it is FALSE.

Requirements

Headers: Defined in wdbgexts.h. If you are writing a WdbgExts extension, include wdbgexts.h. If you are writing a DbgEng extension that calls this function, include wdbgexts.h before dbgeng.h (see Writing DbgEng Extension Code for details).

Build machine: CAPEBUILD