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.

294 lines
6.3 KiB

  1. /*++
  2. Copyright (C) 1996-2001 Microsoft Corporation
  3. Module Name:
  4. ProvSubS.h
  5. Abstract:
  6. History:
  7. --*/
  8. #ifndef _Server_ProviderRefresherManager_H
  9. #define _Server_ProviderRefresherManager_H
  10. /******************************************************************************
  11. *
  12. * Name:
  13. *
  14. *
  15. * Description:
  16. *
  17. *
  18. *****************************************************************************/
  19. #include "ProvCache.h"
  20. /******************************************************************************
  21. *
  22. * Name:
  23. *
  24. *
  25. * Description:
  26. *
  27. *
  28. *****************************************************************************/
  29. #define ProxyIndex_RefresherManager_IWbemRefresherMgr 0
  30. #define ProxyIndex_RefresherManager_IWbemShutdown 1
  31. /******************************************************************************
  32. *
  33. * Name:
  34. *
  35. *
  36. * Description:
  37. *
  38. *
  39. *****************************************************************************/
  40. class CServerObject_InterceptorProviderRefresherManager : public _IWbemRefresherMgr ,
  41. public IWbemShutdown ,
  42. public RefresherManagerCacheElement
  43. {
  44. public:
  45. private:
  46. LONG m_ReferenceCount ;
  47. WmiAllocator &m_Allocator ;
  48. ProxyContainer m_ProxyContainer ;
  49. _IWmiProviderHost *m_Host ;
  50. _IWbemRefresherMgr *m_Manager ;
  51. IWbemShutdown *m_Shutdown ;
  52. LONG m_Initialized ;
  53. LONG m_UnInitialized ;
  54. HRESULT m_InitializeResult ;
  55. HANDLE m_InitializedEvent ;
  56. IWbemContext *m_InitializationContext ;
  57. protected:
  58. HRESULT AbnormalShutdown () ;
  59. public:
  60. HRESULT Initialize () ;
  61. HRESULT SetManager ( _IWmiProviderHost *a_Host , _IWbemRefresherMgr *a_Manager ) ;
  62. HRESULT SetInitialized ( HRESULT a_InitializeResult ) ;
  63. HRESULT IsIndependant ( IWbemContext *a_Context ) ;
  64. HRESULT STDMETHODCALLTYPE WaitProvider ( IWbemContext *a_Context , ULONG a_Timeout ) ;
  65. HRESULT STDMETHODCALLTYPE GetInitializeResult ()
  66. {
  67. return m_InitializeResult ;
  68. }
  69. public:
  70. CServerObject_InterceptorProviderRefresherManager (
  71. CWbemGlobal_IWbemRefresherMgrController *a_Controller ,
  72. const ULONG &a_Period ,
  73. WmiAllocator &a_Allocator ,
  74. IWbemContext *a_InitializationContext
  75. ) ;
  76. ~CServerObject_InterceptorProviderRefresherManager () ;
  77. //IUnknown members
  78. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  79. STDMETHODIMP_( ULONG ) AddRef () ;
  80. STDMETHODIMP_( ULONG ) Release () ;
  81. // IWmi_ProviderSubSystem members
  82. // IWmi_Initialize members
  83. HRESULT STDMETHODCALLTYPE Startup (
  84. LONG a_Flags ,
  85. IWbemContext *a_Context ,
  86. _IWmiProvSS *a_ProvSS
  87. ) ;
  88. // IWmi_UnInitialize members
  89. HRESULT STDMETHODCALLTYPE Shutdown (
  90. LONG a_Flags ,
  91. ULONG a_MaxMilliSeconds ,
  92. IWbemContext *a_Context
  93. ) ;
  94. HRESULT STDMETHODCALLTYPE AddObjectToRefresher (
  95. IWbemServices *a_Service,
  96. LPCWSTR a_ServerName,
  97. LPCWSTR a_Namespace,
  98. IWbemClassObject* pClassObject,
  99. WBEM_REFRESHER_ID *a_DestinationRefresherId,
  100. IWbemClassObject *a_InstanceTemplate,
  101. long a_Flags,
  102. IWbemContext *a_Context,
  103. IUnknown* pLockMgr,
  104. WBEM_REFRESH_INFO *a_Information
  105. ) ;
  106. HRESULT STDMETHODCALLTYPE AddEnumToRefresher (
  107. IWbemServices *a_Service,
  108. LPCWSTR a_ServerName,
  109. LPCWSTR a_Namespace,
  110. IWbemClassObject* pClassObject,
  111. WBEM_REFRESHER_ID *a_DestinationRefresherId,
  112. IWbemClassObject *a_InstanceTemplate,
  113. LPCWSTR a_Class,
  114. long a_Flags,
  115. IWbemContext *a_Context,
  116. IUnknown* pLockMgr,
  117. WBEM_REFRESH_INFO *a_Information
  118. ) ;
  119. HRESULT STDMETHODCALLTYPE GetRemoteRefresher (
  120. WBEM_REFRESHER_ID *a_RefresherId ,
  121. long a_Flags,
  122. BOOL fAddRefresher,
  123. IWbemRemoteRefresher **a_RemoteRefresher ,
  124. IUnknown* pLockMgr,
  125. GUID *a_Guid
  126. ) ;
  127. HRESULT STDMETHODCALLTYPE LoadProvider (
  128. IWbemServices *a_Service ,
  129. LPCWSTR a_ProviderName ,
  130. LPCWSTR a_Namespace ,
  131. IWbemContext * a_Context,
  132. IWbemHiPerfProvider **a_Provider,
  133. _IWmiProviderStack **a_ProvStack
  134. ) ;
  135. };
  136. /******************************************************************************
  137. *
  138. * Name:
  139. *
  140. *
  141. * Description:
  142. *
  143. *
  144. *****************************************************************************/
  145. class CServerObject_ProviderRefresherManager : public _IWbemRefresherMgr ,
  146. public IWbemShutdown
  147. {
  148. public:
  149. private:
  150. LONG m_ReferenceCount ;
  151. WmiAllocator &m_Allocator ;
  152. _IWbemRefresherMgr *m_Manager ;
  153. IWbemShutdown *m_Shutdown ;
  154. protected:
  155. public:
  156. CServerObject_ProviderRefresherManager ( WmiAllocator &a_Allocator ) ;
  157. ~CServerObject_ProviderRefresherManager () ;
  158. //IUnknown members
  159. STDMETHODIMP QueryInterface ( REFIID , LPVOID FAR * ) ;
  160. STDMETHODIMP_( ULONG ) AddRef () ;
  161. STDMETHODIMP_( ULONG ) Release () ;
  162. // IWmi_ProviderSubSystem members
  163. // IWmi_Initialize members
  164. HRESULT STDMETHODCALLTYPE Startup (
  165. LONG a_Flags ,
  166. IWbemContext *a_Context ,
  167. _IWmiProvSS *a_ProvSS
  168. ) ;
  169. // IWmi_UnInitialize members
  170. HRESULT STDMETHODCALLTYPE Shutdown (
  171. LONG a_Flags ,
  172. ULONG a_MaxMilliSeconds ,
  173. IWbemContext *a_Context
  174. ) ;
  175. HRESULT STDMETHODCALLTYPE AddObjectToRefresher (
  176. IWbemServices *a_Service,
  177. LPCWSTR a_ServerName,
  178. LPCWSTR a_Namespace,
  179. IWbemClassObject* pClassObject,
  180. WBEM_REFRESHER_ID *a_DestinationRefresherId,
  181. IWbemClassObject *a_InstanceTemplate,
  182. long a_Flags,
  183. IWbemContext *a_Context,
  184. IUnknown* pLockMgr,
  185. WBEM_REFRESH_INFO *a_Information
  186. ) ;
  187. HRESULT STDMETHODCALLTYPE AddEnumToRefresher (
  188. IWbemServices *a_Service,
  189. LPCWSTR a_ServerName,
  190. LPCWSTR a_Namespace,
  191. IWbemClassObject* pClassObject,
  192. WBEM_REFRESHER_ID *a_DestinationRefresherId,
  193. IWbemClassObject *a_InstanceTemplate,
  194. LPCWSTR a_Class,
  195. long a_Flags,
  196. IWbemContext *a_Context,
  197. IUnknown* pLockMgr,
  198. WBEM_REFRESH_INFO *a_Information
  199. ) ;
  200. HRESULT STDMETHODCALLTYPE GetRemoteRefresher (
  201. WBEM_REFRESHER_ID *a_RefresherId ,
  202. long a_Flags,
  203. BOOL fAddRefresher,
  204. IWbemRemoteRefresher **a_RemoteRefresher ,
  205. IUnknown* pLockMgr,
  206. GUID *a_Guid
  207. ) ;
  208. HRESULT STDMETHODCALLTYPE LoadProvider (
  209. IWbemServices *a_Service ,
  210. LPCWSTR a_ProviderName ,
  211. LPCWSTR a_Namespace ,
  212. IWbemContext * a_Context,
  213. IWbemHiPerfProvider **a_Provider,
  214. _IWmiProviderStack** a_ProvStack
  215. ) ;
  216. };
  217. #endif // _Server_ProviderRefresherManager_H