IOCTL_SCSI_GET_INQUIRY_DATA control code
Returns the SCSI inquiry data for all devices on a given SCSI host bus adapter (HBA). If the IOCTL is employed in user space, the program must have opened a handle to the HBA, which can be enumerated by various means, such as SetupDixxx calls. You can use IOCTL_STORAGE_QUERY_PROPERTY to find information about a specific device on the HBA. To determine the size of the output buffer that is required, the caller should send this IOCTL request in a loop. Every time that the storage stack rejects the IOCTL with an error message that indicates that the buffer was too small, the caller should double the buffer size.
Parameters.DeviceIoControl.OutputBufferLength indicates the size, in bytes, of the buffer, which must be >= (sizeof(SCSI_ADAPTER_BUS_INFO) + (NumberOfBuses) * sizeof(SCSI_BUS_DATA)) + (InquiryDataSize * NumberOfLUs), where the InquiryDataSize is (sizeof(SCSI_INQUIRY_DATA) - 1 + INQUIRYDATABUFFERSIZE) rounded up to an alignment boundary.
The buffer at Irp->AssociatedIrp.SystemBuffer contains the returned inquiry data. For a description of the layout of the inquiry data in the output buffer, see SCSI_ADAPTER_BUS_INFO.
The Information field contains the number of bytes returned in the output buffer. The Status field indicates the results of the operation.