// ntddscsi.h
typedef struct _SCSI_PASS_THROUGH {
USHORT Length;
UCHAR ScsiStatus;
UCHAR PathId;
UCHAR TargetId;
UCHAR Lun;
UCHAR CdbLength;
UCHAR SenseInfoLength;
UCHAR DataIn;
ULONG DataTransferLength;
ULONG TimeOutValue;
ULONG_PTR DataBufferOffset;
ULONG SenseInfoOffset;
UCHAR Cdb[16];
} SCSI_PASS_THROUGH, *PSCSI_PASS_THROUGH;
View the official Windows Driver Kit DDI referenceNo description available.
The SCSI_PASS_THROUGH structure is used in conjunction with an IOCTL_SCSI_PASS_THROUGH request to instruct the port driver to send an embedded SCSI command to the target device.
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.
The SCSI_PASS_THROUGH structure is used in conjunction with an IOCTL_SCSI_PASS_THROUGH request to instruct the port driver to send an embedded SCSI command to the target device.
LengthContains the value of sizeof(SCSI_PASS_THROUGH).
ScsiStatusReports the SCSI status that was returned by the HBA or the target device.
PathIdIndicates the SCSI port or bus for the request.
TargetIdIndicates the target controller or device on the bus.
LunIndicates the logical unit number of the device.
CdbLengthIndicates the size in bytes of the SCSI command descriptor block.
SenseInfoLengthIndicates the size in bytes of the request-sense buffer.
DataInIndicates whether the SCSI command will read or write data. This field must have one of three values:
| Value | Meaning |
|---|---|
| SCSI_IOCTL_DATA_OUT (0) | Write data to the device |
| SCSI_IOCTL_DATA_IN (1) | Read data from the device |
| SCSI_IOCTL_DATA_UNSPECIFIED (2) | No data transfer or transfer direction is unknown |
DataTransferLengthIndicates the size in bytes of the data buffer. Many devices transfer chunks of data of predefined length. The value in DataTransferLength 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.
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:
DataBufferOffsetContains an offset from the beginning of this structure to the data buffer. The offset must respect the data alignment requirements of the device.
SenseInfoOffsetOffset from the beginning of this structure to the request-sense buffer.
CdbSpecifies the SCSI command descriptor block to be sent to the target device.
The SCSI_PASS_THROUGH structure is used with IOCTL_SCSI_PASS_THROUGH, which is a buffered device control request. To bypass buffering in system memory, callers should use IOCTL_SCSI_PASS_THROUGH_DIRECT. When handling an IOCTL_SCSI_PASS_THROUGH_DIRECT request, the system locks down the buffer in user memory and the device accesses this memory directly.
The members of SCSI_PASS_THROUGH correspond roughly to the members of a SCSI_REQUEST_BLOCK structure. The values of the DataIn member correspond to the SCSI_IOCTL_DATA_IN, SCSI_IOCTL_DATA_OUT, and SCSI_IOCTL_DATA_UNSPECIFIED flags assigned to SrbFlags member of SCSI_REQUEST_BLOCK.
IOCTL_SCSI_PASS_THROUGH_DIRECT