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.

2736 lines
96 KiB

  1. /*++
  2. Copyright (c) 1993-1999 Microsoft Corporation
  3. Module Name:
  4. extflags.h
  5. Abstract:
  6. This header file (re)defines various flags used by extensions. These definitions
  7. are copied from different header files as stated.
  8. --*/
  9. #ifndef _EXTFLAGS_
  10. #define _EXTFLAGS_
  11. ///////////////////////////////////////////////////////////////////////////////
  12. //
  13. // apic.inc
  14. //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. //
  17. // Default Physical addresses of the APICs in a PC+MP system
  18. //
  19. #define IO_BASE_ADDRESS 0xFEC00000 // Default address of
  20. // 1st IO Apic
  21. #define LU_BASE_ADDRESS 0xFEE00000 // Default address
  22. // of Local Apic
  23. #define IO_REGISTER_SELECT 0x00000000 //
  24. #define IO_REGISTER_WINDOW 0x00000010 //
  25. #define IO_ID_REGISTER 0x00000000
  26. #define IO_VERS_REGISTER 0x00000001
  27. #define IO_ARB_ID_REGISTER 0x00000002
  28. #define IO_REDIR_00_LOW 0x00000010
  29. #define IO_REDIR_00_HIGH 0x00000011
  30. #define IO_MAX_REDIR_MASK 0x00FF0000
  31. #define IO_VERSION_MASK 0x000000FF
  32. #define LU_ID_REGISTER 0x00000020 //
  33. #define LU_VERS_REGISTER 0x00000030 //
  34. #define LU_TPR 0x00000080 //
  35. #define LU_APR 0x00000090 //
  36. #define LU_PPR 0x000000A0 //
  37. #define LU_EOI 0x000000B0 //
  38. #define LU_REMOTE_REGISTER 0x000000C0 //
  39. #define LU_LOGICAL_DEST 0x000000D0 //
  40. #define LU_LOGICAL_DEST_MASK 0xFF000000
  41. #define LU_DEST_FORMAT 0x000000E0 //
  42. #define LU_DEST_FORMAT_MASK 0xF0000000
  43. #define LU_DEST_FORMAT_FLAT 0xFFFFFFFF
  44. #define LU_DEST_FORMAT_CLUSTER 0x0FFFFFFF
  45. #define LU_SPURIOUS_VECTOR 0x000000F0 //
  46. #define LU_FAULT_VECTOR 0x00000370 //
  47. #define LU_UNIT_ENABLED 0x00000100
  48. #define LU_UNIT_DISABLED 0x00000000
  49. #define LU_ISR_0 0x00000100 //
  50. #define LU_TMR_0 0x00000180 //
  51. #define LU_IRR_0 0x00000200 //
  52. #define LU_ERROR_STATUS 0x00000280 //
  53. #define LU_INT_CMD_LOW 0x00000300 //
  54. #define LU_INT_CMD_HIGH 0x00000310 //
  55. #define LU_TIMER_VECTOR 0x00000320 //
  56. #define LU_PERF_VECTOR 0x00000340
  57. #define LU_INT_VECTOR_0 0x00000350 // TEMPORARY - do not use
  58. #define LU_INT_VECTOR_1 0x00000360 // TEMPORARY - do not use
  59. #define LU_INITIAL_COUNT 0x00000380 //
  60. #define LU_CURRENT_COUNT 0x00000390 //
  61. #define LU_DIVIDER_CONFIG 0x000003E0 //
  62. #define APIC_ID_MASK 0xFF000000
  63. #define APIC_ID_SHIFT 24
  64. #define INT_VECTOR_MASK 0x000000FF
  65. #define RESERVED_HIGH_INT 0x000000F8
  66. #define DELIVERY_MODE_MASK 0x00000700
  67. #define DELIVER_FIXED 0x00000000
  68. #define DELIVER_LOW_PRIORITY 0x00000100
  69. #define DELIVER_SMI 0x00000200
  70. #define DELIVER_REMOTE_READ 0x00000300
  71. #define DELIVER_NMI 0x00000400
  72. #define DELIVER_INIT 0x00000500
  73. #define DELIVER_STARTUP 0x00000600
  74. #define DELIVER_EXTINT 0x00000700
  75. #define PHYSICAL_DESTINATION 0x00000000
  76. #define LOGICAL_DESTINATION 0x00000800
  77. #define DELIVERY_PENDING 0x00001000
  78. #define ACTIVE_LOW 0x00002000
  79. #define ACTIVE_HIGH 0x00000000
  80. #define REMOTE_IRR 0x00004000
  81. #define LEVEL_TRIGGERED 0x00008000
  82. #define EDGE_TRIGGERED 0x00000000
  83. #define INTERRUPT_MASKED 0x00010000
  84. #define INTERRUPT_MOT_MASKED 0x00000000
  85. #define PERIODIC_TIMER 0x00020000
  86. #define ICR_LEVEL_ASSERTED 0x00004000
  87. #define ICR_LEVEL_DEASSERTED 0x00000000
  88. #define ICR_RR_STATUS_MASK 0x00030000
  89. #define ICR_RR_INVALID 0x00000000
  90. #define ICR_RR_IN_PROGRESS 0x00010000
  91. #define ICR_RR_VALID 0x00020000
  92. #define ICR_SHORTHAND_MASK 0x000C0000
  93. #define ICR_USE_DEST_FIELD 0x00000000
  94. #define ICR_SELF 0x00040000
  95. #define ICR_ALL_INCL_SELF 0x00080000
  96. #define ICR_ALL_EXCL_SELF 0x000C0000
  97. //
  98. // Io Apic Entry definitions
  99. //
  100. // Interrupt Types Possible in the PC+MP Table
  101. // valid for both local and Io Apics
  102. //
  103. #define INT_TYPE_INTR 0x0
  104. #define INT_TYPE_NMI 0x1
  105. #define INT_TYPE_SMI 0x2
  106. #define INT_TYPE_EXTINT 0x3
  107. ///////////////////////////////////////////////////////////////////////////////
  108. //
  109. // arbiter.h
  110. //
  111. ///////////////////////////////////////////////////////////////////////////////
  112. //
  113. // Attributes for the ranges
  114. //
  115. #define ARBITER_RANGE_BOOT_ALLOCATED 0x01
  116. #define ARBITER_RANGE_SHARE_DRIVER_EXCLUSIVE 0x02
  117. #define ARBITER_RANGE_ALIAS 0x10
  118. #define ARBITER_RANGE_POSITIVE_DECODE 0x20
  119. #define INITIAL_ALLOCATION_STATE_SIZE PageSize
  120. #define ARBITER_INSTANCE_SIGNATURE 'sbrA'
  121. ///////////////////////////////////////////////////////////////////////////////
  122. //
  123. // busp.h
  124. //
  125. ///////////////////////////////////////////////////////////////////////////////
  126. //
  127. // Flags definitions of DEVICE_INFORMATION and BUS_EXTENSION
  128. //
  129. #define DF_DELETED 0x00000001
  130. #define DF_REMOVED 0X00000002
  131. #define DF_NOT_FUNCTIONING 0x00000004
  132. #define DF_ENUMERATED 0x00000008
  133. #define DF_ACTIVATED 0x00000010
  134. #define DF_QUERY_STOPPED 0x00000020
  135. #define DF_SURPRISE_REMOVED 0x00000040
  136. #define DF_PROCESSING_RDP 0x00000080
  137. #define DF_STOPPED 0x00000100
  138. #define DF_RESTARTED_MOVED 0x00000200
  139. #define DF_RESTARTED_NOMOVE 0x00000400
  140. #define DF_REQ_TRIMMED 0x00000800
  141. #define DF_READ_DATA_PORT 0x40000000
  142. #define DF_BUS 0x80000000
  143. ///////////////////////////////////////////////////////////////////////////////
  144. //
  145. // cache.h
  146. //
  147. ///////////////////////////////////////////////////////////////////////////////
  148. // Define two constants describing the view size (and alignment)
  149. // that the Cache Manager uses to map files.
  150. //
  151. #define VACB_MAPPING_GRANULARITY (0x40000)
  152. #define VACB_OFFSET_SHIFT (18)
  153. ///////////////////////////////////////////////////////////////////////////////
  154. //
  155. // cc.h
  156. //
  157. ///////////////////////////////////////////////////////////////////////////////
  158. //
  159. // Define our node type codes.
  160. //
  161. #define CACHE_NTC_SHARED_CACHE_MAP (0x2FF)
  162. #define CACHE_NTC_PRIVATE_CACHE_MAP (0x2FE)
  163. #define CACHE_NTC_BCB (0x2FD)
  164. #define CACHE_NTC_DEFERRED_WRITE (0x2FC)
  165. #define CACHE_NTC_MBCB (0x2FB)
  166. #define CACHE_NTC_OBCB (0x2FA)
  167. #define CACHE_NTC_MBCB_GRANDE (0x2F9)
  168. // There is a bit of a trick as we make the jump to the multilevel structure in that
  169. // we need a real fixed reference count.
  170. //
  171. #define VACB_LEVEL_SHIFT (7)
  172. //
  173. // This is how many bytes of pointers are at each level. This is the size for both
  174. // the Vacb array and (optional) Bcb listheads. It does not include the reference
  175. // block.
  176. //
  177. // #define VACB_LEVEL_BLOCK_SIZE ((1 << VACB_LEVEL_SHIFT) * sizeof(PVOID))
  178. //
  179. // This is the last index for a level.
  180. //
  181. #define VACB_LAST_INDEX_FOR_LEVEL ((1 << VACB_LEVEL_SHIFT) - 1)
  182. //
  183. // This is the size of file which can be handled in a single level.
  184. //
  185. #define VACB_SIZE_OF_FIRST_LEVEL (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 (unsigned)((BuildNo < 2251) ? 128 : 256)
  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. #define GRAN_BYTE 0
  740. #define GRAN_PAGE 1
  741. ///////////////////////////////////////////////////////////////////////////////
  742. //
  743. // ob.h
  744. //
  745. ///////////////////////////////////////////////////////////////////////////////
  746. #define OB_FLAG_NEW_OBJECT 0x01
  747. #define OB_FLAG_KERNEL_OBJECT 0x02
  748. #define OB_FLAG_CREATOR_INFO 0x04
  749. #define OB_FLAG_EXCLUSIVE_OBJECT 0x08
  750. #define OB_FLAG_PERMANENT_OBJECT 0x10
  751. #define OB_FLAG_DEFAULT_SECURITY_QUOTA 0x20
  752. #define OB_FLAG_SINGLE_HANDLE_ENTRY 0x40
  753. ///////////////////////////////////////////////////////////////////////////////
  754. //
  755. // openhci.h
  756. //
  757. ///////////////////////////////////////////////////////////////////////////////
  758. //values for HcFlags
  759. #define HC_FLAG_REMOTE_WAKEUP_CONNECTED 0x00000001
  760. #define HC_FLAG_LEGACY_BIOS_DETECTED 0x00000002
  761. #define HC_FLAG_SLOW_BULK_ENABLE 0x00000004
  762. #define HC_FLAG_SHUTDOWN 0x00000008 // not really used
  763. #define HC_FLAG_MAP_SX_TO_D3 0x00000010
  764. #define HC_FLAG_IDLE 0x00000020
  765. #define HC_FLAG_DISABLE_IDLE_CHECK 0x00000040
  766. #define HC_FLAG_DEVICE_STARTED 0x00000080
  767. #define HC_FLAG_LOST_POWER 0x00000100
  768. #define HC_FLAG_DISABLE_IDLE_MODE 0x00000200
  769. #define HC_FLAG_USE_HYDRA_HACK 0x00000400
  770. #define HC_FLAG_IN_DPC 0x00000800
  771. #define HC_FLAG_SUSPEND_NEXT_D3 0x00001000
  772. #define HC_FLAG_LIST_FIX_ENABLE 0x00002000
  773. #define HC_FLAG_HUNG_CHECK_ENABLE 0x00004000
  774. #define PENDING_TD_LIST_SIZE 1000
  775. #define HcCtrl_CBSR_MASK 0x00000003L
  776. #define HcCtrl_CBSR_1_to_1 0x00000000L
  777. #define HcCtrl_CBSR_2_to_1 0x00000001L
  778. #define HcCtrl_CBSR_3_to_1 0x00000002L
  779. #define HcCtrl_CBSR_4_to_1 0x00000003L
  780. #define HcCtrl_PeriodicListEnable 0x00000004L
  781. #define HcCtrl_IsochronousEnable 0x00000008L
  782. #define HcCtrl_ControlListEnable 0x00000010L
  783. #define HcCtrl_BulkListEnable 0x00000020L
  784. #define HcCtrl_ListEnableMask 0x00000038L
  785. #define HcCtrl_HCFS_MASK 0x000000C0L
  786. #define HcCtrl_HCFS_USBReset 0x00000000L
  787. #define HcCtrl_HCFS_USBResume 0x00000040L
  788. #define HcCtrl_HCFS_USBOperational 0x00000080L
  789. #define HcCtrl_HCFS_USBSuspend 0x000000C0L
  790. #define HcCtrl_InterruptRouting 0x00000100L
  791. #define HcCtrl_RemoteWakeupConnected 0x00000200L
  792. #define HcCtrl_RemoteWakeupEnable 0x00000400L
  793. #define HcHCFS_USBReset 0x00000000
  794. #define HcHCFS_USBResume 0x00000001
  795. #define HcHCFS_USBOperational 0x00000002
  796. #define HcHCFS_USBSuspend 0x00000003
  797. #define HcCmd_HostControllerReset 0x00000001
  798. #define HcCmd_ControlListFilled 0x00000002
  799. #define HcCmd_BulkListFilled 0x00000004
  800. #define HcCmd_OwnershipChangeRequest 0x00000008
  801. #define HcCmd_SOC_Mask 0x00030000
  802. #define HcCmd_SOC_Offset 16
  803. #define HcCmd_SOC_Mask_LowBits 0x00000003
  804. //
  805. // Definitions for HC_ENDPOINT_CONTROL.Direction
  806. //
  807. #define HcEDDirection_Defer 0 // Defer direction to TD (Control Endpoints)
  808. #define HcEDDirection_Out 1 // Direction from host to device
  809. #define HcEDDirection_In 2 // Direction from device to host
  810. //
  811. // The different ED lists are as follows.
  812. //
  813. #define ED_INTERRUPT_1ms 0
  814. #define ED_INTERRUPT_2ms 1
  815. #define ED_INTERRUPT_4ms 3
  816. #define ED_INTERRUPT_8ms 7
  817. #define ED_INTERRUPT_16ms 15
  818. #define ED_INTERRUPT_32ms 31
  819. #define ED_CONTROL 63
  820. #define ED_BULK 64
  821. #define ED_ISOCHRONOUS 0 // same as 1ms interrupt queue
  822. #define NO_ED_LISTS 65
  823. #define ED_EOF 0xff
  824. //
  825. // 7.1.4 HcInterrruptStatus Register
  826. // 7.1.5 HcInterruptEnable Register
  827. // 7.1.6 HcInterruptDisable Register
  828. //
  829. #define HcInt_SchedulingOverrun 0x00000001L
  830. #define HcInt_WritebackDoneHead 0x00000002L
  831. #define HcInt_StartOfFrame 0x00000004L
  832. #define HcInt_ResumeDetected 0x00000008L
  833. #define HcInt_UnrecoverableError 0x00000010L
  834. #define HcInt_FrameNumberOverflow 0x00000020L
  835. #define HcInt_RootHubStatusChange 0x00000040L
  836. #define HcInt_OwnershipChange 0x40000000L
  837. #define HcInt_MasterInterruptEnable 0x80000000L
  838. //
  839. // 7.4.3 HcRhStatus Register
  840. //
  841. #define HcRhS_LocalPowerStatus 0x00000001 // read only
  842. #define HcRhS_OverCurrentIndicator 0x00000002 // read only
  843. #define HcRhS_DeviceRemoteWakeupEnable 0x00008000 // read only
  844. #define HcRhS_LocalPowerStatusChange 0x00010000 // read only
  845. #define HcRhS_OverCurrentIndicatorChange 0x00020000 // read only
  846. #define HcRhS_ClearGlobalPower 0x00000001 // write only
  847. #define HcRhS_SetRemoteWakeupEnable 0x00008000 // write only
  848. #define HcRhS_SetGlobalPower 0x00010000 // write only
  849. #define HcRhS_ClearOverCurrentIndicatorChange 0x00020000 // write only
  850. #define HcRhS_ClearRemoteWakeupEnable 0x80000000 // write only
  851. //
  852. // 7.4.4 HcRhPortStatus Register
  853. //
  854. #define HcRhPS_CurrentConnectStatus 0x00000001 // read only
  855. #define HcRhPS_PortEnableStatus 0x00000002 // read only
  856. #define HcRhPS_PortSuspendStatus 0x00000004 // read only
  857. #define HcRhPS_PortOverCurrentIndicator 0x00000008 // read only
  858. #define HcRhPS_PortResetStatus 0x00000010 // read only
  859. #define HcRhPS_PortPowerStatus 0x00000100 // read only
  860. #define HcRhPS_LowSpeedDeviceAttached 0x00000200 // read only
  861. #define HcRhPS_ConnectStatusChange 0x00010000 // read only
  862. #define HcRhPS_PortEnableStatusChange 0x00020000 // read only
  863. #define HcRhPS_PortSuspendStatusChange 0x00040000 // read only
  864. #define HcRhPS_OverCurrentIndicatorChange 0x00080000 // read only
  865. #define HcRhPS_PortResetStatusChange 0x00100000 // read only
  866. #define HcRhPS_ClearPortEnable 0x00000001 // write only
  867. #define HcRhPS_SetPortEnable 0x00000002 // write only
  868. #define HcRhPS_SetPortSuspend 0x00000004 // write only
  869. #define HcRhPS_ClearPortSuspend 0x00000008 // write only
  870. #define HcRhPS_SetPortReset 0x00000010 // write only
  871. #define HcRhPS_SetPortPower 0x00000100 // write only
  872. #define HcRhPS_ClearPortPower 0x00000200 // write only
  873. #define HcRhPS_ClearConnectStatusChange 0x00010000 // write only
  874. #define HcRhPS_ClearPortEnableStatusChange 0x00020000 // write only
  875. #define HcRhPS_ClearPortSuspendStatusChange 0x00040000 // write only
  876. #define HcRhPS_ClearPortOverCurrentChange 0x00080000 // write only
  877. #define HcRhPS_ClearPortResetStatusChange 0x00100000 // write only
  878. #define HcRhPS_RESERVED (~(HcRhPS_CurrentConnectStatus | \
  879. HcRhPS_PortEnableStatus | \
  880. HcRhPS_PortSuspendStatus | \
  881. HcRhPS_PortOverCurrentIndicator | \
  882. HcRhPS_PortResetStatus | \
  883. HcRhPS_PortPowerStatus | \
  884. HcRhPS_LowSpeedDeviceAttached | \
  885. HcRhPS_ConnectStatusChange | \
  886. HcRhPS_PortEnableStatusChange | \
  887. HcRhPS_PortSuspendStatusChange | \
  888. HcRhPS_OverCurrentIndicatorChange | \
  889. HcRhPS_PortResetStatusChange \
  890. ))
  891. //
  892. // Definitions for HC_TRANSFER_CONTROL.Control
  893. //
  894. #define HcTDControl_STARTING_FRAME 0x0000FFFF // mask for starting frame (Isochronous)
  895. #define HcTDControl_ISOCHRONOUS 0x00010000 // 1 for Isoch TD, 0 for General TD
  896. #define HcTDControl_SHORT_XFER_OK 0x00040000 // 0 if short transfers are errors
  897. #define HcTDControl_DIR_MASK 0x00180000 // Transfer direction field
  898. #define HcTDControl_DIR_SETUP 0x00000000 // direction is setup packet from host to device
  899. #define HcTDControl_DIR_OUT 0x00080000 // direction is from host to device
  900. #define HcTDControl_DIR_IN 0x00100000 // direction is from device to host
  901. #define HcTDControl_INT_DELAY_MASK 0x00E00000 // Interrupt Delay field
  902. #define HcTDControl_INT_DELAY_0_MS 0x00000000 // Interrupt at end of frame TD is completed
  903. #define HcTDControl_INT_DELAY_1_MS 0x00200000 // Interrupt no later than end of 1st frame after TD is completed
  904. #define HcTDControl_INT_DELAY_2_MS 0x00400000 // Interrupt no later than end of 2nd frame after TD is completed
  905. #define HcTDControl_INT_DELAY_3_MS 0x00600000 // Interrupt no later than end of 3rd frame after TD is completed
  906. #define HcTDControl_INT_DELAY_4_MS 0x00800000 // Interrupt no later than end of 4th frame after TD is completed
  907. #define HcTDControl_INT_DELAY_5_MS 0x00A00000 // Interrupt no later than end of 5th frame after TD is completed
  908. #define HcTDControl_INT_DELAY_6_MS 0x00C00000 // Interrupt no later than end of 6th frame after TD is completed
  909. #ifdef NSC
  910. #define HcTDControl_INT_DELAY_NO_INT 0x00C00000 // Almost infinity but not yet quite.
  911. #elif DISABLE_INT_DELAY_NO_INT
  912. #define HcTDControl_INT_DELAY_NO_INT 0x00000000 // Interrupt at the completion of all packets.
  913. #else
  914. #define HcTDControl_INT_DELAY_NO_INT 0x00E00000 // Do not cause an interrupt for normal completion of this TD
  915. #endif
  916. #define HcTDControl_FRAME_COUNT_MASK 0x07000000 // mask for FrameCount field (Isochronous)
  917. #define HcTDControl_FRAME_COUNT_SHIFT 24 // shift count for FrameCount (Isochronous)
  918. #define HcTDControl_FRAME_COUNT_MAX 8 // Max number of for frame count per TD
  919. #define HcTDControl_TOGGLE_MASK 0x03000000 // mask for Toggle control field
  920. #define HcTDControl_TOGGLE_FROM_ED 0x00000000 // get data toggle from CARRY field of ED
  921. #define HcTDControl_TOGGLE_DATA0 0x02000000 // use DATA0 for data PID
  922. #define HcTDControl_TOGGLE_DATA1 0x03000000 // use DATA1 for data PID
  923. #define HcTDControl_ERROR_COUNT 0x0C000000 // mask for Error Count field
  924. #define HcTDControl_CONDITION_CODE_MASK 0xF0000000 // mask for ConditionCode field
  925. #define HcTDControl_CONDITION_CODE_SHIFT 28 // shift count for ConditionCode
  926. //
  927. // Definitions for HC_TRANSFER_CONTROL.Direction
  928. //
  929. #define HcTDDirection_Setup 0 // setup packet from host to device
  930. #define HcTDDirection_Out 1 // direction from host to device
  931. #define HcTDDirection_In 2 // direction from device to host
  932. //
  933. // Definitions for Hc_TRANSFER_CONTROL.IntDelay
  934. //
  935. #define HcTDIntDelay_0ms 0 // interrupt at end of frame TD is completed
  936. #define HcTDIntDelay_1ms 1 // Interrupt no later than end of 1st frame after TD is completed
  937. #define HcTDIntDelay_2ms 2 // Interrupt no later than end of 2nd frame after TD is completed
  938. #define HcTDIntDelay_3ms 3 // Interrupt no later than end of 3rd frame after TD is completed
  939. #define HcTDIntDelay_4ms 4 // Interrupt no later than end of 4th frame after TD is completed
  940. #define HcTDIntDelay_5ms 5 // Interrupt no later than end of 5th frame after TD is completed
  941. #define HcTDIntDelay_6ms 6 // Interrupt no later than end of 6th frame after TD is completed
  942. #define HcTDIntDelay_NoInterrupt 7 // do not generate interrupt for normal completion of this TD
  943. //
  944. // Definitions for HC_TRANSFER_CONTROL.Toggle
  945. //
  946. #define HcTDToggle_FromEd 0 // get toggle for Endpoint Descriptor toggle CARRY bit
  947. #define HcTDToggle_Data0 2 // use Data0 PID
  948. #define HcTDToggle_Data1 3 // use Data1 PID
  949. //
  950. // Definitions for HC_TRANSFER_CONTROL.ConditionCode and HC_OFFSET_PSW.ConditionCode
  951. //
  952. #define HcCC_NoError 0x0UL
  953. #define HcCC_CRC 0x1UL
  954. #define HcCC_BitStuffing 0x2UL
  955. #define HcCC_DataToggleMismatch 0x3UL
  956. #define HcCC_Stall 0x4UL
  957. #define HcCC_DeviceNotResponding 0x5UL
  958. #define HcCC_PIDCheckFailure 0x6UL
  959. #define HcCC_UnexpectedPID 0x7UL
  960. #define HcCC_DataOverrun 0x8UL
  961. #define HcCC_DataUnderrun 0x9UL
  962. // 0xA // reserved
  963. // 0xB // reserved
  964. #define HcCC_BufferOverrun 0xCUL
  965. #define HcCC_BufferUnderrun 0xDUL
  966. #define HcCC_NotAccessed 0xEUL
  967. ///////////////////////////////////////////////////////////////////////////////
  968. //
  969. // pci.h
  970. //
  971. ///////////////////////////////////////////////////////////////////////////////
  972. //
  973. // Note - State.c depends on the order of these.
  974. //
  975. typedef enum {
  976. PciNotStarted = 0,
  977. PciStarted,
  978. PciDeleted,
  979. PciStopped,
  980. PciSurpriseRemoved,
  981. PciSynchronizedOperation,
  982. PciMaxObjectState
  983. } PCI_OBJECT_STATE;
  984. //
  985. // Base Class Code encodings for Base Class (from PCI spec rev 2.1).
  986. //
  987. #define PCI_CLASS_PRE_20 0x00
  988. #define PCI_CLASS_MASS_STORAGE_CTLR 0x01
  989. #define PCI_CLASS_NETWORK_CTLR 0x02
  990. #define PCI_CLASS_DISPLAY_CTLR 0x03
  991. #define PCI_CLASS_MULTIMEDIA_DEV 0x04
  992. #define PCI_CLASS_MEMORY_CTLR 0x05
  993. #define PCI_CLASS_BRIDGE_DEV 0x06
  994. #define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07
  995. #define PCI_CLASS_BASE_SYSTEM_DEV 0x08
  996. #define PCI_CLASS_INPUT_DEV 0x09
  997. #define PCI_CLASS_DOCKING_STATION 0x0a
  998. #define PCI_CLASS_PROCESSOR 0x0b
  999. #define PCI_CLASS_SERIAL_BUS_CTLR 0x0c
  1000. // 0d thru fe reserved
  1001. #define PCI_CLASS_NOT_DEFINED 0xff
  1002. //
  1003. // Sub Class Code encodings (PCI rev 2.1).
  1004. //
  1005. // Class 00 - PCI_CLASS_PRE_20
  1006. #define PCI_SUBCLASS_PRE_20_NON_VGA 0x00
  1007. #define PCI_SUBCLASS_PRE_20_VGA 0x01
  1008. // Class 01 - PCI_CLASS_MASS_STORAGE_CTLR
  1009. #define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00
  1010. #define PCI_SUBCLASS_MSC_IDE_CTLR 0x01
  1011. #define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02
  1012. #define PCI_SUBCLASS_MSC_IPI_CTLR 0x03
  1013. #define PCI_SUBCLASS_MSC_RAID_CTLR 0x04
  1014. #define PCI_SUBCLASS_MSC_OTHER 0x80
  1015. // Class 02 - PCI_CLASS_NETWORK_CTLR
  1016. #define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00
  1017. #define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01
  1018. #define PCI_SUBCLASS_NET_FDDI_CTLR 0x02
  1019. #define PCI_SUBCLASS_NET_ATM_CTLR 0x03
  1020. #define PCI_SUBCLASS_NET_OTHER 0x80
  1021. // Class 03 - PCI_CLASS_DISPLAY_CTLR
  1022. // N.B. Sub Class 00 could be VGA or 8514 depending on Interface byte
  1023. #define PCI_SUBCLASS_VID_VGA_CTLR 0x00
  1024. #define PCI_SUBCLASS_VID_XGA_CTLR 0x01
  1025. #define PCI_SUBCLASS_VID_OTHER 0x80
  1026. // Class 04 - PCI_CLASS_MULTIMEDIA_DEV
  1027. #define PCI_SUBCLASS_MM_VIDEO_DEV 0x00
  1028. #define PCI_SUBCLASS_MM_AUDIO_DEV 0x01
  1029. #define PCI_SUBCLASS_MM_OTHER 0x80
  1030. // Class 05 - PCI_CLASS_MEMORY_CTLR
  1031. #define PCI_SUBCLASS_MEM_RAM 0x00
  1032. #define PCI_SUBCLASS_MEM_FLASH 0x01
  1033. #define PCI_SUBCLASS_MEM_OTHER 0x80
  1034. // Class 06 - PCI_CLASS_BRIDGE_DEV
  1035. #define PCI_SUBCLASS_BR_HOST 0x00
  1036. #define PCI_SUBCLASS_BR_ISA 0x01
  1037. #define PCI_SUBCLASS_BR_EISA 0x02
  1038. #define PCI_SUBCLASS_BR_MCA 0x03
  1039. #define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04
  1040. #define PCI_SUBCLASS_BR_PCMCIA 0x05
  1041. #define PCI_SUBCLASS_BR_NUBUS 0x06
  1042. #define PCI_SUBCLASS_BR_CARDBUS 0x07
  1043. #define PCI_SUBCLASS_BR_OTHER 0x80
  1044. // Class 07 - PCI_CLASS_SIMPLE_COMMS_CTLR
  1045. // N.B. Sub Class 00 and 01 additional info in Interface byte
  1046. #define PCI_SUBCLASS_COM_SERIAL 0x00
  1047. #define PCI_SUBCLASS_COM_PARALLEL 0x01
  1048. #define PCI_SUBCLASS_COM_OTHER 0x80
  1049. // Class 08 - PCI_CLASS_BASE_SYSTEM_DEV
  1050. // N.B. See Interface byte for additional info.
  1051. #define PCI_SUBCLASS_SYS_INTERRUPT_CTLR 0x00
  1052. #define PCI_SUBCLASS_SYS_DMA_CTLR 0x01
  1053. #define PCI_SUBCLASS_SYS_SYSTEM_TIMER 0x02
  1054. #define PCI_SUBCLASS_SYS_REAL_TIME_CLOCK 0x03
  1055. #define PCI_SUBCLASS_SYS_OTHER 0x80
  1056. // Class 09 - PCI_CLASS_INPUT_DEV
  1057. #define PCI_SUBCLASS_INP_KEYBOARD 0x00
  1058. #define PCI_SUBCLASS_INP_DIGITIZER 0x01
  1059. #define PCI_SUBCLASS_INP_MOUSE 0x02
  1060. #define PCI_SUBCLASS_INP_OTHER 0x80
  1061. // Class 0a - PCI_CLASS_DOCKING_STATION
  1062. #define PCI_SUBCLASS_DOC_GENERIC 0x00
  1063. #define PCI_SUBCLASS_DOC_OTHER 0x80
  1064. // Class 0b - PCI_CLASS_PROCESSOR
  1065. #define PCI_SUBCLASS_PROC_386 0x00
  1066. #define PCI_SUBCLASS_PROC_486 0x01
  1067. #define PCI_SUBCLASS_PROC_PENTIUM 0x02
  1068. #define PCI_SUBCLASS_PROC_ALPHA 0x10
  1069. #define PCI_SUBCLASS_PROC_POWERPC 0x20
  1070. #define PCI_SUBCLASS_PROC_COPROCESSOR 0x40
  1071. // Class 0c - PCI_CLASS_SERIAL_BUS_CTLR
  1072. #define PCI_SUBCLASS_SB_IEEE1394 0x00
  1073. #define PCI_SUBCLASS_SB_ACCESS 0x01
  1074. #define PCI_SUBCLASS_SB_SSA 0x02
  1075. #define PCI_SUBCLASS_SB_USB 0x03
  1076. #define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04
  1077. //
  1078. // Bit encodings for PCI_COMMON_CONFIG.Command
  1079. //
  1080. #define PCI_ENABLE_IO_SPACE 0x0001
  1081. #define PCI_ENABLE_MEMORY_SPACE 0x0002
  1082. #define PCI_ENABLE_BUS_MASTER 0x0004
  1083. #define PCI_ENABLE_SPECIAL_CYCLES 0x0008
  1084. #define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010
  1085. #define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020
  1086. #define PCI_ENABLE_PARITY 0x0040 // (ro+)
  1087. #define PCI_ENABLE_WAIT_CYCLE 0x0080 // (ro+)
  1088. #define PCI_ENABLE_SERR 0x0100 // (ro+)
  1089. #define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200 // (ro)
  1090. #define PCI_TYPE0_ADDRESSES 6
  1091. #define PCI_TYPE1_ADDRESSES 2
  1092. #define PCI_TYPE2_ADDRESSES 5
  1093. ///////////////////////////////////////////////////////////////////////////////
  1094. //
  1095. // pcmcia.h
  1096. //
  1097. ///////////////////////////////////////////////////////////////////////////////
  1098. //
  1099. // Flags indicating card/controller state
  1100. //
  1101. #define PCMCIA_DEVICE_STARTED 0x00000001
  1102. #define PCMCIA_DEVICE_LOGICALLY_REMOVED 0x00000002
  1103. #define PCMCIA_DEVICE_PHYSICALLY_REMOVED 0x00000004
  1104. #define PCMCIA_DEVICE_MULTIFUNCTION 0x00000008
  1105. #define PCMCIA_DEVICE_WAKE_PENDING 0x00000010
  1106. #define PCMCIA_DEVICE_LEGACY_DETECTED 0x00000020
  1107. #define PCMCIA_DEVICE_DELETED 0x00000040
  1108. #define PCMCIA_DEVICE_CARDBUS 0x00000080
  1109. #define PCMCIA_FILTER_ADDED_MEMORY 0x00000100
  1110. #define PCMCIA_MEMORY_24BIT 0x00000200
  1111. #define PCMCIA_CARDBUS_NOT_SUPPORTED 0x00000400
  1112. #define PCMCIA_USE_POLLED_CSC 0x00000800
  1113. #define PCMCIA_ATTRIBUTE_MEMORY_MAPPED 0x00001000
  1114. #define PCMCIA_SOCKET_REGISTER_BASE_MAPPED 0x00002000
  1115. #define PCMCIA_INTMODE_COMPAQ 0x00004000
  1116. #define PCMCIA_POWER_WORKER_POWERUP 0x00008000
  1117. #define PCMCIA_SOCKET_POWER_REQUESTED 0x00010000
  1118. #define PCMCIA_CONFIG_STATUS_DEFERRED 0x00020000
  1119. #define PCMCIA_POWER_STATUS_DEFERRED 0x00040000
  1120. #define PCMCIA_INT_ROUTE_INTERFACE 0x00080000
  1121. #define PCMCIA_FDO_CONTEXT_SAVED 0x00100000
  1122. #define PCMCIA_FDO_DEFAULT_IRQ_MASK 0x00200000
  1123. //
  1124. // Socket flags
  1125. //
  1126. #define SOCKET_CARD_IN_SOCKET 0x00000001
  1127. #define SOCKET_CARD_INITIALIZED 0x00000002
  1128. #define SOCKET_CARD_POWERED_UP 0x00000004
  1129. #define SOCKET_CARD_CONFIGURED 0x00000008
  1130. #define SOCKET_CARD_MULTIFUNCTION 0x00000010
  1131. #define SOCKET_CARD_CARDBUS 0x00000020
  1132. #define SOCKET_CARD_MEMORY 0x00000040
  1133. #define SOCKET_CHANGE_INTERRUPT 0x00000080
  1134. #define SOCKET_CUSTOM_INTERFACE 0x00000100
  1135. #define SOCKET_INSERTED_SOUND_PENDING 0x00000200
  1136. #define SOCKET_REMOVED_SOUND_PENDING 0x00000400
  1137. #define SOCKET_SUPPORT_MESSAGE_SENT 0x00000800
  1138. #define SOCKET_MEMORY_WINDOW_ENABLED 0x00001000
  1139. #define SOCKET_CARD_STATUS_CHANGE 0x00002000
  1140. #define SOCKET_POWER_STATUS_DEFERRED 0x00004000
  1141. //
  1142. // Worker states for socket power operations
  1143. //
  1144. #define SPW_Stopped 0
  1145. #define SPW_Exit 1
  1146. #define SPW_RequestPower 2
  1147. #define SPW_ReleasePower 3
  1148. #define SPW_SetPowerOn 4
  1149. #define SPW_SetPowerOff 5
  1150. #define SPW_ParentPowerUp 6
  1151. #define SPW_ParentPowerUpComplete 7
  1152. //
  1153. // Controller classes returned in socket information structure.
  1154. //
  1155. typedef enum _PCMCIA_CONTROLLER_CLASS {
  1156. PcmciaInvalidControllerClass = -1,
  1157. PcmciaIntelCompatible,
  1158. PcmciaCardBusCompatible,
  1159. PcmciaElcController,
  1160. PcmciaDatabook,
  1161. PcmciaPciPcmciaBridge,
  1162. PcmciaCirrusLogic,
  1163. PcmciaTI,
  1164. PcmciaTopic,
  1165. PcmciaRicoh,
  1166. PcmciaDatabookCB,
  1167. PcmciaOpti,
  1168. PcmciaTrid,
  1169. PcmciaO2Micro,
  1170. PcmciaNEC,
  1171. PcmciaNEC_98
  1172. } PCMCIA_CONTROLLER_CLASS, *PPCMCIA_CONTROLLER_CLASS;
  1173. #define PcmciaInvalidControllerType 0xffffffff
  1174. #define PCMCIA_INVALID_CONFIGURATION 0x00000001
  1175. // Max length of device id
  1176. #define PCMCIA_MAXIMUM_DEVICE_ID_LENGTH 128
  1177. //
  1178. // states for PdoPowerWorker
  1179. //
  1180. #define PPW_Stopped 0
  1181. #define PPW_Exit 1
  1182. #define PPW_InitialState 2
  1183. #define PPW_PowerUp 3
  1184. #define PPW_PowerUpComplete 4
  1185. #define PPW_PowerDown 5
  1186. #define PPW_PowerDownComplete 6
  1187. #define PPW_SendIrpDown 7
  1188. #define PPW_16BitConfigure 8
  1189. #define PPW_Deconfigure 9
  1190. #define PPW_VerifyCard 10
  1191. #define PPW_CardBusRefresh 11
  1192. #define PPW_CardBusDelay 12
  1193. //
  1194. // phases for ConfigurationWorker
  1195. //
  1196. // Note that the ConfigurationPhase is simply incremented, these
  1197. // definitions are just for clarity.
  1198. //
  1199. #define CW_Stopped 0
  1200. #define CW_Phase1 1
  1201. #define CW_Phase2 2
  1202. #define CW_Phase3 3
  1203. #define CW_Exit 4
  1204. ///////////////////////////////////////////////////////////////////////////////
  1205. //
  1206. // pcmp.inc
  1207. //
  1208. ///////////////////////////////////////////////////////////////////////////////
  1209. //
  1210. // IMCR (Interrupt Mode Control Register) access definitions
  1211. //
  1212. #define ImcrDisableApic 0x00
  1213. #define ImcrEnableApic 0x01
  1214. #define ImcrRegPortAddr 0x22
  1215. #if defined(NEC_98)
  1216. #define ImcrDataPortAddr 0x700
  1217. #else // defined(NEC_98)
  1218. #define ImcrDataPortAddr 0x23
  1219. #endif // defined(NEC_98)
  1220. #define ImcrPort 0x70
  1221. // Physical location where the Extended BIOS Data Area segment adress is store
  1222. #define EBDA_SEGMENT_PTR 0x40e
  1223. #define BASE_MEM_PTR 0x413
  1224. //
  1225. // The PC+MP configuration table Possible Entry Types
  1226. //
  1227. #define ENTRY_PROCESSOR 0
  1228. #define ENTRY_BUS 1
  1229. #define ENTRY_IOAPIC 2
  1230. #define ENTRY_INTI 3
  1231. #define ENTRY_LINTI 4
  1232. #define HEADER_SIZE 0x2c
  1233. // Number of default configurations for PC+MP version 1.1
  1234. #define NUM_DEFAULT_CONFIGS 7
  1235. //
  1236. // Bits used in the CpuFlags field of the Processor entry
  1237. //
  1238. #define CPU_DISABLED 0x0 // 1 Bit - CPU Disabled
  1239. #define CPU_ENABLED 0x1 // 1 Bit - CPU Enabled
  1240. #define BSP_CPU 0x2 // Bit #2 - CPU is BSP
  1241. // APIC Versions used by PC+MP systems - this is used in the
  1242. // Processor entries and the IoApic Entries
  1243. //
  1244. #define APIC_INTEGRATED 0x10 // 8 Bits-Apic Version Register
  1245. #define APIC_82489DX 0x0 // 8 Bits-Apic Version Register
  1246. //
  1247. // Io Apic Entry definitions
  1248. //
  1249. // Valid IoApicFlag values
  1250. //
  1251. #define IO_APIC_ENABLED 0x1
  1252. #define IO_APIC_DISABLED 0x0
  1253. //
  1254. // Default value for Io Apic ID.
  1255. //
  1256. #define IOUNIT_APIC_ID 0xE
  1257. //
  1258. // PC+MP Signature used to verify the PC+MP table
  1259. // as valid
  1260. //
  1261. // "P"=50H,"C"=43H,"M"=4dH,"P"=50H
  1262. //
  1263. #define PCMP_SIGNATURE 0x504d4350
  1264. //
  1265. // PC+MP Signature used to identify the floating pointer
  1266. // structure (in extended BIOS data segment) that contains
  1267. // a pointer to the PC+MP table.
  1268. //
  1269. // "_"=5fH, "M"=4dH, "P"=50H, "_"=5fH
  1270. //
  1271. #define MP_PTR_SIGNATURE 0x5f504d5f
  1272. //
  1273. // Extension table definitions
  1274. //
  1275. #define EXTTYPE_BUS_ADDRESS_MAP 128
  1276. #define EXTTYPE_BUS_HIERARCHY 129
  1277. #define EXTTYPE_BUS_COMPATIBLE_MAP 130
  1278. #define EXTTYPE_PERSISTENT_STORE 131
  1279. #define MPS_ADDRESS_MAP_IO 0
  1280. #define MPS_ADDRESS_MAP_MEMORY 1
  1281. #define MPS_ADDRESS_MAP_PREFETCH_MEMORY 2
  1282. #define MPS_ADDRESS_MAP_UNDEFINED 9
  1283. //
  1284. // The System configuration table as used by a PC_MP system
  1285. //
  1286. //
  1287. // The offset is relative to the BIOS starting at f0000H
  1288. //
  1289. #define PTR_OFFSET 0x0000e6f5
  1290. #define BIOS_BASE 0x000f0000
  1291. #define PCMP_IMPLEMENTED 0x01 // In MpFeatureInfoByte1
  1292. #define PCMP_CONFIG_MASK 0x0e // In MpFeatureInfoByte1
  1293. #define IMCR_MASK 0x80 // In MpFeatureInfoByte2
  1294. #define MULT_CLOCKS_MASK 0x40 // In MpFeatureInfoByte2
  1295. ///////////////////////////////////////////////////////////////////////////////
  1296. //
  1297. // pnpiop.h
  1298. //
  1299. ///////////////////////////////////////////////////////////////////////////////
  1300. typedef enum _PNP_DEVNODE_STATE {
  1301. DeviceNodeUnspecified = 0x300, // 768
  1302. DeviceNodeUninitialized, // 769
  1303. DeviceNodeInitialized, // 770
  1304. DeviceNodeDriversAdded, // 771
  1305. DeviceNodeResourcesAssigned, // 772 - Operational state for Added
  1306. DeviceNodeStartPending, // 773 - Operational state for Added
  1307. DeviceNodeStartCompletion, // 774 - Operational state for Added
  1308. DeviceNodeStartPostWork, // 775 - Operational state for Added
  1309. DeviceNodeStarted, // 776
  1310. DeviceNodeQueryStopped, // 777
  1311. DeviceNodeStopped, // 778
  1312. DeviceNodeRestartCompletion, // 779 - Operational state for Stopped
  1313. DeviceNodeEnumeratePending, // 780 - Operational state for Started
  1314. DeviceNodeEnumerateCompletion, // 781 - Operational state for Started
  1315. DeviceNodeAwaitingQueuedDeletion, // 782
  1316. DeviceNodeAwaitingQueuedRemoval, // 783
  1317. DeviceNodeQueryRemoved, // 784
  1318. DeviceNodeRemovePendingCloses, // 785
  1319. DeviceNodeRemoved, // 786
  1320. DeviceNodeDeletePendingCloses, // 787
  1321. DeviceNodeDeleted // 788
  1322. } PNP_DEVNODE_STATE, *PPNP_DEVNODE_STATE;
  1323. #define STATE_HISTORY_SIZE 20
  1324. //
  1325. // DNF_MAKEUP - this devnode's device is created and owned by PnP manager
  1326. //
  1327. #define DNF_MADEUP 0x00000001
  1328. //
  1329. // DNF_DUPLICATE - this devnode's device is a duplicate of another enumerate PDO
  1330. //
  1331. #define DNF_DUPLICATE 0x00000002
  1332. //
  1333. // DNF_HAL_NODE - a flag to indicate which device node is the root node created by
  1334. // the hal
  1335. //
  1336. #define DNF_HAL_NODE 0x00000004
  1337. //
  1338. // DNF_REENUMERATE - needs to be reenumerated
  1339. //
  1340. #define DNF_REENUMERATE 0x00000008
  1341. //
  1342. // DNF_ENUMERATED - used to track enumeration in IopEnumerateDevice()
  1343. //
  1344. #define DNF_ENUMERATED 0x00000010
  1345. //
  1346. // Singal that we need to send driver query id irps
  1347. //
  1348. #define DNF_IDS_QUERIED 0x00000020
  1349. //
  1350. // DNF_HAS_BOOT_CONFIG - the device has resource assigned by BIOS. It is considered
  1351. // pseudo-started and need to participate in rebalance.
  1352. //
  1353. #define DNF_HAS_BOOT_CONFIG 0x00000040
  1354. //
  1355. // DNF_BOOT_CONFIG_RESERVED - Indicates the BOOT resources of the device are reserved.
  1356. //
  1357. #define DNF_BOOT_CONFIG_RESERVED 0x00000080
  1358. //
  1359. // DNF_NO_RESOURCE_REQUIRED - this devnode's device does not require resource.
  1360. //
  1361. #define DNF_NO_RESOURCE_REQUIRED 0x00000100
  1362. //
  1363. // DNF_RESOURCE_REQUIREMENTS_NEED_FILTERED - to distinguished the
  1364. // DeviceNode->ResourceRequirements is a filtered list or not.
  1365. //
  1366. #define DNF_RESOURCE_REQUIREMENTS_NEED_FILTERED 0x00000200
  1367. //
  1368. // DNF_RESOURCE_REQUIREMENTS_CHANGED - Indicates the device's resource
  1369. // requirements list has been changed.
  1370. //
  1371. #define DNF_RESOURCE_REQUIREMENTS_CHANGED 0x00000400
  1372. //
  1373. // DNF_NON_STOPPED_REBALANC - indicates the device can be restarted with new
  1374. // resources without being stopped.
  1375. //
  1376. #define DNF_NON_STOPPED_REBALANCE 0x00000800
  1377. //
  1378. // The device's controlling driver is a legacy driver
  1379. //
  1380. #define DNF_LEGACY_DRIVER 0x00001000
  1381. //
  1382. // This corresponds to the user-mode CM_PROB_WILL_BE_REMOVED problem value and
  1383. // the DN_WILL_BE_REMOVED status flag.
  1384. //
  1385. #define DNF_HAS_PROBLEM 0x00002000
  1386. //
  1387. // DNF_HAS_PRIVATE_PROBLEM - indicates this device reported PNP_DEVICE_FAILED
  1388. // to a IRP_MN_QUERY_PNP_DEVICE_STATE without also reporting
  1389. // PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED.
  1390. //
  1391. #define DNF_HAS_PRIVATE_PROBLEM 0x00004000
  1392. //
  1393. // DNF_HARDWARE_VERIFICATION is set on device nodes that have hardware
  1394. // verification (probably via WHQL applet).
  1395. //
  1396. #define DNF_HARDWARE_VERIFICATION 0x00008000
  1397. //
  1398. // DNF_DEVICE_GONE is set when a pdo is no longer returned in a query bus
  1399. // relations. It will then be processed as a surprise remove if started.
  1400. // This flag is used to better detect when a device is resurrected, and when
  1401. // processing surprise remove, to determine if the devnode should be removed
  1402. // from the tree.
  1403. //
  1404. #define DNF_DEVICE_GONE 0x00010000
  1405. //
  1406. // DNF_LEGACY_RESOURCE_DEVICENODE is set for device nodes created for legacy
  1407. // resource allocation.
  1408. //
  1409. #define DNF_LEGACY_RESOURCE_DEVICENODE 0x00020000
  1410. //
  1411. // DNF_NEEDS_REBALANCE is set for device nodes that trigger rebalance.
  1412. //
  1413. #define DNF_NEEDS_REBALANCE 0x00040000
  1414. //
  1415. // DNF_LOCKED_FOR_EJECT is set on device nodes that are being ejected or are
  1416. // related to a device being ejected.
  1417. //
  1418. #define DNF_LOCKED_FOR_EJECT 0x00080000
  1419. //
  1420. // DNF_DRIVER_BLOCKED is set on device nodes that use one or more drivers that
  1421. // have been blocked from loading.
  1422. //
  1423. #define DNF_DRIVER_BLOCKED 0x00100000
  1424. //
  1425. // This corresponds to the user-mode the DN_WILL_BE_REMOVED status flag.
  1426. //
  1427. #define DNUF_WILL_BE_REMOVED 0x00000001
  1428. //
  1429. // This corresponds to the user-mode DN_NO_SHOW_IN_DM status flag.
  1430. //
  1431. #define DNUF_DONT_SHOW_IN_UI 0x00000002
  1432. //
  1433. // This flag is set when user-mode lets us know that a reboot is required
  1434. // for this device.
  1435. //
  1436. #define DNUF_NEED_RESTART 0x00000004
  1437. //
  1438. // This flag is set to let the user-mode know when a device can be disabled
  1439. // it is still possible for this to be TRUE, yet disable to fail, as it's
  1440. // a polled flag (see also PNP_DEVICE_NOT_DISABLEABLE)
  1441. //
  1442. #define DNUF_NOT_DISABLEABLE 0x00000008
  1443. //
  1444. // Flags used during shutdown when the IO Verifier is trying to remove all
  1445. // PNP devices.
  1446. //
  1447. // DNUF_SHUTDOWN_QUERIED is set when we issue the QueryRemove to a devnode.
  1448. //
  1449. // DNUF_SHUTDOWN_SUBTREE_DONE is set once we've issued the QueryRemove to all
  1450. // a Devnodes descendants.
  1451. //
  1452. #define DNUF_SHUTDOWN_QUERIED 0x00000010
  1453. #define DNUF_SHUTDOWN_SUBTREE_DONE 0x00000020
  1454. //
  1455. // IOP_RESOURCE_REQUEST
  1456. //
  1457. #define QUERY_RESOURCE_LIST 0
  1458. #define QUERY_RESOURCE_REQUIREMENTS 1
  1459. #define REGISTRY_ALLOC_CONFIG 1
  1460. #define REGISTRY_FORCED_CONFIG 2
  1461. #define REGISTRY_BOOT_CONFIG 4
  1462. #define REGISTRY_OVERRIDE_CONFIGVECTOR 1
  1463. #define REGISTRY_BASIC_CONFIGVECTOR 2
  1464. ///////////////////////////////////////////////////////////////////////////////
  1465. //
  1466. // pnpmgr.h
  1467. //
  1468. ///////////////////////////////////////////////////////////////////////////////
  1469. //
  1470. // Private device events
  1471. //
  1472. DEFINE_GUID( GUID_DEVICE_ARRIVAL, 0xcb3a4009L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1473. DEFINE_GUID( GUID_DEVICE_ENUMERATED, 0xcb3a400AL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1474. DEFINE_GUID( GUID_DEVICE_ENUMERATE_REQUEST, 0xcb3a400BL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1475. DEFINE_GUID( GUID_DEVICE_START_REQUEST, 0xcb3a400CL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1476. DEFINE_GUID( GUID_DEVICE_REMOVE_PENDING, 0xcb3a400DL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1477. DEFINE_GUID( GUID_DEVICE_QUERY_AND_REMOVE, 0xcb3a400EL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1478. DEFINE_GUID( GUID_DEVICE_EJECT, 0xcb3a400FL, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1479. DEFINE_GUID( GUID_DEVICE_NOOP, 0xcb3a4010L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f);
  1480. DEFINE_GUID( GUID_DEVICE_SURPRISE_REMOVAL, 0xce5af000L, 0x80dd, 0x11d2, 0xa8, 0x8d, 0x00, 0xa0, 0xc9, 0x69, 0x6b, 0x4b);
  1481. //
  1482. // Private driver events
  1483. //
  1484. DEFINE_GUID( GUID_DRIVER_BLOCKED, 0x1bc87a21L, 0xa3ff, 0x47a6, 0x96, 0xaa, 0x6d, 0x01, 0x09, 0x06, 0x80, 0x5a);
  1485. //
  1486. // Standard interface device classes
  1487. //
  1488. DEFINE_GUID( GUID_CLASS_VOLUME, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x72);
  1489. DEFINE_GUID( GUID_CLASS_LPTPORT, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x74);
  1490. DEFINE_GUID( GUID_CLASS_NET, 0x86e0d1e0L, 0x8089, 0x11d0, 0x9c, 0xe4, 0x08, 0x00, 0x3e, 0x30, 0x1f, 0x75);
  1491. ///////////////////////////////////////////////////////////////////////////////
  1492. //
  1493. // po.h
  1494. //
  1495. ///////////////////////////////////////////////////////////////////////////////
  1496. #define PO_ORDER_NOT_VIDEO 0x0001
  1497. #define PO_ORDER_ROOT_ENUM 0x0002
  1498. #define PO_ORDER_PAGABLE 0x0004
  1499. #define PO_ORDER_MAXIMUM 0x0007
  1500. // notify GDI before this order level
  1501. #define PO_ORDER_GDI_NOTIFICATION (PO_ORDER_PAGABLE)
  1502. ///////////////////////////////////////////////////////////////////////////////
  1503. //
  1504. // pop.h
  1505. //
  1506. ///////////////////////////////////////////////////////////////////////////////
  1507. //
  1508. // constants
  1509. //
  1510. #define PO_IDLE_SCAN_INTERVAL 1 // scan interval in seconds
  1511. //
  1512. // Values for ios.Parameters.SystemContext
  1513. #define POP_NO_CONTEXT 0
  1514. #define POP_FLAG_CONTEXT 1 // if true, it's flags
  1515. #define POP_DEVICE_REQUEST (0x2 | POP_FLAG_CONTEXT) // an irp sent by RequestPowerChange
  1516. #define POP_INRUSH_CONTEXT (0x4 | POP_FLAG_CONTEXT) // the active INRUSH irp
  1517. #define POP_COUNT_CONTEXT 0xff000000 // byte used for next counting
  1518. #define POP_COUNT_SHIFT 24
  1519. #define PO_ERROR 0x00000001
  1520. #define PO_WARN 0x00000002
  1521. #define PO_BATT 0x00000004
  1522. #define PO_PACT 0x00000008
  1523. #define PO_NOTIFY 0x00000010
  1524. #define PO_THERM 0x00000020
  1525. #define PO_THROTTLE 0x00000040
  1526. #define PO_HIBERNATE 0x00000080
  1527. #define PO_POCALL 0x00000200
  1528. #define PO_SYSDEV 0x00000400
  1529. #define PO_THERM_DETAIL 0x20000000
  1530. #define PO_SIDLE 0x40000000
  1531. #define PO_HIBER_MAP 0x80000000
  1532. #define POP_SIM_CAPABILITIES 0x00000001
  1533. #define POP_SIM_ALL_CAPABILITIES 0x00000002
  1534. #define POP_ALLOW_AC_THROTTLE 0x00000004
  1535. #define POP_IGNORE_S1 0x00000008
  1536. #define POP_IGNORE_UNSUPPORTED_DRIVERS 0x00000010
  1537. #define POP_IGNORE_S3 0x00000020
  1538. #define POP_IGNORE_S2 0x00000040
  1539. #define POP_LOOP_ON_FAILED_DRIVERS 0x00000080
  1540. #define POP_CRC_MEMORY 0x00000100
  1541. #define POP_IGNORE_CRC_FAILURES 0x00000200
  1542. #define POP_TEST_CRC_MEMORY 0x00000400
  1543. #define POP_DEBUG_HIBER_FILE 0x00000800
  1544. #define POP_RESET_ON_HIBER 0x00001000
  1545. #define POP_IGNORE_S4 0x00002000
  1546. #define POP_USE_S4BIOS 0x00004000
  1547. #define POP_IGNORE_HIBER_SYMBOL_UNLOAD 0x00008000
  1548. #define POP_ENABLE_HIBER_PERF 0x00010000
  1549. //
  1550. // Universal Power Data - stored in DeviceObject->DeviceObjectExtension->PowerFlags
  1551. //
  1552. #define POPF_SYSTEM_STATE 0xf // 4 bits for S0 to S5
  1553. #define POPF_DEVICE_STATE 0xf0 // 4 bits to hold D0 to D3
  1554. #define POPF_SYSTEM_ACTIVE 0x100 // True if S irp active at this DO
  1555. #define POPF_SYSTEM_PENDING 0x200 // True if S irp pending (0x100 must be 1)
  1556. #define POPF_DEVICE_ACTIVE 0x400 // same as SYSTEM_ACTIVE but for DEVICE
  1557. #define POPF_DEVICE_PENDING 0x800 // same as SYSTEM_PENDING but for DEVICE
  1558. #define PO_PM_USER 0x01 // nice to inform user mode, but not needed
  1559. #define PO_PM_REISSUE 0x02 // sleep promotoed to shutdown
  1560. #define PO_PM_SETSTATE 0x04 // recomputed something to do with the viable state
  1561. #define PO_ACT_IDLE 0
  1562. #define PO_ACT_NEW_REQUEST 1
  1563. #define PO_ACT_CALLOUT 2
  1564. #define PO_ACT_SET_SYSTEM_STATE 3
  1565. //
  1566. // Types for POP_ACTION_TRIGGER
  1567. //
  1568. typedef enum {
  1569. PolicyDeviceSystemButton,
  1570. PolicyDeviceThermalZone,
  1571. PolicyDeviceBattery,
  1572. PolicyInitiatePowerActionAPI,
  1573. PolicySetPowerStateAPI,
  1574. PolicyImmediateDozeS4,
  1575. PolicySystemIdle
  1576. } POP_POLICY_DEVICE_TYPE;
  1577. #define PO_TRG_USER 0x01 // User action initiated
  1578. #define PO_TRG_SYSTEM 0x02 // System action initiated
  1579. #define PO_TRG_SYNC 0x20 // Trigger is synchronous
  1580. #define PO_TRG_SET 0x80 // Event enabled or disabled
  1581. // POP_THERMAL_ZONE.State
  1582. #define PO_TZ_NO_STATE 0
  1583. #define PO_TZ_READ_STATE 1
  1584. #define PO_TZ_SET_MODE 2
  1585. #define PO_TZ_SET_ACTIVE 3
  1586. // POP_THERMAL_ZONE.Flags
  1587. #define PO_TZ_THROTTLING 0x01
  1588. #define PO_TZ_CLEANUP 0x80
  1589. #define PO_TZ_THROTTLE_SCALE 10 // temp reported in 1/10ths kelin
  1590. #define PO_TZ_NO_THROTTLE (100 * PO_TZ_THROTTLE_SCALE)
  1591. // PopCoolingMode
  1592. #define PO_TZ_ACTIVE 0
  1593. #define PO_TZ_PASSIVE 1
  1594. #define PO_TZ_INVALID_MODE 2
  1595. //
  1596. // Action timeouts
  1597. //
  1598. #define POP_ACTION_TIMEOUT 30
  1599. #define POP_ACTION_CANCEL_TIMEOUT 5
  1600. ///////////////////////////////////////////////////////////////////////////////
  1601. //
  1602. // pool.h
  1603. //
  1604. ///////////////////////////////////////////////////////////////////////////////
  1605. #define POOL_QUOTA_MASK 8
  1606. #define POOL_TYPE_MASK (3)
  1607. #define POOL_OVERHEAD ((LONG)GetTypeSize("POOL_HEADER"))
  1608. //
  1609. // Define pool tracking information.
  1610. //
  1611. #define POOL_BACKTRACEINDEX_PRESENT 0x8000
  1612. ///////////////////////////////////////////////////////////////////////////////
  1613. //
  1614. // range.h
  1615. //
  1616. ///////////////////////////////////////////////////////////////////////////////
  1617. //
  1618. // Range list structures
  1619. //
  1620. #define RTLP_RANGE_LIST_ENTRY_MERGED 0x0001
  1621. ///////////////////////////////////////////////////////////////////////////////
  1622. //
  1623. // srb.h
  1624. //
  1625. ///////////////////////////////////////////////////////////////////////////////
  1626. //
  1627. // Port driver error codes
  1628. //
  1629. #define SP_BUS_PARITY_ERROR 0x0001
  1630. #define SP_UNEXPECTED_DISCONNECT 0x0002
  1631. #define SP_INVALID_RESELECTION 0x0003
  1632. #define SP_BUS_TIME_OUT 0x0004
  1633. #define SP_PROTOCOL_ERROR 0x0005
  1634. #define SP_INTERNAL_ADAPTER_ERROR 0x0006
  1635. #define SP_REQUEST_TIMEOUT 0x0007
  1636. #define SP_IRQ_NOT_RESPONDING 0x0008
  1637. #define SP_BAD_FW_WARNING 0x0009
  1638. #define SP_BAD_FW_ERROR 0x000a
  1639. #define SP_LOST_WMI_MINIPORT_REQUEST 0x000b
  1640. //
  1641. // Return values for SCSI_HW_FIND_ADAPTER.
  1642. //
  1643. #define SP_RETURN_NOT_FOUND 0
  1644. #define SP_RETURN_FOUND 1
  1645. #define SP_RETURN_ERROR 2
  1646. #define SP_RETURN_BAD_CONFIG 3
  1647. //
  1648. // Notification Event Types
  1649. //
  1650. typedef enum _SCSI_NOTIFICATION_TYPE {
  1651. RequestComplete,
  1652. NextRequest,
  1653. NextLuRequest,
  1654. ResetDetected,
  1655. CallDisableInterrupts,
  1656. CallEnableInterrupts,
  1657. RequestTimerCall,
  1658. BusChangeDetected, /* New */
  1659. WMIEvent,
  1660. WMIReregister
  1661. } SCSI_NOTIFICATION_TYPE, *PSCSI_NOTIFICATION_TYPE;
  1662. //
  1663. // SRB Functions
  1664. //
  1665. #define SRB_FUNCTION_EXECUTE_SCSI 0x00
  1666. #define SRB_FUNCTION_CLAIM_DEVICE 0x01
  1667. #define SRB_FUNCTION_IO_CONTROL 0x02
  1668. #define SRB_FUNCTION_RECEIVE_EVENT 0x03
  1669. #define SRB_FUNCTION_RELEASE_QUEUE 0x04
  1670. #define SRB_FUNCTION_ATTACH_DEVICE 0x05
  1671. #define SRB_FUNCTION_RELEASE_DEVICE 0x06
  1672. #define SRB_FUNCTION_SHUTDOWN 0x07
  1673. #define SRB_FUNCTION_FLUSH 0x08
  1674. #define SRB_FUNCTION_ABORT_COMMAND 0x10
  1675. #define SRB_FUNCTION_RELEASE_RECOVERY 0x11
  1676. #define SRB_FUNCTION_RESET_BUS 0x12
  1677. #define SRB_FUNCTION_RESET_DEVICE 0x13
  1678. #define SRB_FUNCTION_TERMINATE_IO 0x14
  1679. #define SRB_FUNCTION_FLUSH_QUEUE 0x15
  1680. #define SRB_FUNCTION_REMOVE_DEVICE 0x16
  1681. #define SRB_FUNCTION_WMI 0x17
  1682. #define SRB_FUNCTION_LOCK_QUEUE 0x18
  1683. #define SRB_FUNCTION_UNLOCK_QUEUE 0x19
  1684. //
  1685. // SRB Status Masks
  1686. //
  1687. #define SRB_STATUS_QUEUE_FROZEN 0x40
  1688. #define SRB_STATUS_AUTOSENSE_VALID 0x80
  1689. #define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN))
  1690. //
  1691. // SRB Flag Bits
  1692. //
  1693. #define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002
  1694. #define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004
  1695. #define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008
  1696. #define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010
  1697. #define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020
  1698. #define SRB_FLAGS_DATA_IN 0x00000040
  1699. #define SRB_FLAGS_DATA_OUT 0x00000080
  1700. #define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000
  1701. #define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT)
  1702. #define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100
  1703. #define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200
  1704. #define SRB_FLAGS_IS_ACTIVE 0x00010000
  1705. #define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000
  1706. #define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000
  1707. #define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000
  1708. #define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000
  1709. #define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000
  1710. #define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000
  1711. //
  1712. // Queue Action
  1713. //
  1714. #define SRB_SIMPLE_TAG_REQUEST 0x20
  1715. #define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21
  1716. #define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22
  1717. #define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01
  1718. ///////////////////////////////////////////////////////////////////////////////
  1719. //
  1720. // trackirp.h
  1721. //
  1722. ///////////////////////////////////////////////////////////////////////////////
  1723. #define DOE_DESIGNATED_FDO 0x80000000
  1724. #define DOE_BOTTOM_OF_FDO_STACK 0x40000000
  1725. #define DOE_RAW_FDO 0x20000000
  1726. #define DOE_EXAMINED 0x10000000
  1727. #define DOE_TRACKED 0x08000000
  1728. #define ASSERTFLAG_TRACKIRPS 0x00000001
  1729. #define ASSERTFLAG_MONITOR_ALLOCS 0x00000002
  1730. #define ASSERTFLAG_POLICEIRPS 0x00000004
  1731. #define ASSERTFLAG_MONITORMAJORS 0x00000008
  1732. #define ASSERTFLAG_SURROGATE 0x00000010
  1733. #define ASSERTFLAG_SMASH_SRBS 0x00000020
  1734. #define ASSERTFLAG_CONSUME_ALWAYS 0x00000040
  1735. #define ASSERTFLAG_FORCEPENDING 0x00000080
  1736. #define ASSERTFLAG_COMPLETEATDPC 0x00000100
  1737. #define ASSERTFLAG_COMPLETEATPASSIVE 0x00000200
  1738. #define ASSERTFLAG_DEFERCOMPLETION 0x00000800
  1739. #define ASSERTFLAG_ROTATE_STATUS 0x00001000
  1740. // ----------
  1741. #define ASSERTMASK_COMPLETESTYLE 0x00000F80
  1742. #define ASSERTFLAG_SEEDSTACK 0x00010000
  1743. //
  1744. // Disabling HACKHACKS_ENABLED will remove support for all hack code. The
  1745. // hack code allows the machine to fully boot in checked builds. Note that
  1746. // those hacks can be individually disabled by setting the IovpHackFlags
  1747. // variable at boot time.
  1748. //
  1749. #define HACKHACKS_ENABLED
  1750. #define HACKFLAG_FOR_MUP 0x00000001
  1751. #define HACKFLAG_FOR_SCSIPORT 0x00000002
  1752. #define HACKFLAG_FOR_ACPI 0x00000004
  1753. #define HACKFLAG_FOR_BOGUSIRPS 0x00000008
  1754. ///////////////////////////////////////////////////////////////////////////////
  1755. //
  1756. // uhcd.h
  1757. //
  1758. ///////////////////////////////////////////////////////////////////////////////
  1759. //
  1760. // Interrupt Mask register bits
  1761. //
  1762. #define UHCD_INT_MASK_SHORT_BIT 3
  1763. #define UHCD_INT_MASK_SHORT (1<<UHCD_INT_MASK_SHORT_BIT)
  1764. #define UHCD_INT_MASK_IOC_BIT 2
  1765. #define UHCD_INT_MASK_IOC (1<<UHCD_INT_MASK_IOC_BIT)
  1766. #define UHCD_INT_MASK_RESUME_BIT 1
  1767. #define UHCD_INT_MASK_RESUME (1<<UHCD_INT_MASK_RESUME_BIT)
  1768. #define UHCD_INT_MASK_TIMEOUT_BIT 0
  1769. #define UHCD_INT_MASK_TIMEOUT (1<<UHCD_INT_MASK_TIMEOUT_BIT)
  1770. //
  1771. // Port Register Bits
  1772. //
  1773. #define UHCD_PORT_ENABLE_BIT 2
  1774. #define UHCD_PORT_ENABLE (1<<UHCD_PORT_ENABLE_BIT)
  1775. //
  1776. // Command Register Bits
  1777. //
  1778. #define UHCD_CMD_RUN_BIT 0
  1779. #define UHCD_CMD_RUN (USHORT)(1<<UHCD_CMD_RUN_BIT)
  1780. #define UHCD_CMD_RESET_BIT 1
  1781. #define UHCD_CMD_RESET (USHORT)(1<<UHCD_CMD_RESET_BIT)
  1782. #define UHCD_CMD_GLOBAL_RESET_BIT 2
  1783. #define UHCD_CMD_GLOBAL_RESET (USHORT)(1<<UHCD_CMD_GLOBAL_RESET_BIT)
  1784. #define UHCD_CMD_SUSPEND_BIT 3
  1785. #define UHCD_CMD_SUSPEND (USHORT)(1<<UHCD_CMD_SUSPEND_BIT)
  1786. #define UHCD_CMD_FORCE_RESUME_BIT 4
  1787. #define UHCD_CMD_FORCE_RESUME (USHORT)(1<<UHCD_CMD_FORCE_RESUME_BIT)
  1788. #define UHCD_CMD_SW_DEBUG_BIT 5
  1789. #define UHCD_CMD_SW_DEBUG (USHORT)(1<<UHCD_CMD_SW_DEBUG_BIT)
  1790. #define UHCD_CMD_SW_CONFIGURED_BIT 6
  1791. #define UHCD_CMD_SW_CONFIGURED (USHORT)(1<<UHCD_CMD_SW_CONFIGURED_BIT)
  1792. #define UHCD_CMD_MAXPKT_64_BIT 7
  1793. #define UHCD_CMD_MAXPKT_64 (USHORT)(1<<UHCD_CMD_MAXPKT_64_BIT)
  1794. //
  1795. // Status Register Bits
  1796. //
  1797. #define UHCD_STATUS_USBINT_BIT 0
  1798. #define UHCD_STATUS_USBINT (1<<UHCD_STATUS_USBINT_BIT)
  1799. #define UHCD_STATUS_USBERR_BIT 1
  1800. #define UHCD_STATUS_USBERR (1<<UHCD_STATUS_USBERR_BIT)
  1801. #define UHCD_STATUS_RESUME_BIT 2
  1802. #define UHCD_STATUS_RESUME (1<<UHCD_STATUS_RESUME_BIT)
  1803. #define UHCD_STATUS_PCIERR_BIT 3
  1804. #define UHCD_STATUS_PCIERR (1<<UHCD_STATUS_PCIERR_BIT)
  1805. #define UHCD_STATUS_HCERR_BIT 4
  1806. #define UHCD_STATUS_HCERR (1<<UHCD_STATUS_HCERR_BIT)
  1807. #define UHCD_STATUS_HCHALT_BIT 5
  1808. #define UHCD_STATUS_HCHALT (1<<UHCD_STATUS_HCHALT_BIT)
  1809. // number of bit times in a USB frame based on a 12MHZ SOF clock
  1810. #define UHCD_12MHZ_SOF 11936
  1811. //
  1812. // values for HcFlags
  1813. //
  1814. // Set to indicate port resources were assigned
  1815. #define HCFLAG_GOT_IO 0x00000001
  1816. // Set at initialization to indicate that the base register
  1817. // address must be unmapped when the driver is unloaded.
  1818. #define HCFLAG_UNMAP_REGISTERS 0x00000002
  1819. // Set if we have a USB BIOS on this system
  1820. #define HCFLAG_USBBIOS 0x00000004
  1821. // Current state of BW reclimation
  1822. #define HCFLAG_BWRECLIMATION_ENABLED 0x00000008
  1823. // This flag indicates if the driver needs to cleanup resources
  1824. // allocated in start_device.
  1825. #define HCFLAG_NEED_CLEANUP 0x00000010
  1826. // HC is idle
  1827. #define HCFLAG_IDLE 0x00000020
  1828. // set when the rollover int is disabled
  1829. #define HCFLAG_ROLLOVER_IDLE 0x00000040
  1830. // set when the controller is stopped
  1831. #define HCFLAG_HCD_STOPPED 0x00000080
  1832. // turn off idle check
  1833. #define HCFLAG_DISABLE_IDLE 0x00000100
  1834. // work item queued
  1835. #define HCFLAG_WORK_ITEM_QUEUED 0x00000200
  1836. // hcd has shut down
  1837. #define HCFLAG_HCD_SHUTDOWN 0x00000400
  1838. // indicates we need to restore HC from hibernate
  1839. #define HCFLAG_LOST_POWER 0x00000800
  1840. // set when root hub turns off the HC
  1841. #define HCFLAG_RH_OFF 0x00001000
  1842. #define HCFLAG_MAP_SX_TO_D3 0x00002000
  1843. // set if we will be suspending in this D3
  1844. #define HCFLAG_SUSPEND_NEXT_D3 0x00004000
  1845. ///////////////////////////////////////////////////////////////////////////////
  1846. //
  1847. // usbdi.h
  1848. //
  1849. ///////////////////////////////////////////////////////////////////////////////
  1850. //
  1851. // URB request codes
  1852. //
  1853. #define URB_FUNCTION_SELECT_CONFIGURATION 0x0000
  1854. #define URB_FUNCTION_SELECT_INTERFACE 0x0001
  1855. #define URB_FUNCTION_ABORT_PIPE 0x0002
  1856. #define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003
  1857. #define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004
  1858. #define URB_FUNCTION_GET_FRAME_LENGTH 0x0005
  1859. #define URB_FUNCTION_SET_FRAME_LENGTH 0x0006
  1860. #define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007
  1861. #define URB_FUNCTION_CONTROL_TRANSFER 0x0008
  1862. #define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009
  1863. #define URB_FUNCTION_ISOCH_TRANSFER 0x000A
  1864. #define URB_FUNCTION_RESET_PIPE 0x001E
  1865. //
  1866. // These functions correspond
  1867. // to the standard commands on the default pipe
  1868. //
  1869. // direction is implied
  1870. //
  1871. #define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B
  1872. #define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024
  1873. #define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028
  1874. #define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C
  1875. #define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025
  1876. #define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029
  1877. #define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D
  1878. #define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E
  1879. #define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F
  1880. #define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023
  1881. #define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010
  1882. #define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011
  1883. #define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012
  1884. #define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022
  1885. #define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013
  1886. #define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014
  1887. #define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015
  1888. #define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021
  1889. // direction is specified in TransferFlags
  1890. #define URB_FUNCTION_RESERVED0 0x0016
  1891. //
  1892. // These are for sending vendor and class commands
  1893. // on the default pipe
  1894. //
  1895. // direction is specified in TransferFlags
  1896. //
  1897. #define URB_FUNCTION_VENDOR_DEVICE 0x0017
  1898. #define URB_FUNCTION_VENDOR_INTERFACE 0x0018
  1899. #define URB_FUNCTION_VENDOR_ENDPOINT 0x0019
  1900. #define URB_FUNCTION_VENDOR_OTHER 0x0020
  1901. #define URB_FUNCTION_CLASS_DEVICE 0x001A
  1902. #define URB_FUNCTION_CLASS_INTERFACE 0x001B
  1903. #define URB_FUNCTION_CLASS_ENDPOINT 0x001C
  1904. #define URB_FUNCTION_CLASS_OTHER 0x001F
  1905. //
  1906. // Reserved function codes
  1907. //
  1908. #define URB_FUNCTION_RESERVED 0x001D
  1909. #define URB_FUNCTION_GET_CONFIGURATION 0x0026
  1910. #define URB_FUNCTION_GET_INTERFACE 0x0027
  1911. #define URB_FUNCTION_LAST 0x0029
  1912. ///////////////////////////////////////////////////////////////////////////////
  1913. //
  1914. // usbhub.h
  1915. //
  1916. ///////////////////////////////////////////////////////////////////////////////
  1917. //
  1918. // Hub and Port status defined below also apply to StatusChnage bits
  1919. //
  1920. #define HUB_STATUS_LOCAL_POWER 0x01
  1921. #define HUB_STATUS_OVER_CURRENT 0x02
  1922. #define PORT_STATUS_CONNECT 0x001
  1923. #define PORT_STATUS_ENABLE 0x002
  1924. #define PORT_STATUS_SUSPEND 0x004
  1925. #define PORT_STATUS_OVER_CURRENT 0x008
  1926. #define PORT_STATUS_RESET 0x010
  1927. #define PORT_STATUS_POWER 0x100
  1928. #define PORT_STATUS_LOW_SPEED 0x200
  1929. #define HUBFLAG_NEED_CLEANUP 0x00000001
  1930. #define HUBFLAG_ENABLED_FOR_WAKEUP 0x00000002
  1931. #define HUBFLAG_DEVICE_STOPPING 0x00000004
  1932. #define HUBFLAG_HUB_FAILURE 0x00000008
  1933. #define HUBFLAG_SUPPORT_WAKEUP 0x00000010
  1934. #define HUBFLAG_HUB_STOPPED 0x00000020
  1935. #define HUBFLAG_HUB_BUSY 0x00000040
  1936. #define HUBFLAG_PENDING_WAKE_IRP 0x00000080
  1937. #define HUBFLAG_PENDING_PORT_RESET 0x00000100
  1938. #define HUBFLAG_HUB_HAS_LOST_BRAINS 0x00000200
  1939. #define USBH_MAX_ENUMERATION_ATTEMPTS 3
  1940. //
  1941. // Common fields for Pdo and Fdo extensions
  1942. //
  1943. #define EXTENSION_TYPE_PORT 0x54524f50 // "PORT"
  1944. #define EXTENSION_TYPE_HUB 0x20425548 // "HUB "
  1945. #define EXTENSION_TYPE_PARENT 0x50525400 // "PRT "
  1946. #define EXTENSION_TYPE_FUNCTION 0xfefefeff // ""
  1947. //
  1948. // values for PortPdoFlags
  1949. //
  1950. #define PORTPDO_DEVICE_IS_HUB 0x00000001
  1951. #define PORTPDO_DEVICE_IS_PARENT 0x00000002
  1952. #define PORTPDO_DEVICE_ENUM_ERROR 0x00000004
  1953. #define PORTPDO_LOW_SPEED_DEVICE 0x00000008
  1954. #define PORTPDO_REMOTE_WAKEUP_SUPPORTED 0x00000010
  1955. #define PORTPDO_REMOTE_WAKEUP_ENABLED 0x00000020
  1956. #define PORTPDO_DELETED_PDO 0x00000040
  1957. #define PORTPDO_DELETE_PENDING 0x00000080
  1958. #define PORTPDO_NEED_RESET 0x00000100
  1959. #define PORTPDO_STARTED 0x00000200
  1960. #define PORTPDO_WANT_POWER_FEATURE 0x00000400
  1961. #define PORTPDO_SYM_LINK 0x00000800
  1962. #define PORTPDO_DEVICE_FAILED 0x00001000
  1963. #define PORTPDO_USB_SUSPEND 0x00002000
  1964. #define PORTPDO_OVERCURRENT 0x00004000
  1965. #define PORTPDO_DD_REMOVED 0x00008000
  1966. #define PORTPDO_NOT_ENOUGH_POWER 0x00010000
  1967. #define PORTPDO_PDO_RETURNED 0x00020000
  1968. #define PORTPDO_NO_BANDWIDTH 0x00040000
  1969. #define PORTPDO_RESET_PENDING 0x00080000
  1970. ///////////////////////////////////////////////////////////////////////////////
  1971. //
  1972. // wdm.h
  1973. //
  1974. ///////////////////////////////////////////////////////////////////////////////
  1975. //
  1976. // POWER minor function codes
  1977. //
  1978. #define IRP_MN_WAIT_WAKE 0x00
  1979. #define IRP_MN_POWER_SEQUENCE 0x01
  1980. #define IRP_MN_SET_POWER 0x02
  1981. #define IRP_MN_QUERY_POWER 0x03
  1982. //
  1983. // Device Control Request minor function codes for SCSI support. Note that
  1984. // user requests are assumed to be zero.
  1985. //
  1986. #define IRP_MN_SCSI_CLASS 0x01
  1987. //
  1988. // PNP minor function codes.
  1989. //
  1990. #define IRP_MN_START_DEVICE 0x00
  1991. #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
  1992. #define IRP_MN_REMOVE_DEVICE 0x02
  1993. #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
  1994. #define IRP_MN_STOP_DEVICE 0x04
  1995. #define IRP_MN_QUERY_STOP_DEVICE 0x05
  1996. #define IRP_MN_CANCEL_STOP_DEVICE 0x06
  1997. #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
  1998. #define IRP_MN_QUERY_INTERFACE 0x08
  1999. #define IRP_MN_QUERY_CAPABILITIES 0x09
  2000. #define IRP_MN_QUERY_RESOURCES 0x0A
  2001. #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
  2002. #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
  2003. #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
  2004. #define IRP_MN_READ_CONFIG 0x0F
  2005. #define IRP_MN_WRITE_CONFIG 0x10
  2006. #define IRP_MN_EJECT 0x11
  2007. #define IRP_MN_SET_LOCK 0x12
  2008. #define IRP_MN_QUERY_ID 0x13
  2009. #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
  2010. #define IRP_MN_QUERY_BUS_INFORMATION 0x15
  2011. #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
  2012. #define IRP_MN_SURPRISE_REMOVAL 0x17
  2013. #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
  2014. // begin_ntminiport
  2015. //
  2016. // WMI minor function codes under IRP_MJ_SYSTEM_CONTROL
  2017. //
  2018. #define IRP_MN_QUERY_ALL_DATA 0x00
  2019. #define IRP_MN_QUERY_SINGLE_INSTANCE 0x01
  2020. #define IRP_MN_CHANGE_SINGLE_INSTANCE 0x02
  2021. #define IRP_MN_CHANGE_SINGLE_ITEM 0x03
  2022. #define IRP_MN_ENABLE_EVENTS 0x04
  2023. #define IRP_MN_DISABLE_EVENTS 0x05
  2024. #define IRP_MN_ENABLE_COLLECTION 0x06
  2025. #define IRP_MN_DISABLE_COLLECTION 0x07
  2026. #define IRP_MN_REGINFO 0x08
  2027. #define IRP_MN_EXECUTE_METHOD 0x09
  2028. //
  2029. // Define PNP/POWER types required by IRP_MJ_PNP/IRP_MJ_POWER.
  2030. //
  2031. typedef enum _DEVICE_RELATION_TYPE {
  2032. BusRelations,
  2033. EjectionRelations,
  2034. PowerRelations,
  2035. RemovalRelations,
  2036. TargetDeviceRelation
  2037. } DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE;
  2038. typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
  2039. DeviceUsageTypeUndefined,
  2040. DeviceUsageTypePaging,
  2041. DeviceUsageTypeHibernation,
  2042. DeviceUsageTypeDumpFile
  2043. } DEVICE_USAGE_NOTIFICATION_TYPE;
  2044. typedef enum {
  2045. BusQueryDeviceID = 0, // <Enumerator>\<Enumerator-specific device id>
  2046. BusQueryHardwareIDs = 1, // Hardware ids
  2047. BusQueryCompatibleIDs = 2, // compatible device ids
  2048. BusQueryInstanceID = 3, // persistent id for this instance of the device
  2049. BusQueryDeviceSerialNumber = 4 // serial number for this device
  2050. } BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE;
  2051. typedef enum {
  2052. DeviceTextDescription = 0, // DeviceDesc property
  2053. DeviceTextLocationInformation = 1 // DeviceLocation property
  2054. } DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE;
  2055. #define FILE_DEVICE_BEEP 0x00000001
  2056. #define FILE_DEVICE_CD_ROM 0x00000002
  2057. #define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003
  2058. #define FILE_DEVICE_CONTROLLER 0x00000004
  2059. #define FILE_DEVICE_DATALINK 0x00000005
  2060. #define FILE_DEVICE_DFS 0x00000006
  2061. #define FILE_DEVICE_DISK 0x00000007
  2062. #define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008
  2063. #define FILE_DEVICE_FILE_SYSTEM 0x00000009
  2064. #define FILE_DEVICE_INPORT_PORT 0x0000000a
  2065. #define FILE_DEVICE_KEYBOARD 0x0000000b
  2066. #define FILE_DEVICE_MAILSLOT 0x0000000c
  2067. #define FILE_DEVICE_MIDI_IN 0x0000000d
  2068. #define FILE_DEVICE_MIDI_OUT 0x0000000e
  2069. #define FILE_DEVICE_MOUSE 0x0000000f
  2070. #define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010
  2071. #define FILE_DEVICE_NAMED_PIPE 0x00000011
  2072. #define FILE_DEVICE_NETWORK 0x00000012
  2073. #define FILE_DEVICE_NETWORK_BROWSER 0x00000013
  2074. #define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014
  2075. #define FILE_DEVICE_NULL 0x00000015
  2076. #define FILE_DEVICE_PARALLEL_PORT 0x00000016
  2077. #define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017
  2078. #define FILE_DEVICE_PRINTER 0x00000018
  2079. #define FILE_DEVICE_SCANNER 0x00000019
  2080. #define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a
  2081. #define FILE_DEVICE_SERIAL_PORT 0x0000001b
  2082. #define FILE_DEVICE_SCREEN 0x0000001c
  2083. #define FILE_DEVICE_SOUND 0x0000001d
  2084. #define FILE_DEVICE_STREAMS 0x0000001e
  2085. #define FILE_DEVICE_TAPE 0x0000001f
  2086. #define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020
  2087. #define FILE_DEVICE_TRANSPORT 0x00000021
  2088. #define FILE_DEVICE_UNKNOWN 0x00000022
  2089. #define FILE_DEVICE_VIDEO 0x00000023
  2090. #define FILE_DEVICE_VIRTUAL_DISK 0x00000024
  2091. #define FILE_DEVICE_WAVE_IN 0x00000025
  2092. #define FILE_DEVICE_WAVE_OUT 0x00000026
  2093. #define FILE_DEVICE_8042_PORT 0x00000027
  2094. #define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028
  2095. #define FILE_DEVICE_BATTERY 0x00000029
  2096. #define FILE_DEVICE_BUS_EXTENDER 0x0000002a
  2097. #define FILE_DEVICE_MODEM 0x0000002b
  2098. #define FILE_DEVICE_VDM 0x0000002c
  2099. #define FILE_DEVICE_MASS_STORAGE 0x0000002d
  2100. #define FILE_DEVICE_SMB 0x0000002e
  2101. #define FILE_DEVICE_KS 0x0000002f
  2102. #define FILE_DEVICE_CHANGER 0x00000030
  2103. #define FILE_DEVICE_SMARTCARD 0x00000031
  2104. #define FILE_DEVICE_ACPI 0x00000032
  2105. #define FILE_DEVICE_DVD 0x00000033
  2106. #define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034
  2107. #define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035
  2108. #define FILE_DEVICE_DFS_VOLUME 0x00000036
  2109. #define FILE_DEVICE_SERENUM 0x00000037
  2110. #define FILE_DEVICE_TERMSRV 0x00000038
  2111. #define FILE_DEVICE_KSEC 0x00000039
  2112. //
  2113. // Macro definition for defining IOCTL and FSCTL function control codes. Note
  2114. // that function codes 0-2047 are reserved for Microsoft Corporation, and
  2115. // 2048-4095 are reserved for customers.
  2116. //
  2117. #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
  2118. ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
  2119. )
  2120. ///////////////////////////////////////////////////////////////////////////////
  2121. //
  2122. // wdmaud.h
  2123. //
  2124. ///////////////////////////////////////////////////////////////////////////////
  2125. #define WDMAUD_CTL_CODE CTL_CODE
  2126. #define IOCTL_SOUND_BASE FILE_DEVICE_SOUND
  2127. #define IOCTL_WDMAUD_BASE 0x0000
  2128. #define IOCTL_WAVE_BASE 0x0040
  2129. #define IOCTL_MIDI_BASE 0x0080
  2130. #define IOCTL_MIXER_BASE 0x00C0
  2131. #define IOCTL_WDMAUD_INIT WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2132. #define IOCTL_WDMAUD_ADD_DEVNODE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2133. #define IOCTL_WDMAUD_REMOVE_DEVNODE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2134. #define IOCTL_WDMAUD_GET_CAPABILITIES WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2135. #define IOCTL_WDMAUD_GET_NUM_DEVS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2136. #define IOCTL_WDMAUD_OPEN_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2137. #define IOCTL_WDMAUD_CLOSE_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2138. #define IOCTL_WDMAUD_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2139. #define IOCTL_WDMAUD_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2140. #define IOCTL_WDMAUD_EXIT WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2141. #define IOCTL_WDMAUD_SET_PREFERRED_DEVICE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WDMAUD_BASE + 0x000a, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2142. #define IOCTL_WDMAUD_WAVE_OUT_PAUSE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2143. #define IOCTL_WDMAUD_WAVE_OUT_PLAY WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2144. #define IOCTL_WDMAUD_WAVE_OUT_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2145. #define IOCTL_WDMAUD_WAVE_OUT_BREAKLOOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2146. #define IOCTL_WDMAUD_WAVE_OUT_GET_POS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2147. #define IOCTL_WDMAUD_WAVE_OUT_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2148. #define IOCTL_WDMAUD_WAVE_OUT_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2149. #define IOCTL_WDMAUD_WAVE_OUT_WRITE_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2150. #define IOCTL_WDMAUD_WAVE_IN_STOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2151. #define IOCTL_WDMAUD_WAVE_IN_RECORD WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0011, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2152. #define IOCTL_WDMAUD_WAVE_IN_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0012, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2153. #define IOCTL_WDMAUD_WAVE_IN_GET_POS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0013, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2154. #define IOCTL_WDMAUD_WAVE_IN_READ_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_WAVE_BASE + 0x0014, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2155. #define IOCTL_WDMAUD_MIDI_OUT_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2156. #define IOCTL_WDMAUD_MIDI_OUT_SET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2157. #define IOCTL_WDMAUD_MIDI_OUT_GET_VOLUME WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2158. #define IOCTL_WDMAUD_MIDI_OUT_WRITE_DATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2159. #define IOCTL_WDMAUD_MIDI_OUT_WRITE_LONGDATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2160. #define IOCTL_WDMAUD_MIDI_IN_STOP WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2161. #define IOCTL_WDMAUD_MIDI_IN_RECORD WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0011, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2162. #define IOCTL_WDMAUD_MIDI_IN_RESET WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0012, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2163. #define IOCTL_WDMAUD_MIDI_IN_READ_PIN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0013, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2164. #define IOCTL_WDMAUD_MIXER_OPEN WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0000, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2165. #define IOCTL_WDMAUD_MIXER_CLOSE WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0001, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2166. #define IOCTL_WDMAUD_MIXER_GETLINEINFO WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2167. #define IOCTL_WDMAUD_MIXER_GETLINECONTROLS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2168. #define IOCTL_WDMAUD_MIXER_GETCONTROLDETAILS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2169. #define IOCTL_WDMAUD_MIXER_SETCONTROLDETAILS WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2170. #define IOCTL_WDMAUD_MIXER_GETHARDWAREEVENTDATA WDMAUD_CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIXER_BASE + 0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
  2171. ///////////////////////////////////////////////////////////////////////////////
  2172. //
  2173. // wdguid.h
  2174. //
  2175. ///////////////////////////////////////////////////////////////////////////////
  2176. //
  2177. // Device events that can be broadcasted to drivers and user-mode apps.
  2178. //
  2179. DEFINE_GUID( GUID_HWPROFILE_QUERY_CHANGE, 0xcb3a4001L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2180. DEFINE_GUID( GUID_HWPROFILE_CHANGE_CANCELLED, 0xcb3a4002L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2181. DEFINE_GUID( GUID_HWPROFILE_CHANGE_COMPLETE, 0xcb3a4003L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2182. DEFINE_GUID( GUID_DEVICE_INTERFACE_ARRIVAL, 0xcb3a4004L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2183. DEFINE_GUID( GUID_DEVICE_INTERFACE_REMOVAL, 0xcb3a4005L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2184. DEFINE_GUID( GUID_TARGET_DEVICE_QUERY_REMOVE, 0xcb3a4006L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2185. DEFINE_GUID( GUID_TARGET_DEVICE_REMOVE_CANCELLED, 0xcb3a4007L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2186. DEFINE_GUID( GUID_TARGET_DEVICE_REMOVE_COMPLETE, 0xcb3a4008L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f );
  2187. DEFINE_GUID( GUID_PNP_CUSTOM_NOTIFICATION, 0xACA73F8EL, 0x8D23, 0x11D1, 0xAC, 0x7D, 0x00, 0x00, 0xF8, 0x75, 0x71, 0xD0 );
  2188. DEFINE_GUID( GUID_PNP_POWER_NOTIFICATION, 0xC2CF0660L, 0xEB7A, 0x11D1, 0xBD, 0x7F, 0x00, 0x00, 0xF8, 0x75, 0x71, 0xD0 );
  2189. #endif // _EXTFLAGS_