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.

1442 lines
44 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. ProvWsv.H
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _Server_Interceptor_IWbemServices_H
  9. #define _Server_Interceptor_IWbemServices_H
  10. #include <CGlobals.h>
  11. #include "ProvCache.h"
  12. #include "ProvRegInfo.h"
  13. #define ProxyIndex_IWbemServices 0
  14. #define ProxyIndex_IWbemPropertyProvider 1
  15. #define ProxyIndex_IWbemHiPerfProvider 2
  16. #define ProxyIndex_IWbemEventProvider 3
  17. #define ProxyIndex_IWbemEventProviderQuerySink 4
  18. #define ProxyIndex_IWbemEventProviderSecurity 5
  19. #define ProxyIndex_IWbemProviderIdentity 6
  20. #define ProxyIndex_IWbemEventConsumerProvider 7
  21. #define ProxyIndex_IWbemEventConsumerProviderEx 8
  22. #define ProxyIndex_IWbemUnboundObjectSink 9
  23. #define ProxyIndex_IWbemProviderInit 10
  24. #define ProxyIndex_Internal_IWbemServices 11
  25. #define ProxyIndex_Internal_IWbemPropertyProvider 12
  26. #define ProxyIndex_Internal_IWbemEventProvider 13
  27. #define ProxyIndex_Internal_IWbemEventProviderQuerySink 14
  28. #define ProxyIndex_Internal_IWbemEventProviderSecurity 15
  29. #define ProxyIndex_Internal_IWbemEventConsumerProvider 16
  30. #define ProxyIndex_Internal_IWbemEventConsumerProviderEx 17
  31. #define ProxyIndex_Internal_IWbemUnboundObjectSink 18
  32. #define ProxyIndex_Internal_IWbemProviderIdentity 19
  33. #define ProxyIndex_Internal_IWbemProviderInit 20
  34. #define ProxyIndex_IWbemShutdown 21
  35. #define ProxyIndex__IWmiProviderConfiguration 22
  36. #define ProxyIndex_Internal_IWmiProviderConfiguration 23
  37. #define ProxyIndex_Provider_Size 23
  38. #define ProxyIndex_UnBound_IWbemUnboundObjectSink 0
  39. #define ProxyIndex_UnBound_Internal_IWbemUnboundObjectSink 1
  40. #define ProxyIndex_UnBound_Size 2
  41. #define ProxyIndex_UnBoundSync_IWbemUnboundObjectSink 0
  42. #define ProxyIndex_UnBoundSync_Size 1
  43. /******************************************************************************
  44. *
  45. * Name:
  46. *
  47. *
  48. * Description:
  49. *
  50. *
  51. *****************************************************************************/
  52. class CInterceptor_IWbemSyncProvider : public IWbemServices,
  53. public IWbemPropertyProvider ,
  54. public IWbemEventProvider ,
  55. public IWbemEventProviderQuerySink ,
  56. public IWbemEventProviderSecurity ,
  57. public IWbemProviderIdentity ,
  58. public IWbemHiPerfProvider ,
  59. public SyncProviderContainerElement ,
  60. public CWbemGlobal_IWmiObjectSinkController
  61. {
  62. private:
  63. LONG m_ReferenceCount ;
  64. IUnknown *m_Unknown ;
  65. IWbemServices *m_Provider_IWbemServices ;
  66. IWbemPropertyProvider *m_Provider_IWbemPropertyProvider ;
  67. IWbemHiPerfProvider *m_Provider_IWbemHiPerfProvider ;
  68. IWbemEventProvider *m_Provider_IWbemEventProvider ;
  69. IWbemEventProviderQuerySink *m_Provider_IWbemEventProviderQuerySink ;
  70. IWbemEventProviderSecurity *m_Provider_IWbemEventProviderSecurity ;
  71. IWbemProviderIdentity *m_Provider_IWbemProviderIdentity ;
  72. IWbemEventConsumerProvider *m_Provider_IWbemEventConsumerProvider ;
  73. IWbemServices *m_CoreStub ;
  74. ProxyContainer m_ProxyContainer ;
  75. LONG m_Initialized ;
  76. HRESULT m_InitializeResult ;
  77. HANDLE m_InitializedEvent ;
  78. IWbemContext *m_InitializationContext ;
  79. public:
  80. HRESULT SetInitialized ( HRESULT a_InitializeResult ) ;
  81. public:
  82. CServerObject_ProviderRegistrationV1 *m_Registration ;
  83. BSTR m_Locale ;
  84. BSTR m_User ;
  85. BSTR m_Namespace ;
  86. BSTR m_TransactionIdentifier ;
  87. UINT64 m_ProviderOperation_GetObjectAsync ;
  88. UINT64 m_ProviderOperation_PutClassAsync ;
  89. UINT64 m_ProviderOperation_DeleteClassAsync ;
  90. UINT64 m_ProviderOperation_CreateClassEnumAsync ;
  91. UINT64 m_ProviderOperation_PutInstanceAsync ;
  92. UINT64 m_ProviderOperation_DeleteInstanceAsync ;
  93. UINT64 m_ProviderOperation_CreateInstanceEnumAsync ;
  94. UINT64 m_ProviderOperation_ExecQueryAsync ;
  95. UINT64 m_ProviderOperation_ExecNotificationQueryAsync ;
  96. UINT64 m_ProviderOperation_ExecMethodAsync ;
  97. UINT64 m_ProviderOperation_Begin ;
  98. UINT64 m_ProviderOperation_Rollback ;
  99. UINT64 m_ProviderOperation_Commit ;
  100. UINT64 m_ProviderOperation_QueryState ;
  101. UINT64 m_ProviderOperation_QueryInstances ;
  102. UINT64 m_ProviderOperation_CreateRefresher ;
  103. UINT64 m_ProviderOperation_CreateRefreshableObject ;
  104. UINT64 m_ProviderOperation_StopRefreshing ;
  105. UINT64 m_ProviderOperation_CreateRefreshableEnum ;
  106. UINT64 m_ProviderOperation_GetObjects ;
  107. UINT64 m_ProviderOperation_GetProperty ;
  108. UINT64 m_ProviderOperation_PutProperty ;
  109. UINT64 m_ProviderOperation_ProvideEvents ;
  110. UINT64 m_ProviderOperation_NewQuery ;
  111. UINT64 m_ProviderOperation_CancelQuery ;
  112. UINT64 m_ProviderOperation_AccessCheck ;
  113. UINT64 m_ProviderOperation_SetRegistrationObject ;
  114. UINT64 m_ProviderOperation_FindConsumer ;
  115. UINT64 m_ProviderOperation_ValidateSubscription ;
  116. UINT64 m_ProviderOperation_OpenAsync ;
  117. UINT64 m_ProviderOperation_AddAsync ;
  118. UINT64 m_ProviderOperation_RemoveAsync ;
  119. UINT64 m_ProviderOperation_RefreshObjectAsync ;
  120. UINT64 m_ProviderOperation_RenameObjectAsync ;
  121. UINT64 m_ProviderOperation_DeleteObjectAsync ;
  122. UINT64 m_ProviderOperation_PutObjectAsync ;
  123. void Increment_ProviderOperation_GetObjectAsync () { m_ProviderOperation_GetObjectAsync ++ ; }
  124. void Increment_ProviderOperation_PutClassAsync () { m_ProviderOperation_PutClassAsync ++ ; }
  125. void Increment_ProviderOperation_DeleteClassAsync () { m_ProviderOperation_DeleteClassAsync ++ ; }
  126. void Increment_ProviderOperation_CreateClassEnumAsync () { m_ProviderOperation_CreateClassEnumAsync ++ ; }
  127. void Increment_ProviderOperation_PutInstanceAsync () { m_ProviderOperation_PutInstanceAsync ++ ; }
  128. void Increment_ProviderOperation_DeleteInstanceAsync () { m_ProviderOperation_DeleteInstanceAsync ++ ; }
  129. void Increment_ProviderOperation_CreateInstanceEnumAsync () { m_ProviderOperation_CreateInstanceEnumAsync ++ ; }
  130. void Increment_ProviderOperation_ExecQueryAsync () { m_ProviderOperation_ExecQueryAsync ++ ; }
  131. void Increment_ProviderOperation_ExecNotificationQueryAsync () { m_ProviderOperation_ExecNotificationQueryAsync ++ ; }
  132. void Increment_ProviderOperation_ExecMethodAsync () { m_ProviderOperation_ExecMethodAsync ++ ; }
  133. void Increment_ProviderOperation_Begin () { m_ProviderOperation_Begin ++ ; }
  134. void Increment_ProviderOperation_Rollback () { m_ProviderOperation_Rollback ++ ; }
  135. void Increment_ProviderOperation_Commit () { m_ProviderOperation_Commit ++ ; }
  136. void Increment_ProviderOperation_QueryState () { m_ProviderOperation_QueryState ++ ; }
  137. void Increment_ProviderOperation_QueryInstances () { m_ProviderOperation_QueryInstances ++ ; }
  138. void Increment_ProviderOperation_CreateRefresher () { m_ProviderOperation_CreateRefresher ++ ; }
  139. void Increment_ProviderOperation_CreateRefreshableObject () { m_ProviderOperation_CreateRefreshableObject ++ ; }
  140. void Increment_ProviderOperation_StopRefreshing () { m_ProviderOperation_StopRefreshing ++ ; }
  141. void Increment_ProviderOperation_CreateRefreshableEnum () { m_ProviderOperation_CreateRefreshableEnum ++ ; }
  142. void Increment_ProviderOperation_GetObjects () { m_ProviderOperation_GetObjects ++ ; }
  143. void Increment_ProviderOperation_GetProperty () { m_ProviderOperation_GetProperty ++ ; }
  144. void Increment_ProviderOperation_PutProperty () { m_ProviderOperation_PutProperty ++ ; }
  145. void Increment_ProviderOperation_ProvideEvents () { m_ProviderOperation_ProvideEvents ++ ; }
  146. void Increment_ProviderOperation_NewQuery () { m_ProviderOperation_NewQuery ++ ; }
  147. void Increment_ProviderOperation_CancelQuery () { m_ProviderOperation_CancelQuery ++ ; }
  148. void Increment_ProviderOperation_AccessCheck () { m_ProviderOperation_AccessCheck ++ ; }
  149. void Increment_ProviderOperation_SetRegistrationObject () { m_ProviderOperation_SetRegistrationObject ++ ; }
  150. void Increment_ProviderOperation_FindConsumer () { m_ProviderOperation_FindConsumer ++ ; }
  151. void Increment_ProviderOperation_ValidateSubscription () { m_ProviderOperation_ValidateSubscription ++ ; }
  152. void Increment_ProviderOperation_OpenAsync () { m_ProviderOperation_OpenAsync ++ ; }
  153. void Increment_ProviderOperation_AddAsync () { m_ProviderOperation_AddAsync ++ ; }
  154. void Increment_ProviderOperation_RemoveAsync () { m_ProviderOperation_RemoveAsync ++ ; }
  155. void Increment_ProviderOperation_RefreshObjectAsync () { m_ProviderOperation_RefreshObjectAsync ++ ; }
  156. void Increment_ProviderOperation_RenameObjectAsync () { m_ProviderOperation_RenameObjectAsync ++ ; }
  157. void Increment_ProviderOperation_DeleteObjectAsync () { m_ProviderOperation_DeleteObjectAsync ++ ; }
  158. void Increment_ProviderOperation_PutObjectAsync () { m_ProviderOperation_PutObjectAsync ++ ; }
  159. UINT64 Get_ProviderOperation_GetObjectAsync () { return m_ProviderOperation_GetObjectAsync ; }
  160. UINT64 Get_ProviderOperation_PutClassAsync () { return m_ProviderOperation_PutClassAsync ; }
  161. UINT64 Get_ProviderOperation_DeleteClassAsync () { return m_ProviderOperation_DeleteClassAsync ; }
  162. UINT64 Get_ProviderOperation_CreateClassEnumAsync () { return m_ProviderOperation_CreateClassEnumAsync ; }
  163. UINT64 Get_ProviderOperation_PutInstanceAsync () { return m_ProviderOperation_PutInstanceAsync ; }
  164. UINT64 Get_ProviderOperation_DeleteInstanceAsync () { return m_ProviderOperation_DeleteInstanceAsync ; }
  165. UINT64 Get_ProviderOperation_CreateInstanceEnumAsync () { return m_ProviderOperation_CreateInstanceEnumAsync ; }
  166. UINT64 Get_ProviderOperation_ExecQueryAsync () { return m_ProviderOperation_ExecQueryAsync ; }
  167. UINT64 Get_ProviderOperation_ExecNotificationQueryAsync () { return m_ProviderOperation_ExecNotificationQueryAsync ; }
  168. UINT64 Get_ProviderOperation_ExecMethodAsync () { return m_ProviderOperation_ExecMethodAsync ; }
  169. UINT64 Get_ProviderOperation_Begin () { return m_ProviderOperation_Begin ; }
  170. UINT64 Get_ProviderOperation_Rollback () { return m_ProviderOperation_Rollback ; }
  171. UINT64 Get_ProviderOperation_Commit () { return m_ProviderOperation_Commit ; }
  172. UINT64 Get_ProviderOperation_QueryState () { return m_ProviderOperation_QueryState ; }
  173. UINT64 Get_ProviderOperation_QueryInstances () { return m_ProviderOperation_QueryInstances ; }
  174. UINT64 Get_ProviderOperation_CreateRefresher () { return m_ProviderOperation_CreateRefresher ; }
  175. UINT64 Get_ProviderOperation_CreateRefreshableObject () { return m_ProviderOperation_CreateRefreshableObject ; }
  176. UINT64 Get_ProviderOperation_StopRefreshing () { return m_ProviderOperation_StopRefreshing ; }
  177. UINT64 Get_ProviderOperation_CreateRefreshableEnum () { return m_ProviderOperation_CreateRefreshableEnum ; }
  178. UINT64 Get_ProviderOperation_GetObjects () { return m_ProviderOperation_GetObjects ; }
  179. UINT64 Get_ProviderOperation_GetProperty () { return m_ProviderOperation_GetProperty ; }
  180. UINT64 Get_ProviderOperation_PutProperty () { return m_ProviderOperation_PutProperty ; }
  181. UINT64 Get_ProviderOperation_ProvideEvents () { return m_ProviderOperation_ProvideEvents ; }
  182. UINT64 Get_ProviderOperation_NewQuery () { return m_ProviderOperation_NewQuery ; }
  183. UINT64 Get_ProviderOperation_CancelQuery () { return m_ProviderOperation_CancelQuery ; }
  184. UINT64 Get_ProviderOperation_AccessCheck () { return m_ProviderOperation_AccessCheck ; }
  185. UINT64 Get_ProviderOperation_SetRegistrationObject () { return m_ProviderOperation_SetRegistrationObject ; }
  186. UINT64 Get_ProviderOperation_FindConsumer () { return m_ProviderOperation_FindConsumer ; }
  187. UINT64 Get_ProviderOperation_ValidateSubscription () { return m_ProviderOperation_ValidateSubscription ; }
  188. UINT64 Get_ProviderOperation_OpenAsync () { return m_ProviderOperation_OpenAsync ; }
  189. UINT64 Get_ProviderOperation_AddAsync () { return m_ProviderOperation_AddAsync ; }
  190. UINT64 Get_ProviderOperation_RemoveAsync () { return m_ProviderOperation_RemoveAsync ; }
  191. UINT64 Get_ProviderOperation_RefreshObjectAsync () { return m_ProviderOperation_RefreshObjectAsync ; }
  192. UINT64 Get_ProviderOperation_RenameObjectAsync () { return m_ProviderOperation_RenameObjectAsync ; }
  193. UINT64 Get_ProviderOperation_DeleteObjectAsync () { return m_ProviderOperation_RenameObjectAsync ; }
  194. UINT64 Get_ProviderOperation_PutObjectAsync () { return m_ProviderOperation_PutObjectAsync ; }
  195. private:
  196. HRESULT AdjustGetContext (
  197. IWbemContext *a_Context
  198. ) ;
  199. HRESULT Helper_HiPerfGetObjectAsync (
  200. IWbemHiPerfProvider *a_HighPerformanceProvider ,
  201. const BSTR a_ObjectPath ,
  202. long a_Flags ,
  203. IWbemContext *a_Context ,
  204. IWbemObjectSink *a_Sink
  205. ) ;
  206. HRESULT Helper_GetObjectAsync (
  207. BOOL a_IsProxy ,
  208. const BSTR a_ObjectPath ,
  209. long a_Flags ,
  210. IWbemContext *a_Context ,
  211. IWbemObjectSink *a_Sink ,
  212. IWbemServices *a_Service
  213. ) ;
  214. HRESULT Helper_PutClassAsync (
  215. BOOL a_IsProxy ,
  216. IWbemClassObject *a_Object ,
  217. long a_Flags ,
  218. IWbemContext FAR *a_Context ,
  219. IWbemObjectSink *a_Sink ,
  220. IWbemServices *a_Service
  221. ) ;
  222. HRESULT Helper_DeleteClassAsync (
  223. BOOL a_IsProxy ,
  224. const BSTR a_Class ,
  225. long a_Flags ,
  226. IWbemContext FAR *a_Context ,
  227. IWbemObjectSink *a_Sink ,
  228. IWbemServices *a_Service
  229. ) ;
  230. HRESULT Helper_CreateClassEnumAsync (
  231. BOOL a_IsProxy ,
  232. const BSTR a_SuperClass ,
  233. long a_Flags ,
  234. IWbemContext FAR *a_Context ,
  235. IWbemObjectSink *a_Sink ,
  236. IWbemServices *a_Service
  237. ) ;
  238. HRESULT Helper_PutInstanceAsync (
  239. BOOL a_IsProxy ,
  240. IWbemClassObject *a_Instance ,
  241. long a_Flags ,
  242. IWbemContext FAR *a_Context ,
  243. IWbemObjectSink *a_Sink ,
  244. IWbemServices *a_Service
  245. ) ;
  246. HRESULT Helper_DeleteInstanceAsync (
  247. BOOL a_IsProxy ,
  248. const BSTR a_ObjectPath ,
  249. long a_Flags ,
  250. IWbemContext FAR *a_Context ,
  251. IWbemObjectSink *a_Sink ,
  252. IWbemServices *a_Service
  253. ) ;
  254. HRESULT Helper_CreateInstanceEnumAsync (
  255. BOOL a_IsProxy ,
  256. const BSTR a_Class ,
  257. long a_Flags ,
  258. IWbemContext *a_Context ,
  259. IWbemObjectSink *a_Sink ,
  260. IWbemServices *a_Service
  261. ) ;
  262. HRESULT Helper_QueryInstancesAsync (
  263. IWbemHiPerfProvider *a_PerformanceProvider ,
  264. const BSTR a_Class ,
  265. long a_Flags ,
  266. IWbemContext *a_Context ,
  267. IWbemObjectSink *a_Sink
  268. ) ;
  269. HRESULT Helper_ExecQueryAsync (
  270. BOOL a_IsProxy ,
  271. const BSTR a_QueryLanguage ,
  272. const BSTR a_Query,
  273. long a_Flags ,
  274. IWbemContext FAR *a_Context ,
  275. IWbemObjectSink *a_Sink ,
  276. IWbemServices *a_Service
  277. ) ;
  278. HRESULT Helper_ExecMethodAsync (
  279. BOOL a_IsProxy ,
  280. const BSTR a_ObjectPath ,
  281. const BSTR a_MethodName ,
  282. long a_Flags ,
  283. IWbemContext *a_Context ,
  284. IWbemClassObject *a_InParams ,
  285. IWbemObjectSink *a_Sink ,
  286. IWbemServices *a_Service
  287. ) ;
  288. public:
  289. CInterceptor_IWbemSyncProvider (
  290. WmiAllocator &a_Allocator ,
  291. IUnknown *a_ClientSideUnknown ,
  292. IUnknown *a_ServerSideUnknown ,
  293. IWbemServices *a_CoreStub ,
  294. CWbemGlobal_IWbemSyncProviderController *a_Controller ,
  295. CServerObject_ProviderRegistrationV1 &a_Registration ,
  296. GUID &a_Guid
  297. ) ;
  298. ~CInterceptor_IWbemSyncProvider () ;
  299. public:
  300. //Non-delegating object IUnknown
  301. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  302. STDMETHODIMP_( ULONG ) AddRef () ;
  303. STDMETHODIMP_( ULONG ) Release () ;
  304. /* IWbemServices methods */
  305. HRESULT STDMETHODCALLTYPE OpenNamespace (
  306. const BSTR a_Namespace ,
  307. long a_Flags ,
  308. IWbemContext *a_Context ,
  309. IWbemServices **a_Service ,
  310. IWbemCallResult **a_CallResult
  311. ) ;
  312. HRESULT STDMETHODCALLTYPE CancelAsyncCall (
  313. IWbemObjectSink *a_Sink
  314. ) ;
  315. HRESULT STDMETHODCALLTYPE QueryObjectSink (
  316. long a_Flags ,
  317. IWbemObjectSink **a_Sink
  318. ) ;
  319. HRESULT STDMETHODCALLTYPE GetObject (
  320. const BSTR a_ObjectPath ,
  321. long a_Flags ,
  322. IWbemContext *a_Context ,
  323. IWbemClassObject **ppObject ,
  324. IWbemCallResult **a_CallResult
  325. ) ;
  326. HRESULT STDMETHODCALLTYPE GetObjectAsync (
  327. const BSTR a_ObjectPath ,
  328. long a_Flags ,
  329. IWbemContext *a_Context ,
  330. IWbemObjectSink *a_Sink
  331. ) ;
  332. HRESULT STDMETHODCALLTYPE PutClass (
  333. IWbemClassObject *a_Object ,
  334. long a_Flags ,
  335. IWbemContext *a_Context ,
  336. IWbemCallResult **a_CallResult
  337. ) ;
  338. HRESULT STDMETHODCALLTYPE PutClassAsync (
  339. IWbemClassObject *a_Object ,
  340. long a_Flags ,
  341. IWbemContext *a_Context ,
  342. IWbemObjectSink *a_Sink
  343. ) ;
  344. HRESULT STDMETHODCALLTYPE DeleteClass (
  345. const BSTR a_Class ,
  346. long a_Flags ,
  347. IWbemContext *a_Context ,
  348. IWbemCallResult **a_CallResult
  349. ) ;
  350. HRESULT STDMETHODCALLTYPE DeleteClassAsync (
  351. const BSTR a_Class ,
  352. long a_Flags ,
  353. IWbemContext *a_Context ,
  354. IWbemObjectSink *a_Sink
  355. ) ;
  356. HRESULT STDMETHODCALLTYPE CreateClassEnum (
  357. const BSTR a_Superclass ,
  358. long a_Flags ,
  359. IWbemContext *a_Context ,
  360. IEnumWbemClassObject **a_Enum
  361. ) ;
  362. HRESULT STDMETHODCALLTYPE CreateClassEnumAsync (
  363. const BSTR a_Superclass ,
  364. long a_Flags ,
  365. IWbemContext *a_Context ,
  366. IWbemObjectSink *a_Sink
  367. ) ;
  368. HRESULT STDMETHODCALLTYPE PutInstance (
  369. IWbemClassObject *a_Instance ,
  370. long a_Flags ,
  371. IWbemContext *a_Context ,
  372. IWbemCallResult **a_CallResult
  373. ) ;
  374. HRESULT STDMETHODCALLTYPE PutInstanceAsync (
  375. IWbemClassObject *a_Instance ,
  376. long a_Flags ,
  377. IWbemContext *a_Context ,
  378. IWbemObjectSink *a_Sink
  379. ) ;
  380. HRESULT STDMETHODCALLTYPE DeleteInstance (
  381. const BSTR a_ObjectPath ,
  382. long a_Flags ,
  383. IWbemContext *a_Context ,
  384. IWbemCallResult **a_CallResult
  385. ) ;
  386. HRESULT STDMETHODCALLTYPE DeleteInstanceAsync (
  387. const BSTR a_ObjectPath,
  388. long a_Flags,
  389. IWbemContext *a_Context ,
  390. IWbemObjectSink *a_Sink
  391. ) ;
  392. HRESULT STDMETHODCALLTYPE CreateInstanceEnum (
  393. const BSTR a_Class ,
  394. long a_Flags ,
  395. IWbemContext *a_Context ,
  396. IEnumWbemClassObject **a_Enum
  397. ) ;
  398. HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync (
  399. const BSTR a_Class ,
  400. long a_Flags ,
  401. IWbemContext *a_Context ,
  402. IWbemObjectSink *a_Sink
  403. ) ;
  404. HRESULT STDMETHODCALLTYPE ExecQuery (
  405. const BSTR a_QueryLanguage,
  406. const BSTR a_Query,
  407. long a_Flags ,
  408. IWbemContext *a_Context ,
  409. IEnumWbemClassObject **a_Enum
  410. ) ;
  411. HRESULT STDMETHODCALLTYPE ExecQueryAsync (
  412. const BSTR a_QueryLanguage ,
  413. const BSTR a_Query ,
  414. long a_Flags ,
  415. IWbemContext *a_Context ,
  416. IWbemObjectSink *a_Sink
  417. ) ;
  418. HRESULT STDMETHODCALLTYPE ExecNotificationQuery (
  419. const BSTR a_QueryLanguage ,
  420. const BSTR a_Query ,
  421. long a_Flags ,
  422. IWbemContext *a_Context ,
  423. IEnumWbemClassObject **a_Enum
  424. ) ;
  425. HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync (
  426. const BSTR a_QueryLanguage ,
  427. const BSTR a_Query ,
  428. long a_Flags ,
  429. IWbemContext *a_Context ,
  430. IWbemObjectSink *a_Sink
  431. ) ;
  432. HRESULT STDMETHODCALLTYPE ExecMethod (
  433. const BSTR a_ObjectPath ,
  434. const BSTR a_MethodName ,
  435. long a_Flags ,
  436. IWbemContext *a_Context ,
  437. IWbemClassObject *a_InParams ,
  438. IWbemClassObject **a_OutParams ,
  439. IWbemCallResult **a_CallResult
  440. ) ;
  441. HRESULT STDMETHODCALLTYPE ExecMethodAsync (
  442. const BSTR a_ObjectPath ,
  443. const BSTR a_MethodName ,
  444. long a_Flags ,
  445. IWbemContext *a_Context ,
  446. IWbemClassObject *a_InParams ,
  447. IWbemObjectSink *a_Sink
  448. ) ;
  449. /* IWbemPropertyProvider */
  450. HRESULT STDMETHODCALLTYPE GetProperty (
  451. long a_Flags ,
  452. const BSTR a_Locale ,
  453. const BSTR a_ClassMapping ,
  454. const BSTR a_InstanceMapping ,
  455. const BSTR a_PropertyMapping ,
  456. VARIANT *a_Value
  457. ) ;
  458. HRESULT STDMETHODCALLTYPE PutProperty (
  459. long a_Flags ,
  460. const BSTR a_Locale ,
  461. const BSTR a_ClassMapping ,
  462. const BSTR a_InstanceMapping ,
  463. const BSTR a_PropertyMapping ,
  464. const VARIANT *a_Value
  465. ) ;
  466. /* IWbemEventProvider */
  467. HRESULT STDMETHODCALLTYPE ProvideEvents (
  468. IWbemObjectSink *a_Sink ,
  469. long a_Flags
  470. ) ;
  471. /* IWbemEventProviderQuerySink */
  472. HRESULT STDMETHODCALLTYPE NewQuery (
  473. unsigned long a_Id ,
  474. WBEM_WSTR a_QueryLanguage ,
  475. WBEM_WSTR a_Query
  476. );
  477. HRESULT STDMETHODCALLTYPE CancelQuery (
  478. unsigned long a_Id
  479. ) ;
  480. /* IWbemEventProviderSecurity */
  481. HRESULT STDMETHODCALLTYPE AccessCheck (
  482. WBEM_CWSTR a_QueryLanguage ,
  483. WBEM_CWSTR a_Query ,
  484. long a_SidLength ,
  485. const BYTE *a_Sid
  486. ) ;
  487. /* IWbemProviderIdentity */
  488. HRESULT STDMETHODCALLTYPE SetRegistrationObject (
  489. long a_Flags ,
  490. IWbemClassObject *a_ProviderRegistration
  491. ) ;
  492. /* IWbemEventConsumerProvider */
  493. HRESULT STDMETHODCALLTYPE FindConsumer (
  494. IWbemClassObject *a_LogicalConsumer ,
  495. IWbemUnboundObjectSink **a_Consumer
  496. );
  497. /* IWbemHiPerfProvider */
  498. HRESULT STDMETHODCALLTYPE QueryInstances (
  499. IWbemServices *a_Namespace ,
  500. WCHAR *a_Class ,
  501. long a_Flags ,
  502. IWbemContext *a_Context ,
  503. IWbemObjectSink *a_Sink
  504. ) ;
  505. HRESULT STDMETHODCALLTYPE CreateRefresher (
  506. IWbemServices *a_Namespace ,
  507. long a_Flags ,
  508. IWbemRefresher **a_Refresher
  509. ) ;
  510. HRESULT STDMETHODCALLTYPE CreateRefreshableObject (
  511. IWbemServices *a_Namespace ,
  512. IWbemObjectAccess *a_Template ,
  513. IWbemRefresher *a_Refresher ,
  514. long a_Flags ,
  515. IWbemContext *a_Context ,
  516. IWbemObjectAccess **a_Refreshable ,
  517. long *a_Id
  518. ) ;
  519. HRESULT STDMETHODCALLTYPE StopRefreshing (
  520. IWbemRefresher *a_Refresher ,
  521. long a_Id ,
  522. long a_Flags
  523. ) ;
  524. HRESULT STDMETHODCALLTYPE CreateRefreshableEnum (
  525. IWbemServices *a_Namespace ,
  526. LPCWSTR a_Class ,
  527. IWbemRefresher *a_Refresher ,
  528. long a_Flags ,
  529. IWbemContext *a_Context ,
  530. IWbemHiPerfEnum *a_HiPerfEnum ,
  531. long *a_Id
  532. ) ;
  533. HRESULT STDMETHODCALLTYPE GetObjects (
  534. IWbemServices *a_Namespace ,
  535. long a_ObjectCount ,
  536. IWbemObjectAccess **a_Objects ,
  537. long a_Flags ,
  538. IWbemContext *a_Context
  539. ) ;
  540. HRESULT STDMETHODCALLTYPE Initialize (LPWSTR a_User ,
  541. LONG a_Flags ,
  542. LPWSTR a_Namespace ,
  543. LPWSTR a_Locale ,
  544. IWbemServices *a_Service ,
  545. IWbemContext *a_Context ,
  546. IWbemProviderInitSink *a_Sink) ;
  547. HRESULT STDMETHODCALLTYPE WaitProvider ( IWbemContext *a_Context , ULONG a_Timeout ) ;
  548. HRESULT STDMETHODCALLTYPE GetInitializeResult ()
  549. {
  550. return m_InitializeResult ;
  551. }
  552. HRESULT STDMETHODCALLTYPE IsPerUserInitialization ( BOOL *a_Value )
  553. {
  554. return WBEM_E_NOT_AVAILABLE ;
  555. }
  556. HRESULT STDMETHODCALLTYPE IsPerLocaleInitialization ( BOOL *a_Value )
  557. {
  558. return WBEM_E_NOT_AVAILABLE ;
  559. }
  560. // IWmi_UnInitialize members
  561. HRESULT STDMETHODCALLTYPE Shutdown (
  562. LONG a_Flags ,
  563. ULONG a_MaxMilliSeconds ,
  564. IWbemContext *a_Context
  565. ) ;
  566. } ;
  567. /******************************************************************************
  568. *
  569. * Name:
  570. *
  571. *
  572. * Description:
  573. *
  574. *
  575. *****************************************************************************/
  576. class CDecoupled_IWbemUnboundObjectSink : public IWbemUnboundObjectSink ,
  577. public IWbemShutdown ,
  578. public VoidPointerContainerElement
  579. {
  580. private:
  581. WmiAllocator &m_Allocator ;
  582. CServerObject_ProviderRegistrationV1 *m_Registration ;
  583. _IWmiProviderAbnormalShutdown *m_Controller ;
  584. IUnknown *m_Unknown ;
  585. IWbemUnboundObjectSink *m_Provider_IWbemUnboundObjectSink ;
  586. Internal_IWbemUnboundObjectSink *m_Provider_Internal_IWbemUnboundObjectSink ;
  587. ProxyContainer m_ProxyContainer ;
  588. DWORD m_ProcessIdentifier ;
  589. HRESULT m_InitializeResult ;
  590. protected:
  591. HRESULT Begin_Interface (
  592. IUnknown *a_ServerInterface ,
  593. REFIID a_InterfaceIdentifier ,
  594. DWORD a_ProxyIndex ,
  595. IUnknown *a_InternalServerInterface ,
  596. REFIID a_InternalInterfaceIdentifier ,
  597. DWORD a_InternalProxyIndex ,
  598. DWORD a_ProcessIdentifier ,
  599. HANDLE &a_IdentifyToken ,
  600. BOOL &a_Impersonating ,
  601. IUnknown *&a_OldContext ,
  602. IServerSecurity *&a_OldSecurity ,
  603. BOOL &a_IsProxy ,
  604. IUnknown *&a_Interface ,
  605. BOOL &a_Revert ,
  606. IUnknown *&a_Proxy ,
  607. IWbemContext *a_Context = NULL
  608. ) ;
  609. HRESULT End_Interface (
  610. IUnknown *a_ServerInterface ,
  611. REFIID a_InterfaceIdentifier ,
  612. DWORD a_ProxyIndex ,
  613. IUnknown *a_InternalServerInterface ,
  614. REFIID a_InternalInterfaceIdentifier ,
  615. DWORD a_InternalProxyIndex ,
  616. DWORD a_ProcessIdentifier ,
  617. HANDLE a_IdentifyToken ,
  618. BOOL a_Impersonating ,
  619. IUnknown *a_OldContext ,
  620. IServerSecurity *a_OldSecurity ,
  621. BOOL a_IsProxy ,
  622. IUnknown *a_Interface ,
  623. BOOL a_Revert ,
  624. IUnknown *a_Proxy
  625. ) ;
  626. public:
  627. CDecoupled_IWbemUnboundObjectSink (
  628. WmiAllocator &a_Allocator ,
  629. IUnknown *a_ServerSideProvider ,
  630. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  631. CServerObject_ProviderRegistrationV1 &a_Registration
  632. ) ;
  633. ~CDecoupled_IWbemUnboundObjectSink () ;
  634. HRESULT Initialize () ;
  635. public:
  636. STDMETHODIMP QueryInterface (
  637. REFIID iid ,
  638. LPVOID FAR *iplpv
  639. ) ;
  640. STDMETHODIMP_( ULONG ) AddRef () ;
  641. STDMETHODIMP_( ULONG ) Release () ;
  642. HRESULT STDMETHODCALLTYPE IndicateToConsumer (
  643. IWbemClassObject *a_LogicalConsumer ,
  644. long a_ObjectCount ,
  645. IWbemClassObject **a_Objects
  646. ) ;
  647. HRESULT STDMETHODCALLTYPE Shutdown (
  648. LONG a_Flags ,
  649. ULONG a_MaxMilliSeconds ,
  650. IWbemContext *a_Context
  651. ) ;
  652. } ;
  653. /******************************************************************************
  654. *
  655. * Name:
  656. *
  657. *
  658. * Description:
  659. *
  660. *
  661. *****************************************************************************/
  662. class CInterceptor_IWbemDecoupledProvider : public IWbemServices ,
  663. public IWbemPropertyProvider ,
  664. public IWbemEventProvider ,
  665. public IWbemEventProviderQuerySink ,
  666. public IWbemEventProviderSecurity ,
  667. public IWbemProviderInit ,
  668. public IWbemProviderIdentity ,
  669. public IWbemEventConsumerProviderEx ,
  670. public IWbemUnboundObjectSink ,
  671. public IWbemShutdown ,
  672. public _IWmiProviderInitialize ,
  673. public _IWmiProviderAbnormalShutdown ,
  674. public SyncProviderContainerElement ,
  675. public CWbemGlobal_IWmiObjectSinkController
  676. {
  677. private:
  678. IUnknown *m_Unknown ;
  679. IWbemServices *m_Provider_IWbemServices ;
  680. IWbemPropertyProvider *m_Provider_IWbemPropertyProvider ;
  681. IWbemEventProvider *m_Provider_IWbemEventProvider ;
  682. IWbemEventProviderQuerySink *m_Provider_IWbemEventProviderQuerySink ;
  683. IWbemEventProviderSecurity *m_Provider_IWbemEventProviderSecurity ;
  684. IWbemEventConsumerProvider *m_Provider_IWbemEventConsumerProvider ;
  685. IWbemEventConsumerProviderEx *m_Provider_IWbemEventConsumerProviderEx ;
  686. IWbemUnboundObjectSink *m_Provider_IWbemUnboundObjectSink ;
  687. IWbemProviderInit *m_Provider_IWbemProviderInit ;
  688. IWbemProviderIdentity *m_Provider_IWbemProviderIdentity ;
  689. Internal_IWbemServices *m_Provider_Internal_IWbemServices ;
  690. Internal_IWbemPropertyProvider *m_Provider_Internal_IWbemPropertyProvider ;
  691. Internal_IWbemEventProvider *m_Provider_Internal_IWbemEventProvider ;
  692. Internal_IWbemEventProviderQuerySink *m_Provider_Internal_IWbemEventProviderQuerySink ;
  693. Internal_IWbemEventProviderSecurity *m_Provider_Internal_IWbemEventProviderSecurity ;
  694. Internal_IWbemEventConsumerProvider *m_Provider_Internal_IWbemEventConsumerProvider ;
  695. Internal_IWbemEventConsumerProviderEx *m_Provider_Internal_IWbemEventConsumerProviderEx ;
  696. Internal_IWbemUnboundObjectSink *m_Provider_Internal_IWbemUnboundObjectSink ;
  697. Internal_IWmiProviderConfiguration *m_Provider_Internal_IWmiProviderConfiguration ;
  698. Internal_IWbemProviderInit *m_Provider_Internal_IWbemProviderInit ;
  699. Internal_IWbemProviderIdentity *m_Provider_Internal_IWbemProviderIdentity ;
  700. IWbemServices *m_CoreStub ;
  701. IWbemClassObject *m_ExtendedStatusObject ;
  702. WmiAllocator &m_Allocator ;
  703. ProxyContainer m_ProxyContainer ;
  704. LONG m_Initialized ;
  705. HRESULT m_InitializeResult ;
  706. HANDLE m_InitializedEvent ;
  707. IWbemContext *m_InitializationContext ;
  708. DWORD m_ProcessIdentifier ;
  709. HRESULT Begin_Interface (
  710. IUnknown *a_ServerInterface ,
  711. REFIID a_InterfaceIdentifier ,
  712. DWORD a_ProxyIndex ,
  713. IUnknown *a_InternalServerInterface ,
  714. REFIID a_InternalInterfaceIdentifier ,
  715. DWORD a_InternalProxyIndex ,
  716. DWORD a_ProcessIdentifier ,
  717. HANDLE &a_IdentifyToken ,
  718. BOOL &a_Impersonating ,
  719. IUnknown *&a_OldContext ,
  720. IServerSecurity *&a_OldSecurity ,
  721. BOOL &a_IsProxy ,
  722. IUnknown *&a_Interface ,
  723. BOOL &a_Revert ,
  724. IUnknown *&a_Proxy ,
  725. IWbemContext *a_Context = NULL
  726. ) ;
  727. HRESULT End_Interface (
  728. IUnknown *a_ServerInterface ,
  729. REFIID a_InterfaceIdentifier ,
  730. DWORD a_ProxyIndex ,
  731. IUnknown *a_InternalServerInterface ,
  732. REFIID a_InternalInterfaceIdentifier ,
  733. DWORD a_InternalProxyIndex ,
  734. DWORD a_ProcessIdentifier ,
  735. HANDLE a_IdentifyToken ,
  736. BOOL a_Impersonating ,
  737. IUnknown *a_OldContext ,
  738. IServerSecurity *a_OldSecurity ,
  739. BOOL a_IsProxy ,
  740. IUnknown *a_Interface ,
  741. BOOL a_Revert ,
  742. IUnknown *a_Proxy
  743. ) ;
  744. public:
  745. HRESULT SetInitialized ( HRESULT a_InitializeResult ) ;
  746. public:
  747. CServerObject_ProviderRegistrationV1 *m_Registration ;
  748. BSTR m_Locale ;
  749. BSTR m_User ;
  750. BSTR m_Namespace ;
  751. BSTR m_TransactionIdentifier ;
  752. UINT64 m_ProviderOperation_GetObjectAsync ;
  753. UINT64 m_ProviderOperation_PutClassAsync ;
  754. UINT64 m_ProviderOperation_DeleteClassAsync ;
  755. UINT64 m_ProviderOperation_CreateClassEnumAsync ;
  756. UINT64 m_ProviderOperation_PutInstanceAsync ;
  757. UINT64 m_ProviderOperation_DeleteInstanceAsync ;
  758. UINT64 m_ProviderOperation_CreateInstanceEnumAsync ;
  759. UINT64 m_ProviderOperation_ExecQueryAsync ;
  760. UINT64 m_ProviderOperation_ExecNotificationQueryAsync ;
  761. UINT64 m_ProviderOperation_ExecMethodAsync ;
  762. UINT64 m_ProviderOperation_Begin ;
  763. UINT64 m_ProviderOperation_Rollback ;
  764. UINT64 m_ProviderOperation_Commit ;
  765. UINT64 m_ProviderOperation_QueryState ;
  766. UINT64 m_ProviderOperation_QueryInstances ;
  767. UINT64 m_ProviderOperation_CreateRefresher ;
  768. UINT64 m_ProviderOperation_CreateRefreshableObject ;
  769. UINT64 m_ProviderOperation_StopRefreshing ;
  770. UINT64 m_ProviderOperation_CreateRefreshableEnum ;
  771. UINT64 m_ProviderOperation_GetObjects ;
  772. UINT64 m_ProviderOperation_GetProperty ;
  773. UINT64 m_ProviderOperation_PutProperty ;
  774. UINT64 m_ProviderOperation_ProvideEvents ;
  775. UINT64 m_ProviderOperation_NewQuery ;
  776. UINT64 m_ProviderOperation_CancelQuery ;
  777. UINT64 m_ProviderOperation_AccessCheck ;
  778. UINT64 m_ProviderOperation_SetRegistrationObject ;
  779. UINT64 m_ProviderOperation_FindConsumer ;
  780. UINT64 m_ProviderOperation_ValidateSubscription ;
  781. void Increment_ProviderOperation_GetObjectAsync () { m_ProviderOperation_GetObjectAsync ++ ; }
  782. void Increment_ProviderOperation_PutClassAsync () { m_ProviderOperation_PutClassAsync ++ ; }
  783. void Increment_ProviderOperation_DeleteClassAsync () { m_ProviderOperation_DeleteClassAsync ++ ; }
  784. void Increment_ProviderOperation_CreateClassEnumAsync () { m_ProviderOperation_CreateClassEnumAsync ++ ; }
  785. void Increment_ProviderOperation_PutInstanceAsync () { m_ProviderOperation_PutInstanceAsync ++ ; }
  786. void Increment_ProviderOperation_DeleteInstanceAsync () { m_ProviderOperation_DeleteInstanceAsync ++ ; }
  787. void Increment_ProviderOperation_CreateInstanceEnumAsync () { m_ProviderOperation_CreateInstanceEnumAsync ++ ; }
  788. void Increment_ProviderOperation_ExecQueryAsync () { m_ProviderOperation_ExecQueryAsync ++ ; }
  789. void Increment_ProviderOperation_ExecNotificationQueryAsync () { m_ProviderOperation_ExecNotificationQueryAsync ++ ; }
  790. void Increment_ProviderOperation_ExecMethodAsync () { m_ProviderOperation_ExecMethodAsync ++ ; }
  791. void Increment_ProviderOperation_Begin () { m_ProviderOperation_Begin ++ ; }
  792. void Increment_ProviderOperation_Rollback () { m_ProviderOperation_Rollback ++ ; }
  793. void Increment_ProviderOperation_Commit () { m_ProviderOperation_Commit ++ ; }
  794. void Increment_ProviderOperation_QueryState () { m_ProviderOperation_QueryState ++ ; }
  795. void Increment_ProviderOperation_QueryInstances () { m_ProviderOperation_QueryInstances ++ ; }
  796. void Increment_ProviderOperation_CreateRefresher () { m_ProviderOperation_CreateRefresher ++ ; }
  797. void Increment_ProviderOperation_CreateRefreshableObject () { m_ProviderOperation_CreateRefreshableObject ++ ; }
  798. void Increment_ProviderOperation_StopRefreshing () { m_ProviderOperation_StopRefreshing ++ ; }
  799. void Increment_ProviderOperation_CreateRefreshableEnum () { m_ProviderOperation_CreateRefreshableEnum ++ ; }
  800. void Increment_ProviderOperation_GetObjects () { m_ProviderOperation_GetObjects ++ ; }
  801. void Increment_ProviderOperation_GetProperty () { m_ProviderOperation_GetProperty ++ ; }
  802. void Increment_ProviderOperation_PutProperty () { m_ProviderOperation_PutProperty ++ ; }
  803. void Increment_ProviderOperation_ProvideEvents () { m_ProviderOperation_ProvideEvents ++ ; }
  804. void Increment_ProviderOperation_NewQuery () { m_ProviderOperation_NewQuery ++ ; }
  805. void Increment_ProviderOperation_CancelQuery () { m_ProviderOperation_CancelQuery ++ ; }
  806. void Increment_ProviderOperation_AccessCheck () { m_ProviderOperation_AccessCheck ++ ; }
  807. void Increment_ProviderOperation_SetRegistrationObject () { m_ProviderOperation_SetRegistrationObject ++ ; }
  808. void Increment_ProviderOperation_FindConsumer () { m_ProviderOperation_FindConsumer ++ ; }
  809. void Increment_ProviderOperation_ValidateSubscription () { m_ProviderOperation_ValidateSubscription ++ ; }
  810. UINT64 Get_ProviderOperation_GetObjectAsync () { return m_ProviderOperation_GetObjectAsync ; }
  811. UINT64 Get_ProviderOperation_PutClassAsync () { return m_ProviderOperation_PutClassAsync ; }
  812. UINT64 Get_ProviderOperation_DeleteClassAsync () { return m_ProviderOperation_DeleteClassAsync ; }
  813. UINT64 Get_ProviderOperation_CreateClassEnumAsync () { return m_ProviderOperation_CreateClassEnumAsync ; }
  814. UINT64 Get_ProviderOperation_PutInstanceAsync () { return m_ProviderOperation_PutInstanceAsync ; }
  815. UINT64 Get_ProviderOperation_DeleteInstanceAsync () { return m_ProviderOperation_DeleteInstanceAsync ; }
  816. UINT64 Get_ProviderOperation_CreateInstanceEnumAsync () { return m_ProviderOperation_CreateInstanceEnumAsync ; }
  817. UINT64 Get_ProviderOperation_ExecQueryAsync () { return m_ProviderOperation_ExecQueryAsync ; }
  818. UINT64 Get_ProviderOperation_ExecNotificationQueryAsync () { return m_ProviderOperation_ExecNotificationQueryAsync ; }
  819. UINT64 Get_ProviderOperation_ExecMethodAsync () { return m_ProviderOperation_ExecMethodAsync ; }
  820. UINT64 Get_ProviderOperation_Begin () { return m_ProviderOperation_Begin ; }
  821. UINT64 Get_ProviderOperation_Rollback () { return m_ProviderOperation_Rollback ; }
  822. UINT64 Get_ProviderOperation_Commit () { return m_ProviderOperation_Commit ; }
  823. UINT64 Get_ProviderOperation_QueryState () { return m_ProviderOperation_QueryState ; }
  824. UINT64 Get_ProviderOperation_QueryInstances () { return m_ProviderOperation_QueryInstances ; }
  825. UINT64 Get_ProviderOperation_CreateRefresher () { return m_ProviderOperation_CreateRefresher ; }
  826. UINT64 Get_ProviderOperation_CreateRefreshableObject () { return m_ProviderOperation_CreateRefreshableObject ; }
  827. UINT64 Get_ProviderOperation_StopRefreshing () { return m_ProviderOperation_StopRefreshing ; }
  828. UINT64 Get_ProviderOperation_CreateRefreshableEnum () { return m_ProviderOperation_CreateRefreshableEnum ; }
  829. UINT64 Get_ProviderOperation_GetObjects () { return m_ProviderOperation_GetObjects ; }
  830. UINT64 Get_ProviderOperation_GetProperty () { return m_ProviderOperation_GetProperty ; }
  831. UINT64 Get_ProviderOperation_PutProperty () { return m_ProviderOperation_PutProperty ; }
  832. UINT64 Get_ProviderOperation_ProvideEvents () { return m_ProviderOperation_ProvideEvents ; }
  833. UINT64 Get_ProviderOperation_NewQuery () { return m_ProviderOperation_NewQuery ; }
  834. UINT64 Get_ProviderOperation_CancelQuery () { return m_ProviderOperation_CancelQuery ; }
  835. UINT64 Get_ProviderOperation_AccessCheck () { return m_ProviderOperation_AccessCheck ; }
  836. UINT64 Get_ProviderOperation_SetRegistrationObject () { return m_ProviderOperation_SetRegistrationObject ; }
  837. UINT64 Get_ProviderOperation_FindConsumer () { return m_ProviderOperation_FindConsumer ; }
  838. UINT64 Get_ProviderOperation_ValidateSubscription () { return m_ProviderOperation_ValidateSubscription ; }
  839. public:
  840. CInterceptor_IWbemDecoupledProvider (
  841. WmiAllocator &a_Allocator ,
  842. IUnknown *a_ServerSideUnknown ,
  843. IWbemServices *a_CoreStub ,
  844. CWbemGlobal_IWbemSyncProviderController *a_Controller ,
  845. IWbemContext *a_InitializationContext ,
  846. CServerObject_ProviderRegistrationV1 &a_Registration ,
  847. GUID &a_Guid
  848. ) ;
  849. ~CInterceptor_IWbemDecoupledProvider () ;
  850. public:
  851. //Non-delegating object IUnknown
  852. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  853. STDMETHODIMP_( ULONG ) AddRef () ;
  854. STDMETHODIMP_( ULONG ) Release () ;
  855. /* IWbemServices methods */
  856. HRESULT STDMETHODCALLTYPE OpenNamespace (
  857. const BSTR a_Namespace ,
  858. long a_Flags ,
  859. IWbemContext *a_Context ,
  860. IWbemServices **a_Service ,
  861. IWbemCallResult **a_CallResult
  862. ) ;
  863. HRESULT STDMETHODCALLTYPE CancelAsyncCall (
  864. IWbemObjectSink *a_Sink
  865. ) ;
  866. HRESULT STDMETHODCALLTYPE QueryObjectSink (
  867. long a_Flags ,
  868. IWbemObjectSink **a_Sink
  869. ) ;
  870. HRESULT STDMETHODCALLTYPE GetObject (
  871. const BSTR a_ObjectPath ,
  872. long a_Flags ,
  873. IWbemContext *a_Context ,
  874. IWbemClassObject **ppObject ,
  875. IWbemCallResult **a_CallResult
  876. ) ;
  877. HRESULT STDMETHODCALLTYPE GetObjectAsync (
  878. const BSTR a_ObjectPath ,
  879. long a_Flags ,
  880. IWbemContext *a_Context ,
  881. IWbemObjectSink *a_Sink
  882. ) ;
  883. HRESULT STDMETHODCALLTYPE PutClass (
  884. IWbemClassObject *a_Object ,
  885. long a_Flags ,
  886. IWbemContext *a_Context ,
  887. IWbemCallResult **a_CallResult
  888. ) ;
  889. HRESULT STDMETHODCALLTYPE PutClassAsync (
  890. IWbemClassObject *a_Object ,
  891. long a_Flags ,
  892. IWbemContext *a_Context ,
  893. IWbemObjectSink *a_Sink
  894. ) ;
  895. HRESULT STDMETHODCALLTYPE DeleteClass (
  896. const BSTR a_Class ,
  897. long a_Flags ,
  898. IWbemContext *a_Context ,
  899. IWbemCallResult **a_CallResult
  900. ) ;
  901. HRESULT STDMETHODCALLTYPE DeleteClassAsync (
  902. const BSTR a_Class ,
  903. long a_Flags ,
  904. IWbemContext *a_Context ,
  905. IWbemObjectSink *a_Sink
  906. ) ;
  907. HRESULT STDMETHODCALLTYPE CreateClassEnum (
  908. const BSTR a_Superclass ,
  909. long a_Flags ,
  910. IWbemContext *a_Context ,
  911. IEnumWbemClassObject **a_Enum
  912. ) ;
  913. HRESULT STDMETHODCALLTYPE CreateClassEnumAsync (
  914. const BSTR a_Superclass ,
  915. long a_Flags ,
  916. IWbemContext *a_Context ,
  917. IWbemObjectSink *a_Sink
  918. ) ;
  919. HRESULT STDMETHODCALLTYPE PutInstance (
  920. IWbemClassObject *a_Instance ,
  921. long a_Flags ,
  922. IWbemContext *a_Context ,
  923. IWbemCallResult **a_CallResult
  924. ) ;
  925. HRESULT STDMETHODCALLTYPE PutInstanceAsync (
  926. IWbemClassObject *a_Instance ,
  927. long a_Flags ,
  928. IWbemContext *a_Context ,
  929. IWbemObjectSink *a_Sink
  930. ) ;
  931. HRESULT STDMETHODCALLTYPE DeleteInstance (
  932. const BSTR a_ObjectPath ,
  933. long a_Flags ,
  934. IWbemContext *a_Context ,
  935. IWbemCallResult **a_CallResult
  936. ) ;
  937. HRESULT STDMETHODCALLTYPE DeleteInstanceAsync (
  938. const BSTR a_ObjectPath,
  939. long a_Flags,
  940. IWbemContext *a_Context ,
  941. IWbemObjectSink *a_Sink
  942. ) ;
  943. HRESULT STDMETHODCALLTYPE CreateInstanceEnum (
  944. const BSTR a_Class ,
  945. long a_Flags ,
  946. IWbemContext *a_Context ,
  947. IEnumWbemClassObject **a_Enum
  948. ) ;
  949. HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync (
  950. const BSTR a_Class ,
  951. long a_Flags ,
  952. IWbemContext *a_Context ,
  953. IWbemObjectSink *a_Sink
  954. ) ;
  955. HRESULT STDMETHODCALLTYPE ExecQuery (
  956. const BSTR a_QueryLanguage,
  957. const BSTR a_Query,
  958. long a_Flags ,
  959. IWbemContext *a_Context ,
  960. IEnumWbemClassObject **a_Enum
  961. ) ;
  962. HRESULT STDMETHODCALLTYPE ExecQueryAsync (
  963. const BSTR a_QueryLanguage ,
  964. const BSTR a_Query ,
  965. long a_Flags ,
  966. IWbemContext *a_Context ,
  967. IWbemObjectSink *a_Sink
  968. ) ;
  969. HRESULT STDMETHODCALLTYPE ExecNotificationQuery (
  970. const BSTR a_QueryLanguage ,
  971. const BSTR a_Query ,
  972. long a_Flags ,
  973. IWbemContext *a_Context ,
  974. IEnumWbemClassObject **a_Enum
  975. ) ;
  976. HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync (
  977. const BSTR a_QueryLanguage ,
  978. const BSTR a_Query ,
  979. long a_Flags ,
  980. IWbemContext *a_Context ,
  981. IWbemObjectSink *a_Sink
  982. ) ;
  983. HRESULT STDMETHODCALLTYPE ExecMethod (
  984. const BSTR a_ObjectPath ,
  985. const BSTR a_MethodName ,
  986. long a_Flags ,
  987. IWbemContext *a_Context ,
  988. IWbemClassObject *a_InParams ,
  989. IWbemClassObject **a_OutParams ,
  990. IWbemCallResult **a_CallResult
  991. ) ;
  992. HRESULT STDMETHODCALLTYPE ExecMethodAsync (
  993. const BSTR a_ObjectPath ,
  994. const BSTR a_MethodName ,
  995. long a_Flags ,
  996. IWbemContext *a_Context ,
  997. IWbemClassObject *a_InParams ,
  998. IWbemObjectSink *a_Sink
  999. ) ;
  1000. /* IWbemPropertyProvider */
  1001. HRESULT STDMETHODCALLTYPE GetProperty (
  1002. long a_Flags ,
  1003. const BSTR a_Locale ,
  1004. const BSTR a_ClassMapping ,
  1005. const BSTR a_InstanceMapping ,
  1006. const BSTR a_PropertyMapping ,
  1007. VARIANT *a_Value
  1008. ) ;
  1009. HRESULT STDMETHODCALLTYPE PutProperty (
  1010. long a_Flags ,
  1011. const BSTR a_Locale ,
  1012. const BSTR a_ClassMapping ,
  1013. const BSTR a_InstanceMapping ,
  1014. const BSTR a_PropertyMapping ,
  1015. const VARIANT *a_Value
  1016. ) ;
  1017. /* IWbemEventProvider */
  1018. HRESULT STDMETHODCALLTYPE ProvideEvents (
  1019. IWbemObjectSink *a_Sink ,
  1020. long a_Flags
  1021. ) ;
  1022. /* IWbemEventProviderQuerySink */
  1023. HRESULT STDMETHODCALLTYPE NewQuery (
  1024. unsigned long a_Id ,
  1025. WBEM_WSTR a_QueryLanguage ,
  1026. WBEM_WSTR a_Query
  1027. );
  1028. HRESULT STDMETHODCALLTYPE CancelQuery (
  1029. unsigned long a_Id
  1030. ) ;
  1031. /* IWbemEventProviderSecurity */
  1032. HRESULT STDMETHODCALLTYPE AccessCheck (
  1033. WBEM_CWSTR a_QueryLanguage ,
  1034. WBEM_CWSTR a_Query ,
  1035. long a_SidLength ,
  1036. const BYTE *a_Sid
  1037. ) ;
  1038. /* IWbemProviderIdentity */
  1039. HRESULT STDMETHODCALLTYPE SetRegistrationObject (
  1040. long a_Flags ,
  1041. IWbemClassObject *a_ProviderRegistration
  1042. ) ;
  1043. /* IWbemEventConsumerProvider */
  1044. HRESULT STDMETHODCALLTYPE FindConsumer (
  1045. IWbemClassObject *a_LogicalConsumer ,
  1046. IWbemUnboundObjectSink **a_Consumer
  1047. );
  1048. /* IWbemEventConsumerProviderEx */
  1049. HRESULT STDMETHODCALLTYPE ValidateSubscription (
  1050. IWbemClassObject *a_LogicalConsumer
  1051. ) ;
  1052. /* IWbemUnboundObjectSink */
  1053. HRESULT STDMETHODCALLTYPE IndicateToConsumer (
  1054. IWbemClassObject *a_LogicalConsumer ,
  1055. long a_ObjectCount ,
  1056. IWbemClassObject **a_Objects
  1057. ) ;
  1058. /* IWbemProviderInit methods */
  1059. HRESULT STDMETHODCALLTYPE Initialize (
  1060. LPWSTR a_User ,
  1061. LONG a_Flags ,
  1062. LPWSTR a_Namespace ,
  1063. LPWSTR a_Locale ,
  1064. IWbemServices *a_CoreService ,
  1065. IWbemContext *a_Context ,
  1066. IWbemProviderInitSink *a_Sink
  1067. ) ;
  1068. HRESULT STDMETHODCALLTYPE Initialize (
  1069. LONG a_Flags ,
  1070. IWbemContext *a_Context ,
  1071. GUID *a_TransactionIdentifier,
  1072. LPCWSTR a_User ,
  1073. LPCWSTR a_Locale ,
  1074. LPCWSTR a_Namespace ,
  1075. IWbemServices *a_Repository ,
  1076. IWbemServices *a_Service ,
  1077. IWbemProviderInitSink *a_Sink
  1078. ) ;
  1079. HRESULT STDMETHODCALLTYPE WaitProvider ( IWbemContext *a_Context , ULONG a_Timeout ) ;
  1080. HRESULT STDMETHODCALLTYPE GetInitializeResult ()
  1081. {
  1082. return m_InitializeResult ;
  1083. }
  1084. HRESULT STDMETHODCALLTYPE GetHosting ( ULONG *a_Value )
  1085. {
  1086. return WBEM_E_NOT_AVAILABLE ;
  1087. }
  1088. HRESULT STDMETHODCALLTYPE GetHostingGroup ( BSTR *a_Value )
  1089. {
  1090. return WBEM_E_NOT_AVAILABLE ;
  1091. }
  1092. HRESULT STDMETHODCALLTYPE IsInternal ( BOOL *a_Value )
  1093. {
  1094. return WBEM_E_NOT_AVAILABLE ;
  1095. }
  1096. HRESULT STDMETHODCALLTYPE IsPerUserInitialization ( BOOL *a_Value )
  1097. {
  1098. return WBEM_E_NOT_AVAILABLE ;
  1099. }
  1100. HRESULT STDMETHODCALLTYPE IsPerLocaleInitialization ( BOOL *a_Value )
  1101. {
  1102. return WBEM_E_NOT_AVAILABLE ;
  1103. }
  1104. HRESULT STDMETHODCALLTYPE AbnormalShutdown () ;
  1105. // IWmi_UnInitialize members
  1106. HRESULT STDMETHODCALLTYPE Shutdown (
  1107. LONG a_Flags ,
  1108. ULONG a_MaxMilliSeconds ,
  1109. IWbemContext *a_Context
  1110. ) ;
  1111. } ;
  1112. #endif // _Server_Interceptor_IWbemServices_H