ScsiPortWmiPostProcess function (scsiwmi.h)

The ScsiPortWmiPostProcess routine updates a request context for a WMI SRB.

Note  The SCSI port driver and SCSI miniport driver models may be altered or unavailable in the future. Instead, we recommend using the Storport driver and Storport miniport driver models.
 

Syntax

void ScsiPortWmiPostProcess(
  [in] PSCSIWMI_REQUEST_CONTEXT RequestContext,
  [in] UCHAR                    SrbStatus,
  [in] ULONG                    BufferUsed
);

Parameters

[in] RequestContext

A pointer to the request context for this SRB.

[in] SrbStatus

Specifies any valid SRB status. If the output buffer passed to the miniport driver was too small to contain all of the data from a request, the miniport driver sets SrbStatus to SRB_STATUS_DATA_OVERRUN.

[in] BufferUsed

If SrbStatus indicates success, the miniport driver sets BufferUsed to the number of bytes of data written to the buffer. If SrbStatus is SRB_STATUS_DATA_OVERRUN, the miniport driver sets BufferUsed to the number of bytes required to complete the SRB successfully.

Return value

None

Remarks

A miniport driver must call ScsiPortWmiPostProcess after the WMI SRB request has been processed and is ready to be completed.

For synchronous SRBs, ScsiPortWmiPostProcess is called in the callback routine.

For pending SRBs, ScsiPortWmiPostProcess is called after the SRB has been processed, and before it is completed.

If a miniport driver sets SrbStatus to SRB_STATUS_DATA_OVERRUN and sets BufferUsed, successive identical WMI SRBs with an allocated buffer equal to or greater than BufferUsed bytes should succeed. This should be achieved if the driver sets the exact value for BufferUsed that is needed to complete the request when calling ScsiPortWmiPostProcess with SrbStatus equal to SRB_STATUS_DATA_OVERRUN. For a variable-sized output structure, the input data buffer of the SRB should have enough information to determine the exact BufferUsed value. If the input data buffer does not contain enough information, the driver should never fail the same SRB two times with SRB_STATUS_DATA_OVERRUN. Instead, the driver should set SRB_STATUS_DATA_OVERRUN and request the minimum size necessary for the output buffer first, and then set SRB_STATUS_SUCCESS and indicate the failure in the contents of the output buffer.

Requirements

Requirement Value
Target Platform Desktop
Header scsiwmi.h (include Miniport.h, Scsi.h)

See also

SCSIWMI_REQUEST_CONTEXT

ScsiPortWmiDispatchFunction

ScsiPortWmiGetReturnSize

ScsiPortWmiGetReturnStatus