ScsiPortWmiFireLogicalUnitEvent function (scsiwmi.h)

The ScsiPortWmiFireLogicalUnitEvent routine sends an event associated with a logical unit to the port driver for delivery to WMI data consumers that have requested notification of the event.

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 ScsiPortWmiFireLogicalUnitEvent(
  [in] PVOID  HwDeviceExtension,
  [in] UCHAR  PathId,
  [in] UCHAR  TargetId,
  [in] UCHAR  Lun,
  [in] LPGUID Guid,
  [in] ULONG  InstanceIndex,
  [in] ULONG  EventDataSize,
  [in] PVOID  EventData
);

Parameters

[in] HwDeviceExtension

Pointer to the hardware device extension. This is a per-HBA storage area that the port driver allocates and initializes on behalf of the miniport driver. Miniport drivers usually store HBA-specific information in this extension, such as the state of the HBA and the HBA's mapped access ranges. This area is available to the miniport driver in the DeviceExtension->HwDeviceExtension member of the HBA's device object immediately after the miniport driver calls ScsiPortInitialize. The port driver frees this memory when it removes the device.

[in] PathId

Identifies the SCSI bus; SP_UNTAGGED indicates all buses controlled by the HBA.

[in] TargetId

Identifies the target controller or device on the given bus(es); SP_UNTAGGED indicates all targets on the bus.

[in] Lun

Identifies the logical unit for the given target controller or device; SP_UNTAGGED indicates all logical units for the given target controller(s) on the given bus(es).

[in] Guid

Pointer to the GUID that represents the event block.

[in] InstanceIndex

If the event block has multiple instances, specifies the index of the instance.

[in] EventDataSize

Specifies the number of bytes of data at EventData, not including pad bytes at the beginning of the event data buffer. If no data is generated for an event, EventDataSize should be set to zero.

[in] EventData

Pointer to a miniport driver-allocated buffer containing data generated by the miniport driver for the event. The buffer must be at least the size of the event data plus 0x40 pad bytes at the beginning of the buffer.

Return value

None

Remarks

A miniport driver calls ScsiPortWmiFireLogicalUnitEvent to send an event associated with an adapter or logical unit to all data consumers that have requested notification of the event.

The miniport driver sends an event only if it has been previously enabled by the miniport driver's HwScsiWmiFunctionControl routine.

The driver should write event data to the buffer pointed to by EventData at offset 0x40. The first 0x40 bytes are used by SCSI WMI. If no data is passed back with the event then EventData should be 0x40 bytes in length.

Requirements

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

See also

HwScsiWmiFunctionControl