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.

509 lines
10 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. ProvResv.H
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _Server_Aggregator_IWbemProvider_H
  9. #define _Server_Aggregator_IWbemProvider_H
  10. #include "ProvDnf.h"
  11. #include "ProvRegInfo.h"
  12. /******************************************************************************
  13. *
  14. * Name:
  15. *
  16. *
  17. * Description:
  18. *
  19. *
  20. *****************************************************************************/
  21. class CAggregator_IWbemProvider : public IWbemServices ,
  22. public _IWmiProviderInitialize ,
  23. public IWbemShutdown ,
  24. public _IWmiProviderCache ,
  25. public _IWmiProviderAssociatorsHelper,
  26. public ServiceCacheElement ,
  27. public CWbemGlobal_IWmiObjectSinkController
  28. {
  29. private:
  30. LONG m_ReferenceCount ; //Object reference count
  31. WmiAllocator &m_Allocator ;
  32. _IWmiProviderFactory *m_Factory ;
  33. IWbemServices *m_CoreRepositoryStub ;
  34. IWbemServices *m_CoreFullStub ;
  35. BSTR m_User ;
  36. BSTR m_Locale ;
  37. ULONG m_ClassProvidersCount ;
  38. CServerObject_ProviderRegistrationV1 **m_ClassProviders ;
  39. LONG m_Initialized ;
  40. HRESULT m_InitializeResult ;
  41. HANDLE m_InitializedEvent ;
  42. IWbemContext *m_InitializationContext ;
  43. private:
  44. QueryPreprocessor :: QuadState IsA (
  45. IWbemClassObject *a_Left ,
  46. IWbemClassObject *a_Right ,
  47. LONG &a_LeftLength ,
  48. LONG &a_RightLength ,
  49. BOOL &a_LeftIsA
  50. ) ;
  51. QueryPreprocessor :: QuadState EnumDeep_RecursiveEvaluate (
  52. IWbemClassObject *a_Class ,
  53. IWbemContext *a_Context ,
  54. WmiTreeNode *&a_Node
  55. ) ;
  56. QueryPreprocessor :: QuadState EnumDeep_Evaluate (
  57. IWbemClassObject *a_Class ,
  58. IWbemContext *a_Context ,
  59. WmiTreeNode *&a_Node
  60. ) ;
  61. QueryPreprocessor :: QuadState EnumShallow_RecursiveEvaluate (
  62. IWbemClassObject *a_Class ,
  63. IWbemContext *a_Context ,
  64. WmiTreeNode *&a_Node
  65. ) ;
  66. QueryPreprocessor :: QuadState EnumShallow_Evaluate (
  67. IWbemClassObject *a_Class ,
  68. IWbemContext *a_Context ,
  69. WmiTreeNode *&a_Node
  70. ) ;
  71. QueryPreprocessor :: QuadState Get_RecursiveEvaluate (
  72. wchar_t *a_Class ,
  73. IWbemContext *a_Context ,
  74. WmiTreeNode *&a_Node
  75. ) ;
  76. QueryPreprocessor :: QuadState Get_Evaluate (
  77. wchar_t *a_Class ,
  78. IWbemContext *a_Context ,
  79. WmiTreeNode *&a_Node
  80. ) ;
  81. HRESULT Enum_ClassProviders (
  82. IWbemServices *a_Repository ,
  83. IWbemContext *a_Context
  84. ) ;
  85. HRESULT PutClass_Helper_Advisory (
  86. IWbemClassObject *a_ClassObject,
  87. long a_Flags,
  88. IWbemContext *a_Context,
  89. IWbemObjectSink *a_Sink
  90. ) ;
  91. HRESULT PutClass_Helper_Put_CreateOrUpdate (
  92. BSTR a_Class ,
  93. IWbemClassObject *a_Object,
  94. long a_Flags,
  95. IWbemContext *a_Context,
  96. IWbemObjectSink *a_Sink
  97. ) ;
  98. HRESULT PutClass_Helper_Put (
  99. IWbemClassObject *a_Object,
  100. long a_Flags,
  101. IWbemContext *a_Context,
  102. IWbemObjectSink *a_Sink
  103. ) ;
  104. HRESULT DeleteClass_Helper_Advisory (
  105. IWbemClassObject *a_ClassObject ,
  106. BSTR a_Class,
  107. long a_Flags,
  108. IWbemContext *a_Context,
  109. IWbemObjectSink *a_Sink
  110. ) ;
  111. HRESULT DeleteClass_Helper_Enum (
  112. IWbemClassObject *a_ClassObject ,
  113. BSTR a_Class,
  114. long a_Flags,
  115. IWbemContext *a_Context,
  116. IWbemObjectSink *a_Sink
  117. ) ;
  118. HRESULT DeleteClass_Helper_Get (
  119. IWbemClassObject *a_ClassObject ,
  120. BSTR a_Class,
  121. long a_Flags,
  122. IWbemContext *a_Context,
  123. IWbemObjectSink *a_Sink
  124. ) ;
  125. public:
  126. CAggregator_IWbemProvider (
  127. WmiAllocator &m_Allocator ,
  128. CWbemGlobal_IWmiProviderController *a_Controller ,
  129. _IWmiProviderFactory *a_Factory ,
  130. IWbemServices *a_CoreRepositoryStub ,
  131. IWbemServices *a_CoreFullStub ,
  132. const ProviderCacheKey &a_Key ,
  133. const ULONG &a_Period ,
  134. IWbemContext *a_InitializationContext
  135. ) ;
  136. ~CAggregator_IWbemProvider () ;
  137. HRESULT SetInitialized ( HRESULT a_Result ) ;
  138. HRESULT IsIndependant ( IWbemContext *a_Context ) ;
  139. HRESULT Enum_ClassProviders ( IWbemContext *a_Context ) ;
  140. public:
  141. //Non-delegating object IUnknown
  142. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  143. STDMETHODIMP_( ULONG ) AddRef () ;
  144. STDMETHODIMP_( ULONG ) Release () ;
  145. /* IWbemServices methods */
  146. HRESULT STDMETHODCALLTYPE OpenNamespace (
  147. const BSTR a_Namespace ,
  148. long a_Flags ,
  149. IWbemContext *a_Context ,
  150. IWbemServices **a_Service ,
  151. IWbemCallResult **a_CallResult
  152. ) ;
  153. HRESULT STDMETHODCALLTYPE CancelAsyncCall (
  154. IWbemObjectSink *a_Sink
  155. ) ;
  156. HRESULT STDMETHODCALLTYPE QueryObjectSink (
  157. long a_Flags ,
  158. IWbemObjectSink **a_Sink
  159. ) ;
  160. HRESULT STDMETHODCALLTYPE GetObject (
  161. const BSTR a_ObjectPath ,
  162. long a_Flags ,
  163. IWbemContext *a_Context ,
  164. IWbemClassObject **ppObject ,
  165. IWbemCallResult **a_CallResult
  166. ) ;
  167. HRESULT STDMETHODCALLTYPE GetObjectAsync (
  168. const BSTR a_ObjectPath ,
  169. long a_Flags ,
  170. IWbemContext *a_Context ,
  171. IWbemObjectSink *a_Sink
  172. ) ;
  173. HRESULT STDMETHODCALLTYPE PutClass (
  174. IWbemClassObject *a_Object ,
  175. long a_Flags ,
  176. IWbemContext *a_Context ,
  177. IWbemCallResult **a_CallResult
  178. ) ;
  179. HRESULT STDMETHODCALLTYPE PutClassAsync (
  180. IWbemClassObject *a_Object ,
  181. long a_Flags ,
  182. IWbemContext *a_Context ,
  183. IWbemObjectSink *a_Sink
  184. ) ;
  185. HRESULT STDMETHODCALLTYPE DeleteClass (
  186. const BSTR a_Class ,
  187. long a_Flags ,
  188. IWbemContext *a_Context ,
  189. IWbemCallResult **a_CallResult
  190. ) ;
  191. HRESULT STDMETHODCALLTYPE DeleteClassAsync (
  192. const BSTR a_Class ,
  193. long a_Flags ,
  194. IWbemContext *a_Context ,
  195. IWbemObjectSink *a_Sink
  196. ) ;
  197. HRESULT STDMETHODCALLTYPE CreateClassEnum (
  198. const BSTR a_Superclass ,
  199. long a_Flags ,
  200. IWbemContext *a_Context ,
  201. IEnumWbemClassObject **a_Enum
  202. ) ;
  203. HRESULT STDMETHODCALLTYPE CreateClassEnumAsync (
  204. const BSTR a_Superclass ,
  205. long a_Flags ,
  206. IWbemContext *a_Context ,
  207. IWbemObjectSink *a_Sink
  208. ) ;
  209. HRESULT STDMETHODCALLTYPE PutInstance (
  210. IWbemClassObject *a_Instance ,
  211. long a_Flags ,
  212. IWbemContext *a_Context ,
  213. IWbemCallResult **a_CallResult
  214. ) ;
  215. HRESULT STDMETHODCALLTYPE PutInstanceAsync (
  216. IWbemClassObject *a_Instance ,
  217. long a_Flags ,
  218. IWbemContext *a_Context ,
  219. IWbemObjectSink *a_Sink
  220. ) ;
  221. HRESULT STDMETHODCALLTYPE DeleteInstance (
  222. const BSTR a_ObjectPath ,
  223. long a_Flags ,
  224. IWbemContext *a_Context ,
  225. IWbemCallResult **a_CallResult
  226. ) ;
  227. HRESULT STDMETHODCALLTYPE DeleteInstanceAsync (
  228. const BSTR a_ObjectPath,
  229. long a_Flags,
  230. IWbemContext *a_Context ,
  231. IWbemObjectSink *a_Sink
  232. ) ;
  233. HRESULT STDMETHODCALLTYPE CreateInstanceEnum (
  234. const BSTR a_Class ,
  235. long a_Flags ,
  236. IWbemContext *a_Context ,
  237. IEnumWbemClassObject **a_Enum
  238. ) ;
  239. HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync (
  240. const BSTR a_Class ,
  241. long a_Flags ,
  242. IWbemContext *a_Context ,
  243. IWbemObjectSink *a_Sink
  244. ) ;
  245. HRESULT STDMETHODCALLTYPE ExecQuery (
  246. const BSTR a_QueryLanguage,
  247. const BSTR a_Query,
  248. long a_Flags ,
  249. IWbemContext *a_Context ,
  250. IEnumWbemClassObject **a_Enum
  251. ) ;
  252. HRESULT STDMETHODCALLTYPE ExecQueryAsync (
  253. const BSTR a_QueryLanguage ,
  254. const BSTR a_Query ,
  255. long a_Flags ,
  256. IWbemContext *a_Context ,
  257. IWbemObjectSink *a_Sink
  258. ) ;
  259. HRESULT STDMETHODCALLTYPE ExecNotificationQuery (
  260. const BSTR a_QueryLanguage ,
  261. const BSTR a_Query ,
  262. long a_Flags ,
  263. IWbemContext *a_Context ,
  264. IEnumWbemClassObject **a_Enum
  265. ) ;
  266. HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync (
  267. const BSTR a_QueryLanguage ,
  268. const BSTR a_Query ,
  269. long a_Flags ,
  270. IWbemContext *a_Context ,
  271. IWbemObjectSink *a_Sink
  272. ) ;
  273. HRESULT STDMETHODCALLTYPE ExecMethod (
  274. const BSTR a_ObjectPath ,
  275. const BSTR a_MethodName ,
  276. long a_Flags ,
  277. IWbemContext *a_Context ,
  278. IWbemClassObject *a_InParams ,
  279. IWbemClassObject **a_OutParams ,
  280. IWbemCallResult **a_CallResult
  281. ) ;
  282. HRESULT STDMETHODCALLTYPE ExecMethodAsync (
  283. const BSTR a_ObjectPath ,
  284. const BSTR a_MethodName ,
  285. long a_Flags ,
  286. IWbemContext *a_Context ,
  287. IWbemClassObject *a_InParams ,
  288. IWbemObjectSink *a_Sink
  289. ) ;
  290. HRESULT STDMETHODCALLTYPE Initialize (
  291. long a_Flags ,
  292. IWbemContext *a_Context ,
  293. GUID *a_TransactionIdentifier,
  294. LPCWSTR a_User,
  295. LPCWSTR a_Locale,
  296. LPCWSTR a_Namespace ,
  297. IWbemServices *a_Repository ,
  298. IWbemServices *a_Service ,
  299. IWbemProviderInitSink *a_Sink
  300. ) ;
  301. HRESULT STDMETHODCALLTYPE WaitProvider ( IWbemContext *a_Context , ULONG a_Timeout ) ;
  302. HRESULT STDMETHODCALLTYPE GetInitializeResult ()
  303. {
  304. return m_InitializeResult ;
  305. }
  306. HRESULT STDMETHODCALLTYPE GetHosting ( ULONG *a_Value )
  307. {
  308. if ( a_Value )
  309. {
  310. *a_Value = e_Hosting_WmiCore ;
  311. return S_OK ;
  312. }
  313. else
  314. {
  315. return WBEM_E_INVALID_PARAMETER ;
  316. }
  317. }
  318. HRESULT STDMETHODCALLTYPE GetHostingGroup ( BSTR *a_Value )
  319. {
  320. if ( a_Value )
  321. {
  322. *a_Value = NULL ;
  323. return S_OK ;
  324. }
  325. else
  326. {
  327. return WBEM_E_INVALID_PARAMETER ;
  328. }
  329. }
  330. HRESULT STDMETHODCALLTYPE IsInternal ( BOOL *a_Value )
  331. {
  332. if ( a_Value )
  333. {
  334. *a_Value = TRUE ;
  335. return S_OK ;
  336. }
  337. else
  338. {
  339. return WBEM_E_INVALID_PARAMETER ;
  340. }
  341. }
  342. HRESULT STDMETHODCALLTYPE IsPerUserInitialization ( BOOL *a_Value )
  343. {
  344. if ( a_Value )
  345. {
  346. *a_Value = FALSE ;
  347. return S_OK ;
  348. }
  349. else
  350. {
  351. return WBEM_E_INVALID_PARAMETER ;
  352. }
  353. }
  354. HRESULT STDMETHODCALLTYPE IsPerLocaleInitialization ( BOOL *a_Value )
  355. {
  356. if ( a_Value )
  357. {
  358. *a_Value = FALSE ;
  359. return S_OK ;
  360. }
  361. else
  362. {
  363. return WBEM_E_INVALID_PARAMETER ;
  364. }
  365. }
  366. /* _IWmiProviderCache */
  367. HRESULT STDMETHODCALLTYPE Expel (
  368. long a_Flags ,
  369. IWbemContext *a_Context
  370. ) ;
  371. HRESULT STDMETHODCALLTYPE ForceReload () ;
  372. HRESULT STDMETHODCALLTYPE Shutdown (
  373. LONG a_Flags ,
  374. ULONG a_MaxMilliSeconds ,
  375. IWbemContext *a_Context
  376. ) ;
  377. /* _IWmiProviderAssociatorsHelper */
  378. HRESULT STDMETHODCALLTYPE GetReferencesClasses (
  379. long a_Flags ,
  380. IWbemContext *a_Context ,
  381. IWbemObjectSink *a_Sink
  382. ) ;
  383. } ;
  384. #endif // _Server_Aggregator_IWbemProvider_H