When DeviceIoControl() returns ERROR_IO_DEVICE

Hello,

I issue IO requests to storage devices using DeviceIoControl() and
IOCTL_SCSI_PASS_THROUGH_DIRECT in user mode. Typical IO requests
complete in a matter of milliseconds. For a certain customer with a
certain drive, DeviceIoControl() blocks for about 5 seconds then returns
ERROR_IO_DEVICE. My question is twofold:

  1. Is there a way for me to determine more information about the cause
    of the error? For example, what was the NT STATUS_* code that led to
    ERROR_IO_DEVICE?

  2. It’s not clear to me whether the error is hardware-related or
    driver-related. Is there a way for me to determine what drivers are
    involved in processing IO requests for a specific device?

Basic direction on where to look for answers is greatly appreciated.

Thank you,

Chuck