They are located in the ntddscsi.h file found in c: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Include \ (on a 64-bit system). They are ignored as:
#define IOCTL_ATA_PASS_THROUGH CTL_CODE(IOCTL_SCSI_BASE, 0x040b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
and IOCTL_SCSI_BASE is
#define IOCTL_SCSI_BASE FILE_DEVICE_CONTROLLER
from the same file
and from WinIoCtl.h
#define METHOD_BUFFERED 0 #define FILE_DEVICE_CONTROLLER 0x00000004 #define FILE_READ_ACCESS ( 0x0001 )
and CTL_CODE comes from WinIoCtl.h found in c: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Include \
#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)
so your final value for IOCTL_ATA_PASS_THROUGH will be:
(4 << 16 | (1 | 2) << 14 | 0x040b << 2 | 0) = 315436 = 4D02C
: D
And if you apply these calculations to other IO _.... macros, you will find the values. On the other hand, it is much easier to write a short application to print their values as hex;)
source share