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

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