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.

433 lines
6.6 KiB

  1. /*++
  2. Copyright (c) 1995-2001 Microsoft Corporation
  3. Module Name:
  4. umpnpi.h
  5. Abstract:
  6. This module contains the internal structure definitions and APIs used by
  7. the user-mode Plug and Play Manager.
  8. Author:
  9. Jim Cavalaris (jamesca) 03-01-2001
  10. Environment:
  11. User-mode only.
  12. Revision History:
  13. 01-March-2001 jamesca
  14. Creation and initial implementation.
  15. --*/
  16. #ifndef _UMPNPI_H_
  17. #define _UMPNPI_H_
  18. //
  19. // global data
  20. //
  21. extern HANDLE ghPnPHeap;
  22. extern LUID gLuidLoadDriverPrivilege;
  23. extern LUID gLuidUndockPrivilege;
  24. //
  25. // definitions
  26. //
  27. #define GUID_STRING_LEN 39 // size in chars, including terminating NULL
  28. //
  29. // flags for IsValidDeviceID
  30. //
  31. #define PNP_NOT_MOVED 0x00000001
  32. #define PNP_NOT_PHANTOM 0x00000002
  33. #define PNP_PRESENT 0x00000004
  34. #define PNP_NOT_REMOVED 0x00000008
  35. #define PNP_STRICT 0xFFFFFFFF
  36. //
  37. // Define the Plug and Play driver types. (from ntos\io\pnpmgr\pnpi.h)
  38. //
  39. typedef enum _PLUGPLAY_SERVICE_TYPE {
  40. PlugPlayServiceBusExtender,
  41. PlugPlayServiceAdapter,
  42. PlugPlayServicePeripheral,
  43. PlugPlayServiceSoftware,
  44. MaxPlugPlayServiceType
  45. } PLUGPLAY_SERVICE_TYPE, *PPLUGPLAY_SERVICE_TYPE;
  46. //
  47. // rdevnode.c
  48. //
  49. CONFIGRET
  50. EnableDevInst(
  51. IN PCWSTR pszDeviceID
  52. );
  53. CONFIGRET
  54. DisableDevInst(
  55. IN PCWSTR pszDeviceID,
  56. OUT PPNP_VETO_TYPE pVetoType,
  57. OUT LPWSTR pszVetoName,
  58. IN ULONG ulNameLength
  59. );
  60. CONFIGRET
  61. UninstallRealDevice(
  62. IN LPCWSTR pszDeviceID
  63. );
  64. CONFIGRET
  65. UninstallPhantomDevice(
  66. IN LPCWSTR pszDeviceID
  67. );
  68. BOOL
  69. IsDeviceRootEnumerated(
  70. IN LPCWSTR pszDeviceID
  71. );
  72. CONFIGRET
  73. QueryAndRemoveSubTree(
  74. IN PCWSTR pszDeviceID,
  75. OUT PPNP_VETO_TYPE pVetoType,
  76. OUT LPWSTR pszVetoName,
  77. IN ULONG ulNameLength,
  78. IN ULONG ulFlags
  79. );
  80. CONFIGRET
  81. ReenumerateDevInst(
  82. IN PCWSTR pszDeviceID,
  83. IN BOOL EnumSubTree,
  84. IN ULONG ulFlags
  85. );
  86. typedef enum {
  87. EA_CONTINUE,
  88. EA_SKIP_SUBTREE,
  89. EA_STOP_ENUMERATION
  90. } ENUM_ACTION;
  91. typedef ENUM_ACTION (*PFN_ENUMTREE)(
  92. IN LPCWSTR DevInst,
  93. IN OUT PVOID Context
  94. );
  95. CONFIGRET
  96. EnumerateSubTreeTopDownBreadthFirst(
  97. IN handle_t BindingHandle,
  98. IN LPCWSTR DevInst,
  99. IN PFN_ENUMTREE CallbackFunction,
  100. IN OUT PVOID Context
  101. );
  102. //
  103. // revent.c
  104. //
  105. BOOL
  106. InitNotification(
  107. VOID
  108. );
  109. DWORD
  110. InitializePnPManager(
  111. IN LPDWORD lpParam
  112. );
  113. DWORD
  114. SessionNotificationHandler(
  115. IN DWORD EventType,
  116. IN PWTSSESSION_NOTIFICATION SessionNotification
  117. );
  118. #define PNP_INIT_MUTEX TEXT("PnP_Init_Mutex")
  119. typedef struct {
  120. BOOL HeadNodeSeen;
  121. BOOL SingleLevelEnumOnly;
  122. CONFIGRET Status;
  123. } QI_CONTEXT, *PQI_CONTEXT;
  124. ENUM_ACTION
  125. QueueInstallationCallback(
  126. IN LPCWSTR DevInst,
  127. IN OUT PVOID Context
  128. );
  129. //
  130. // rtravers.c
  131. //
  132. CONFIGRET
  133. GetServiceDeviceListSize(
  134. IN LPCWSTR pszService,
  135. OUT PULONG pulLength
  136. );
  137. CONFIGRET
  138. GetServiceDeviceList(
  139. IN LPCWSTR pszService,
  140. OUT LPWSTR pBuffer,
  141. IN OUT PULONG pulLength,
  142. IN ULONG ulFlags
  143. );
  144. //
  145. // rutil.c
  146. //
  147. BOOL
  148. MultiSzAppendW(
  149. IN OUT LPWSTR pszMultiSz,
  150. IN OUT PULONG pulSize,
  151. IN LPCWSTR pszString
  152. );
  153. BOOL
  154. MultiSzDeleteStringW(
  155. IN OUT LPWSTR pString,
  156. IN LPCWSTR pSubString
  157. );
  158. LPWSTR
  159. MultiSzFindNextStringW(
  160. IN LPWSTR pMultiSz
  161. );
  162. BOOL
  163. MultiSzSearchStringW(
  164. IN LPCWSTR pString,
  165. IN LPCWSTR pSubString
  166. );
  167. ULONG
  168. MultiSzSizeW(
  169. IN LPCWSTR pString
  170. );
  171. BOOL
  172. IsValidGuid(
  173. IN LPWSTR pszGuid
  174. );
  175. DWORD
  176. GuidFromString(
  177. IN PCTSTR GuidString,
  178. OUT LPGUID Guid
  179. );
  180. DWORD
  181. StringFromGuid(
  182. IN CONST GUID *Guid,
  183. OUT PTSTR GuidString,
  184. IN DWORD GuidStringSize
  185. );
  186. BOOL
  187. IsValidDeviceID(
  188. IN LPCWSTR pszDeviceID,
  189. IN HKEY hKey,
  190. IN ULONG ulFlags
  191. );
  192. BOOL
  193. IsRootDeviceID(
  194. IN LPCWSTR pDeviceID
  195. );
  196. BOOL
  197. IsDeviceIdPresent(
  198. IN LPCWSTR pszDeviceID
  199. );
  200. BOOL
  201. IsDevicePhantom(
  202. IN LPWSTR pszDeviceID
  203. );
  204. BOOL
  205. IsDeviceMoved(
  206. IN LPCWSTR pszDeviceID,
  207. IN HKEY hKey
  208. );
  209. ULONG
  210. GetDeviceConfigFlags(
  211. IN LPCWSTR pszDeviceID,
  212. IN HKEY hKey
  213. );
  214. CONFIGRET
  215. GetDeviceStatus(
  216. IN LPCWSTR pszDeviceID,
  217. OUT PULONG pulStatus,
  218. OUT PULONG pulProblem
  219. );
  220. CONFIGRET
  221. SetDeviceStatus(
  222. IN LPCWSTR pszDeviceID,
  223. IN ULONG ulStatus,
  224. IN ULONG ulProblem
  225. );
  226. CONFIGRET
  227. ClearDeviceStatus(
  228. IN LPCWSTR pszDeviceID,
  229. IN ULONG ulStatus,
  230. IN ULONG ulProblem
  231. );
  232. BOOL
  233. GetActiveService(
  234. IN PCWSTR pszDevice,
  235. OUT PWSTR pszService
  236. );
  237. BOOL
  238. PathToString(
  239. IN LPWSTR pszString,
  240. IN LPCWSTR pszPath,
  241. IN ULONG ulLength
  242. );
  243. BOOL
  244. SplitClassInstanceString(
  245. IN LPCWSTR pszClassInstance,
  246. OUT LPWSTR pszClass,
  247. OUT LPWSTR pszInstance
  248. );
  249. CONFIGRET
  250. CopyRegistryTree(
  251. IN HKEY hSrcKey,
  252. IN HKEY hDestKey,
  253. IN ULONG ulOption
  254. );
  255. CONFIGRET
  256. MakeKeyVolatile(
  257. IN LPCWSTR pszParentKey,
  258. IN LPCWSTR pszChildKey
  259. );
  260. CONFIGRET
  261. MakeKeyNonVolatile(
  262. IN LPCWSTR pszParentKey,
  263. IN LPCWSTR pszChildKey
  264. );
  265. CONFIGRET
  266. OpenLogConfKey(
  267. IN LPCWSTR pszDeviceID,
  268. IN ULONG LogConfType,
  269. OUT PHKEY phKey
  270. );
  271. BOOL
  272. CreateDeviceIDRegKey(
  273. IN HKEY hParentKey,
  274. IN LPCWSTR pDeviceID
  275. );
  276. CONFIGRET
  277. GetProfileCount(
  278. OUT PULONG pulProfiles
  279. );
  280. VOID
  281. PNP_ENTER_SYNCHRONOUS_CALL(
  282. VOID
  283. );
  284. VOID
  285. PNP_LEAVE_SYNCHRONOUS_CALL(
  286. VOID
  287. );
  288. ULONG
  289. MapNtStatusToCmError(
  290. IN ULONG NtStatus
  291. );
  292. ULONG
  293. GetActiveConsoleSessionId(
  294. VOID
  295. );
  296. BOOL
  297. IsClientUsingLocalConsole(
  298. IN handle_t hBinding
  299. );
  300. BOOL
  301. IsClientLocal(
  302. IN handle_t hBinding
  303. );
  304. BOOL
  305. IsClientInteractive(
  306. IN handle_t hBinding
  307. );
  308. BOOL
  309. IsClientAdministrator(
  310. IN handle_t hBinding
  311. );
  312. BOOL
  313. VerifyClientAccess(
  314. IN handle_t hBinding,
  315. IN PLUID pPrivilegeLuid
  316. );
  317. BOOL
  318. VerifyKernelInitiatedEjectPermissions(
  319. IN HANDLE UserToken OPTIONAL,
  320. IN BOOL DockDevice
  321. );
  322. //
  323. // osver.c
  324. //
  325. BOOL
  326. IsEmbeddedNT(
  327. VOID
  328. );
  329. BOOL
  330. IsTerminalServer(
  331. VOID
  332. );
  333. BOOL
  334. IsFastUserSwitchingEnabled(
  335. VOID
  336. );
  337. #endif // _UMPNPI_H_