PVOID
ScsiPortGetLogicalUnit(
IN PVOID HwDeviceExtension,
IN UCHAR PathId,
IN UCHAR TargetId,
IN UCHAR Lun
);
ScsiPortGetLogicalUnit returns a pointer to the miniport’s per-LU storage area for a given peripheral.
ScsiPortGetLogicalUnit returns a pointer to the miniport’s storage area for the requested logical unit. If the OS-specific port driver considers this logical unit to be nonexistent, it returns NULL.
ScsiPortGetLogicalUnit is irrelevant if the miniport’s DriverEntry routine specified zero for the LuExtensionSize in the HW_INITIALIZATION_DATA when it called ScsiPortInitialize. Otherwise, the OS-specific port driver allocates and initializes with zeros a set of LU extensions of the specified size for the miniport driver to use.
Per-LU storage can be used to store data relevant to a particular peripheral, such as saved data pointers. To access this area, the miniport calls ScsiPortGetLogicalUnit when the driver is maintaining information about the state of or current operation for any particular peripheral.
The OS-specific port driver can consider a logical unit to be nonexistent if there is no active request for that logical unit and the device has never been successfully selected.
DriverEntry, HW_INITIALIZATION_DATA, ScsiPortInitialize, ScsiPortMoveMemory