A miniport driver's HwStorWmiSetDataItem routine is called to change a single data item in an instance of a data block.
UCHAR HwStorWmiSetDataItem( IN PVOID DeviceContext, IN PSCSIWMI_REQUEST_CONTEXT RequestContext, IN ULONG GuidIndex, IN ULONG InstanceIndex, IN ULONG DataItemId, 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 ID of the data item to set.
Specifies the size in bytes of the buffer at Buffer.
A pointer to a buffer that contains the new value for the data item.
HwStorWmiSetDataItem 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, HwScsiWmiSetDataItem.
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 HwStorWmiSetDataItem routine if MinorFunction indicates a request to change an item in an instance of a data block.
If a miniport driver does not implement a HwStorWmiSetDataItem routine, it must set SetWmiDataItem to NULL in the SCSI_WMILIB_CONTEXT the miniport driver passes to ScsiPortWmiDispatchFunction. In this circumstance, the port driver will return SRB_STATUS_ERROR to the caller.
If the request does not pend, the miniport driver should call ScsiPortWmiPostProcess in its HwStorWmiSetDataItem callback. Otherwise, the miniport driver should call ScsiPortWmiPostProcess when the request is actually completed. The miniport driver should call ScsiPortWmiPostProcess with the appropriate SrbStatus value.
If the item is read-only, the miniport driver calls ScsiPortWmiPostProcess with SRB_STATUS_ERROR. Otherwise, the miniport driver changes the item and calls ScsiPortWmiPostProcess with SRB_STATUS_SUCCESS.