HwStorWmiSetDataItem

HwStorWmiSetDataItem routine

A miniport driver's HwStorWmiSetDataItem routine is called to change a single data item in an instance of a data block.

Syntax


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
);

Parameters

DeviceContext

A pointer to the miniport driver-defined context value passed to ScsiPortWmiDispatchFunction.

RequestContext

A pointer to the SCSIWMI_REQUEST_CONTEXT structure that the miniport driver passed to ScsiPortWmiDispatchFunction.

GuidIndex

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.

InstanceIndex

If the block specified by GuidIndex has multiple instances, InstanceIndex specifies the instance.

DataItemId

Specifies the ID of the data item to set.

BufferSize

Specifies the size in bytes of the buffer at Buffer.

Buffer

A pointer to a buffer that contains the new value for the data item.

Return value

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.

Remarks

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.

Requirements

Target platform

Header

Storport.h (include Storport.h)

See also

HwScsiWmiSetDataItem
SCSI_WMILIB_CONTEXT
ScsiPortWmiDispatchFunction
ScsiPortWmiPostProcess

 

 

Send comments about this topic to Microsoft

Anzeigen:
© 2016 Microsoft