// ntddscsi.h
// CTL_CODE(0x0004, 0x411, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_SCSI_PASS_THROUGH_EX 0x0004D044
View the official Windows Driver Kit DDI referenceNo description available.
The IOCTL_SCSI_PASS_THROUGH_EX control code request is the extended version of the IOCTL_SCSI_PASS_THROUGH request. This request provides support for bidirectional data transfers and allows a command data block (CDB) > 16 bytes.
Allows an application to send almost any SCSI command to a target device, with the following restrictions:
The calling application creates the SCSI command descriptor block, which can include a request for request-sense data if a CHECK CONDITION occurs.
IOCTL_SCSI_PASS_THROUGH_EX 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.
This request is typically used for transferring small amounts of data (<16K).
Applications can send this request by means of an IRP_MJ_DEVICE_CONTROL request.
Storage class drivers set the minor IRP number to IRP_MN_SCSI_CLASS to indicate that the request has been processed by a storage class driver.
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.
This structure includes a SCSI CDB, which must be initialized by the caller except for the path, target ID, and logical unit number (LUN), which are filled in by the port driver. For a data-out command, the data to be transferred is included in the buffer at Irp->AssociatedIrp.SystemBuffer at DataInBufferOffset in the SCSI_PASS_THROUGH_EX structure. However, the caller must allocate additional storage, immediately following SCSI_PASS_THROUGH_EX, if the caller asks for request-sense data.
Parameters.DeviceIoControl.InputBufferLength indicates the size, in bytes, of the buffer at Irp->AssociatedIrp.SystemBuffer, which must be at least (sense data size + sizeof(SCSI_PASS_THROUGH_EX)). The size of the SCSI_PASS_THROUGH_EX structure varies, depending on the value specified in DataInTransferLength .
The port driver returns any request-sense data and any data transferred from the device to the buffer at Irp->AssociatedIrp.SystemBuffer. The SenseInfoLength and DataOutTransferLength in the SCSI_PASS_THROUGH_EX structure are updated to indicate the amount of data transferred.
The SenseInfoLength and DataOutTransferLength in the SCSI_PASS_THROUGH_EX structure are updated to indicate the amount of data transferred.
The Information field is set to the number of bytes returned in the output buffer at Irp->AssociatedIrp.SystemBuffer. The Status field is set to STATUS_SUCCESS, or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_INVALID_PARAMETER if the input Length value in SCSI_PASS_THROUGH_EX is improperly set.
In order to issue an IOCTL_SCSI_PASS_THROUGH_EX request, the underlying storage device must support extended SRBs. This means that the supported SRB type is SRB_TYPE_STORAGE_REQUEST_BLOCK. An application can query for SRB support with the IOCTL_STORAGE_QUERY_PROPERTY request with a query type of PropertyStandardQuery and a property type of StorageDeviceProperty. The SrbType member returned in the STORAGE_ADAPTER_DESCRIPTOR structure will indicate either SRB_TYPE_SCSI_REQUEST_BLOCK or SRB_TYPE_STORAGE_REQUEST_BLOCK.