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