Source code of Windows XP (NT5)
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.

2756 lines
95 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. #if 0
  12. ///////////////////////////////////////////////////////////////////////////////
  13. //
  14. // apic.inc
  15. //
  16. ///////////////////////////////////////////////////////////////////////////////
  17. //
  18. // Default Physical addresses of the APICs in a PC+MP system
  19. //
  20. #define IO_BASE_ADDRESS 0xFEC00000 // Default address of
  21. // 1st IO Apic
  22. #define LU_BASE_ADDRESS 0xFEE00000 // Default address
  23. // of Local Apic
  24. #define IO_REGISTER_SELECT 0x00000000 //
  25. #define IO_REGISTER_WINDOW 0x00000010 //
  26. #define IO_ID_REGISTER 0x00000000
  27. #define IO_VERS_REGISTER 0x00000001
  28. #define IO_ARB_ID_REGISTER 0x00000002
  29. #define IO_REDIR_00_LOW 0x00000010
  30. #define IO_REDIR_00_HIGH 0x00000011
  31. #define IO_MAX_REDIR_MASK 0x00FF0000
  32. #define IO_VERSION_MASK 0x000000FF
  33. #define LU_ID_REGISTER 0x00000020 //
  34. #define LU_VERS_REGISTER 0x00000030 //
  35. #define LU_TPR 0x00000080 //
  36. #define LU_APR 0x00000090 //
  37. #define LU_PPR 0x000000A0 //
  38. #define LU_EOI 0x000000B0 //
  39. #define LU_REMOTE_REGISTER 0x000000C0 //
  40. #define LU_LOGICAL_DEST 0x000000D0 //
  41. #define LU_LOGICAL_DEST_MASK 0xFF000000
  42. #define LU_DEST_FORMAT 0x000000E0 //
  43. #define LU_DEST_FORMAT_MASK 0xF0000000
  44. #define LU_DEST_FORMAT_FLAT 0xFFFFFFFF
  45. #define LU_DEST_FORMAT_CLUSTER 0x0FFFFFFF
  46. #define LU_SPURIOUS_VECTOR 0x000000F0 //
  47. #define LU_FAULT_VECTOR 0x00000370 //
  48. #define LU_UNIT_ENABLED 0x00000100
  49. #define LU_UNIT_DISABLED 0x00000000
  50. #define LU_ISR_0 0x00000100 //
  51. #define LU_TMR_0 0x00000180 //
  52. #define LU_IRR_0 0x00000200 //
  53. #define LU_ERROR_STATUS 0x00000280 //
  54. #define LU_INT_CMD_LOW 0x00000300 //
  55. #define LU_INT_CMD_HIGH 0x00000310 //
  56. #define LU_TIMER_VECTOR 0x00000320 //
  57. #define LU_PERF_VECTOR 0x00000340
  58. #define LU_INT_VECTOR_0 0x00000350 // TEMPORARY - do not use
  59. #define LU_INT_VECTOR_1 0x00000360 // TEMPORARY - do not use
  60. #define LU_INITIAL_COUNT 0x00000380 //
  61. #define LU_CURRENT_COUNT 0x00000390 //
  62. #define LU_DIVIDER_CONFIG 0x000003E0 //
  63. #define APIC_ID_MASK 0xFF000000
  64. #define APIC_ID_SHIFT 24
  65. #define INT_VECTOR_MASK 0x000000FF
  66. #define RESERVED_HIGH_INT 0x000000F8
  67. #define DELIVERY_MODE_MASK 0x00000700
  68. #define DELIVER_FIXED 0x00000000
  69. #define DELIVER_LOW_PRIORITY 0x00000100
  70. #define DELIVER_SMI 0x00000200
  71. #define DELIVER_REMOTE_READ 0x00000300
  72. #define DELIVER_NMI 0x00000400
  73. #define DELIVER_INIT 0x00000500
  74. #define DELIVER_STARTUP 0x00000600
  75. #define DELIVER_EXTINT 0x00000700
  76. #define PHYSICAL_DESTINATION 0x00000000
  77. #define LOGICAL_DESTINATION 0x00000800
  78. #define DELIVERY_PENDING 0x00001000
  79. #define ACTIVE_LOW 0x00002000
  80. #define ACTIVE_HIGH 0x00000000
  81. #define REMOTE_IRR 0x00004000
  82. #define LEVEL_TRIGGERED 0x00008000
  83. #define EDGE_TRIGGERED 0x00000000
  84. #define INTERRUPT_MASKED 0x00010000
  85. #define INTERRUPT_MOT_MASKED 0x00000000
  86. #define PERIODIC_TIMER 0x00020000
  87. #define ICR_LEVEL_ASSERTED 0x00004000
  88. #define ICR_LEVEL_DEASSERTED 0x00000000
  89. #define ICR_RR_STATUS_MASK 0x00030000
  90. #define ICR_RR_INVALID 0x00000000
  91. #define ICR_RR_IN_PROGRESS 0x00010000
  92. #define ICR_RR_VALID 0x00020000
  93. #define ICR_SHORTHAND_MASK 0x000C0000
  94. #define ICR_USE_DEST_FIELD 0x00000000
  95. #define ICR_SELF 0x00040000
  96. #define ICR_ALL_INCL_SELF 0x00080000
  97. #define ICR_ALL_EXCL_SELF 0x000C0000
  98. //
  99. // Io Apic Entry definitions
  100. //
  101. // Interrupt Types Possible in the PC+MP Table
  102. // valid for both local and Io Apics
  103. //
  104. #define INT_TYPE_INTR 0x0
  105. #define INT_TYPE_NMI 0x1
  106. #define INT_TYPE_SMI 0x2
  107. #define INT_TYPE_EXTINT 0x3
  108. ///////////////////////////////////////////////////////////////////////////////
  109. //
  110. // arbiter.h
  111. //
  112. ///////////////////////////////////////////////////////////////////////////////
  113. //
  114. // Attributes for the ranges
  115. //
  116. #define ARBITER_RANGE_BOOT_ALLOCATED 0x01
  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 (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. // hcdi.h
  309. //
  310. ///////////////////////////////////////////////////////////////////////////////
  311. //
  312. // values for DeviceExtension Flags
  313. //
  314. #define USBDFLAG_PDO_REMOVED 0x00000001
  315. #define USBDFLAG_HCD_SHUTDOWN 0x00000002
  316. #define USBDFLAG_HCD_STARTED 0x00000004
  317. #define USBDFLAG_HCD_D0_COMPLETE_PENDING 0x00000008
  318. #define USBDFLAG_RH_DELAY_SET_D0 0x00000010
  319. #define HC_ENABLED_FOR_WAKEUP 0x01
  320. #define HC_WAKE_PENDING 0x02
  321. // device hack flags, these flags alter the stacks default behavior
  322. // in order to support certain broken "legacy" devices
  323. #define USBD_DEVHACK_SLOW_ENUMERATION 0x00000001
  324. #define USBD_DEVHACK_DISABLE_SN 0x00000002
  325. //
  326. // This macro returns the true device object for the HCD give
  327. // either the true device_object or a PDO owned by the HCD/BUS
  328. // driver.
  329. //
  330. //
  331. // HCD specific URB commands
  332. //
  333. #define URB_FUNCTION_HCD_OPEN_ENDPOINT 0x1000
  334. #define URB_FUNCTION_HCD_CLOSE_ENDPOINT 0x1001
  335. #define URB_FUNCTION_HCD_GET_ENDPOINT_STATE 0x1002
  336. #define URB_FUNCTION_HCD_SET_ENDPOINT_STATE 0x1003
  337. #define URB_FUNCTION_HCD_ABORT_ENDPOINT 0x1004
  338. // this bit is set for all functions that must be handled by HCD
  339. #define HCD_URB_FUNCTION 0x1000
  340. // this bit is set in the function code by USBD to indicate that
  341. // this is an internal call originating from USBD
  342. #define HCD_NO_USBD_CALL 0x2000
  343. //
  344. // values for HcdEndpointState
  345. //
  346. //
  347. // set if the current state of the endpoint in the HCD is 'stalled'
  348. //
  349. #define HCD_ENDPOINT_HALTED_BIT 0
  350. #define HCD_ENDPOINT_HALTED (1<<HCD_ENDPOINT_HALTED_BIT)
  351. //
  352. // set if the HCD has any transfers queued for the endpoint
  353. //
  354. #define HCD_ENDPOINT_TRANSFERS_QUEUED_BIT 1
  355. #define HCD_ENDPOINT_TRANSFERS_QUEUED (1<<HCD_ENDPOINT_TRANSFERS_QUEUED_BIT)
  356. //
  357. // set if the HCD should reset the data toggle on the host side
  358. //
  359. #define HCD_ENDPOINT_RESET_DATA_TOGGLE_BIT 2
  360. #define HCD_ENDPOINT_RESET_DATA_TOGGLE (1<<HCD_ENDPOINT_RESET_DATA_TOGGLE_BIT )
  361. //
  362. // HCD specific URBs
  363. //
  364. #define USBD_EP_FLAG_LOWSPEED 0x0001
  365. #define USBD_EP_FLAG_NEVERHALT 0x0002
  366. #define USBD_EP_FLAG_DOUBLE_BUFFER 0x0004
  367. #define USBD_EP_FLAG_FAST_ISO 0x0008
  368. ///////////////////////////////////////////////////////////////////////////////
  369. //
  370. // hidclass\local.h
  371. //
  372. ///////////////////////////////////////////////////////////////////////////////
  373. //
  374. // Valid values for HIDCLASS_DEVICE_EXTENSION.state
  375. //
  376. enum deviceState {
  377. DEVICE_STATE_INITIALIZED,
  378. DEVICE_STATE_STARTING,
  379. DEVICE_STATE_START_SUCCESS,
  380. DEVICE_STATE_START_FAILURE,
  381. DEVICE_STATE_STOPPED,
  382. DEVICE_STATE_REMOVING,
  383. DEVICE_STATE_REMOVED,
  384. DEVICE_STATE_SUSPENDED
  385. };
  386. enum collectionState {
  387. COLLECTION_STATE_UNINITIALIZED,
  388. COLLECTION_STATE_INITIALIZED,
  389. COLLECTION_STATE_RUNNING,
  390. COLLECTION_STATE_STOPPED,
  391. COLLECTION_STATE_REMOVING
  392. };
  393. #define HID_DEVICE_EXTENSION_SIG 'EddH'
  394. ///////////////////////////////////////////////////////////////////////////////
  395. //
  396. // hidparse.h
  397. //
  398. ///////////////////////////////////////////////////////////////////////////////
  399. #define HIDP_PREPARSED_DATA_SIGNATURE1 'PdiH'
  400. #define HIDP_PREPARSED_DATA_SIGNATURE2 'RDK '
  401. ///////////////////////////////////////////////////////////////////////////////
  402. //
  403. // hivedata.h
  404. //
  405. ///////////////////////////////////////////////////////////////////////////////
  406. //
  407. // ===== Basic Structures and Definitions =====
  408. //
  409. // These are same whether on disk or in memory.
  410. //
  411. //
  412. // NOTE: Volatile == storage goes away at reboot
  413. // Stable == Persistent == Not Volatile
  414. //
  415. typedef enum {
  416. Stable = 0,
  417. Volatile = 1
  418. } HSTORAGE_TYPE;
  419. #define HTYPE_COUNT 2
  420. // --- HBASE_BLOCK --- on disk description of the hive
  421. //
  422. //
  423. // NOTE: HBASE_BLOCK must be >= the size of physical sector,
  424. // or integrity assumptions will be violated, and crash
  425. // recovery may not work.
  426. //
  427. #define HBASE_BLOCK_SIGNATURE 0x66676572 // "regf"
  428. #define HSYS_MAJOR 1 // Must match to read at all
  429. #define HSYS_MINOR 3 // Must be <= to write, always
  430. // set up to writer's version.
  431. #define HBASE_FORMAT_MEMORY 1 // Direct memory load case
  432. #define HBASE_NAME_ALLOC 64 // 32 unicode chars
  433. // #define HLOG_HEADER_SIZE (FIELD_OFFSET(HBASE_BLOCK, Reserved2))
  434. #define HLOG_DV_SIGNATURE 0x54524944 // "DIRT"
  435. #define HCELL_TYPE_MASK 0x80000000
  436. #define HCELL_TYPE_SHIFT 31
  437. #define HCELL_TABLE_MASK 0x7fe00000
  438. #define HCELL_TABLE_SHIFT 21
  439. #define HCELL_BLOCK_MASK 0x001ff000
  440. #define HCELL_BLOCK_SHIFT 12
  441. #define HCELL_OFFSET_MASK 0x00000fff
  442. #define HBLOCK_SIZE 0x1000 // LOGICAL block size
  443. // This is the size of one of
  444. // the registry's logical/virtual
  445. // pages. It has no particular
  446. // relationship to page size
  447. // of the machine.
  448. #define HSECTOR_SIZE 0x200 // LOGICAL sector size
  449. #define HSECTOR_COUNT 8 // LOGICAL sectors / LOGICAL Block
  450. #define HTABLE_SLOTS 512 // 9 bits of address
  451. #define HDIRECTORY_SLOTS 1024 // 10 bits of address
  452. ///////////////////////////////////////////////////////////////////////////////
  453. //
  454. // io.h
  455. //
  456. ///////////////////////////////////////////////////////////////////////////////
  457. //
  458. // Define I/O system data structure type codes. Each major data structure in
  459. // the I/O system has a type code The type field in each structure is at the
  460. // same offset. The following values can be used to determine which type of
  461. // data structure a pointer refers to.
  462. //
  463. #define IO_TYPE_ADAPTER 0x00000001
  464. #define IO_TYPE_CONTROLLER 0x00000002
  465. #define IO_TYPE_DEVICE 0x00000003
  466. #define IO_TYPE_DRIVER 0x00000004
  467. #define IO_TYPE_FILE 0x00000005
  468. #define IO_TYPE_IRP 0x00000006
  469. #define IO_TYPE_MASTER_ADAPTER 0x00000007
  470. #define IO_TYPE_OPEN_PACKET 0x00000008
  471. #define IO_TYPE_TIMER 0x00000009
  472. #define IO_TYPE_VPB 0x0000000a
  473. #define IO_TYPE_ERROR_LOG 0x0000000b
  474. #define IO_TYPE_ERROR_MESSAGE 0x0000000c
  475. #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0000000d
  476. //
  477. // Define the major function codes for IRPs.
  478. //
  479. #define IRP_MJ_CREATE 0x00
  480. #define IRP_MJ_CREATE_NAMED_PIPE 0x01
  481. #define IRP_MJ_CLOSE 0x02
  482. #define IRP_MJ_READ 0x03
  483. #define IRP_MJ_WRITE 0x04
  484. #define IRP_MJ_QUERY_INFORMATION 0x05
  485. #define IRP_MJ_SET_INFORMATION 0x06
  486. #define IRP_MJ_QUERY_EA 0x07
  487. #define IRP_MJ_SET_EA 0x08
  488. #define IRP_MJ_FLUSH_BUFFERS 0x09
  489. #define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
  490. #define IRP_MJ_SET_VOLUME_INFORMATION 0x0b
  491. #define IRP_MJ_DIRECTORY_CONTROL 0x0c
  492. #define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d
  493. #define IRP_MJ_DEVICE_CONTROL 0x0e
  494. #define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f
  495. #define IRP_MJ_SHUTDOWN 0x10
  496. #define IRP_MJ_LOCK_CONTROL 0x11
  497. #define IRP_MJ_CLEANUP 0x12
  498. #define IRP_MJ_CREATE_MAILSLOT 0x13
  499. #define IRP_MJ_QUERY_SECURITY 0x14
  500. #define IRP_MJ_SET_SECURITY 0x15
  501. #define IRP_MJ_POWER 0x16
  502. #define IRP_MJ_SYSTEM_CONTROL 0x17
  503. #define IRP_MJ_DEVICE_CHANGE 0x18
  504. #define IRP_MJ_QUERY_QUOTA 0x19
  505. #define IRP_MJ_SET_QUOTA 0x1a
  506. #define IRP_MJ_PNP 0x1b
  507. #define IRP_MJ_PNP_POWER IRP_MJ_PNP // Obsolete....
  508. #define IRP_MJ_MAXIMUM_FUNCTION 0x1b
  509. //
  510. // Make the Scsi major code the same as internal device control.
  511. //
  512. #define IRP_MJ_SCSI IRP_MJ_INTERNAL_DEVICE_CONTROL
  513. //
  514. // Define the Device Object Extension Flags
  515. //
  516. #define DOE_UNLOAD_PENDING 0x00000001
  517. #define DOE_DELETE_PENDING 0x00000002
  518. #define DOE_REMOVE_PENDING 0x00000004
  519. #define DOE_REMOVE_PROCESSED 0x00000008
  520. #define DOE_START_PENDING 0x00000010
  521. //
  522. // Define stack location control flags
  523. //
  524. #define SL_PENDING_RETURNED 0x01
  525. #define SL_INVOKE_ON_CANCEL 0x20
  526. #define SL_INVOKE_ON_SUCCESS 0x40
  527. #define SL_INVOKE_ON_ERROR 0x80
  528. //
  529. // Define I/O Request Packet (IRP) flags
  530. //
  531. #define IRP_NOCACHE 0x00000001
  532. #define IRP_PAGING_IO 0x00000002
  533. #define IRP_MOUNT_COMPLETION 0x00000002
  534. #define IRP_SYNCHRONOUS_API 0x00000004
  535. #define IRP_ASSOCIATED_IRP 0x00000008
  536. #define IRP_BUFFERED_IO 0x00000010
  537. #define IRP_DEALLOCATE_BUFFER 0x00000020
  538. #define IRP_INPUT_OPERATION 0x00000040
  539. #define IRP_SYNCHRONOUS_PAGING_IO 0x00000040
  540. #define IRP_CREATE_OPERATION 0x00000080
  541. #define IRP_READ_OPERATION 0x00000100
  542. #define IRP_WRITE_OPERATION 0x00000200
  543. #define IRP_CLOSE_OPERATION 0x00000400
  544. #define IRP_DEFER_IO_COMPLETION 0x00000800
  545. #define IRP_OB_QUERY_NAME 0x00001000
  546. #define IRP_HOLD_DEVICE_QUEUE 0x00002000
  547. #define IRP_RETRY_IO_COMPLETION 0x00004000
  548. #define DO_VERIFY_VOLUME 0x00000002 // ntddk nthal ntifs
  549. #define DO_BUFFERED_IO 0x00000004 // ntddk nthal ntifs wdm
  550. #define DO_EXCLUSIVE 0x00000008 // ntddk nthal ntifs wdm
  551. #define DO_DIRECT_IO 0x00000010 // ntddk nthal ntifs wdm
  552. #define DO_MAP_IO_BUFFER 0x00000020 // ntddk nthal ntifs wdm
  553. #define DO_DEVICE_HAS_NAME 0x00000040 // ntddk nthal ntifs
  554. #define DO_DEVICE_INITIALIZING 0x00000080 // ntddk nthal ntifs wdm
  555. #define DO_SYSTEM_BOOT_PARTITION 0x00000100 // ntddk nthal ntifs
  556. #define DO_LONG_TERM_REQUESTS 0x00000200 // ntddk nthal ntifs
  557. #define DO_NEVER_LAST_DEVICE 0x00000400 // ntddk nthal ntifs
  558. #define DO_SHUTDOWN_REGISTERED 0x00000800 // ntddk nthal ntifs wdm
  559. #define DO_BUS_ENUMERATED_DEVICE 0x00001000 // ntddk nthal ntifs wdm
  560. #define DO_POWER_PAGABLE 0x00002000 // ntddk nthal ntifs wdm
  561. #define DO_POWER_INRUSH 0x00004000 // ntddk nthal ntifs wdm
  562. #define DO_POWER_NOOP 0x00008000
  563. #define DO_LOW_PRIORITY_FILESYSTEM 0x00010000 // ntddk nthal ntifs
  564. //
  565. // Define Volume Parameter Block (VPB) flags.
  566. //
  567. #define VPB_MOUNTED 0x00000001
  568. #define VPB_LOCKED 0x00000002
  569. #define VPB_PERSISTENT 0x00000004
  570. #define VPB_REMOVE_PENDING 0x00000008
  571. #define VPB_RAW_MOUNT 0x00000010
  572. ///////////////////////////////////////////////////////////////////////////////
  573. //
  574. // ke.h
  575. //
  576. ///////////////////////////////////////////////////////////////////////////////
  577. //
  578. // Define I/O request packet (IRP) alternate flags for allocation control.
  579. //
  580. #define IRP_QUOTA_CHARGED 0x01
  581. #define IRP_ALLOCATED_MUST_SUCCEED 0x02
  582. #define IRP_ALLOCATED_FIXED_SIZE 0x04
  583. #define IRP_LOOKASIDE_ALLOCATION 0x08
  584. //
  585. // Public (external) constant definitions.
  586. //
  587. #define BASE_PRIORITY_THRESHOLD NORMAL_BASE_PRIORITY // fast path base threshold
  588. // begin_ntddk begin_wdm
  589. #define THREAD_WAIT_OBJECTS 3 // Builtin usable wait blocks
  590. // end_ntddk end_wdm
  591. #define EVENT_WAIT_BLOCK 2 // Builtin event pair wait block
  592. #define SEMAPHORE_WAIT_BLOCK 2 // Builtin semaphore wait block
  593. #define TIMER_WAIT_BLOCK 3 // Builtin timer wait block
  594. #if (EVENT_WAIT_BLOCK != SEMAPHORE_WAIT_BLOCK)
  595. #error "wait event and wait semaphore must use same wait block"
  596. #endif
  597. //
  598. // Define timer table size.
  599. //
  600. #define TIMER_TABLE_SIZE 128
  601. typedef enum _KOBJECTS {
  602. EventNotificationObject = 0,
  603. EventSynchronizationObject = 1,
  604. MutantObject = 2,
  605. ProcessObject = 3,
  606. QueueObject = 4,
  607. SemaphoreObject = 5,
  608. ThreadObject = 6,
  609. Spare1Object = 7,
  610. TimerNotificationObject = 8,
  611. TimerSynchronizationObject = 9,
  612. Spare2Object = 10,
  613. Spare3Object = 11,
  614. Spare4Object = 12,
  615. Spare5Object = 13,
  616. Spare6Object = 14,
  617. Spare7Object = 15,
  618. Spare8Object = 16,
  619. Spare9Object = 17,
  620. ApcObject,
  621. DpcObject,
  622. DeviceQueueObject,
  623. EventPairObject,
  624. InterruptObject,
  625. ProfileObject
  626. } KOBJECTS;
  627. typedef enum _KBUGCHECK_BUFFER_DUMP_STATE {
  628. BufferEmpty,
  629. BufferInserted,
  630. BufferStarted,
  631. BufferFinished,
  632. BufferIncomplete
  633. } KBUGCHECK_BUFFER_DUMP_STATE;
  634. ///////////////////////////////////////////////////////////////////////////////
  635. //
  636. // local.h
  637. //
  638. ///////////////////////////////////////////////////////////////////////////////
  639. typedef enum {
  640. //
  641. // Device Object Extension Types
  642. //
  643. PciPdoExtensionType = 'icP0',
  644. PciFdoExtensionType,
  645. //
  646. // Arbitration Types. (These are also secondary extensions).
  647. //
  648. PciArb_Io,
  649. PciArb_Memory,
  650. PciArb_Interrupt,
  651. PciArb_BusNumber,
  652. //
  653. // Translation Types. (These are also secondary extensions).
  654. //
  655. PciTrans_Interrupt,
  656. //
  657. // Other exposed interfaces.
  658. //
  659. PciInterface_BusHandler,
  660. PciInterface_IntRouteHandler,
  661. PciInterface_PciCb,
  662. PciInterface_LegacyDeviceDetection,
  663. PciInterface_PmeHandler,
  664. PciInterface_DevicePresent
  665. } PCI_SIGNATURE;
  666. ///////////////////////////////////////////////////////////////////////////////
  667. //
  668. // lpc.h
  669. //
  670. ///////////////////////////////////////////////////////////////////////////////
  671. //
  672. // Valid values for Flags field
  673. //
  674. #define PORT_TYPE 0x0000000F
  675. #define SERVER_CONNECTION_PORT 0x00000001
  676. #define UNCONNECTED_COMMUNICATION_PORT 0x00000002
  677. #define SERVER_COMMUNICATION_PORT 0x00000003
  678. #define CLIENT_COMMUNICATION_PORT 0x00000004
  679. #define PORT_WAITABLE 0x20000000
  680. #define PORT_NAME_DELETED 0x40000000
  681. #define PORT_DYNAMIC_SECURITY 0x80000000
  682. #define PORT_DELETED 0x10000000
  683. ///////////////////////////////////////////////////////////////////////////////
  684. //
  685. // mi.h
  686. //
  687. ///////////////////////////////////////////////////////////////////////////////
  688. //
  689. // Page protections
  690. //
  691. #define MM_ZERO_ACCESS 0 // this value is not used.
  692. #define MM_READONLY 1
  693. #define MM_EXECUTE 2
  694. #define MM_EXECUTE_READ 3
  695. #define MM_READWRITE 4 // bit 2 is set if this is writable.
  696. #define MM_WRITECOPY 5
  697. #define MM_EXECUTE_READWRITE 6
  698. #define MM_EXECUTE_WRITECOPY 7
  699. #define MM_NOCACHE 0x8
  700. #define MM_GUARD_PAGE 0x10
  701. #define MM_DECOMMIT 0x10 //NO_ACCESS, Guard page
  702. #define MM_NOACCESS 0x18 //NO_ACCESS, Guard_page, nocache.
  703. #define MM_UNKNOWN_PROTECTION 0x100 //bigger than 5 bits!
  704. #define MM_LARGE_PAGES 0x111
  705. #define PROTECT_KSTACKS 1
  706. #define MM_KSTACK_OUTSWAPPED 0x1F //Debug marking for kernel stacks
  707. #define MM_PROTECTION_WRITE_MASK 4
  708. #define MM_PROTECTION_COPY_MASK 1
  709. #define MM_PROTECTION_OPERATION_MASK 7 // mask off guard page and nocache.
  710. #define MM_PROTECTION_EXECUTE_MASK 2
  711. #define MM_SECURE_DELETE_CHECK 0x55
  712. //
  713. // Special pool constants
  714. //
  715. #define MI_SPECIAL_POOL_PAGABLE 0x8000
  716. #define MI_SPECIAL_POOL_VERIFIER 0x4000
  717. #define MI_SPECIAL_POOL_PTE_PAGABLE 0x0002
  718. #define MI_SPECIAL_POOL_PTE_NONPAGABLE 0x0004
  719. #define VI_VERIFYING_DIRECTLY 0x1
  720. #define VI_VERIFYING_INVERSELY 0x2
  721. #define MM_SYS_PTE_TABLES_MAX 5
  722. ///////////////////////////////////////////////////////////////////////////////
  723. //
  724. // mm.h
  725. //
  726. ///////////////////////////////////////////////////////////////////////////////
  727. typedef enum _MMLISTS {
  728. ZeroedPageList,
  729. FreePageList,
  730. StandbyPageList, //this list and before make up available pages.
  731. ModifiedPageList,
  732. ModifiedNoWritePageList,
  733. BadPageList,
  734. ActiveAndValid,
  735. TransitionPage
  736. } MMLISTS;
  737. #define MM_FREE_WSLE_SHIFT 4
  738. #define WSLE_NULL_INDEX ((ULONG64)0xFFFFFFFFFFFFFFFUI64)
  739. //
  740. // GDT selectors - These defines are R0 selector numbers, which means
  741. // they happen to match the byte offset relative to
  742. // the base of the GDT.
  743. //
  744. #define KGDT_NULL 0
  745. #define KGDT_R0_CODE 8
  746. #define KGDT_R0_DATA 16
  747. #define KGDT_R3_CODE 24
  748. #define KGDT_R3_DATA 32
  749. #define KGDT_TSS 40
  750. #define KGDT_R0_PCR 48
  751. #define KGDT_R3_TEB 56
  752. #define KGDT_VDM_TILE 64
  753. #define KGDT_LDT 72
  754. #define KGDT_DF_TSS 80
  755. #define KGDT_NMI_TSS 88
  756. //
  757. // GDT selectors - These defines are R0 selector numbers, which means
  758. // they happen to match the byte offset relative to
  759. // the base of the GDT.
  760. //
  761. #define KGDT_NULL 0
  762. #define KGDT_R3_CODE 24
  763. #define KGDT_R3_DATA 32
  764. #define KGDT_R3_TEB 56
  765. #define KGDT_VDM_TILE 64
  766. #define GRAN_BYTE 0
  767. #define GRAN_PAGE 1
  768. #endif
  769. ///////////////////////////////////////////////////////////////////////////////
  770. //
  771. // ob.h
  772. //
  773. ///////////////////////////////////////////////////////////////////////////////
  774. #define OB_FLAG_NEW_OBJECT 0x01
  775. #define OB_FLAG_KERNEL_OBJECT 0x02
  776. #define OB_FLAG_CREATOR_INFO 0x04
  777. #define OB_FLAG_EXCLUSIVE_OBJECT 0x08
  778. #define OB_FLAG_PERMANENT_OBJECT 0x10
  779. #define OB_FLAG_DEFAULT_SECURITY_QUOTA 0x20
  780. #define OB_FLAG_SINGLE_HANDLE_ENTRY 0x40
  781. #if 0
  782. ///////////////////////////////////////////////////////////////////////////////
  783. //
  784. // openhci.h
  785. //
  786. ///////////////////////////////////////////////////////////////////////////////
  787. //values for HcFlags
  788. #define HC_FLAG_REMOTE_WAKEUP_CONNECTED 0x00000001
  789. #define HC_FLAG_LEGACY_BIOS_DETECTED 0x00000002
  790. #define HC_FLAG_SLOW_BULK_ENABLE 0x00000004
  791. #define HC_FLAG_SHUTDOWN 0x00000008 // not really used
  792. #define HC_FLAG_MAP_SX_TO_D3 0x00000010
  793. #define HC_FLAG_IDLE 0x00000020
  794. #define HC_FLAG_DISABLE_IDLE_CHECK 0x00000040
  795. #define HC_FLAG_DEVICE_STARTED 0x00000080
  796. #define HC_FLAG_LOST_POWER 0x00000100
  797. #define HC_FLAG_DISABLE_IDLE_MODE 0x00000200
  798. #define HC_FLAG_USE_HYDRA_HACK 0x00000400
  799. #define HC_FLAG_IN_DPC 0x00000800
  800. #define HC_FLAG_SUSPEND_NEXT_D3 0x00001000
  801. #define HC_FLAG_LIST_FIX_ENABLE 0x00002000
  802. #define HC_FLAG_HUNG_CHECK_ENABLE 0x00004000
  803. #define PENDING_TD_LIST_SIZE 1000
  804. #define HcCtrl_CBSR_MASK 0x00000003L
  805. #define HcCtrl_CBSR_1_to_1 0x00000000L
  806. #define HcCtrl_CBSR_2_to_1 0x00000001L
  807. #define HcCtrl_CBSR_3_to_1 0x00000002L
  808. #define HcCtrl_CBSR_4_to_1 0x00000003L
  809. #define HcCtrl_PeriodicListEnable 0x00000004L
  810. #define HcCtrl_IsochronousEnable 0x00000008L
  811. #define HcCtrl_ControlListEnable 0x00000010L
  812. #define HcCtrl_BulkListEnable 0x00000020L
  813. #define HcCtrl_ListEnableMask 0x00000038L
  814. #define HcCtrl_HCFS_MASK 0x000000C0L
  815. #define HcCtrl_HCFS_USBReset 0x00000000L
  816. #define HcCtrl_HCFS_USBResume 0x00000040L
  817. #define HcCtrl_HCFS_USBOperational 0x00000080L
  818. #define HcCtrl_HCFS_USBSuspend 0x000000C0L
  819. #define HcCtrl_InterruptRouting 0x00000100L
  820. #define HcCtrl_RemoteWakeupConnected 0x00000200L
  821. #define HcCtrl_RemoteWakeupEnable 0x00000400L
  822. #define HcHCFS_USBReset 0x00000000
  823. #define HcHCFS_USBResume 0x00000001
  824. #define HcHCFS_USBOperational 0x00000002
  825. #define HcHCFS_USBSuspend 0x00000003
  826. #define HcCmd_HostControllerReset 0x00000001
  827. #define HcCmd_ControlListFilled 0x00000002
  828. #define HcCmd_BulkListFilled 0x00000004
  829. #define HcCmd_OwnershipChangeRequest 0x00000008
  830. #define HcCmd_SOC_Mask 0x00030000
  831. #define HcCmd_SOC_Offset 16
  832. #define HcCmd_SOC_Mask_LowBits 0x00000003
  833. //
  834. // Definitions for HC_ENDPOINT_CONTROL.Direction
  835. //
  836. #define HcEDDirection_Defer 0 // Defer direction to TD (Control Endpoints)
  837. #define HcEDDirection_Out 1 // Direction from host to device
  838. #define HcEDDirection_In 2 // Direction from device to host
  839. //
  840. // The different ED lists are as follows.
  841. //
  842. #define ED_INTERRUPT_1ms 0
  843. #define ED_INTERRUPT_2ms 1
  844. #define ED_INTERRUPT_4ms 3
  845. #define ED_INTERRUPT_8ms 7
  846. #define ED_INTERRUPT_16ms 15
  847. #define ED_INTERRUPT_32ms 31
  848. #define ED_CONTROL 63
  849. #define ED_BULK 64
  850. #define ED_ISOCHRONOUS 0 // same as 1ms interrupt queue
  851. #define NO_ED_LISTS 65
  852. #define ED_EOF 0xff
  853. //
  854. // 7.1.4 HcInterrruptStatus Register
  855. // 7.1.5 HcInterruptEnable Register
  856. // 7.1.6 HcInterruptDisable Register
  857. //
  858. #define HcInt_SchedulingOverrun 0x00000001L
  859. #define HcInt_WritebackDoneHead 0x00000002L
  860. #define HcInt_StartOfFrame 0x00000004L
  861. #define HcInt_ResumeDetected 0x00000008L
  862. #define HcInt_UnrecoverableError 0x00000010L
  863. #define HcInt_FrameNumberOverflow 0x00000020L
  864. #define HcInt_RootHubStatusChange 0x00000040L
  865. #define HcInt_OwnershipChange 0x40000000L
  866. #define HcInt_MasterInterruptEnable 0x80000000L
  867. //
  868. // 7.4.3 HcRhStatus Register
  869. //
  870. #define HcRhS_LocalPowerStatus 0x00000001 // read only
  871. #define HcRhS_OverCurrentIndicator 0x00000002 // read only
  872. #define HcRhS_DeviceRemoteWakeupEnable 0x00008000 // read only
  873. #define HcRhS_LocalPowerStatusChange 0x00010000 // read only
  874. #define HcRhS_OverCurrentIndicatorChange 0x00020000 // read only
  875. #define HcRhS_ClearGlobalPower 0x00000001 // write only
  876. #define HcRhS_SetRemoteWakeupEnable 0x00008000 // write only
  877. #define HcRhS_SetGlobalPower 0x00010000 // write only
  878. #define HcRhS_ClearOverCurrentIndicatorChange 0x00020000 // write only
  879. #define HcRhS_ClearRemoteWakeupEnable 0x80000000 // write only
  880. //
  881. // 7.4.4 HcRhPortStatus Register
  882. //
  883. #define HcRhPS_CurrentConnectStatus 0x00000001 // read only
  884. #define HcRhPS_PortEnableStatus 0x00000002 // read only
  885. #define HcRhPS_PortSuspendStatus 0x00000004 // read only
  886. #define HcRhPS_PortOverCurrentIndicator 0x00000008 // read only
  887. #define HcRhPS_PortResetStatus 0x00000010 // read only
  888. #define HcRhPS_PortPowerStatus 0x00000100 // read only
  889. #define HcRhPS_LowSpeedDeviceAttached 0x00000200 // read only
  890. #define HcRhPS_ConnectStatusChange 0x00010000 // read only
  891. #define HcRhPS_PortEnableStatusChange 0x00020000 // read only
  892. #define HcRhPS_PortSuspendStatusChange 0x00040000 // read only
  893. #define HcRhPS_OverCurrentIndicatorChange 0x00080000 // read only
  894. #define HcRhPS_PortResetStatusChange 0x00100000 // read only
  895. #define HcRhPS_ClearPortEnable 0x00000001 // write only
  896. #define HcRhPS_SetPortEnable 0x00000002 // write only
  897. #define HcRhPS_SetPortSuspend 0x00000004 // write only
  898. #define HcRhPS_ClearPortSuspend 0x00000008 // write only
  899. #define HcRhPS_SetPortReset 0x00000010 // write only
  900. #define HcRhPS_SetPortPower 0x00000100 // write only
  901. #define HcRhPS_ClearPortPower 0x00000200 // write only
  902. #define HcRhPS_ClearConnectStatusChange 0x00010000 // write only
  903. #define HcRhPS_ClearPortEnableStatusChange 0x00020000 // write only
  904. #define HcRhPS_ClearPortSuspendStatusChange 0x00040000 // write only
  905. #define HcRhPS_ClearPortOverCurrentChange 0x00080000 // write only
  906. #define HcRhPS_ClearPortResetStatusChange 0x00100000 // write only
  907. #define HcRhPS_RESERVED (~(HcRhPS_CurrentConnectStatus | \
  908. HcRhPS_PortEnableStatus | \
  909. HcRhPS_PortSuspendStatus | \
  910. HcRhPS_PortOverCurrentIndicator | \
  911. HcRhPS_PortResetStatus | \
  912. HcRhPS_PortPowerStatus | \
  913. HcRhPS_LowSpeedDeviceAttached | \
  914. HcRhPS_ConnectStatusChange | \
  915. HcRhPS_PortEnableStatusChange | \
  916. HcRhPS_PortSuspendStatusChange | \
  917. HcRhPS_OverCurrentIndicatorChange | \
  918. HcRhPS_PortResetStatusChange \
  919. ))
  920. //
  921. // Definitions for HC_TRANSFER_CONTROL.Control
  922. //
  923. #define HcTDControl_STARTING_FRAME 0x0000FFFF // mask for starting frame (Isochronous)
  924. #define HcTDControl_ISOCHRONOUS 0x00010000 // 1 for Isoch TD, 0 for General TD
  925. #define HcTDControl_SHORT_XFER_OK 0x00040000 // 0 if short transfers are errors
  926. #define HcTDControl_DIR_MASK 0x00180000 // Transfer direction field
  927. #define HcTDControl_DIR_SETUP 0x00000000 // direction is setup packet from host to device
  928. #define HcTDControl_DIR_OUT 0x00080000 // direction is from host to device
  929. #define HcTDControl_DIR_IN 0x00100000 // direction is from device to host
  930. #define HcTDControl_INT_DELAY_MASK 0x00E00000 // Interrupt Delay field
  931. #define HcTDControl_INT_DELAY_0_MS 0x00000000 // Interrupt at end of frame TD is completed
  932. #define HcTDControl_INT_DELAY_1_MS 0x00200000 // Interrupt no later than end of 1st frame after TD is completed
  933. #define HcTDControl_INT_DELAY_2_MS 0x00400000 // Interrupt no later than end of 2nd frame after TD is completed
  934. #define HcTDControl_INT_DELAY_3_MS 0x00600000 // Interrupt no later than end of 3rd frame after TD is completed
  935. #define HcTDControl_INT_DELAY_4_MS 0x00800000 // Interrupt no later than end of 4th frame after TD is completed
  936. #define HcTDControl_INT_DELAY_5_MS 0x00A00000 // Interrupt no later than end of 5th frame after TD is completed
  937. #define HcTDControl_INT_DELAY_6_MS 0x00C00000 // Interrupt no later than end of 6th frame after TD is completed
  938. #ifdef NSC
  939. #define HcTDControl_INT_DELAY_NO_INT 0x00C00000 // Almost infinity but not yet quite.
  940. #elif DISABLE_INT_DELAY_NO_INT
  941. #define HcTDControl_INT_DELAY_NO_INT 0x00000000 // Interrupt at the completion of all packets.
  942. #else
  943. #define HcTDControl_INT_DELAY_NO_INT 0x00E00000 // Do not cause an interrupt for normal completion of this TD
  944. #endif
  945. #define HcTDControl_FRAME_COUNT_MASK 0x07000000 // mask for FrameCount field (Isochronous)
  946. #define HcTDControl_FRAME_COUNT_SHIFT 24 // shift count for FrameCount (Isochronous)
  947. #define HcTDControl_FRAME_COUNT_MAX 8 // Max number of for frame count per TD
  948. #define HcTDControl_TOGGLE_MASK 0x03000000 // mask for Toggle control field
  949. #define HcTDControl_TOGGLE_FROM_ED 0x00000000 // get data toggle from CARRY field of ED
  950. #define HcTDControl_TOGGLE_DATA0 0x02000000 // use DATA0 for data PID
  951. #define HcTDControl_TOGGLE_DATA1 0x03000000 // use DATA1 for data PID
  952. #define HcTDControl_ERROR_COUNT 0x0C000000 // mask for Error Count field
  953. #define HcTDControl_CONDITION_CODE_MASK 0xF0000000 // mask for ConditionCode field
  954. #define HcTDControl_CONDITION_CODE_SHIFT 28 // shift count for ConditionCode
  955. //
  956. // Definitions for HC_TRANSFER_CONTROL.Direction
  957. //
  958. #define HcTDDirection_Setup 0 // setup packet from host to device
  959. #define HcTDDirection_Out 1 // direction from host to device
  960. #define HcTDDirection_In 2 // direction from device to host
  961. //
  962. // Definitions for Hc_TRANSFER_CONTROL.IntDelay
  963. //
  964. #define HcTDIntDelay_0ms 0 // interrupt at end of frame TD is completed
  965. #define HcTDIntDelay_1ms 1 // Interrupt no later than end of 1st frame after TD is completed
  966. #define HcTDIntDelay_2ms 2 // Interrupt no later than end of 2nd frame after TD is completed
  967. #define HcTDIntDelay_3ms 3 // Interrupt no later than end of 3rd frame after TD is completed
  968. #define HcTDIntDelay_4ms 4 // Interrupt no later than end of 4th frame after TD is completed
  969. #define HcTDIntDelay_5ms 5 // Interrupt no later than end of 5th frame after TD is completed
  970. #define HcTDIntDelay_6ms 6 // Interrupt no later than end of 6th frame after TD is completed
  971. #define HcTDIntDelay_NoInterrupt 7 // do not generate interrupt for normal completion of this TD
  972. //
  973. // Definitions for HC_TRANSFER_CONTROL.Toggle
  974. //
  975. #define HcTDToggle_FromEd 0 // get toggle for Endpoint Descriptor toggle CARRY bit
  976. #define HcTDToggle_Data0 2 // use Data0 PID
  977. #define HcTDToggle_Data1 3 // use Data1 PID
  978. //
  979. // Definitions for HC_TRANSFER_CONTROL.ConditionCode and HC_OFFSET_PSW.ConditionCode
  980. //
  981. #define HcCC_NoError 0x0UL
  982. #define HcCC_CRC 0x1UL
  983. #define HcCC_BitStuffing 0x2UL
  984. #define HcCC_DataToggleMismatch 0x3UL
  985. #define HcCC_Stall 0x4UL
  986. #define HcCC_DeviceNotResponding 0x5UL
  987. #define HcCC_PIDCheckFailure 0x6UL
  988. #define HcCC_UnexpectedPID 0x7UL
  989. #define HcCC_DataOverrun 0x8UL
  990. #define HcCC_DataUnderrun 0x9UL
  991. // 0xA // reserved
  992. // 0xB // reserved
  993. #define HcCC_BufferOverrun 0xCUL
  994. #define HcCC_BufferUnderrun 0xDUL
  995. #define HcCC_NotAccessed 0xEUL
  996. ///////////////////////////////////////////////////////////////////////////////
  997. //
  998. // pci.h
  999. //
  1000. ///////////////////////////////////////////////////////////////////////////////
  1001. //
  1002. // Note - State.c depends on the order of these.
  1003. //
  1004. typedef enum {
  1005. PciNotStarted = 0,
  1006. PciStarted,
  1007. PciDeleted,
  1008. PciStopped,
  1009. PciSurpriseRemoved,
  1010. PciSynchronizedOperation,
  1011. PciMaxObjectState
  1012. } PCI_OBJECT_STATE;
  1013. //
  1014. // Base Class Code encodings for Base Class (from PCI spec rev 2.1).
  1015. //
  1016. #define PCI_CLASS_PRE_20 0x00
  1017. #define PCI_CLASS_MASS_STORAGE_CTLR 0x01
  1018. #define PCI_CLASS_NETWORK_CTLR 0x02
  1019. #define PCI_CLASS_DISPLAY_CTLR 0x03
  1020. #define PCI_CLASS_MULTIMEDIA_DEV 0x04
  1021. #define PCI_CLASS_MEMORY_CTLR 0x05
  1022. #define PCI_CLASS_BRIDGE_DEV 0x06
  1023. #define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07
  1024. #define PCI_CLASS_BASE_SYSTEM_DEV 0x08
  1025. #define PCI_CLASS_INPUT_DEV 0x09
  1026. #define PCI_CLASS_DOCKING_STATION 0x0a
  1027. #define PCI_CLASS_PROCESSOR 0x0b
  1028. #define PCI_CLASS_SERIAL_BUS_CTLR 0x0c
  1029. // 0d thru fe reserved
  1030. #define PCI_CLASS_NOT_DEFINED 0xff
  1031. //
  1032. // Sub Class Code encodings (PCI rev 2.1).
  1033. //
  1034. // Class 00 - PCI_CLASS_PRE_20
  1035. #define PCI_SUBCLASS_PRE_20_NON_VGA 0x00
  1036. #define PCI_SUBCLASS_PRE_20_VGA 0x01
  1037. // Class 01 - PCI_CLASS_MASS_STORAGE_CTLR
  1038. #define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00
  1039. #define PCI_SUBCLASS_MSC_IDE_CTLR 0x01
  1040. #define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02
  1041. #define PCI_SUBCLASS_MSC_IPI_CTLR 0x03
  1042. #define PCI_SUBCLASS_MSC_RAID_CTLR 0x04
  1043. #define PCI_SUBCLASS_MSC_OTHER 0x80
  1044. // Class 02 - PCI_CLASS_NETWORK_CTLR
  1045. #define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00
  1046. #define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01
  1047. #define PCI_SUBCLASS_NET_FDDI_CTLR 0x02
  1048. #define PCI_SUBCLASS_NET_ATM_CTLR 0x03
  1049. #define PCI_SUBCLASS_NET_OTHER 0x80
  1050. // Class 03 - PCI_CLASS_DISPLAY_CTLR
  1051. // N.B. Sub Class 00 could be VGA or 8514 depending on Interface byte
  1052. #define PCI_SUBCLASS_VID_VGA_CTLR 0x00
  1053. #define PCI_SUBCLASS_VID_XGA_CTLR 0x01
  1054. #define PCI_SUBCLASS_VID_OTHER 0x80
  1055. // Class 04 - PCI_CLASS_MULTIMEDIA_DEV
  1056. #define PCI_SUBCLASS_MM_VIDEO_DEV 0x00
  1057. #define PCI_SUBCLASS_MM_AUDIO_DEV 0x01
  1058. #define PCI_SUBCLASS_MM_OTHER 0x80
  1059. // Class 05 - PCI_CLASS_MEMORY_CTLR
  1060. #define PCI_SUBCLASS_MEM_RAM 0x00
  1061. #define PCI_SUBCLASS_MEM_FLASH 0x01
  1062. #define PCI_SUBCLASS_MEM_OTHER 0x80
  1063. // Class 06 - PCI_CLASS_BRIDGE_DEV
  1064. #define PCI_SUBCLASS_BR_HOST 0x00
  1065. #define PCI_SUBCLASS_BR_ISA 0x01
  1066. #define PCI_SUBCLASS_BR_EISA 0x02
  1067. #define PCI_SUBCLASS_BR_MCA 0x03
  1068. #define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04
  1069. #define PCI_SUBCLASS_BR_PCMCIA 0x05
  1070. #define PCI_SUBCLASS_BR_NUBUS 0x06
  1071. #define PCI_SUBCLASS_BR_CARDBUS 0x07
  1072. #define PCI_SUBCLASS_BR_OTHER 0x80
  1073. // Class 07 - PCI_CLASS_SIMPLE_COMMS_CTLR
  1074. // N.B. Sub Class 00 and 01 additional info in Interface byte
  1075. #define PCI_SUBCLASS_COM_SERIAL 0x00
  1076. #define PCI_SUBCLASS_COM_PARALLEL 0x01
  1077. #define PCI_SUBCLASS_COM_OTHER 0x80
  1078. // Class 08 - PCI_CLASS_BASE_SYSTEM_DEV
  1079. // N.B. See Interface byte for additional info.
  1080. #define PCI_SUBCLASS_SYS_INTERRUPT_CTLR 0x00
  1081. #define PCI_SUBCLASS_SYS_DMA_CTLR 0x01
  1082. #define PCI_SUBCLASS_SYS_SYSTEM_TIMER 0x02
  1083. #define PCI_SUBCLASS_SYS_REAL_TIME_CLOCK 0x03
  1084. #define PCI_SUBCLASS_SYS_OTHER 0x80
  1085. // Class 09 - PCI_CLASS_INPUT_DEV
  1086. #define PCI_SUBCLASS_INP_KEYBOARD 0x00
  1087. #define PCI_SUBCLASS_INP_DIGITIZER 0x01
  1088. #define PCI_SUBCLASS_INP_MOUSE 0x02
  1089. #define PCI_SUBCLASS_INP_OTHER 0x80
  1090. // Class 0a - PCI_CLASS_DOCKING_STATION
  1091. #define PCI_SUBCLASS_DOC_GENERIC 0x00
  1092. #define PCI_SUBCLASS_DOC_OTHER 0x80
  1093. // Class 0b - PCI_CLASS_PROCESSOR
  1094. #define PCI_SUBCLASS_PROC_386 0x00
  1095. #define PCI_SUBCLASS_PROC_486 0x01
  1096. #define PCI_SUBCLASS_PROC_PENTIUM 0x02
  1097. #define PCI_SUBCLASS_PROC_ALPHA 0x10
  1098. #define PCI_SUBCLASS_PROC_POWERPC 0x20
  1099. #define PCI_SUBCLASS_PROC_COPROCESSOR 0x40
  1100. // Class 0c - PCI_CLASS_SERIAL_BUS_CTLR
  1101. #define PCI_SUBCLASS_SB_IEEE1394 0x00
  1102. #define PCI_SUBCLASS_SB_ACCESS 0x01
  1103. #define PCI_SUBCLASS_SB_SSA 0x02
  1104. #define PCI_SUBCLASS_SB_USB 0x03
  1105. #define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04
  1106. ///////////////////////////////////////////////////////////////////////////////
  1107. //
  1108. // pcmcia.h
  1109. //
  1110. ///////////////////////////////////////////////////////////////////////////////
  1111. //
  1112. // Flags indicating card/controller state
  1113. //
  1114. #define PCMCIA_DEVICE_STARTED 0x00000001
  1115. #define PCMCIA_DEVICE_LOGICALLY_REMOVED 0x00000002
  1116. #define PCMCIA_DEVICE_PHYSICALLY_REMOVED 0x00000004
  1117. #define PCMCIA_DEVICE_MULTIFUNCTION 0x00000008
  1118. #define PCMCIA_DEVICE_WAKE_PENDING 0x00000010
  1119. #define PCMCIA_DEVICE_LEGACY_DETECTED 0x00000020
  1120. #define PCMCIA_DEVICE_DELETED 0x00000040
  1121. #define PCMCIA_DEVICE_CARDBUS 0x00000080
  1122. #define PCMCIA_FILTER_ADDED_MEMORY 0x00000100
  1123. #define PCMCIA_MEMORY_24BIT 0x00000200
  1124. #define PCMCIA_CARDBUS_NOT_SUPPORTED 0x00000400
  1125. #define PCMCIA_USE_POLLED_CSC 0x00000800
  1126. #define PCMCIA_ATTRIBUTE_MEMORY_MAPPED 0x00001000
  1127. #define PCMCIA_SOCKET_REGISTER_BASE_MAPPED 0x00002000
  1128. #define PCMCIA_INTMODE_COMPAQ 0x00004000
  1129. #define PCMCIA_POWER_WORKER_POWERUP 0x00008000
  1130. #define PCMCIA_SOCKET_POWER_REQUESTED 0x00010000
  1131. #define PCMCIA_CONFIG_STATUS_DEFERRED 0x00020000
  1132. #define PCMCIA_POWER_STATUS_DEFERRED 0x00040000
  1133. #define PCMCIA_INT_ROUTE_INTERFACE 0x00080000
  1134. #define PCMCIA_FDO_CONTEXT_SAVED 0x00100000
  1135. #define PCMCIA_FDO_DEFAULT_IRQ_MASK 0x00200000
  1136. //
  1137. // Socket flags
  1138. //
  1139. #define SOCKET_CARD_IN_SOCKET 0x00000001
  1140. #define SOCKET_CARD_INITIALIZED 0x00000002
  1141. #define SOCKET_CARD_POWERED_UP 0x00000004
  1142. #define SOCKET_CARD_CONFIGURED 0x00000008
  1143. #define SOCKET_CARD_MULTIFUNCTION 0x00000010
  1144. #define SOCKET_CARD_CARDBUS 0x00000020
  1145. #define SOCKET_CARD_MEMORY 0x00000040
  1146. #define SOCKET_CHANGE_INTERRUPT 0x00000080
  1147. #define SOCKET_CUSTOM_INTERFACE 0x00000100
  1148. #define SOCKET_INSERTED_SOUND_PENDING 0x00000200
  1149. #define SOCKET_REMOVED_SOUND_PENDING 0x00000400
  1150. #define SOCKET_SUPPORT_MESSAGE_SENT 0x00000800
  1151. #define SOCKET_MEMORY_WINDOW_ENABLED 0x00001000
  1152. #define SOCKET_CARD_STATUS_CHANGE 0x00002000
  1153. #define SOCKET_POWER_STATUS_DEFERRED 0x00004000
  1154. //
  1155. // Worker states for socket power operations
  1156. //
  1157. #define SPW_Stopped 0
  1158. #define SPW_Exit 1
  1159. #define SPW_RequestPower 2
  1160. #define SPW_ReleasePower 3
  1161. #define SPW_SetPowerOn 4
  1162. #define SPW_SetPowerOff 5
  1163. #define SPW_InitPcCard 6
  1164. #define SPW_ParentPowerUp 7
  1165. #define SPW_ParentPowerUpComplete 8
  1166. //
  1167. // Controller classes returned in socket information structure.
  1168. //
  1169. typedef enum _PCMCIA_CONTROLLER_CLASS {
  1170. PcmciaInvalidControllerClass = -1,
  1171. PcmciaIntelCompatible,
  1172. PcmciaCardBusCompatible,
  1173. PcmciaElcController,
  1174. PcmciaDatabook,
  1175. PcmciaPciPcmciaBridge,
  1176. PcmciaCirrusLogic,
  1177. PcmciaTI,
  1178. PcmciaTopic,
  1179. PcmciaRicoh,
  1180. PcmciaDatabookCB,
  1181. PcmciaOpti,
  1182. PcmciaTrid,
  1183. PcmciaO2Micro,
  1184. PcmciaNEC,
  1185. PcmciaNEC_98
  1186. } PCMCIA_CONTROLLER_CLASS, *PPCMCIA_CONTROLLER_CLASS;
  1187. #define PcmciaInvalidControllerType 0xffffffff
  1188. #define PCMCIA_INVALID_CONFIGURATION 0x00000001
  1189. // Max length of device id
  1190. #define PCMCIA_MAXIMUM_DEVICE_ID_LENGTH 128
  1191. //
  1192. // states for PdoPowerWorker
  1193. //
  1194. #define PPW_Stopped 0
  1195. #define PPW_Exit 1
  1196. #define PPW_InitialState 2
  1197. #define PPW_PowerUp 3
  1198. #define PPW_PowerUpComplete 4
  1199. #define PPW_PowerDown 5
  1200. #define PPW_PowerDownComplete 6
  1201. #define PPW_SendIrpDown 7
  1202. #define PPW_16BitConfigure 8
  1203. #define PPW_Deconfigure 9
  1204. #define PPW_VerifyCard 10
  1205. #define PPW_CardBusRefresh 11
  1206. #define PPW_CardBusDelay 12
  1207. //
  1208. // phases for ConfigurationWorker
  1209. //
  1210. // Note that the ConfigurationPhase is simply incremented, these
  1211. // definitions are just for clarity.
  1212. //
  1213. #define CW_Stopped 0
  1214. #define CW_Phase1 1
  1215. #define CW_Phase2 2
  1216. #define CW_Phase3 3
  1217. #define CW_Exit 4
  1218. ///////////////////////////////////////////////////////////////////////////////
  1219. //
  1220. // pcmp.inc
  1221. //
  1222. ///////////////////////////////////////////////////////////////////////////////
  1223. //
  1224. // IMCR (Interrupt Mode Control Register) access definitions
  1225. //
  1226. #define ImcrDisableApic 0x00
  1227. #define ImcrEnableApic 0x01
  1228. #define ImcrRegPortAddr 0x22
  1229. #if defined(NEC_98)
  1230. #define ImcrDataPortAddr 0x700
  1231. #else // defined(NEC_98)
  1232. #define ImcrDataPortAddr 0x23
  1233. #endif // defined(NEC_98)
  1234. #define ImcrPort 0x70
  1235. // Physical location where the Extended BIOS Data Area segment adress is store
  1236. #define EBDA_SEGMENT_PTR 0x40e
  1237. #define BASE_MEM_PTR 0x413
  1238. //
  1239. // The PC+MP configuration table Possible Entry Types
  1240. //
  1241. #define ENTRY_PROCESSOR 0
  1242. #define ENTRY_BUS 1
  1243. #define ENTRY_IOAPIC 2
  1244. #define ENTRY_INTI 3
  1245. #define ENTRY_LINTI 4
  1246. #define HEADER_SIZE 0x2c
  1247. // Number of default configurations for PC+MP version 1.1
  1248. #define NUM_DEFAULT_CONFIGS 7
  1249. //
  1250. // Bits used in the CpuFlags field of the Processor entry
  1251. //
  1252. #define CPU_DISABLED 0x0 // 1 Bit - CPU Disabled
  1253. #define CPU_ENABLED 0x1 // 1 Bit - CPU Enabled
  1254. #define BSP_CPU 0x2 // Bit #2 - CPU is BSP
  1255. // APIC Versions used by PC+MP systems - this is used in the
  1256. // Processor entries and the IoApic Entries
  1257. //
  1258. #define APIC_INTEGRATED 0x10 // 8 Bits-Apic Version Register
  1259. #define APIC_82489DX 0x0 // 8 Bits-Apic Version Register
  1260. //
  1261. // Io Apic Entry definitions
  1262. //
  1263. // Valid IoApicFlag values
  1264. //
  1265. #define IO_APIC_ENABLED 0x1
  1266. #define IO_APIC_DISABLED 0x0
  1267. //
  1268. // Default value for Io Apic ID.
  1269. //
  1270. #define IOUNIT_APIC_ID 0xE
  1271. //
  1272. // PC+MP Signature used to verify the PC+MP table
  1273. // as valid
  1274. //
  1275. // "P"=50H,"C"=43H,"M"=4dH,"P"=50H
  1276. //
  1277. #define PCMP_SIGNATURE 0x504d4350
  1278. //
  1279. // PC+MP Signature used to identify the floating pointer
  1280. // structure (in extended BIOS data segment) that contains
  1281. // a pointer to the PC+MP table.
  1282. //
  1283. // "_"=5fH, "M"=4dH, "P"=50H, "_"=5fH
  1284. //
  1285. #define MP_PTR_SIGNATURE 0x5f504d5f
  1286. //
  1287. // Extension table definitions
  1288. //
  1289. #define EXTTYPE_BUS_ADDRESS_MAP 128
  1290. #define EXTTYPE_BUS_HIERARCHY 129
  1291. #define EXTTYPE_BUS_COMPATIBLE_MAP 130
  1292. #define EXTTYPE_PERSISTENT_STORE 131
  1293. #define MPS_ADDRESS_MAP_IO 0
  1294. #define MPS_ADDRESS_MAP_MEMORY 1
  1295. #define MPS_ADDRESS_MAP_PREFETCH_MEMORY 2
  1296. #define MPS_ADDRESS_MAP_UNDEFINED 9
  1297. //
  1298. // The System configuration table as used by a PC_MP system
  1299. //
  1300. //
  1301. // The offset is relative to the BIOS starting at f0000H
  1302. //
  1303. #define PTR_OFFSET 0x0000e6f5
  1304. #define BIOS_BASE 0x000f0000
  1305. #define PCMP_IMPLEMENTED 0x01 // In MpFeatureInfoByte1
  1306. #define PCMP_CONFIG_MASK 0x0e // In MpFeatureInfoByte1
  1307. #define IMCR_MASK 0x80 // In MpFeatureInfoByte2
  1308. #define MULT_CLOCKS_MASK 0x40 // In MpFeatureInfoByte2
  1309. ///////////////////////////////////////////////////////////////////////////////
  1310. //
  1311. // pnpiop.h
  1312. //
  1313. ///////////////////////////////////////////////////////////////////////////////
  1314. //
  1315. // Pool tags
  1316. //
  1317. #define IOP_DNOD_TAG 'donD'
  1318. #define IOP_DNDT_TAG 'tdnD'
  1319. #define IOP_DPWR_TAG 'rwPD'
  1320. //
  1321. // Dbg scope
  1322. //
  1323. #define DBG_SCOPE 1 // Enable SOME DBG stuff on ALL builds
  1324. //#define DBG_SCOPE DBG // Enable only on DBG build
  1325. //
  1326. // DNF_MAKEUP - this devnode's device is created and owned by PnP manager
  1327. //
  1328. #define DNF_MADEUP 0x00000001
  1329. //
  1330. // DNF_DUPLICATE - this devnode's device is a duplicate of another enumerate PDO
  1331. //
  1332. #define DNF_DUPLICATE 0x00000002
  1333. //
  1334. // DNF_HAL_NODE - a flag to indicate which device node is the root node created by
  1335. // the hal
  1336. //
  1337. #define DNF_HAL_NODE 0x00000004
  1338. //
  1339. // DNF_PROCESSED - indicates if the registry instance key of the device node
  1340. // was created.
  1341. //
  1342. #define DNF_PROCESSED 0x00000008
  1343. //
  1344. // DNF_ENUMERATED - used to track enumeration in IopEnumerateDevice()
  1345. //
  1346. #define DNF_ENUMERATED 0x00000010
  1347. //
  1348. // Singal that we need to send driver query id irps
  1349. //
  1350. #define DNF_NEED_QUERY_IDS 0x00000020
  1351. //
  1352. // THis device has been added to its controlling driver
  1353. //
  1354. #define DNF_ADDED 0x00000040
  1355. //
  1356. // DNF_HAS_BOOT_CONFIG - the device has resource assigned by BIOS. It is considered
  1357. // pseudo-started and need to participate in rebalance.
  1358. //
  1359. #define DNF_HAS_BOOT_CONFIG 0x00000080
  1360. //
  1361. // DNF_BOOT_CONFIG_RESERVED - Indicates the BOOT resources of the device are reserved.
  1362. //
  1363. #define DNF_BOOT_CONFIG_RESERVED 0x00000100
  1364. //
  1365. // DNF_START_REQUEST_PENDING - Indicates the device is being started.
  1366. //
  1367. #define DNF_START_REQUEST_PENDING 0x00000200
  1368. //
  1369. // DNF_NO_RESOURCE_REQUIRED - this devnode's device does not require resource.
  1370. //
  1371. #define DNF_NO_RESOURCE_REQUIRED 0x00000400
  1372. //
  1373. // DNF_RESOURCE_REQUIREMENTS_NEED_FILTERED - to distinguished the
  1374. // DeviceNode->ResourceRequirements is a filtered list or not.
  1375. //
  1376. #define DNF_RESOURCE_REQUIREMENTS_NEED_FILTERED 0x00000800
  1377. //
  1378. // Indicates the device's resources are bing assigned (but is not done yet.)
  1379. // So don't try assign resource to this device.
  1380. //
  1381. #define DNF_ASSIGNING_RESOURCES 0x00001000
  1382. //
  1383. // DNF_RESOURCE_ASSIGNED - this devnode's resources are assigned by PnP
  1384. //
  1385. #define DNF_RESOURCE_ASSIGNED 0x00002000
  1386. //
  1387. // DNF_RESOURCE_REPORTED - this devnode's resources are reported by PnP
  1388. //
  1389. #define DNF_RESOURCE_REPORTED 0x00004000
  1390. //
  1391. // DNF_RESOURCE_REQUIREMENTS_CHANGED - Indicates the device's resource
  1392. // requirements list has been changed.
  1393. //
  1394. #define DNF_RESOURCE_REQUIREMENTS_CHANGED 0x00008000
  1395. //
  1396. // DNF_NON_STOPPED_REBALANC - indicates the device can be restarted with new
  1397. // resources without being stopped.
  1398. //
  1399. #define DNF_NON_STOPPED_REBALANCE 0x00010000
  1400. //
  1401. // DNF_STOPPED - indicates this device is currently stopped for reconfiguration of
  1402. // its resources.
  1403. //
  1404. #define DNF_STOPPED 0x00020000
  1405. //
  1406. // DNF_STARTED - indicates if the device was started, i.e., its StartDevice
  1407. // irp is processed.
  1408. //
  1409. #define DNF_STARTED 0x00040000
  1410. //
  1411. // The device's controlling driver is a legacy driver
  1412. //
  1413. #define DNF_LEGACY_DRIVER 0x00080000
  1414. //
  1415. // For the reported detected devices, they are considered started. We still
  1416. // need a flag to indicate we need to enumerate the device.
  1417. //
  1418. #define DNF_NEED_ENUMERATION_ONLY 0x00100000
  1419. //
  1420. // DNF_IO_INVALIDATE_DEVICE_RELATIONS_PENDING - indicate the
  1421. // IoInvalidateDeviceRelations request is pending and therequest needs to
  1422. // be queued after the Query_Device_relation irp is completed.
  1423. //
  1424. #define DNF_IO_INVALIDATE_DEVICE_RELATIONS_PENDING 0x00200000
  1425. //
  1426. // Indicates the device is being sent a query device relations irp. So no more
  1427. // q-d-r irp at the same time.
  1428. //
  1429. #define DNF_BEING_ENUMERATED 0x00400000
  1430. //
  1431. // DNF_ENUMERATION_REQUEST_QUEUED - indicate the IoInvalidateDeviceRelations
  1432. // request is queued. So, new IoInvalidateDeviceRelations can be ignored.
  1433. //
  1434. #define DNF_ENUMERATION_REQUEST_QUEUED 0x00800000
  1435. //
  1436. // DNF_ENUMERATION_REQUEST_PENDING - Indicates the QUERY_DEVICE_RELATIONS irp
  1437. // returns pending.
  1438. //
  1439. #define DNF_ENUMERATION_REQUEST_PENDING 0x01000000
  1440. //
  1441. // This corresponds to the user-mode CM_PROB_WILL_BE_REMOVED problem value and
  1442. // the DN_WILL_BE_REMOVED status flag.
  1443. //
  1444. #define DNF_HAS_PROBLEM 0x02000000
  1445. //
  1446. // DNF_HAS_PRIVATE_PROBLEM - indicates this device reported PNP_DEVICE_FAILED
  1447. // to a IRP_MN_QUERY_PNP_DEVICE_STATE without also reporting
  1448. // PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED.
  1449. //
  1450. #define DNF_HAS_PRIVATE_PROBLEM 0x04000000
  1451. //
  1452. // DNF_REMOVE_PENDING_CLOSES is set after a IRP_MN_SURPRISE_REMOVE is sent
  1453. // to a device object. It is an indicator that IRP_MN_REMOVE_DEVICE should
  1454. // be sent to the device object as soon as all of the file objects have gone
  1455. // away.
  1456. //
  1457. #define DNF_REMOVE_PENDING_CLOSES 0x08000000
  1458. //
  1459. // DNF_DEVICE_GONE is set when a pdo is no longer returned in a query bus
  1460. // relations. It will then be processed as a surprise remove if started.
  1461. // This flag is used to better detect when a device is resurrected, and when
  1462. // processing surprise remove, to determine if the devnode should be removed
  1463. // from the tree.
  1464. //
  1465. #define DNF_DEVICE_GONE 0x10000000
  1466. //
  1467. // DNF_LEGACY_RESOURCE_DEVICENODE is set for device nodes created for legacy
  1468. // resource allocation.
  1469. //
  1470. #define DNF_LEGACY_RESOURCE_DEVICENODE 0x20000000
  1471. //
  1472. // DNF_NEEDS_REBALANCE is set for device nodes that trigger rebalance.
  1473. //
  1474. #define DNF_NEEDS_REBALANCE 0x40000000
  1475. //
  1476. // DNF_LOCKED_FOR_EJECT is set on device nodes that are being ejected or are
  1477. // related to a device being ejected.
  1478. //
  1479. #define DNF_LOCKED_FOR_EJECT 0x80000000
  1480. //
  1481. // This corresponds to the user-mode the DN_WILL_BE_REMOVED status flag.
  1482. //
  1483. #define DNUF_WILL_BE_REMOVED 0x00000001
  1484. //
  1485. // This corresponds to the user-mode DN_NO_SHOW_IN_DM status flag.
  1486. //
  1487. #define DNUF_DONT_SHOW_IN_UI 0x00000002
  1488. //
  1489. // This flag is set when user-mode lets us know that a reboot is required
  1490. // for this device.
  1491. //
  1492. #define DNUF_NEED_RESTART 0x00000004
  1493. //
  1494. // This flag is set to let the user-mode know when a device can be disabled
  1495. // it is still possible for this to be TRUE, yet disable to fail, as it's
  1496. // a polled flag (see also PNP_DEVICE_NOT_DISABLEABLE)
  1497. //
  1498. #define DNUF_NOT_DISABLEABLE 0x00000008
  1499. //
  1500. // Flags used during shutdown when the IO Verifier is trying to remove all
  1501. // PNP devices.
  1502. //
  1503. // DNUF_SHUTDOWN_QUERIED is set when we issue the QueryRemove to a devnode.
  1504. //
  1505. // DNUF_SHUTDOWN_SUBTREE_DONE is set once we've issued the QueryRemove to all
  1506. // a Devnodes descendants.
  1507. //
  1508. #define DNUF_SHUTDOWN_QUERIED 0x00000010
  1509. #define DNUF_SHUTDOWN_SUBTREE_DONE 0x00000020
  1510. //
  1511. // PNP Bugcheck Subcodes
  1512. //
  1513. #define PNP_ERR_DUPLICATE_PDO 1
  1514. #define PNP_ERR_INVALID_PDO 2
  1515. #define PNP_ERR_BOGUS_ID 3
  1516. #define PNP_ERR_PDO_ENUMERATED_AFTER_DELETION 4
  1517. #define PNP_ERR_ACTIVE_PDO_FREED 5
  1518. #define PNP_ERR_DEVICE_MISSING_FROM_EJECT_LIST 6
  1519. #define PNP_ERR_UNEXPECTED_ADD_RELATION_ERR 7
  1520. //
  1521. // IOP_RESOURCE_REQUEST
  1522. //
  1523. #define QUERY_RESOURCE_LIST 0
  1524. #define QUERY_RESOURCE_REQUIREMENTS 1
  1525. #define REGISTRY_ALLOC_CONFIG 1
  1526. #define REGISTRY_FORCED_CONFIG 2
  1527. #define REGISTRY_BOOT_CONFIG 4
  1528. #define REGISTRY_OVERRIDE_CONFIGVECTOR 1
  1529. #define REGISTRY_BASIC_CONFIGVECTOR 2
  1530. ///////////////////////////////////////////////////////////////////////////////
  1531. //
  1532. // pnpmgr.h
  1533. //
  1534. ///////////////////////////////////////////////////////////////////////////////
  1535. //
  1536. // Private device events
  1537. //
  1538. DEFINE_GUID( GUID_DEVICE_ARRIVAL, 0xcb3a4009L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1539. DEFINE_GUID( GUID_DEVICE_ENUMERATED, 0xcb3a400AL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1540. DEFINE_GUID( GUID_DEVICE_ENUMERATE_REQUEST, 0xcb3a400BL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1541. DEFINE_GUID( GUID_DEVICE_START_REQUEST, 0xcb3a400CL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1542. DEFINE_GUID( GUID_DEVICE_REMOVE_PENDING, 0xcb3a400DL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1543. DEFINE_GUID( GUID_DEVICE_QUERY_AND_REMOVE, 0xcb3a400EL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1544. DEFINE_GUID( GUID_DEVICE_EJECT, 0xcb3a400FL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1545. DEFINE_GUID( GUID_DEVICE_NOOP, 0xcb3a4010L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1546. DEFINE_GUID( GUID_DEVICE_SURPRISE_REMOVAL, 0xce5af000L, 0x80dd, 0x11d2, 0xa8, 0x8d, 0x00, 0xa0, 0xc9, 0x69, 0x6b, 0x4b);
  1547. //
  1548. // Standard interface device classes
  1549. //
  1550. DEFINE_GUID( GUID_CLASS_VOLUME, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x72);
  1551. DEFINE_GUID( GUID_CLASS_LPTPORT, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x74);
  1552. DEFINE_GUID( GUID_CLASS_NET, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x75);
  1553. ///////////////////////////////////////////////////////////////////////////////
  1554. //
  1555. // po.h
  1556. //
  1557. ///////////////////////////////////////////////////////////////////////////////
  1558. #define PO_ORDER_NOT_VIDEO 0x0001
  1559. #define PO_ORDER_ROOT_ENUM 0x0002
  1560. #define PO_ORDER_PAGABLE 0x0004
  1561. #define PO_ORDER_MAXIMUM 0x0007
  1562. // notify GDI before this order level
  1563. #define PO_ORDER_GDI_NOTIFICATION (PO_ORDER_PAGABLE)
  1564. ///////////////////////////////////////////////////////////////////////////////
  1565. //
  1566. // pop.h
  1567. //
  1568. ///////////////////////////////////////////////////////////////////////////////
  1569. //
  1570. // constants
  1571. //
  1572. #define PO_IDLE_SCAN_INTERVAL 1 // scan interval in seconds
  1573. //
  1574. // Values for ios.Parameters.SystemContext
  1575. #define POP_NO_CONTEXT 0
  1576. #define POP_FLAG_CONTEXT 1 // if true, it's flags
  1577. #define POP_DEVICE_REQUEST (0x2 | POP_FLAG_CONTEXT) // an irp sent by RequestPowerChange
  1578. #define POP_INRUSH_CONTEXT (0x4 | POP_FLAG_CONTEXT) // the active INRUSH irp
  1579. #define POP_COUNT_CONTEXT 0xff000000 // byte used for next counting
  1580. #define POP_COUNT_SHIFT 24
  1581. #define PO_ERROR 0x00000001
  1582. #define PO_WARN 0x00000002
  1583. #define PO_BATT 0x00000004
  1584. #define PO_PACT 0x00000008
  1585. #define PO_NOTIFY 0x00000010
  1586. #define PO_THERM 0x00000020
  1587. #define PO_THROTTLE 0x00000040
  1588. #define PO_HIBERNATE 0x00000080
  1589. #define PO_POCALL 0x00000200
  1590. #define PO_SYSDEV 0x00000400
  1591. #define PO_THERM_DETAIL 0x20000000
  1592. #define PO_SIDLE 0x40000000
  1593. #define PO_HIBER_MAP 0x80000000
  1594. #define POP_SIM_CAPABILITIES 0x00000001
  1595. #define POP_SIM_ALL_CAPABILITIES 0x00000002
  1596. #define POP_ALLOW_AC_THROTTLE 0x00000004
  1597. #define POP_IGNORE_S1 0x00000008
  1598. #define POP_IGNORE_UNSUPPORTED_DRIVERS 0x00000010
  1599. #define POP_IGNORE_S3 0x00000020
  1600. #define POP_IGNORE_S2 0x00000040
  1601. #define POP_LOOP_ON_FAILED_DRIVERS 0x00000080
  1602. #define POP_CRC_MEMORY 0x00000100
  1603. #define POP_IGNORE_CRC_FAILURES 0x00000200
  1604. #define POP_TEST_CRC_MEMORY 0x00000400
  1605. #define POP_DEBUG_HIBER_FILE 0x00000800
  1606. #define POP_RESET_ON_HIBER 0x00001000
  1607. #define POP_IGNORE_S4 0x00002000
  1608. #define POP_USE_S4BIOS 0x00004000
  1609. #define POP_IGNORE_HIBER_SYMBOL_UNLOAD 0x00008000
  1610. #define POP_ENABLE_HIBER_PERF 0x00010000
  1611. //
  1612. // Universal Power Data - stored in DeviceObject->DeviceObjectExtension->PowerFlags
  1613. //
  1614. #define POPF_SYSTEM_STATE 0xf // 4 bits for S0 to S5
  1615. #define POPF_DEVICE_STATE 0xf0 // 4 bits to hold D0 to D3
  1616. #define POPF_SYSTEM_ACTIVE 0x100 // True if S irp active at this DO
  1617. #define POPF_SYSTEM_PENDING 0x200 // True if S irp pending (0x100 must be 1)
  1618. #define POPF_DEVICE_ACTIVE 0x400 // same as SYSTEM_ACTIVE but for DEVICE
  1619. #define POPF_DEVICE_PENDING 0x800 // same as SYSTEM_PENDING but for DEVICE
  1620. #define PO_PM_USER 0x01 // nice to inform user mode, but not needed
  1621. #define PO_PM_REISSUE 0x02 // sleep promotoed to shutdown
  1622. #define PO_PM_SETSTATE 0x04 // recomputed something to do with the viable state
  1623. #define PO_ACT_IDLE 0
  1624. #define PO_ACT_NEW_REQUEST 1
  1625. #define PO_ACT_CALLOUT 2
  1626. #define PO_ACT_SET_SYSTEM_STATE 3
  1627. //
  1628. // Types for POP_ACTION_TRIGGER
  1629. //
  1630. typedef enum {
  1631. PolicyDeviceSystemButton,
  1632. PolicyDeviceThermalZone,
  1633. PolicyDeviceBattery,
  1634. PolicyInitiatePowerActionAPI,
  1635. PolicySetPowerStateAPI,
  1636. PolicyImmediateDozeS4,
  1637. PolicySystemIdle
  1638. } POP_POLICY_DEVICE_TYPE;
  1639. #define PO_TRG_USER 0x01 // User action initiated
  1640. #define PO_TRG_SYSTEM 0x02 // System action initiated
  1641. #define PO_TRG_SYNC 0x20 // Trigger is synchronous
  1642. #define PO_TRG_SET 0x80 // Event enabled or disabled
  1643. // POP_THERMAL_ZONE.State
  1644. #define PO_TZ_NO_STATE 0
  1645. #define PO_TZ_READ_STATE 1
  1646. #define PO_TZ_SET_MODE 2
  1647. #define PO_TZ_SET_ACTIVE 3
  1648. // POP_THERMAL_ZONE.Flags
  1649. #define PO_TZ_THROTTLING 0x01
  1650. #define PO_TZ_CLEANUP 0x80
  1651. #define PO_TZ_THROTTLE_SCALE 10 // temp reported in 1/10ths kelin
  1652. #define PO_TZ_NO_THROTTLE (100 * PO_TZ_THROTTLE_SCALE)
  1653. // PopCoolingMode
  1654. #define PO_TZ_ACTIVE 0
  1655. #define PO_TZ_PASSIVE 1
  1656. #define PO_TZ_INVALID_MODE 2
  1657. //
  1658. // Action timeouts
  1659. //
  1660. #define POP_ACTION_TIMEOUT 30
  1661. #define POP_ACTION_CANCEL_TIMEOUT 5
  1662. ///////////////////////////////////////////////////////////////////////////////
  1663. //
  1664. // pool.h
  1665. //
  1666. ///////////////////////////////////////////////////////////////////////////////
  1667. #define POOL_QUOTA_MASK 8
  1668. #define POOL_TYPE_MASK (3)
  1669. #define POOL_OVERHEAD ((LONG)GetTypeSize("POOL_HEADER"))
  1670. //
  1671. // Define pool tracking information.
  1672. //
  1673. #define POOL_BACKTRACEINDEX_PRESENT 0x8000
  1674. ///////////////////////////////////////////////////////////////////////////////
  1675. //
  1676. // range.h
  1677. //
  1678. ///////////////////////////////////////////////////////////////////////////////
  1679. //
  1680. // Range list structures
  1681. //
  1682. #define RTLP_RANGE_LIST_ENTRY_MERGED 0x0001
  1683. ///////////////////////////////////////////////////////////////////////////////
  1684. //
  1685. // srb.h
  1686. //
  1687. ///////////////////////////////////////////////////////////////////////////////
  1688. //
  1689. // Port driver error codes
  1690. //
  1691. #define SP_BUS_PARITY_ERROR 0x0001
  1692. #define SP_UNEXPECTED_DISCONNECT 0x0002
  1693. #define SP_INVALID_RESELECTION 0x0003
  1694. #define SP_BUS_TIME_OUT 0x0004
  1695. #define SP_PROTOCOL_ERROR 0x0005
  1696. #define SP_INTERNAL_ADAPTER_ERROR 0x0006
  1697. #define SP_REQUEST_TIMEOUT 0x0007
  1698. #define SP_IRQ_NOT_RESPONDING 0x0008
  1699. #define SP_BAD_FW_WARNING 0x0009
  1700. #define SP_BAD_FW_ERROR 0x000a
  1701. #define SP_LOST_WMI_MINIPORT_REQUEST 0x000b
  1702. //
  1703. // Return values for SCSI_HW_FIND_ADAPTER.
  1704. //
  1705. #define SP_RETURN_NOT_FOUND 0
  1706. #define SP_RETURN_FOUND 1
  1707. #define SP_RETURN_ERROR 2
  1708. #define SP_RETURN_BAD_CONFIG 3
  1709. //
  1710. // Notification Event Types
  1711. //
  1712. typedef enum _SCSI_NOTIFICATION_TYPE {
  1713. RequestComplete,
  1714. NextRequest,
  1715. NextLuRequest,
  1716. ResetDetected,
  1717. CallDisableInterrupts,
  1718. CallEnableInterrupts,
  1719. RequestTimerCall,
  1720. BusChangeDetected, /* New */
  1721. WMIEvent,
  1722. WMIReregister
  1723. } SCSI_NOTIFICATION_TYPE, *PSCSI_NOTIFICATION_TYPE;
  1724. //
  1725. // SRB Functions
  1726. //
  1727. #define SRB_FUNCTION_EXECUTE_SCSI 0x00
  1728. #define SRB_FUNCTION_CLAIM_DEVICE 0x01
  1729. #define SRB_FUNCTION_IO_CONTROL 0x02
  1730. #define SRB_FUNCTION_RECEIVE_EVENT 0x03
  1731. #define SRB_FUNCTION_RELEASE_QUEUE 0x04
  1732. #define SRB_FUNCTION_ATTACH_DEVICE 0x05
  1733. #define SRB_FUNCTION_RELEASE_DEVICE 0x06
  1734. #define SRB_FUNCTION_SHUTDOWN 0x07
  1735. #define SRB_FUNCTION_FLUSH 0x08
  1736. #define SRB_FUNCTION_ABORT_COMMAND 0x10
  1737. #define SRB_FUNCTION_RELEASE_RECOVERY 0x11
  1738. #define SRB_FUNCTION_RESET_BUS 0x12
  1739. #define SRB_FUNCTION_RESET_DEVICE 0x13
  1740. #define SRB_FUNCTION_TERMINATE_IO 0x14
  1741. #define SRB_FUNCTION_FLUSH_QUEUE 0x15
  1742. #define SRB_FUNCTION_REMOVE_DEVICE 0x16
  1743. #define SRB_FUNCTION_WMI 0x17
  1744. #define SRB_FUNCTION_LOCK_QUEUE 0x18
  1745. #define SRB_FUNCTION_UNLOCK_QUEUE 0x19
  1746. //
  1747. // SRB Status Masks
  1748. //
  1749. #define SRB_STATUS_QUEUE_FROZEN 0x40
  1750. #define SRB_STATUS_AUTOSENSE_VALID 0x80
  1751. #define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
  1752. //
  1753. // SRB Flag Bits
  1754. //
  1755. #define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002
  1756. #define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004
  1757. #define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
  1758. #define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010
  1759. #define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
  1760. #define SRB_FLAGS_DATA_IN 0x00000040
  1761. #define SRB_FLAGS_DATA_OUT 0x00000080
  1762. #define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
  1763. #define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
  1764. #define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100
  1765. #define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200
  1766. #define SRB_FLAGS_IS_ACTIVE 0x00010000
  1767. #define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000
  1768. #define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000
  1769. #define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000
  1770. #define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000
  1771. #define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000
  1772. #define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000
  1773. //
  1774. // Queue Action
  1775. //
  1776. #define SRB_SIMPLE_TAG_REQUEST 0x20
  1777. #define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21
  1778. #define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22
  1779. #define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01
  1780. ///////////////////////////////////////////////////////////////////////////////
  1781. //
  1782. // trackirp.h
  1783. //
  1784. ///////////////////////////////////////////////////////////////////////////////
  1785. #define DOE_DESIGNATED_FDO 0x80000000
  1786. #define DOE_BOTTOM_OF_FDO_STACK 0x40000000
  1787. #define DOE_RAW_FDO 0x20000000
  1788. #define DOE_EXAMINED 0x10000000
  1789. #define DOE_TRACKED 0x08000000
  1790. #define ASSERTFLAG_TRACKIRPS 0x00000001
  1791. #define ASSERTFLAG_MONITOR_ALLOCS 0x00000002
  1792. #define ASSERTFLAG_POLICEIRPS 0x00000004
  1793. #define ASSERTFLAG_MONITORMAJORS 0x00000008
  1794. #define ASSERTFLAG_SURROGATE 0x00000010
  1795. #define ASSERTFLAG_SMASH_SRBS 0x00000020
  1796. #define ASSERTFLAG_CONSUME_ALWAYS 0x00000040
  1797. #define ASSERTFLAG_FORCEPENDING 0x00000080
  1798. #define ASSERTFLAG_COMPLETEATDPC 0x00000100
  1799. #define ASSERTFLAG_COMPLETEATPASSIVE 0x00000200
  1800. #define ASSERTFLAG_DEFERCOMPLETION 0x00000800
  1801. #define ASSERTFLAG_ROTATE_STATUS 0x00001000
  1802. // ----------
  1803. #define ASSERTMASK_COMPLETESTYLE 0x00000F80
  1804. #define ASSERTFLAG_SEEDSTACK 0x00010000
  1805. //
  1806. // Disabling HACKHACKS_ENABLED will remove support for all hack code. The
  1807. // hack code allows the machine to fully boot in checked builds. Note that
  1808. // those hacks can be individually disabled by setting the IovpHackFlags
  1809. // variable at boot time.
  1810. //
  1811. #define HACKHACKS_ENABLED
  1812. #define HACKFLAG_FOR_MUP 0x00000001
  1813. #define HACKFLAG_FOR_SCSIPORT 0x00000002
  1814. #define HACKFLAG_FOR_ACPI 0x00000004
  1815. #define HACKFLAG_FOR_BOGUSIRPS 0x00000008
  1816. ///////////////////////////////////////////////////////////////////////////////
  1817. //
  1818. // uhcd.h
  1819. //
  1820. ///////////////////////////////////////////////////////////////////////////////
  1821. //
  1822. // Interrupt Mask register bits
  1823. //
  1824. #define UHCD_INT_MASK_SHORT_BIT 3
  1825. #define UHCD_INT_MASK_SHORT (1<<UHCD_INT_MASK_SHORT_BIT)
  1826. #define UHCD_INT_MASK_IOC_BIT 2
  1827. #define UHCD_INT_MASK_IOC (1<<UHCD_INT_MASK_IOC_BIT)
  1828. #define UHCD_INT_MASK_RESUME_BIT 1
  1829. #define UHCD_INT_MASK_RESUME (1<<UHCD_INT_MASK_RESUME_BIT)
  1830. #define UHCD_INT_MASK_TIMEOUT_BIT 0
  1831. #define UHCD_INT_MASK_TIMEOUT (1<<UHCD_INT_MASK_TIMEOUT_BIT)
  1832. //
  1833. // Port Register Bits
  1834. //
  1835. #define UHCD_PORT_ENABLE_BIT 2
  1836. #define UHCD_PORT_ENABLE (1<<UHCD_PORT_ENABLE_BIT)
  1837. //
  1838. // Command Register Bits
  1839. //
  1840. #define UHCD_CMD_RUN_BIT 0
  1841. #define UHCD_CMD_RUN (USHORT)(1<<UHCD_CMD_RUN_BIT)
  1842. #define UHCD_CMD_RESET_BIT 1
  1843. #define UHCD_CMD_RESET (USHORT)(1<<UHCD_CMD_RESET_BIT)
  1844. #define UHCD_CMD_GLOBAL_RESET_BIT 2
  1845. #define UHCD_CMD_GLOBAL_RESET (USHORT)(1<<UHCD_CMD_GLOBAL_RESET_BIT)
  1846. #define UHCD_CMD_SUSPEND_BIT 3
  1847. #define UHCD_CMD_SUSPEND (USHORT)(1<<UHCD_CMD_SUSPEND_BIT)
  1848. #define UHCD_CMD_FORCE_RESUME_BIT 4
  1849. #define UHCD_CMD_FORCE_RESUME (USHORT)(1<<UHCD_CMD_FORCE_RESUME_BIT)
  1850. #define UHCD_CMD_SW_DEBUG_BIT 5
  1851. #define UHCD_CMD_SW_DEBUG (USHORT)(1<<UHCD_CMD_SW_DEBUG_BIT)
  1852. #define UHCD_CMD_SW_CONFIGURED_BIT 6
  1853. #define UHCD_CMD_SW_CONFIGURED (USHORT)(1<<UHCD_CMD_SW_CONFIGURED_BIT)
  1854. #define UHCD_CMD_MAXPKT_64_BIT 7
  1855. #define UHCD_CMD_MAXPKT_64 (USHORT)(1<<UHCD_CMD_MAXPKT_64_BIT)
  1856. //
  1857. // Status Register Bits
  1858. //
  1859. #define UHCD_STATUS_USBINT_BIT 0
  1860. #define UHCD_STATUS_USBINT (1<<UHCD_STATUS_USBINT_BIT)
  1861. #define UHCD_STATUS_USBERR_BIT 1
  1862. #define UHCD_STATUS_USBERR (1<<UHCD_STATUS_USBERR_BIT)
  1863. #define UHCD_STATUS_RESUME_BIT 2
  1864. #define UHCD_STATUS_RESUME (1<<UHCD_STATUS_RESUME_BIT)
  1865. #define UHCD_STATUS_PCIERR_BIT 3
  1866. #define UHCD_STATUS_PCIERR (1<<UHCD_STATUS_PCIERR_BIT)
  1867. #define UHCD_STATUS_HCERR_BIT 4
  1868. #define UHCD_STATUS_HCERR (1<<UHCD_STATUS_HCERR_BIT)
  1869. #define UHCD_STATUS_HCHALT_BIT 5
  1870. #define UHCD_STATUS_HCHALT (1<<UHCD_STATUS_HCHALT_BIT)
  1871. // number of bit times in a USB frame based on a 12MHZ SOF clock
  1872. #define UHCD_12MHZ_SOF 11936
  1873. //
  1874. // values for HcFlags
  1875. //
  1876. // Set to indicate port resources were assigned
  1877. #define HCFLAG_GOT_IO 0x00000001
  1878. // Set at initialization to indicate that the base register
  1879. // address must be unmapped when the driver is unloaded.
  1880. #define HCFLAG_UNMAP_REGISTERS 0x00000002
  1881. // Set if we have a USB BIOS on this system
  1882. #define HCFLAG_USBBIOS 0x00000004
  1883. // Current state of BW reclimation
  1884. #define HCFLAG_BWRECLIMATION_ENABLED 0x00000008
  1885. // This flag indicates if the driver needs to cleanup resources
  1886. // allocated in start_device.
  1887. #define HCFLAG_NEED_CLEANUP 0x00000010
  1888. // HC is idle
  1889. #define HCFLAG_IDLE 0x00000020
  1890. // set when the rollover int is disabled
  1891. #define HCFLAG_ROLLOVER_IDLE 0x00000040
  1892. // set when the controller is stopped
  1893. #define HCFLAG_HCD_STOPPED 0x00000080
  1894. // turn off idle check
  1895. #define HCFLAG_DISABLE_IDLE 0x00000100
  1896. // work item queued
  1897. #define HCFLAG_WORK_ITEM_QUEUED 0x00000200
  1898. // hcd has shut down
  1899. #define HCFLAG_HCD_SHUTDOWN 0x00000400
  1900. // indicates we need to restore HC from hibernate
  1901. #define HCFLAG_LOST_POWER 0x00000800
  1902. // set when root hub turns off the HC
  1903. #define HCFLAG_RH_OFF 0x00001000
  1904. #define HCFLAG_MAP_SX_TO_D3 0x00002000
  1905. // set if we will be suspending in this D3
  1906. #define HCFLAG_SUSPEND_NEXT_D3 0x00004000
  1907. ///////////////////////////////////////////////////////////////////////////////
  1908. //
  1909. // usbdi.h
  1910. //
  1911. ///////////////////////////////////////////////////////////////////////////////
  1912. //
  1913. // URB request codes
  1914. //
  1915. #define URB_FUNCTION_SELECT_CONFIGURATION 0x0000
  1916. #define URB_FUNCTION_SELECT_INTERFACE 0x0001
  1917. #define URB_FUNCTION_ABORT_PIPE 0x0002
  1918. #define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003
  1919. #define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004
  1920. #define URB_FUNCTION_GET_FRAME_LENGTH 0x0005
  1921. #define URB_FUNCTION_SET_FRAME_LENGTH 0x0006
  1922. #define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007
  1923. #define URB_FUNCTION_CONTROL_TRANSFER 0x0008
  1924. #define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009
  1925. #define URB_FUNCTION_ISOCH_TRANSFER 0x000A
  1926. #define URB_FUNCTION_RESET_PIPE 0x001E
  1927. //
  1928. // These functions correspond
  1929. // to the standard commands on the default pipe
  1930. //
  1931. // direction is implied
  1932. //
  1933. #define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B
  1934. #define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024
  1935. #define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028
  1936. #define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C
  1937. #define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025
  1938. #define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029
  1939. #define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D
  1940. #define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E
  1941. #define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F
  1942. #define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023
  1943. #define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010
  1944. #define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011
  1945. #define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012
  1946. #define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022
  1947. #define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013
  1948. #define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014
  1949. #define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015
  1950. #define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021
  1951. // direction is specified in TransferFlags
  1952. #define URB_FUNCTION_RESERVED0 0x0016
  1953. //
  1954. // These are for sending vendor and class commands
  1955. // on the default pipe
  1956. //
  1957. // direction is specified in TransferFlags
  1958. //
  1959. #define URB_FUNCTION_VENDOR_DEVICE 0x0017
  1960. #define URB_FUNCTION_VENDOR_INTERFACE 0x0018
  1961. #define URB_FUNCTION_VENDOR_ENDPOINT 0x0019
  1962. #define URB_FUNCTION_VENDOR_OTHER 0x0020
  1963. #define URB_FUNCTION_CLASS_DEVICE 0x001A
  1964. #define URB_FUNCTION_CLASS_INTERFACE 0x001B
  1965. #define URB_FUNCTION_CLASS_ENDPOINT 0x001C
  1966. #define URB_FUNCTION_CLASS_OTHER 0x001F
  1967. //
  1968. // Reserved function codes
  1969. //
  1970. #define URB_FUNCTION_RESERVED 0x001D
  1971. #define URB_FUNCTION_GET_CONFIGURATION 0x0026
  1972. #define URB_FUNCTION_GET_INTERFACE 0x0027
  1973. #define URB_FUNCTION_LAST 0x0029
  1974. ///////////////////////////////////////////////////////////////////////////////
  1975. //
  1976. // usbhub.h
  1977. //
  1978. ///////////////////////////////////////////////////////////////////////////////
  1979. //
  1980. // Hub and Port status defined below also apply to StatusChnage bits
  1981. //
  1982. #define HUB_STATUS_LOCAL_POWER 0x01
  1983. #define HUB_STATUS_OVER_CURRENT 0x02
  1984. #define PORT_STATUS_CONNECT 0x001
  1985. #define PORT_STATUS_ENABLE 0x002
  1986. #define PORT_STATUS_SUSPEND 0x004
  1987. #define PORT_STATUS_OVER_CURRENT 0x008
  1988. #define PORT_STATUS_RESET 0x010
  1989. #define PORT_STATUS_POWER 0x100
  1990. #define PORT_STATUS_LOW_SPEED 0x200
  1991. #define HUBFLAG_NEED_CLEANUP 0x00000001
  1992. #define HUBFLAG_ENABLED_FOR_WAKEUP 0x00000002
  1993. #define HUBFLAG_DEVICE_STOPPING 0x00000004
  1994. #define HUBFLAG_HUB_FAILURE 0x00000008
  1995. #define HUBFLAG_SUPPORT_WAKEUP 0x00000010
  1996. #define HUBFLAG_HUB_STOPPED 0x00000020
  1997. #define HUBFLAG_HUB_BUSY 0x00000040
  1998. #define HUBFLAG_PENDING_WAKE_IRP 0x00000080
  1999. #define HUBFLAG_PENDING_PORT_RESET 0x00000100
  2000. #define HUBFLAG_HUB_HAS_LOST_BRAINS 0x00000200
  2001. #define USBH_MAX_ENUMERATION_ATTEMPTS 3
  2002. //
  2003. // Common fields for Pdo and Fdo extensions
  2004. //
  2005. #define EXTENSION_TYPE_PORT 0x54524f50 // "PORT"
  2006. #define EXTENSION_TYPE_HUB 0x20425548 // "HUB "
  2007. #define EXTENSION_TYPE_PARENT 0x50525400 // "PRT "
  2008. #define EXTENSION_TYPE_FUNCTION 0xfefefeff // ""
  2009. //
  2010. // values for PortPdoFlags
  2011. //
  2012. #define PORTPDO_DEVICE_IS_HUB 0x00000001
  2013. #define PORTPDO_DEVICE_IS_PARENT 0x00000002
  2014. #define PORTPDO_DEVICE_ENUM_ERROR 0x00000004
  2015. #define PORTPDO_LOW_SPEED_DEVICE 0x00000008
  2016. #define PORTPDO_REMOTE_WAKEUP_SUPPORTED 0x00000010
  2017. #define PORTPDO_REMOTE_WAKEUP_ENABLED 0x00000020
  2018. #define PORTPDO_DELETED_PDO 0x00000040
  2019. #define PORTPDO_DELETE_PENDING 0x00000080
  2020. #define PORTPDO_NEED_RESET 0x00000100
  2021. #define PORTPDO_STARTED 0x00000200
  2022. #define PORTPDO_WANT_POWER_FEATURE 0x00000400
  2023. #define PORTPDO_SYM_LINK 0x00000800
  2024. #define PORTPDO_DEVICE_FAILED 0x00001000
  2025. #define PORTPDO_USB_SUSPEND 0x00002000
  2026. #define PORTPDO_OVERCURRENT 0x00004000
  2027. #define PORTPDO_DD_REMOVED 0x00008000
  2028. #define PORTPDO_NOT_ENOUGH_POWER 0x00010000
  2029. #define PORTPDO_PDO_RETURNED 0x00020000
  2030. #define PORTPDO_NO_BANDWIDTH 0x00040000
  2031. #define PORTPDO_RESET_PENDING 0x00080000
  2032. ///////////////////////////////////////////////////////////////////////////////
  2033. //
  2034. // wdm.h
  2035. //
  2036. ///////////////////////////////////////////////////////////////////////////////
  2037. //
  2038. // POWER minor function codes
  2039. //
  2040. #define IRP_MN_WAIT_WAKE 0x00
  2041. #define IRP_MN_POWER_SEQUENCE 0x01
  2042. #define IRP_MN_SET_POWER 0x02
  2043. #define IRP_MN_QUERY_POWER 0x03
  2044. // begin_ntminiport
  2045. //
  2046. // WMI minor function codes under IRP_MJ_SYSTEM_CONTROL
  2047. //
  2048. #define IRP_MN_QUERY_ALL_DATA 0x00
  2049. #define IRP_MN_QUERY_SINGLE_INSTANCE 0x01
  2050. #define IRP_MN_CHANGE_SINGLE_INSTANCE 0x02
  2051. #define IRP_MN_CHANGE_SINGLE_ITEM 0x03
  2052. #define IRP_MN_ENABLE_EVENTS 0x04
  2053. #define IRP_MN_DISABLE_EVENTS 0x05
  2054. #define IRP_MN_ENABLE_COLLECTION 0x06
  2055. #define IRP_MN_DISABLE_COLLECTION 0x07
  2056. #define IRP_MN_REGINFO 0x08
  2057. #define IRP_MN_EXECUTE_METHOD 0x09
  2058. #define FILE_DEVICE_BEEP 0x00000001
  2059. #define FILE_DEVICE_CD_ROM 0x00000002
  2060. #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
  2061. #define FILE_DEVICE_CONTROLLER 0x00000004
  2062. #define FILE_DEVICE_DATALINK 0x00000005
  2063. #define FILE_DEVICE_DFS 0x00000006
  2064. #define FILE_DEVICE_DISK 0x00000007
  2065. #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
  2066. #define FILE_DEVICE_FILE_SYSTEM 0x00000009
  2067. #define FILE_DEVICE_INPORT_PORT 0x0000000a
  2068. #define FILE_DEVICE_KEYBOARD 0x0000000b
  2069. #define FILE_DEVICE_MAILSLOT 0x0000000c
  2070. #define FILE_DEVICE_MIDI_IN 0x0000000d
  2071. #define FILE_DEVICE_MIDI_OUT 0x0000000e
  2072. #define FILE_DEVICE_MOUSE 0x0000000f
  2073. #define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
  2074. #define FILE_DEVICE_NAMED_PIPE 0x00000011
  2075. #define FILE_DEVICE_NETWORK 0x00000012
  2076. #define FILE_DEVICE_NETWORK_BROWSER 0x00000013
  2077. #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
  2078. #define FILE_DEVICE_NULL 0x00000015
  2079. #define FILE_DEVICE_PARALLEL_PORT 0x00000016
  2080. #define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
  2081. #define FILE_DEVICE_PRINTER 0x00000018
  2082. #define FILE_DEVICE_SCANNER 0x00000019
  2083. #define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
  2084. #define FILE_DEVICE_SERIAL_PORT 0x0000001b
  2085. #define FILE_DEVICE_SCREEN 0x0000001c
  2086. #define FILE_DEVICE_SOUND 0x0000001d
  2087. #define FILE_DEVICE_STREAMS 0x0000001e
  2088. #define FILE_DEVICE_TAPE 0x0000001f
  2089. #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
  2090. #define FILE_DEVICE_TRANSPORT 0x00000021
  2091. #define FILE_DEVICE_UNKNOWN 0x00000022
  2092. #define FILE_DEVICE_VIDEO 0x00000023
  2093. #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
  2094. #define FILE_DEVICE_WAVE_IN 0x00000025
  2095. #define FILE_DEVICE_WAVE_OUT 0x00000026
  2096. #define FILE_DEVICE_8042_PORT 0x00000027
  2097. #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
  2098. #define FILE_DEVICE_BATTERY 0x00000029
  2099. #define FILE_DEVICE_BUS_EXTENDER 0x0000002a
  2100. #define FILE_DEVICE_MODEM 0x0000002b
  2101. #define FILE_DEVICE_VDM 0x0000002c
  2102. #define FILE_DEVICE_MASS_STORAGE 0x0000002d
  2103. #define FILE_DEVICE_SMB 0x0000002e
  2104. #define FILE_DEVICE_KS 0x0000002f
  2105. #define FILE_DEVICE_CHANGER 0x00000030
  2106. #define FILE_DEVICE_SMARTCARD 0x00000031
  2107. #define FILE_DEVICE_ACPI 0x00000032
  2108. #define FILE_DEVICE_DVD 0x00000033
  2109. #define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
  2110. #define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
  2111. #define FILE_DEVICE_DFS_VOLUME 0x00000036
  2112. #define FILE_DEVICE_SERENUM 0x00000037
  2113. #define FILE_DEVICE_TERMSRV 0x00000038
  2114. #define FILE_DEVICE_KSEC 0x00000039
  2115. //
  2116. // Macro definition for defining IOCTL and FSCTL function control codes. Note
  2117. // that function codes 0-2047 are reserved for Microsoft Corporation, and
  2118. // 2048-4095 are reserved for customers.
  2119. //
  2120. #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
  2121. ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
  2122. )
  2123. ///////////////////////////////////////////////////////////////////////////////
  2124. //
  2125. // wdmaud.h
  2126. //
  2127. ///////////////////////////////////////////////////////////////////////////////
  2128. #define WDMAUD_CTL_CODE CTL_CODE
  2129. #define IOCTL_SOUND_BASE FILE_DEVICE_SOUND
  2130. #define IOCTL_WDMAUD_BASE 0x0000
  2131. #define IOCTL_WAVE_BASE 0x0040
  2132. #define IOCTL_MIDI_BASE 0x0080
  2133. #define IOCTL_MIXER_BASE 0x00C0
  2134. #define IOCTL_WDMAUD_INIT WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2135. #define IOCTL_WDMAUD_ADD_DEVNODE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2136. #define IOCTL_WDMAUD_REMOVE_DEVNODE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2137. #define IOCTL_WDMAUD_GET_CAPABILITIES WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2138. #define IOCTL_WDMAUD_GET_NUM_DEVS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2139. #define IOCTL_WDMAUD_OPEN_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2140. #define IOCTL_WDMAUD_CLOSE_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2141. #define IOCTL_WDMAUD_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2142. #define IOCTL_WDMAUD_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2143. #define IOCTL_WDMAUD_EXIT WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2144. #define IOCTL_WDMAUD_SET_PREFERRED_DEVICE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x000a, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2145. #define IOCTL_WDMAUD_WAVE_OUT_PAUSE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2146. #define IOCTL_WDMAUD_WAVE_OUT_PLAY WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2147. #define IOCTL_WDMAUD_WAVE_OUT_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2148. #define IOCTL_WDMAUD_WAVE_OUT_BREAKLOOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2149. #define IOCTL_WDMAUD_WAVE_OUT_GET_POS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2150. #define IOCTL_WDMAUD_WAVE_OUT_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2151. #define IOCTL_WDMAUD_WAVE_OUT_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2152. #define IOCTL_WDMAUD_WAVE_OUT_WRITE_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2153. #define IOCTL_WDMAUD_WAVE_IN_STOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2154. #define IOCTL_WDMAUD_WAVE_IN_RECORD WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0011, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2155. #define IOCTL_WDMAUD_WAVE_IN_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0012, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2156. #define IOCTL_WDMAUD_WAVE_IN_GET_POS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0013, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2157. #define IOCTL_WDMAUD_WAVE_IN_READ_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0014, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2158. #define IOCTL_WDMAUD_MIDI_OUT_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2159. #define IOCTL_WDMAUD_MIDI_OUT_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2160. #define IOCTL_WDMAUD_MIDI_OUT_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2161. #define IOCTL_WDMAUD_MIDI_OUT_WRITE_DATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2162. #define IOCTL_WDMAUD_MIDI_OUT_WRITE_LONGDATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2163. #define IOCTL_WDMAUD_MIDI_IN_STOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2164. #define IOCTL_WDMAUD_MIDI_IN_RECORD WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0011, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2165. #define IOCTL_WDMAUD_MIDI_IN_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0012, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2166. #define IOCTL_WDMAUD_MIDI_IN_READ_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0013, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2167. #define IOCTL_WDMAUD_MIXER_OPEN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2168. #define IOCTL_WDMAUD_MIXER_CLOSE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2169. #define IOCTL_WDMAUD_MIXER_GETLINEINFO WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2170. #define IOCTL_WDMAUD_MIXER_GETLINECONTROLS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2171. #define IOCTL_WDMAUD_MIXER_GETCONTROLDETAILS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2172. #define IOCTL_WDMAUD_MIXER_SETCONTROLDETAILS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2173. #define IOCTL_WDMAUD_MIXER_GETHARDWAREEVENTDATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2174. ///////////////////////////////////////////////////////////////////////////////
  2175. //
  2176. // wdguid.h
  2177. //
  2178. ///////////////////////////////////////////////////////////////////////////////
  2179. //
  2180. // Device events that can be broadcasted to drivers and user-mode apps.
  2181. //
  2182. DEFINE_GUID( GUID_HWPROFILE_QUERY_CHANGE, 0xcb3a4001L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2183. DEFINE_GUID( GUID_HWPROFILE_CHANGE_CANCELLED, 0xcb3a4002L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2184. DEFINE_GUID( GUID_HWPROFILE_CHANGE_COMPLETE, 0xcb3a4003L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2185. DEFINE_GUID( GUID_DEVICE_INTERFACE_ARRIVAL, 0xcb3a4004L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2186. DEFINE_GUID( GUID_DEVICE_INTERFACE_REMOVAL, 0xcb3a4005L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2187. DEFINE_GUID( GUID_TARGET_DEVICE_QUERY_REMOVE, 0xcb3a4006L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2188. DEFINE_GUID( GUID_TARGET_DEVICE_REMOVE_CANCELLED, 0xcb3a4007L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2189. DEFINE_GUID( GUID_TARGET_DEVICE_REMOVE_COMPLETE, 0xcb3a4008L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2190. DEFINE_GUID( GUID_PNP_CUSTOM_NOTIFICATION, 0xACA73F8EL, 0x8D23, 0x11D1, 0xAC, 0x7D, 0x00, 0x00, 0xF8, 0x75, 0x71, 0xD0 );
  2191. DEFINE_GUID( GUID_PNP_POWER_NOTIFICATION, 0xC2CF0660L, 0xEB7A, 0x11D1, 0xBD, 0x7F, 0x00, 0x00, 0xF8, 0x75, 0x71, 0xD0 );
  2192. #endif
  2193. #endif // _EXTFLAGS_