DeviceIoControl for SCSI INQUIRY command returns error 50
问题 I am trying to access a USB scanner through the IOCTL commands. This is on Windows 7. I did not deal with IOCTL coding before, so I first tried the following snippet based on what I could find with a quick search. #include "stdafx.h" #include <stddef.h> #include <Windows.h> #include <ntddscsi.h> #include <usbscan.h> typedef struct { SCSI_PASS_THROUGH spt; BYTE sense[18]; BYTE data[36]; } SPTSD; LPTSTR ErrorMessage(DWORD error) { LPTSTR errorText = NULL; FormatMessage( FORMAT_MESSAGE_FROM