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.

1228 lines
26 KiB

  1. #ifndef _Server_Interceptor_IWbemObjectSink_H
  2. #define _Server_Interceptor_IWbemObjectSink_H
  3. /*++
  4. Copyright (C) 1996-2001 Microsoft Corporation
  5. Module Name:
  6. ProvObSk.H
  7. Abstract:
  8. History:
  9. --*/
  10. #include <ProvObjectSink.h>
  11. #include "ProvCache.h"
  12. #include "Queue.h"
  13. #include <lockst.h>
  14. #define SYNCPROV_USEBATCH
  15. /******************************************************************************
  16. *
  17. * Name:
  18. *
  19. *
  20. * Description:
  21. *
  22. *
  23. *****************************************************************************/
  24. #define ProxyIndex_IWbemObjectSink 0
  25. #define ProxyIndex_Internal_IWbemObjectSink 1
  26. #define ProxyIndex_ObjectSink_Size 2
  27. /******************************************************************************
  28. *
  29. * Name:
  30. *
  31. *
  32. * Description:
  33. *
  34. *
  35. *****************************************************************************/
  36. class IObjectSink_CancelOperation : public IUnknown
  37. {
  38. private:
  39. protected:
  40. public:
  41. virtual HRESULT STDMETHODCALLTYPE Cancel (
  42. LONG a_Flags
  43. ) = 0 ;
  44. } ;
  45. /******************************************************************************
  46. *
  47. * Name:
  48. *
  49. *
  50. * Description:
  51. *
  52. *
  53. *****************************************************************************/
  54. class CInterceptor_IWbemObjectSink : public IWbemObjectSink ,
  55. public IWbemShutdown ,
  56. #ifdef INTERNAL_IDENTIFY
  57. public Internal_IWbemObjectSink ,
  58. #endif
  59. public ObjectSinkContainerElement
  60. {
  61. private:
  62. LONG m_InProgress ;
  63. LONG m_StatusCalled ;
  64. IWbemObjectSink *m_InterceptedSink ;
  65. IUnknown *m_Unknown ;
  66. SECURITY_DESCRIPTOR *m_SecurityDescriptor ;
  67. protected:
  68. LONG m_GateClosed ;
  69. public:
  70. CInterceptor_IWbemObjectSink (
  71. IWbemObjectSink *a_InterceptedSink ,
  72. IUnknown *a_Unknown ,
  73. CWbemGlobal_IWmiObjectSinkController *a_Controller
  74. ) ;
  75. ~CInterceptor_IWbemObjectSink () ;
  76. HRESULT Initialize ( SECURITY_DESCRIPTOR *a_SecurityDescriptor ) ;
  77. void CallBackInternalRelease () ;
  78. public:
  79. //Non-delegating object IUnknown
  80. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  81. STDMETHODIMP_( ULONG ) AddRef () ;
  82. STDMETHODIMP_( ULONG ) Release () ;
  83. HRESULT STDMETHODCALLTYPE Indicate (
  84. long a_ObjectCount ,
  85. IWbemClassObject **a_ObjectArray
  86. ) ;
  87. HRESULT STDMETHODCALLTYPE SetStatus (
  88. long a_Flags ,
  89. HRESULT a_Result ,
  90. BSTR a_StringParamater ,
  91. IWbemClassObject *a_ObjectParameter
  92. ) ;
  93. HRESULT STDMETHODCALLTYPE Shutdown (
  94. LONG a_Flags ,
  95. ULONG a_MaxMilliSeconds ,
  96. IWbemContext *a_Context
  97. ) ;
  98. #ifdef INTERNAL_IDENTIFY
  99. HRESULT STDMETHODCALLTYPE Internal_Indicate (
  100. WmiInternalContext a_InternalContext ,
  101. long a_ObjectCount ,
  102. IWbemClassObject **a_ObjectArray
  103. ) ;
  104. HRESULT STDMETHODCALLTYPE Internal_SetStatus (
  105. WmiInternalContext a_InternalContext ,
  106. long a_Flags ,
  107. HRESULT a_Result ,
  108. BSTR a_StringParamater ,
  109. IWbemClassObject *a_ObjectParameter
  110. ) ;
  111. #endif
  112. } ;
  113. /******************************************************************************
  114. *
  115. * Name:
  116. *
  117. *
  118. * Description:
  119. *
  120. *
  121. *****************************************************************************/
  122. class CInterceptor_IWbemSyncObjectSink : public CCommon_IWbemSyncObjectSink
  123. {
  124. private:
  125. protected:
  126. public:
  127. CInterceptor_IWbemSyncObjectSink (
  128. WmiAllocator &a_Allocator ,
  129. IWbemObjectSink *a_InterceptedSink ,
  130. IUnknown *a_Unknown ,
  131. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  132. ULONG a_Dependant = FALSE
  133. ) ;
  134. ~CInterceptor_IWbemSyncObjectSink() ;
  135. } ;
  136. /*****************************************************************************
  137. *
  138. * Name:
  139. *
  140. *
  141. * Description:
  142. *
  143. *
  144. *****************************************************************************/
  145. class CInterceptor_IWbemSyncObjectSink_GetObjectAsync : public CCommon_IWbemSyncObjectSink
  146. {
  147. private:
  148. long m_Flags ;
  149. BSTR m_ObjectPath ;
  150. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  151. protected:
  152. public:
  153. CInterceptor_IWbemSyncObjectSink_GetObjectAsync (
  154. WmiAllocator &a_Allocator ,
  155. long a_Flags ,
  156. BSTR a_ObjectPath ,
  157. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  158. IWbemObjectSink *a_InterceptedSink ,
  159. IUnknown *a_Unknown ,
  160. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  161. ULONG a_Dependant = FALSE
  162. ) ;
  163. ~CInterceptor_IWbemSyncObjectSink_GetObjectAsync () ;
  164. HRESULT STDMETHODCALLTYPE SetStatus (
  165. long a_Flags ,
  166. HRESULT a_Result ,
  167. BSTR a_StringParamater ,
  168. IWbemClassObject *a_ObjectParameter
  169. ) ;
  170. } ;
  171. /*****************************************************************************
  172. *
  173. * Name:
  174. *
  175. *
  176. * Description:
  177. *
  178. *
  179. *****************************************************************************/
  180. class CInterceptor_IWbemSyncObjectSink_DeleteInstanceAsync : public CCommon_IWbemSyncObjectSink
  181. {
  182. private:
  183. long m_Flags ;
  184. BSTR m_ObjectPath ;
  185. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  186. protected:
  187. public:
  188. CInterceptor_IWbemSyncObjectSink_DeleteInstanceAsync (
  189. WmiAllocator &a_Allocator ,
  190. long a_Flags ,
  191. BSTR a_ObjectPath ,
  192. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  193. IWbemObjectSink *a_InterceptedSink ,
  194. IUnknown *a_Unknown ,
  195. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  196. ULONG a_Dependant = FALSE
  197. ) ;
  198. ~CInterceptor_IWbemSyncObjectSink_DeleteInstanceAsync () ;
  199. HRESULT STDMETHODCALLTYPE SetStatus (
  200. long a_Flags ,
  201. HRESULT a_Result ,
  202. BSTR a_StringParamater ,
  203. IWbemClassObject *a_ObjectParameter
  204. ) ;
  205. } ;
  206. /*****************************************************************************
  207. *
  208. * Name:
  209. *
  210. *
  211. * Description:
  212. *
  213. *
  214. *****************************************************************************/
  215. class CInterceptor_IWbemSyncObjectSink_DeleteClassAsync : public CCommon_IWbemSyncObjectSink
  216. {
  217. private:
  218. long m_Flags ;
  219. BSTR m_Class ;
  220. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  221. protected:
  222. public:
  223. CInterceptor_IWbemSyncObjectSink_DeleteClassAsync (
  224. WmiAllocator &a_Allocator ,
  225. long a_Flags ,
  226. BSTR a_Class ,
  227. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  228. IWbemObjectSink *a_InterceptedSink ,
  229. IUnknown *a_Unknown ,
  230. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  231. ULONG a_Dependant = FALSE
  232. ) ;
  233. ~CInterceptor_IWbemSyncObjectSink_DeleteClassAsync () ;
  234. HRESULT STDMETHODCALLTYPE SetStatus (
  235. long a_Flags ,
  236. HRESULT a_Result ,
  237. BSTR a_StringParamater ,
  238. IWbemClassObject *a_ObjectParameter
  239. ) ;
  240. } ;
  241. /*****************************************************************************
  242. *
  243. * Name:
  244. *
  245. *
  246. * Description:
  247. *
  248. *
  249. *****************************************************************************/
  250. class CInterceptor_IWbemSyncObjectSink_PutInstanceAsync : public CCommon_IWbemSyncObjectSink
  251. {
  252. private:
  253. long m_Flags ;
  254. IWbemClassObject *m_Instance ;
  255. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  256. protected:
  257. public:
  258. CInterceptor_IWbemSyncObjectSink_PutInstanceAsync (
  259. WmiAllocator &a_Allocator ,
  260. long a_Flags ,
  261. IWbemClassObject *a_Class ,
  262. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  263. IWbemObjectSink *a_InterceptedSink ,
  264. IUnknown *a_Unknown ,
  265. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  266. ULONG a_Dependant = FALSE
  267. ) ;
  268. ~CInterceptor_IWbemSyncObjectSink_PutInstanceAsync () ;
  269. HRESULT STDMETHODCALLTYPE SetStatus (
  270. long a_Flags ,
  271. HRESULT a_Result ,
  272. BSTR a_StringParamater ,
  273. IWbemClassObject *a_ObjectParameter
  274. ) ;
  275. } ;
  276. /*****************************************************************************
  277. *
  278. * Name:
  279. *
  280. *
  281. * Description:
  282. *
  283. *
  284. *****************************************************************************/
  285. class CInterceptor_IWbemSyncObjectSink_PutClassAsync : public CCommon_IWbemSyncObjectSink
  286. {
  287. private:
  288. long m_Flags ;
  289. IWbemClassObject *m_Class ;
  290. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  291. protected:
  292. public:
  293. CInterceptor_IWbemSyncObjectSink_PutClassAsync (
  294. WmiAllocator &a_Allocator ,
  295. long a_Flags ,
  296. IWbemClassObject *a_Class ,
  297. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  298. IWbemObjectSink *a_InterceptedSink ,
  299. IUnknown *a_Unknown ,
  300. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  301. ULONG a_Dependant = FALSE
  302. ) ;
  303. ~CInterceptor_IWbemSyncObjectSink_PutClassAsync () ;
  304. HRESULT STDMETHODCALLTYPE SetStatus (
  305. long a_Flags ,
  306. HRESULT a_Result ,
  307. BSTR a_StringParamater ,
  308. IWbemClassObject *a_ObjectParameter
  309. ) ;
  310. } ;
  311. /*****************************************************************************
  312. *
  313. * Name:
  314. *
  315. *
  316. * Description:
  317. *
  318. *
  319. *****************************************************************************/
  320. class CInterceptor_IWbemSyncObjectSink_CreateInstanceEnumAsync : public CCommon_Batching_IWbemSyncObjectSink
  321. {
  322. private:
  323. long m_Flags ;
  324. BSTR m_Class ;
  325. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  326. protected:
  327. public:
  328. CInterceptor_IWbemSyncObjectSink_CreateInstanceEnumAsync (
  329. WmiAllocator &a_Allocator ,
  330. long a_Flags ,
  331. BSTR a_Class ,
  332. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  333. IWbemObjectSink *a_InterceptedSink ,
  334. IUnknown *a_Unknown ,
  335. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  336. ULONG a_Dependant = FALSE
  337. ) ;
  338. ~CInterceptor_IWbemSyncObjectSink_CreateInstanceEnumAsync () ;
  339. HRESULT STDMETHODCALLTYPE SetStatus (
  340. long a_Flags ,
  341. HRESULT a_Result ,
  342. BSTR a_StringParamater ,
  343. IWbemClassObject *a_ObjectParameter
  344. ) ;
  345. } ;
  346. /*****************************************************************************
  347. *
  348. * Name:
  349. *
  350. *
  351. * Description:
  352. *
  353. *
  354. *****************************************************************************/
  355. class CInterceptor_IWbemSyncObjectSink_CreateClassEnumAsync : public CCommon_Batching_IWbemSyncObjectSink
  356. {
  357. private:
  358. long m_Flags ;
  359. BSTR m_SuperClass ;
  360. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  361. protected:
  362. public:
  363. CInterceptor_IWbemSyncObjectSink_CreateClassEnumAsync (
  364. WmiAllocator &a_Allocator ,
  365. long a_Flags ,
  366. BSTR a_SuperClass ,
  367. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  368. IWbemObjectSink *a_InterceptedSink ,
  369. IUnknown *a_Unknown ,
  370. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  371. ULONG a_Dependant = FALSE
  372. ) ;
  373. ~CInterceptor_IWbemSyncObjectSink_CreateClassEnumAsync () ;
  374. HRESULT STDMETHODCALLTYPE SetStatus (
  375. long a_Flags ,
  376. HRESULT a_Result ,
  377. BSTR a_StringParamater ,
  378. IWbemClassObject *a_ObjectParameter
  379. ) ;
  380. } ;
  381. /*****************************************************************************
  382. *
  383. * Name:
  384. *
  385. *
  386. * Description:
  387. *
  388. *
  389. *****************************************************************************/
  390. class CInterceptor_IWbemSyncObjectSink_ExecQueryAsync : public CCommon_Batching_IWbemSyncObjectSink
  391. {
  392. private:
  393. long m_Flags ;
  394. BSTR m_QueryLanguage ;
  395. BSTR m_Query ;
  396. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  397. protected:
  398. public:
  399. CInterceptor_IWbemSyncObjectSink_ExecQueryAsync (
  400. WmiAllocator &a_Allocator ,
  401. long a_Flags ,
  402. BSTR a_QueryLanguage ,
  403. BSTR a_Query ,
  404. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  405. IWbemObjectSink *a_InterceptedSink ,
  406. IUnknown *a_Unknown ,
  407. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  408. ULONG a_Dependant = FALSE
  409. ) ;
  410. ~CInterceptor_IWbemSyncObjectSink_ExecQueryAsync () ;
  411. HRESULT STDMETHODCALLTYPE SetStatus (
  412. long a_Flags ,
  413. HRESULT a_Result ,
  414. BSTR a_StringParamater ,
  415. IWbemClassObject *a_ObjectParameter
  416. ) ;
  417. } ;
  418. /*****************************************************************************
  419. *
  420. * Name:
  421. *
  422. *
  423. * Description:
  424. *
  425. *
  426. *****************************************************************************/
  427. class CInterceptor_IWbemSyncObjectSink_ExecMethodAsync : public CCommon_IWbemSyncObjectSink
  428. {
  429. private:
  430. long m_Flags ;
  431. BSTR m_ObjectPath ;
  432. BSTR m_MethodName ;
  433. IWbemClassObject *m_InParameters ;
  434. CInterceptor_IWbemSyncProvider *m_Interceptor ;
  435. protected:
  436. public:
  437. CInterceptor_IWbemSyncObjectSink_ExecMethodAsync (
  438. WmiAllocator &a_Allocator ,
  439. long a_Flags ,
  440. BSTR a_ObjectPath ,
  441. BSTR a_MethodName ,
  442. IWbemClassObject *a_InParameters ,
  443. CInterceptor_IWbemSyncProvider *a_Interceptor ,
  444. IWbemObjectSink *a_InterceptedSink ,
  445. IUnknown *a_Unknown ,
  446. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  447. ULONG a_Dependant = FALSE
  448. ) ;
  449. ~CInterceptor_IWbemSyncObjectSink_ExecMethodAsync () ;
  450. HRESULT STDMETHODCALLTYPE SetStatus (
  451. long a_Flags ,
  452. HRESULT a_Result ,
  453. BSTR a_StringParamater ,
  454. IWbemClassObject *a_ObjectParameter
  455. ) ;
  456. } ;
  457. /******************************************************************************
  458. *
  459. * Name:
  460. *
  461. *
  462. * Description:
  463. *
  464. *
  465. *****************************************************************************/
  466. class CInterceptor_IWbemFilteringObjectSink : public CInterceptor_IWbemObjectSink
  467. {
  468. private:
  469. LONG m_Filtering ;
  470. BSTR m_QueryLanguage ;
  471. BSTR m_Query ;
  472. IWbemQuery *m_QueryFilter ;
  473. protected:
  474. public:
  475. CInterceptor_IWbemFilteringObjectSink (
  476. IWbemObjectSink *a_InterceptedSink ,
  477. IUnknown *a_Unknown ,
  478. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  479. const BSTR a_QueryLanguage ,
  480. const BSTR a_Query
  481. ) ;
  482. ~CInterceptor_IWbemFilteringObjectSink () ;
  483. public:
  484. HRESULT STDMETHODCALLTYPE Indicate (
  485. long a_ObjectCount ,
  486. IWbemClassObject **a_ObjectArray
  487. ) ;
  488. HRESULT STDMETHODCALLTYPE SetStatus (
  489. long a_Flags ,
  490. HRESULT a_Result ,
  491. BSTR a_StringParamater ,
  492. IWbemClassObject *a_ObjectParameter
  493. ) ;
  494. } ;
  495. /******************************************************************************
  496. *
  497. * Name:
  498. *
  499. *
  500. * Description:
  501. *
  502. *
  503. *****************************************************************************/
  504. class CInterceptor_IWbemSyncFilteringObjectSink : public IWbemObjectSink ,
  505. public IWbemShutdown ,
  506. public ObjectSinkContainerElement
  507. {
  508. private:
  509. LONG m_InProgress ;
  510. LONG m_StatusCalled ;
  511. LONG m_Filtering ;
  512. BSTR m_QueryLanguage ;
  513. BSTR m_Query ;
  514. ULONG m_Dependant ;
  515. IWbemObjectSink *m_InterceptedSink ;
  516. IWbemQuery *m_QueryFilter ;
  517. IUnknown *m_Unknown ;
  518. protected:
  519. LONG m_GateClosed ;
  520. public:
  521. CInterceptor_IWbemSyncFilteringObjectSink (
  522. IWbemObjectSink *a_InterceptedSink ,
  523. IUnknown *a_Unknown ,
  524. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  525. const BSTR a_QueryLanguage ,
  526. const BSTR a_Query ,
  527. ULONG a_Dependant = FALSE
  528. ) ;
  529. ~CInterceptor_IWbemSyncFilteringObjectSink() ;
  530. void CallBackInternalRelease () ;
  531. //Non-delegating object IUnknown
  532. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  533. STDMETHODIMP_( ULONG ) AddRef () ;
  534. STDMETHODIMP_( ULONG ) Release () ;
  535. HRESULT STDMETHODCALLTYPE Indicate (
  536. long a_ObjectCount ,
  537. IWbemClassObject **a_ObjectArray
  538. ) ;
  539. HRESULT STDMETHODCALLTYPE SetStatus (
  540. long a_Flags ,
  541. HRESULT a_Result ,
  542. BSTR a_StringParamater ,
  543. IWbemClassObject *a_ObjectParameter
  544. ) ;
  545. HRESULT STDMETHODCALLTYPE Shutdown (
  546. LONG a_Flags ,
  547. ULONG a_MaxMilliSeconds ,
  548. IWbemContext *a_Context
  549. ) ;
  550. } ;
  551. /******************************************************************************
  552. *
  553. * Name:
  554. *
  555. *
  556. * Description:
  557. *
  558. *
  559. *****************************************************************************/
  560. class CInterceptor_DecoupledIWbemObjectSink : public IWbemObjectSink ,
  561. public IWbemShutdown ,
  562. public IObjectSink_CancelOperation ,
  563. public ObjectSinkContainerElement
  564. {
  565. private:
  566. LONG m_InProgress ;
  567. LONG m_StatusCalled ;
  568. IWbemObjectSink *m_InterceptedSink ;
  569. IUnknown *m_Unknown ;
  570. SECURITY_DESCRIPTOR *m_SecurityDescriptor ;
  571. IWbemServices *m_Provider ;
  572. protected:
  573. LONG m_GateClosed ;
  574. public:
  575. CInterceptor_DecoupledIWbemObjectSink (
  576. IWbemServices *a_Provider ,
  577. IWbemObjectSink *a_InterceptedSink ,
  578. IUnknown *a_Unknown ,
  579. CWbemGlobal_IWmiObjectSinkController *a_Controller
  580. ) ;
  581. ~CInterceptor_DecoupledIWbemObjectSink () ;
  582. HRESULT Initialize ( SECURITY_DESCRIPTOR *a_SecurityDescriptor ) ;
  583. void CallBackInternalRelease () ;
  584. IWbemServices *GetProvider () { return m_Provider ; }
  585. public:
  586. //Non-delegating object IUnknown
  587. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  588. STDMETHODIMP_( ULONG ) AddRef () ;
  589. STDMETHODIMP_( ULONG ) Release () ;
  590. HRESULT STDMETHODCALLTYPE Indicate (
  591. long a_ObjectCount ,
  592. IWbemClassObject **a_ObjectArray
  593. ) ;
  594. HRESULT STDMETHODCALLTYPE SetStatus (
  595. long a_Flags ,
  596. HRESULT a_Result ,
  597. BSTR a_StringParamater ,
  598. IWbemClassObject *a_ObjectParameter
  599. ) ;
  600. HRESULT STDMETHODCALLTYPE Shutdown (
  601. LONG a_Flags ,
  602. ULONG a_MaxMilliSeconds ,
  603. IWbemContext *a_Context
  604. ) ;
  605. HRESULT STDMETHODCALLTYPE Cancel (
  606. LONG a_Flags
  607. ) ;
  608. } ;
  609. /******************************************************************************
  610. *
  611. * Name:
  612. *
  613. *
  614. * Description:
  615. *
  616. *
  617. *****************************************************************************/
  618. class CInterceptor_DecoupledIWbemCombiningObjectSink : public IWbemObjectSink ,
  619. public IWbemShutdown ,
  620. public IObjectSink_CancelOperation ,
  621. public ObjectSinkContainerElement ,
  622. public CWbemGlobal_IWmiObjectSinkController
  623. {
  624. private:
  625. LONG m_InProgress ;
  626. LONG m_StatusCalled ;
  627. LONG m_SinkCount ;
  628. HANDLE m_Event ;
  629. IWbemObjectSink *m_InterceptedSink ;
  630. void CallBackInternalRelease () ;
  631. protected:
  632. LONG m_GateClosed ;
  633. public:
  634. CInterceptor_DecoupledIWbemCombiningObjectSink (
  635. WmiAllocator &m_Allocator ,
  636. IWbemObjectSink *a_InterceptedSink ,
  637. CWbemGlobal_IWmiObjectSinkController *a_Controller
  638. ) ;
  639. ~CInterceptor_DecoupledIWbemCombiningObjectSink () ;
  640. HRESULT Wait ( ULONG a_Timeout ) ;
  641. HRESULT EnQueue ( CInterceptor_DecoupledIWbemObjectSink *a_Sink ) ;
  642. void Suspend () ;
  643. void Resume () ;
  644. public:
  645. //Non-delegating object IUnknown
  646. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  647. STDMETHODIMP_( ULONG ) AddRef () ;
  648. STDMETHODIMP_( ULONG ) Release () ;
  649. HRESULT STDMETHODCALLTYPE Indicate (
  650. long a_ObjectCount ,
  651. IWbemClassObject **a_ObjectArray
  652. ) ;
  653. HRESULT STDMETHODCALLTYPE SetStatus (
  654. long a_Flags ,
  655. HRESULT a_Result ,
  656. BSTR a_StringParamater ,
  657. IWbemClassObject *a_ObjectParameter
  658. ) ;
  659. HRESULT STDMETHODCALLTYPE Shutdown (
  660. LONG a_Flags ,
  661. ULONG a_MaxMilliSeconds ,
  662. IWbemContext *a_Context
  663. ) ;
  664. HRESULT STDMETHODCALLTYPE Cancel (
  665. LONG a_Flags
  666. ) ;
  667. } ;
  668. /******************************************************************************
  669. *
  670. * Name:
  671. *
  672. *
  673. * Description:
  674. *
  675. *
  676. *****************************************************************************/
  677. class CInterceptor_IWbemWaitingObjectSink : public IWbemObjectSink ,
  678. public IWbemShutdown ,
  679. public IObjectSink_CancelOperation ,
  680. public ObjectSinkContainerElement ,
  681. public CWbemGlobal_IWmiObjectSinkController
  682. {
  683. private:
  684. LONG m_ReferenceCount ;
  685. LONG m_InProgress ;
  686. LONG m_StatusCalled ;
  687. WmiQueue <IWbemClassObject *,8> m_Queue ;
  688. CriticalSection m_CriticalSection ;
  689. HANDLE m_Event ;
  690. HRESULT m_Result ;
  691. IWbemServices *m_Provider ;
  692. CServerObject_ProviderRegistrationV1 &m_Registration ;
  693. SECURITY_DESCRIPTOR *m_SecurityDescriptor ;
  694. protected:
  695. LONG m_GateClosed ;
  696. public:
  697. CInterceptor_IWbemWaitingObjectSink (
  698. WmiAllocator &m_Allocator ,
  699. IWbemServices *a_Provider ,
  700. IWbemObjectSink *a_InterceptedSink ,
  701. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  702. CServerObject_ProviderRegistrationV1 &a_Registration
  703. ) ;
  704. ~CInterceptor_IWbemWaitingObjectSink () ;
  705. HRESULT Initialize ( SECURITY_DESCRIPTOR *a_SecurityDescriptor ) ;
  706. void CallBackInternalRelease () ;
  707. HRESULT Wait ( ULONG a_Timeout = INFINITE ) ;
  708. WmiQueue <IWbemClassObject *,8> & GetQueue () { return m_Queue ; }
  709. CriticalSection &GetQueueCriticalSection () { return m_CriticalSection ; }
  710. HRESULT GetResult () { return m_Result ; }
  711. IWbemServices *GetProvider () { return m_Provider ; }
  712. public:
  713. //Non-delegating object IUnknown
  714. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  715. STDMETHODIMP_( ULONG ) AddRef () ;
  716. STDMETHODIMP_( ULONG ) Release () ;
  717. HRESULT STDMETHODCALLTYPE Indicate (
  718. long a_ObjectCount ,
  719. IWbemClassObject **a_ObjectArray
  720. ) ;
  721. HRESULT STDMETHODCALLTYPE SetStatus (
  722. long a_Flags ,
  723. HRESULT a_Result ,
  724. BSTR a_StringParamater ,
  725. IWbemClassObject *a_ObjectParameter
  726. ) ;
  727. HRESULT STDMETHODCALLTYPE Shutdown (
  728. LONG a_Flags ,
  729. ULONG a_MaxMilliSeconds ,
  730. IWbemContext *a_Context
  731. ) ;
  732. HRESULT STDMETHODCALLTYPE Cancel (
  733. LONG a_Flags
  734. ) ;
  735. } ;
  736. /******************************************************************************
  737. *
  738. * Name:
  739. *
  740. *
  741. * Description:
  742. *
  743. *
  744. *****************************************************************************/
  745. class CInterceptor_IWbemWaitingObjectSink_GetObjectAsync : public CInterceptor_IWbemWaitingObjectSink
  746. {
  747. private:
  748. BSTR m_ObjectPath ;
  749. LONG m_Flags ;
  750. IWbemContext *m_Context ;
  751. protected:
  752. public:
  753. CInterceptor_IWbemWaitingObjectSink_GetObjectAsync (
  754. WmiAllocator &m_Allocator ,
  755. IWbemServices *a_Provider ,
  756. IWbemObjectSink *a_InterceptedSink ,
  757. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  758. CServerObject_ProviderRegistrationV1 &a_Registration
  759. ) ;
  760. ~CInterceptor_IWbemWaitingObjectSink_GetObjectAsync () ;
  761. HRESULT Initialize (
  762. SECURITY_DESCRIPTOR *a_SecurityDescriptor ,
  763. BSTR a_ObjectPath ,
  764. LONG a_Flags ,
  765. IWbemContext *a_Context
  766. ) ;
  767. } ;
  768. /******************************************************************************
  769. *
  770. * Name:
  771. *
  772. *
  773. * Description:
  774. *
  775. *
  776. *****************************************************************************/
  777. class CInterceptor_IWbemWaitingObjectSink_DeleteClassAsync : public CInterceptor_IWbemWaitingObjectSink
  778. {
  779. private:
  780. BSTR m_Class ;
  781. LONG m_Flags ;
  782. IWbemContext *m_Context ;
  783. protected:
  784. public:
  785. CInterceptor_IWbemWaitingObjectSink_DeleteClassAsync (
  786. WmiAllocator &m_Allocator ,
  787. IWbemServices *a_Provider ,
  788. IWbemObjectSink *a_InterceptedSink ,
  789. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  790. CServerObject_ProviderRegistrationV1 &a_Registration
  791. ) ;
  792. ~CInterceptor_IWbemWaitingObjectSink_DeleteClassAsync () ;
  793. HRESULT Initialize (
  794. SECURITY_DESCRIPTOR *a_SecurityDescriptor ,
  795. BSTR a_Class ,
  796. LONG a_Flags ,
  797. IWbemContext *a_Context
  798. ) ;
  799. } ;
  800. /******************************************************************************
  801. *
  802. * Name:
  803. *
  804. *
  805. * Description:
  806. *
  807. *
  808. *****************************************************************************/
  809. class CInterceptor_IWbemWaitingObjectSink_CreateClassEnumAsync : public CInterceptor_IWbemWaitingObjectSink
  810. {
  811. private:
  812. BSTR m_SuperClass ;
  813. LONG m_Flags ;
  814. IWbemContext *m_Context ;
  815. protected:
  816. public:
  817. CInterceptor_IWbemWaitingObjectSink_CreateClassEnumAsync (
  818. WmiAllocator &m_Allocator ,
  819. IWbemServices *a_Provider ,
  820. IWbemObjectSink *a_InterceptedSink ,
  821. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  822. CServerObject_ProviderRegistrationV1 &a_Registration
  823. ) ;
  824. ~CInterceptor_IWbemWaitingObjectSink_CreateClassEnumAsync () ;
  825. HRESULT Initialize (
  826. SECURITY_DESCRIPTOR *a_SecurityDescriptor ,
  827. BSTR a_SuperClass ,
  828. LONG a_Flags ,
  829. IWbemContext *a_Context
  830. ) ;
  831. } ;
  832. /******************************************************************************
  833. *
  834. * Name:
  835. *
  836. *
  837. * Description:
  838. *
  839. *
  840. *****************************************************************************/
  841. class CInterceptor_IWbemWaitingObjectSink_PutClassAsync : public CInterceptor_IWbemWaitingObjectSink
  842. {
  843. private:
  844. IWbemClassObject *m_ClassObject ;
  845. LONG m_Flags ;
  846. IWbemContext *m_Context ;
  847. protected:
  848. public:
  849. CInterceptor_IWbemWaitingObjectSink_PutClassAsync (
  850. WmiAllocator &m_Allocator ,
  851. IWbemServices *a_Provider ,
  852. IWbemObjectSink *a_InterceptedSink ,
  853. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  854. CServerObject_ProviderRegistrationV1 &a_Registration
  855. ) ;
  856. ~CInterceptor_IWbemWaitingObjectSink_PutClassAsync () ;
  857. HRESULT Initialize (
  858. SECURITY_DESCRIPTOR *a_SecurityDescriptor ,
  859. IWbemClassObject *a_ClassObject ,
  860. LONG a_Flags ,
  861. IWbemContext *a_Context
  862. ) ;
  863. } ;
  864. /******************************************************************************
  865. *
  866. * Name:
  867. *
  868. *
  869. * Description:
  870. *
  871. *
  872. *****************************************************************************/
  873. class CWaitingObjectSink : public IWbemObjectSink ,
  874. public IWbemShutdown ,
  875. public ObjectSinkContainerElement
  876. {
  877. private:
  878. LONG m_InProgress ;
  879. LONG m_StatusCalled ;
  880. HRESULT m_Result ;
  881. LONG m_ReferenceCount ;
  882. HANDLE m_Event ;
  883. WmiQueue <IWbemClassObject *,8> m_Queue ;
  884. CriticalSection m_CriticalSection ;
  885. protected:
  886. LONG m_GateClosed ;
  887. public:
  888. HRESULT SinkInitialize () ;
  889. public:
  890. CWaitingObjectSink ( WmiAllocator &a_Allocator ) ;
  891. ~CWaitingObjectSink () ;
  892. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  893. STDMETHODIMP_( ULONG ) AddRef () ;
  894. STDMETHODIMP_(ULONG) Release () ;
  895. HRESULT STDMETHODCALLTYPE SetStatus (
  896. long a_Flags ,
  897. HRESULT a_Result ,
  898. BSTR a_StringParameter ,
  899. IWbemClassObject *a_ObjectParameter
  900. ) ;
  901. HRESULT STDMETHODCALLTYPE Indicate (
  902. LONG a_ObjectCount,
  903. IWbemClassObject **a_ObjectArray
  904. ) ;
  905. HRESULT Wait ( DWORD a_Timeout = INFINITE ) ;
  906. HRESULT STDMETHODCALLTYPE Shutdown (
  907. LONG a_Flags ,
  908. ULONG a_MaxMilliSeconds ,
  909. IWbemContext *a_Context
  910. ) ;
  911. WmiQueue <IWbemClassObject *,8> & GetQueue () { return m_Queue ; }
  912. CriticalSection &GetQueueCriticalSection () { return m_CriticalSection ; }
  913. HRESULT GetResult () { return m_Result ; }
  914. } ;
  915. #endif _Server_Interceptor_IWbemObjectSink_H