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.

261 lines
7.6 KiB

  1. /*++
  2. Copyright (c) 1989-2001 Microsoft Corporation
  3. Module Name:
  4. cfgmgrp.h
  5. Abstract:
  6. This module contains private Plug and Play defintions and declarations used
  7. by the Configuration Manager, the user mode Plug and Play manager, and other
  8. system components.
  9. Author:
  10. Paula Tomlinson (paulat) 06/19/1995
  11. Revision History:
  12. Jim Cavalaris (jamesca) 03/01/2001
  13. Removed definitions and declarations that are specific to only either
  14. CFGMGR32 or UMPNPMGR, since this header file is also included privately
  15. by other system components such as the service control manager (SCM).
  16. --*/
  17. #ifndef _CFGMGRP_H_
  18. #define _CFGMGRP_H_
  19. //
  20. // The following constants are used by PNP_GetVersion / CM_Get_Version to
  21. // retrieve the version of the Configuration Manager APIs. CONFIGMG_VERSION is
  22. // defined as 0x0400 in the public header cfgmgr32.h and should remain constant
  23. // across all future versions of Windows, for compatibility reasons.
  24. //
  25. #define PNP_VERSION CONFIGMG_VERSION
  26. #define CFGMGR32_VERSION CONFIGMG_VERSION
  27. //
  28. // The following constants are used for version negotiation between the client
  29. // and the server, and are for internal use only. CFGMGR32_VERSION_INTERNAL is
  30. // supplied to PNP_GetVersionInternal by the client, and upon successful return
  31. // receives PNP_VERSION_INTERNAL. For simplicity, these are defined to the
  32. // current version of Windows the corresponding client and server shipped with.
  33. //
  34. // Note that there is no client routine to receive the internal version of the
  35. // server directly. Instead, CM_Is_Version_Available is provided to determine
  36. // support for a particular version. The only version publicly defined is
  37. // CFGMG_VERSION, which is constant, and always available.
  38. //
  39. #define PNP_VERSION_INTERNAL WINVER
  40. #define CFGMGR32_VERSION_INTERNAL WINVER
  41. //
  42. // Common PNP constant definitions
  43. //
  44. #define MAX_DEVICE_INSTANCE_LEN 256
  45. #define MAX_DEVICE_INSTANCE_SIZE 512
  46. #define MAX_SERVICE_NAME_LEN 256
  47. #define MAX_PROFILE_ID_LEN 5
  48. #define MAX_CM_PATH 360
  49. #define NT_RESLIST_VERSION (0x00000000)
  50. #define NT_RESLIST_REVISION (0x00000000)
  51. #define NT_REQLIST_VERSION (0x00000001)
  52. #define NT_REQLIST_REVISION (0x00000001)
  53. #define CM_PRIVATE_LOGCONF_SIGNATURE (0x08156201)
  54. #define CM_PRIVATE_RESDES_SIGNATURE (0x08156202)
  55. #define CM_PRIVATE_CONFLIST_SIGNATURE (0x08156203)
  56. #define MAX_LOGCONF_TAG (0xFFFFFFFF)
  57. #define MAX_RESDES_TAG (0xFFFFFFFF)
  58. #define RESDES_CS_TAG (MAX_RESDES_TAG - 1) // class-specific
  59. //
  60. // Action types for PNP_GetRelatedDeviceInstance
  61. //
  62. #define PNP_GET_PARENT_DEVICE_INSTANCE 0x00000001
  63. #define PNP_GET_CHILD_DEVICE_INSTANCE 0x00000002
  64. #define PNP_GET_SIBLING_DEVICE_INSTANCE 0x00000003
  65. //
  66. // Action types for PNP_DeviceInstanceAction
  67. //
  68. #define PNP_DEVINST_CREATE 0x00000001
  69. #define PNP_DEVINST_MOVE 0x00000002
  70. #define PNP_DEVINST_SETUP 0x00000003
  71. #define PNP_DEVINST_ENABLE 0x00000004
  72. #define PNP_DEVINST_DISABLE 0x00000005
  73. #define PNP_DEVINST_REMOVESUBTREE 0x00000006
  74. #define PNP_DEVINST_REENUMERATE 0x00000007
  75. #define PNP_DEVINST_QUERYREMOVE 0x00000008
  76. #define PNP_DEVINST_REQUEST_EJECT 0x00000009
  77. //
  78. // Action types for PNP_EnumerateSubKeys
  79. //
  80. #define PNP_ENUMERATOR_SUBKEYS 0x00000001
  81. #define PNP_CLASS_SUBKEYS 0x00000002
  82. //
  83. // Action types for PNP_HwProfFlags
  84. //
  85. #define PNP_GET_HWPROFFLAGS 0x00000001
  86. #define PNP_SET_HWPROFFLAGS 0x00000002
  87. //
  88. // flags for PNP_SetActiveService
  89. //
  90. #define PNP_SERVICE_STARTED 0x00000001
  91. #define PNP_SERVICE_STOPPED 0x00000002
  92. //
  93. // Mask for Flags argument to CMP_RegisterNotification, PNP_RegisterNotification
  94. // Must be kept in sync with RegisterDeviceNotification flags, in winuser.h and
  95. // winuserp.h.
  96. //
  97. //#define DEVICE_NOTIFY_WINDOW_HANDLE 0x00000000
  98. //#define DEVICE_NOTIFY_SERVICE_HANDLE 0x00000001
  99. //#define DEVICE_NOTIFY_COMPLETION_HANDLE 0x00000002
  100. #define DEVICE_NOTIFY_HANDLE_MASK 0x00000003
  101. //#define DEVICE_NOTIFY_ALL_INTERFACE_CLASSES 0x00000004
  102. #define DEVICE_NOTIFY_PROPERTY_MASK 0x00FFFFFC
  103. #define DEVICE_NOTIFY_WOW64_CLIENT 0x01000000
  104. #define DEVICE_NOTIFY_RESERVED_MASK 0xFF000000
  105. #define DEVICE_NOTIFY_BITS (DEVICE_NOTIFY_HANDLE_MASK|DEVICE_NOTIFY_ALL_INTERFACE_CLASSES|DEVICE_NOTIFY_WOW64_CLIENT)
  106. //
  107. // Flags returned from CMP_GetServerSideDeviceInstallFlags
  108. //
  109. #define SSDI_REBOOT_PENDING 0x00000001
  110. //-------------------------------------------------------------------
  111. // Private routines for Service Notifications, exported from
  112. // UMPNPMGR.dll for use by the Service Control Manager only.
  113. //-------------------------------------------------------------------
  114. //
  115. // Prototype definitions for the private routines supplied to the User-mode Plug
  116. // and Play service for direct communication with the Service Control Manager.
  117. //
  118. typedef
  119. DWORD
  120. (*PSCMCALLBACK_ROUTINE) (
  121. IN SERVICE_STATUS_HANDLE hServiceStatus,
  122. IN DWORD OpCode,
  123. IN DWORD dwEventType, // PnP wParam
  124. IN LPARAM EventData, // PnP lParam
  125. IN PDWORD result
  126. );
  127. typedef
  128. DWORD
  129. (*PSCMAUTHENTICATION_CALLBACK) (
  130. IN LPWSTR lpServiceName,
  131. OUT SERVICE_STATUS_HANDLE *lphServiceStatus
  132. );
  133. //
  134. // Private routines called by the Service Controller to supply (and revoke)
  135. // entrypoints for the above routines. (Note - UnRegisterScmCallback is not
  136. // currently used by the SCM, and is consequently not exported by UMPNPMGR)
  137. //
  138. CONFIGRET
  139. RegisterScmCallback(
  140. IN PSCMCALLBACK_ROUTINE pScCallback,
  141. IN PSCMAUTHENTICATION_CALLBACK pScAuthCallback
  142. );
  143. CONFIGRET
  144. UnRegisterScmCallback(
  145. VOID
  146. );
  147. //
  148. // Private routine called by the Service Controller to register a service to
  149. // receive notification events other than device events, that are also delivered
  150. // by Plug and Play (i.e. hardware profile change events, power events).
  151. //
  152. CONFIGRET
  153. RegisterServiceNotification(
  154. IN SERVICE_STATUS_HANDLE hService,
  155. IN LPWSTR pszService,
  156. IN DWORD scControls,
  157. IN BOOL bServiceStopped
  158. );
  159. //
  160. // Private routine caled by the Service Controller whenever a service is deleted
  161. // to delete any Plug and Play registry keys for a service (and uninstall the
  162. // devnode when necessary).
  163. //
  164. CONFIGRET
  165. DeleteServicePlugPlayRegKeys(
  166. IN LPWSTR pszService
  167. );
  168. //
  169. // Private routine called by the Service Controller to set the ActiveService for
  170. // devices controlled by the specified service.
  171. // [Note that this routine is NOT an RPC server routine, it is exported only!!]
  172. //
  173. CONFIGRET
  174. PNP_SetActiveService(
  175. IN handle_t hBinding,
  176. IN LPCWSTR pszService,
  177. IN ULONG ulFlags
  178. );
  179. //
  180. // Private routine to get the current list of blocked drivers (GUIDs).
  181. //
  182. CONFIGRET
  183. CMP_GetBlockedDriverInfo(
  184. OUT LPBYTE Buffer,
  185. IN OUT PULONG pulLength,
  186. IN ULONG ulFlags,
  187. IN HMACHINE hMachine
  188. );
  189. //
  190. // Private routine to get server side device install flags.
  191. //
  192. CONFIGRET
  193. CMP_GetServerSideDeviceInstallFlags(
  194. IN PULONG pulSSDIFlags,
  195. IN ULONG ulFlags,
  196. IN HMACHINE hMachine
  197. );
  198. #endif // _CFGMGRP_H_