SCSI pass through commands
I'm trying to communicate with a USB Mass Storage device using the SCSI command set. I have control over the behavior of the device because I'm able to modify the firmware and hence add vendor specific commands to handle new SCSI commands. I'm trying to send IOCTL_SCSI_PASS_THROUGH/IOCTL_SCSI_PASS_THROUGH_DIRECT commands to the device with DeviceIOControl() with a data payload, and have the device send back an success/fail packet back, but I'm unsure of how to do this.
The SCSI_PASS_THROUGH_DIRECT structure has a DataIn member variable that specifies the direction of data transfer. Since I wish to transfer a data payload to the device, this should be a SCSI_IOCTL_DATA_OUT. However, since I also wish to receive a success/fail message back from the device, it has to be SCSI_IOCTL_DATA_IN as well.
Short of sending 2 commands(a write followed by a read), is there a way of doing this in just 1 DeviceIOControl() call?
TIA

