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.

210 lines
4.1 KiB

  1. #ifndef _Common_IWbemObjectSink_H
  2. #define _Common_IWbemObjectSink_H
  3. /*++
  4. Copyright (C) 1996-2001 Microsoft Corporation
  5. Module Name:
  6. ProvObSk.H
  7. Abstract:
  8. History:
  9. --*/
  10. #include "Queue.h"
  11. #include "CGlobals.h"
  12. #define SYNCPROV_USEBATCH
  13. /******************************************************************************
  14. *
  15. * Name:
  16. *
  17. *
  18. * Description:
  19. *
  20. *
  21. *****************************************************************************/
  22. #define ProxyIndex_IWbemObjectSink 0
  23. #define ProxyIndex_Internal_IWbemObjectSink 1
  24. #define ProxyIndex_ObjectSink_Size 2
  25. /******************************************************************************
  26. *
  27. * Name:
  28. *
  29. *
  30. * Description:
  31. *
  32. *
  33. *****************************************************************************/
  34. class CCommon_IWbemSyncObjectSink : public IWbemObjectSink ,
  35. public IWbemShutdown ,
  36. public ObjectSinkContainerElement
  37. {
  38. private:
  39. LONG m_InProgress ;
  40. LONG m_StatusCalled ;
  41. ULONG m_Dependant ;
  42. IWbemObjectSink *m_InterceptedSink ;
  43. #ifdef INTERNAL_IDENTIFY
  44. Internal_IWbemObjectSink *m_Internal_InterceptedSink ;
  45. ProxyContainer m_ProxyContainer ;
  46. #endif
  47. IUnknown *m_Unknown ;
  48. protected:
  49. LONG m_GateClosed ;
  50. protected:
  51. #ifdef INTERNAL_IDENTIFY
  52. HRESULT Begin_IWbemObjectSink (
  53. DWORD a_ProcessIdentifier ,
  54. HANDLE &a_IdentifyToken ,
  55. BOOL &a_Impersonating ,
  56. IUnknown *&a_OldContext ,
  57. IServerSecurity *&a_OldSecurity ,
  58. BOOL &a_IsProxy ,
  59. IUnknown *&a_Interface ,
  60. BOOL &a_Revert ,
  61. IUnknown *&a_Proxy
  62. ) ;
  63. HRESULT End_IWbemObjectSink (
  64. DWORD a_ProcessIdentifier ,
  65. HANDLE a_IdentifyToken ,
  66. BOOL a_Impersonating ,
  67. IUnknown *a_OldContext ,
  68. IServerSecurity *a_OldSecurity ,
  69. BOOL a_IsProxy ,
  70. IUnknown *a_Interface ,
  71. BOOL a_Revert ,
  72. IUnknown *a_Proxy
  73. ) ;
  74. #endif
  75. HRESULT STDMETHODCALLTYPE Helper_Indicate (
  76. long a_ObjectCount ,
  77. IWbemClassObject **a_ObjectArray
  78. ) ;
  79. HRESULT STDMETHODCALLTYPE Helper_SetStatus (
  80. long a_Flags ,
  81. HRESULT a_Result ,
  82. BSTR a_StringParamater ,
  83. IWbemClassObject *a_ObjectParameter
  84. ) ;
  85. public:
  86. CCommon_IWbemSyncObjectSink (
  87. WmiAllocator &a_Allocator ,
  88. IWbemObjectSink *a_InterceptedSink ,
  89. IUnknown *a_Unknown ,
  90. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  91. ULONG a_Dependant = FALSE
  92. ) ;
  93. ~CCommon_IWbemSyncObjectSink() ;
  94. void CallBackInternalRelease () ;
  95. virtual HRESULT SinkInitialize () ;
  96. //Non-delegating object IUnknown
  97. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  98. STDMETHODIMP_( ULONG ) AddRef () ;
  99. STDMETHODIMP_( ULONG ) Release () ;
  100. HRESULT STDMETHODCALLTYPE Indicate (
  101. long a_ObjectCount ,
  102. IWbemClassObject **a_ObjectArray
  103. ) ;
  104. HRESULT STDMETHODCALLTYPE SetStatus (
  105. long a_Flags ,
  106. HRESULT a_Result ,
  107. BSTR a_StringParamater ,
  108. IWbemClassObject *a_ObjectParameter
  109. ) ;
  110. HRESULT STDMETHODCALLTYPE Shutdown (
  111. LONG a_Flags ,
  112. ULONG a_MaxMilliSeconds ,
  113. IWbemContext *a_Context
  114. ) ;
  115. } ;
  116. /******************************************************************************
  117. *
  118. * Name:
  119. *
  120. *
  121. * Description:
  122. *
  123. *
  124. *****************************************************************************/
  125. class CCommon_Batching_IWbemSyncObjectSink : public CCommon_IWbemSyncObjectSink
  126. {
  127. private:
  128. DWORD m_Size ;
  129. WmiQueue <IWbemClassObject *,8> m_Queue ;
  130. CriticalSection m_CriticalSection ;
  131. protected:
  132. public:
  133. CCommon_Batching_IWbemSyncObjectSink (
  134. WmiAllocator &a_Allocator ,
  135. IWbemObjectSink *a_InterceptedSink ,
  136. IUnknown *a_Unknown ,
  137. CWbemGlobal_IWmiObjectSinkController *a_Controller ,
  138. ULONG a_Dependant = FALSE
  139. ) ;
  140. ~CCommon_Batching_IWbemSyncObjectSink () ;
  141. HRESULT SinkInitialize () ;
  142. HRESULT STDMETHODCALLTYPE Indicate (
  143. long a_ObjectCount ,
  144. IWbemClassObject **a_ObjectArray
  145. ) ;
  146. HRESULT STDMETHODCALLTYPE SetStatus (
  147. long a_Flags ,
  148. HRESULT a_Result ,
  149. BSTR a_StringParamater ,
  150. IWbemClassObject *a_ObjectParameter
  151. ) ;
  152. } ;
  153. #endif _Common_IWbemObjectSink_H