I need to know the IOCTL constants for the various strings (for example the value of the constant of IOCTL_ATA_PASS_THROUGH). Searching the net I found that those constants are defined in the header Ntddscsi.h but those constant are wrong. For example the constant value of IOCTL_ATA_PASS_THROUGH should be 4D02C while in the header file it is 40B
The question is: where can I find a list with ALL the right values?
Thanks
EDIT:
I’ve found http://www.ioctls.net/ where there are listed all the codes. Thanks anyway for the explanation of why the value in Ntddscsi.h is not the “final” value
They are in ntddscsi.h found at c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\ (on a 64 bit system). They are defied as:
and
IOCTL_SCSI_BASEisfrom the same file
and these from WinIoCtl.h
and
CTL_CODEcomes from WinIoCtl.h found at c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include\)
so your final value for IOCTL_ATA_PASS_THROUGH will be:
😀
And if you will apply these calculations to the other IO_…. macros you will find the values. On the other end it’s much easier to write a short application just to print out their values as hex 😉