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.

984 lines
27 KiB

  1. /*++ BUILD Version: 0002 // Increment this if a change has global effects
  2. Copyright (c) 1992-1999 Microsoft Corporation
  3. Module Name:
  4. ntconfig.h
  5. Abstract:
  6. This module contains the definitions associated with the conventions
  7. used to access the configuration registry.
  8. Author:
  9. Andre Vachon (andreva) 17-Apr-1992
  10. Revision History:
  11. 28-Apr-1992 JohnRo
  12. Made changes to be consistent with win32 service controller APIs.
  13. --*/
  14. #ifndef _NTCONFIG_
  15. #define _NTCONFIG_
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. // begin_ntddk begin_wdm begin_nthal
  23. // begin_winnt
  24. //
  25. // Predefined Value Types.
  26. //
  27. #define REG_NONE ( 0 ) // No value type
  28. #define REG_SZ ( 1 ) // Unicode nul terminated string
  29. #define REG_EXPAND_SZ ( 2 ) // Unicode nul terminated string
  30. // (with environment variable references)
  31. #define REG_BINARY ( 3 ) // Free form binary
  32. #define REG_DWORD ( 4 ) // 32-bit number
  33. #define REG_DWORD_LITTLE_ENDIAN ( 4 ) // 32-bit number (same as REG_DWORD)
  34. #define REG_DWORD_BIG_ENDIAN ( 5 ) // 32-bit number
  35. #define REG_LINK ( 6 ) // Symbolic Link (unicode)
  36. #define REG_MULTI_SZ ( 7 ) // Multiple Unicode strings
  37. #define REG_RESOURCE_LIST ( 8 ) // Resource list in the resource map
  38. #define REG_FULL_RESOURCE_DESCRIPTOR ( 9 ) // Resource list in the hardware description
  39. #define REG_RESOURCE_REQUIREMENTS_LIST ( 10 )
  40. #define REG_QWORD ( 11 ) // 64-bit number
  41. #define REG_QWORD_LITTLE_ENDIAN ( 11 ) // 64-bit number (same as REG_QWORD)
  42. // end_ntddk end_wdm end_nthal
  43. // begin_ntddk begin_wdm begin_nthal
  44. //
  45. // Service Types (Bit Mask)
  46. //
  47. #define SERVICE_KERNEL_DRIVER 0x00000001
  48. #define SERVICE_FILE_SYSTEM_DRIVER 0x00000002
  49. #define SERVICE_ADAPTER 0x00000004
  50. #define SERVICE_RECOGNIZER_DRIVER 0x00000008
  51. #define SERVICE_DRIVER (SERVICE_KERNEL_DRIVER | \
  52. SERVICE_FILE_SYSTEM_DRIVER | \
  53. SERVICE_RECOGNIZER_DRIVER)
  54. #define SERVICE_WIN32_OWN_PROCESS 0x00000010
  55. #define SERVICE_WIN32_SHARE_PROCESS 0x00000020
  56. #define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | \
  57. SERVICE_WIN32_SHARE_PROCESS)
  58. #define SERVICE_INTERACTIVE_PROCESS 0x00000100
  59. #define SERVICE_TYPE_ALL (SERVICE_WIN32 | \
  60. SERVICE_ADAPTER | \
  61. SERVICE_DRIVER | \
  62. SERVICE_INTERACTIVE_PROCESS)
  63. //
  64. // Start Type
  65. //
  66. #define SERVICE_BOOT_START 0x00000000
  67. #define SERVICE_SYSTEM_START 0x00000001
  68. #define SERVICE_AUTO_START 0x00000002
  69. #define SERVICE_DEMAND_START 0x00000003
  70. #define SERVICE_DISABLED 0x00000004
  71. //
  72. // Error control type
  73. //
  74. #define SERVICE_ERROR_IGNORE 0x00000000
  75. #define SERVICE_ERROR_NORMAL 0x00000001
  76. #define SERVICE_ERROR_SEVERE 0x00000002
  77. #define SERVICE_ERROR_CRITICAL 0x00000003
  78. //
  79. //
  80. // Define the registry driver node enumerations
  81. //
  82. typedef enum _CM_SERVICE_NODE_TYPE {
  83. DriverType = SERVICE_KERNEL_DRIVER,
  84. FileSystemType = SERVICE_FILE_SYSTEM_DRIVER,
  85. Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS,
  86. Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS,
  87. AdapterType = SERVICE_ADAPTER,
  88. RecognizerType = SERVICE_RECOGNIZER_DRIVER
  89. } SERVICE_NODE_TYPE;
  90. typedef enum _CM_SERVICE_LOAD_TYPE {
  91. BootLoad = SERVICE_BOOT_START,
  92. SystemLoad = SERVICE_SYSTEM_START,
  93. AutoLoad = SERVICE_AUTO_START,
  94. DemandLoad = SERVICE_DEMAND_START,
  95. DisableLoad = SERVICE_DISABLED
  96. } SERVICE_LOAD_TYPE;
  97. typedef enum _CM_ERROR_CONTROL_TYPE {
  98. IgnoreError = SERVICE_ERROR_IGNORE,
  99. NormalError = SERVICE_ERROR_NORMAL,
  100. SevereError = SERVICE_ERROR_SEVERE,
  101. CriticalError = SERVICE_ERROR_CRITICAL
  102. } SERVICE_ERROR_TYPE;
  103. // end_winnt
  104. // end_ntddk end_wdm end_nthal
  105. // begin_ntddk begin_wdm begin_nthal
  106. //
  107. // Resource List definitions
  108. //
  109. // begin_ntminiport begin_ntndis
  110. //
  111. // Defines the Type in the RESOURCE_DESCRIPTOR
  112. //
  113. // NOTE: For all CM_RESOURCE_TYPE values, there must be a
  114. // corresponding ResType value in the 32-bit ConfigMgr headerfile
  115. // (cfgmgr32.h). Values in the range [0x6,0x80) use the same values
  116. // as their ConfigMgr counterparts. CM_RESOURCE_TYPE values with
  117. // the high bit set (i.e., in the range [0x80,0xFF]), are
  118. // non-arbitrated resources. These correspond to the same values
  119. // in cfgmgr32.h that have their high bit set (however, since
  120. // cfgmgr32.h uses 16 bits for ResType values, these values are in
  121. // the range [0x8000,0x807F). Note that ConfigMgr ResType values
  122. // cannot be in the range [0x8080,0xFFFF), because they would not
  123. // be able to map into CM_RESOURCE_TYPE values. (0xFFFF itself is
  124. // a special value, because it maps to CmResourceTypeDeviceSpecific.)
  125. //
  126. typedef int CM_RESOURCE_TYPE;
  127. // CmResourceTypeNull is reserved
  128. #define CmResourceTypeNull 0 // ResType_All or ResType_None (0x0000)
  129. #define CmResourceTypePort 1 // ResType_IO (0x0002)
  130. #define CmResourceTypeInterrupt 2 // ResType_IRQ (0x0004)
  131. #define CmResourceTypeMemory 3 // ResType_Mem (0x0001)
  132. #define CmResourceTypeDma 4 // ResType_DMA (0x0003)
  133. #define CmResourceTypeDeviceSpecific 5 // ResType_ClassSpecific (0xFFFF)
  134. #define CmResourceTypeBusNumber 6 // ResType_BusNumber (0x0006)
  135. // end_wdm
  136. #define CmResourceTypeMaximum 7
  137. // begin_wdm
  138. #define CmResourceTypeNonArbitrated 128 // Not arbitrated if 0x80 bit set
  139. #define CmResourceTypeConfigData 128 // ResType_Reserved (0x8000)
  140. #define CmResourceTypeDevicePrivate 129 // ResType_DevicePrivate (0x8001)
  141. #define CmResourceTypePcCardConfig 130 // ResType_PcCardConfig (0x8002)
  142. #define CmResourceTypeMfCardConfig 131 // ResType_MfCardConfig (0x8003)
  143. //
  144. // Defines the ShareDisposition in the RESOURCE_DESCRIPTOR
  145. //
  146. typedef enum _CM_SHARE_DISPOSITION {
  147. CmResourceShareUndetermined = 0, // Reserved
  148. CmResourceShareDeviceExclusive,
  149. CmResourceShareDriverExclusive,
  150. CmResourceShareShared
  151. } CM_SHARE_DISPOSITION;
  152. //
  153. // Define the bit masks for Flags when type is CmResourceTypeInterrupt
  154. //
  155. #define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0
  156. #define CM_RESOURCE_INTERRUPT_LATCHED 1
  157. //
  158. // Define the bit masks for Flags when type is CmResourceTypeMemory
  159. //
  160. #define CM_RESOURCE_MEMORY_READ_WRITE 0x0000
  161. #define CM_RESOURCE_MEMORY_READ_ONLY 0x0001
  162. #define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002
  163. #define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004
  164. #define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008
  165. #define CM_RESOURCE_MEMORY_24 0x0010
  166. #define CM_RESOURCE_MEMORY_CACHEABLE 0x0020
  167. //
  168. // Define the bit masks for Flags when type is CmResourceTypePort
  169. //
  170. #define CM_RESOURCE_PORT_MEMORY 0x0000
  171. #define CM_RESOURCE_PORT_IO 0x0001
  172. #define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004
  173. #define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008
  174. #define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010
  175. #define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020
  176. #define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040
  177. #define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080
  178. //
  179. // Define the bit masks for Flags when type is CmResourceTypeDma
  180. //
  181. #define CM_RESOURCE_DMA_8 0x0000
  182. #define CM_RESOURCE_DMA_16 0x0001
  183. #define CM_RESOURCE_DMA_32 0x0002
  184. #define CM_RESOURCE_DMA_8_AND_16 0x0004
  185. #define CM_RESOURCE_DMA_BUS_MASTER 0x0008
  186. #define CM_RESOURCE_DMA_TYPE_A 0x0010
  187. #define CM_RESOURCE_DMA_TYPE_B 0x0020
  188. #define CM_RESOURCE_DMA_TYPE_F 0x0040
  189. // end_ntminiport end_ntndis
  190. //
  191. // This structure defines one type of resource used by a driver.
  192. //
  193. // There can only be *1* DeviceSpecificData block. It must be located at
  194. // the end of all resource descriptors in a full descriptor block.
  195. //
  196. //
  197. // Make sure alignment is made properly by compiler; otherwise move
  198. // flags back to the top of the structure (common to all members of the
  199. // union).
  200. //
  201. // begin_ntndis
  202. #include "pshpack4.h"
  203. typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
  204. UCHAR Type;
  205. UCHAR ShareDisposition;
  206. USHORT Flags;
  207. union {
  208. //
  209. // Range of resources, inclusive. These are physical, bus relative.
  210. // It is known that Port and Memory below have the exact same layout
  211. // as Generic.
  212. //
  213. struct {
  214. PHYSICAL_ADDRESS Start;
  215. ULONG Length;
  216. } Generic;
  217. //
  218. // end_wdm
  219. // Range of port numbers, inclusive. These are physical, bus
  220. // relative. The value should be the same as the one passed to
  221. // HalTranslateBusAddress().
  222. // begin_wdm
  223. //
  224. struct {
  225. PHYSICAL_ADDRESS Start;
  226. ULONG Length;
  227. } Port;
  228. //
  229. // end_wdm
  230. // IRQL and vector. Should be same values as were passed to
  231. // HalGetInterruptVector().
  232. // begin_wdm
  233. //
  234. struct {
  235. ULONG Level;
  236. ULONG Vector;
  237. KAFFINITY Affinity;
  238. } Interrupt;
  239. //
  240. // Range of memory addresses, inclusive. These are physical, bus
  241. // relative. The value should be the same as the one passed to
  242. // HalTranslateBusAddress().
  243. //
  244. struct {
  245. PHYSICAL_ADDRESS Start; // 64 bit physical addresses.
  246. ULONG Length;
  247. } Memory;
  248. //
  249. // Physical DMA channel.
  250. //
  251. struct {
  252. ULONG Channel;
  253. ULONG Port;
  254. ULONG Reserved1;
  255. } Dma;
  256. //
  257. // Device driver private data, usually used to help it figure
  258. // what the resource assignments decisions that were made.
  259. //
  260. struct {
  261. ULONG Data[3];
  262. } DevicePrivate;
  263. //
  264. // Bus Number information.
  265. //
  266. struct {
  267. ULONG Start;
  268. ULONG Length;
  269. ULONG Reserved;
  270. } BusNumber;
  271. //
  272. // Device Specific information defined by the driver.
  273. // The DataSize field indicates the size of the data in bytes. The
  274. // data is located immediately after the DeviceSpecificData field in
  275. // the structure.
  276. //
  277. struct {
  278. ULONG DataSize;
  279. ULONG Reserved1;
  280. ULONG Reserved2;
  281. } DeviceSpecificData;
  282. } u;
  283. } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
  284. #include "poppack.h"
  285. //
  286. // A Partial Resource List is what can be found in the ARC firmware
  287. // or will be generated by ntdetect.com.
  288. // The configuration manager will transform this structure into a Full
  289. // resource descriptor when it is about to store it in the regsitry.
  290. //
  291. // Note: There must a be a convention to the order of fields of same type,
  292. // (defined on a device by device basis) so that the fields can make sense
  293. // to a driver (i.e. when multiple memory ranges are necessary).
  294. //
  295. typedef struct _CM_PARTIAL_RESOURCE_LIST {
  296. USHORT Version;
  297. USHORT Revision;
  298. ULONG Count;
  299. CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
  300. } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
  301. //
  302. // A Full Resource Descriptor is what can be found in the registry.
  303. // This is what will be returned to a driver when it queries the registry
  304. // to get device information; it will be stored under a key in the hardware
  305. // description tree.
  306. //
  307. // end_wdm
  308. // Note: The BusNumber and Type are redundant information, but we will keep
  309. // it since it allows the driver _not_ to append it when it is creating
  310. // a resource list which could possibly span multiple buses.
  311. //
  312. // begin_wdm
  313. // Note: There must a be a convention to the order of fields of same type,
  314. // (defined on a device by device basis) so that the fields can make sense
  315. // to a driver (i.e. when multiple memory ranges are necessary).
  316. //
  317. typedef struct _CM_FULL_RESOURCE_DESCRIPTOR {
  318. INTERFACE_TYPE InterfaceType; // unused for WDM
  319. ULONG BusNumber; // unused for WDM
  320. CM_PARTIAL_RESOURCE_LIST PartialResourceList;
  321. } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
  322. //
  323. // The Resource list is what will be stored by the drivers into the
  324. // resource map via the IO API.
  325. //
  326. typedef struct _CM_RESOURCE_LIST {
  327. ULONG Count;
  328. CM_FULL_RESOURCE_DESCRIPTOR List[1];
  329. } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
  330. // end_ntndis
  331. //
  332. // Define the structures used to interpret configuration data of
  333. // \\Registry\machine\hardware\description tree.
  334. // Basically, these structures are used to interpret component
  335. // sepcific data.
  336. //
  337. //
  338. // Define DEVICE_FLAGS
  339. //
  340. typedef struct _DEVICE_FLAGS {
  341. ULONG Failed : 1;
  342. ULONG ReadOnly : 1;
  343. ULONG Removable : 1;
  344. ULONG ConsoleIn : 1;
  345. ULONG ConsoleOut : 1;
  346. ULONG Input : 1;
  347. ULONG Output : 1;
  348. } DEVICE_FLAGS, *PDEVICE_FLAGS;
  349. //
  350. // Define Component Information structure
  351. //
  352. typedef struct _CM_COMPONENT_INFORMATION {
  353. DEVICE_FLAGS Flags;
  354. ULONG Version;
  355. ULONG Key;
  356. KAFFINITY AffinityMask;
  357. } CM_COMPONENT_INFORMATION, *PCM_COMPONENT_INFORMATION;
  358. // end_ntddk end_wdm end_nthal
  359. // begin_ntddk begin_wdm begin_nthal
  360. //
  361. // The following structures are used to interpret x86
  362. // DeviceSpecificData of CM_PARTIAL_RESOURCE_DESCRIPTOR.
  363. // (Most of the structures are defined by BIOS. They are
  364. // not aligned on word (or dword) boundary.
  365. //
  366. //
  367. // Define the Rom Block structure
  368. //
  369. typedef struct _CM_ROM_BLOCK {
  370. ULONG Address;
  371. ULONG Size;
  372. } CM_ROM_BLOCK, *PCM_ROM_BLOCK;
  373. // begin_ntminiport begin_ntndis
  374. #include "pshpack1.h"
  375. // end_ntminiport end_ntndis
  376. //
  377. // Define INT13 driver parameter block
  378. //
  379. typedef struct _CM_INT13_DRIVE_PARAMETER {
  380. USHORT DriveSelect;
  381. ULONG MaxCylinders;
  382. USHORT SectorsPerTrack;
  383. USHORT MaxHeads;
  384. USHORT NumberDrives;
  385. } CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
  386. // begin_ntminiport begin_ntndis
  387. //
  388. // Define Mca POS data block for slot
  389. //
  390. typedef struct _CM_MCA_POS_DATA {
  391. USHORT AdapterId;
  392. UCHAR PosData1;
  393. UCHAR PosData2;
  394. UCHAR PosData3;
  395. UCHAR PosData4;
  396. } CM_MCA_POS_DATA, *PCM_MCA_POS_DATA;
  397. //
  398. // Memory configuration of eisa data block structure
  399. //
  400. typedef struct _EISA_MEMORY_TYPE {
  401. UCHAR ReadWrite: 1;
  402. UCHAR Cached : 1;
  403. UCHAR Reserved0 :1;
  404. UCHAR Type:2;
  405. UCHAR Shared:1;
  406. UCHAR Reserved1 :1;
  407. UCHAR MoreEntries : 1;
  408. } EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE;
  409. typedef struct _EISA_MEMORY_CONFIGURATION {
  410. EISA_MEMORY_TYPE ConfigurationByte;
  411. UCHAR DataSize;
  412. USHORT AddressLowWord;
  413. UCHAR AddressHighByte;
  414. USHORT MemorySize;
  415. } EISA_MEMORY_CONFIGURATION, *PEISA_MEMORY_CONFIGURATION;
  416. //
  417. // Interrupt configurationn of eisa data block structure
  418. //
  419. typedef struct _EISA_IRQ_DESCRIPTOR {
  420. UCHAR Interrupt : 4;
  421. UCHAR Reserved :1;
  422. UCHAR LevelTriggered :1;
  423. UCHAR Shared : 1;
  424. UCHAR MoreEntries : 1;
  425. } EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR;
  426. typedef struct _EISA_IRQ_CONFIGURATION {
  427. EISA_IRQ_DESCRIPTOR ConfigurationByte;
  428. UCHAR Reserved;
  429. } EISA_IRQ_CONFIGURATION, *PEISA_IRQ_CONFIGURATION;
  430. //
  431. // DMA description of eisa data block structure
  432. //
  433. typedef struct _DMA_CONFIGURATION_BYTE0 {
  434. UCHAR Channel : 3;
  435. UCHAR Reserved : 3;
  436. UCHAR Shared :1;
  437. UCHAR MoreEntries :1;
  438. } DMA_CONFIGURATION_BYTE0;
  439. typedef struct _DMA_CONFIGURATION_BYTE1 {
  440. UCHAR Reserved0 : 2;
  441. UCHAR TransferSize : 2;
  442. UCHAR Timing : 2;
  443. UCHAR Reserved1 : 2;
  444. } DMA_CONFIGURATION_BYTE1;
  445. typedef struct _EISA_DMA_CONFIGURATION {
  446. DMA_CONFIGURATION_BYTE0 ConfigurationByte0;
  447. DMA_CONFIGURATION_BYTE1 ConfigurationByte1;
  448. } EISA_DMA_CONFIGURATION, *PEISA_DMA_CONFIGURATION;
  449. //
  450. // Port description of eisa data block structure
  451. //
  452. typedef struct _EISA_PORT_DESCRIPTOR {
  453. UCHAR NumberPorts : 5;
  454. UCHAR Reserved :1;
  455. UCHAR Shared :1;
  456. UCHAR MoreEntries : 1;
  457. } EISA_PORT_DESCRIPTOR, *PEISA_PORT_DESCRIPTOR;
  458. typedef struct _EISA_PORT_CONFIGURATION {
  459. EISA_PORT_DESCRIPTOR Configuration;
  460. USHORT PortAddress;
  461. } EISA_PORT_CONFIGURATION, *PEISA_PORT_CONFIGURATION;
  462. //
  463. // Eisa slot information definition
  464. // N.B. This structure is different from the one defined
  465. // in ARC eisa addendum.
  466. //
  467. typedef struct _CM_EISA_SLOT_INFORMATION {
  468. UCHAR ReturnCode;
  469. UCHAR ReturnFlags;
  470. UCHAR MajorRevision;
  471. UCHAR MinorRevision;
  472. USHORT Checksum;
  473. UCHAR NumberFunctions;
  474. UCHAR FunctionInformation;
  475. ULONG CompressedId;
  476. } CM_EISA_SLOT_INFORMATION, *PCM_EISA_SLOT_INFORMATION;
  477. //
  478. // Eisa function information definition
  479. //
  480. typedef struct _CM_EISA_FUNCTION_INFORMATION {
  481. ULONG CompressedId;
  482. UCHAR IdSlotFlags1;
  483. UCHAR IdSlotFlags2;
  484. UCHAR MinorRevision;
  485. UCHAR MajorRevision;
  486. UCHAR Selections[26];
  487. UCHAR FunctionFlags;
  488. UCHAR TypeString[80];
  489. EISA_MEMORY_CONFIGURATION EisaMemory[9];
  490. EISA_IRQ_CONFIGURATION EisaIrq[7];
  491. EISA_DMA_CONFIGURATION EisaDma[4];
  492. EISA_PORT_CONFIGURATION EisaPort[20];
  493. UCHAR InitializationData[60];
  494. } CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION;
  495. //
  496. // The following defines the way pnp bios information is stored in
  497. // the registry \\HKEY_LOCAL_MACHINE\HARDWARE\Description\System\MultifunctionAdapter\x
  498. // key, where x is an integer number indicating adapter instance. The
  499. // "Identifier" of the key must equal to "PNP BIOS" and the
  500. // "ConfigurationData" is organized as follow:
  501. //
  502. // CM_PNP_BIOS_INSTALLATION_CHECK +
  503. // CM_PNP_BIOS_DEVICE_NODE for device 1 +
  504. // CM_PNP_BIOS_DEVICE_NODE for device 2 +
  505. // ...
  506. // CM_PNP_BIOS_DEVICE_NODE for device n
  507. //
  508. //
  509. // Pnp BIOS device node structure
  510. //
  511. typedef struct _CM_PNP_BIOS_DEVICE_NODE {
  512. USHORT Size;
  513. UCHAR Node;
  514. ULONG ProductId;
  515. UCHAR DeviceType[3];
  516. USHORT DeviceAttributes;
  517. // followed by AllocatedResourceBlock, PossibleResourceBlock
  518. // and CompatibleDeviceId
  519. } CM_PNP_BIOS_DEVICE_NODE,*PCM_PNP_BIOS_DEVICE_NODE;
  520. //
  521. // Pnp BIOS Installation check
  522. //
  523. typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK {
  524. UCHAR Signature[4]; // $PnP (ascii)
  525. UCHAR Revision;
  526. UCHAR Length;
  527. USHORT ControlField;
  528. UCHAR Checksum;
  529. ULONG EventFlagAddress; // Physical address
  530. USHORT RealModeEntryOffset;
  531. USHORT RealModeEntrySegment;
  532. USHORT ProtectedModeEntryOffset;
  533. ULONG ProtectedModeCodeBaseAddress;
  534. ULONG OemDeviceId;
  535. USHORT RealModeDataBaseAddress;
  536. ULONG ProtectedModeDataBaseAddress;
  537. } CM_PNP_BIOS_INSTALLATION_CHECK, *PCM_PNP_BIOS_INSTALLATION_CHECK;
  538. #include "poppack.h"
  539. //
  540. // Masks for EISA function information
  541. //
  542. #define EISA_FUNCTION_ENABLED 0x80
  543. #define EISA_FREE_FORM_DATA 0x40
  544. #define EISA_HAS_PORT_INIT_ENTRY 0x20
  545. #define EISA_HAS_PORT_RANGE 0x10
  546. #define EISA_HAS_DMA_ENTRY 0x08
  547. #define EISA_HAS_IRQ_ENTRY 0x04
  548. #define EISA_HAS_MEMORY_ENTRY 0x02
  549. #define EISA_HAS_TYPE_ENTRY 0x01
  550. #define EISA_HAS_INFORMATION EISA_HAS_PORT_RANGE + \
  551. EISA_HAS_DMA_ENTRY + \
  552. EISA_HAS_IRQ_ENTRY + \
  553. EISA_HAS_MEMORY_ENTRY + \
  554. EISA_HAS_TYPE_ENTRY
  555. //
  556. // Masks for EISA memory configuration
  557. //
  558. #define EISA_MORE_ENTRIES 0x80
  559. #define EISA_SYSTEM_MEMORY 0x00
  560. #define EISA_MEMORY_TYPE_RAM 0x01
  561. //
  562. // Returned error code for EISA bios call
  563. //
  564. #define EISA_INVALID_SLOT 0x80
  565. #define EISA_INVALID_FUNCTION 0x81
  566. #define EISA_INVALID_CONFIGURATION 0x82
  567. #define EISA_EMPTY_SLOT 0x83
  568. #define EISA_INVALID_BIOS_CALL 0x86
  569. // end_ntminiport end_ntndis
  570. //
  571. // The following structures are used to interpret mips
  572. // DeviceSpecificData of CM_PARTIAL_RESOURCE_DESCRIPTOR.
  573. //
  574. //
  575. // Device data records for adapters.
  576. //
  577. //
  578. // The device data record for the Emulex SCSI controller.
  579. //
  580. typedef struct _CM_SCSI_DEVICE_DATA {
  581. USHORT Version;
  582. USHORT Revision;
  583. UCHAR HostIdentifier;
  584. } CM_SCSI_DEVICE_DATA, *PCM_SCSI_DEVICE_DATA;
  585. //
  586. // Device data records for controllers.
  587. //
  588. //
  589. // The device data record for the Video controller.
  590. //
  591. typedef struct _CM_VIDEO_DEVICE_DATA {
  592. USHORT Version;
  593. USHORT Revision;
  594. ULONG VideoClock;
  595. } CM_VIDEO_DEVICE_DATA, *PCM_VIDEO_DEVICE_DATA;
  596. //
  597. // The device data record for the SONIC network controller.
  598. //
  599. typedef struct _CM_SONIC_DEVICE_DATA {
  600. USHORT Version;
  601. USHORT Revision;
  602. USHORT DataConfigurationRegister;
  603. UCHAR EthernetAddress[8];
  604. } CM_SONIC_DEVICE_DATA, *PCM_SONIC_DEVICE_DATA;
  605. //
  606. // The device data record for the serial controller.
  607. //
  608. typedef struct _CM_SERIAL_DEVICE_DATA {
  609. USHORT Version;
  610. USHORT Revision;
  611. ULONG BaudClock;
  612. } CM_SERIAL_DEVICE_DATA, *PCM_SERIAL_DEVICE_DATA;
  613. //
  614. // Device data records for peripherals.
  615. //
  616. //
  617. // The device data record for the Monitor peripheral.
  618. //
  619. typedef struct _CM_MONITOR_DEVICE_DATA {
  620. USHORT Version;
  621. USHORT Revision;
  622. USHORT HorizontalScreenSize;
  623. USHORT VerticalScreenSize;
  624. USHORT HorizontalResolution;
  625. USHORT VerticalResolution;
  626. USHORT HorizontalDisplayTimeLow;
  627. USHORT HorizontalDisplayTime;
  628. USHORT HorizontalDisplayTimeHigh;
  629. USHORT HorizontalBackPorchLow;
  630. USHORT HorizontalBackPorch;
  631. USHORT HorizontalBackPorchHigh;
  632. USHORT HorizontalFrontPorchLow;
  633. USHORT HorizontalFrontPorch;
  634. USHORT HorizontalFrontPorchHigh;
  635. USHORT HorizontalSyncLow;
  636. USHORT HorizontalSync;
  637. USHORT HorizontalSyncHigh;
  638. USHORT VerticalBackPorchLow;
  639. USHORT VerticalBackPorch;
  640. USHORT VerticalBackPorchHigh;
  641. USHORT VerticalFrontPorchLow;
  642. USHORT VerticalFrontPorch;
  643. USHORT VerticalFrontPorchHigh;
  644. USHORT VerticalSyncLow;
  645. USHORT VerticalSync;
  646. USHORT VerticalSyncHigh;
  647. } CM_MONITOR_DEVICE_DATA, *PCM_MONITOR_DEVICE_DATA;
  648. //
  649. // The device data record for the Floppy peripheral.
  650. //
  651. typedef struct _CM_FLOPPY_DEVICE_DATA {
  652. USHORT Version;
  653. USHORT Revision;
  654. CHAR Size[8];
  655. ULONG MaxDensity;
  656. ULONG MountDensity;
  657. //
  658. // New data fields for version >= 2.0
  659. //
  660. UCHAR StepRateHeadUnloadTime;
  661. UCHAR HeadLoadTime;
  662. UCHAR MotorOffTime;
  663. UCHAR SectorLengthCode;
  664. UCHAR SectorPerTrack;
  665. UCHAR ReadWriteGapLength;
  666. UCHAR DataTransferLength;
  667. UCHAR FormatGapLength;
  668. UCHAR FormatFillCharacter;
  669. UCHAR HeadSettleTime;
  670. UCHAR MotorSettleTime;
  671. UCHAR MaximumTrackValue;
  672. UCHAR DataTransferRate;
  673. } CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA;
  674. //
  675. // The device data record for the Keyboard peripheral.
  676. // The KeyboardFlags is defined (by x86 BIOS INT 16h, function 02) as:
  677. // bit 7 : Insert on
  678. // bit 6 : Caps Lock on
  679. // bit 5 : Num Lock on
  680. // bit 4 : Scroll Lock on
  681. // bit 3 : Alt Key is down
  682. // bit 2 : Ctrl Key is down
  683. // bit 1 : Left shift key is down
  684. // bit 0 : Right shift key is down
  685. //
  686. typedef struct _CM_KEYBOARD_DEVICE_DATA {
  687. USHORT Version;
  688. USHORT Revision;
  689. UCHAR Type;
  690. UCHAR Subtype;
  691. USHORT KeyboardFlags;
  692. } CM_KEYBOARD_DEVICE_DATA, *PCM_KEYBOARD_DEVICE_DATA;
  693. //
  694. // Declaration of the structure for disk geometries
  695. //
  696. typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA {
  697. ULONG BytesPerSector;
  698. ULONG NumberOfCylinders;
  699. ULONG SectorsPerTrack;
  700. ULONG NumberOfHeads;
  701. } CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
  702. // end_wdm
  703. //
  704. // Declaration of the structure for the PcCard ISA IRQ map
  705. //
  706. typedef struct _CM_PCCARD_DEVICE_DATA {
  707. UCHAR Flags;
  708. UCHAR ErrorCode;
  709. USHORT Reserved;
  710. ULONG BusData;
  711. ULONG DeviceId;
  712. ULONG LegacyBaseAddress;
  713. UCHAR IRQMap[16];
  714. } CM_PCCARD_DEVICE_DATA, *PCM_PCCARD_DEVICE_DATA;
  715. // Definitions for Flags
  716. #define PCCARD_MAP_ERROR 0x01
  717. #define PCCARD_DEVICE_PCI 0x10
  718. #define PCCARD_SCAN_DISABLED 0x01
  719. #define PCCARD_MAP_ZERO 0x02
  720. #define PCCARD_NO_TIMER 0x03
  721. #define PCCARD_NO_PIC 0x04
  722. #define PCCARD_NO_LEGACY_BASE 0x05
  723. #define PCCARD_DUP_LEGACY_BASE 0x06
  724. #define PCCARD_NO_CONTROLLERS 0x07
  725. // begin_wdm
  726. // begin_ntminiport
  727. //
  728. // Defines Resource Options
  729. //
  730. #define IO_RESOURCE_PREFERRED 0x01
  731. #define IO_RESOURCE_DEFAULT 0x02
  732. #define IO_RESOURCE_ALTERNATIVE 0x08
  733. //
  734. // This structure defines one type of resource requested by the driver
  735. //
  736. typedef struct _IO_RESOURCE_DESCRIPTOR {
  737. UCHAR Option;
  738. UCHAR Type; // use CM_RESOURCE_TYPE
  739. UCHAR ShareDisposition; // use CM_SHARE_DISPOSITION
  740. UCHAR Spare1;
  741. USHORT Flags; // use CM resource flag defines
  742. USHORT Spare2; // align
  743. union {
  744. struct {
  745. ULONG Length;
  746. ULONG Alignment;
  747. PHYSICAL_ADDRESS MinimumAddress;
  748. PHYSICAL_ADDRESS MaximumAddress;
  749. } Port;
  750. struct {
  751. ULONG Length;
  752. ULONG Alignment;
  753. PHYSICAL_ADDRESS MinimumAddress;
  754. PHYSICAL_ADDRESS MaximumAddress;
  755. } Memory;
  756. struct {
  757. ULONG MinimumVector;
  758. ULONG MaximumVector;
  759. } Interrupt;
  760. struct {
  761. ULONG MinimumChannel;
  762. ULONG MaximumChannel;
  763. } Dma;
  764. struct {
  765. ULONG Length;
  766. ULONG Alignment;
  767. PHYSICAL_ADDRESS MinimumAddress;
  768. PHYSICAL_ADDRESS MaximumAddress;
  769. } Generic;
  770. struct {
  771. ULONG Data[3];
  772. } DevicePrivate;
  773. //
  774. // Bus Number information.
  775. //
  776. struct {
  777. ULONG Length;
  778. ULONG MinBusNumber;
  779. ULONG MaxBusNumber;
  780. ULONG Reserved;
  781. } BusNumber;
  782. struct {
  783. ULONG Priority; // use LCPRI_Xxx values in cfg.h
  784. ULONG Reserved1;
  785. ULONG Reserved2;
  786. } ConfigData;
  787. } u;
  788. } IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR;
  789. // end_ntminiport
  790. typedef struct _IO_RESOURCE_LIST {
  791. USHORT Version;
  792. USHORT Revision;
  793. ULONG Count;
  794. IO_RESOURCE_DESCRIPTOR Descriptors[1];
  795. } IO_RESOURCE_LIST, *PIO_RESOURCE_LIST;
  796. typedef struct _IO_RESOURCE_REQUIREMENTS_LIST {
  797. ULONG ListSize;
  798. INTERFACE_TYPE InterfaceType; // unused for WDM
  799. ULONG BusNumber; // unused for WDM
  800. ULONG SlotNumber;
  801. ULONG Reserved[3];
  802. ULONG AlternativeLists;
  803. IO_RESOURCE_LIST List[1];
  804. } IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST;
  805. // end_ntddk end_wdm end_nthal
  806. #ifdef __cplusplus
  807. }
  808. #endif
  809. #endif // _NTCONFIG_