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.

251 lines
9.9 KiB

  1. //***************************************************************************
  2. //
  3. // methprov.h
  4. //
  5. // Module: WBEM Method Test Provider code
  6. //
  7. // Purpose: Method Provider Test Header File.
  8. //
  9. // Copyright (c)1998 Microsoft Corporation, All Rights Reserved
  10. //
  11. //***************************************************************************
  12. #ifndef _methprov_H_
  13. #define _methprov_H_
  14. #include "wbemidl.h"
  15. typedef LPVOID * PPVOID;
  16. // Provider interfaces are provided by objects of this class
  17. class CMethodPro : public IWbemServices, public IWbemProviderInit
  18. {
  19. protected:
  20. ULONG m_cRef; //Object reference count
  21. IWbemServices * m_pWbemSvcs;
  22. IWbemClassObject* m_pOutClass;
  23. public:
  24. CMethodPro();
  25. ~CMethodPro(void);
  26. //Non-delegating object IUnknown
  27. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  28. STDMETHODIMP_(ULONG) AddRef(void);
  29. STDMETHODIMP_(ULONG) Release(void);
  30. STDMETHOD(GetTypeInfoCount)(THIS_ UINT FAR* pctinfo){return WBEM_E_NOT_SUPPORTED;};
  31. STDMETHOD(GetTypeInfo)(
  32. THIS_
  33. UINT itinfo,
  34. LCID lcid,
  35. ITypeInfo FAR* FAR* pptinfo){return WBEM_E_NOT_SUPPORTED;};
  36. STDMETHOD(GetIDsOfNames)(
  37. THIS_
  38. REFIID riid,
  39. OLECHAR FAR* FAR* rgszNames,
  40. UINT cNames,
  41. LCID lcid,
  42. DISPID FAR* rgdispid){return WBEM_E_NOT_SUPPORTED;};
  43. STDMETHOD(Invoke)(
  44. THIS_
  45. DISPID dispidMember,
  46. REFIID riid,
  47. LCID lcid,
  48. WORD wFlags,
  49. DISPPARAMS FAR* pdispparams,
  50. VARIANT FAR* pvarResult,
  51. EXCEPINFO FAR* pexcepinfo,
  52. UINT FAR* puArgErr){return WBEM_E_NOT_SUPPORTED;};
  53. //IWbemProviderInit
  54. HRESULT STDMETHODCALLTYPE Initialize(
  55. /* [in] */ LPWSTR pszUser,
  56. /* [in] */ LONG lFlags,
  57. /* [in] */ LPWSTR pszNamespace,
  58. /* [in] */ LPWSTR pszLocale,
  59. /* [in] */ IWbemServices *pNamespace,
  60. /* [in] */ IWbemContext *pCtx,
  61. /* [in] */ IWbemProviderInitSink *pInitSink
  62. );
  63. //IWbemServices
  64. HRESULT STDMETHODCALLTYPE OpenNamespace(
  65. /* [in] */ const BSTR Namespace,
  66. /* [in] */ long lFlags,
  67. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  68. /* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace,
  69. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult) {return WBEM_E_NOT_SUPPORTED;};
  70. HRESULT STDMETHODCALLTYPE CancelAsyncCall(
  71. /* [in] */ IWbemObjectSink __RPC_FAR *pSink) {return WBEM_E_NOT_SUPPORTED;};
  72. HRESULT STDMETHODCALLTYPE QueryObjectSink(
  73. /* [in] */ long lFlags,
  74. /* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
  75. HRESULT STDMETHODCALLTYPE GetObject(
  76. /* [in] */ const BSTR ObjectPath,
  77. /* [in] */ long lFlags,
  78. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  79. /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject,
  80. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
  81. HRESULT STDMETHODCALLTYPE GetObjectAsync(
  82. /* [in] */ const BSTR ObjectPath,
  83. /* [in] */ long lFlags,
  84. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  85. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;}
  86. HRESULT STDMETHODCALLTYPE PutClass(
  87. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  88. /* [in] */ long lFlags,
  89. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  90. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
  91. HRESULT STDMETHODCALLTYPE PutClassAsync(
  92. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  93. /* [in] */ long lFlags,
  94. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  95. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
  96. HRESULT STDMETHODCALLTYPE DeleteClass(
  97. /* [in] */ const BSTR Class,
  98. /* [in] */ long lFlags,
  99. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  100. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
  101. HRESULT STDMETHODCALLTYPE DeleteClassAsync(
  102. /* [in] */ const BSTR Class,
  103. /* [in] */ long lFlags,
  104. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  105. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
  106. HRESULT STDMETHODCALLTYPE CreateClassEnum(
  107. /* [in] */ const BSTR Superclass,
  108. /* [in] */ long lFlags,
  109. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  110. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;};
  111. HRESULT STDMETHODCALLTYPE CreateClassEnumAsync(
  112. /* [in] */ const BSTR Superclass,
  113. /* [in] */ long lFlags,
  114. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  115. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
  116. HRESULT STDMETHODCALLTYPE PutInstance(
  117. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  118. /* [in] */ long lFlags,
  119. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  120. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
  121. HRESULT STDMETHODCALLTYPE PutInstanceAsync(
  122. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  123. /* [in] */ long lFlags,
  124. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  125. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
  126. HRESULT STDMETHODCALLTYPE DeleteInstance(
  127. /* [in] */ const BSTR ObjectPath,
  128. /* [in] */ long lFlags,
  129. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  130. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;};
  131. HRESULT STDMETHODCALLTYPE DeleteInstanceAsync(
  132. /* [in] */ const BSTR ObjectPath,
  133. /* [in] */ long lFlags,
  134. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  135. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
  136. HRESULT STDMETHODCALLTYPE CreateInstanceEnum(
  137. /* [in] */ const BSTR Class,
  138. /* [in] */ long lFlags,
  139. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  140. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;};
  141. HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync(
  142. /* [in] */ const BSTR Class,
  143. /* [in] */ long lFlags,
  144. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  145. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler){return WBEM_E_NOT_SUPPORTED;}
  146. HRESULT STDMETHODCALLTYPE ExecQuery(
  147. /* [in] */ const BSTR QueryLanguage,
  148. /* [in] */ const BSTR Query,
  149. /* [in] */ long lFlags,
  150. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  151. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;};
  152. HRESULT STDMETHODCALLTYPE ExecQueryAsync(
  153. /* [in] */ const BSTR QueryLanguage,
  154. /* [in] */ const BSTR Query,
  155. /* [in] */ long lFlags,
  156. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  157. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
  158. HRESULT STDMETHODCALLTYPE ExecNotificationQuery(
  159. /* [in] */ const BSTR QueryLanguage,
  160. /* [in] */ const BSTR Query,
  161. /* [in] */ long lFlags,
  162. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  163. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;};
  164. HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync(
  165. /* [in] */ const BSTR QueryLanguage,
  166. /* [in] */ const BSTR Query,
  167. /* [in] */ long lFlags,
  168. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  169. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;};
  170. // Supported !!!!
  171. HRESULT STDMETHODCALLTYPE ExecMethod( const BSTR, const BSTR, long, IWbemContext*,
  172. IWbemClassObject*, IWbemClassObject**, IWbemCallResult**){return WBEM_E_NOT_SUPPORTED;}
  173. HRESULT STDMETHODCALLTYPE ExecMethodAsync( const BSTR, const BSTR, long,
  174. IWbemContext*, IWbemClassObject*, IWbemObjectSink*);
  175. };
  176. typedef CMethodPro *PCMethodPro;
  177. // This class is the class factory for CMethodPro objects.
  178. class CProvFactory : public IClassFactory
  179. {
  180. protected:
  181. ULONG m_cRef;
  182. public:
  183. CProvFactory(void);
  184. ~CProvFactory(void);
  185. //IUnknown members
  186. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  187. STDMETHODIMP_(ULONG) AddRef(void);
  188. STDMETHODIMP_(ULONG) Release(void);
  189. //IClassFactory members
  190. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID
  191. , PPVOID);
  192. STDMETHODIMP LockServer(BOOL);
  193. };
  194. typedef CProvFactory *PCProvFactory;
  195. // These variables keep track of when the module can be unloaded
  196. extern long g_cObj;
  197. extern long g_cLock;
  198. #endif