HwStorWmiSetDataBlock routine

A miniport driver's HwStorWmiSetDataBlock routine is called to change all data items in a single instance of a data block.


UCHAR HwStorWmiSetDataBlock(
   IN PVOID                    DeviceContext,
   IN ULONG                    GuidIndex,
   IN ULONG                    InstanceIndex,
   IN ULONG                    BufferSize,
   IN 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 the block specified by GuidIndex has multiple instances, InstanceIndex specifies the instance.


Specifies the size in bytes of the buffer at Buffer.


A pointer to a buffer that contains new values for the instance.

Return value

HwStorWmiSetDataBlock 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, HwScsiWmiSetDataBlock.

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 HwStorWmiSetDataBlock routine if MinorFunction indicates a request to change an instance of a data block.

If a miniport driver does not implement a HwStorWmiSetDataBlock routine, it must set SetWmiDataBlock to NULL in the SCSI_WMILIB_CONTEXT the miniport driver passes to ScsiPortWmiDispatchFunction. In this case, the port driver returns SRB_STATUS_ERROR to the caller.

If the miniport driver implements HwStorWmiSetDataBlock it should change the instance of the data block to the new values from the buffer.

If all of the items in the data block are read-only, the miniport driver should return SRB_STATUS_ERROR. Otherwise, the miniport driver changes the items it can and returns SRB_STATUS_SUCCESS.

The miniport driver should call ScsiPortWmiPostProcess with an appropriate SrbStatus value when the request is completed. If the request does not pend, ScsiPortWmiPostProcess should be called in the HwStorWmiSetDataBlock callback. Otherwise, ScsiPortWmiPostProcess should be called when the request is actually completed.


Target platform



Storport.h (include Storport.h)

See also




Send comments about this topic to Microsoft