Macro to define IOCTL codes.
#define FILE_DEVICE_DISK 0x00000007 #define FILE_DEVICE_HAL 0x00000101 #define METHOD_BUFFERED 0 #define FILE_ANY_ACCESS 0 #define CTL_CODE( DeviceType, Function, Method, Access ) (((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method))
You can find a sample in the SourceCode examples.