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.

1974 lines
71 KiB

  1. /*****************************************************************************
  2. *
  3. * (C) Copyright MICROSOFT Corp., 1993-1998
  4. *
  5. * Title: CONFIGMG.H - Configuration manager header file
  6. *
  7. * Version: 1.00
  8. *
  9. * Date: 02-Feb-1993
  10. *
  11. * Authors: PYS & RAL
  12. *
  13. *------------------------------------------------------------------------------
  14. *
  15. * Change log:
  16. *
  17. * DATE REV DESCRIPTION
  18. * ----------- --- -----------------------------------------------------------
  19. * 02-Feb-1993 PYS Original
  20. *****************************************************************************/
  21. #ifndef _CONFIGMG_H
  22. #define _CONFIGMG_H
  23. #define CONFIGMG_VERSION 0x0400
  24. #define PNPDRVS_Major_Ver 0x0004
  25. #define PNPDRVS_Minor_Ver 0x0000
  26. #ifdef MAXDEBUG
  27. #define CM_PERFORMANCE_INFO
  28. #endif
  29. #ifdef GOLDEN
  30. #ifdef RETAIL
  31. #define CM_GOLDEN_RETAIL
  32. #endif
  33. #endif
  34. /*XLATOFF*/
  35. #pragma pack(1)
  36. /*XLATON*/
  37. #ifndef NORESDES
  38. /****************************************************************************
  39. *
  40. * EQUATES FOR RESOURCE DESCRIPTOR
  41. *
  42. * The equates for resource descriptor work the exact same way as those
  43. * for VxD IDs, which is:
  44. *
  45. * Device ID's are a combination of OEM # and device # in the form:
  46. *
  47. * xOOOOOOOOOODDDDD
  48. *
  49. * The high bit of the device ID is reserved for future use. The next
  50. * 10 bits are the OEM # which is assigned by Microsoft. The last 5 bits
  51. * are the device #. This allows each OEM to create 32 unique devices.
  52. * If an OEM is creating a replacement for a standard device, then it
  53. * should re-use the standard ID listed below. Microsoft reserves the
  54. * first 16 OEM #'s (0 thru 0Fh)
  55. *
  56. * To make your resource ID, you must use the same 10 OEMs bit that
  57. * have been given by Microsoft as OEM VxD ID range. You can then tag
  58. * any of the 32 unique number in that range (it does not have to be
  59. * the same as the VxD as some VxD may have mupltiple arbitrators).
  60. *
  61. * If the ResType_Ignored_Bit is set, the resource is not arbitrated.
  62. * You cannot register a handler for such a resource.
  63. *
  64. ***************************************************************************/
  65. #define ResType_All 0x00000000 // Return all resource types.
  66. #define ResType_None 0x00000000 // Arbitration always succeeded.
  67. #define ResType_Mem 0x00000001 // Physical address resource.
  68. #define ResType_IO 0x00000002 // Physical IO address resource.
  69. #define ResType_DMA 0x00000003 // DMA channels 0-7 resource.
  70. #define ResType_IRQ 0x00000004 // IRQ 0-15 resource.
  71. #define ResType_Max 0x00000004 // Max KNOWN ResType (for DEBUG).
  72. #define ResType_Ignored_Bit 0x00008000 // This resource is to be ignored.
  73. #define DEBUG_RESTYPE_NAMES \
  74. char CMFAR *lpszResourceName[ResType_Max+1]= \
  75. { \
  76. "All/None", \
  77. "Mem ", \
  78. "IO ", \
  79. "DMA ", \
  80. "IRQ ", \
  81. };
  82. /************************************************************************
  83. * *
  84. * OEMS WHO WANT A VXD DEVICE ID ASSIGNED TO THEM, *
  85. * PLEASE CONTACT MICROSOFT PRODUCT SUPPORT *
  86. * *
  87. ************************************************************************/
  88. /****************************************************************************
  89. *
  90. * RESOURCE DESCRIPTORS
  91. *
  92. * Each resource descriptor consists of an array of resource requests.
  93. * Exactly one element of the array must be satisfied. The data
  94. * of each array element is resource specific an described below.
  95. * The data may specify one or more resource requests. At least
  96. * one element of a Res_Des must be satisfied to satisfy the request
  97. * represented by the Res_Des. The values allocated to the Res_Des
  98. * are stored within the Res_Des.
  99. * Each subarray (OR element) is a single Res_Des followed
  100. * by data specific to the type of resource. The data includes the
  101. * allocated resource (if any) followed by resource requests (which
  102. * will include the values indicated by the allocated resource.
  103. *
  104. ***************************************************************************/
  105. /****************************************************************************
  106. * Memory resource requests consist of ranges of pages
  107. ***************************************************************************/
  108. #define MType_Range sizeof(struct Mem_Range_s)
  109. #define fMD_MemoryType 1 // Memory range is ROM/RAM
  110. #define fMD_ROM 0 // Memory range is ROM
  111. #define fMD_RAM 1 // Memory range is RAM
  112. #define fMD_32_24 2 // Memory range is 32/24 (for ISAPNP only)
  113. #define fMD_24 0 // Memory range is 24
  114. #define fMD_32 2 // Memory range is 32
  115. /* Memory Range descriptor data
  116. */
  117. struct Mem_Range_s {
  118. ULONG MR_Align; // Mask for base alignment
  119. ULONG MR_nBytes; // Count of bytes
  120. ULONG MR_Min; // Min Address
  121. ULONG MR_Max; // Max Address
  122. WORD MR_Flags; // Flags
  123. WORD MR_Reserved;
  124. };
  125. typedef struct Mem_Range_s MEM_RANGE;
  126. /* Mem Resource descriptor header structure
  127. * MD_Count * MD_Type bytes of data follow header in an
  128. * array of MEM_RANGE structures. When an allocation is made,
  129. * the allocated value is stored in the MD_Alloc_... variables.
  130. *
  131. * Example for memory Resource Description:
  132. * Mem_Des_s {
  133. * MD_Count = 1;
  134. * MD_Type = MTypeRange;
  135. * MD_Alloc_Base = 0;
  136. * MD_Alloc_End = 0;
  137. * MD_Flags = 0;
  138. * MD_Reserved = 0;
  139. * };
  140. * Mem_Range_s {
  141. * MR_Align = 0xFFFFFF00; // 256 byte alignment
  142. * MR_nBytes = 32; // 32 bytes needed
  143. * MR_Min = 0;
  144. * MR_Max = 0xFFFFFFFF; // Any place in address space
  145. * MR_Flags = 0;
  146. * MR_Reserved = 0;
  147. * };
  148. */
  149. struct Mem_Des_s {
  150. WORD MD_Count;
  151. WORD MD_Type;
  152. ULONG MD_Alloc_Base;
  153. ULONG MD_Alloc_End;
  154. WORD MD_Flags;
  155. WORD MD_Reserved;
  156. };
  157. typedef struct Mem_Des_s MEM_DES;
  158. /****************************************************************************
  159. * IO resource allocations consist of fixed ranges or variable ranges
  160. * The Alias and Decode masks provide additional flexibility
  161. * in specifying how the address is handled. They provide a convenient
  162. * method for specifying what port aliases a card responds to. An alias
  163. * is a port address that is responded to as if it were another address.
  164. * Additionally, some cards will actually use additional ports for
  165. * different purposes, but use a decoding scheme that makes it look as
  166. * though it were using aliases. E.G., an ISA card may decode 10 bits
  167. * and require port 03C0h. It would need to specify an Alias offset of
  168. * 04h and a Decode of 3 (no aliases are used as actual ports). For
  169. * convenience, the alias field can be set to zero indicate no aliases
  170. * are required and then decode is ignored.
  171. * If the card were to use the ports at 7C0h, 0BC0h and 0FC0h, where these
  172. * ports have different functionality, the Alias would be the same and the
  173. * the decode would be 0Fh indicating bits 11 and 12 of the port address
  174. * are significant. Thus, the allocation is for all of the ports
  175. * (PORT[i] + (n*Alias*256)) & (Decode*256 | 03FFh), where n is
  176. * any integer and PORT is the range specified by the nPorts, Min and
  177. * Max fields. Note that the minimum Alias is 4 and the minimum
  178. * Decode is 3.
  179. * Because of the history of the ISA bus, all ports that can be described
  180. * by the formula PORT = n*400h + zzzz, where "zzzz" is a port in the
  181. * range 100h - 3FFh, will be checked for compatibility with the port
  182. * zzzz, assuming that the port zzzz is using a 10 bit decode. If a card
  183. * is on a local bus that can prevent the IO address from appearing on
  184. * the ISA bus (e.g. PCI), then the logical configuration should specify
  185. * an alias of IOA_Local which will prevent the arbitrator from checking
  186. * for old ISA bus compatibility.
  187. */
  188. #define IOType_Range sizeof(struct IO_Range_s) // Variable range
  189. /* IO Range descriptor data */
  190. struct IO_Range_s {
  191. WORD IOR_Align; // Mask for base alignment
  192. WORD IOR_nPorts; // Number of ports
  193. WORD IOR_Min; // Min port address
  194. WORD IOR_Max; // Max port address
  195. WORD IOR_RangeFlags; // Flags
  196. BYTE IOR_Alias; // Alias offset
  197. BYTE IOR_Decode; // Address specified
  198. };
  199. typedef struct IO_Range_s IO_RANGE;
  200. /* IO Resource descriptor header structure
  201. * IOD_Count * IOD_Type bytes of data follow header in an
  202. * array of IO_RANGE structures. When an allocation is made,
  203. * the allocated value is stored in the IOD_Alloc_... variables.
  204. *
  205. * Example for IO Resource Description:
  206. * IO_Des_s {
  207. * IOD_Count = 1;
  208. * IOD_Type = IOType_Range;
  209. * IOD_Alloc_Base = 0;
  210. * IOD_Alloc_End = 0;
  211. * IOD_Alloc_Alias = 0;
  212. * IOD_Alloc_Decode = 0;
  213. * IOD_DesFlags = 0;
  214. * IOD_Reserved = 0;
  215. * };
  216. * IO_Range_s {
  217. * IOR_Align = 0xFFF0; // 16 byte alignment
  218. * IOR_nPorts = 16; // 16 ports required
  219. * IOR_Min = 0x0100;
  220. * IOR_Max = 0x03FF; // Anywhere in ISA std ports
  221. * IOR_RangeFlags = 0;
  222. * IOR_Alias = 0004; // Standard ISA 10 bit aliasing
  223. * IOR_Decode = 0x000F; // Use first 3 aliases (e.g. if
  224. * // 0x100 were base port, 0x500
  225. * // 0x900, and 0xD00 would
  226. * // also be allocated)
  227. * };
  228. */
  229. struct IO_Des_s {
  230. WORD IOD_Count;
  231. WORD IOD_Type;
  232. WORD IOD_Alloc_Base;
  233. WORD IOD_Alloc_End;
  234. WORD IOD_DesFlags;
  235. BYTE IOD_Alloc_Alias;
  236. BYTE IOD_Alloc_Decode;
  237. };
  238. typedef struct IO_Des_s IO_DES;
  239. /* Definition for special alias value indicating card on PCI or similar local bus
  240. * This value should used for the IOR_Alias and IOD_Alias fields
  241. */
  242. #define IOA_Local 0xff
  243. /****************************************************************************
  244. * DMA channel resource allocations consist of one WORD channel bit masks.
  245. * The mask indcates alternative channel allocations,
  246. * one bit for each alternative (only one is allocated per mask).
  247. */
  248. /*DMA flags
  249. *First two are DMA channel width: BYTE, WORD or DWORD
  250. */
  251. #define mDD_Width 0003h // Mask for channel width
  252. #define fDD_BYTE 0
  253. #define fDD_WORD 1
  254. #define fDD_DWORD 2
  255. #define szDMA_Des_Flags "WD"
  256. /* DMA Resource descriptor structure
  257. *
  258. * Example for DMA Resource Description:
  259. *
  260. * DMA_Des_s {
  261. * DD_Flags = fDD_Byte; // Byte transfer
  262. * DD_Alloc_Chan = 0;
  263. * DD_Req_Mask = 0x60; // Channel 5 or 6
  264. * DD_Reserved = 0;
  265. * };
  266. */
  267. struct DMA_Des_s {
  268. BYTE DD_Flags;
  269. BYTE DD_Alloc_Chan; // Channel number allocated
  270. BYTE DD_Req_Mask; // Mask of possible channels
  271. BYTE DD_Reserved;
  272. };
  273. typedef struct DMA_Des_s DMA_DES;
  274. /****************************************************************************
  275. * IRQ resource allocations consist of two WORD IRQ bit masks.
  276. * The first mask indcates alternatives for IRQ allocation,
  277. * one bit for each alternative (only one is allocated per mask). The
  278. * second mask is used to specify that the IRQ can be shared.
  279. */
  280. /*
  281. * IRQ flags
  282. */
  283. #define fIRQD_Share 1 // IRQ can be shared
  284. #define cIRQ_Des_Flags 'S'
  285. /* IRQ Resource descriptor structure
  286. *
  287. * Example for IRQ Resource Description:
  288. *
  289. * IRQ_Des_s {
  290. * IRQD_Flags = fIRQD_Share // IRQ can be shared
  291. * IRQD_Alloc_Num = 0;
  292. * IRQD_Req_Mask = 0x18; // IRQ 3 or 4
  293. * IRQD_Reserved = 0;
  294. * };
  295. */
  296. struct IRQ_Des_s {
  297. WORD IRQD_Flags;
  298. WORD IRQD_Alloc_Num; // Allocated IRQ number
  299. WORD IRQD_Req_Mask; // Mask of possible IRQs
  300. WORD IRQD_Reserved;
  301. };
  302. typedef struct IRQ_Des_s IRQ_DES;
  303. /*XLATOFF*/
  304. /****************************************************************************
  305. *
  306. * 'C'-only defined total resource structure. Since a resource consists of
  307. * one resource header followed by an undefined number of resource data
  308. * structure, we use the undefined array size [] on the *_DATA structure
  309. * member. Unfortunately, this does not H2INC since the total size of the
  310. * array cannot be computed from the definition.
  311. *
  312. ***************************************************************************/
  313. #pragma warning (disable:4200) // turn off undefined array size
  314. typedef MEM_DES *PMEM_DES;
  315. typedef MEM_RANGE *PMEM_RANGE;
  316. typedef IO_DES *PIO_DES;
  317. typedef IO_RANGE *PIO_RANGE;
  318. typedef DMA_DES *PDMA_DES;
  319. typedef IRQ_DES *PIRQ_DES;
  320. struct MEM_Resource_s {
  321. MEM_DES MEM_Header;
  322. MEM_RANGE MEM_Data[];
  323. };
  324. typedef struct MEM_Resource_s MEM_RESOURCE;
  325. typedef MEM_RESOURCE *PMEM_RESOURCE;
  326. struct MEM_Resource1_s {
  327. MEM_DES MEM_Header;
  328. MEM_RANGE MEM_Data;
  329. };
  330. typedef struct MEM_Resource1_s MEM_RESOURCE1;
  331. typedef MEM_RESOURCE1 *PMEM_RESOURCE1;
  332. #define SIZEOF_MEM(x) (sizeof(MEM_DES)+(x)*sizeof(MEM_RANGE))
  333. struct IO_Resource_s {
  334. IO_DES IO_Header;
  335. IO_RANGE IO_Data[];
  336. };
  337. typedef struct IO_Resource_s IO_RESOURCE;
  338. typedef IO_RESOURCE *PIO_RESOURCE;
  339. struct IO_Resource1_s {
  340. IO_DES IO_Header;
  341. IO_RANGE IO_Data;
  342. };
  343. typedef struct IO_Resource1_s IO_RESOURCE1;
  344. typedef IO_RESOURCE1 *PIO_RESOURCE1;
  345. #define SIZEOF_IORANGE(x) (sizeof(IO_DES)+(x)*sizeof(IO_RANGE))
  346. struct DMA_Resource_s {
  347. DMA_DES DMA_Header;
  348. };
  349. typedef struct DMA_Resource_s DMA_RESOURCE;
  350. #define SIZEOF_DMA sizeof(DMA_DES)
  351. struct IRQ_Resource_s {
  352. IRQ_DES IRQ_Header;
  353. };
  354. typedef struct IRQ_Resource_s IRQ_RESOURCE;
  355. #define SIZEOF_IRQ sizeof(IRQ_DES)
  356. #pragma warning (default:4200) // turn on undefined array size
  357. /*XLATON*/
  358. #endif // ifndef NORESDES
  359. #define LCPRI_FORCECONFIG 0x00000000 // Logical configuration priorities.
  360. #define LCPRI_BOOTCONFIG 0x00000001
  361. #define LCPRI_HARDWIRED 0x00001000
  362. #define LCPRI_DESIRED 0x00002000
  363. #define LCPRI_NORMAL 0x00003000
  364. #define LCPRI_LASTBESTCONFIG 0x00003FFF // CM ONLY, DO NOT USE.
  365. #define LCPRI_SUBOPTIMAL 0x00005000
  366. #define LCPRI_LASTSOFTCONFIG 0x00007FFF // CM ONLY, DO NOT USE.
  367. #define LCPRI_RESTART 0x00008000
  368. #define LCPRI_REBOOT 0x00009000
  369. #define LCPRI_POWEROFF 0x0000A000
  370. #define LCPRI_HARDRECONFIG 0x0000C000
  371. #define LCPRI_DISABLED 0x0000FFFF
  372. #define MAX_LCPRI 0x0000FFFF
  373. #define MAX_MEM_REGISTERS 9
  374. #define MAX_IO_PORTS 20
  375. #define MAX_IRQS 7
  376. #define MAX_DMA_CHANNELS 7
  377. struct Config_Buff_s {
  378. WORD wNumMemWindows; // Num memory windows
  379. DWORD dMemBase[MAX_MEM_REGISTERS]; // Memory window base
  380. DWORD dMemLength[MAX_MEM_REGISTERS]; // Memory window length
  381. WORD wMemAttrib[MAX_MEM_REGISTERS]; // Memory window Attrib
  382. WORD wNumIOPorts; // Num IO ports
  383. WORD wIOPortBase[MAX_IO_PORTS]; // I/O port base
  384. WORD wIOPortLength[MAX_IO_PORTS]; // I/O port length
  385. WORD wNumIRQs; // Num IRQ info
  386. BYTE bIRQRegisters[MAX_IRQS]; // IRQ list
  387. BYTE bIRQAttrib[MAX_IRQS]; // IRQ Attrib list
  388. WORD wNumDMAs; // Num DMA channels
  389. BYTE bDMALst[MAX_DMA_CHANNELS]; // DMA list
  390. WORD wDMAAttrib[MAX_DMA_CHANNELS]; // DMA Attrib list
  391. BYTE bReserved1[3]; // Reserved
  392. };
  393. typedef struct Config_Buff_s CMCONFIG; // Config buffer info
  394. #ifndef CMJUSTRESDES
  395. #define MAX_DEVICE_ID_LEN 200
  396. #include <vmmreg.h>
  397. /*XLATOFF*/
  398. #ifdef Not_VxD
  399. #include <dbt.h>
  400. #pragma warning(disable:4001) // Non-standard extensions
  401. #pragma warning(disable:4505) // Unreferenced local functions
  402. #ifdef IS_32
  403. #define CMFAR
  404. #else
  405. #define CMFAR _far
  406. #endif
  407. #else // Not_VxD
  408. #define CMFAR
  409. #endif // Not_VxD
  410. #ifdef IS_32
  411. typedef DWORD RETURN_TYPE;
  412. #else // IS_32
  413. typedef WORD RETURN_TYPE;
  414. #endif // IS_32
  415. #define CONFIGMG_Service Declare_Service
  416. /*XLATON*/
  417. /*MACROS*/
  418. Begin_Service_Table(CONFIGMG, VxD)
  419. CONFIGMG_Service (_CONFIGMG_Get_Version, VxD_CODE)
  420. CONFIGMG_Service (_CONFIGMG_Initialize, VxD_CODE)
  421. CONFIGMG_Service (_CONFIGMG_Locate_DevNode, VxD_CODE)
  422. CONFIGMG_Service (_CONFIGMG_Get_Parent, VxD_CODE)
  423. CONFIGMG_Service (_CONFIGMG_Get_Child, VxD_CODE)
  424. CONFIGMG_Service (_CONFIGMG_Get_Sibling, VxD_CODE)
  425. CONFIGMG_Service (_CONFIGMG_Get_Device_ID_Size, VxD_CODE)
  426. CONFIGMG_Service (_CONFIGMG_Get_Device_ID, VxD_CODE)
  427. CONFIGMG_Service (_CONFIGMG_Get_Depth, VxD_CODE)
  428. CONFIGMG_Service (_CONFIGMG_Get_Private_DWord, VxD_CODE)
  429. CONFIGMG_Service (_CONFIGMG_Set_Private_DWord, VxD_CODE)
  430. CONFIGMG_Service (_CONFIGMG_Create_DevNode, VxD_CODE)
  431. CONFIGMG_Service (_CONFIGMG_Query_Remove_SubTree, VxD_CODE)
  432. CONFIGMG_Service (_CONFIGMG_Remove_SubTree, VxD_CODE)
  433. CONFIGMG_Service (_CONFIGMG_Register_Device_Driver, VxD_CODE)
  434. CONFIGMG_Service (_CONFIGMG_Register_Enumerator, VxD_CODE)
  435. CONFIGMG_Service (_CONFIGMG_Register_Arbitrator, VxD_CODE)
  436. CONFIGMG_Service (_CONFIGMG_Deregister_Arbitrator, VxD_CODE)
  437. CONFIGMG_Service (_CONFIGMG_Query_Arbitrator_Free_Size, VxD_CODE)
  438. CONFIGMG_Service (_CONFIGMG_Query_Arbitrator_Free_Data, VxD_CODE)
  439. CONFIGMG_Service (_CONFIGMG_Sort_NodeList, VxD_CODE)
  440. CONFIGMG_Service (_CONFIGMG_Yield, VxD_CODE)
  441. CONFIGMG_Service (_CONFIGMG_Lock, VxD_CODE)
  442. CONFIGMG_Service (_CONFIGMG_Unlock, VxD_CODE)
  443. CONFIGMG_Service (_CONFIGMG_Add_Empty_Log_Conf, VxD_CODE)
  444. CONFIGMG_Service (_CONFIGMG_Free_Log_Conf, VxD_CODE)
  445. CONFIGMG_Service (_CONFIGMG_Get_First_Log_Conf, VxD_CODE)
  446. CONFIGMG_Service (_CONFIGMG_Get_Next_Log_Conf, VxD_CODE)
  447. CONFIGMG_Service (_CONFIGMG_Add_Res_Des, VxD_CODE)
  448. CONFIGMG_Service (_CONFIGMG_Modify_Res_Des, VxD_CODE)
  449. CONFIGMG_Service (_CONFIGMG_Free_Res_Des, VxD_CODE)
  450. CONFIGMG_Service (_CONFIGMG_Get_Next_Res_Des, VxD_CODE)
  451. CONFIGMG_Service (_CONFIGMG_Get_Performance_Info, VxD_CODE)
  452. CONFIGMG_Service (_CONFIGMG_Get_Res_Des_Data_Size, VxD_CODE)
  453. CONFIGMG_Service (_CONFIGMG_Get_Res_Des_Data, VxD_CODE)
  454. CONFIGMG_Service (_CONFIGMG_Process_Events_Now, VxD_CODE)
  455. CONFIGMG_Service (_CONFIGMG_Create_Range_List, VxD_CODE)
  456. CONFIGMG_Service (_CONFIGMG_Add_Range, VxD_CODE)
  457. CONFIGMG_Service (_CONFIGMG_Delete_Range, VxD_CODE)
  458. CONFIGMG_Service (_CONFIGMG_Test_Range_Available, VxD_CODE)
  459. CONFIGMG_Service (_CONFIGMG_Dup_Range_List, VxD_CODE)
  460. CONFIGMG_Service (_CONFIGMG_Free_Range_List, VxD_CODE)
  461. CONFIGMG_Service (_CONFIGMG_Invert_Range_List, VxD_CODE)
  462. CONFIGMG_Service (_CONFIGMG_Intersect_Range_List, VxD_CODE)
  463. CONFIGMG_Service (_CONFIGMG_First_Range, VxD_CODE)
  464. CONFIGMG_Service (_CONFIGMG_Next_Range, VxD_CODE)
  465. CONFIGMG_Service (_CONFIGMG_Dump_Range_List, VxD_CODE)
  466. CONFIGMG_Service (_CONFIGMG_Load_DLVxDs, VxD_CODE)
  467. CONFIGMG_Service (_CONFIGMG_Get_DDBs, VxD_CODE)
  468. CONFIGMG_Service (_CONFIGMG_Get_CRC_CheckSum, VxD_CODE)
  469. CONFIGMG_Service (_CONFIGMG_Register_DevLoader, VxD_CODE)
  470. CONFIGMG_Service (_CONFIGMG_Reenumerate_DevNode, VxD_CODE)
  471. CONFIGMG_Service (_CONFIGMG_Setup_DevNode, VxD_CODE)
  472. CONFIGMG_Service (_CONFIGMG_Reset_Children_Marks, VxD_CODE)
  473. CONFIGMG_Service (_CONFIGMG_Get_DevNode_Status, VxD_CODE)
  474. CONFIGMG_Service (_CONFIGMG_Remove_Unmarked_Children, VxD_CODE)
  475. CONFIGMG_Service (_CONFIGMG_ISAPNP_To_CM, VxD_CODE)
  476. CONFIGMG_Service (_CONFIGMG_CallBack_Device_Driver, VxD_CODE)
  477. CONFIGMG_Service (_CONFIGMG_CallBack_Enumerator, VxD_CODE)
  478. CONFIGMG_Service (_CONFIGMG_Get_Alloc_Log_Conf, VxD_CODE)
  479. CONFIGMG_Service (_CONFIGMG_Get_DevNode_Key_Size, VxD_CODE)
  480. CONFIGMG_Service (_CONFIGMG_Get_DevNode_Key, VxD_CODE)
  481. CONFIGMG_Service (_CONFIGMG_Read_Registry_Value, VxD_CODE)
  482. CONFIGMG_Service (_CONFIGMG_Write_Registry_Value, VxD_CODE)
  483. CONFIGMG_Service (_CONFIGMG_Disable_DevNode, VxD_CODE)
  484. CONFIGMG_Service (_CONFIGMG_Enable_DevNode, VxD_CODE)
  485. CONFIGMG_Service (_CONFIGMG_Move_DevNode, VxD_CODE)
  486. CONFIGMG_Service (_CONFIGMG_Set_Bus_Info, VxD_CODE)
  487. CONFIGMG_Service (_CONFIGMG_Get_Bus_Info, VxD_CODE)
  488. CONFIGMG_Service (_CONFIGMG_Set_HW_Prof, VxD_CODE)
  489. CONFIGMG_Service (_CONFIGMG_Recompute_HW_Prof, VxD_CODE)
  490. CONFIGMG_Service (_CONFIGMG_Query_Change_HW_Prof, VxD_CODE)
  491. CONFIGMG_Service (_CONFIGMG_Get_Device_Driver_Private_DWord, VxD_CODE)
  492. CONFIGMG_Service (_CONFIGMG_Set_Device_Driver_Private_DWord, VxD_CODE)
  493. CONFIGMG_Service (_CONFIGMG_Get_HW_Prof_Flags, VxD_CODE)
  494. CONFIGMG_Service (_CONFIGMG_Set_HW_Prof_Flags, VxD_CODE)
  495. CONFIGMG_Service (_CONFIGMG_Read_Registry_Log_Confs, VxD_CODE)
  496. CONFIGMG_Service (_CONFIGMG_Run_Detection, VxD_CODE)
  497. CONFIGMG_Service (_CONFIGMG_Call_At_Appy_Time, VxD_CODE)
  498. CONFIGMG_Service (_CONFIGMG_Fail_Change_HW_Prof, VxD_CODE)
  499. CONFIGMG_Service (_CONFIGMG_Set_Private_Problem, VxD_CODE)
  500. CONFIGMG_Service (_CONFIGMG_Debug_DevNode, VxD_CODE)
  501. CONFIGMG_Service (_CONFIGMG_Get_Hardware_Profile_Info, VxD_CODE)
  502. CONFIGMG_Service (_CONFIGMG_Register_Enumerator_Function, VxD_CODE)
  503. CONFIGMG_Service (_CONFIGMG_Call_Enumerator_Function, VxD_CODE)
  504. CONFIGMG_Service (_CONFIGMG_Add_ID, VxD_CODE)
  505. End_Service_Table(CONFIGMG, VxD)
  506. /*ENDMACROS*/
  507. /*XLATOFF*/
  508. #define NUM_CM_SERVICES ((WORD)(Num_CONFIGMG_Services & 0xFFFF))
  509. #define DEBUG_SERVICE_NAMES \
  510. char CMFAR *lpszServiceName[NUM_CM_SERVICES]= \
  511. { \
  512. "Get_Version", \
  513. "Initialize", \
  514. "Locate_DevNode", \
  515. "Get_Parent", \
  516. "Get_Child", \
  517. "Get_Sibling", \
  518. "Get_Device_ID_Size", \
  519. "Get_Device_ID", \
  520. "Get_Depth", \
  521. "Get_Private_DWord", \
  522. "Set_Private_DWord", \
  523. "Create_DevNode", \
  524. "Query_Remove_SubTree", \
  525. "Remove_SubTree", \
  526. "Register_Device_Driver", \
  527. "Register_Enumerator", \
  528. "Register_Arbitrator", \
  529. "Deregister_Arbitrator", \
  530. "Query_Arbitrator_Free_Size", \
  531. "Query_Arbitrator_Free_Data", \
  532. "Sort_NodeList", \
  533. "Yield", \
  534. "Lock", \
  535. "Unlock", \
  536. "Add_Empty_Log_Conf", \
  537. "Free_Log_Conf", \
  538. "Get_First_Log_Conf", \
  539. "Get_Next_Log_Conf", \
  540. "Add_Res_Des", \
  541. "Modify_Res_Des", \
  542. "Free_Res_Des", \
  543. "Get_Next_Res_Des", \
  544. "Get_Performance_Info", \
  545. "Get_Res_Des_Data_Size", \
  546. "Get_Res_Des_Data", \
  547. "Process_Events_Now", \
  548. "Create_Range_List", \
  549. "Add_Range", \
  550. "Delete_Range", \
  551. "Test_Range_Available", \
  552. "Dup_Range_List", \
  553. "Free_Range_List", \
  554. "Invert_Range_List", \
  555. "Intersect_Range_List", \
  556. "First_Range", \
  557. "Next_Range", \
  558. "Dump_Range_List", \
  559. "Load_DLVxDs", \
  560. "Get_DDBs", \
  561. "Get_CRC_CheckSum", \
  562. "Register_DevLoader", \
  563. "Reenumerate_DevNode", \
  564. "Setup_DevNode", \
  565. "Reset_Children_Marks", \
  566. "Get_DevNode_Status", \
  567. "Remove_Unmarked_Children", \
  568. "ISAPNP_To_CM", \
  569. "CallBack_Device_Driver", \
  570. "CallBack_Enumerator", \
  571. "Get_Alloc_Log_Conf", \
  572. "Get_DevNode_Key_Size", \
  573. "Get_DevNode_Key", \
  574. "Read_Registry_Value", \
  575. "Write_Registry_Value", \
  576. "Disable_DevNode", \
  577. "Enable_DevNode", \
  578. "Move_DevNode", \
  579. "Set_Bus_Info", \
  580. "Get_Bus_Info", \
  581. "Set_HW_Prof", \
  582. "Recompute_HW_Prof", \
  583. "Query_Change_HW_Prof", \
  584. "Get_Device_Driver_Private_DWord", \
  585. "Set_Device_Driver_Private_DWord", \
  586. "Get_HW_Prof_Flags", \
  587. "Set_HW_Prof_Flags", \
  588. "Read_Registry_Log_Confs", \
  589. "Run_Detection", \
  590. "Call_At_Appy_Time", \
  591. "Fail_Change_HW_Prof", \
  592. "Set_Private_Problem", \
  593. "Debug_DevNode", \
  594. "Get_Hardware_Profile_Info", \
  595. "Register_Enumerator_Function", \
  596. "Call_Enumerator_Function", \
  597. "Add_ID", \
  598. };
  599. /*XLATON*/
  600. /****************************************************************************
  601. *
  602. * GLOBALLY DEFINED TYPEDEFS
  603. *
  604. ***************************************************************************/
  605. typedef RETURN_TYPE CONFIGRET; // Standardized return value.
  606. typedef PPVMMDDB *PPPVMMDDB; // Too long to describe.
  607. typedef VOID CMFAR *PFARVOID; // Pointer to a VOID.
  608. typedef ULONG CMFAR *PFARULONG; // Pointer to a ULONG.
  609. typedef char CMFAR *PFARCHAR; // Pointer to a string.
  610. typedef VMMHKEY CMFAR *PFARHKEY; // Pointer to a HKEY.
  611. typedef char CMFAR *DEVNODEID; // Device ID ANSI name.
  612. typedef DWORD LOG_CONF; // Logical configuration.
  613. typedef LOG_CONF CMFAR *PLOG_CONF; // Pointer to logical configuration.
  614. typedef DWORD RES_DES; // Resource descriptor.
  615. typedef RES_DES CMFAR *PRES_DES; // Pointer to resource descriptor.
  616. typedef DWORD DEVNODE; // Devnode.
  617. typedef DEVNODE CMFAR *PDEVNODE; // Pointer to devnode.
  618. typedef DWORD NODELIST; // Pointer to a nodelist element.
  619. typedef DWORD NODELIST_HEADER;// Pointer to a nodelist header.
  620. typedef DWORD REGISTERID; // Arbitartor registration.
  621. typedef REGISTERID CMFAR *PREGISTERID; // Pointer to arbitartor registration.
  622. typedef ULONG RESOURCEID; // Resource type ID.
  623. typedef RESOURCEID CMFAR *PRESOURCEID; // Pointer to resource type ID.
  624. typedef ULONG PRIORITY; // Priority number.
  625. typedef DWORD RANGE_LIST; // Range list handle.
  626. typedef RANGE_LIST CMFAR *PRANGE_LIST; // Pointer to a range list handle.
  627. typedef DWORD RANGE_ELEMENT; // Range list element handle.
  628. typedef RANGE_ELEMENT CMFAR *PRANGE_ELEMENT;// Pointer to a range element handle.
  629. typedef DWORD LOAD_TYPE; // For the loading function.
  630. typedef CMCONFIG CMFAR *PCMCONFIG; // Pointer to a config buffer info.
  631. typedef DWORD CMBUSTYPE; // Type of the bus.
  632. typedef CMBUSTYPE CMFAR *PCMBUSTYPE; // Pointer to a bus type.
  633. typedef double VMM_TIME; // Time in microticks.
  634. #define LODWORD(x) ((DWORD)(x))
  635. #define HIDWORD(x) (*(PDWORD)(PDWORD(&x)+1))
  636. typedef ULONG CONFIGFUNC;
  637. typedef ULONG SUBCONFIGFUNC;
  638. typedef CONFIGRET (CMFAR _cdecl *CMCONFIGHANDLER)(CONFIGFUNC, SUBCONFIGFUNC, DEVNODE, ULONG, ULONG);
  639. typedef CONFIGRET (CMFAR _cdecl *CMENUMHANDLER)(CONFIGFUNC, SUBCONFIGFUNC, DEVNODE, DEVNODE, ULONG);
  640. typedef VOID (CMFAR _cdecl *CMAPPYCALLBACKHANDLER)(ULONG);
  641. typedef ULONG ENUMFUNC;
  642. typedef CONFIGRET (CMFAR _cdecl *CMENUMFUNCTION)(ENUMFUNC, ULONG, DEVNODE, PFARVOID, ULONG);
  643. typedef ULONG ARBFUNC;
  644. typedef CONFIGRET (CMFAR _cdecl *CMARBHANDLER)(ARBFUNC, ULONG, DEVNODE, NODELIST_HEADER);
  645. /****************************************************************************
  646. *
  647. * CONFIGURATION MANAGER BUS TYPE
  648. *
  649. ***************************************************************************/
  650. #define BusType_None 0x00000000
  651. #define BusType_ISA 0x00000001
  652. #define BusType_EISA 0x00000002
  653. #define BusType_PCI 0x00000004
  654. #define BusType_PCMCIA 0x00000008
  655. #define BusType_ISAPNP 0x00000010
  656. #define BusType_MCA 0x00000020
  657. /****************************************************************************
  658. *
  659. * CONFIGURATION MANAGER RETURN VALUES
  660. *
  661. ***************************************************************************/
  662. #define CR_SUCCESS 0x00000000
  663. #define CR_DEFAULT 0x00000001
  664. #define CR_OUT_OF_MEMORY 0x00000002
  665. #define CR_INVALID_POINTER 0x00000003
  666. #define CR_INVALID_FLAG 0x00000004
  667. #define CR_INVALID_DEVNODE 0x00000005
  668. #define CR_INVALID_RES_DES 0x00000006
  669. #define CR_INVALID_LOG_CONF 0x00000007
  670. #define CR_INVALID_ARBITRATOR 0x00000008
  671. #define CR_INVALID_NODELIST 0x00000009
  672. #define CR_DEVNODE_HAS_REQS 0x0000000A
  673. #define CR_INVALID_RESOURCEID 0x0000000B
  674. #define CR_DLVXD_NOT_FOUND 0x0000000C
  675. #define CR_NO_SUCH_DEVNODE 0x0000000D
  676. #define CR_NO_MORE_LOG_CONF 0x0000000E
  677. #define CR_NO_MORE_RES_DES 0x0000000F
  678. #define CR_ALREADY_SUCH_DEVNODE 0x00000010
  679. #define CR_INVALID_RANGE_LIST 0x00000011
  680. #define CR_INVALID_RANGE 0x00000012
  681. #define CR_FAILURE 0x00000013
  682. #define CR_NO_SUCH_LOGICAL_DEV 0x00000014
  683. #define CR_CREATE_BLOCKED 0x00000015
  684. #define CR_NOT_SYSTEM_VM 0x00000016
  685. #define CR_REMOVE_VETOED 0x00000017
  686. #define CR_APM_VETOED 0x00000018
  687. #define CR_INVALID_LOAD_TYPE 0x00000019
  688. #define CR_BUFFER_SMALL 0x0000001A
  689. #define CR_NO_ARBITRATOR 0x0000001B
  690. #define CR_NO_REGISTRY_HANDLE 0x0000001C
  691. #define CR_REGISTRY_ERROR 0x0000001D
  692. #define CR_INVALID_DEVICE_ID 0x0000001E
  693. #define CR_INVALID_DATA 0x0000001F
  694. #define CR_INVALID_API 0x00000020
  695. #define CR_DEVLOADER_NOT_READY 0x00000021
  696. #define CR_NEED_RESTART 0x00000022
  697. #define CR_INTERRUPTS_DISABLED 0x00000023
  698. #define CR_DEVICE_NOT_THERE 0x00000024
  699. #define CR_NO_SUCH_VALUE 0x00000025
  700. #define CR_WRONG_TYPE 0x00000026
  701. #define CR_INVALID_PRIORITY 0x00000027
  702. #define CR_NOT_DISABLEABLE 0x00000028
  703. #define CR_NO_MORE_HW_PROFILES 0x00000029
  704. #define NUM_CR_RESULTS 0x0000002A
  705. /*XLATOFF*/
  706. #define DEBUG_RETURN_CR_NAMES \
  707. char CMFAR *lpszReturnCRName[NUM_CR_RESULTS]= \
  708. { \
  709. "CR_SUCCESS", \
  710. "CR_DEFAULT", \
  711. "CR_OUT_OF_MEMORY", \
  712. "CR_INVALID_POINTER", \
  713. "CR_INVALID_FLAG", \
  714. "CR_INVALID_DEVNODE", \
  715. "CR_INVALID_RES_DES", \
  716. "CR_INVALID_LOG_CONF", \
  717. "CR_INVALID_ARBITRATOR", \
  718. "CR_INVALID_NODELIST", \
  719. "CR_DEVNODE_HAS_REQS", \
  720. "CR_INVALID_RESOURCEID", \
  721. "CR_DLVXD_NOT_FOUND", \
  722. "CR_NO_SUCH_DEVNODE", \
  723. "CR_NO_MORE_LOG_CONF", \
  724. "CR_NO_MORE_RES_DES", \
  725. "CR_ALREADY_SUCH_DEVNODE", \
  726. "CR_INVALID_RANGE_LIST", \
  727. "CR_INVALID_RANGE", \
  728. "CR_FAILURE", \
  729. "CR_NO_SUCH_LOGICAL_DEVICE", \
  730. "CR_CREATE_BLOCKED", \
  731. "CR_NOT_SYSTEM_VM", \
  732. "CR_REMOVE_VETOED", \
  733. "CR_APM_VETOED", \
  734. "CR_INVALID_LOAD_TYPE", \
  735. "CR_BUFFER_SMALL", \
  736. "CR_NO_ARBITRATOR", \
  737. "CR_NO_REGISTRY_HANDLE", \
  738. "CR_REGISTRY_ERROR", \
  739. "CR_INVALID_DEVICE_ID", \
  740. "CR_INVALID_DATA", \
  741. "CR_INVALID_API", \
  742. "CR_DEVLOADER_NOT_READY", \
  743. "CR_NEED_RESTART", \
  744. "CR_INTERRUPTS_DISABLED", \
  745. "CR_DEVICE_NOT_THERE", \
  746. "CR_NO_SUCH_VALUE", \
  747. "CR_WRONG_TYPE", \
  748. "CR_INVALID_PRIORITY", \
  749. "CR_NOT_DISABLEABLE", \
  750. "CR_NO_MORE_HW_PROFILES", \
  751. };
  752. /*XLATON*/
  753. #define CM_PROB_NOT_CONFIGURED 0x00000001
  754. #define CM_PROB_DEVLOADER_FAILED 0x00000002
  755. #define CM_PROB_OUT_OF_MEMORY 0x00000003
  756. #define CM_PROB_ENTRY_IS_WRONG_TYPE 0x00000004
  757. #define CM_PROB_LACKED_ARBITRATOR 0x00000005
  758. #define CM_PROB_BOOT_CONFIG_CONFLICT 0x00000006
  759. #define CM_PROB_FAILED_FILTER 0x00000007
  760. #define CM_PROB_DEVLOADER_NOT_FOUND 0x00000008
  761. #define CM_PROB_INVALID_DATA 0x00000009
  762. #define CM_PROB_FAILED_START 0x0000000A
  763. #define CM_PROB_LIAR 0x0000000B
  764. #define CM_PROB_NORMAL_CONFLICT 0x0000000C
  765. #define CM_PROB_NOT_VERIFIED 0x0000000D
  766. #define CM_PROB_NEED_RESTART 0x0000000E
  767. #define CM_PROB_REENUMERATION 0x0000000F
  768. #define CM_PROB_PARTIAL_LOG_CONF 0x00000010
  769. #define CM_PROB_UNKNOWN_RESOURCE 0x00000011
  770. #define CM_PROB_REINSTALL 0x00000012
  771. #define CM_PROB_REGISTRY 0x00000013
  772. #define CM_PROB_VXDLDR 0x00000014
  773. #define CM_PROB_WILL_BE_REMOVED 0x00000015
  774. #define CM_PROB_DISABLED 0x00000016
  775. #define CM_PROB_DEVLOADER_NOT_READY 0x00000017
  776. #define CM_PROB_DEVICE_NOT_THERE 0x00000018
  777. #define CM_PROB_MOVED 0x00000019
  778. #define CM_PROB_TOO_EARLY 0x0000001A
  779. #define CM_PROB_NO_VALID_LOG_CONF 0x0000001B
  780. #define NUM_CM_PROB 0x0000001C
  781. /*XLATOFF*/
  782. #define DEBUG_CM_PROB_NAMES \
  783. char CMFAR *lpszCMProbName[NUM_CM_PROB]= \
  784. { \
  785. "No Problem", \
  786. "No ConfigFlags (not configured)", \
  787. "Devloader failed", \
  788. "Run out of memory", \
  789. "Devloader/StaticVxD/Configured is of wrong type", \
  790. "Lacked an arbitrator", \
  791. "Boot config conflicted", \
  792. "Filtering failed", \
  793. "Devloader not found", \
  794. "Invalid data in registry", \
  795. "Device failed to start", \
  796. "Device failed something not failable", \
  797. "Was normal conflicting", \
  798. "Did not verified", \
  799. "Need restart", \
  800. "Is probably reenumeration", \
  801. "Was not fully detected", \
  802. "Resource number was not found", \
  803. "Reinstall", \
  804. "Registry returned unknown result", \
  805. "VxDLdr returned unknown result", \
  806. "Will be removed", \
  807. "Disabled", \
  808. "Devloader was not ready", \
  809. "Device not there", \
  810. "Was moved", \
  811. "Too early", \
  812. "No valid log conf", \
  813. };
  814. /*XLATON*/
  815. #define CM_INITIALIZE_VMM 0x00000000
  816. #define CM_INITIALIZE_VXDLDR 0x00000001
  817. #define CM_INITIALIZE_BITS 0x00000001
  818. #define CM_YIELD_NO_RESUME_EXEC 0x00000000
  819. #define CM_YIELD_RESUME_EXEC 0x00000001
  820. #define CM_YIELD_BITS 0x00000001
  821. #define CM_CREATE_DEVNODE_NORMAL 0x00000000
  822. #define CM_CREATE_DEVNODE_NO_WAIT_INSTALL 0x00000001
  823. #define CM_CREATE_DEVNODE_BITS 0x00000001
  824. #define CM_REGISTER_DEVICE_DRIVER_STATIC 0x00000000
  825. #define CM_REGISTER_DEVICE_DRIVER_DISABLEABLE 0x00000001
  826. #define CM_REGISTER_DEVICE_DRIVER_REMOVABLE 0x00000002
  827. #define CM_REGISTER_DEVICE_DRIVER_BITS 0x00000003
  828. #define CM_REGISTER_ENUMERATOR_SOFTWARE 0x00000000
  829. #define CM_REGISTER_ENUMERATOR_HARDWARE 0x00000001
  830. #define CM_REGISTER_ENUMERATOR_BITS 0x00000001
  831. #define CM_SETUP_DEVNODE_READY 0x00000000
  832. #define CM_SETUP_DOWNLOAD 0x00000001
  833. #define CM_SETUP_BITS 0x00000001
  834. #define CM_ADD_RANGE_ADDIFCONFLICT 0x00000000
  835. #define CM_ADD_RANGE_DONOTADDIFCONFLICT 0x00000001
  836. #define CM_ADD_RANGE_BITS 0x00000001
  837. #define CM_ISAPNP_ADD_RES_DES 0x00000000
  838. #define CM_ISAPNP_SETUP 0x00000001
  839. #define CM_ISAPNP_ADD_BOOT_RES_DES 0x00000002
  840. #define CM_ISAPNP_INVALID 0x00000003
  841. #define CM_ISAPNP_BITS 0x00000003
  842. #define CM_GET_PERFORMANCE_INFO_DATA 0x00000000
  843. #define CM_GET_PERFORMANCE_INFO_RESET 0x00000001
  844. #define CM_GET_PERFORMANCE_INFO_START 0x00000002
  845. #define CM_GET_PERFORMANCE_INFO_STOP 0x00000003
  846. #define CM_RESET_HIT_DATA 0x00000004
  847. #define CM_GET_HIT_DATA 0x00000005
  848. #define CM_GET_PERFORMANCE_INFO_BITS 0x0000000F
  849. #define CM_HIT_DATA_FILES 0xFFFF0000
  850. #define CM_HIT_DATA_SIZE ((256*8)+8) // magic number!
  851. #define CM_GET_ALLOC_LOG_CONF_ALLOC 0x00000000
  852. #define CM_GET_ALLOC_LOG_CONF_BOOT_ALLOC 0x00000001
  853. #define CM_GET_ALLOC_LOG_CONF_BITS 0x00000001
  854. #define CM_REGISTRY_HARDWARE 0x00000000 // Select hardware branch if NULL subkey
  855. #define CM_REGISTRY_SOFTWARE 0x00000001 // Select software branch if NULL subkey
  856. #define CM_REGISTRY_USER 0x00000100 // Use HKEY_CURRENT_USER
  857. #define CM_REGISTRY_CONFIG 0x00000200 // Use HKEY_CURRENT_CONFIG
  858. #define CM_REGISTRY_BITS 0x00000301 // The bits for the registry functions
  859. #define CM_DISABLE_POLITE 0x00000000 // Ask the driver
  860. #define CM_DISABLE_ABSOLUTE 0x00000001 // Don't ask the driver
  861. #define CM_DISABLE_BITS 0x00000001 // The bits for the disable function
  862. #define CM_HW_PROF_UNDOCK 0x00000000 // Computer not in a dock.
  863. #define CM_HW_PROF_DOCK 0x00000001 // Computer in a docking station
  864. #define CM_HW_PROF_RECOMPUTE_BITS 0x00000001 // RecomputeConfig
  865. #define CM_HW_PROF_DOCK_KNOWN 0x00000002 // Computer in a known docking station
  866. #define CM_HW_PROF_QUERY_CHANGE_BITS 0x00000003 // QueryChangeConfig
  867. #define CM_DETECT_NEW_PROFILE 0x00000001 // run detect for a new profile
  868. #define CM_DETECT_CRASHED 0x00000002 // detection crashed before
  869. #define CM_DETECT_HWPROF_FIRST_BOOT 0x00000004 // first boot in a new profile
  870. #define CM_DETECT_RUN 0x80000000 // run detection for new hardware
  871. #define CM_ADD_ID_HARDWARE 0x00000000
  872. #define CM_ADD_ID_COMPATIBLE 0x00000001
  873. #define CM_ADD_ID_BITS 0x00000001
  874. #define CM_REENUMERATE_NORMAL 0x00000000
  875. #define CM_REENUMERATE_SYNCHRONOUS 0x00000001
  876. #define CM_REENUMERATE_BITS 0x00000001
  877. /****************************************************************************
  878. *
  879. * CONFIGURATION MANAGER FUNCTIONS
  880. *
  881. ****************************************************************************
  882. *
  883. * Each devnode has a config handler field and a enum handler field
  884. * which are getting called every time Configuration Manager wants a
  885. * devnode to perform some configuration related function. The handler
  886. * is registered with CM_Register_Device_Driver or
  887. * CM_Register_Enumerator, depending if the handler is for the device
  888. * itself or for one of the children of the devnode.
  889. *
  890. * The registered handler is called with:
  891. *
  892. * result=dnToDevNode->dn_Config(if dnToDevNode==dnAboutDevNode)
  893. * result=dnToDevNode->dn_Enum(if dnToDevNode!=dnAboutDevNode)
  894. * ( FuncName,
  895. * SubFuncName,
  896. * dnToDevNode,
  897. * dnAboutDevNode, (if enum)
  898. * dwRefData, (if driver)
  899. * ulFlags);
  900. * Where:
  901. *
  902. * FuncName is one of CONFIG_FILTER, CONFIG_START, CONFIG_STOP,
  903. * CONFIG_TEST, CONFIG_REMOVE, CONFIG_ENUMERATE, CONFIG_SETUP or
  904. * CONFIG_CALLBACK.
  905. *
  906. * SubFuncName is the specific CONFIG_xxxx_* that further describe
  907. * we START, STOP or TEST.
  908. *
  909. * dnToDevNode is the devnode we are calling. This is given so that
  910. * a signle handler can handle multiple devnodes.
  911. *
  912. * dnAboutDevNode specifies which devnode the function is about. For
  913. * a config handler, this is necessarily the same as dnToDevNode. For
  914. * an enumerator handler, this devnode is necessarily different as it
  915. * is a child of the dnToDevNode (special case: CONFIG_ENUMERATE
  916. * necessarily has dnAboutDevNode==NULL). For instance, when starting
  917. * a COM devnode under a BIOS enumerator, we would make the following
  918. * two calls:
  919. *
  920. * To BIOS with (CONFIG_START, ?, BIOS, COM, ?, 0).
  921. *
  922. * To COM with (CONFIG_START, ?, COM, COM, ?, 0).
  923. *
  924. * dwRefData is a dword of reference data. For a config handler, it is
  925. * the DWORD passed on the CONFIGMG_Register_Device_Driver call. For an
  926. * enumerator, it is the same as CONFIGMG_Get_Private_DWord(?,
  927. * dnToDevNode, dnToDevNode, 0).
  928. *
  929. * ulFlags is 0 and is reserved for future extensions.
  930. *
  931. * Here is the explanation of each event, in parenthesis I put the
  932. * order the devnodes will be called:
  933. *
  934. * CONFIG_FILTER (BRANCH GOING UP) is the first thing called when a new
  935. * insertion or change of configuration need to be processed. First
  936. * CM copies the requirement list (BASIC_LOG_CONF) onto the filtered
  937. * requirement list (FILTER_LOG_CONF) so that they are originally
  938. * the same. CM then calls every node up, giving them the chance to
  939. * patch the requirement of the dnAboutDevNode (they can also
  940. * alter their own requirement). Examples are PCMCIA which would
  941. * remove some IRQ that the adapter can't do, prealloc some IO
  942. * windows and memory windows. ISA which would limit address space
  943. * to being <16Meg. A device driver should look only at
  944. * FILTER_LOG_CONF during this call.
  945. *
  946. * CONFIG_START (BRANCH GOING DOWN) are called to change the
  947. * configuration. A config handler/enumerator hander should look
  948. * only at the allocated list (ALLOC_LOG_CONF).
  949. *
  950. * CONFIG_STOP (WHOLE TREE BUT ONLY DEVNODES THAT CHANGE
  951. * CONFIGURATION (FOR EACH DEVNODE, BRANCH GOING UP)) is called
  952. * for two reasons:
  953. *
  954. * 1) Just after the rebalance algorithm came up with a
  955. * solution and we want to stop all devnodes that will be
  956. * rebalance. This is to avoid the problem of having two cards
  957. * that can respond to 110h and 220h and that need to toggle
  958. * their usage. We do not want two people responding to 220h,
  959. * even for a brief amount of time. This is the normal call
  960. * though.
  961. *
  962. * 2) There was a conflict and the user selected this device
  963. * to kill.
  964. *
  965. * CONFIG_TEST (WHOLE TREE) is called before starting the rebalance
  966. * algorithm. Device drivers that fail this call will be considered
  967. * worst than jumpered configured for the reminder of this balancing
  968. * process.
  969. *
  970. * CONFIG_REMOVE (FOR EACH SUB TREE NODE, DOING BRANCH GOING UP), is
  971. * called when someone notify CM via CM_Remove_SubTree that a devnode
  972. * is not needed anymore. A static VxD probably has nothing to do. A
  973. * dynamic VxD should check whether it should unload itself (return
  974. * CR_SUCCESS_UNLOAD) or not (CR_SUCCESS).
  975. *
  976. * Note, failing any of CONFIG_START, or CONFIG_STOP is really bad,
  977. * both in terms of performance and stability. Requirements for a
  978. * configuration to succeed should be noted/preallocated during
  979. * CONFIG_FILTER. Failing CONFIG_TEST is less bad as what basically
  980. * happens is that the devnode is considered worst than jumpered
  981. * configured for the reminder of this pass of the balancing algorithm.
  982. *
  983. * COMFIG_ENUMERATE, the called node should create children devnodes
  984. * using CM_Create_DevNode (but no need for grand children) and remove
  985. * children using CM_Remove_SubTree as appropriate. Config Manager
  986. * will recurse calling the children until nothing new appears. During
  987. * this call, dnAboutDevNode will be NULL. Note that there is an easy
  988. * way for buses which do not have direct children accessibility to
  989. * detect (ISAPNP for instance will isolate one board at a time and
  990. * there is no way to tell one specific board not to participate in
  991. * the isolation sequence):
  992. *
  993. * If some children have soft-eject capability, check those first.
  994. * If the user is pressing the eject button, call Query_Remove_SubTree
  995. * and if that succeed, call Remove_SubTree.
  996. *
  997. * Do a CM_Reset_Children_Marks on the bus devnode.
  998. *
  999. * Do the usual sequence doing CM_Create_DevNode calls. If a devnode
  1000. * was already there, CR_ALREADY_SUCH_DEVNODE is returned and this
  1001. * devnode's DN_HAS_MARK will be set. There is nothing more to do with
  1002. * this devnode has it should just continue running. If the devnode
  1003. * was not previously there, CR_SUCCESS will be return, in which case
  1004. * the enumerator should add the logical configurations.
  1005. *
  1006. * Once all the devnode got created. The enumerator can call
  1007. * CM_Remove_Unmarked_Children to remove the devnode that are now gone.
  1008. * Essentially, this is a for loop thru all the children of the bus
  1009. * devnode, doing Remove_SubTree on the the devnode which have their
  1010. * mark cleared. Alternatively, an enumerator can use CM_Get_Child,
  1011. * CM_Get_Sibling, CM_Remove_SubTree and CM_Get_DevNode_Status.
  1012. *
  1013. * For CONFIG_SETUP, the called node should install drivers if it
  1014. * know out to get them. This is mostly for drivers imbeded in the
  1015. * cards (ISA_RTR, PCI or PCMCIA). For most old cards/driver, this
  1016. * should return CR_NO_DRIVER.
  1017. *
  1018. * WARNING: For any non-defined service, the enumertor / device
  1019. * driver handler should return CR_DEFAULT. This will be treated
  1020. * as the compatibility case in future version.
  1021. *
  1022. * So normally what happens is as follows:
  1023. *
  1024. * - Some detection code realize there is a new device. This can be at
  1025. * initialization time or at run-time (usually during a media_change
  1026. * interrupt). The code does a CM_Reenumerate_DevNode(dnBusDevNode)
  1027. * asynchronous call.
  1028. *
  1029. * - During appy time event, CM gets notified.
  1030. *
  1031. * - CM calls the enumerator with:
  1032. *
  1033. * BusEnumHandler(CONFIG_ENUMERATE, 0, dnBusDevNode, NULL, ?, 0);
  1034. *
  1035. * - The parent uses CM_Create_DevNode and CM_Remove_SubTree as
  1036. * appropriate, usually for only its immediate children.
  1037. *
  1038. * - The parent return to CM from the enumerator call.
  1039. *
  1040. * - CM walks the children, first loading their device driver if
  1041. * needed, then calling their enumerators. Thus the whole process
  1042. * will terminate only when all grand-...-grand-children have stopped
  1043. * using CM_Create_DevNode.
  1044. *
  1045. * If rebalance is called (a new devnode is conflicting):
  1046. *
  1047. * - All devnode receives the CONFIG_TEST. Devnodes that
  1048. * fail it are considered worst than jumpered configured.
  1049. *
  1050. * - CM does the rebalance algorithm.
  1051. *
  1052. * - All affected devnodes that where previously loaded get the
  1053. * CONFIG_STOP event.
  1054. *
  1055. * - All affected devnode and the new devnodes receives a CONFIG_START.
  1056. *
  1057. * If rebalancing failed (couldn't make one or more devnodes work):
  1058. *
  1059. * - Device installer is called which will present the user with a
  1060. * choice of devnode to kill.
  1061. *
  1062. * - Those devnodes will received a CONFIG_STOP message.
  1063. *
  1064. ***************************************************************************/
  1065. // Possible CONFIGFUNC FuncNames:
  1066. #define CONFIG_FILTER 0x00000000 // Ancestors must filter requirements.
  1067. #define CONFIG_START 0x00000001 // Devnode dynamic initialization.
  1068. #define CONFIG_STOP 0x00000002 // Devnode must stop using config.
  1069. #define CONFIG_TEST 0x00000003 // Can devnode change state now.
  1070. #define CONFIG_REMOVE 0x00000004 // Devnode must stop using config.
  1071. #define CONFIG_ENUMERATE 0x00000005 // Devnode must enumerated.
  1072. #define CONFIG_SETUP 0x00000006 // Devnode should download driver.
  1073. #define CONFIG_CALLBACK 0x00000007 // Devnode is being called back.
  1074. #define CONFIG_APM 0x00000008 // APM functions.
  1075. #define CONFIG_TEST_FAILED 0x00000009 // Continue as before after a TEST.
  1076. #define CONFIG_TEST_SUCCEEDED 0x0000000A // Prepare for the STOP/REMOVE.
  1077. #define CONFIG_VERIFY_DEVICE 0x0000000B // Insure the legacy card is there.
  1078. #define CONFIG_PREREMOVE 0x0000000C // Devnode must stop using config.
  1079. #define CONFIG_SHUTDOWN 0x0000000D // We are shutting down.
  1080. #define CONFIG_PREREMOVE2 0x0000000E // Devnode must stop using config.
  1081. #define CONFIG_READY 0x0000000F // The devnode has been setup.
  1082. #define NUM_CONFIG_COMMANDS 0x00000010 // For DEBUG.
  1083. /*XLATOFF*/
  1084. #define DEBUG_CONFIG_NAMES \
  1085. char CMFAR *lpszConfigName[NUM_CONFIG_COMMANDS]= \
  1086. { \
  1087. "CONFIG_FILTER", \
  1088. "CONFIG_START", \
  1089. "CONFIG_STOP", \
  1090. "CONFIG_TEST", \
  1091. "CONFIG_REMOVE", \
  1092. "CONFIG_ENUMERATE", \
  1093. "CONFIG_SETUP", \
  1094. "CONFIG_CALLBACK", \
  1095. "CONFIG_APM", \
  1096. "CONFIG_TEST_FAILED", \
  1097. "CONFIG_TEST_SUCCEEDED", \
  1098. "CONFIG_VERIFY_DEVICE", \
  1099. "CONFIG_PREREMOVE", \
  1100. "CONFIG_SHUTDOWN", \
  1101. "CONFIG_PREREMOVE2", \
  1102. "CONFIG_READY", \
  1103. };
  1104. /*XLATON*/
  1105. // Possible SUBCONFIGFUNC SubFuncNames:
  1106. #define CONFIG_START_DYNAMIC_START 0x00000000
  1107. #define CONFIG_START_FIRST_START 0x00000001
  1108. #define CONFIG_STOP_DYNAMIC_STOP 0x00000000
  1109. #define CONFIG_STOP_HAS_PROBLEM 0x00000001
  1110. //
  1111. // For both CONFIG_REMOVE and CONFIG_POSTREMOVE
  1112. //
  1113. #define CONFIG_REMOVE_DYNAMIC 0x00000000
  1114. #define CONFIG_REMOVE_SHUTDOWN 0x00000001
  1115. #define CONFIG_REMOVE_REBOOT 0x00000002
  1116. #define CONFIG_TEST_CAN_STOP 0x00000000
  1117. #define CONFIG_TEST_CAN_REMOVE 0x00000001
  1118. #define CONFIG_APM_TEST_STANDBY 0x00000000
  1119. #define CONFIG_APM_TEST_SUSPEND 0x00000001
  1120. #define CONFIG_APM_TEST_STANDBY_FAILED 0x00000002
  1121. #define CONFIG_APM_TEST_SUSPEND_FAILED 0x00000003
  1122. #define CONFIG_APM_TEST_STANDBY_SUCCEEDED 0x00000004
  1123. #define CONFIG_APM_TEST_SUSPEND_SUCCEEDED 0x00000005
  1124. #define CONFIG_APM_RESUME_STANDBY 0x00000006
  1125. #define CONFIG_APM_RESUME_SUSPEND 0x00000007
  1126. #define CONFIG_APM_RESUME_CRITICAL 0x00000008
  1127. #define CONFIG_APM_UI_ALLOWED 0x80000000
  1128. /****************************************************************************
  1129. *
  1130. * ARBITRATOR FUNCTIONS
  1131. *
  1132. ****************************************************************************
  1133. *
  1134. * Each arbitrator has a handler field which is getting called every
  1135. * time Configuration Manager wants it to perform a function. The
  1136. * handler is called with:
  1137. *
  1138. * result=paArbitrator->Arbitrate( EventName,
  1139. * paArbitrator->DWordToBePassed,
  1140. * paArbitrator->dnItsDevNode,
  1141. * pnlhNodeListHeader);
  1142. *
  1143. * ENTRY: NodeListHeader contains a logical configuration for all
  1144. * devices the configuration manager would like to reconfigure.
  1145. * DWordToBePassed is the arbitrator reference data.
  1146. * ItsDevNode is the pointer to arbitrator's devnode.
  1147. * EventName is one of the following:
  1148. *
  1149. * ARB_TEST_ALLOC - Test allocation of resource
  1150. *
  1151. * DESC: The arbitration routine will attempt to satisfy all
  1152. * allocation requests contained in the nodelist for its
  1153. * resource. See individual arbitrator for the algorithm
  1154. * employed. Generally, the arbitration consists
  1155. * of sorting the list according to most likely succesful
  1156. * allocation order, making a copy of the current allocation
  1157. * data strucuture(s), releasing all resource currently
  1158. * allocated to devnodes on the list from the copy data structure
  1159. * and then attempting to satisfy allocation requests
  1160. * by passing through the entire list, trying all possible
  1161. * combinations of allocations before failing. The arbitrator
  1162. * saves the resultant successful allocations, both in the node
  1163. * list per device and the copy of the allocation data structure.
  1164. * The configuration manager is expected to subsequently call
  1165. * either ARB_SET_ALLOC or ARB_RELEASE_ALLOC.
  1166. *
  1167. * EXIT: CR_SUCCESS if successful allocation
  1168. * CR_FAILURE if unsuccessful allocation
  1169. * CR_OUT_OF_MEMORY if not enough memory.
  1170. *
  1171. * ARB_RETEST_ALLOC - Retest allocation of resource
  1172. *
  1173. * DESC: The arbitration routine will attempt to satisfy all
  1174. * allocation requests contained in the nodelist for its
  1175. * resource. It will take the result of a previous TEST_ALLOC
  1176. * and attempt to allocate that resource for each allcoation in
  1177. * the list. It will not sort the node list. It will make a copy
  1178. * of the current allocation data strucuture(s), release all
  1179. * resource currently allocated to devnodes on the list from
  1180. * the copy data structure and then attempt to satisfy the
  1181. * allocations from the previous TEST_ALLOC. The arbitrator
  1182. * saves the resultant copy of the allocation data structure.
  1183. * The configuration manager is expected to subsequently call
  1184. * either ARB_SET_ALLOC or ARB_RELEASE_ALLOC.
  1185. *
  1186. * EXIT: CR_SUCCESS if successful allocation
  1187. * CR_FAILURE if unsuccessful allocation
  1188. * CR_OUT_OF_MEMORY if not enough memory.
  1189. *
  1190. * ARB_FORCE_ALLOC - Retest allocation of resource, always succeed
  1191. *
  1192. * DESC: The arbitration routine will satisfy all
  1193. * allocation requests contained in the nodelist for its
  1194. * resource. It will take the result of a previous TEST_ALLOC
  1195. * and allocate that resource for each allocation in
  1196. * the list. It will not sort the node list. It will make a copy
  1197. * of the current allocation data strucuture(s), release all
  1198. * resource currently allocated to devnodes on the list from
  1199. * the copy data structure and then satisfy the
  1200. * allocations from the previous TEST_ALLOC. The arbitrator
  1201. * saves the resultant copy of the allocation data structure.
  1202. * The configuration manager is expected to subsequently call
  1203. * either ARB_SET_ALLOC or ARB_RELEASE_ALLOC.
  1204. *
  1205. * EXIT: CR_SUCCESS if successful allocation
  1206. * CR_OUT_OF_MEMORY if not enough memory.
  1207. *
  1208. * ARB_SET_ALLOC - Makes a test allocation the real allocation
  1209. *
  1210. * DESC: Makes the copy of the allocation data structure the
  1211. * current valid allocation.
  1212. *
  1213. * EXIT: CR_SUCCESS
  1214. *
  1215. * ARB_RELEASE_ALLOC - Clean up after failed test allocation
  1216. *
  1217. * DESC: Free all allocation that were allocated by the previous
  1218. * ARB_TEST_ALLOC.
  1219. *
  1220. * EXIT: CR_SUCCESS
  1221. *
  1222. * ARB_QUERY_FREE - Add all free resource logical configuration
  1223. *
  1224. * DESC: Return resource specific data on the free element. Note
  1225. * than the pnlhNodeListHeader is a cast of an arbitfree_s.
  1226. *
  1227. * EXIT: CR_SUCCESS if successful
  1228. * CR_FAILURE if the request makles no sense.
  1229. * CR_OUT_OF_MEMORY if not enough memory.
  1230. *
  1231. * ARB_REMOVE - The devnode the arbitrator registered with is going away
  1232. *
  1233. * DESC: Arbitrator registered with a non-NULL devnode (thus is
  1234. * normally local), and the devnode is being removed. Arbitrator
  1235. * should do appropriate cleanup.
  1236. *
  1237. * EXIT: CR_SUCCESS
  1238. *
  1239. * WARNING: For any non-defined service, the arbitrator should return
  1240. * CR_DEFAULT. This will be treated as the compatibility case in future
  1241. * version.
  1242. *
  1243. ***************************************************************************/
  1244. #define ARB_TEST_ALLOC 0x00000000 // Check if can make alloc works.
  1245. #define ARB_RETEST_ALLOC 0x00000001 // Check if can take previous alloc.
  1246. #define ARB_SET_ALLOC 0x00000002 // Set the tested allocation.
  1247. #define ARB_RELEASE_ALLOC 0x00000003 // Release the tested allocation.
  1248. #define ARB_QUERY_FREE 0x00000004 // Return free resource.
  1249. #define ARB_REMOVE 0x00000005 // DevNode is gone.
  1250. #define ARB_FORCE_ALLOC 0x00000006 // Force previous TEST_ALLOC
  1251. #define NUM_ARB_COMMANDS 0x00000007 // Number of arb commands
  1252. #define DEBUG_ARB_NAMES \
  1253. char CMFAR *lpszArbFuncName[NUM_ARB_COMMANDS]= \
  1254. { \
  1255. "ARB_TEST_ALLOC",\
  1256. "ARB_RETEST_ALLOC",\
  1257. "ARB_SET_ALLOC",\
  1258. "ARB_RELEASE_ALLOC",\
  1259. "ARB_QUERY_FREE",\
  1260. "ARB_REMOVE",\
  1261. "ARB_FORCE_ALLOC",\
  1262. };
  1263. /****************************************************************************
  1264. *
  1265. * DEVNODE STATUS
  1266. *
  1267. ****************************************************************************
  1268. *
  1269. * These are the bits in the devnode's status that someone can query
  1270. * with a CM_Get_DevNode_Status. The A/S column tells wheter the flag
  1271. * cann be change asynchronously or not.
  1272. *
  1273. ***************************************************************************/
  1274. #define DN_ROOT_ENUMERATED 0x00000001 // S: Was enumerated by ROOT
  1275. #define DN_DRIVER_LOADED 0x00000002 // S: Has Register_Device_Driver
  1276. #define DN_ENUM_LOADED 0x00000004 // S: Has Register_Enumerator
  1277. #define DN_STARTED 0x00000008 // S: Is currently configured
  1278. #define DN_MANUAL 0x00000010 // S: Manually installed
  1279. #define DN_NEED_TO_ENUM 0x00000020 // A: May need reenumeration
  1280. #define DN_NOT_FIRST_TIME 0x00000040 // S: Has received a config
  1281. #define DN_HARDWARE_ENUM 0x00000080 // S: Enum generates hardware ID
  1282. #define DN_LIAR 0x00000100 // S: Lied about can reconfig once
  1283. #define DN_HAS_MARK 0x00000200 // S: Not CM_Create_DevNode lately
  1284. #define DN_HAS_PROBLEM 0x00000400 // S: Need device installer
  1285. #define DN_FILTERED 0x00000800 // S: Is filtered
  1286. #define DN_MOVED 0x00001000 // S: Has been moved
  1287. #define DN_DISABLEABLE 0x00002000 // S: Can be rebalanced
  1288. #define DN_REMOVABLE 0x00004000 // S: Can be removed
  1289. #define DN_PRIVATE_PROBLEM 0x00008000 // S: Has a private problem
  1290. #define DN_MF_PARENT 0x00010000 // S: Multi function parent
  1291. #define DN_MF_CHILD 0x00020000 // S: Multi function child
  1292. #define DN_WILL_BE_REMOVED 0x00040000 // S: Devnode is being removed
  1293. /*XLATOFF*/
  1294. #define NUM_DN_FLAG 0x00000013 // DEBUG: maximum flag (number)
  1295. #define DN_FLAG_LEN 0x00000002 // DEBUG: flag length
  1296. #define DEBUG_DN_FLAGS_NAMES \
  1297. char CMFAR lpszDNFlagsName[NUM_DN_FLAG][DN_FLAG_LEN]= \
  1298. { \
  1299. "rt", \
  1300. "dl", \
  1301. "el", \
  1302. "st", \
  1303. "mn", \
  1304. "ne", \
  1305. "fs", \
  1306. "hw", \
  1307. "lr", \
  1308. "mk", \
  1309. "pb", \
  1310. "ft", \
  1311. "mv", \
  1312. "db", \
  1313. "rb", \
  1314. "pp", \
  1315. "mp", \
  1316. "mc", \
  1317. "rm", \
  1318. };
  1319. struct vmmtime_s {
  1320. DWORD vmmtime_lo;
  1321. DWORD vmmtime_hi;
  1322. };
  1323. typedef struct vmmtime_s VMMTIME;
  1324. typedef VMMTIME *PVMMTIME;
  1325. struct cmtime_s {
  1326. DWORD dwAPICount;
  1327. VMMTIME vtAPITime;
  1328. };
  1329. typedef struct cmtime_s CMTIME;
  1330. typedef CMTIME *PCMTIME;
  1331. struct cm_performance_info_s {
  1332. CMTIME ctBoot;
  1333. CMTIME ctAPI[NUM_CM_SERVICES];
  1334. CMTIME ctRing3;
  1335. CMTIME ctProcessTree;
  1336. CMTIME ctAssignResources;
  1337. CMTIME ctSort;
  1338. CMTIME ctRegistry;
  1339. CMTIME ctVxDLdr;
  1340. CMTIME ctNewDevNode;
  1341. CMTIME ctSendMessage;
  1342. CMTIME ctShell;
  1343. CMTIME ctReceiveMessage;
  1344. CMTIME ctAppyTime;
  1345. CMTIME ctConfigMessage[NUM_CONFIG_COMMANDS];
  1346. CMTIME ctArbTime[ResType_Max+1][NUM_ARB_COMMANDS];
  1347. DWORD dwStackSize;
  1348. DWORD dwMaxProcessTreePasses;
  1349. DWORD dwStackAlloc;
  1350. };
  1351. typedef struct cm_performance_info_s CMPERFINFO;
  1352. typedef CMPERFINFO CMFAR *PCMPERFINFO;
  1353. /*XLATON*/
  1354. /****************************************************************************
  1355. *
  1356. * DLVXD FUNCTIONS
  1357. *
  1358. ****************************************************************************
  1359. *
  1360. * We load a Dynamically loaded VxD when there is a DEVLOADER=... line
  1361. * in the registry, or when someone calls CM_Load_Device. We then do
  1362. * a direct system control call (PNP_NEW_DEVNODE) to it, telling the
  1363. * DLVXD whether we loaded it to be an enumerator, a driver or a
  1364. * devloader (config manager does only deal with devloaders, but the
  1365. * default devloaders does CM_Load_Device with DLVXD_LOAD_ENUMERATOR
  1366. * and DLVXD_LOAD_DRIVER).
  1367. *
  1368. ***************************************************************************/
  1369. #define DLVXD_LOAD_ENUMERATOR 0x00000000 // We loaded DLVxD as an enumerator.
  1370. #define DLVXD_LOAD_DEVLOADER 0x00000001 // We loaded DLVxD as a devloader.
  1371. #define DLVXD_LOAD_DRIVER 0x00000002 // We loaded DLVxD as a device driver.
  1372. #define NUM_DLVXD_LOAD_TYPE 0x00000003 // Number of DLVxD load type.
  1373. /****************************************************************************
  1374. *
  1375. * GLOBALLY DEFINED FLAGS
  1376. *
  1377. ***************************************************************************/
  1378. #define ARB_GLOBAL 0x00000001 // Arbitrator is global.
  1379. #define ARB_LOCAL 0x00000000 // Arbitrator is local.
  1380. #define ARB_SCOPE_BIT 0x00000001 // Arbitrator is global/local bit.
  1381. #define BASIC_LOG_CONF 0x00000000 // Specifies the req list.
  1382. #define FILTERED_LOG_CONF 0x00000001 // Specifies the filtered req list.
  1383. #define ALLOC_LOG_CONF 0x00000002 // Specifies the Alloc Element.
  1384. #define BOOT_LOG_CONF 0x00000003 // Specifies the RM Alloc Element.
  1385. #define FORCED_LOG_CONF 0x00000004 // Specifies the Forced Log Conf
  1386. #define NUM_LOG_CONF 0x00000005 // Number of Log Conf type
  1387. #define LOG_CONF_BITS 0x00000007 // The bits of the log conf type.
  1388. #define DEBUG_LOG_CONF_NAMES \
  1389. char CMFAR *lpszLogConfName[NUM_LOG_CONF]= \
  1390. { \
  1391. "BASIC_LOG_CONF",\
  1392. "FILTERED_LOG_CONF",\
  1393. "ALLOC_LOG_CONF",\
  1394. "BOOT_LOG_CONF",\
  1395. "FORCED_LOG_CONF",\
  1396. };
  1397. #define PRIORITY_EQUAL_FIRST 0x00000008 // Same priority, new one is first.
  1398. #define PRIORITY_EQUAL_LAST 0x00000000 // Same priority, new one is last.
  1399. #define PRIORITY_BIT 0x00000008 // The bit of priority.
  1400. #ifndef Not_VxD
  1401. /****************************************************************************
  1402. *
  1403. * Arbitration list structures
  1404. *
  1405. ***************************************************************************/
  1406. struct nodelist_s {
  1407. struct nodelist_s *nl_Next; // Next node element
  1408. struct nodelist_s *nl_Previous; // Previous node element
  1409. struct devnode_s *nl_ItsDevNode; // The dev node it represent
  1410. // You can add fields to this structure, but the first three
  1411. // fields must NEVER be changed.
  1412. struct Log_Conf *nl_Test_Req; // Test resource alloc request
  1413. ULONG nl_ulSortDWord; // Specifies the sort order
  1414. };
  1415. struct nodelistheader_s {
  1416. struct nodelist_s *nlh_Head; // First node element
  1417. struct nodelist_s *nlh_Tail; // Last node element
  1418. };
  1419. struct arbitfree_s {
  1420. PVOID *af_PointerToInfo; // the arbitrator info
  1421. ULONG af_SizeOfInfo; // size of the info
  1422. };
  1423. #endif
  1424. /****************************************************************************
  1425. * ARB_QUERY_FREE arbitrator function for memory returns a Range List (see
  1426. * configuration manager for APIs to use with Range Lists). The values
  1427. * in the Range List are ranges of taken memory address space.
  1428. */
  1429. struct MEM_Arb_s {
  1430. RANGE_LIST MEMA_Alloc;
  1431. };
  1432. typedef struct MEM_Arb_s MEMA_ARB;
  1433. /****************************************************************************
  1434. * ARB_QUERY_FREE arbitrator function for IO returns a Range List (see
  1435. * configuration manager for APIs to use with Range Lists). The values
  1436. * in the Range List are ranges of taken IO address space.
  1437. */
  1438. struct IO_Arb_s {
  1439. RANGE_LIST IOA_Alloc;
  1440. };
  1441. typedef struct IO_Arb_s IOA_ARB;
  1442. /****************************************************************************
  1443. * ARB_QUERY_FREE arbitrator function for DMA returns the DMA_Arb_s,
  1444. * 16 bits of allocation bit mask, where DMAA_Alloc is inverted
  1445. * (set bit indicates free port).
  1446. */
  1447. struct DMA_Arb_s {
  1448. WORD DMAA_Alloc;
  1449. };
  1450. typedef struct DMA_Arb_s DMA_ARB;
  1451. /***************************************************************************
  1452. * ARB_QUERY_FREE arbitrator function for IRQ returns the IRQ_Arb_s,
  1453. * 16 bits of allocation bit mask, 16 bits of share bit mask and 16
  1454. * BYTES of share count. IRQA_Alloc is inverted (bit set indicates free
  1455. * port). If port is not free, IRQA_Share bit set indicates port
  1456. * that is shareable. For shareable IRQs, IRQA_Share_Count indicates
  1457. * number of devices that are sharing an IRQ.
  1458. */
  1459. struct IRQ_Arb_s {
  1460. WORD IRQA_Alloc;
  1461. WORD IRQA_Share;
  1462. BYTE IRQA_Share_Count[16];
  1463. };
  1464. typedef struct IRQ_Arb_s IRQ_ARB;
  1465. /* ASM
  1466. DebugCommand Macro FuncName
  1467. local DC_01
  1468. ifndef CM_GOLDEN_RETAIL
  1469. ifdef retail
  1470. IsDebugOnlyLoaded DC_01
  1471. endif
  1472. Control_Dispatch DEBUG_QUERY, FuncName, sCall
  1473. endif
  1474. DC_01:
  1475. endm
  1476. IFDEF CM_PERFORMANCE_INFO
  1477. CM_PAGEABLE_CODE_SEG TEXTEQU <VxD_LOCKED_CODE_SEG>
  1478. CM_PAGEABLE_CODE_ENDS TEXTEQU <VxD_LOCKED_CODE_ENDS>
  1479. CM_PAGEABLE_DATA_SEG TEXTEQU <VxD_LOCKED_DATA_SEG>
  1480. CM_PAGEABLE_DATA_ENDS TEXTEQU <VxD_LOCKED_DATA_ENDS>
  1481. ELSE
  1482. CM_PAGEABLE_CODE_SEG TEXTEQU <VxD_PNP_CODE_SEG>
  1483. CM_PAGEABLE_CODE_ENDS TEXTEQU <VxD_PNP_CODE_ENDS>
  1484. CM_PAGEABLE_DATA_SEG TEXTEQU <VxD_PAGEABLE_DATA_SEG>
  1485. CM_PAGEABLE_DATA_ENDS TEXTEQU <VxD_PAGEABLE_DATA_ENDS>
  1486. ENDIF
  1487. */
  1488. struct CM_API_s {
  1489. DWORD pCMAPIStack;
  1490. DWORD dwCMAPIService;
  1491. DWORD dwCMAPIRet;
  1492. };
  1493. typedef struct CM_API_s CMAPI;
  1494. /*XLATOFF*/
  1495. #define CM_VXD_RESULT int
  1496. #define CM_EXTERNAL _cdecl
  1497. #define CM_HANDLER _cdecl
  1498. #define CM_SYSCTRL _stdcall
  1499. #define CM_GLOBAL_DATA
  1500. #define CM_LOCAL_DATA static
  1501. #define CM_OFFSET_OF(type, id) ((DWORD)(&(((type)0)->id)))
  1502. #define CM_BUUGBUUG(d, id, msg) message("BUUGBUUG: "##d##", "##id##": "##msg)
  1503. #if DEBLEVEL==DEBLEVELRETAIL
  1504. #define CM_WARN(strings)
  1505. #define CM_ERROR(strings)
  1506. #else
  1507. #if DEBLEVEL==DEBLEVELNORMAL
  1508. #define CM_WARN(strings)
  1509. #define CM_ERROR(strings) {\
  1510. _Debug_Printf_Service(WARNNAME " ERROR: "); \
  1511. _Debug_Printf_Service##strings; \
  1512. _Debug_Printf_Service("\n");}
  1513. #else
  1514. #define CM_WARN(strings) {\
  1515. _Debug_Printf_Service(WARNNAME " WARNS: "); \
  1516. _Debug_Printf_Service##strings; \
  1517. _Debug_Printf_Service("\n");}
  1518. #define CM_ERROR(strings) {\
  1519. _Debug_Printf_Service(WARNNAME " ERROR: "); \
  1520. _Debug_Printf_Service##strings; \
  1521. _Debug_Printf_Service("\n"); \
  1522. {_asm int 3}}
  1523. #endif
  1524. #endif
  1525. #ifdef DEBUG
  1526. #define CM_DEBUG_CODE VxD_LOCKED_CODE_SEG
  1527. #define CM_DEBUG_DATA VxD_LOCKED_DATA_SEG
  1528. #else
  1529. #define CM_DEBUG_CODE VxD_DEBUG_ONLY_CODE_SEG
  1530. #define CM_DEBUG_DATA VxD_DEBUG_ONLY_DATA_SEG
  1531. #endif
  1532. #ifdef CM_PERFORMANCE_INFO
  1533. #define CM_PAGEABLE_CODE VxD_LOCKED_CODE_SEG
  1534. #define CM_PAGEABLE_DATA VxD_LOCKED_DATA_SEG
  1535. #define CM_INIT_CODE VxD_INIT_CODE_SEG
  1536. #define CM_INIT_DATA VxD_INIT_DATA_SEG
  1537. #define CURSEG() LCODE
  1538. #else
  1539. #define CM_PAGEABLE_CODE VxD_PNP_CODE_SEG
  1540. #define CM_PAGEABLE_DATA VxD_PAGEABLE_DATA_SEG
  1541. #define CM_INIT_CODE VxD_INIT_CODE_SEG
  1542. #define CM_INIT_DATA VxD_INIT_DATA_SEG
  1543. #pragma warning (disable:4005) // turn off redefinition
  1544. #define CURSEG() CCODE
  1545. #pragma warning (default:4005) // turn on redefinition
  1546. #endif
  1547. #ifndef MAX_PROFILE_LEN
  1548. #define MAX_PROFILE_LEN 80
  1549. #endif
  1550. struct HWProfileInfo_s {
  1551. ULONG HWPI_ulHWProfile; // the profile handle
  1552. char HWPI_szFriendlyName[MAX_PROFILE_LEN]; // the friendly name
  1553. DWORD HWPI_dwFlags; // CM_HWPI_* flags
  1554. };
  1555. typedef struct HWProfileInfo_s HWPROFILEINFO;
  1556. typedef struct HWProfileInfo_s *PHWPROFILEINFO;
  1557. typedef struct HWProfileInfo_s CMFAR *PFARHWPROFILEINFO;
  1558. #define CM_HWPI_NOT_DOCKABLE 0x00000000
  1559. #define CM_HWPI_UNDOCKED 0x00000001
  1560. #define CM_HWPI_DOCKED 0x00000002
  1561. #ifdef DEBUG
  1562. #define CM_INTERNAL _cdecl
  1563. #else
  1564. #define CM_INTERNAL _fastcall
  1565. #endif
  1566. #define CM_NAKED __declspec ( naked )
  1567. #define CM_LOCAL CM_INTERNAL
  1568. #define CM_UNIQUE static CM_INTERNAL
  1569. #define CM_BEGIN_CRITICAL {\
  1570. _asm pushfd \
  1571. _asm cli \
  1572. }
  1573. #define CM_END_CRITICAL \
  1574. _asm popfd\
  1575. #define CM_FOREVER for (;;)
  1576. #ifndef No_CM_Calls
  1577. #ifdef Not_VxD
  1578. /****************************************************************************
  1579. *
  1580. * CONFIGMG_Get_Entry_Point - Return the address to call to get in
  1581. * Config Manager.
  1582. *
  1583. * Exported.
  1584. *
  1585. * ENTRY: None.
  1586. *
  1587. * EXIT: None.
  1588. *
  1589. * On return, the variable CMEntryPoint has been updated with the
  1590. * proper address to call to get to Configuration Manager.
  1591. *
  1592. ***************************************************************************/
  1593. DWORD static
  1594. CM_Get_Entry_Point(void)
  1595. {
  1596. static DWORD CMEntryPoint=NULL;
  1597. if (CMEntryPoint)
  1598. return(CMEntryPoint);
  1599. _asm push bx
  1600. _asm push es
  1601. _asm push di
  1602. _asm xor di, di
  1603. _asm mov ax, 0x1684
  1604. _asm mov bx, 0x33
  1605. _asm mov es, di
  1606. _asm int 0x2f
  1607. _asm mov word ptr [CMEntryPoint+2], es
  1608. _asm mov word ptr [CMEntryPoint], di
  1609. _asm pop di
  1610. _asm pop es
  1611. _asm pop bx
  1612. return(CMEntryPoint);
  1613. }
  1614. #define MAKE_CM_HEADER(Function, Parameters) \
  1615. CONFIGRET static _near _cdecl \
  1616. CM_##Function##Parameters \
  1617. { \
  1618. CONFIGRET CMRetValue=0; \
  1619. DWORD CMEntryPoint; \
  1620. WORD wCMAPIService=GetVxDServiceOrdinal(_CONFIGMG_##Function); \
  1621. if ((CMEntryPoint=CM_Get_Entry_Point())==0) \
  1622. return(0); \
  1623. _asm {mov ax, wCMAPIService};\
  1624. _asm {call CMEntryPoint}; \
  1625. _asm {mov CMRetValue, ax};\
  1626. return(CMRetValue); \
  1627. }
  1628. #else // Not_VxD
  1629. #define MAKE_CM_HEADER(Function, Parameters) \
  1630. MAKE_HEADER(CONFIGRET, _cdecl, CAT(_CONFIGMG_, Function), Parameters)
  1631. #endif // Not_VxD
  1632. /****************************************************************************
  1633. *
  1634. * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
  1635. *
  1636. * Each of the following functions must match their equivalent service
  1637. * and the parameter table in dos386\vmm\configmg\services.*.
  1638. *
  1639. * Except for the Get_Version, each function return a CR_* result in EAX
  1640. * (AX for non IS_32 app) and can trash ECX and/or EDX as they are 'C'
  1641. * callable.
  1642. *
  1643. * WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
  1644. *
  1645. ***************************************************************************/
  1646. #pragma warning (disable:4100) // Param not used
  1647. #ifdef Not_VxD
  1648. MAKE_CM_HEADER(Get_Version, (VOID))
  1649. #else
  1650. WORD VXDINLINE
  1651. CONFIGMG_Get_Version(VOID)
  1652. {
  1653. WORD w;
  1654. VxDCall(_CONFIGMG_Get_Version);
  1655. _asm mov [w], ax
  1656. return(w);
  1657. }
  1658. #endif
  1659. MAKE_CM_HEADER(Initialize, (ULONG ulFlags))
  1660. MAKE_CM_HEADER(Locate_DevNode, (PDEVNODE pdnDevNode, DEVNODEID pDeviceID, ULONG ulFlags))
  1661. MAKE_CM_HEADER(Get_Parent, (PDEVNODE pdnDevNode, DEVNODE dnDevNode, ULONG ulFlags))
  1662. MAKE_CM_HEADER(Get_Child, (PDEVNODE pdnDevNode, DEVNODE dnDevNode, ULONG ulFlags))
  1663. MAKE_CM_HEADER(Get_Sibling, (PDEVNODE pdnDevNode, DEVNODE dnDevNode, ULONG ulFlags))
  1664. MAKE_CM_HEADER(Get_Device_ID_Size, (PFARULONG pulLen, DEVNODE dnDevNode, ULONG ulFlags))
  1665. MAKE_CM_HEADER(Get_Device_ID, (DEVNODE dnDevNode, PFARVOID Buffer, ULONG BufferLen, ULONG ulFlags))
  1666. MAKE_CM_HEADER(Get_Depth, (PFARULONG pulDepth, DEVNODE dnDevNode, ULONG ulFlags))
  1667. MAKE_CM_HEADER(Get_Private_DWord, (PFARULONG pulPrivate, DEVNODE dnInDevNode, DEVNODE dnForDevNode, ULONG ulFlags))
  1668. MAKE_CM_HEADER(Set_Private_DWord, (DEVNODE dnInDevNode, DEVNODE dnForDevNode, ULONG ulValue, ULONG ulFlags))
  1669. MAKE_CM_HEADER(Create_DevNode, (PDEVNODE pdnDevNode, DEVNODEID pDeviceID, DEVNODE dnParent, ULONG ulFlags))
  1670. MAKE_CM_HEADER(Query_Remove_SubTree, (DEVNODE dnAncestor, ULONG ulFlags))
  1671. MAKE_CM_HEADER(Remove_SubTree, (DEVNODE dnAncestor, ULONG ulFlags))
  1672. MAKE_CM_HEADER(Register_Device_Driver, (DEVNODE dnDevNode, CMCONFIGHANDLER Handler, ULONG ulRefData, ULONG ulFlags))
  1673. MAKE_CM_HEADER(Register_Enumerator, (DEVNODE dnDevNode, CMENUMHANDLER Handler, ULONG ulFlags))
  1674. MAKE_CM_HEADER(Register_Arbitrator, (PREGISTERID pRid, RESOURCEID id, CMARBHANDLER Handler, ULONG ulDWordToBePassed, DEVNODE dnArbitratorNode, ULONG ulFlags))
  1675. MAKE_CM_HEADER(Deregister_Arbitrator, (REGISTERID id, ULONG ulFlags))
  1676. MAKE_CM_HEADER(Query_Arbitrator_Free_Size, (PFARULONG pulSize, DEVNODE dnDevNode, RESOURCEID ResourceID, ULONG ulFlags))
  1677. MAKE_CM_HEADER(Query_Arbitrator_Free_Data, (PFARVOID pData, ULONG DataLen, DEVNODE dnDevNode, RESOURCEID ResourceID, ULONG ulFlags))
  1678. MAKE_CM_HEADER(Sort_NodeList, (NODELIST_HEADER nlhNodeListHeader, ULONG ulFlags))
  1679. MAKE_CM_HEADER(Yield, (ULONG ulMicroseconds, ULONG ulFlags))
  1680. MAKE_CM_HEADER(Lock, (ULONG ulFlags))
  1681. MAKE_CM_HEADER(Unlock, (ULONG ulFlags))
  1682. MAKE_CM_HEADER(Add_Empty_Log_Conf, (PLOG_CONF plcLogConf, DEVNODE dnDevNode, PRIORITY Priority, ULONG ulFlags))
  1683. MAKE_CM_HEADER(Free_Log_Conf, (LOG_CONF lcLogConfToBeFreed, ULONG ulFlags))
  1684. MAKE_CM_HEADER(Get_First_Log_Conf, (PLOG_CONF plcLogConf, DEVNODE dnDevNode, ULONG ulFlags))
  1685. MAKE_CM_HEADER(Get_Next_Log_Conf, (PLOG_CONF plcLogConf, LOG_CONF lcLogConf, ULONG ulFlags))
  1686. MAKE_CM_HEADER(Add_Res_Des, (PRES_DES prdResDes, LOG_CONF lcLogConf, RESOURCEID ResourceID, PFARVOID ResourceData, ULONG ResourceLen, ULONG ulFlags))
  1687. MAKE_CM_HEADER(Modify_Res_Des, (PRES_DES prdResDes, RES_DES rdResDes, RESOURCEID ResourceID, PFARVOID ResourceData, ULONG ResourceLen, ULONG ulFlags))
  1688. MAKE_CM_HEADER(Free_Res_Des, (PRES_DES prdResDes, RES_DES rdResDes, ULONG ulFlags))
  1689. MAKE_CM_HEADER(Get_Next_Res_Des, (PRES_DES prdResDes, RES_DES CurrentResDesOrLogConf, RESOURCEID ForResource, PRESOURCEID pResourceID, ULONG ulFlags))
  1690. MAKE_CM_HEADER(Get_Performance_Info, (PCMPERFINFO pPerfInfo, ULONG ulFlags))
  1691. MAKE_CM_HEADER(Get_Res_Des_Data_Size, (PFARULONG pulSize, RES_DES rdResDes, ULONG ulFlags))
  1692. MAKE_CM_HEADER(Get_Res_Des_Data, (RES_DES rdResDes, PFARVOID Buffer, ULONG BufferLen, ULONG ulFlags))
  1693. MAKE_CM_HEADER(Process_Events_Now, (ULONG ulFlags))
  1694. MAKE_CM_HEADER(Create_Range_List, (PRANGE_LIST prlh, ULONG ulFlags))
  1695. MAKE_CM_HEADER(Add_Range, (ULONG ulStartValue, ULONG ulEndValue, RANGE_LIST rlh, ULONG ulFlags))
  1696. MAKE_CM_HEADER(Delete_Range, (ULONG ulStartValue, ULONG ulEndValue, RANGE_LIST rlh, ULONG ulFlags))
  1697. MAKE_CM_HEADER(Test_Range_Available, (ULONG ulStartValue, ULONG ulEndValue, RANGE_LIST rlh, ULONG ulFlags))
  1698. MAKE_CM_HEADER(Dup_Range_List, (RANGE_LIST rlhOld, RANGE_LIST rlhNew, ULONG ulFlags))
  1699. MAKE_CM_HEADER(Free_Range_List, (RANGE_LIST rlh, ULONG ulFlags))
  1700. MAKE_CM_HEADER(Invert_Range_List, (RANGE_LIST rlhOld, RANGE_LIST rlhNew, ULONG ulMaxVal, ULONG ulFlags))
  1701. MAKE_CM_HEADER(Intersect_Range_List, (RANGE_LIST rlhOld1, RANGE_LIST rlhOld2, RANGE_LIST rlhNew, ULONG ulFlags))
  1702. MAKE_CM_HEADER(First_Range, (RANGE_LIST rlh, PFARULONG pulStart, PFARULONG pulEnd, PRANGE_ELEMENT preElement, ULONG ulFlags))
  1703. MAKE_CM_HEADER(Next_Range, (PRANGE_ELEMENT preElement, PFARULONG pulStart, PFARULONG pulEnd, ULONG ulFlags))
  1704. MAKE_CM_HEADER(Dump_Range_List, (RANGE_LIST rlh, ULONG ulFlags))
  1705. MAKE_CM_HEADER(Load_DLVxDs, (DEVNODE dnDevNode, PFARCHAR FileNames, LOAD_TYPE LoadType, ULONG ulFlags))
  1706. MAKE_CM_HEADER(Get_DDBs, (PPPVMMDDB ppDDB, PFARULONG pulCount, LOAD_TYPE LoadType, DEVNODE dnDevNode, ULONG ulFlags))
  1707. MAKE_CM_HEADER(Get_CRC_CheckSum, (PFARVOID pBuffer, ULONG ulSize, PFARULONG pulSeed, ULONG ulFlags))
  1708. MAKE_CM_HEADER(Register_DevLoader, (PVMMDDB pDDB, ULONG ulFlags))
  1709. MAKE_CM_HEADER(Reenumerate_DevNode, (DEVNODE dnDevNode, ULONG ulFlags))
  1710. MAKE_CM_HEADER(Setup_DevNode, (DEVNODE dnDevNode, ULONG ulFlags))
  1711. MAKE_CM_HEADER(Reset_Children_Marks, (DEVNODE dnDevNode, ULONG ulFlags))
  1712. MAKE_CM_HEADER(Get_DevNode_Status, (PFARULONG pulStatus, PFARULONG pulProblemNumber, DEVNODE dnDevNode, ULONG ulFlags))
  1713. MAKE_CM_HEADER(Remove_Unmarked_Children, (DEVNODE dnDevNode, ULONG ulFlags))
  1714. MAKE_CM_HEADER(ISAPNP_To_CM, (PFARVOID pBuffer, DEVNODE dnDevNode, ULONG ulLogDev, ULONG ulFlags))
  1715. MAKE_CM_HEADER(CallBack_Device_Driver, (CMCONFIGHANDLER Handler, ULONG ulFlags))
  1716. MAKE_CM_HEADER(CallBack_Enumerator, (CMENUMHANDLER Handler, ULONG ulFlags))
  1717. MAKE_CM_HEADER(Get_Alloc_Log_Conf, (PCMCONFIG pccBuffer, DEVNODE dnDevNode, ULONG ulFlags))
  1718. MAKE_CM_HEADER(Get_DevNode_Key_Size, (PFARULONG pulLen, DEVNODE dnDevNode, PFARCHAR pszSubKey, ULONG ulFlags))
  1719. MAKE_CM_HEADER(Get_DevNode_Key, (DEVNODE dnDevNode, PFARCHAR pszSubKey, PFARVOID Buffer, ULONG BufferLen, ULONG ulFlags))
  1720. MAKE_CM_HEADER(Read_Registry_Value, (DEVNODE dnDevNode, PFARCHAR pszSubKey, PFARCHAR pszValueName, ULONG ulExpectedType, PFARVOID pBuffer, PFARULONG pulLength, ULONG ulFlags))
  1721. MAKE_CM_HEADER(Write_Registry_Value, (DEVNODE dnDevNode, PFARCHAR pszSubKey, PFARCHAR pszValueName, ULONG ulType, PFARVOID pBuffer, ULONG ulLength, ULONG ulFlags))
  1722. MAKE_CM_HEADER(Disable_DevNode, (DEVNODE dnDevNode, ULONG ulFlags))
  1723. MAKE_CM_HEADER(Enable_DevNode, (DEVNODE dnDevNode, ULONG ulFlags))
  1724. MAKE_CM_HEADER(Move_DevNode, (DEVNODE dnFromDevNode, DEVNODE dnToDevNode, ULONG ulFlags))
  1725. MAKE_CM_HEADER(Set_Bus_Info, (DEVNODE dnDevNode, CMBUSTYPE btBusType, ULONG ulSizeOfInfo, PFARVOID pInfo, ULONG ulFlags))
  1726. MAKE_CM_HEADER(Get_Bus_Info, (DEVNODE dnDevNode, PCMBUSTYPE pbtBusType, PFARULONG pulSizeOfInfo, PFARVOID pInfo, ULONG ulFlags))
  1727. MAKE_CM_HEADER(Set_HW_Prof, (ULONG ulConfig, ULONG ulFlags))
  1728. MAKE_CM_HEADER(Recompute_HW_Prof, (ULONG ulDock, ULONG ulSerialNo, ULONG ulFlags))
  1729. MAKE_CM_HEADER(Query_Change_HW_Prof, (ULONG ulDock, ULONG ulSerialNo, ULONG ulFlags))
  1730. MAKE_CM_HEADER(Get_Device_Driver_Private_DWord, (DEVNODE dnDevNode, PFARULONG pulDWord, ULONG ulFlags))
  1731. MAKE_CM_HEADER(Set_Device_Driver_Private_DWord, (DEVNODE dnDevNode, ULONG ulDword, ULONG ulFlags))
  1732. MAKE_CM_HEADER(Get_HW_Prof_Flags, (PFARCHAR szDevNodeName, ULONG ulConfig, PFARULONG pulValue, ULONG ulFlags))
  1733. MAKE_CM_HEADER(Set_HW_Prof_Flags, (PFARCHAR szDevNodeName, ULONG ulConfig, ULONG ulValue, ULONG ulFlags))
  1734. MAKE_CM_HEADER(Read_Registry_Log_Confs, (DEVNODE dnDevNode, ULONG ulFlags))
  1735. MAKE_CM_HEADER(Run_Detection, (ULONG ulFlags))
  1736. MAKE_CM_HEADER(Call_At_Appy_Time, (CMAPPYCALLBACKHANDLER Handler, ULONG ulRefData, ULONG ulFlags))
  1737. MAKE_CM_HEADER(Fail_Change_HW_Prof, (ULONG ulFlags))
  1738. MAKE_CM_HEADER(Set_Private_Problem, (DEVNODE dnDevNode, ULONG ulRefData, ULONG ulFlags))
  1739. MAKE_CM_HEADER(Debug_DevNode, (DEVNODE dnDevNode, ULONG ulFlags))
  1740. MAKE_CM_HEADER(Get_Hardware_Profile_Info, (ULONG ulIndex, PFARHWPROFILEINFO pHWProfileInfo, ULONG ulFlags))
  1741. MAKE_CM_HEADER(Register_Enumerator_Function, (DEVNODE dnDevNode, CMENUMFUNCTION Handler, ULONG ulFlags))
  1742. MAKE_CM_HEADER(Call_Enumerator_Function, (DEVNODE dnDevNode, ENUMFUNC efFunc, ULONG ulRefData, PFARVOID pBuffer, ULONG ulBufferSize, ULONG ulFlags))
  1743. MAKE_CM_HEADER(Add_ID, (DEVNODE dnDevNode, PFARCHAR pszID, ULONG ulFlags))
  1744. #pragma warning (default:4100) // Param not used
  1745. #endif // ifndef No_CM_Calls
  1746. /*XLATON*/
  1747. #endif // ifndef CMJUSTRESDES
  1748. #endif // _CONFIGMG_H