Debugging Tools for Windows

GetShortField

The GetShortField function reads the value of a member in a structure if its size is less than or equal to 8 bytes. This function is not intended to be used directly, InitTypeRead or InitTypeReadPhysical and ReadField should be used instead.

ULONG64
GetShortField (
    IN  ULONG64  TypeAddress,
    IN  LPCSTR  Name,
    IN  USHORT  StoreAddress
    );

Parameters

TypeAddress
If StoreAddress is non-zero:Specifies the address of the structure in the target's memory. This address is used for subsequent calls when StoreAddress is zero.If StoreAddress is zero:TypeAddress is ignored. The value of TypeAddress from the last call when StoreAddress was non-zero is used to specify the address of the structure in the target's memory.
Name
If StoreAddress is non-zero:
Specifies the name of the type of the structure at TypeAddress.
If StoreAddress is zero:
Specifies the name of the member in the structure to read. The address and type of the structure are remembered from a previous call to this function with StoreAddress not equal to- zero. Submembers can be specified by using a period-separated path, for example, "myfield.mysubfield".
StoreAddress
Specifies the mode of this function.
If StoreAddress is non-zero:
This function initializes a structure for reading its members. The address and type name for the structure is remembered.

If the bit value 2 is set in StoreAddress, the address TypeAddress is considered a physical address; otherwise, it is considered a virtual address.

If StoreAddress is zero:
This function reads a member from a previously initialized structure.

Return Value

If StoreAddress is non-zero:
This function returns TRUE on success and FALSE on failure.
If StoreAddress is zero:
This function returns the value of the member.

Comments

This function does not need to be called directly. The macros InitTypeRead and InitTypeReadPhysical call this function with StoreAddress non-zero to prepare a structure for reading its members. The macro ReadField calls this function with StoreAddress (and TypeAddress) equal to zero, to read members from the structure.

Note because this function stores the TypeAddress and Name by using static local variables, and because this function is defined in WdbgExts.h, the C pre-processor will create a new instance of this function for each DLL, and TypeAddress and Name will only be available within a single source file. In other words, the structure must be initialized in the same source file from which the members are read.

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).

See Also

InitTypeRead, InitTypeReadPhysical, ReadField

Build machine: CAPEBUILD