FIELD_OFFSET

LONG
    FIELD_OFFSET(
        IN TYPE
Type,
        IN PCHAR Field
        );

FIELD_OFFSET returns the byte offset of a named field in a known structure type.

Parameters

Type
The name of a known structure type containing Field.
Field
The name of a field in a structure of type Type.

Return Value

Returns the byte offset of the caller supplied Field in the Type structure.

Comments

Used by device driver writers to symbolically determine the offset of a known field in a known structure type.

Callers of FIELD_OFFSET can be running at any IRQL as long as the structure is resident. If a page fault could occur, callers must be at or below IRQL APC_LEVEL.

See Also

CONTAINING_RECORD