DeviceIoControl is not good, even with PASS_THROUGH. The fact is that you are still working with Windows, not with the drive directly and Windows decides what commands to let through and what not.
In fact, it lets through only non-destructive commands like SMART, IDENTIFY_DEVICE, SLEEP, STANDBY, READ_SECTOR etc.
SET_MAX_ADDRESS works, but still there are problems with it. For example, I have 200GB drive with HPA set to 100GB. Windows sees that it's under 128GB and thinks that drive works only with 28bit commands and when I send a valid 48bit command to reset HPA it just aborts it.
So, ABORT error that you see was sent to you not by the drive, but by the Windows. For some reason, Windows didn't like your command (try to play with Device register - most likely because of it).
To sum up, DeviceIoControl sucks

The best way to work directly with the drive on the register level is to use GiveIO. You will have to disable Secondary port and work with the registers as in DOS, without any interference from Windows drivers.
