1

Ive been trying to send raw ATA commands via WdfIoTargetSendIoctlSynchronously using the ATA_PASS_THROUGH_EX32 structure and IOCTL_ATA_PASS_THROUGH IoControlCode. What I've noticed is any commands other than IOCTL_DISK_GET_DRIVE_GEOMETRY seems to fail from inside a KMDF driver for me.

I've build a standard 32bit executable and can use IOCTL_ATA_PASS_THROUGH perfectly fine. The driver doesn't get any errors other than STATUS_INVALID_PARAMETER from the NTStatus return value of WdfIoTargetSendIoctlSynchronously.

Does anyone have any ideas?

Steps Taken:

  • WdfIoTargetCreate
  • WdfIoTargetOpen
  • WdfRequestCreate
  • WdfMemoryCreate -> WDF_MEMORY_DESCRIPTOR_INIT_BUFFER -> ATA_PASS_THROUGH_EX32
  • WdfMemoryCreate -> WDF_MEMORY_DESCRIPTOR_INIT_BUFFER -> OutputBuffer
  • WdfIoTargetSendIoctlSynchronously
  • Have you tried using IOCTL_SCSI_PASS_THROUGH? I know IOCTL_ATA_PASS_THROUGH works fine on the application level, but on the driver level they only check for IOCTL_SCSI_PASS_THROUGH. I believe that IOCTL_ATA_PASS_THROUGH gets converted to IOCTL_SCSI_PASS_THROUGH in the application level for backwards compatibility. – tchau.dev Oct 27 '15 at 22:01
  • Turns out the issue is down to the fact that any device specific IOCTL within WDF is blocked. unless it is for USB/FireWire at present. restored to using DriverCall() instead. – Mathew Evans Nov 12 '15 at 20:58

0 Answers0