Debugging Tools for Windows

ReadField

The ReadField and ReadStrField macros read a field whose size is less than 8 bytes from a structure initialized with InitTypeRead or InitTypeReadPhysical. They are each a thin wrapper around the GetShortField function.

#define ReadField(Field) \
    GetShortField(0, #Field, 0)

#define ReadFieldStr(FieldStr) \
    GetShortField(0, FieldStr, 0)

Parameters

Field
Specifies the name of the field. The C-preprocessor will turn Field into a string.
FieldStr
Specifies the name of the field. FieldStr is expected to be an ASCII string.

Comments

The parameter Field is the name of the member. For ReadField, the C pre-processor will turn the parameter into a string. For ReadFieldStr, Field is expected to already be an ASCII string. For example, the following two commands are identical and read the same member from a previously initialized structure:

ReadField( myField );
ReadFieldStr( "myField" );

Submembers can be read by using a period-separated path, for example, "myField.mySubfield".

Note Because these macros use the GetShortField function, they must be called from the same source code file as the macros that initialize the structure for reading. For more details, see GetShortField.

Requirements

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

See Also

InitTypeRead, InitTypeReadPhysical, GetShortField

Build machine: CAPEBUILD