winioctlcon.py 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711
  1. ## flags, enums, guids used with DeviceIoControl from WinIoCtl.h
  2. import pywintypes
  3. from ntsecuritycon import FILE_READ_DATA,FILE_WRITE_DATA
  4. def CTL_CODE(DeviceType, Function, Method, Access):
  5. return (DeviceType << 16) | (Access << 14) | (Function << 2) | Method
  6. def DEVICE_TYPE_FROM_CTL_CODE(ctrlCode):
  7. return (ctrlCode & 0xffff0000) >> 16
  8. FILE_DEVICE_BEEP = 0x00000001
  9. FILE_DEVICE_CD_ROM = 0x00000002
  10. FILE_DEVICE_CD_ROM_FILE_SYSTEM = 0x00000003
  11. FILE_DEVICE_CONTROLLER = 0x00000004
  12. FILE_DEVICE_DATALINK = 0x00000005
  13. FILE_DEVICE_DFS = 0x00000006
  14. FILE_DEVICE_DISK = 0x00000007
  15. FILE_DEVICE_DISK_FILE_SYSTEM = 0x00000008
  16. FILE_DEVICE_FILE_SYSTEM = 0x00000009
  17. FILE_DEVICE_INPORT_PORT = 0x0000000a
  18. FILE_DEVICE_KEYBOARD = 0x0000000b
  19. FILE_DEVICE_MAILSLOT = 0x0000000c
  20. FILE_DEVICE_MIDI_IN = 0x0000000d
  21. FILE_DEVICE_MIDI_OUT = 0x0000000e
  22. FILE_DEVICE_MOUSE = 0x0000000f
  23. FILE_DEVICE_MULTI_UNC_PROVIDER = 0x00000010
  24. FILE_DEVICE_NAMED_PIPE = 0x00000011
  25. FILE_DEVICE_NETWORK = 0x00000012
  26. FILE_DEVICE_NETWORK_BROWSER = 0x00000013
  27. FILE_DEVICE_NETWORK_FILE_SYSTEM = 0x00000014
  28. FILE_DEVICE_NULL = 0x00000015
  29. FILE_DEVICE_PARALLEL_PORT = 0x00000016
  30. FILE_DEVICE_PHYSICAL_NETCARD = 0x00000017
  31. FILE_DEVICE_PRINTER = 0x00000018
  32. FILE_DEVICE_SCANNER = 0x00000019
  33. FILE_DEVICE_SERIAL_MOUSE_PORT = 0x0000001a
  34. FILE_DEVICE_SERIAL_PORT = 0x0000001b
  35. FILE_DEVICE_SCREEN = 0x0000001c
  36. FILE_DEVICE_SOUND = 0x0000001d
  37. FILE_DEVICE_STREAMS = 0x0000001e
  38. FILE_DEVICE_TAPE = 0x0000001f
  39. FILE_DEVICE_TAPE_FILE_SYSTEM = 0x00000020
  40. FILE_DEVICE_TRANSPORT = 0x00000021
  41. FILE_DEVICE_UNKNOWN = 0x00000022
  42. FILE_DEVICE_VIDEO = 0x00000023
  43. FILE_DEVICE_VIRTUAL_DISK = 0x00000024
  44. FILE_DEVICE_WAVE_IN = 0x00000025
  45. FILE_DEVICE_WAVE_OUT = 0x00000026
  46. FILE_DEVICE_8042_PORT = 0x00000027
  47. FILE_DEVICE_NETWORK_REDIRECTOR = 0x00000028
  48. FILE_DEVICE_BATTERY = 0x00000029
  49. FILE_DEVICE_BUS_EXTENDER = 0x0000002a
  50. FILE_DEVICE_MODEM = 0x0000002b
  51. FILE_DEVICE_VDM = 0x0000002c
  52. FILE_DEVICE_MASS_STORAGE = 0x0000002d
  53. FILE_DEVICE_SMB = 0x0000002e
  54. FILE_DEVICE_KS = 0x0000002f
  55. FILE_DEVICE_CHANGER = 0x00000030
  56. FILE_DEVICE_SMARTCARD = 0x00000031
  57. FILE_DEVICE_ACPI = 0x00000032
  58. FILE_DEVICE_DVD = 0x00000033
  59. FILE_DEVICE_FULLSCREEN_VIDEO = 0x00000034
  60. FILE_DEVICE_DFS_FILE_SYSTEM = 0x00000035
  61. FILE_DEVICE_DFS_VOLUME = 0x00000036
  62. FILE_DEVICE_SERENUM = 0x00000037
  63. FILE_DEVICE_TERMSRV = 0x00000038
  64. FILE_DEVICE_KSEC = 0x00000039
  65. FILE_DEVICE_FIPS = 0x0000003A
  66. FILE_DEVICE_INFINIBAND = 0x0000003B
  67. METHOD_BUFFERED = 0
  68. METHOD_IN_DIRECT = 1
  69. METHOD_OUT_DIRECT = 2
  70. METHOD_NEITHER = 3
  71. METHOD_DIRECT_TO_HARDWARE = METHOD_IN_DIRECT
  72. METHOD_DIRECT_FROM_HARDWARE = METHOD_OUT_DIRECT
  73. FILE_ANY_ACCESS = 0
  74. FILE_SPECIAL_ACCESS = FILE_ANY_ACCESS
  75. FILE_READ_ACCESS = 0x0001
  76. FILE_WRITE_ACCESS = 0x0002
  77. IOCTL_STORAGE_BASE = FILE_DEVICE_MASS_STORAGE
  78. RECOVERED_WRITES_VALID = 0x00000001
  79. UNRECOVERED_WRITES_VALID = 0x00000002
  80. RECOVERED_READS_VALID = 0x00000004
  81. UNRECOVERED_READS_VALID = 0x00000008
  82. WRITE_COMPRESSION_INFO_VALID = 0x00000010
  83. READ_COMPRESSION_INFO_VALID = 0x00000020
  84. TAPE_RETURN_STATISTICS = 0
  85. TAPE_RETURN_ENV_INFO = 1
  86. TAPE_RESET_STATISTICS = 2
  87. MEDIA_ERASEABLE = 0x00000001
  88. MEDIA_WRITE_ONCE = 0x00000002
  89. MEDIA_READ_ONLY = 0x00000004
  90. MEDIA_READ_WRITE = 0x00000008
  91. MEDIA_WRITE_PROTECTED = 0x00000100
  92. MEDIA_CURRENTLY_MOUNTED = 0x80000000
  93. IOCTL_DISK_BASE = FILE_DEVICE_DISK
  94. PARTITION_ENTRY_UNUSED = 0x00
  95. PARTITION_FAT_12 = 0x01
  96. PARTITION_XENIX_1 = 0x02
  97. PARTITION_XENIX_2 = 0x03
  98. PARTITION_FAT_16 = 0x04
  99. PARTITION_EXTENDED = 0x05
  100. PARTITION_HUGE = 0x06
  101. PARTITION_IFS = 0x07
  102. PARTITION_OS2BOOTMGR = 0x0A
  103. PARTITION_FAT32 = 0x0B
  104. PARTITION_FAT32_XINT13 = 0x0C
  105. PARTITION_XINT13 = 0x0E
  106. PARTITION_XINT13_EXTENDED = 0x0F
  107. PARTITION_PREP = 0x41
  108. PARTITION_LDM = 0x42
  109. PARTITION_UNIX = 0x63
  110. VALID_NTFT = 0xC0
  111. PARTITION_NTFT = 0x80
  112. GPT_ATTRIBUTE_PLATFORM_REQUIRED = 0x0000000000000001
  113. GPT_BASIC_DATA_ATTRIBUTE_NO_DRIVE_LETTER = 0x8000000000000000
  114. GPT_BASIC_DATA_ATTRIBUTE_HIDDEN = 0x4000000000000000
  115. GPT_BASIC_DATA_ATTRIBUTE_SHADOW_COPY = 0x2000000000000000
  116. GPT_BASIC_DATA_ATTRIBUTE_READ_ONLY = 0x1000000000000000
  117. HIST_NO_OF_BUCKETS = 24
  118. DISK_LOGGING_START = 0
  119. DISK_LOGGING_STOP = 1
  120. DISK_LOGGING_DUMP = 2
  121. DISK_BINNING = 3
  122. CAP_ATA_ID_CMD = 1
  123. CAP_ATAPI_ID_CMD = 2
  124. CAP_SMART_CMD = 4
  125. ATAPI_ID_CMD = 0xA1
  126. ID_CMD = 0xEC
  127. SMART_CMD = 0xB0
  128. SMART_CYL_LOW = 0x4F
  129. SMART_CYL_HI = 0xC2
  130. SMART_NO_ERROR = 0
  131. SMART_IDE_ERROR = 1
  132. SMART_INVALID_FLAG = 2
  133. SMART_INVALID_COMMAND = 3
  134. SMART_INVALID_BUFFER = 4
  135. SMART_INVALID_DRIVE = 5
  136. SMART_INVALID_IOCTL = 6
  137. SMART_ERROR_NO_MEM = 7
  138. SMART_INVALID_REGISTER = 8
  139. SMART_NOT_SUPPORTED = 9
  140. SMART_NO_IDE_DEVICE = 10
  141. SMART_OFFLINE_ROUTINE_OFFLINE = 0
  142. SMART_SHORT_SELFTEST_OFFLINE = 1
  143. SMART_EXTENDED_SELFTEST_OFFLINE = 2
  144. SMART_ABORT_OFFLINE_SELFTEST = 127
  145. SMART_SHORT_SELFTEST_CAPTIVE = 129
  146. SMART_EXTENDED_SELFTEST_CAPTIVE = 130
  147. READ_ATTRIBUTE_BUFFER_SIZE = 512
  148. IDENTIFY_BUFFER_SIZE = 512
  149. READ_THRESHOLD_BUFFER_SIZE = 512
  150. SMART_LOG_SECTOR_SIZE = 512
  151. READ_ATTRIBUTES = 0xD0
  152. READ_THRESHOLDS = 0xD1
  153. ENABLE_DISABLE_AUTOSAVE = 0xD2
  154. SAVE_ATTRIBUTE_VALUES = 0xD3
  155. EXECUTE_OFFLINE_DIAGS = 0xD4
  156. SMART_READ_LOG = 0xD5
  157. SMART_WRITE_LOG = 0xd6
  158. ENABLE_SMART = 0xD8
  159. DISABLE_SMART = 0xD9
  160. RETURN_SMART_STATUS = 0xDA
  161. ENABLE_DISABLE_AUTO_OFFLINE = 0xDB
  162. IOCTL_CHANGER_BASE = FILE_DEVICE_CHANGER
  163. MAX_VOLUME_ID_SIZE = 36
  164. MAX_VOLUME_TEMPLATE_SIZE = 40
  165. VENDOR_ID_LENGTH = 8
  166. PRODUCT_ID_LENGTH = 16
  167. REVISION_LENGTH = 4
  168. SERIAL_NUMBER_LENGTH = 32
  169. CHANGER_BAR_CODE_SCANNER_INSTALLED = 0x00000001
  170. CHANGER_INIT_ELEM_STAT_WITH_RANGE = 0x00000002
  171. CHANGER_CLOSE_IEPORT = 0x00000004
  172. CHANGER_OPEN_IEPORT = 0x00000008
  173. CHANGER_STATUS_NON_VOLATILE = 0x00000010
  174. CHANGER_EXCHANGE_MEDIA = 0x00000020
  175. CHANGER_CLEANER_SLOT = 0x00000040
  176. CHANGER_LOCK_UNLOCK = 0x00000080
  177. CHANGER_CARTRIDGE_MAGAZINE = 0x00000100
  178. CHANGER_MEDIUM_FLIP = 0x00000200
  179. CHANGER_POSITION_TO_ELEMENT = 0x00000400
  180. CHANGER_REPORT_IEPORT_STATE = 0x00000800
  181. CHANGER_STORAGE_DRIVE = 0x00001000
  182. CHANGER_STORAGE_IEPORT = 0x00002000
  183. CHANGER_STORAGE_SLOT = 0x00004000
  184. CHANGER_STORAGE_TRANSPORT = 0x00008000
  185. CHANGER_DRIVE_CLEANING_REQUIRED = 0x00010000
  186. CHANGER_PREDISMOUNT_EJECT_REQUIRED = 0x00020000
  187. CHANGER_CLEANER_ACCESS_NOT_VALID = 0x00040000
  188. CHANGER_PREMOUNT_EJECT_REQUIRED = 0x00080000
  189. CHANGER_VOLUME_IDENTIFICATION = 0x00100000
  190. CHANGER_VOLUME_SEARCH = 0x00200000
  191. CHANGER_VOLUME_ASSERT = 0x00400000
  192. CHANGER_VOLUME_REPLACE = 0x00800000
  193. CHANGER_VOLUME_UNDEFINE = 0x01000000
  194. CHANGER_SERIAL_NUMBER_VALID = 0x04000000
  195. CHANGER_DEVICE_REINITIALIZE_CAPABLE = 0x08000000
  196. CHANGER_KEYPAD_ENABLE_DISABLE = 0x10000000
  197. CHANGER_DRIVE_EMPTY_ON_DOOR_ACCESS = 0x20000000
  198. CHANGER_RESERVED_BIT = 0x80000000
  199. CHANGER_PREDISMOUNT_ALIGN_TO_SLOT = 0x80000001
  200. CHANGER_PREDISMOUNT_ALIGN_TO_DRIVE = 0x80000002
  201. CHANGER_CLEANER_AUTODISMOUNT = 0x80000004
  202. CHANGER_TRUE_EXCHANGE_CAPABLE = 0x80000008
  203. CHANGER_SLOTS_USE_TRAYS = 0x80000010
  204. CHANGER_RTN_MEDIA_TO_ORIGINAL_ADDR = 0x80000020
  205. CHANGER_CLEANER_OPS_NOT_SUPPORTED = 0x80000040
  206. CHANGER_IEPORT_USER_CONTROL_OPEN = 0x80000080
  207. CHANGER_IEPORT_USER_CONTROL_CLOSE = 0x80000100
  208. CHANGER_MOVE_EXTENDS_IEPORT = 0x80000200
  209. CHANGER_MOVE_RETRACTS_IEPORT = 0x80000400
  210. CHANGER_TO_TRANSPORT = 0x01
  211. CHANGER_TO_SLOT = 0x02
  212. CHANGER_TO_IEPORT = 0x04
  213. CHANGER_TO_DRIVE = 0x08
  214. LOCK_UNLOCK_IEPORT = 0x01
  215. LOCK_UNLOCK_DOOR = 0x02
  216. LOCK_UNLOCK_KEYPAD = 0x04
  217. LOCK_ELEMENT = 0
  218. UNLOCK_ELEMENT = 1
  219. EXTEND_IEPORT = 2
  220. RETRACT_IEPORT = 3
  221. ELEMENT_STATUS_FULL = 0x00000001
  222. ELEMENT_STATUS_IMPEXP = 0x00000002
  223. ELEMENT_STATUS_EXCEPT = 0x00000004
  224. ELEMENT_STATUS_ACCESS = 0x00000008
  225. ELEMENT_STATUS_EXENAB = 0x00000010
  226. ELEMENT_STATUS_INENAB = 0x00000020
  227. ELEMENT_STATUS_PRODUCT_DATA = 0x00000040
  228. ELEMENT_STATUS_LUN_VALID = 0x00001000
  229. ELEMENT_STATUS_ID_VALID = 0x00002000
  230. ELEMENT_STATUS_NOT_BUS = 0x00008000
  231. ELEMENT_STATUS_INVERT = 0x00400000
  232. ELEMENT_STATUS_SVALID = 0x00800000
  233. ELEMENT_STATUS_PVOLTAG = 0x10000000
  234. ELEMENT_STATUS_AVOLTAG = 0x20000000
  235. ERROR_LABEL_UNREADABLE = 0x00000001
  236. ERROR_LABEL_QUESTIONABLE = 0x00000002
  237. ERROR_SLOT_NOT_PRESENT = 0x00000004
  238. ERROR_DRIVE_NOT_INSTALLED = 0x00000008
  239. ERROR_TRAY_MALFUNCTION = 0x00000010
  240. ERROR_INIT_STATUS_NEEDED = 0x00000011
  241. ERROR_UNHANDLED_ERROR = 0xFFFFFFFF
  242. SEARCH_ALL = 0x0
  243. SEARCH_PRIMARY = 0x1
  244. SEARCH_ALTERNATE = 0x2
  245. SEARCH_ALL_NO_SEQ = 0x4
  246. SEARCH_PRI_NO_SEQ = 0x5
  247. SEARCH_ALT_NO_SEQ = 0x6
  248. ASSERT_PRIMARY = 0x8
  249. ASSERT_ALTERNATE = 0x9
  250. REPLACE_PRIMARY = 0xA
  251. REPLACE_ALTERNATE = 0xB
  252. UNDEFINE_PRIMARY = 0xC
  253. UNDEFINE_ALTERNATE = 0xD
  254. USN_PAGE_SIZE = 0x1000
  255. USN_REASON_DATA_OVERWRITE = 0x00000001
  256. USN_REASON_DATA_EXTEND = 0x00000002
  257. USN_REASON_DATA_TRUNCATION = 0x00000004
  258. USN_REASON_NAMED_DATA_OVERWRITE = 0x00000010
  259. USN_REASON_NAMED_DATA_EXTEND = 0x00000020
  260. USN_REASON_NAMED_DATA_TRUNCATION = 0x00000040
  261. USN_REASON_FILE_CREATE = 0x00000100
  262. USN_REASON_FILE_DELETE = 0x00000200
  263. USN_REASON_EA_CHANGE = 0x00000400
  264. USN_REASON_SECURITY_CHANGE = 0x00000800
  265. USN_REASON_RENAME_OLD_NAME = 0x00001000
  266. USN_REASON_RENAME_NEW_NAME = 0x00002000
  267. USN_REASON_INDEXABLE_CHANGE = 0x00004000
  268. USN_REASON_BASIC_INFO_CHANGE = 0x00008000
  269. USN_REASON_HARD_LINK_CHANGE = 0x00010000
  270. USN_REASON_COMPRESSION_CHANGE = 0x00020000
  271. USN_REASON_ENCRYPTION_CHANGE = 0x00040000
  272. USN_REASON_OBJECT_ID_CHANGE = 0x00080000
  273. USN_REASON_REPARSE_POINT_CHANGE = 0x00100000
  274. USN_REASON_STREAM_CHANGE = 0x00200000
  275. USN_REASON_TRANSACTED_CHANGE = 0x00400000
  276. USN_REASON_CLOSE = 0x80000000
  277. USN_DELETE_FLAG_DELETE = 0x00000001
  278. USN_DELETE_FLAG_NOTIFY = 0x00000002
  279. USN_DELETE_VALID_FLAGS = 0x00000003
  280. USN_SOURCE_DATA_MANAGEMENT = 0x00000001
  281. USN_SOURCE_AUXILIARY_DATA = 0x00000002
  282. USN_SOURCE_REPLICATION_MANAGEMENT = 0x00000004
  283. MARK_HANDLE_PROTECT_CLUSTERS = 1
  284. MARK_HANDLE_TXF_SYSTEM_LOG = 4
  285. MARK_HANDLE_NOT_TXF_SYSTEM_LOG = 8
  286. VOLUME_IS_DIRTY = 0x00000001
  287. VOLUME_UPGRADE_SCHEDULED = 0x00000002
  288. VOLUME_SESSION_OPEN = 4
  289. FILE_PREFETCH_TYPE_FOR_CREATE = 1
  290. FILE_PREFETCH_TYPE_FOR_DIRENUM = 2
  291. FILE_PREFETCH_TYPE_FOR_CREATE_EX = 3
  292. FILE_PREFETCH_TYPE_FOR_DIRENUM_EX = 4
  293. FILE_PREFETCH_TYPE_MAX = 4
  294. FILESYSTEM_STATISTICS_TYPE_NTFS = 1
  295. FILESYSTEM_STATISTICS_TYPE_FAT = 2
  296. FILE_SET_ENCRYPTION = 0x00000001
  297. FILE_CLEAR_ENCRYPTION = 0x00000002
  298. STREAM_SET_ENCRYPTION = 0x00000003
  299. STREAM_CLEAR_ENCRYPTION = 0x00000004
  300. MAXIMUM_ENCRYPTION_VALUE = 0x00000004
  301. ENCRYPTION_FORMAT_DEFAULT = 0x01
  302. COMPRESSION_FORMAT_SPARSE = 0x4000
  303. COPYFILE_SIS_LINK = 0x0001
  304. COPYFILE_SIS_REPLACE = 0x0002
  305. COPYFILE_SIS_FLAGS = 0x0003
  306. WMI_DISK_GEOMETRY_GUID = pywintypes.IID("{25007F51-57C2-11D1-A528-00A0C9062910}")
  307. GUID_DEVINTERFACE_CDROM = pywintypes.IID("{53F56308-B6BF-11D0-94F2-00A0C91EFB8B}")
  308. GUID_DEVINTERFACE_FLOPPY = pywintypes.IID("{53F56311-B6BF-11D0-94F2-00A0C91EFB8B}")
  309. GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR = pywintypes.IID("{4D36E978-E325-11CE-BFC1-08002BE10318}")
  310. GUID_DEVINTERFACE_COMPORT = pywintypes.IID("{86E0D1E0-8089-11D0-9CE4-08003E301F73}")
  311. GUID_DEVINTERFACE_DISK = pywintypes.IID("{53F56307-B6BF-11D0-94F2-00A0C91EFB8B}")
  312. GUID_DEVINTERFACE_STORAGEPORT = pywintypes.IID("{2ACCFE60-C130-11D2-B082-00A0C91EFB8B}")
  313. GUID_DEVINTERFACE_CDCHANGER = pywintypes.IID("{53F56312-B6BF-11D0-94F2-00A0C91EFB8B}")
  314. GUID_DEVINTERFACE_PARTITION = pywintypes.IID("{53F5630A-B6BF-11D0-94F2-00A0C91EFB8B}")
  315. GUID_DEVINTERFACE_VOLUME = pywintypes.IID("{53F5630D-B6BF-11D0-94F2-00A0C91EFB8B}")
  316. GUID_DEVINTERFACE_WRITEONCEDISK = pywintypes.IID("{53F5630C-B6BF-11D0-94F2-00A0C91EFB8B}")
  317. GUID_DEVINTERFACE_TAPE = pywintypes.IID("{53F5630B-B6BF-11D0-94F2-00A0C91EFB8B}")
  318. GUID_DEVINTERFACE_MEDIUMCHANGER = pywintypes.IID("{53F56310-B6BF-11D0-94F2-00A0C91EFB8B}")
  319. GUID_SERENUM_BUS_ENUMERATOR = GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR
  320. GUID_CLASS_COMPORT = GUID_DEVINTERFACE_COMPORT
  321. DiskClassGuid = GUID_DEVINTERFACE_DISK
  322. CdRomClassGuid = GUID_DEVINTERFACE_CDROM
  323. PartitionClassGuid = GUID_DEVINTERFACE_PARTITION
  324. TapeClassGuid = GUID_DEVINTERFACE_TAPE
  325. WriteOnceDiskClassGuid = GUID_DEVINTERFACE_WRITEONCEDISK
  326. VolumeClassGuid = GUID_DEVINTERFACE_VOLUME
  327. MediumChangerClassGuid = GUID_DEVINTERFACE_MEDIUMCHANGER
  328. FloppyClassGuid = GUID_DEVINTERFACE_FLOPPY
  329. CdChangerClassGuid = GUID_DEVINTERFACE_CDCHANGER
  330. StoragePortClassGuid = GUID_DEVINTERFACE_STORAGEPORT
  331. IOCTL_STORAGE_CHECK_VERIFY = CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
  332. IOCTL_STORAGE_CHECK_VERIFY2 = CTL_CODE(IOCTL_STORAGE_BASE, 0x0200, METHOD_BUFFERED, FILE_ANY_ACCESS)
  333. IOCTL_STORAGE_MEDIA_REMOVAL = CTL_CODE(IOCTL_STORAGE_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
  334. IOCTL_STORAGE_EJECT_MEDIA = CTL_CODE(IOCTL_STORAGE_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
  335. IOCTL_STORAGE_LOAD_MEDIA = CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
  336. IOCTL_STORAGE_LOAD_MEDIA2 = CTL_CODE(IOCTL_STORAGE_BASE, 0x0203, METHOD_BUFFERED, FILE_ANY_ACCESS)
  337. IOCTL_STORAGE_RESERVE = CTL_CODE(IOCTL_STORAGE_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
  338. IOCTL_STORAGE_RELEASE = CTL_CODE(IOCTL_STORAGE_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
  339. IOCTL_STORAGE_FIND_NEW_DEVICES = CTL_CODE(IOCTL_STORAGE_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
  340. IOCTL_STORAGE_EJECTION_CONTROL = CTL_CODE(IOCTL_STORAGE_BASE, 0x0250, METHOD_BUFFERED, FILE_ANY_ACCESS)
  341. IOCTL_STORAGE_MCN_CONTROL = CTL_CODE(IOCTL_STORAGE_BASE, 0x0251, METHOD_BUFFERED, FILE_ANY_ACCESS)
  342. IOCTL_STORAGE_GET_MEDIA_TYPES = CTL_CODE(IOCTL_STORAGE_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
  343. IOCTL_STORAGE_GET_MEDIA_TYPES_EX = CTL_CODE(IOCTL_STORAGE_BASE, 0x0301, METHOD_BUFFERED, FILE_ANY_ACCESS)
  344. IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER = CTL_CODE(IOCTL_STORAGE_BASE, 0x0304, METHOD_BUFFERED, FILE_ANY_ACCESS)
  345. IOCTL_STORAGE_GET_HOTPLUG_INFO = CTL_CODE(IOCTL_STORAGE_BASE, 0x0305, METHOD_BUFFERED, FILE_ANY_ACCESS)
  346. IOCTL_STORAGE_SET_HOTPLUG_INFO = CTL_CODE(IOCTL_STORAGE_BASE, 0x0306, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  347. IOCTL_STORAGE_RESET_BUS = CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS)
  348. IOCTL_STORAGE_RESET_DEVICE = CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS)
  349. IOCTL_STORAGE_BREAK_RESERVATION = CTL_CODE(IOCTL_STORAGE_BASE, 0x0405, METHOD_BUFFERED, FILE_READ_ACCESS)
  350. IOCTL_STORAGE_GET_DEVICE_NUMBER = CTL_CODE(IOCTL_STORAGE_BASE, 0x0420, METHOD_BUFFERED, FILE_ANY_ACCESS)
  351. IOCTL_STORAGE_PREDICT_FAILURE = CTL_CODE(IOCTL_STORAGE_BASE, 0x0440, METHOD_BUFFERED, FILE_ANY_ACCESS)
  352. IOCTL_DISK_GET_DRIVE_GEOMETRY = CTL_CODE(IOCTL_DISK_BASE, 0x0000, METHOD_BUFFERED, FILE_ANY_ACCESS)
  353. IOCTL_DISK_GET_PARTITION_INFO = CTL_CODE(IOCTL_DISK_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
  354. IOCTL_DISK_SET_PARTITION_INFO = CTL_CODE(IOCTL_DISK_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  355. IOCTL_DISK_GET_DRIVE_LAYOUT = CTL_CODE(IOCTL_DISK_BASE, 0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
  356. IOCTL_DISK_SET_DRIVE_LAYOUT = CTL_CODE(IOCTL_DISK_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  357. IOCTL_DISK_VERIFY = CTL_CODE(IOCTL_DISK_BASE, 0x0005, METHOD_BUFFERED, FILE_ANY_ACCESS)
  358. IOCTL_DISK_FORMAT_TRACKS = CTL_CODE(IOCTL_DISK_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  359. IOCTL_DISK_REASSIGN_BLOCKS = CTL_CODE(IOCTL_DISK_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  360. IOCTL_DISK_PERFORMANCE = CTL_CODE(IOCTL_DISK_BASE, 0x0008, METHOD_BUFFERED, FILE_ANY_ACCESS)
  361. IOCTL_DISK_IS_WRITABLE = CTL_CODE(IOCTL_DISK_BASE, 0x0009, METHOD_BUFFERED, FILE_ANY_ACCESS)
  362. IOCTL_DISK_LOGGING = CTL_CODE(IOCTL_DISK_BASE, 0x000a, METHOD_BUFFERED, FILE_ANY_ACCESS)
  363. IOCTL_DISK_FORMAT_TRACKS_EX = CTL_CODE(IOCTL_DISK_BASE, 0x000b, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  364. IOCTL_DISK_HISTOGRAM_STRUCTURE = CTL_CODE(IOCTL_DISK_BASE, 0x000c, METHOD_BUFFERED, FILE_ANY_ACCESS)
  365. IOCTL_DISK_HISTOGRAM_DATA = CTL_CODE(IOCTL_DISK_BASE, 0x000d, METHOD_BUFFERED, FILE_ANY_ACCESS)
  366. IOCTL_DISK_HISTOGRAM_RESET = CTL_CODE(IOCTL_DISK_BASE, 0x000e, METHOD_BUFFERED, FILE_ANY_ACCESS)
  367. IOCTL_DISK_REQUEST_STRUCTURE = CTL_CODE(IOCTL_DISK_BASE, 0x000f, METHOD_BUFFERED, FILE_ANY_ACCESS)
  368. IOCTL_DISK_REQUEST_DATA = CTL_CODE(IOCTL_DISK_BASE, 0x0010, METHOD_BUFFERED, FILE_ANY_ACCESS)
  369. IOCTL_DISK_PERFORMANCE_OFF = CTL_CODE(IOCTL_DISK_BASE, 0x0018, METHOD_BUFFERED, FILE_ANY_ACCESS)
  370. IOCTL_DISK_CONTROLLER_NUMBER = CTL_CODE(IOCTL_DISK_BASE, 0x0011, METHOD_BUFFERED, FILE_ANY_ACCESS)
  371. SMART_GET_VERSION = CTL_CODE(IOCTL_DISK_BASE, 0x0020, METHOD_BUFFERED, FILE_READ_ACCESS)
  372. SMART_SEND_DRIVE_COMMAND = CTL_CODE(IOCTL_DISK_BASE, 0x0021, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  373. SMART_RCV_DRIVE_DATA = CTL_CODE(IOCTL_DISK_BASE, 0x0022, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  374. IOCTL_DISK_GET_PARTITION_INFO_EX = CTL_CODE(IOCTL_DISK_BASE, 0x0012, METHOD_BUFFERED, FILE_ANY_ACCESS)
  375. IOCTL_DISK_SET_PARTITION_INFO_EX = CTL_CODE(IOCTL_DISK_BASE, 0x0013, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  376. IOCTL_DISK_GET_DRIVE_LAYOUT_EX = CTL_CODE(IOCTL_DISK_BASE, 0x0014, METHOD_BUFFERED, FILE_ANY_ACCESS)
  377. IOCTL_DISK_SET_DRIVE_LAYOUT_EX = CTL_CODE(IOCTL_DISK_BASE, 0x0015, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  378. IOCTL_DISK_CREATE_DISK = CTL_CODE(IOCTL_DISK_BASE, 0x0016, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  379. IOCTL_DISK_GET_LENGTH_INFO = CTL_CODE(IOCTL_DISK_BASE, 0x0017, METHOD_BUFFERED, FILE_READ_ACCESS)
  380. IOCTL_DISK_GET_DRIVE_GEOMETRY_EX = CTL_CODE(IOCTL_DISK_BASE, 0x0028, METHOD_BUFFERED, FILE_ANY_ACCESS)
  381. IOCTL_DISK_REASSIGN_BLOCKS_EX = CTL_CODE(IOCTL_DISK_BASE, 0x0029, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  382. IOCTL_DISK_UPDATE_DRIVE_SIZE = CTL_CODE(IOCTL_DISK_BASE, 0x0032, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  383. IOCTL_DISK_GROW_PARTITION = CTL_CODE(IOCTL_DISK_BASE, 0x0034, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  384. IOCTL_DISK_GET_CACHE_INFORMATION = CTL_CODE(IOCTL_DISK_BASE, 0x0035, METHOD_BUFFERED, FILE_READ_ACCESS)
  385. IOCTL_DISK_SET_CACHE_INFORMATION = CTL_CODE(IOCTL_DISK_BASE, 0x0036, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  386. OBSOLETE_IOCTL_STORAGE_RESET_BUS = CTL_CODE(IOCTL_STORAGE_BASE, 0x0400, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  387. OBSOLETE_IOCTL_STORAGE_RESET_DEVICE = CTL_CODE(IOCTL_STORAGE_BASE, 0x0401, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  388. ## the original define no longer exists in winioctl.h
  389. OBSOLETE_DISK_GET_WRITE_CACHE_STATE = CTL_CODE(IOCTL_DISK_BASE, 0x0037, METHOD_BUFFERED, FILE_READ_ACCESS)
  390. IOCTL_DISK_GET_WRITE_CACHE_STATE=OBSOLETE_DISK_GET_WRITE_CACHE_STATE
  391. IOCTL_DISK_DELETE_DRIVE_LAYOUT = CTL_CODE(IOCTL_DISK_BASE, 0x0040, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  392. IOCTL_DISK_UPDATE_PROPERTIES = CTL_CODE(IOCTL_DISK_BASE, 0x0050, METHOD_BUFFERED, FILE_ANY_ACCESS)
  393. IOCTL_DISK_FORMAT_DRIVE = CTL_CODE(IOCTL_DISK_BASE, 0x00f3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  394. IOCTL_DISK_SENSE_DEVICE = CTL_CODE(IOCTL_DISK_BASE, 0x00f8, METHOD_BUFFERED, FILE_ANY_ACCESS)
  395. IOCTL_DISK_CHECK_VERIFY = CTL_CODE(IOCTL_DISK_BASE, 0x0200, METHOD_BUFFERED, FILE_READ_ACCESS)
  396. IOCTL_DISK_MEDIA_REMOVAL = CTL_CODE(IOCTL_DISK_BASE, 0x0201, METHOD_BUFFERED, FILE_READ_ACCESS)
  397. IOCTL_DISK_EJECT_MEDIA = CTL_CODE(IOCTL_DISK_BASE, 0x0202, METHOD_BUFFERED, FILE_READ_ACCESS)
  398. IOCTL_DISK_LOAD_MEDIA = CTL_CODE(IOCTL_DISK_BASE, 0x0203, METHOD_BUFFERED, FILE_READ_ACCESS)
  399. IOCTL_DISK_RESERVE = CTL_CODE(IOCTL_DISK_BASE, 0x0204, METHOD_BUFFERED, FILE_READ_ACCESS)
  400. IOCTL_DISK_RELEASE = CTL_CODE(IOCTL_DISK_BASE, 0x0205, METHOD_BUFFERED, FILE_READ_ACCESS)
  401. IOCTL_DISK_FIND_NEW_DEVICES = CTL_CODE(IOCTL_DISK_BASE, 0x0206, METHOD_BUFFERED, FILE_READ_ACCESS)
  402. IOCTL_DISK_GET_MEDIA_TYPES = CTL_CODE(IOCTL_DISK_BASE, 0x0300, METHOD_BUFFERED, FILE_ANY_ACCESS)
  403. DISK_HISTOGRAM_SIZE = 72
  404. HISTOGRAM_BUCKET_SIZE = 8
  405. IOCTL_CHANGER_GET_PARAMETERS = CTL_CODE(IOCTL_CHANGER_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS)
  406. IOCTL_CHANGER_GET_STATUS = CTL_CODE(IOCTL_CHANGER_BASE, 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
  407. IOCTL_CHANGER_GET_PRODUCT_DATA = CTL_CODE(IOCTL_CHANGER_BASE, 0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
  408. IOCTL_CHANGER_SET_ACCESS = CTL_CODE(IOCTL_CHANGER_BASE, 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  409. IOCTL_CHANGER_GET_ELEMENT_STATUS = CTL_CODE(IOCTL_CHANGER_BASE, 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  410. IOCTL_CHANGER_INITIALIZE_ELEMENT_STATUS = CTL_CODE(IOCTL_CHANGER_BASE, 0x0006, METHOD_BUFFERED, FILE_READ_ACCESS)
  411. IOCTL_CHANGER_SET_POSITION = CTL_CODE(IOCTL_CHANGER_BASE, 0x0007, METHOD_BUFFERED, FILE_READ_ACCESS)
  412. IOCTL_CHANGER_EXCHANGE_MEDIUM = CTL_CODE(IOCTL_CHANGER_BASE, 0x0008, METHOD_BUFFERED, FILE_READ_ACCESS)
  413. IOCTL_CHANGER_MOVE_MEDIUM = CTL_CODE(IOCTL_CHANGER_BASE, 0x0009, METHOD_BUFFERED, FILE_READ_ACCESS)
  414. IOCTL_CHANGER_REINITIALIZE_TRANSPORT = CTL_CODE(IOCTL_CHANGER_BASE, 0x000A, METHOD_BUFFERED, FILE_READ_ACCESS)
  415. IOCTL_CHANGER_QUERY_VOLUME_TAGS = CTL_CODE(IOCTL_CHANGER_BASE, 0x000B, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  416. IOCTL_SERIAL_LSRMST_INSERT = CTL_CODE(FILE_DEVICE_SERIAL_PORT,31,METHOD_BUFFERED,FILE_ANY_ACCESS)
  417. IOCTL_SERENUM_EXPOSE_HARDWARE = CTL_CODE(FILE_DEVICE_SERENUM,128,METHOD_BUFFERED,FILE_ANY_ACCESS)
  418. IOCTL_SERENUM_REMOVE_HARDWARE = CTL_CODE(FILE_DEVICE_SERENUM,129,METHOD_BUFFERED,FILE_ANY_ACCESS)
  419. IOCTL_SERENUM_PORT_DESC = CTL_CODE(FILE_DEVICE_SERENUM,130,METHOD_BUFFERED,FILE_ANY_ACCESS)
  420. IOCTL_SERENUM_GET_PORT_NAME = CTL_CODE(FILE_DEVICE_SERENUM,131,METHOD_BUFFERED,FILE_ANY_ACCESS)
  421. ## ??? can't find where FILE_DEVICE_AVIO is defined ???
  422. ## IOCTL_AVIO_ALLOCATE_STREAM = CTL_CODE(FILE_DEVICE_AVIO, 1, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  423. ## IOCTL_AVIO_FREE_STREAM = CTL_CODE(FILE_DEVICE_AVIO, 2, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  424. ## IOCTL_AVIO_MODIFY_STREAM = CTL_CODE(FILE_DEVICE_AVIO, 3, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  425. SERIAL_LSRMST_ESCAPE = 0x00
  426. SERIAL_LSRMST_LSR_DATA = 0x01
  427. SERIAL_LSRMST_LSR_NODATA = 0x02
  428. SERIAL_LSRMST_MST = 0x03
  429. SERIAL_IOC_FCR_FIFO_ENABLE = 0x00000001
  430. SERIAL_IOC_FCR_RCVR_RESET = 0x00000002
  431. SERIAL_IOC_FCR_XMIT_RESET = 0x00000004
  432. SERIAL_IOC_FCR_DMA_MODE = 0x00000008
  433. SERIAL_IOC_FCR_RES1 = 0x00000010
  434. SERIAL_IOC_FCR_RES2 = 0x00000020
  435. SERIAL_IOC_FCR_RCVR_TRIGGER_LSB = 0x00000040
  436. SERIAL_IOC_FCR_RCVR_TRIGGER_MSB = 0x00000080
  437. SERIAL_IOC_MCR_DTR = 0x00000001
  438. SERIAL_IOC_MCR_RTS = 0x00000002
  439. SERIAL_IOC_MCR_OUT1 = 0x00000004
  440. SERIAL_IOC_MCR_OUT2 = 0x00000008
  441. SERIAL_IOC_MCR_LOOP = 0x00000010
  442. FSCTL_REQUEST_OPLOCK_LEVEL_1 = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
  443. FSCTL_REQUEST_OPLOCK_LEVEL_2 = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
  444. FSCTL_REQUEST_BATCH_OPLOCK = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
  445. FSCTL_OPLOCK_BREAK_ACKNOWLEDGE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
  446. FSCTL_OPBATCH_ACK_CLOSE_PENDING = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
  447. FSCTL_OPLOCK_BREAK_NOTIFY = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
  448. FSCTL_LOCK_VOLUME = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
  449. FSCTL_UNLOCK_VOLUME = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
  450. FSCTL_DISMOUNT_VOLUME = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
  451. FSCTL_IS_VOLUME_MOUNTED = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
  452. FSCTL_IS_PATHNAME_VALID = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS)
  453. FSCTL_MARK_VOLUME_DIRTY = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
  454. FSCTL_QUERY_RETRIEVAL_POINTERS = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS)
  455. FSCTL_GET_COMPRESSION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
  456. FSCTL_SET_COMPRESSION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
  457. FSCTL_MARK_AS_SYSTEM_HIVE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS)
  458. FSCTL_OPLOCK_BREAK_ACK_NO_2 = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
  459. FSCTL_INVALIDATE_VOLUMES = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
  460. FSCTL_QUERY_FAT_BPB = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS)
  461. FSCTL_REQUEST_FILTER_OPLOCK = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
  462. FSCTL_FILESYSTEM_GET_STATISTICS = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS)
  463. FSCTL_GET_NTFS_VOLUME_DATA = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
  464. FSCTL_GET_NTFS_FILE_RECORD = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
  465. FSCTL_GET_VOLUME_BITMAP = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS)
  466. FSCTL_GET_RETRIEVAL_POINTERS = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS)
  467. FSCTL_MOVE_FILE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  468. FSCTL_IS_VOLUME_DIRTY = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
  469. FSCTL_ALLOW_EXTENDED_DASD_IO = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS)
  470. FSCTL_FIND_FILES_BY_SID = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS)
  471. FSCTL_SET_OBJECT_ID = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  472. FSCTL_GET_OBJECT_ID = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS)
  473. FSCTL_DELETE_OBJECT_ID = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  474. FSCTL_SET_REPARSE_POINT = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  475. FSCTL_GET_REPARSE_POINT = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS)
  476. FSCTL_DELETE_REPARSE_POINT = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  477. FSCTL_ENUM_USN_DATA = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_ANY_ACCESS)
  478. FSCTL_SECURITY_ID_CHECK = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA)
  479. FSCTL_READ_USN_JOURNAL = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_ANY_ACCESS)
  480. FSCTL_SET_OBJECT_ID_EXTENDED = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  481. FSCTL_CREATE_OR_GET_OBJECT_ID = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS)
  482. FSCTL_SET_SPARSE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  483. FSCTL_SET_ZERO_DATA = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA)
  484. FSCTL_QUERY_ALLOCATED_RANGES = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA)
  485. FSCTL_SET_ENCRYPTION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_NEITHER, FILE_ANY_ACCESS)
  486. FSCTL_ENCRYPTION_FSCTL_IO = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS)
  487. FSCTL_WRITE_RAW_ENCRYPTED = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_SPECIAL_ACCESS)
  488. FSCTL_READ_RAW_ENCRYPTED = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_SPECIAL_ACCESS)
  489. FSCTL_CREATE_USN_JOURNAL = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_ANY_ACCESS)
  490. FSCTL_READ_FILE_USN_DATA = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_ANY_ACCESS)
  491. FSCTL_WRITE_USN_CLOSE_RECORD = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_ANY_ACCESS)
  492. FSCTL_EXTEND_VOLUME = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS)
  493. FSCTL_QUERY_USN_JOURNAL = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS)
  494. FSCTL_DELETE_USN_JOURNAL = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS)
  495. FSCTL_MARK_HANDLE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS)
  496. FSCTL_SIS_COPYFILE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS)
  497. FSCTL_SIS_LINK_FILES = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
  498. FSCTL_HSM_MSG = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 66, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
  499. FSCTL_HSM_DATA = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 68, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA)
  500. FSCTL_RECALL_FILE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS)
  501. FSCTL_READ_FROM_PLEX = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA)
  502. FSCTL_FILE_PREFETCH = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  503. FSCTL_MAKE_MEDIA_COMPATIBLE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 76, METHOD_BUFFERED, FILE_WRITE_DATA)
  504. FSCTL_SET_DEFECT_MANAGEMENT = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 77, METHOD_BUFFERED, FILE_WRITE_DATA)
  505. FSCTL_QUERY_SPARING_INFO = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 78, METHOD_BUFFERED, FILE_ANY_ACCESS)
  506. FSCTL_QUERY_ON_DISK_VOLUME_INFO = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 79, METHOD_BUFFERED, FILE_ANY_ACCESS)
  507. FSCTL_SET_VOLUME_COMPRESSION_STATE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 80, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  508. FSCTL_TXFS_MODIFY_RM = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 81, METHOD_BUFFERED, FILE_WRITE_DATA)
  509. FSCTL_TXFS_QUERY_RM_INFORMATION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 82, METHOD_BUFFERED, FILE_READ_DATA)
  510. FSCTL_TXFS_ROLLFORWARD_REDO = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 84, METHOD_BUFFERED, FILE_WRITE_DATA)
  511. FSCTL_TXFS_ROLLFORWARD_UNDO = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 85, METHOD_BUFFERED, FILE_WRITE_DATA)
  512. FSCTL_TXFS_START_RM = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 86, METHOD_BUFFERED, FILE_WRITE_DATA)
  513. FSCTL_TXFS_SHUTDOWN_RM = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 87, METHOD_BUFFERED, FILE_WRITE_DATA)
  514. FSCTL_TXFS_READ_BACKUP_INFORMATION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 88, METHOD_BUFFERED, FILE_READ_DATA)
  515. FSCTL_TXFS_WRITE_BACKUP_INFORMATION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 89, METHOD_BUFFERED, FILE_WRITE_DATA)
  516. FSCTL_TXFS_CREATE_SECONDARY_RM = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 90, METHOD_BUFFERED, FILE_WRITE_DATA)
  517. FSCTL_TXFS_GET_METADATA_INFO = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 91, METHOD_BUFFERED, FILE_READ_DATA)
  518. FSCTL_TXFS_GET_TRANSACTED_VERSION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 92, METHOD_BUFFERED, FILE_READ_DATA)
  519. FSCTL_TXFS_CREATE_MINIVERSION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 95, METHOD_BUFFERED, FILE_WRITE_DATA)
  520. FSCTL_TXFS_TRANSACTION_ACTIVE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 99, METHOD_BUFFERED, FILE_READ_DATA)
  521. FSCTL_SET_ZERO_ON_DEALLOCATION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 101, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  522. FSCTL_SET_REPAIR = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 102, METHOD_BUFFERED, FILE_ANY_ACCESS)
  523. FSCTL_GET_REPAIR = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 103, METHOD_BUFFERED, FILE_ANY_ACCESS)
  524. FSCTL_WAIT_FOR_REPAIR = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 104, METHOD_BUFFERED, FILE_ANY_ACCESS)
  525. FSCTL_INITIATE_REPAIR = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 106, METHOD_BUFFERED, FILE_ANY_ACCESS)
  526. FSCTL_CSC_INTERNAL = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 107, METHOD_NEITHER, FILE_ANY_ACCESS)
  527. FSCTL_SHRINK_VOLUME = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 108, METHOD_BUFFERED, FILE_SPECIAL_ACCESS)
  528. FSCTL_SET_SHORT_NAME_BEHAVIOR = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 109, METHOD_BUFFERED, FILE_ANY_ACCESS)
  529. FSCTL_DFSR_SET_GHOST_HANDLE_STATE = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 110, METHOD_BUFFERED, FILE_ANY_ACCESS)
  530. FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_READ_DATA)
  531. FSCTL_TXFS_LIST_TRANSACTIONS = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 121, METHOD_BUFFERED, FILE_READ_DATA)
  532. FSCTL_QUERY_PAGEFILE_ENCRYPTION = CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 122, METHOD_BUFFERED, FILE_ANY_ACCESS)
  533. IOCTL_VOLUME_BASE = ord('V')
  534. IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS = CTL_CODE(IOCTL_VOLUME_BASE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
  535. IOCTL_VOLUME_ONLINE = CTL_CODE(IOCTL_VOLUME_BASE, 2, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  536. IOCTL_VOLUME_OFFLINE = CTL_CODE(IOCTL_VOLUME_BASE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  537. IOCTL_VOLUME_IS_CLUSTERED = CTL_CODE(IOCTL_VOLUME_BASE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
  538. IOCTL_VOLUME_GET_GPT_ATTRIBUTES = CTL_CODE(IOCTL_VOLUME_BASE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS)
  539. ## enums
  540. ## STORAGE_MEDIA_TYPE
  541. DDS_4mm = 32
  542. MiniQic = 33
  543. Travan = 34
  544. QIC = 35
  545. MP_8mm = 36
  546. AME_8mm = 37
  547. AIT1_8mm = 38
  548. DLT = 39
  549. NCTP = 40
  550. IBM_3480 = 41
  551. IBM_3490E = 42
  552. IBM_Magstar_3590 = 43
  553. IBM_Magstar_MP = 44
  554. STK_DATA_D3 = 45
  555. SONY_DTF = 46
  556. DV_6mm = 47
  557. DMI = 48
  558. SONY_D2 = 49
  559. CLEANER_CARTRIDGE = 50
  560. CD_ROM = 51
  561. CD_R = 52
  562. CD_RW = 53
  563. DVD_ROM = 54
  564. DVD_R = 55
  565. DVD_RW = 56
  566. MO_3_RW = 57
  567. MO_5_WO = 58
  568. MO_5_RW = 59
  569. MO_5_LIMDOW = 60
  570. PC_5_WO = 61
  571. PC_5_RW = 62
  572. PD_5_RW = 63
  573. ABL_5_WO = 64
  574. PINNACLE_APEX_5_RW = 65
  575. SONY_12_WO = 66
  576. PHILIPS_12_WO = 67
  577. HITACHI_12_WO = 68
  578. CYGNET_12_WO = 69
  579. KODAK_14_WO = 70
  580. MO_NFR_525 = 71
  581. NIKON_12_RW = 72
  582. IOMEGA_ZIP = 73
  583. IOMEGA_JAZ = 74
  584. SYQUEST_EZ135 = 75
  585. SYQUEST_EZFLYER = 76
  586. SYQUEST_SYJET = 77
  587. AVATAR_F2 = 78
  588. MP2_8mm = 79
  589. DST_S = 80
  590. DST_M = 81
  591. DST_L = 82
  592. VXATape_1 = 83
  593. VXATape_2 = 84
  594. STK_9840 = 85
  595. LTO_Ultrium = 86
  596. LTO_Accelis = 87
  597. DVD_RAM = 88
  598. AIT_8mm = 89
  599. ADR_1 = 90
  600. ADR_2 = 91
  601. STK_9940 = 92
  602. ## STORAGE_BUS_TYPE
  603. BusTypeUnknown = 0
  604. BusTypeScsi = 1
  605. BusTypeAtapi = 2
  606. BusTypeAta = 3
  607. BusType1394 = 4
  608. BusTypeSsa = 5
  609. BusTypeFibre = 6
  610. BusTypeUsb = 7
  611. BusTypeRAID = 8
  612. BusTypeiScsi = 9
  613. BusTypeSas = 10
  614. BusTypeSata = 11
  615. BusTypeMaxReserved = 127
  616. ## MEDIA_TYPE
  617. Unknown = 0
  618. F5_1Pt2_512 = 1
  619. F3_1Pt44_512 = 2
  620. F3_2Pt88_512 = 3
  621. F3_20Pt8_512 = 4
  622. F3_720_512 = 5
  623. F5_360_512 = 6
  624. F5_320_512 = 7
  625. F5_320_1024 = 8
  626. F5_180_512 = 9
  627. F5_160_512 = 10
  628. RemovableMedia = 11
  629. FixedMedia = 12
  630. F3_120M_512 = 13
  631. F3_640_512 = 14
  632. F5_640_512 = 15
  633. F5_720_512 = 16
  634. F3_1Pt2_512 = 17
  635. F3_1Pt23_1024 = 18
  636. F5_1Pt23_1024 = 19
  637. F3_128Mb_512 = 20
  638. F3_230Mb_512 = 21
  639. F8_256_128 = 22
  640. F3_200Mb_512 = 23
  641. F3_240M_512 = 24
  642. F3_32M_512 = 25
  643. ## PARTITION_STYLE
  644. PARTITION_STYLE_MBR = 0
  645. PARTITION_STYLE_GPT = 1
  646. PARTITION_STYLE_RAW = 2
  647. ## DETECTION_TYPE
  648. DetectNone = 0
  649. DetectInt13 = 1
  650. DetectExInt13 = 2
  651. ## DISK_CACHE_RETENTION_PRIORITY
  652. EqualPriority = 0
  653. KeepPrefetchedData = 1
  654. KeepReadData = 2
  655. ## DISK_WRITE_CACHE_STATE - ?????? this enum has disappeared from winioctl.h in windows 2003 SP1 sdk ??????
  656. DiskWriteCacheNormal = 0
  657. DiskWriteCacheForceDisable = 1
  658. DiskWriteCacheDisableNotSupported = 2
  659. ## BIN_TYPES
  660. RequestSize = 0
  661. RequestLocation = 1
  662. ## CHANGER_DEVICE_PROBLEM_TYPE
  663. DeviceProblemNone = 0
  664. DeviceProblemHardware = 1
  665. DeviceProblemCHMError = 2
  666. DeviceProblemDoorOpen = 3
  667. DeviceProblemCalibrationError = 4
  668. DeviceProblemTargetFailure = 5
  669. DeviceProblemCHMMoveError = 6
  670. DeviceProblemCHMZeroError = 7
  671. DeviceProblemCartridgeInsertError = 8
  672. DeviceProblemPositionError = 9
  673. DeviceProblemSensorError = 10
  674. DeviceProblemCartridgeEjectError = 11
  675. DeviceProblemGripperError = 12
  676. DeviceProblemDriveError = 13