I've been working on creating a program to send (preferrably arbitrary) ATA commands, and so far, the only option I've found in Windows is IOCTL_ATA_PASS_THROUGH and a related struct, ATA_PASS_THROUGH_EX using C++.
Unfortunately, I've been finding the documentation to be lacking for those who don't already know what they're doing. Here's what I haven't figured out:
- How is
IOCTL_ATA_PASS_THROUGH
used in a statement? - Where do you put the ATA command to send?
ATA_PASS_THROUGH_EX.DataTransferLength
should be the size of the data buffer, in bytes. Is that the struct + the ATA command, or just the command?- How do you select which drive the command is going to?
- Where does the response from the drive go?