Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2137 lines
74 KiB

  1. /*++
  2. Copyright (c) 1993-1999 Microsoft Corporation
  3. Module Name:
  4. extflags.h
  5. Abstract:
  6. This header file (re)defines various flags used by extensions. These definitions
  7. are copied from different header files as stated.
  8. --*/
  9. #ifndef _EXTFLAGS_
  10. #define _EXTFLAGS_
  11. ///////////////////////////////////////////////////////////////////////////////
  12. //
  13. // apic.inc
  14. //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. //
  17. // Default Physical addresses of the APICs in a PC+MP system
  18. //
  19. #define IO_BASE_ADDRESS 0xFEC00000 // Default address of
  20. // 1st IO Apic
  21. #define LU_BASE_ADDRESS 0xFEE00000 // Default address
  22. // of Local Apic
  23. #define IO_REGISTER_SELECT 0x00000000 //
  24. #define IO_REGISTER_WINDOW 0x00000010 //
  25. #define IO_ID_REGISTER 0x00000000
  26. #define IO_VERS_REGISTER 0x00000001
  27. #define IO_ARB_ID_REGISTER 0x00000002
  28. #define IO_REDIR_00_LOW 0x00000010
  29. #define IO_REDIR_00_HIGH 0x00000011
  30. #define IO_MAX_REDIR_MASK 0x00FF0000
  31. #define IO_VERSION_MASK 0x000000FF
  32. #define LU_ID_REGISTER 0x00000020 //
  33. #define LU_VERS_REGISTER 0x00000030 //
  34. #define LU_TPR 0x00000080 //
  35. #define LU_APR 0x00000090 //
  36. #define LU_PPR 0x000000A0 //
  37. #define LU_EOI 0x000000B0 //
  38. #define LU_REMOTE_REGISTER 0x000000C0 //
  39. #define LU_LOGICAL_DEST 0x000000D0 //
  40. #define LU_LOGICAL_DEST_MASK 0xFF000000
  41. #define LU_DEST_FORMAT 0x000000E0 //
  42. #define LU_DEST_FORMAT_MASK 0xF0000000
  43. #define LU_DEST_FORMAT_FLAT 0xFFFFFFFF
  44. #define LU_DEST_FORMAT_CLUSTER 0x0FFFFFFF
  45. #define LU_SPURIOUS_VECTOR 0x000000F0 //
  46. #define LU_FAULT_VECTOR 0x00000370 //
  47. #define LU_UNIT_ENABLED 0x00000100
  48. #define LU_UNIT_DISABLED 0x00000000
  49. #define LU_ISR_0 0x00000100 //
  50. #define LU_TMR_0 0x00000180 //
  51. #define LU_IRR_0 0x00000200 //
  52. #define LU_ERROR_STATUS 0x00000280 //
  53. #define LU_INT_CMD_LOW 0x00000300 //
  54. #define LU_INT_CMD_HIGH 0x00000310 //
  55. #define LU_TIMER_VECTOR 0x00000320 //
  56. #define LU_PERF_VECTOR 0x00000340
  57. #define LU_INT_VECTOR_0 0x00000350 // TEMPORARY - do not use
  58. #define LU_INT_VECTOR_1 0x00000360 // TEMPORARY - do not use
  59. #define LU_INITIAL_COUNT 0x00000380 //
  60. #define LU_CURRENT_COUNT 0x00000390 //
  61. #define LU_DIVIDER_CONFIG 0x000003E0 //
  62. #define APIC_ID_MASK 0xFF000000
  63. #define APIC_ID_SHIFT 24
  64. #define INT_VECTOR_MASK 0x000000FF
  65. #define RESERVED_HIGH_INT 0x000000F8
  66. #define DELIVERY_MODE_MASK 0x00000700
  67. #define DELIVER_FIXED 0x00000000
  68. #define DELIVER_LOW_PRIORITY 0x00000100
  69. #define DELIVER_SMI 0x00000200
  70. #define DELIVER_REMOTE_READ 0x00000300
  71. #define DELIVER_NMI 0x00000400
  72. #define DELIVER_INIT 0x00000500
  73. #define DELIVER_STARTUP 0x00000600
  74. #define DELIVER_EXTINT 0x00000700
  75. #define PHYSICAL_DESTINATION 0x00000000
  76. #define LOGICAL_DESTINATION 0x00000800
  77. #define DELIVERY_PENDING 0x00001000
  78. #define ACTIVE_LOW 0x00002000
  79. #define ACTIVE_HIGH 0x00000000
  80. #define REMOTE_IRR 0x00004000
  81. #define LEVEL_TRIGGERED 0x00008000
  82. #define EDGE_TRIGGERED 0x00000000
  83. #define INTERRUPT_MASKED 0x00010000
  84. #define INTERRUPT_MOT_MASKED 0x00000000
  85. #define PERIODIC_TIMER 0x00020000
  86. #define ICR_LEVEL_ASSERTED 0x00004000
  87. #define ICR_LEVEL_DEASSERTED 0x00000000
  88. #define ICR_RR_STATUS_MASK 0x00030000
  89. #define ICR_RR_INVALID 0x00000000
  90. #define ICR_RR_IN_PROGRESS 0x00010000
  91. #define ICR_RR_VALID 0x00020000
  92. #define ICR_SHORTHAND_MASK 0x000C0000
  93. #define ICR_USE_DEST_FIELD 0x00000000
  94. #define ICR_SELF 0x00040000
  95. #define ICR_ALL_INCL_SELF 0x00080000
  96. #define ICR_ALL_EXCL_SELF 0x000C0000
  97. //
  98. // Io Apic Entry definitions
  99. //
  100. // Interrupt Types Possible in the PC+MP Table
  101. // valid for both local and Io Apics
  102. //
  103. #define INT_TYPE_INTR 0x0
  104. #define INT_TYPE_NMI 0x1
  105. #define INT_TYPE_SMI 0x2
  106. #define INT_TYPE_EXTINT 0x3
  107. ///////////////////////////////////////////////////////////////////////////////
  108. //
  109. // arbiter.h
  110. //
  111. ///////////////////////////////////////////////////////////////////////////////
  112. //
  113. // Attributes for the ranges
  114. //
  115. #define ARBITER_RANGE_BOOT_ALLOCATED 0x01
  116. #define ARBITER_RANGE_SHARE_DRIVER_EXCLUSIVE 0x02
  117. #define ARBITER_RANGE_ALIAS 0x10
  118. #define ARBITER_RANGE_POSITIVE_DECODE 0x20
  119. #define INITIAL_ALLOCATION_STATE_SIZE PageSize
  120. #define ARBITER_INSTANCE_SIGNATURE 'sbrA'
  121. ///////////////////////////////////////////////////////////////////////////////
  122. //
  123. // busp.h
  124. //
  125. ///////////////////////////////////////////////////////////////////////////////
  126. //
  127. // Flags definitions of DEVICE_INFORMATION and BUS_EXTENSION
  128. //
  129. #define DF_DELETED 0x00000001
  130. #define DF_REMOVED 0X00000002
  131. #define DF_NOT_FUNCTIONING 0x00000004
  132. #define DF_ENUMERATED 0x00000008
  133. #define DF_ACTIVATED 0x00000010
  134. #define DF_QUERY_STOPPED 0x00000020
  135. #define DF_SURPRISE_REMOVED 0x00000040
  136. #define DF_PROCESSING_RDP 0x00000080
  137. #define DF_STOPPED 0x00000100
  138. #define DF_RESTARTED_MOVED 0x00000200
  139. #define DF_RESTARTED_NOMOVE 0x00000400
  140. #define DF_REQ_TRIMMED 0x00000800
  141. #define DF_READ_DATA_PORT 0x40000000
  142. #define DF_BUS 0x80000000
  143. ///////////////////////////////////////////////////////////////////////////////
  144. //
  145. // cache.h
  146. //
  147. ///////////////////////////////////////////////////////////////////////////////
  148. // Define two constants describing the view size (and alignment)
  149. // that the Cache Manager uses to map files.
  150. //
  151. #define VACB_MAPPING_GRANULARITY (0x40000)
  152. #define VACB_OFFSET_SHIFT (18)
  153. ///////////////////////////////////////////////////////////////////////////////
  154. //
  155. // cc.h
  156. //
  157. ///////////////////////////////////////////////////////////////////////////////
  158. //
  159. // Define our node type codes.
  160. //
  161. #define CACHE_NTC_SHARED_CACHE_MAP (0x2FF)
  162. #define CACHE_NTC_PRIVATE_CACHE_MAP (0x2FE)
  163. #define CACHE_NTC_BCB (0x2FD)
  164. #define CACHE_NTC_DEFERRED_WRITE (0x2FC)
  165. #define CACHE_NTC_MBCB (0x2FB)
  166. #define CACHE_NTC_OBCB (0x2FA)
  167. #define CACHE_NTC_MBCB_GRANDE (0x2F9)
  168. // There is a bit of a trick as we make the jump to the multilevel structure in that
  169. // we need a real fixed reference count.
  170. //
  171. #define VACB_LEVEL_SHIFT (7)
  172. //
  173. // This is how many bytes of pointers are at each level. This is the size for both
  174. // the Vacb array and (optional) Bcb listheads. It does not include the reference
  175. // block.
  176. //
  177. // #define VACB_LEVEL_BLOCK_SIZE ((1 << VACB_LEVEL_SHIFT) * sizeof(PVOID))
  178. //
  179. // This is the last index for a level.
  180. //
  181. #define VACB_LAST_INDEX_FOR_LEVEL ((1 << VACB_LEVEL_SHIFT) - 1)
  182. //
  183. // This is the size of file which can be handled in a single level.
  184. //
  185. #define VACB_SIZE_OF_FIRST_LEVEL ((ULONG64)1 << (VACB_OFFSET_SHIFT + VACB_LEVEL_SHIFT))
  186. //
  187. // This is the maximum number of levels it takes to support 63-bits. It is
  188. // used for routines that must remember a path.
  189. //
  190. #define VACB_NUMBER_OF_LEVELS (((63 - VACB_OFFSET_SHIFT)/VACB_LEVEL_SHIFT) + 1)
  191. //
  192. // First some constants
  193. //
  194. #define PREALLOCATED_VACBS (4)
  195. ///////////////////////////////////////////////////////////////////////////////
  196. //
  197. // ex.h
  198. //
  199. ///////////////////////////////////////////////////////////////////////////////
  200. #define CALL_HASH_TABLE_SIZE 64
  201. //
  202. // If high order bit in Pool tag is set, then must use ExFreePoolWithTag to free
  203. //
  204. #define PROTECTED_POOL 0x80000000
  205. #define POOL_BACKTRACEINDEX_PRESENT 0x8000
  206. #define ResourceNeverExclusive 0x10
  207. #define ResourceReleaseByOtherThread 0x20
  208. #define ResourceOwnedExclusive 0x80
  209. #define RESOURCE_HASH_TABLE_SIZE 64
  210. //
  211. // The following two definitions control the raising of exceptions on quota
  212. // and allocation failures.
  213. //
  214. #define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE 8
  215. #define POOL_RAISE_IF_ALLOCATION_FAILURE 16 // ntifs
  216. ///////////////////////////////////////////////////////////////////////////////
  217. //
  218. // cmdata.h
  219. //
  220. ///////////////////////////////////////////////////////////////////////////////
  221. //
  222. // Define the HINT Length used
  223. //
  224. #define CM_SUBKEY_HINT_LENGTH 4
  225. #define CM_MAX_CACHE_HINT_SIZE 14
  226. //
  227. // Bits used in the ExtFlags in KCB.
  228. //
  229. #define CM_KCB_NO_SUBKEY 0x0001 // This key has no subkeys
  230. #define CM_KCB_SUBKEY_ONE 0x0002 // This key has only one subkey and the
  231. // first 4 char
  232. //
  233. #define CM_KCB_SUBKEY_HINT 0x0004
  234. #define CM_KCB_SYM_LINK_FOUND 0x0008
  235. #define CM_KCB_KEY_NON_EXIST 0x0010
  236. #define CM_KCB_NO_DELAY_CLOSE 0x0020
  237. #define CM_KCB_INVALID_CACHED_INFO 0x0040 // info stored in SubKeyCount is not valid, so we shouldn't rely on it
  238. #define CM_KCB_CACHE_MASK (CM_KCB_NO_SUBKEY | \
  239. CM_KCB_KEY_NON_EXIST | \
  240. CM_KCB_SUBKEY_ONE | \
  241. CM_KCB_SUBKEY_HINT)
  242. //
  243. // CM_KEY_BODY
  244. //
  245. #define KEY_BODY_TYPE 0x6b793032 // "ky02"
  246. //
  247. // ----- CM_KEY_VALUE -----
  248. //
  249. #define CM_KEY_VALUE_SIGNATURE 0x6b76 // "kv"
  250. #define VALUE_COMP_NAME 0x0001 // The name for this value is stored in a
  251. //
  252. // ----- CM_KEY_NODE -----
  253. //
  254. #define CM_KEY_NODE_SIGNATURE 0x6b6e // "kn"
  255. #define CM_LINK_NODE_SIGNATURE 0x6b6c // "kl"
  256. #define KEY_VOLATILE 0x0001 // This key (and all its children)
  257. // is volatile.
  258. #define KEY_HIVE_EXIT 0x0002 // This key marks a bounary to another
  259. // hive (sort of a link). The null
  260. // value entry contains the hive
  261. // and hive index of the root of the
  262. // child hive.
  263. #define KEY_HIVE_ENTRY 0x0004 // This key is the root of a particular
  264. // hive.
  265. #define KEY_NO_DELETE 0x0008 // This key cannot be deleted, period.
  266. #define KEY_SYM_LINK 0x0010 // This key is really a symbolic link.
  267. #define KEY_COMP_NAME 0x0020 // The name for this key is stored in a
  268. // compressed form.
  269. #define KEY_PREDEF_HANDLE 0x0040 // There is no real key backing this,
  270. // return the predefined handle.
  271. // Predefined handles are stashed in
  272. // ValueList.Count.
  273. ///////////////////////////////////////////////////////////////////////////////
  274. //
  275. // hivedata.h
  276. //
  277. ///////////////////////////////////////////////////////////////////////////////
  278. #define HFILE_TYPE_PRIMARY 0 // Base hive file
  279. #define HFILE_TYPE_LOG 1 // Log (security.log)
  280. #define HFILE_TYPE_EXTERNAL 2 // Target of savekey, etc.
  281. #define HFILE_TYPE_MAX 3
  282. #define HHIVE_SIGNATURE 0xBEE0BEE0
  283. #define HBIN_SIGNATURE 0x6e696268 // "hbin"
  284. #define HHIVE_LINEAR_INDEX 16 // All computed linear indices < HHIVE_LINEAR_INDEX are valid
  285. #define HHIVE_EXPONENTIAL_INDEX 23 // All computed exponential indices < HHIVE_EXPONENTIAL_INDEX
  286. // and >= HHIVE_LINEAR_INDEX are valid.
  287. #define HHIVE_FREE_DISPLAY_SIZE 24
  288. #define HHIVE_FREE_DISPLAY_SHIFT 3 // This must be log2 of HCELL_PAD!
  289. #define HHIVE_FREE_DISPLAY_BIAS 7 // Add to first set bit left of cell size to get exponential index
  290. ///////////////////////////////////////////////////////////////////////////////
  291. //
  292. // hardware.h
  293. //
  294. ///////////////////////////////////////////////////////////////////////////////
  295. typedef enum {
  296. WaveInDevice = 0,
  297. WaveOutDevice,
  298. MidiOutDevice,
  299. MidiInDevice,
  300. LineInDevice,
  301. CDInternal,
  302. MixerDevice,
  303. AuxDevice,
  304. NumberOfDevices
  305. } SOUND_DEVICES;
  306. ///////////////////////////////////////////////////////////////////////////////
  307. //
  308. // hidclass\local.h
  309. //
  310. ///////////////////////////////////////////////////////////////////////////////
  311. //
  312. // Valid values for HIDCLASS_DEVICE_EXTENSION.state
  313. //
  314. enum deviceState {
  315. DEVICE_STATE_INITIALIZED,
  316. DEVICE_STATE_STARTING,
  317. DEVICE_STATE_START_SUCCESS,
  318. DEVICE_STATE_START_FAILURE,
  319. DEVICE_STATE_STOPPED,
  320. DEVICE_STATE_REMOVING,
  321. DEVICE_STATE_REMOVED,
  322. DEVICE_STATE_SUSPENDED
  323. };
  324. enum collectionState {
  325. COLLECTION_STATE_UNINITIALIZED,
  326. COLLECTION_STATE_INITIALIZED,
  327. COLLECTION_STATE_RUNNING,
  328. COLLECTION_STATE_STOPPED,
  329. COLLECTION_STATE_REMOVING
  330. };
  331. #define HID_DEVICE_EXTENSION_SIG 'EddH'
  332. ///////////////////////////////////////////////////////////////////////////////
  333. //
  334. // hidparse.h
  335. //
  336. ///////////////////////////////////////////////////////////////////////////////
  337. #define HIDP_PREPARSED_DATA_SIGNATURE1 'PdiH'
  338. #define HIDP_PREPARSED_DATA_SIGNATURE2 'RDK '
  339. ///////////////////////////////////////////////////////////////////////////////
  340. //
  341. // hivedata.h
  342. //
  343. ///////////////////////////////////////////////////////////////////////////////
  344. //
  345. // ===== Basic Structures and Definitions =====
  346. //
  347. // These are same whether on disk or in memory.
  348. //
  349. //
  350. // NOTE: Volatile == storage goes away at reboot
  351. // Stable == Persistent == Not Volatile
  352. //
  353. typedef enum {
  354. Stable = 0,
  355. Volatile = 1
  356. } HSTORAGE_TYPE;
  357. #define HTYPE_COUNT 2
  358. // --- HBASE_BLOCK --- on disk description of the hive
  359. //
  360. //
  361. // NOTE: HBASE_BLOCK must be >= the size of physical sector,
  362. // or integrity assumptions will be violated, and crash
  363. // recovery may not work.
  364. //
  365. #define HBASE_BLOCK_SIGNATURE 0x66676572 // "regf"
  366. #define HSYS_MAJOR 1 // Must match to read at all
  367. #define HSYS_MINOR 3 // Must be <= to write, always
  368. // set up to writer's version.
  369. #define HBASE_FORMAT_MEMORY 1 // Direct memory load case
  370. #define HBASE_NAME_ALLOC 64 // 32 unicode chars
  371. // #define HLOG_HEADER_SIZE (FIELD_OFFSET(HBASE_BLOCK, Reserved2))
  372. #define HLOG_DV_SIGNATURE 0x54524944 // "DIRT"
  373. #define HCELL_TYPE_MASK 0x80000000
  374. #define HCELL_TYPE_SHIFT 31
  375. #define HCELL_TABLE_MASK 0x7fe00000
  376. #define HCELL_TABLE_SHIFT 21
  377. #define HCELL_BLOCK_MASK 0x001ff000
  378. #define HCELL_BLOCK_SHIFT 12
  379. #define HCELL_OFFSET_MASK 0x00000fff
  380. #define HBLOCK_SIZE 0x1000 // LOGICAL block size
  381. // This is the size of one of
  382. // the registry's logical/virtual
  383. // pages. It has no particular
  384. // relationship to page size
  385. // of the machine.
  386. #define HSECTOR_SIZE 0x200 // LOGICAL sector size
  387. #define HSECTOR_COUNT 8 // LOGICAL sectors / LOGICAL Block
  388. #define HTABLE_SLOTS 512 // 9 bits of address
  389. #define HDIRECTORY_SLOTS 1024 // 10 bits of address
  390. ///////////////////////////////////////////////////////////////////////////////
  391. //
  392. // io.h
  393. //
  394. ///////////////////////////////////////////////////////////////////////////////
  395. //
  396. // Define I/O system data structure type codes. Each major data structure in
  397. // the I/O system has a type code The type field in each structure is at the
  398. // same offset. The following values can be used to determine which type of
  399. // data structure a pointer refers to.
  400. //
  401. #define IO_TYPE_ADAPTER 0x00000001
  402. #define IO_TYPE_CONTROLLER 0x00000002
  403. #define IO_TYPE_DEVICE 0x00000003
  404. #define IO_TYPE_DRIVER 0x00000004
  405. #define IO_TYPE_FILE 0x00000005
  406. #define IO_TYPE_IRP 0x00000006
  407. #define IO_TYPE_MASTER_ADAPTER 0x00000007
  408. #define IO_TYPE_OPEN_PACKET 0x00000008
  409. #define IO_TYPE_TIMER 0x00000009
  410. #define IO_TYPE_VPB 0x0000000a
  411. #define IO_TYPE_ERROR_LOG 0x0000000b
  412. #define IO_TYPE_ERROR_MESSAGE 0x0000000c
  413. #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0000000d
  414. //
  415. // Define the major function codes for IRPs.
  416. //
  417. #define IRP_MJ_CREATE 0x00
  418. #define IRP_MJ_CREATE_NAMED_PIPE 0x01
  419. #define IRP_MJ_CLOSE 0x02
  420. #define IRP_MJ_READ 0x03
  421. #define IRP_MJ_WRITE 0x04
  422. #define IRP_MJ_QUERY_INFORMATION 0x05
  423. #define IRP_MJ_SET_INFORMATION 0x06
  424. #define IRP_MJ_QUERY_EA 0x07
  425. #define IRP_MJ_SET_EA 0x08
  426. #define IRP_MJ_FLUSH_BUFFERS 0x09
  427. #define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
  428. #define IRP_MJ_SET_VOLUME_INFORMATION 0x0b
  429. #define IRP_MJ_DIRECTORY_CONTROL 0x0c
  430. #define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d
  431. #define IRP_MJ_DEVICE_CONTROL 0x0e
  432. #define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f
  433. #define IRP_MJ_SHUTDOWN 0x10
  434. #define IRP_MJ_LOCK_CONTROL 0x11
  435. #define IRP_MJ_CLEANUP 0x12
  436. #define IRP_MJ_CREATE_MAILSLOT 0x13
  437. #define IRP_MJ_QUERY_SECURITY 0x14
  438. #define IRP_MJ_SET_SECURITY 0x15
  439. #define IRP_MJ_POWER 0x16
  440. #define IRP_MJ_SYSTEM_CONTROL 0x17
  441. #define IRP_MJ_DEVICE_CHANGE 0x18
  442. #define IRP_MJ_QUERY_QUOTA 0x19
  443. #define IRP_MJ_SET_QUOTA 0x1a
  444. #define IRP_MJ_PNP 0x1b
  445. #define IRP_MJ_PNP_POWER IRP_MJ_PNP // Obsolete....
  446. #define IRP_MJ_MAXIMUM_FUNCTION 0x1b
  447. //
  448. // Make the Scsi major code the same as internal device control.
  449. //
  450. #define IRP_MJ_SCSI IRP_MJ_INTERNAL_DEVICE_CONTROL
  451. //
  452. // Define the Device Object Extension Flags
  453. //
  454. #define DOE_UNLOAD_PENDING 0x00000001
  455. #define DOE_DELETE_PENDING 0x00000002
  456. #define DOE_REMOVE_PENDING 0x00000004
  457. #define DOE_REMOVE_PROCESSED 0x00000008
  458. #define DOE_START_PENDING 0x00000010
  459. //
  460. // Define stack location control flags
  461. //
  462. #define SL_PENDING_RETURNED 0x01
  463. #define SL_INVOKE_ON_CANCEL 0x20
  464. #define SL_INVOKE_ON_SUCCESS 0x40
  465. #define SL_INVOKE_ON_ERROR 0x80
  466. //
  467. // Define I/O Request Packet (IRP) flags
  468. //
  469. #define IRP_NOCACHE 0x00000001
  470. #define IRP_PAGING_IO 0x00000002
  471. #define IRP_MOUNT_COMPLETION 0x00000002
  472. #define IRP_SYNCHRONOUS_API 0x00000004
  473. #define IRP_ASSOCIATED_IRP 0x00000008
  474. #define IRP_BUFFERED_IO 0x00000010
  475. #define IRP_DEALLOCATE_BUFFER 0x00000020
  476. #define IRP_INPUT_OPERATION 0x00000040
  477. #define IRP_SYNCHRONOUS_PAGING_IO 0x00000040
  478. #define IRP_CREATE_OPERATION 0x00000080
  479. #define IRP_READ_OPERATION 0x00000100
  480. #define IRP_WRITE_OPERATION 0x00000200
  481. #define IRP_CLOSE_OPERATION 0x00000400
  482. #define IRP_DEFER_IO_COMPLETION 0x00000800
  483. #define IRP_OB_QUERY_NAME 0x00001000
  484. #define IRP_HOLD_DEVICE_QUEUE 0x00002000
  485. #define IRP_RETRY_IO_COMPLETION 0x00004000
  486. #define DO_VERIFY_VOLUME 0x00000002 // ntddk nthal ntifs
  487. #define DO_BUFFERED_IO 0x00000004 // ntddk nthal ntifs wdm
  488. #define DO_EXCLUSIVE 0x00000008 // ntddk nthal ntifs wdm
  489. #define DO_DIRECT_IO 0x00000010 // ntddk nthal ntifs wdm
  490. #define DO_MAP_IO_BUFFER 0x00000020 // ntddk nthal ntifs wdm
  491. #define DO_DEVICE_HAS_NAME 0x00000040 // ntddk nthal ntifs
  492. #define DO_DEVICE_INITIALIZING 0x00000080 // ntddk nthal ntifs wdm
  493. #define DO_SYSTEM_BOOT_PARTITION 0x00000100 // ntddk nthal ntifs
  494. #define DO_LONG_TERM_REQUESTS 0x00000200 // ntddk nthal ntifs
  495. #define DO_NEVER_LAST_DEVICE 0x00000400 // ntddk nthal ntifs
  496. #define DO_SHUTDOWN_REGISTERED 0x00000800 // ntddk nthal ntifs wdm
  497. #define DO_BUS_ENUMERATED_DEVICE 0x00001000 // ntddk nthal ntifs wdm
  498. #define DO_POWER_PAGABLE 0x00002000 // ntddk nthal ntifs wdm
  499. #define DO_POWER_INRUSH 0x00004000 // ntddk nthal ntifs wdm
  500. #define DO_POWER_NOOP 0x00008000
  501. #define DO_LOW_PRIORITY_FILESYSTEM 0x00010000 // ntddk nthal ntifs
  502. //
  503. // Define Volume Parameter Block (VPB) flags.
  504. //
  505. #define VPB_MOUNTED 0x00000001
  506. #define VPB_LOCKED 0x00000002
  507. #define VPB_PERSISTENT 0x00000004
  508. #define VPB_REMOVE_PENDING 0x00000008
  509. #define VPB_RAW_MOUNT 0x00000010
  510. ///////////////////////////////////////////////////////////////////////////////
  511. //
  512. // ke.h
  513. //
  514. ///////////////////////////////////////////////////////////////////////////////
  515. //
  516. // Define I/O request packet (IRP) alternate flags for allocation control.
  517. //
  518. #define IRP_QUOTA_CHARGED 0x01
  519. #define IRP_ALLOCATED_MUST_SUCCEED 0x02
  520. #define IRP_ALLOCATED_FIXED_SIZE 0x04
  521. #define IRP_LOOKASIDE_ALLOCATION 0x08
  522. //
  523. // Public (external) constant definitions.
  524. //
  525. #define BASE_PRIORITY_THRESHOLD NORMAL_BASE_PRIORITY // fast path base threshold
  526. // begin_ntddk begin_wdm
  527. #define THREAD_WAIT_OBJECTS 3 // Builtin usable wait blocks
  528. // end_ntddk end_wdm
  529. #define EVENT_WAIT_BLOCK 2 // Builtin event pair wait block
  530. #define SEMAPHORE_WAIT_BLOCK 2 // Builtin semaphore wait block
  531. #define TIMER_WAIT_BLOCK 3 // Builtin timer wait block
  532. #if (EVENT_WAIT_BLOCK != SEMAPHORE_WAIT_BLOCK)
  533. #error "wait event and wait semaphore must use same wait block"
  534. #endif
  535. //
  536. // Define timer table size.
  537. //
  538. #define TIMER_TABLE_SIZE (unsigned)((BuildNo < 2251) ? 128 : 256)
  539. typedef enum _KOBJECTS {
  540. EventNotificationObject = 0,
  541. EventSynchronizationObject = 1,
  542. MutantObject = 2,
  543. ProcessObject = 3,
  544. QueueObject = 4,
  545. SemaphoreObject = 5,
  546. ThreadObject = 6,
  547. Spare1Object = 7,
  548. TimerNotificationObject = 8,
  549. TimerSynchronizationObject = 9,
  550. Spare2Object = 10,
  551. Spare3Object = 11,
  552. Spare4Object = 12,
  553. Spare5Object = 13,
  554. Spare6Object = 14,
  555. Spare7Object = 15,
  556. Spare8Object = 16,
  557. Spare9Object = 17,
  558. ApcObject,
  559. DpcObject,
  560. DeviceQueueObject,
  561. EventPairObject,
  562. InterruptObject,
  563. ProfileObject
  564. } KOBJECTS;
  565. typedef enum _KBUGCHECK_BUFFER_DUMP_STATE {
  566. BufferEmpty,
  567. BufferInserted,
  568. BufferStarted,
  569. BufferFinished,
  570. BufferIncomplete
  571. } KBUGCHECK_BUFFER_DUMP_STATE;
  572. ///////////////////////////////////////////////////////////////////////////////
  573. //
  574. // local.h
  575. //
  576. ///////////////////////////////////////////////////////////////////////////////
  577. typedef enum {
  578. //
  579. // Device Object Extension Types
  580. //
  581. PciPdoExtensionType = 'icP0',
  582. PciFdoExtensionType,
  583. //
  584. // Arbitration Types. (These are also secondary extensions).
  585. //
  586. PciArb_Io,
  587. PciArb_Memory,
  588. PciArb_Interrupt,
  589. PciArb_BusNumber,
  590. //
  591. // Translation Types. (These are also secondary extensions).
  592. //
  593. PciTrans_Interrupt,
  594. //
  595. // Other exposed interfaces.
  596. //
  597. PciInterface_BusHandler,
  598. PciInterface_IntRouteHandler,
  599. PciInterface_PciCb,
  600. PciInterface_LegacyDeviceDetection,
  601. PciInterface_PmeHandler,
  602. PciInterface_DevicePresent
  603. } PCI_SIGNATURE;
  604. ///////////////////////////////////////////////////////////////////////////////
  605. //
  606. // lpc.h
  607. //
  608. ///////////////////////////////////////////////////////////////////////////////
  609. //
  610. // Valid values for Flags field
  611. //
  612. #define PORT_TYPE 0x0000000F
  613. #define SERVER_CONNECTION_PORT 0x00000001
  614. #define UNCONNECTED_COMMUNICATION_PORT 0x00000002
  615. #define SERVER_COMMUNICATION_PORT 0x00000003
  616. #define CLIENT_COMMUNICATION_PORT 0x00000004
  617. #define PORT_WAITABLE 0x20000000
  618. #define PORT_NAME_DELETED 0x40000000
  619. #define PORT_DYNAMIC_SECURITY 0x80000000
  620. #define PORT_DELETED 0x10000000
  621. ///////////////////////////////////////////////////////////////////////////////
  622. //
  623. // mi.h
  624. //
  625. ///////////////////////////////////////////////////////////////////////////////
  626. //
  627. // Page protections
  628. //
  629. #define MM_ZERO_ACCESS 0 // this value is not used.
  630. #define MM_READONLY 1
  631. #define MM_EXECUTE 2
  632. #define MM_EXECUTE_READ 3
  633. #define MM_READWRITE 4 // bit 2 is set if this is writable.
  634. #define MM_WRITECOPY 5
  635. #define MM_EXECUTE_READWRITE 6
  636. #define MM_EXECUTE_WRITECOPY 7
  637. #define MM_NOCACHE 0x8
  638. #define MM_GUARD_PAGE 0x10
  639. #define MM_DECOMMIT 0x10 //NO_ACCESS, Guard page
  640. #define MM_NOACCESS 0x18 //NO_ACCESS, Guard_page, nocache.
  641. #define MM_UNKNOWN_PROTECTION 0x100 //bigger than 5 bits!
  642. #define MM_LARGE_PAGES 0x111
  643. #define PROTECT_KSTACKS 1
  644. #define MM_KSTACK_OUTSWAPPED 0x1F //Debug marking for kernel stacks
  645. #define MM_PROTECTION_WRITE_MASK 4
  646. #define MM_PROTECTION_COPY_MASK 1
  647. #define MM_PROTECTION_OPERATION_MASK 7 // mask off guard page and nocache.
  648. #define MM_PROTECTION_EXECUTE_MASK 2
  649. #define MM_SECURE_DELETE_CHECK 0x55
  650. //
  651. // Special pool constants
  652. //
  653. #define MI_SPECIAL_POOL_PAGABLE 0x8000
  654. #define MI_SPECIAL_POOL_VERIFIER 0x4000
  655. #define MI_SPECIAL_POOL_PTE_PAGABLE 0x0002
  656. #define MI_SPECIAL_POOL_PTE_NONPAGABLE 0x0004
  657. #define VI_VERIFYING_DIRECTLY 0x1
  658. #define VI_VERIFYING_INVERSELY 0x2
  659. #define MM_SYS_PTE_TABLES_MAX 5
  660. ///////////////////////////////////////////////////////////////////////////////
  661. //
  662. // mm.h
  663. //
  664. ///////////////////////////////////////////////////////////////////////////////
  665. typedef enum _MMLISTS {
  666. ZeroedPageList,
  667. FreePageList,
  668. StandbyPageList, //this list and before make up available pages.
  669. ModifiedPageList,
  670. ModifiedNoWritePageList,
  671. BadPageList,
  672. ActiveAndValid,
  673. TransitionPage
  674. } MMLISTS;
  675. #define MM_FREE_WSLE_SHIFT 4
  676. #define WSLE_NULL_INDEX ((ULONG64)0xFFFFFFFFFFFFFFFUI64)
  677. #define GRAN_BYTE 0
  678. #define GRAN_PAGE 1
  679. ///////////////////////////////////////////////////////////////////////////////
  680. //
  681. // ob.h
  682. //
  683. ///////////////////////////////////////////////////////////////////////////////
  684. #define OB_FLAG_NEW_OBJECT 0x01
  685. #define OB_FLAG_KERNEL_OBJECT 0x02
  686. #define OB_FLAG_CREATOR_INFO 0x04
  687. #define OB_FLAG_EXCLUSIVE_OBJECT 0x08
  688. #define OB_FLAG_PERMANENT_OBJECT 0x10
  689. #define OB_FLAG_DEFAULT_SECURITY_QUOTA 0x20
  690. #define OB_FLAG_SINGLE_HANDLE_ENTRY 0x40
  691. ///////////////////////////////////////////////////////////////////////////////
  692. //
  693. // pci.h
  694. //
  695. ///////////////////////////////////////////////////////////////////////////////
  696. //
  697. // Note - State.c depends on the order of these.
  698. //
  699. typedef enum {
  700. PciNotStarted = 0,
  701. PciStarted,
  702. PciDeleted,
  703. PciStopped,
  704. PciSurpriseRemoved,
  705. PciSynchronizedOperation,
  706. PciMaxObjectState
  707. } PCI_OBJECT_STATE;
  708. //
  709. // Base Class Code encodings for Base Class (from PCI spec rev 2.1).
  710. //
  711. #define PCI_CLASS_PRE_20 0x00
  712. #define PCI_CLASS_MASS_STORAGE_CTLR 0x01
  713. #define PCI_CLASS_NETWORK_CTLR 0x02
  714. #define PCI_CLASS_DISPLAY_CTLR 0x03
  715. #define PCI_CLASS_MULTIMEDIA_DEV 0x04
  716. #define PCI_CLASS_MEMORY_CTLR 0x05
  717. #define PCI_CLASS_BRIDGE_DEV 0x06
  718. #define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07
  719. #define PCI_CLASS_BASE_SYSTEM_DEV 0x08
  720. #define PCI_CLASS_INPUT_DEV 0x09
  721. #define PCI_CLASS_DOCKING_STATION 0x0a
  722. #define PCI_CLASS_PROCESSOR 0x0b
  723. #define PCI_CLASS_SERIAL_BUS_CTLR 0x0c
  724. // 0d thru fe reserved
  725. #define PCI_CLASS_NOT_DEFINED 0xff
  726. //
  727. // Sub Class Code encodings (PCI rev 2.1).
  728. //
  729. // Class 00 - PCI_CLASS_PRE_20
  730. #define PCI_SUBCLASS_PRE_20_NON_VGA 0x00
  731. #define PCI_SUBCLASS_PRE_20_VGA 0x01
  732. // Class 01 - PCI_CLASS_MASS_STORAGE_CTLR
  733. #define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00
  734. #define PCI_SUBCLASS_MSC_IDE_CTLR 0x01
  735. #define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02
  736. #define PCI_SUBCLASS_MSC_IPI_CTLR 0x03
  737. #define PCI_SUBCLASS_MSC_RAID_CTLR 0x04
  738. #define PCI_SUBCLASS_MSC_OTHER 0x80
  739. // Class 02 - PCI_CLASS_NETWORK_CTLR
  740. #define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00
  741. #define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01
  742. #define PCI_SUBCLASS_NET_FDDI_CTLR 0x02
  743. #define PCI_SUBCLASS_NET_ATM_CTLR 0x03
  744. #define PCI_SUBCLASS_NET_OTHER 0x80
  745. // Class 03 - PCI_CLASS_DISPLAY_CTLR
  746. // N.B. Sub Class 00 could be VGA or 8514 depending on Interface byte
  747. #define PCI_SUBCLASS_VID_VGA_CTLR 0x00
  748. #define PCI_SUBCLASS_VID_XGA_CTLR 0x01
  749. #define PCI_SUBCLASS_VID_OTHER 0x80
  750. // Class 04 - PCI_CLASS_MULTIMEDIA_DEV
  751. #define PCI_SUBCLASS_MM_VIDEO_DEV 0x00
  752. #define PCI_SUBCLASS_MM_AUDIO_DEV 0x01
  753. #define PCI_SUBCLASS_MM_OTHER 0x80
  754. // Class 05 - PCI_CLASS_MEMORY_CTLR
  755. #define PCI_SUBCLASS_MEM_RAM 0x00
  756. #define PCI_SUBCLASS_MEM_FLASH 0x01
  757. #define PCI_SUBCLASS_MEM_OTHER 0x80
  758. // Class 06 - PCI_CLASS_BRIDGE_DEV
  759. #define PCI_SUBCLASS_BR_HOST 0x00
  760. #define PCI_SUBCLASS_BR_ISA 0x01
  761. #define PCI_SUBCLASS_BR_EISA 0x02
  762. #define PCI_SUBCLASS_BR_MCA 0x03
  763. #define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04
  764. #define PCI_SUBCLASS_BR_PCMCIA 0x05
  765. #define PCI_SUBCLASS_BR_NUBUS 0x06
  766. #define PCI_SUBCLASS_BR_CARDBUS 0x07
  767. #define PCI_SUBCLASS_BR_OTHER 0x80
  768. // Class 07 - PCI_CLASS_SIMPLE_COMMS_CTLR
  769. // N.B. Sub Class 00 and 01 additional info in Interface byte
  770. #define PCI_SUBCLASS_COM_SERIAL 0x00
  771. #define PCI_SUBCLASS_COM_PARALLEL 0x01
  772. #define PCI_SUBCLASS_COM_OTHER 0x80
  773. // Class 08 - PCI_CLASS_BASE_SYSTEM_DEV
  774. // N.B. See Interface byte for additional info.
  775. #define PCI_SUBCLASS_SYS_INTERRUPT_CTLR 0x00
  776. #define PCI_SUBCLASS_SYS_DMA_CTLR 0x01
  777. #define PCI_SUBCLASS_SYS_SYSTEM_TIMER 0x02
  778. #define PCI_SUBCLASS_SYS_REAL_TIME_CLOCK 0x03
  779. #define PCI_SUBCLASS_SYS_OTHER 0x80
  780. // Class 09 - PCI_CLASS_INPUT_DEV
  781. #define PCI_SUBCLASS_INP_KEYBOARD 0x00
  782. #define PCI_SUBCLASS_INP_DIGITIZER 0x01
  783. #define PCI_SUBCLASS_INP_MOUSE 0x02
  784. #define PCI_SUBCLASS_INP_OTHER 0x80
  785. // Class 0a - PCI_CLASS_DOCKING_STATION
  786. #define PCI_SUBCLASS_DOC_GENERIC 0x00
  787. #define PCI_SUBCLASS_DOC_OTHER 0x80
  788. // Class 0b - PCI_CLASS_PROCESSOR
  789. #define PCI_SUBCLASS_PROC_386 0x00
  790. #define PCI_SUBCLASS_PROC_486 0x01
  791. #define PCI_SUBCLASS_PROC_PENTIUM 0x02
  792. #define PCI_SUBCLASS_PROC_ALPHA 0x10
  793. #define PCI_SUBCLASS_PROC_POWERPC 0x20
  794. #define PCI_SUBCLASS_PROC_COPROCESSOR 0x40
  795. // Class 0c - PCI_CLASS_SERIAL_BUS_CTLR
  796. #define PCI_SUBCLASS_SB_IEEE1394 0x00
  797. #define PCI_SUBCLASS_SB_ACCESS 0x01
  798. #define PCI_SUBCLASS_SB_SSA 0x02
  799. #define PCI_SUBCLASS_SB_USB 0x03
  800. #define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04
  801. //
  802. // Bit encodings for PCI_COMMON_CONFIG.Command
  803. //
  804. #define PCI_ENABLE_IO_SPACE 0x0001
  805. #define PCI_ENABLE_MEMORY_SPACE 0x0002
  806. #define PCI_ENABLE_BUS_MASTER 0x0004
  807. #define PCI_ENABLE_SPECIAL_CYCLES 0x0008
  808. #define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010
  809. #define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020
  810. #define PCI_ENABLE_PARITY 0x0040 // (ro+)
  811. #define PCI_ENABLE_WAIT_CYCLE 0x0080 // (ro+)
  812. #define PCI_ENABLE_SERR 0x0100 // (ro+)
  813. #define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200 // (ro)
  814. #define PCI_TYPE0_ADDRESSES 6
  815. #define PCI_TYPE1_ADDRESSES 2
  816. #define PCI_TYPE2_ADDRESSES 5
  817. ///////////////////////////////////////////////////////////////////////////////
  818. //
  819. // pcmcia.h
  820. //
  821. ///////////////////////////////////////////////////////////////////////////////
  822. //
  823. // Flags indicating card/controller state
  824. //
  825. #define PCMCIA_DEVICE_STARTED 0x00000001
  826. #define PCMCIA_DEVICE_LOGICALLY_REMOVED 0x00000002
  827. #define PCMCIA_DEVICE_PHYSICALLY_REMOVED 0x00000004
  828. #define PCMCIA_DEVICE_MULTIFUNCTION 0x00000008
  829. #define PCMCIA_DEVICE_WAKE_PENDING 0x00000010
  830. #define PCMCIA_DEVICE_LEGACY_DETECTED 0x00000020
  831. #define PCMCIA_DEVICE_DELETED 0x00000040
  832. #define PCMCIA_DEVICE_CARDBUS 0x00000080
  833. #define PCMCIA_FILTER_ADDED_MEMORY 0x00000100
  834. #define PCMCIA_MEMORY_24BIT 0x00000200
  835. #define PCMCIA_CARDBUS_NOT_SUPPORTED 0x00000400
  836. #define PCMCIA_USE_POLLED_CSC 0x00000800
  837. #define PCMCIA_ATTRIBUTE_MEMORY_MAPPED 0x00001000
  838. #define PCMCIA_SOCKET_REGISTER_BASE_MAPPED 0x00002000
  839. #define PCMCIA_INTMODE_COMPAQ 0x00004000
  840. #define PCMCIA_POWER_WORKER_POWERUP 0x00008000
  841. #define PCMCIA_SOCKET_POWER_REQUESTED 0x00010000
  842. #define PCMCIA_CONFIG_STATUS_DEFERRED 0x00020000
  843. #define PCMCIA_POWER_STATUS_DEFERRED 0x00040000
  844. #define PCMCIA_INT_ROUTE_INTERFACE 0x00080000
  845. #define PCMCIA_FDO_CONTEXT_SAVED 0x00100000
  846. #define PCMCIA_FDO_DEFAULT_IRQ_MASK 0x00200000
  847. //
  848. // Socket flags
  849. //
  850. #define SOCKET_CARD_IN_SOCKET 0x00000001
  851. #define SOCKET_CARD_INITIALIZED 0x00000002
  852. #define SOCKET_CARD_POWERED_UP 0x00000004
  853. #define SOCKET_CARD_CONFIGURED 0x00000008
  854. #define SOCKET_CARD_MULTIFUNCTION 0x00000010
  855. #define SOCKET_CARD_CARDBUS 0x00000020
  856. #define SOCKET_CARD_MEMORY 0x00000040
  857. #define SOCKET_CHANGE_INTERRUPT 0x00000080
  858. #define SOCKET_CUSTOM_INTERFACE 0x00000100
  859. #define SOCKET_INSERTED_SOUND_PENDING 0x00000200
  860. #define SOCKET_REMOVED_SOUND_PENDING 0x00000400
  861. #define SOCKET_SUPPORT_MESSAGE_SENT 0x00000800
  862. #define SOCKET_MEMORY_WINDOW_ENABLED 0x00001000
  863. #define SOCKET_CARD_STATUS_CHANGE 0x00002000
  864. #define SOCKET_POWER_STATUS_DEFERRED 0x00004000
  865. //
  866. // Worker states for socket power operations
  867. //
  868. #define SPW_Stopped 0
  869. #define SPW_Exit 1
  870. #define SPW_RequestPower 2
  871. #define SPW_ReleasePower 3
  872. #define SPW_SetPowerOn 4
  873. #define SPW_SetPowerOff 5
  874. #define SPW_ParentPowerUp 6
  875. #define SPW_ParentPowerUpComplete 7
  876. //
  877. // Controller classes returned in socket information structure.
  878. //
  879. typedef enum _PCMCIA_CONTROLLER_CLASS {
  880. PcmciaInvalidControllerClass = -1,
  881. PcmciaIntelCompatible,
  882. PcmciaCardBusCompatible,
  883. PcmciaElcController,
  884. PcmciaDatabook,
  885. PcmciaPciPcmciaBridge,
  886. PcmciaCirrusLogic,
  887. PcmciaTI,
  888. PcmciaTopic,
  889. PcmciaRicoh,
  890. PcmciaDatabookCB,
  891. PcmciaOpti,
  892. PcmciaTrid,
  893. PcmciaO2Micro,
  894. PcmciaNEC,
  895. PcmciaNEC_98
  896. } PCMCIA_CONTROLLER_CLASS, *PPCMCIA_CONTROLLER_CLASS;
  897. #define PcmciaInvalidControllerType 0xffffffff
  898. #define PCMCIA_INVALID_CONFIGURATION 0x00000001
  899. // Max length of device id
  900. #define PCMCIA_MAXIMUM_DEVICE_ID_LENGTH 128
  901. //
  902. // states for PdoPowerWorker
  903. //
  904. #define PPW_Stopped 0
  905. #define PPW_Exit 1
  906. #define PPW_InitialState 2
  907. #define PPW_PowerUp 3
  908. #define PPW_PowerUpComplete 4
  909. #define PPW_PowerDown 5
  910. #define PPW_PowerDownComplete 6
  911. #define PPW_SendIrpDown 7
  912. #define PPW_16BitConfigure 8
  913. #define PPW_Deconfigure 9
  914. #define PPW_VerifyCard 10
  915. #define PPW_CardBusRefresh 11
  916. #define PPW_CardBusDelay 12
  917. //
  918. // phases for ConfigurationWorker
  919. //
  920. // Note that the ConfigurationPhase is simply incremented, these
  921. // definitions are just for clarity.
  922. //
  923. #define CW_Stopped 0
  924. #define CW_Phase1 1
  925. #define CW_Phase2 2
  926. #define CW_Phase3 3
  927. #define CW_Exit 4
  928. ///////////////////////////////////////////////////////////////////////////////
  929. //
  930. // pcmp.inc
  931. //
  932. ///////////////////////////////////////////////////////////////////////////////
  933. //
  934. // IMCR (Interrupt Mode Control Register) access definitions
  935. //
  936. #define ImcrDisableApic 0x00
  937. #define ImcrEnableApic 0x01
  938. #define ImcrRegPortAddr 0x22
  939. #if defined(NEC_98)
  940. #define ImcrDataPortAddr 0x700
  941. #else // defined(NEC_98)
  942. #define ImcrDataPortAddr 0x23
  943. #endif // defined(NEC_98)
  944. #define ImcrPort 0x70
  945. // Physical location where the Extended BIOS Data Area segment adress is store
  946. #define EBDA_SEGMENT_PTR 0x40e
  947. #define BASE_MEM_PTR 0x413
  948. //
  949. // The PC+MP configuration table Possible Entry Types
  950. //
  951. #define ENTRY_PROCESSOR 0
  952. #define ENTRY_BUS 1
  953. #define ENTRY_IOAPIC 2
  954. #define ENTRY_INTI 3
  955. #define ENTRY_LINTI 4
  956. #define HEADER_SIZE 0x2c
  957. // Number of default configurations for PC+MP version 1.1
  958. #define NUM_DEFAULT_CONFIGS 7
  959. //
  960. // Bits used in the CpuFlags field of the Processor entry
  961. //
  962. #define CPU_DISABLED 0x0 // 1 Bit - CPU Disabled
  963. #define CPU_ENABLED 0x1 // 1 Bit - CPU Enabled
  964. #define BSP_CPU 0x2 // Bit #2 - CPU is BSP
  965. // APIC Versions used by PC+MP systems - this is used in the
  966. // Processor entries and the IoApic Entries
  967. //
  968. #define APIC_INTEGRATED 0x10 // 8 Bits-Apic Version Register
  969. #define APIC_82489DX 0x0 // 8 Bits-Apic Version Register
  970. //
  971. // Io Apic Entry definitions
  972. //
  973. // Valid IoApicFlag values
  974. //
  975. #define IO_APIC_ENABLED 0x1
  976. #define IO_APIC_DISABLED 0x0
  977. //
  978. // Default value for Io Apic ID.
  979. //
  980. #define IOUNIT_APIC_ID 0xE
  981. //
  982. // PC+MP Signature used to verify the PC+MP table
  983. // as valid
  984. //
  985. // "P"=50H,"C"=43H,"M"=4dH,"P"=50H
  986. //
  987. #define PCMP_SIGNATURE 0x504d4350
  988. //
  989. // PC+MP Signature used to identify the floating pointer
  990. // structure (in extended BIOS data segment) that contains
  991. // a pointer to the PC+MP table.
  992. //
  993. // "_"=5fH, "M"=4dH, "P"=50H, "_"=5fH
  994. //
  995. #define MP_PTR_SIGNATURE 0x5f504d5f
  996. //
  997. // Extension table definitions
  998. //
  999. #define EXTTYPE_BUS_ADDRESS_MAP 128
  1000. #define EXTTYPE_BUS_HIERARCHY 129
  1001. #define EXTTYPE_BUS_COMPATIBLE_MAP 130
  1002. #define EXTTYPE_PERSISTENT_STORE 131
  1003. #define MPS_ADDRESS_MAP_IO 0
  1004. #define MPS_ADDRESS_MAP_MEMORY 1
  1005. #define MPS_ADDRESS_MAP_PREFETCH_MEMORY 2
  1006. #define MPS_ADDRESS_MAP_UNDEFINED 9
  1007. //
  1008. // The System configuration table as used by a PC_MP system
  1009. //
  1010. //
  1011. // The offset is relative to the BIOS starting at f0000H
  1012. //
  1013. #define PTR_OFFSET 0x0000e6f5
  1014. #define BIOS_BASE 0x000f0000
  1015. #define PCMP_IMPLEMENTED 0x01 // In MpFeatureInfoByte1
  1016. #define PCMP_CONFIG_MASK 0x0e // In MpFeatureInfoByte1
  1017. #define IMCR_MASK 0x80 // In MpFeatureInfoByte2
  1018. #define MULT_CLOCKS_MASK 0x40 // In MpFeatureInfoByte2
  1019. ///////////////////////////////////////////////////////////////////////////////
  1020. //
  1021. // pnpiop.h
  1022. //
  1023. ///////////////////////////////////////////////////////////////////////////////
  1024. typedef enum _PNP_DEVNODE_STATE {
  1025. DeviceNodeUnspecified = 0x300, // 768
  1026. DeviceNodeUninitialized, // 769
  1027. DeviceNodeInitialized, // 770
  1028. DeviceNodeDriversAdded, // 771
  1029. DeviceNodeResourcesAssigned, // 772 - Operational state for Added
  1030. DeviceNodeStartPending, // 773 - Operational state for Added
  1031. DeviceNodeStartCompletion, // 774 - Operational state for Added
  1032. DeviceNodeStartPostWork, // 775 - Operational state for Added
  1033. DeviceNodeStarted, // 776
  1034. DeviceNodeQueryStopped, // 777
  1035. DeviceNodeStopped, // 778
  1036. DeviceNodeRestartCompletion, // 779 - Operational state for Stopped
  1037. DeviceNodeEnumeratePending, // 780 - Operational state for Started
  1038. DeviceNodeEnumerateCompletion, // 781 - Operational state for Started
  1039. DeviceNodeAwaitingQueuedDeletion, // 782
  1040. DeviceNodeAwaitingQueuedRemoval, // 783
  1041. DeviceNodeQueryRemoved, // 784
  1042. DeviceNodeRemovePendingCloses, // 785
  1043. DeviceNodeRemoved, // 786
  1044. DeviceNodeDeletePendingCloses, // 787
  1045. DeviceNodeDeleted // 788
  1046. } PNP_DEVNODE_STATE, *PPNP_DEVNODE_STATE;
  1047. #define STATE_HISTORY_SIZE 20
  1048. //
  1049. // DNF_MAKEUP - this devnode's device is created and owned by PnP manager
  1050. //
  1051. #define DNF_MADEUP 0x00000001
  1052. //
  1053. // DNF_DUPLICATE - this devnode's device is a duplicate of another enumerate PDO
  1054. //
  1055. #define DNF_DUPLICATE 0x00000002
  1056. //
  1057. // DNF_HAL_NODE - a flag to indicate which device node is the root node created by
  1058. // the hal
  1059. //
  1060. #define DNF_HAL_NODE 0x00000004
  1061. //
  1062. // DNF_REENUMERATE - needs to be reenumerated
  1063. //
  1064. #define DNF_REENUMERATE 0x00000008
  1065. //
  1066. // DNF_ENUMERATED - used to track enumeration in IopEnumerateDevice()
  1067. //
  1068. #define DNF_ENUMERATED 0x00000010
  1069. //
  1070. // Singal that we need to send driver query id irps
  1071. //
  1072. #define DNF_IDS_QUERIED 0x00000020
  1073. //
  1074. // DNF_HAS_BOOT_CONFIG - the device has resource assigned by BIOS. It is considered
  1075. // pseudo-started and need to participate in rebalance.
  1076. //
  1077. #define DNF_HAS_BOOT_CONFIG 0x00000040
  1078. //
  1079. // DNF_BOOT_CONFIG_RESERVED - Indicates the BOOT resources of the device are reserved.
  1080. //
  1081. #define DNF_BOOT_CONFIG_RESERVED 0x00000080
  1082. //
  1083. // DNF_NO_RESOURCE_REQUIRED - this devnode's device does not require resource.
  1084. //
  1085. #define DNF_NO_RESOURCE_REQUIRED 0x00000100
  1086. //
  1087. // DNF_RESOURCE_REQUIREMENTS_NEED_FILTERED - to distinguished the
  1088. // DeviceNode->ResourceRequirements is a filtered list or not.
  1089. //
  1090. #define DNF_RESOURCE_REQUIREMENTS_NEED_FILTERED 0x00000200
  1091. //
  1092. // DNF_RESOURCE_REQUIREMENTS_CHANGED - Indicates the device's resource
  1093. // requirements list has been changed.
  1094. //
  1095. #define DNF_RESOURCE_REQUIREMENTS_CHANGED 0x00000400
  1096. //
  1097. // DNF_NON_STOPPED_REBALANC - indicates the device can be restarted with new
  1098. // resources without being stopped.
  1099. //
  1100. #define DNF_NON_STOPPED_REBALANCE 0x00000800
  1101. //
  1102. // The device's controlling driver is a legacy driver
  1103. //
  1104. #define DNF_LEGACY_DRIVER 0x00001000
  1105. //
  1106. // This corresponds to the user-mode CM_PROB_WILL_BE_REMOVED problem value and
  1107. // the DN_WILL_BE_REMOVED status flag.
  1108. //
  1109. #define DNF_HAS_PROBLEM 0x00002000
  1110. //
  1111. // DNF_HAS_PRIVATE_PROBLEM - indicates this device reported PNP_DEVICE_FAILED
  1112. // to a IRP_MN_QUERY_PNP_DEVICE_STATE without also reporting
  1113. // PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED.
  1114. //
  1115. #define DNF_HAS_PRIVATE_PROBLEM 0x00004000
  1116. //
  1117. // DNF_HARDWARE_VERIFICATION is set on device nodes that have hardware
  1118. // verification (probably via WHQL applet).
  1119. //
  1120. #define DNF_HARDWARE_VERIFICATION 0x00008000
  1121. //
  1122. // DNF_DEVICE_GONE is set when a pdo is no longer returned in a query bus
  1123. // relations. It will then be processed as a surprise remove if started.
  1124. // This flag is used to better detect when a device is resurrected, and when
  1125. // processing surprise remove, to determine if the devnode should be removed
  1126. // from the tree.
  1127. //
  1128. #define DNF_DEVICE_GONE 0x00010000
  1129. //
  1130. // DNF_LEGACY_RESOURCE_DEVICENODE is set for device nodes created for legacy
  1131. // resource allocation.
  1132. //
  1133. #define DNF_LEGACY_RESOURCE_DEVICENODE 0x00020000
  1134. //
  1135. // DNF_NEEDS_REBALANCE is set for device nodes that trigger rebalance.
  1136. //
  1137. #define DNF_NEEDS_REBALANCE 0x00040000
  1138. //
  1139. // DNF_LOCKED_FOR_EJECT is set on device nodes that are being ejected or are
  1140. // related to a device being ejected.
  1141. //
  1142. #define DNF_LOCKED_FOR_EJECT 0x00080000
  1143. //
  1144. // DNF_DRIVER_BLOCKED is set on device nodes that use one or more drivers that
  1145. // have been blocked from loading.
  1146. //
  1147. #define DNF_DRIVER_BLOCKED 0x00100000
  1148. //
  1149. // This corresponds to the user-mode the DN_WILL_BE_REMOVED status flag.
  1150. //
  1151. #define DNUF_WILL_BE_REMOVED 0x00000001
  1152. //
  1153. // This corresponds to the user-mode DN_NO_SHOW_IN_DM status flag.
  1154. //
  1155. #define DNUF_DONT_SHOW_IN_UI 0x00000002
  1156. //
  1157. // This flag is set when user-mode lets us know that a reboot is required
  1158. // for this device.
  1159. //
  1160. #define DNUF_NEED_RESTART 0x00000004
  1161. //
  1162. // This flag is set to let the user-mode know when a device can be disabled
  1163. // it is still possible for this to be TRUE, yet disable to fail, as it's
  1164. // a polled flag (see also PNP_DEVICE_NOT_DISABLEABLE)
  1165. //
  1166. #define DNUF_NOT_DISABLEABLE 0x00000008
  1167. //
  1168. // Flags used during shutdown when the IO Verifier is trying to remove all
  1169. // PNP devices.
  1170. //
  1171. // DNUF_SHUTDOWN_QUERIED is set when we issue the QueryRemove to a devnode.
  1172. //
  1173. // DNUF_SHUTDOWN_SUBTREE_DONE is set once we've issued the QueryRemove to all
  1174. // a Devnodes descendants.
  1175. //
  1176. #define DNUF_SHUTDOWN_QUERIED 0x00000010
  1177. #define DNUF_SHUTDOWN_SUBTREE_DONE 0x00000020
  1178. //
  1179. // IOP_RESOURCE_REQUEST
  1180. //
  1181. #define QUERY_RESOURCE_LIST 0
  1182. #define QUERY_RESOURCE_REQUIREMENTS 1
  1183. #define REGISTRY_ALLOC_CONFIG 1
  1184. #define REGISTRY_FORCED_CONFIG 2
  1185. #define REGISTRY_BOOT_CONFIG 4
  1186. #define REGISTRY_OVERRIDE_CONFIGVECTOR 1
  1187. #define REGISTRY_BASIC_CONFIGVECTOR 2
  1188. ///////////////////////////////////////////////////////////////////////////////
  1189. //
  1190. // pnpmgr.h
  1191. //
  1192. ///////////////////////////////////////////////////////////////////////////////
  1193. //
  1194. // Private device events
  1195. //
  1196. DEFINE_GUID( GUID_DEVICE_ARRIVAL, 0xcb3a4009L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1197. DEFINE_GUID( GUID_DEVICE_ENUMERATED, 0xcb3a400AL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1198. DEFINE_GUID( GUID_DEVICE_ENUMERATE_REQUEST, 0xcb3a400BL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1199. DEFINE_GUID( GUID_DEVICE_START_REQUEST, 0xcb3a400CL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1200. DEFINE_GUID( GUID_DEVICE_REMOVE_PENDING, 0xcb3a400DL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1201. DEFINE_GUID( GUID_DEVICE_QUERY_AND_REMOVE, 0xcb3a400EL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1202. DEFINE_GUID( GUID_DEVICE_EJECT, 0xcb3a400FL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1203. DEFINE_GUID( GUID_DEVICE_NOOP, 0xcb3a4010L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1204. DEFINE_GUID( GUID_DEVICE_SURPRISE_REMOVAL, 0xce5af000L, 0x80dd, 0x11d2, 0xa8, 0x8d, 0x00, 0xa0, 0xc9, 0x69, 0x6b, 0x4b);
  1205. //
  1206. // Private driver events
  1207. //
  1208. DEFINE_GUID( GUID_DRIVER_BLOCKED, 0x1bc87a21L, 0xa3ff, 0x47a6, 0x96, 0xaa, 0x6d, 0x01, 0x09, 0x06, 0x80, 0x5a);
  1209. //
  1210. // Standard interface device classes
  1211. //
  1212. DEFINE_GUID( GUID_CLASS_VOLUME, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x72);
  1213. DEFINE_GUID( GUID_CLASS_LPTPORT, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x74);
  1214. DEFINE_GUID( GUID_CLASS_NET, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x75);
  1215. ///////////////////////////////////////////////////////////////////////////////
  1216. //
  1217. // po.h
  1218. //
  1219. ///////////////////////////////////////////////////////////////////////////////
  1220. #define PO_ORDER_NOT_VIDEO 0x0001
  1221. #define PO_ORDER_ROOT_ENUM 0x0002
  1222. #define PO_ORDER_PAGABLE 0x0004
  1223. #define PO_ORDER_MAXIMUM 0x0007
  1224. // notify GDI before this order level
  1225. #define PO_ORDER_GDI_NOTIFICATION (PO_ORDER_PAGABLE)
  1226. ///////////////////////////////////////////////////////////////////////////////
  1227. //
  1228. // pop.h
  1229. //
  1230. ///////////////////////////////////////////////////////////////////////////////
  1231. //
  1232. // constants
  1233. //
  1234. #define PO_IDLE_SCAN_INTERVAL 1 // scan interval in seconds
  1235. //
  1236. // Values for ios.Parameters.SystemContext
  1237. #define POP_NO_CONTEXT 0
  1238. #define POP_FLAG_CONTEXT 1 // if true, it's flags
  1239. #define POP_DEVICE_REQUEST (0x2 | POP_FLAG_CONTEXT) // an irp sent by RequestPowerChange
  1240. #define POP_INRUSH_CONTEXT (0x4 | POP_FLAG_CONTEXT) // the active INRUSH irp
  1241. #define POP_COUNT_CONTEXT 0xff000000 // byte used for next counting
  1242. #define POP_COUNT_SHIFT 24
  1243. #define PO_ERROR 0x00000001
  1244. #define PO_WARN 0x00000002
  1245. #define PO_BATT 0x00000004
  1246. #define PO_PACT 0x00000008
  1247. #define PO_NOTIFY 0x00000010
  1248. #define PO_THERM 0x00000020
  1249. #define PO_THROTTLE 0x00000040
  1250. #define PO_HIBERNATE 0x00000080
  1251. #define PO_POCALL 0x00000200
  1252. #define PO_SYSDEV 0x00000400
  1253. #define PO_THERM_DETAIL 0x20000000
  1254. #define PO_SIDLE 0x40000000
  1255. #define PO_HIBER_MAP 0x80000000
  1256. #define POP_SIM_CAPABILITIES 0x00000001
  1257. #define POP_SIM_ALL_CAPABILITIES 0x00000002
  1258. #define POP_ALLOW_AC_THROTTLE 0x00000004
  1259. #define POP_IGNORE_S1 0x00000008
  1260. #define POP_IGNORE_UNSUPPORTED_DRIVERS 0x00000010
  1261. #define POP_IGNORE_S3 0x00000020
  1262. #define POP_IGNORE_S2 0x00000040
  1263. #define POP_LOOP_ON_FAILED_DRIVERS 0x00000080
  1264. #define POP_CRC_MEMORY 0x00000100
  1265. #define POP_IGNORE_CRC_FAILURES 0x00000200
  1266. #define POP_TEST_CRC_MEMORY 0x00000400
  1267. #define POP_DEBUG_HIBER_FILE 0x00000800
  1268. #define POP_RESET_ON_HIBER 0x00001000
  1269. #define POP_IGNORE_S4 0x00002000
  1270. #define POP_USE_S4BIOS 0x00004000
  1271. #define POP_IGNORE_HIBER_SYMBOL_UNLOAD 0x00008000
  1272. #define POP_ENABLE_HIBER_PERF 0x00010000
  1273. //
  1274. // Universal Power Data - stored in DeviceObject->DeviceObjectExtension->PowerFlags
  1275. //
  1276. #define POPF_SYSTEM_STATE 0xf // 4 bits for S0 to S5
  1277. #define POPF_DEVICE_STATE 0xf0 // 4 bits to hold D0 to D3
  1278. #define POPF_SYSTEM_ACTIVE 0x100 // True if S irp active at this DO
  1279. #define POPF_SYSTEM_PENDING 0x200 // True if S irp pending (0x100 must be 1)
  1280. #define POPF_DEVICE_ACTIVE 0x400 // same as SYSTEM_ACTIVE but for DEVICE
  1281. #define POPF_DEVICE_PENDING 0x800 // same as SYSTEM_PENDING but for DEVICE
  1282. #define PO_PM_USER 0x01 // nice to inform user mode, but not needed
  1283. #define PO_PM_REISSUE 0x02 // sleep promotoed to shutdown
  1284. #define PO_PM_SETSTATE 0x04 // recomputed something to do with the viable state
  1285. #define PO_ACT_IDLE 0
  1286. #define PO_ACT_NEW_REQUEST 1
  1287. #define PO_ACT_CALLOUT 2
  1288. #define PO_ACT_SET_SYSTEM_STATE 3
  1289. //
  1290. // Types for POP_ACTION_TRIGGER
  1291. //
  1292. typedef enum {
  1293. PolicyDeviceSystemButton,
  1294. PolicyDeviceThermalZone,
  1295. PolicyDeviceBattery,
  1296. PolicyInitiatePowerActionAPI,
  1297. PolicySetPowerStateAPI,
  1298. PolicyImmediateDozeS4,
  1299. PolicySystemIdle
  1300. } POP_POLICY_DEVICE_TYPE;
  1301. #define PO_TRG_USER 0x01 // User action initiated
  1302. #define PO_TRG_SYSTEM 0x02 // System action initiated
  1303. #define PO_TRG_SYNC 0x20 // Trigger is synchronous
  1304. #define PO_TRG_SET 0x80 // Event enabled or disabled
  1305. // POP_THERMAL_ZONE.State
  1306. #define PO_TZ_NO_STATE 0
  1307. #define PO_TZ_READ_STATE 1
  1308. #define PO_TZ_SET_MODE 2
  1309. #define PO_TZ_SET_ACTIVE 3
  1310. // POP_THERMAL_ZONE.Flags
  1311. #define PO_TZ_THROTTLING 0x01
  1312. #define PO_TZ_CLEANUP 0x80
  1313. #define PO_TZ_THROTTLE_SCALE 10 // temp reported in 1/10ths kelin
  1314. #define PO_TZ_NO_THROTTLE (100 * PO_TZ_THROTTLE_SCALE)
  1315. // PopCoolingMode
  1316. #define PO_TZ_ACTIVE 0
  1317. #define PO_TZ_PASSIVE 1
  1318. #define PO_TZ_INVALID_MODE 2
  1319. //
  1320. // Action timeouts
  1321. //
  1322. #define POP_ACTION_TIMEOUT 30
  1323. #define POP_ACTION_CANCEL_TIMEOUT 5
  1324. ///////////////////////////////////////////////////////////////////////////////
  1325. //
  1326. // pool.h
  1327. //
  1328. ///////////////////////////////////////////////////////////////////////////////
  1329. #define POOL_QUOTA_MASK 8
  1330. #define POOL_TYPE_MASK (3)
  1331. #define POOL_OVERHEAD ((LONG)GetTypeSize("POOL_HEADER"))
  1332. //
  1333. // Define pool tracking information.
  1334. //
  1335. #define POOL_BACKTRACEINDEX_PRESENT 0x8000
  1336. ///////////////////////////////////////////////////////////////////////////////
  1337. //
  1338. // range.h
  1339. //
  1340. ///////////////////////////////////////////////////////////////////////////////
  1341. //
  1342. // Range list structures
  1343. //
  1344. #define RTLP_RANGE_LIST_ENTRY_MERGED 0x0001
  1345. ///////////////////////////////////////////////////////////////////////////////
  1346. //
  1347. // srb.h
  1348. //
  1349. ///////////////////////////////////////////////////////////////////////////////
  1350. //
  1351. // Port driver error codes
  1352. //
  1353. #define SP_BUS_PARITY_ERROR 0x0001
  1354. #define SP_UNEXPECTED_DISCONNECT 0x0002
  1355. #define SP_INVALID_RESELECTION 0x0003
  1356. #define SP_BUS_TIME_OUT 0x0004
  1357. #define SP_PROTOCOL_ERROR 0x0005
  1358. #define SP_INTERNAL_ADAPTER_ERROR 0x0006
  1359. #define SP_REQUEST_TIMEOUT 0x0007
  1360. #define SP_IRQ_NOT_RESPONDING 0x0008
  1361. #define SP_BAD_FW_WARNING 0x0009
  1362. #define SP_BAD_FW_ERROR 0x000a
  1363. #define SP_LOST_WMI_MINIPORT_REQUEST 0x000b
  1364. //
  1365. // Return values for SCSI_HW_FIND_ADAPTER.
  1366. //
  1367. #define SP_RETURN_NOT_FOUND 0
  1368. #define SP_RETURN_FOUND 1
  1369. #define SP_RETURN_ERROR 2
  1370. #define SP_RETURN_BAD_CONFIG 3
  1371. //
  1372. // Notification Event Types
  1373. //
  1374. typedef enum _SCSI_NOTIFICATION_TYPE {
  1375. RequestComplete,
  1376. NextRequest,
  1377. NextLuRequest,
  1378. ResetDetected,
  1379. CallDisableInterrupts,
  1380. CallEnableInterrupts,
  1381. RequestTimerCall,
  1382. BusChangeDetected, /* New */
  1383. WMIEvent,
  1384. WMIReregister
  1385. } SCSI_NOTIFICATION_TYPE, *PSCSI_NOTIFICATION_TYPE;
  1386. //
  1387. // SRB Functions
  1388. //
  1389. #define SRB_FUNCTION_EXECUTE_SCSI 0x00
  1390. #define SRB_FUNCTION_CLAIM_DEVICE 0x01
  1391. #define SRB_FUNCTION_IO_CONTROL 0x02
  1392. #define SRB_FUNCTION_RECEIVE_EVENT 0x03
  1393. #define SRB_FUNCTION_RELEASE_QUEUE 0x04
  1394. #define SRB_FUNCTION_ATTACH_DEVICE 0x05
  1395. #define SRB_FUNCTION_RELEASE_DEVICE 0x06
  1396. #define SRB_FUNCTION_SHUTDOWN 0x07
  1397. #define SRB_FUNCTION_FLUSH 0x08
  1398. #define SRB_FUNCTION_ABORT_COMMAND 0x10
  1399. #define SRB_FUNCTION_RELEASE_RECOVERY 0x11
  1400. #define SRB_FUNCTION_RESET_BUS 0x12
  1401. #define SRB_FUNCTION_RESET_DEVICE 0x13
  1402. #define SRB_FUNCTION_TERMINATE_IO 0x14
  1403. #define SRB_FUNCTION_FLUSH_QUEUE 0x15
  1404. #define SRB_FUNCTION_REMOVE_DEVICE 0x16
  1405. #define SRB_FUNCTION_WMI 0x17
  1406. #define SRB_FUNCTION_LOCK_QUEUE 0x18
  1407. #define SRB_FUNCTION_UNLOCK_QUEUE 0x19
  1408. //
  1409. // SRB Status Masks
  1410. //
  1411. #define SRB_STATUS_QUEUE_FROZEN 0x40
  1412. #define SRB_STATUS_AUTOSENSE_VALID 0x80
  1413. #define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
  1414. //
  1415. // SRB Flag Bits
  1416. //
  1417. #define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002
  1418. #define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004
  1419. #define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
  1420. #define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010
  1421. #define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
  1422. #define SRB_FLAGS_DATA_IN 0x00000040
  1423. #define SRB_FLAGS_DATA_OUT 0x00000080
  1424. #define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
  1425. #define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
  1426. #define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100
  1427. #define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200
  1428. #define SRB_FLAGS_IS_ACTIVE 0x00010000
  1429. #define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000
  1430. #define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000
  1431. #define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000
  1432. #define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000
  1433. #define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000
  1434. #define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000
  1435. //
  1436. // Queue Action
  1437. //
  1438. #define SRB_SIMPLE_TAG_REQUEST 0x20
  1439. #define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21
  1440. #define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22
  1441. #define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01
  1442. ///////////////////////////////////////////////////////////////////////////////
  1443. //
  1444. // trackirp.h
  1445. //
  1446. ///////////////////////////////////////////////////////////////////////////////
  1447. #define DOE_DESIGNATED_FDO 0x80000000
  1448. #define DOE_BOTTOM_OF_FDO_STACK 0x40000000
  1449. #define DOE_RAW_FDO 0x20000000
  1450. #define DOE_EXAMINED 0x10000000
  1451. #define DOE_TRACKED 0x08000000
  1452. #define ASSERTFLAG_TRACKIRPS 0x00000001
  1453. #define ASSERTFLAG_MONITOR_ALLOCS 0x00000002
  1454. #define ASSERTFLAG_POLICEIRPS 0x00000004
  1455. #define ASSERTFLAG_MONITORMAJORS 0x00000008
  1456. #define ASSERTFLAG_SURROGATE 0x00000010
  1457. #define ASSERTFLAG_SMASH_SRBS 0x00000020
  1458. #define ASSERTFLAG_CONSUME_ALWAYS 0x00000040
  1459. #define ASSERTFLAG_FORCEPENDING 0x00000080
  1460. #define ASSERTFLAG_COMPLETEATDPC 0x00000100
  1461. #define ASSERTFLAG_COMPLETEATPASSIVE 0x00000200
  1462. #define ASSERTFLAG_DEFERCOMPLETION 0x00000800
  1463. #define ASSERTFLAG_ROTATE_STATUS 0x00001000
  1464. // ----------
  1465. #define ASSERTMASK_COMPLETESTYLE 0x00000F80
  1466. #define ASSERTFLAG_SEEDSTACK 0x00010000
  1467. //
  1468. // Disabling HACKHACKS_ENABLED will remove support for all hack code. The
  1469. // hack code allows the machine to fully boot in checked builds. Note that
  1470. // those hacks can be individually disabled by setting the IovpHackFlags
  1471. // variable at boot time.
  1472. //
  1473. #define HACKHACKS_ENABLED
  1474. #define HACKFLAG_FOR_MUP 0x00000001
  1475. #define HACKFLAG_FOR_SCSIPORT 0x00000002
  1476. #define HACKFLAG_FOR_ACPI 0x00000004
  1477. #define HACKFLAG_FOR_BOGUSIRPS 0x00000008
  1478. ///////////////////////////////////////////////////////////////////////////////
  1479. //
  1480. // wdm.h
  1481. //
  1482. ///////////////////////////////////////////////////////////////////////////////
  1483. //
  1484. // POWER minor function codes
  1485. //
  1486. #define IRP_MN_WAIT_WAKE 0x00
  1487. #define IRP_MN_POWER_SEQUENCE 0x01
  1488. #define IRP_MN_SET_POWER 0x02
  1489. #define IRP_MN_QUERY_POWER 0x03
  1490. //
  1491. // Device Control Request minor function codes for SCSI support. Note that
  1492. // user requests are assumed to be zero.
  1493. //
  1494. #define IRP_MN_SCSI_CLASS 0x01
  1495. //
  1496. // PNP minor function codes.
  1497. //
  1498. #define IRP_MN_START_DEVICE 0x00
  1499. #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
  1500. #define IRP_MN_REMOVE_DEVICE 0x02
  1501. #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
  1502. #define IRP_MN_STOP_DEVICE 0x04
  1503. #define IRP_MN_QUERY_STOP_DEVICE 0x05
  1504. #define IRP_MN_CANCEL_STOP_DEVICE 0x06
  1505. #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
  1506. #define IRP_MN_QUERY_INTERFACE 0x08
  1507. #define IRP_MN_QUERY_CAPABILITIES 0x09
  1508. #define IRP_MN_QUERY_RESOURCES 0x0A
  1509. #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
  1510. #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
  1511. #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
  1512. #define IRP_MN_READ_CONFIG 0x0F
  1513. #define IRP_MN_WRITE_CONFIG 0x10
  1514. #define IRP_MN_EJECT 0x11
  1515. #define IRP_MN_SET_LOCK 0x12
  1516. #define IRP_MN_QUERY_ID 0x13
  1517. #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
  1518. #define IRP_MN_QUERY_BUS_INFORMATION 0x15
  1519. #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
  1520. #define IRP_MN_SURPRISE_REMOVAL 0x17
  1521. #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
  1522. // begin_ntminiport
  1523. //
  1524. // WMI minor function codes under IRP_MJ_SYSTEM_CONTROL
  1525. //
  1526. #define IRP_MN_QUERY_ALL_DATA 0x00
  1527. #define IRP_MN_QUERY_SINGLE_INSTANCE 0x01
  1528. #define IRP_MN_CHANGE_SINGLE_INSTANCE 0x02
  1529. #define IRP_MN_CHANGE_SINGLE_ITEM 0x03
  1530. #define IRP_MN_ENABLE_EVENTS 0x04
  1531. #define IRP_MN_DISABLE_EVENTS 0x05
  1532. #define IRP_MN_ENABLE_COLLECTION 0x06
  1533. #define IRP_MN_DISABLE_COLLECTION 0x07
  1534. #define IRP_MN_REGINFO 0x08
  1535. #define IRP_MN_EXECUTE_METHOD 0x09
  1536. //
  1537. // Define PNP/POWER types required by IRP_MJ_PNP/IRP_MJ_POWER.
  1538. //
  1539. typedef enum _DEVICE_RELATION_TYPE {
  1540. BusRelations,
  1541. EjectionRelations,
  1542. PowerRelations,
  1543. RemovalRelations,
  1544. TargetDeviceRelation
  1545. } DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE;
  1546. typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
  1547. DeviceUsageTypeUndefined,
  1548. DeviceUsageTypePaging,
  1549. DeviceUsageTypeHibernation,
  1550. DeviceUsageTypeDumpFile
  1551. } DEVICE_USAGE_NOTIFICATION_TYPE;
  1552. typedef enum {
  1553. BusQueryDeviceID = 0, // <Enumerator>\<Enumerator-specific device id>
  1554. BusQueryHardwareIDs = 1, // Hardware ids
  1555. BusQueryCompatibleIDs = 2, // compatible device ids
  1556. BusQueryInstanceID = 3, // persistent id for this instance of the device
  1557. BusQueryDeviceSerialNumber = 4 // serial number for this device
  1558. } BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE;
  1559. typedef enum {
  1560. DeviceTextDescription = 0, // DeviceDesc property
  1561. DeviceTextLocationInformation = 1 // DeviceLocation property
  1562. } DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE;
  1563. #define FILE_DEVICE_BEEP 0x00000001
  1564. #define FILE_DEVICE_CD_ROM 0x00000002
  1565. #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
  1566. #define FILE_DEVICE_CONTROLLER 0x00000004
  1567. #define FILE_DEVICE_DATALINK 0x00000005
  1568. #define FILE_DEVICE_DFS 0x00000006
  1569. #define FILE_DEVICE_DISK 0x00000007
  1570. #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
  1571. #define FILE_DEVICE_FILE_SYSTEM 0x00000009
  1572. #define FILE_DEVICE_INPORT_PORT 0x0000000a
  1573. #define FILE_DEVICE_KEYBOARD 0x0000000b
  1574. #define FILE_DEVICE_MAILSLOT 0x0000000c
  1575. #define FILE_DEVICE_MIDI_IN 0x0000000d
  1576. #define FILE_DEVICE_MIDI_OUT 0x0000000e
  1577. #define FILE_DEVICE_MOUSE 0x0000000f
  1578. #define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
  1579. #define FILE_DEVICE_NAMED_PIPE 0x00000011
  1580. #define FILE_DEVICE_NETWORK 0x00000012
  1581. #define FILE_DEVICE_NETWORK_BROWSER 0x00000013
  1582. #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
  1583. #define FILE_DEVICE_NULL 0x00000015
  1584. #define FILE_DEVICE_PARALLEL_PORT 0x00000016
  1585. #define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
  1586. #define FILE_DEVICE_PRINTER 0x00000018
  1587. #define FILE_DEVICE_SCANNER 0x00000019
  1588. #define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
  1589. #define FILE_DEVICE_SERIAL_PORT 0x0000001b
  1590. #define FILE_DEVICE_SCREEN 0x0000001c
  1591. #define FILE_DEVICE_SOUND 0x0000001d
  1592. #define FILE_DEVICE_STREAMS 0x0000001e
  1593. #define FILE_DEVICE_TAPE 0x0000001f
  1594. #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
  1595. #define FILE_DEVICE_TRANSPORT 0x00000021
  1596. #define FILE_DEVICE_UNKNOWN 0x00000022
  1597. #define FILE_DEVICE_VIDEO 0x00000023
  1598. #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
  1599. #define FILE_DEVICE_WAVE_IN 0x00000025
  1600. #define FILE_DEVICE_WAVE_OUT 0x00000026
  1601. #define FILE_DEVICE_8042_PORT 0x00000027
  1602. #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
  1603. #define FILE_DEVICE_BATTERY 0x00000029
  1604. #define FILE_DEVICE_BUS_EXTENDER 0x0000002a
  1605. #define FILE_DEVICE_MODEM 0x0000002b
  1606. #define FILE_DEVICE_VDM 0x0000002c
  1607. #define FILE_DEVICE_MASS_STORAGE 0x0000002d
  1608. #define FILE_DEVICE_SMB 0x0000002e
  1609. #define FILE_DEVICE_KS 0x0000002f
  1610. #define FILE_DEVICE_CHANGER 0x00000030
  1611. #define FILE_DEVICE_SMARTCARD 0x00000031
  1612. #define FILE_DEVICE_ACPI 0x00000032
  1613. #define FILE_DEVICE_DVD 0x00000033
  1614. #define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
  1615. #define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
  1616. #define FILE_DEVICE_DFS_VOLUME 0x00000036
  1617. #define FILE_DEVICE_SERENUM 0x00000037
  1618. #define FILE_DEVICE_TERMSRV 0x00000038
  1619. #define FILE_DEVICE_KSEC 0x00000039
  1620. //
  1621. // Macro definition for defining IOCTL and FSCTL function control codes. Note
  1622. // that function codes 0-2047 are reserved for Microsoft Corporation, and
  1623. // 2048-4095 are reserved for customers.
  1624. //
  1625. #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
  1626. ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
  1627. )
  1628. ///////////////////////////////////////////////////////////////////////////////
  1629. //
  1630. // wdmaud.h
  1631. //
  1632. ///////////////////////////////////////////////////////////////////////////////
  1633. #define WDMAUD_CTL_CODE CTL_CODE
  1634. #define IOCTL_SOUND_BASE FILE_DEVICE_SOUND
  1635. #define IOCTL_WDMAUD_BASE 0x0000
  1636. #define IOCTL_WAVE_BASE 0x0040
  1637. #define IOCTL_MIDI_BASE 0x0080
  1638. #define IOCTL_MIXER_BASE 0x00C0
  1639. #define IOCTL_WDMAUD_INIT WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1640. #define IOCTL_WDMAUD_ADD_DEVNODE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1641. #define IOCTL_WDMAUD_REMOVE_DEVNODE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1642. #define IOCTL_WDMAUD_GET_CAPABILITIES WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1643. #define IOCTL_WDMAUD_GET_NUM_DEVS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1644. #define IOCTL_WDMAUD_OPEN_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1645. #define IOCTL_WDMAUD_CLOSE_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1646. #define IOCTL_WDMAUD_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1647. #define IOCTL_WDMAUD_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1648. #define IOCTL_WDMAUD_EXIT WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1649. #define IOCTL_WDMAUD_SET_PREFERRED_DEVICE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x000a, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1650. #define IOCTL_WDMAUD_WAVE_OUT_PAUSE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1651. #define IOCTL_WDMAUD_WAVE_OUT_PLAY WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1652. #define IOCTL_WDMAUD_WAVE_OUT_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1653. #define IOCTL_WDMAUD_WAVE_OUT_BREAKLOOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1654. #define IOCTL_WDMAUD_WAVE_OUT_GET_POS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1655. #define IOCTL_WDMAUD_WAVE_OUT_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1656. #define IOCTL_WDMAUD_WAVE_OUT_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1657. #define IOCTL_WDMAUD_WAVE_OUT_WRITE_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1658. #define IOCTL_WDMAUD_WAVE_IN_STOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1659. #define IOCTL_WDMAUD_WAVE_IN_RECORD WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0011, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1660. #define IOCTL_WDMAUD_WAVE_IN_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0012, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1661. #define IOCTL_WDMAUD_WAVE_IN_GET_POS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0013, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1662. #define IOCTL_WDMAUD_WAVE_IN_READ_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0014, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1663. #define IOCTL_WDMAUD_MIDI_OUT_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1664. #define IOCTL_WDMAUD_MIDI_OUT_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1665. #define IOCTL_WDMAUD_MIDI_OUT_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1666. #define IOCTL_WDMAUD_MIDI_OUT_WRITE_DATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1667. #define IOCTL_WDMAUD_MIDI_OUT_WRITE_LONGDATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1668. #define IOCTL_WDMAUD_MIDI_IN_STOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1669. #define IOCTL_WDMAUD_MIDI_IN_RECORD WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0011, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1670. #define IOCTL_WDMAUD_MIDI_IN_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0012, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1671. #define IOCTL_WDMAUD_MIDI_IN_READ_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0013, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1672. #define IOCTL_WDMAUD_MIXER_OPEN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1673. #define IOCTL_WDMAUD_MIXER_CLOSE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1674. #define IOCTL_WDMAUD_MIXER_GETLINEINFO WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1675. #define IOCTL_WDMAUD_MIXER_GETLINECONTROLS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1676. #define IOCTL_WDMAUD_MIXER_GETCONTROLDETAILS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1677. #define IOCTL_WDMAUD_MIXER_SETCONTROLDETAILS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1678. #define IOCTL_WDMAUD_MIXER_GETHARDWAREEVENTDATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  1679. ///////////////////////////////////////////////////////////////////////////////
  1680. //
  1681. // wdguid.h
  1682. //
  1683. ///////////////////////////////////////////////////////////////////////////////
  1684. //
  1685. // Device events that can be broadcasted to drivers and user-mode apps.
  1686. //
  1687. DEFINE_GUID( GUID_HWPROFILE_QUERY_CHANGE, 0xcb3a4001L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  1688. DEFINE_GUID( GUID_HWPROFILE_CHANGE_CANCELLED, 0xcb3a4002L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  1689. DEFINE_GUID( GUID_HWPROFILE_CHANGE_COMPLETE, 0xcb3a4003L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  1690. DEFINE_GUID( GUID_DEVICE_INTERFACE_ARRIVAL, 0xcb3a4004L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  1691. DEFINE_GUID( GUID_DEVICE_INTERFACE_REMOVAL, 0xcb3a4005L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  1692. DEFINE_GUID( GUID_TARGET_DEVICE_QUERY_REMOVE, 0xcb3a4006L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  1693. DEFINE_GUID( GUID_TARGET_DEVICE_REMOVE_CANCELLED, 0xcb3a4007L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  1694. DEFINE_GUID( GUID_TARGET_DEVICE_REMOVE_COMPLETE, 0xcb3a4008L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  1695. DEFINE_GUID( GUID_PNP_CUSTOM_NOTIFICATION, 0xACA73F8EL, 0x8D23, 0x11D1, 0xAC, 0x7D, 0x00, 0x00, 0xF8, 0x75, 0x71, 0xD0 );
  1696. DEFINE_GUID( GUID_PNP_POWER_NOTIFICATION, 0xC2CF0660L, 0xEB7A, 0x11D1, 0xBD, 0x7F, 0x00, 0x00, 0xF8, 0x75, 0x71, 0xD0 );
  1697. #endif // _EXTFLAGS_