DIO Control Code Needed
Does any one have the constant value of IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER for use with the dll impo开发者_如何学Crt in a C# class? I was told the constants are in WinIoCtl.h, but they are nowhere to be found.
If someone could provide it, it would be appreciated greatly.
From WinIoCtl.h that comes with Windows SDK v5.0:
#define CTL_CODE( DeviceType, Function, Method, Access ) ( \
((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
)
#define METHOD_BUFFERED 0
#define FILE_ANY_ACCESS 0
#define FILE_DEVICE_MASS_STORAGE 0x0000002d
#define IOCTL_STORAGE_BASE FILE_DEVICE_MASS_STORAGE
#define IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)
So it's 2952208 or 0x2d0c10.
精彩评论