Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

217 lines
11 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. cfg.h
  5. Abstract:
  6. This module contains the common Configuration Manager definitions for
  7. both user mode and kernel mode code.
  8. Author:
  9. Paula Tomlinson (paulat) 06/19/1995
  10. Revision History:
  11. --*/
  12. #ifndef _CFG_INCLUDED_
  13. #define _CFG_INCLUDED_
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17. //
  18. // The following definitions are also used by kernel mode code to
  19. // set up the registry.
  20. //
  21. //
  22. // VetoType used in
  23. // CM_Disable_DevNode
  24. // CM_Uninstall_DevNode
  25. // CM_Query_And_Remove_SubTree
  26. //
  27. typedef enum _PNP_VETO_TYPE {
  28. PNP_VetoTypeUnknown, // Name is unspecified
  29. PNP_VetoLegacyDevice, // Name is an Instance Path
  30. PNP_VetoPendingClose, // Name is an Instance Path
  31. PNP_VetoWindowsApp, // Name is a Module
  32. PNP_VetoWindowsService, // Name is a Service
  33. PNP_VetoOutstandingOpen, // Name is an Instance Path
  34. PNP_VetoDevice, // Name is an Instance Path
  35. PNP_VetoDriver, // Name is a Driver Service Name
  36. PNP_VetoIllegalDeviceRequest, // Name is an Instance Path
  37. PNP_VetoInsufficientPower, // Name is unspecified
  38. PNP_VetoNonDisableable, // Name is an Instance Path
  39. PNP_VetoLegacyDriver, // Name is a Service
  40. PNP_VetoInsufficientRights // Name is unspecified
  41. } PNP_VETO_TYPE, *PPNP_VETO_TYPE;
  42. //
  43. // DevInst problem values, returned by call to CM_Get_DevInst_Status
  44. //
  45. #define CM_PROB_NOT_CONFIGURED (0x00000001) // no config for device
  46. #define CM_PROB_DEVLOADER_FAILED (0x00000002) // service load failed
  47. #define CM_PROB_OUT_OF_MEMORY (0x00000003) // out of memory
  48. #define CM_PROB_ENTRY_IS_WRONG_TYPE (0x00000004) //
  49. #define CM_PROB_LACKED_ARBITRATOR (0x00000005) //
  50. #define CM_PROB_BOOT_CONFIG_CONFLICT (0x00000006) // boot config conflict
  51. #define CM_PROB_FAILED_FILTER (0x00000007) //
  52. #define CM_PROB_DEVLOADER_NOT_FOUND (0x00000008) // Devloader not found
  53. #define CM_PROB_INVALID_DATA (0x00000009) //
  54. #define CM_PROB_FAILED_START (0x0000000A) //
  55. #define CM_PROB_LIAR (0x0000000B) //
  56. #define CM_PROB_NORMAL_CONFLICT (0x0000000C) // config conflict
  57. #define CM_PROB_NOT_VERIFIED (0x0000000D) //
  58. #define CM_PROB_NEED_RESTART (0x0000000E) // requires restart
  59. #define CM_PROB_REENUMERATION (0x0000000F) //
  60. #define CM_PROB_PARTIAL_LOG_CONF (0x00000010) //
  61. #define CM_PROB_UNKNOWN_RESOURCE (0x00000011) // unknown res type
  62. #define CM_PROB_REINSTALL (0x00000012) //
  63. #define CM_PROB_REGISTRY (0x00000013) //
  64. #define CM_PROB_VXDLDR (0x00000014) // WINDOWS 95 ONLY
  65. #define CM_PROB_WILL_BE_REMOVED (0x00000015) // devinst will remove
  66. #define CM_PROB_DISABLED (0x00000016) // devinst is disabled
  67. #define CM_PROB_DEVLOADER_NOT_READY (0x00000017) // Devloader not ready
  68. #define CM_PROB_DEVICE_NOT_THERE (0x00000018) // device doesn't exist
  69. #define CM_PROB_MOVED (0x00000019) //
  70. #define CM_PROB_TOO_EARLY (0x0000001A) //
  71. #define CM_PROB_NO_VALID_LOG_CONF (0x0000001B) // no valid log config
  72. #define CM_PROB_FAILED_INSTALL (0x0000001C) // install failed
  73. #define CM_PROB_HARDWARE_DISABLED (0x0000001D) // device disabled
  74. #define CM_PROB_CANT_SHARE_IRQ (0x0000001E) // can't share IRQ
  75. #define CM_PROB_FAILED_ADD (0x0000001F) // driver failed add
  76. #define CM_PROB_DISABLED_SERVICE (0x00000020) // service's Start = 4
  77. #define CM_PROB_TRANSLATION_FAILED (0x00000021) // resource translation failed
  78. #define CM_PROB_NO_SOFTCONFIG (0x00000022) // no soft config
  79. #define CM_PROB_BIOS_TABLE (0x00000023) // device missing in BIOS table
  80. #define CM_PROB_IRQ_TRANSLATION_FAILED (0x00000024) // IRQ translator failed
  81. #define CM_PROB_FAILED_DRIVER_ENTRY (0x00000025) // DriverEntry() failed.
  82. #define CM_PROB_DRIVER_FAILED_PRIOR_UNLOAD (0x00000026) // Driver should have unloaded.
  83. #define CM_PROB_DRIVER_FAILED_LOAD (0x00000027) // Driver load unsuccessful.
  84. #define CM_PROB_DRIVER_SERVICE_KEY_INVALID (0x00000028) // Error accessing driver's service key
  85. #define CM_PROB_LEGACY_SERVICE_NO_DEVICES (0x00000029) // Loaded legacy service created no devices
  86. #define CM_PROB_DUPLICATE_DEVICE (0x0000002A) // Two devices were discovered with the same name
  87. #define CM_PROB_FAILED_POST_START (0x0000002B) // The drivers set the device state to failed
  88. #define CM_PROB_HALTED (0x0000002C) // This device was failed post start via usermode
  89. #define CM_PROB_PHANTOM (0x0000002D) // The devinst currently exists only in the registry
  90. #define CM_PROB_SYSTEM_SHUTDOWN (0x0000002E) // The system is shutting down
  91. #define CM_PROB_HELD_FOR_EJECT (0x0000002F) // The device is offline awaiting removal
  92. #define CM_PROB_DRIVER_BLOCKED (0x00000030) // One or more drivers is blocked from loading
  93. #define CM_PROB_REGISTRY_TOO_LARGE (0x00000031) // System hive has grown too large
  94. #define NUM_CM_PROB (0x00000032)
  95. //
  96. // Configuration Manager Global State Flags (returned by CM_Get_Global_State)
  97. //
  98. #define CM_GLOBAL_STATE_CAN_DO_UI (0x00000001) // Can do UI?
  99. #define CM_GLOBAL_STATE_ON_BIG_STACK (0x00000002) // WINDOWS 95 ONLY
  100. #define CM_GLOBAL_STATE_SERVICES_AVAILABLE (0x00000004) // CM APIs available?
  101. #define CM_GLOBAL_STATE_SHUTTING_DOWN (0x00000008) // CM shutting down
  102. #define CM_GLOBAL_STATE_DETECTION_PENDING (0x00000010) // detection pending
  103. //
  104. // Device Instance status flags, returned by call to CM_Get_DevInst_Status
  105. //
  106. #define DN_ROOT_ENUMERATED (0x00000001) // Was enumerated by ROOT
  107. #define DN_DRIVER_LOADED (0x00000002) // Has Register_Device_Driver
  108. #define DN_ENUM_LOADED (0x00000004) // Has Register_Enumerator
  109. #define DN_STARTED (0x00000008) // Is currently configured
  110. #define DN_MANUAL (0x00000010) // Manually installed
  111. #define DN_NEED_TO_ENUM (0x00000020) // May need reenumeration
  112. #define DN_NOT_FIRST_TIME (0x00000040) // Has received a config
  113. #define DN_HARDWARE_ENUM (0x00000080) // Enum generates hardware ID
  114. #define DN_LIAR (0x00000100) // Lied about can reconfig once
  115. #define DN_HAS_MARK (0x00000200) // Not CM_Create_DevInst lately
  116. #define DN_HAS_PROBLEM (0x00000400) // Need device installer
  117. #define DN_FILTERED (0x00000800) // Is filtered
  118. #define DN_MOVED (0x00001000) // Has been moved
  119. #define DN_DISABLEABLE (0x00002000) // Can be rebalanced
  120. #define DN_REMOVABLE (0x00004000) // Can be removed
  121. #define DN_PRIVATE_PROBLEM (0x00008000) // Has a private problem
  122. #define DN_MF_PARENT (0x00010000) // Multi function parent
  123. #define DN_MF_CHILD (0x00020000) // Multi function child
  124. #define DN_WILL_BE_REMOVED (0x00040000) // DevInst is being removed
  125. //
  126. // Windows 4 OPK2 Flags
  127. //
  128. #define DN_NOT_FIRST_TIMEE 0x00080000 // S: Has received a config enumerate
  129. #define DN_STOP_FREE_RES 0x00100000 // S: When child is stopped, free resources
  130. #define DN_REBAL_CANDIDATE 0x00200000 // S: Don't skip during rebalance
  131. #define DN_BAD_PARTIAL 0x00400000 // S: This devnode's log_confs do not have same resources
  132. #define DN_NT_ENUMERATOR 0x00800000 // S: This devnode's is an NT enumerator
  133. #define DN_NT_DRIVER 0x01000000 // S: This devnode's is an NT driver
  134. //
  135. // Windows 4.1 Flags
  136. //
  137. #define DN_NEEDS_LOCKING 0x02000000 // S: Devnode need lock resume processing
  138. #define DN_ARM_WAKEUP 0x04000000 // S: Devnode can be the wakeup device
  139. #define DN_APM_ENUMERATOR 0x08000000 // S: APM aware enumerator
  140. #define DN_APM_DRIVER 0x10000000 // S: APM aware driver
  141. #define DN_SILENT_INSTALL 0x20000000 // S: Silent install
  142. #define DN_NO_SHOW_IN_DM 0x40000000 // S: No show in device manager
  143. #define DN_BOOT_LOG_PROB 0x80000000 // S: Had a problem during preassignment of boot log conf
  144. //
  145. // Windows NT Flags
  146. //
  147. // These are overloaded on top of unused Win 9X flags
  148. //
  149. //#define DN_LIAR (0x00000100) // Lied about can reconfig once
  150. #define DN_NEED_RESTART DN_LIAR // System needs to be restarted for this Devnode to work properly
  151. // #define DN_NOT_FIRST_TIME (0x00000040) // Has Register_Enumerator
  152. #define DN_DRIVER_BLOCKED DN_NOT_FIRST_TIME // One or more drivers are blocked from loading for this Devnode
  153. //#define DN_MOVED (0x00001000) // Has been moved
  154. #define DN_LEGACY_DRIVER DN_MOVED // This device is using a legacy driver
  155. //#define DN_HAS_MARK (0x00000200) // Not CM_Create_DevInst lately
  156. #define DN_CHILD_WITH_INVALID_ID DN_HAS_MARK // One or more children have invalid ID(s)
  157. #define DN_CHANGEABLE_FLAGS (DN_NOT_FIRST_TIME+\
  158. DN_HARDWARE_ENUM+\
  159. DN_HAS_MARK+\
  160. DN_DISABLEABLE+\
  161. DN_REMOVABLE+\
  162. DN_MF_CHILD+\
  163. DN_MF_PARENT+\
  164. DN_NOT_FIRST_TIMEE+\
  165. DN_STOP_FREE_RES+\
  166. DN_REBAL_CANDIDATE+\
  167. DN_NT_ENUMERATOR+\
  168. DN_NT_DRIVER+\
  169. DN_SILENT_INSTALL+\
  170. DN_NO_SHOW_IN_DM)
  171. //
  172. // Logical configuration Priority values
  173. //
  174. // These priority values are used in user-mode calls to CM_Add_Empty_Log_Conf.
  175. // Drivers may also specify priority values for a given IO_RESOURCE_LIST
  176. // structure by including a ConfigData member union as the first
  177. // IO_RESOURCE_DESCRIPTOR in the IO_RESOURCE_LIST. In this case, the descriptor
  178. // type would be CmResourceTypeConfigData.
  179. //
  180. #define LCPRI_FORCECONFIG (0x00000000) // Coming from a forced config
  181. #define LCPRI_BOOTCONFIG (0x00000001) // Coming from a boot config
  182. #define LCPRI_DESIRED (0x00002000) // Preferable (better performance)
  183. #define LCPRI_NORMAL (0x00003000) // Workable (acceptable performance)
  184. #define LCPRI_LASTBESTCONFIG (0x00003FFF) // CM only--do not use
  185. #define LCPRI_SUBOPTIMAL (0x00005000) // Not desired, but will work
  186. #define LCPRI_LASTSOFTCONFIG (0x00007FFF) // CM only--do not use
  187. #define LCPRI_RESTART (0x00008000) // Need to restart
  188. #define LCPRI_REBOOT (0x00009000) // Need to reboot
  189. #define LCPRI_POWEROFF (0x0000A000) // Need to shutdown/power-off
  190. #define LCPRI_HARDRECONFIG (0x0000C000) // Need to change a jumper
  191. #define LCPRI_HARDWIRED (0x0000E000) // Cannot be changed
  192. #define LCPRI_IMPOSSIBLE (0x0000F000) // Impossible configuration
  193. #define LCPRI_DISABLED (0x0000FFFF) // Disabled configuration
  194. #define MAX_LCPRI (0x0000FFFF) // Maximum known LC Priority
  195. #endif // _CFG_INCLUDED_