A miniport driver's HwStorWmiQueryDataBlock routine is called to obtain either a single instance or all instances of a data block.
UCHAR HwStorWmiQueryDataBlock( IN PVOID Context, IN PSCSIWMI_REQUEST_CONTEXT DispatchContext, IN ULONG GuidIndex, IN ULONG InstanceIndex, IN ULONG InstanceCount, IN OUT PULONG InstanceLengthArray, IN ULONG BufferAvail, OUT PUCHAR Buffer );
A pointer to the miniport driver-defined context value passed to ScsiPortWmiDispatchFunction.
A pointer to the SCSIWMI_REQUEST_CONTEXT structure that the miniport driver passed to ScsiPortWmiDispatchFunction.
Specifies the data block by its index into the list of GUIDs in the SCSI_WMILIB_CONTEXT structure that the miniport driver passed to ScsiPortWmiDispatchFunction.
If HwStorWmiQueryDataBlock is called in response to an IRP_MN_QUERY_SINGLE_INSTANCE request, InstanceIndex specifies the instance to be queried. If HwScsiWmiQueryDataBlock is called in response to an IRP_MN_QUERY_ALL_DATA REQUEST, InstanceIndex is zero.
If HwStorWmiQueryDataBlock is called in response to an IRP_MN_QUERY_SINGLE_INSTANCE request, InstanceCount is 1. If HwStorWmiQueryDataBlock is called in response to an IRP_MN_QUERY_ALL_DATA REQUEST, InstanceCount is the number of instances to be returned.
A pointer to an array of ULONGs that indicate the length of each instance of the data block to be returned. This array has InstanceCount elements. This value may be NULL when there is not enough space in the output buffer to fulfill the request.
Specifies the maximum number of bytes available to receive data in the buffer at Buffer.
A pointer to the buffer to receive instance data. If the buffer is large enough to receive all of the data, the miniport driver writes instance data to the buffer with each instance aligned on an 8-byte boundary. If the buffer is too small to receive all of the data, the miniport driver calls ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN and sets BufferUsed to the size of the output buffer needed to fulfill the request.
HwStorWmiQueryDataBlock returns SRB_STATUS_PENDING if the request is pending, or a nonzero SRB status value if the request was completed. The SRB status value returned by this routine is the same as what was passed in to ScsiPortWmiPostProcess.
This routine is identical in both definition and function to its SCSI port equivalent, HwScsiWmiQueryDataBlock.
When a miniport driver receives an SRB in which the Function member is set to SRB_FUNCTION_WMI, it calls ScsiPortWmiDispatchFunction with a pointer to an initialized SCSI_WMILIB_CONTEXT structure and MinorFunction set to Srb->WmiSubFunction. The SCSI port driver calls the miniport driver's HwStorWmiQueryDataBlock routine if MinorFunction indicates a request to obtain a single instance or all instances of a data block.
The miniport driver writes instance data to the buffer. For requests that do not pend, the miniport driver calls ScsiPortWmiPostProcess with an appropriate SrbStatus value before returning from HwStorWmiQueryDataBlock. If the request pends, the miniport driver calls ScsiPortWmiPostProcess when the request is complete.
Build date: 11/16/2013