Export (0) Print
Expand All

SCSIWMI_REQUEST_CONTEXT structure

A SCSIWMI_REQUEST_CONTEXT structure contains context information for a WMI SRB.

Syntax


typedef struct {
  PVOID  UserContext;
  ULONG  BufferSize;
  PUCHAR Buffer;
  UCHAR  MinorFunction;
  UCHAR  ReturnStatus;
  ULONG  ReturnSize;
} SCSIWMI_REQUEST_CONTEXT, *PSCSIWMI_REQUEST_CONTEXT;

Members

UserContext

Points to a miniport driver buffer that contains any data the miniport driver requires to process the SRB. This can be a pointer to the miniport driver's HW_DEVICE_EXTENSION structure or some other buffer.

BufferSize

Reserved for system use and not available for use by miniport drivers.

Buffer
Pointer to a structure of type WNODE_XXX. For more information about these sorts of structures, see WMI WNODE_XXX Structures.
This member is set by ScsiPortWmiDispatchFunction. Miniport drivers should not assign values to this member.
MinorFunction

Reserved for system use and not available for use by miniport drivers.

ReturnStatus

Indicates the return status of the SRB. This member is not valid until after the miniport driver has called ScsiPortWmiPostProcess to update the request context.

ReturnSize

Indicates the number of bytes of data transferred for the SRB. This member is not valid until after the miniport driver has called ScsiPortWmiPostProcess to update the request context.

Remarks

When the miniport driver receives an SRB in which the Function member is set to SRB_FUNCTION_WMI, it calls ScsiPortWmiDispatchFunction with request parameters, including a pointer to a request context. ScsiPortWmiDispatchFunction passes the request context to the miniport driver's appropriate HwScsiWmiXxx routine.

When the miniport driver is done processing the SRB and prior to completing the SRB, the miniport driver should call ScsiPortWmiPostProcess to update the ReturnStatus and ReturnSize members of the request context. The miniport driver updates the SRB's data transfer length and status to these values by calling ScsiPortWmiGetReturnSize and ScsiPortWmiGetReturnStatus. respectively.

A request context must remain valid throughout the processing of an SRB. If the SRB can pend, the miniport driver must allocate the SCSIWMI_REQUEST_CONTEXT structure from the SRB extension so it remains valid until the SRB completes. For nonpending SRBs the structure can be allocated from a stack frame that does not go out of scope.

Requirements

Header

Scsiwmi.h (include Scsiwmi.h)

See also

ScsiPortWmiDispatchFunction
ScsiPortWmiGetReturnSize
ScsiPortWmiGetReturnStatus
ScsiPortWmiPostProcess

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft