// ntddscsi.h
typedef struct _SCSI_PASS_THROUGH_EX {
ULONG Version;
ULONG Length;
ULONG CdbLength;
ULONG StorAddressLength;
UCHAR ScsiStatus;
UCHAR SenseInfoLength;
UCHAR DataDirection;
UCHAR Reserved;
ULONG TimeOutValue;
ULONG StorAddressOffset;
ULONG SenseInfoOffset;
ULONG DataOutTransferLength;
ULONG DataInTransferLength;
ULONG_PTR DataOutBufferOffset;
ULONG_PTR DataInBufferOffset;
UCHAR Cdb[ANYSIZE_ARRAY];
} SCSI_PASS_THROUGH_EX, *PSCSI_PASS_THROUGH_EX;
View the official Windows Driver Kit DDI referenceNo description available.
The SCSI_PASS_THROUGH_EX structure is used in conjunction with an IOCTL_SCSI_PASS_THROUGH_EX request to instruct the port driver to send an embedded SCSI command to the target device. SCSI_PASS_THROUGH_EX can contain a bi-directional data transfers and a variable length command data block.
[!NOTE] The SCSI port driver and SCSI miniport driver models may be altered or unavailable in the future. Instead, use the Storport driver and Storport miniport driver models.
VersionThe version of this structure. Set to 0.
LengthThe size of this structure, in bytes. Set to sizeof(SCSI_PASS_THROUGH_EX).
CdbLengthThe size of the SCSI command descriptor block in Cdb, in bytes.
StorAddressLengthThe length, in bytes, of the storage device address structure at the offset of StorAddressOffset after this structure.
ScsiStatusReports the SCSI status that was returned by the HBA or the target device.
SenseInfoLengthThe size in bytes of the request-sense buffer. This member is optional and can be set to 0.
DataDirectionIndicates whether the SCSI command will read or write data. This field must be one of the following values:
| Value | Meaning |
|---|---|
| SCSI_IOCTL_DATA_OUT | Write data to the device. |
| SCSI_IOCTL_DATA_IN | Read data from the device. |
| SCSI_IOCTL_DATA_UNSPECIFIED | No data is being transferred. |
| SCSI_IOCTL_DATA_BIDIRECTIONAL | Data is valid for both input and output. |
ReservedReserved. Set to 0.
TimeOutValueIndicates the interval in seconds that the request can execute before the port driver considers it timed out. Do not set this value to 0. Default values often range from:
StorAddressOffsetThe location of the target storage device address structure, in bytes, from the beginning of this structure.
SenseInfoOffsetOffset from the beginning of this structure to the request-sense buffer. Set to 0 if no request-sense buffer is present.
DataOutTransferLengthIndicates the size in bytes of the output data buffer. Many devices transfer chunks of data of predefined length. The value in DataOutTransferLength must be an integral multiple of this predefined, minimum length that is specified by the device. If an underrun occurs, the miniport driver must update this member to the number of bytes actually transferred. If no output data buffer is present, this member is set to 0.
DataInTransferLengthIndicates the size in bytes of the input data buffer. Many devices transfer chunks of data of predefined length. The value in DataInTransferLength must be an integral multiple of this predefined, minimum length that is specified by the device. If an underrun occurs, the miniport driver must update this member to the number of bytes actually transferred. If no input data buffer is present, this member is set to 0.
DataOutBufferOffsetContains an offset from the beginning of this structure to the output data buffer. The offset must respect the data alignment requirements of the device.
DataInBufferOffsetContains an offset from the beginning of this structure to the input data buffer. The offset must respect the data alignment requirements of the device.
CdbSpecifies the SCSI command descriptor block to be sent to the target device.
The SCSI_PASS_THROUGH_EX structure is used with the IOCTL_SCSI_PASS_THROUGH_EX control code, which is a buffered device control request. To bypass buffering in system memory, callers should use IOCTL_SCSI_PASS_THROUGH_DIRECT_EX. When handling an IOCTL_SCSI_PASS_THROUGH_DIRECT_EX request, the system locks down the buffer in user memory and the device accesses this memory directly.
[!NOTE] Drivers executing on a 64-bit version of Windows must use the SCSI_PASS_THROUGH32_EX structure as the request data type when handling an IOCTL_SCSI_PASS_THROUGH_EX request from a 32-bit process.