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.

342 lines
11 KiB

  1. /*++
  2. Copyright (c) 2000-2001 Microsoft Corporation
  3. Module Name:
  4. ProviderBase.h
  5. Abstract:
  6. Definition of:
  7. CProviderBase
  8. Author:
  9. ???
  10. Revision History:
  11. Mohit Srivastava 10-Nov-2000
  12. --*/
  13. #ifndef __providerbase_h__
  14. #define __providerbase_h__
  15. #if _MSC_VER > 1000
  16. #pragma once
  17. #endif
  18. #include "WbemServices.h"
  19. typedef LPVOID * PPVOID;
  20. //
  21. // CProviderBase
  22. // Purpose: provide a general solution for impersonate client for
  23. // Wbem providers.
  24. // USAGE:
  25. // Inherit from this class, and implement abstact virtual functions.
  26. // child class should implement function prefixed with "Do".
  27. //
  28. class CProviderBase : public IWbemServices, public IWbemProviderInit, public IWbemShutdown
  29. {
  30. protected:
  31. ULONG m_cRef; // Object reference count
  32. CWbemServices* m_pNamespace;
  33. public:
  34. CProviderBase(
  35. const BSTR = NULL,
  36. const BSTR = NULL,
  37. const BSTR = NULL,
  38. IWbemContext* = NULL);
  39. virtual ~CProviderBase();
  40. //
  41. // Non-delegating object IUnknown
  42. //
  43. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  44. STDMETHODIMP_(ULONG) AddRef(void);
  45. STDMETHODIMP_(ULONG) Release(void);
  46. //
  47. //IWbemProviderInit
  48. //
  49. HRESULT STDMETHODCALLTYPE Initialize(
  50. /* [in] */ LPWSTR wszUser,
  51. /* [in] */ LONG lFlags,
  52. /* [in] */ LPWSTR wszNamespace,
  53. /* [in] */ LPWSTR wszLocale,
  54. /* [in] */ IWbemServices *pNamespace,
  55. /* [in] */ IWbemContext *pCtx,
  56. /* [in] */ IWbemProviderInitSink *pInitSink
  57. );
  58. //
  59. //IWbemShutdown
  60. //
  61. HRESULT STDMETHODCALLTYPE Shutdown(
  62. /* [in] */ LONG uReason,
  63. /* [in] */ ULONG uMaxMilliseconds,
  64. /* [in] */ IWbemContext *pCtx
  65. );
  66. //
  67. //IWbemServices
  68. //
  69. HRESULT STDMETHODCALLTYPE OpenNamespace(
  70. /* [in] */ const BSTR Namespace,
  71. /* [in] */ long lFlags,
  72. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  73. /* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace,
  74. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult)
  75. {
  76. return WBEM_E_NOT_SUPPORTED;
  77. }
  78. HRESULT STDMETHODCALLTYPE CancelAsyncCall(
  79. /* [in] */ IWbemObjectSink __RPC_FAR *pSink)
  80. {
  81. return WBEM_E_NOT_SUPPORTED;
  82. }
  83. HRESULT STDMETHODCALLTYPE QueryObjectSink(
  84. /* [in] */ long lFlags,
  85. /* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler)
  86. {
  87. return WBEM_E_NOT_SUPPORTED;
  88. }
  89. HRESULT STDMETHODCALLTYPE GetObject(
  90. /* [in] */ const BSTR ObjectPath,
  91. /* [in] */ long lFlags,
  92. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  93. /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject,
  94. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  95. {
  96. return WBEM_E_NOT_SUPPORTED;
  97. }
  98. HRESULT STDMETHODCALLTYPE GetObjectAsync(
  99. /* [in] */ const BSTR ObjectPath,
  100. /* [in] */ long lFlags,
  101. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  102. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
  103. HRESULT STDMETHODCALLTYPE PutClass(
  104. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  105. /* [in] */ long lFlags,
  106. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  107. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  108. {
  109. return WBEM_E_NOT_SUPPORTED;
  110. }
  111. HRESULT STDMETHODCALLTYPE PutClassAsync(
  112. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  113. /* [in] */ long lFlags,
  114. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  115. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  116. {
  117. return WBEM_E_NOT_SUPPORTED;
  118. }
  119. HRESULT STDMETHODCALLTYPE DeleteClass(
  120. /* [in] */ const BSTR Class,
  121. /* [in] */ long lFlags,
  122. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  123. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  124. {
  125. return WBEM_E_NOT_SUPPORTED;
  126. }
  127. HRESULT STDMETHODCALLTYPE DeleteClassAsync(
  128. /* [in] */ const BSTR Class,
  129. /* [in] */ long lFlags,
  130. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  131. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  132. {
  133. return WBEM_E_NOT_SUPPORTED;
  134. }
  135. HRESULT STDMETHODCALLTYPE CreateClassEnum(
  136. /* [in] */ const BSTR Superclass,
  137. /* [in] */ long lFlags,
  138. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  139. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum)
  140. {
  141. return WBEM_E_NOT_SUPPORTED;
  142. }
  143. HRESULT STDMETHODCALLTYPE CreateClassEnumAsync(
  144. /* [in] */ const BSTR Superclass,
  145. /* [in] */ long lFlags,
  146. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  147. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  148. {
  149. return WBEM_E_NOT_SUPPORTED;
  150. }
  151. HRESULT STDMETHODCALLTYPE PutInstance(
  152. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  153. /* [in] */ long lFlags,
  154. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  155. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  156. {
  157. return WBEM_E_NOT_SUPPORTED;
  158. }
  159. HRESULT STDMETHODCALLTYPE PutInstanceAsync(
  160. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  161. /* [in] */ long lFlags,
  162. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  163. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) ;
  164. HRESULT STDMETHODCALLTYPE DeleteInstance(
  165. /* [in] */ const BSTR ObjectPath,
  166. /* [in] */ long lFlags,
  167. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  168. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  169. {
  170. return WBEM_E_NOT_SUPPORTED;
  171. }
  172. HRESULT STDMETHODCALLTYPE DeleteInstanceAsync(
  173. /* [in] */ const BSTR ObjectPath,
  174. /* [in] */ long lFlags,
  175. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  176. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) ;
  177. HRESULT STDMETHODCALLTYPE CreateInstanceEnum(
  178. /* [in] */ const BSTR Class,
  179. /* [in] */ long lFlags,
  180. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  181. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum)
  182. {
  183. return WBEM_E_NOT_SUPPORTED;
  184. }
  185. HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync(
  186. /* [in] */ const BSTR Class,
  187. /* [in] */ long lFlags,
  188. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  189. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
  190. HRESULT STDMETHODCALLTYPE ExecQuery(
  191. /* [in] */ const BSTR QueryLanguage,
  192. /* [in] */ const BSTR Query,
  193. /* [in] */ long lFlags,
  194. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  195. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum)
  196. {
  197. return WBEM_E_NOT_SUPPORTED;
  198. }
  199. HRESULT STDMETHODCALLTYPE ExecQueryAsync(
  200. /* [in] */ const BSTR QueryLanguage,
  201. /* [in] */ const BSTR Query,
  202. /* [in] */ long lFlags,
  203. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  204. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
  205. HRESULT STDMETHODCALLTYPE ExecNotificationQuery(
  206. /* [in] */ const BSTR QueryLanguage,
  207. /* [in] */ const BSTR Query,
  208. /* [in] */ long lFlags,
  209. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  210. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum)
  211. {
  212. return WBEM_E_NOT_SUPPORTED;
  213. }
  214. HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync(
  215. /* [in] */ const BSTR QueryLanguage,
  216. /* [in] */ const BSTR Query,
  217. /* [in] */ long lFlags,
  218. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  219. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  220. {
  221. return WBEM_E_NOT_SUPPORTED;
  222. }
  223. HRESULT STDMETHODCALLTYPE ExecMethod(
  224. const BSTR,
  225. const BSTR,
  226. long,
  227. IWbemContext*,
  228. IWbemClassObject*,
  229. IWbemClassObject**,
  230. IWbemCallResult**)
  231. {
  232. return WBEM_E_NOT_SUPPORTED;
  233. }
  234. HRESULT STDMETHODCALLTYPE ExecMethodAsync(
  235. const BSTR,
  236. const BSTR,
  237. long,
  238. IWbemContext*,
  239. IWbemClassObject*,
  240. IWbemObjectSink*);
  241. protected:
  242. virtual HRESULT STDMETHODCALLTYPE DoInitialize(
  243. /* [in] */ LPWSTR wszUser,
  244. /* [in] */ LONG lFlags,
  245. /* [in] */ LPWSTR wszNamespace,
  246. /* [in] */ LPWSTR wszLocale,
  247. /* [in] */ IWbemServices *pNamespace,
  248. /* [in] */ IWbemContext *pCtx,
  249. /* [in] */ IWbemProviderInitSink *pInitSink
  250. ) = 0;
  251. virtual HRESULT STDMETHODCALLTYPE DoCreateInstanceEnumAsync(
  252. /* [in] */ const BSTR, // Class,
  253. /* [in] */ long, // lFlags,
  254. /* [in] */ IWbemContext __RPC_FAR *, // pCtx,
  255. /* [in] */ IWbemObjectSink __RPC_FAR * // pResponseHandler
  256. ) = 0;
  257. virtual HRESULT STDMETHODCALLTYPE DoDeleteInstanceAsync(
  258. /* [in] */ const BSTR , // ObjectPath,
  259. /* [in] */ long, // lFlags,
  260. /* [in] */ IWbemContext __RPC_FAR *, // pCtx,
  261. /* [in] */ IWbemObjectSink __RPC_FAR * // pResponseHandler
  262. ) = 0;
  263. virtual HRESULT STDMETHODCALLTYPE DoExecMethodAsync(
  264. /* [in] */ const BSTR,
  265. /* [in] */ const BSTR,
  266. /* [in] */ long,
  267. /* [in] */ IWbemContext*,
  268. /* [in] */ IWbemClassObject*,
  269. /* [in] */ IWbemObjectSink*
  270. ) = 0;
  271. virtual HRESULT STDMETHODCALLTYPE DoExecQueryAsync(
  272. /* [in] */ const BSTR, // QueryLanguage,
  273. /* [in] */ const BSTR, // Query,
  274. /* [in] */ long, // lFlags,
  275. /* [in] */ IWbemContext __RPC_FAR *, // pCtx,
  276. /* [in] */ IWbemObjectSink __RPC_FAR * // pResponseHandler
  277. ) = 0;
  278. virtual HRESULT STDMETHODCALLTYPE DoGetObjectAsync(
  279. /* [in] */ const BSTR ObjectPath,
  280. /* [in] */ long lFlags,
  281. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  282. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler
  283. ) = 0;
  284. virtual HRESULT STDMETHODCALLTYPE DoPutInstanceAsync(
  285. /* [in] */ IWbemClassObject __RPC_FAR *, // pInst,
  286. /* [in] */ long , // lFlags,
  287. /* [in] */ IWbemContext __RPC_FAR *, // pCtx,
  288. /* [in] */ IWbemObjectSink __RPC_FAR * // pResponseHandler
  289. ) = 0;
  290. };
  291. #endif