Source code of Windows XP (NT5)
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.

266 lines
9.7 KiB

  1. #ifndef __WBEM_POLICY_RANGE__H_
  2. #define __WBEM_POLICY_RANGE__H_
  3. #include <unk.h>
  4. #include <wbemcli.h>
  5. #include <wbemprov.h>
  6. #include <stdio.h>
  7. #include <sync.h>
  8. #include "activeds.h"
  9. class CPolicyRange : public CUnk
  10. {
  11. public:
  12. CPolicyRange(CLifeControl* pControl = NULL, IUnknown* pOuter = NULL)
  13. : CUnk(pControl, pOuter),
  14. m_XProvider(this),
  15. m_XInit(this),
  16. m_pWMIMgmt(NULL),
  17. m_pADMgmt(NULL)
  18. {}
  19. ~CPolicyRange();
  20. void* GetInterface(REFIID riid);
  21. // stuff for our internal use
  22. IWbemServices* GetWMIServices();
  23. IADsContainer* GetADServices(void);
  24. bool SetWMIServices(IWbemServices* pServices);
  25. bool SetADServices(IADsContainer* pServices);
  26. protected:
  27. class XProvider : public CImpl<IWbemServices, CPolicyRange>
  28. {
  29. public:
  30. IWbemClassObject *GetPolicyTemplateClass();
  31. IWbemClassObject *GetPolicyTemplateInstance();
  32. IWbemClassObject *m_pWMIPolicyClassObject;
  33. HRESULT DoResolve(IWbemServices* pPolicyNamespace,
  34. const BSTR strObjectPath,
  35. IWbemContext __RPC_FAR *pCtx,
  36. IWbemClassObject __RPC_FAR *pInParams,
  37. IWbemClassObject __RPC_FAR *pOutParams,
  38. IWbemObjectSink __RPC_FAR *pResponseHandler);
  39. HRESULT DoMerge(IWbemServices* pNamespace,
  40. const BSTR strObjectPath,
  41. IWbemContext __RPC_FAR *pCtx,
  42. IWbemClassObject __RPC_FAR *pInParams,
  43. IWbemClassObject __RPC_FAR *pOutParams,
  44. IWbemObjectSink __RPC_FAR *pResponseHandler);
  45. XProvider(CPolicyRange* pObj)
  46. : CImpl<IWbemServices, CPolicyRange>(pObj),
  47. m_pWMIPolicyClassObject(NULL)
  48. {}
  49. ~XProvider(void);
  50. HRESULT STDMETHODCALLTYPE OpenNamespace(
  51. /* [in] */ const BSTR Namespace,
  52. /* [in] */ long lFlags,
  53. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  54. /* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace,
  55. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult)
  56. {return WBEM_E_NOT_SUPPORTED;};
  57. HRESULT STDMETHODCALLTYPE CancelAsyncCall(
  58. /* [in] */ IWbemObjectSink __RPC_FAR *pSink)
  59. {return WBEM_E_NOT_SUPPORTED;};
  60. HRESULT STDMETHODCALLTYPE QueryObjectSink(
  61. /* [in] */ long lFlags,
  62. /* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler)
  63. {return WBEM_E_NOT_SUPPORTED;};
  64. HRESULT STDMETHODCALLTYPE GetObject(
  65. /* [in] */ const BSTR ObjectPath,
  66. /* [in] */ long lFlags,
  67. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  68. /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject,
  69. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  70. {return WBEM_E_NOT_SUPPORTED;};
  71. HRESULT STDMETHODCALLTYPE GetObjectAsync(
  72. /* [in] */ const BSTR ObjectPath,
  73. /* [in] */ long lFlags,
  74. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  75. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  76. {return WBEM_E_NOT_SUPPORTED;};
  77. HRESULT STDMETHODCALLTYPE PutClass(
  78. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  79. /* [in] */ long lFlags,
  80. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  81. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  82. {return WBEM_E_NOT_SUPPORTED;};
  83. HRESULT STDMETHODCALLTYPE PutClassAsync(
  84. /* [in] */ IWbemClassObject __RPC_FAR *pObject,
  85. /* [in] */ long lFlags,
  86. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  87. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  88. {return WBEM_E_NOT_SUPPORTED;};
  89. HRESULT STDMETHODCALLTYPE DeleteClass(
  90. /* [in] */ const BSTR Class,
  91. /* [in] */ long lFlags,
  92. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  93. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  94. {return WBEM_E_NOT_SUPPORTED;};
  95. HRESULT STDMETHODCALLTYPE DeleteClassAsync(
  96. /* [in] */ const BSTR Class,
  97. /* [in] */ long lFlags,
  98. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  99. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  100. {return WBEM_E_NOT_SUPPORTED;};
  101. HRESULT STDMETHODCALLTYPE CreateClassEnum(
  102. /* [in] */ const BSTR Superclass,
  103. /* [in] */ long lFlags,
  104. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  105. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum)
  106. {return WBEM_E_NOT_SUPPORTED;};
  107. HRESULT STDMETHODCALLTYPE CreateClassEnumAsync(
  108. /* [in] */ const BSTR Superclass,
  109. /* [in] */ long lFlags,
  110. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  111. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  112. {return WBEM_E_NOT_SUPPORTED;};
  113. HRESULT STDMETHODCALLTYPE PutInstance(
  114. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  115. /* [in] */ long lFlags,
  116. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  117. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  118. {return WBEM_E_NOT_SUPPORTED;};
  119. HRESULT STDMETHODCALLTYPE PutInstanceAsync(
  120. /* [in] */ IWbemClassObject __RPC_FAR *pInst,
  121. /* [in] */ long lFlags,
  122. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  123. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  124. {return WBEM_E_NOT_SUPPORTED;};
  125. HRESULT STDMETHODCALLTYPE DeleteInstance(
  126. /* [in] */ const BSTR ObjectPath,
  127. /* [in] */ long lFlags,
  128. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  129. /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult)
  130. {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)
  136. {return WBEM_E_NOT_SUPPORTED;};
  137. HRESULT STDMETHODCALLTYPE CreateInstanceEnum(
  138. /* [in] */ const BSTR Class,
  139. /* [in] */ long lFlags,
  140. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  141. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum)
  142. {return WBEM_E_NOT_SUPPORTED;};
  143. HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync(
  144. /* [in] */ const BSTR Class,
  145. /* [in] */ long lFlags,
  146. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  147. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  148. {return WBEM_E_NOT_SUPPORTED;};
  149. HRESULT STDMETHODCALLTYPE ExecQuery(
  150. /* [in] */ const BSTR QueryLanguage,
  151. /* [in] */ const BSTR Query,
  152. /* [in] */ long lFlags,
  153. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  154. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum)
  155. {return WBEM_E_NOT_SUPPORTED;};
  156. HRESULT STDMETHODCALLTYPE ExecQueryAsync(
  157. /* [in] */ const BSTR QueryLanguage,
  158. /* [in] */ const BSTR Query,
  159. /* [in] */ long lFlags,
  160. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  161. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  162. {return WBEM_E_NOT_SUPPORTED;};
  163. HRESULT STDMETHODCALLTYPE ExecNotificationQuery(
  164. /* [in] */ const BSTR QueryLanguage,
  165. /* [in] */ const BSTR Query,
  166. /* [in] */ long lFlags,
  167. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  168. /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum)
  169. {return WBEM_E_NOT_SUPPORTED;};
  170. HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync(
  171. /* [in] */ const BSTR QueryLanguage,
  172. /* [in] */ const BSTR Query,
  173. /* [in] */ long lFlags,
  174. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  175. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler)
  176. {return WBEM_E_NOT_SUPPORTED;};
  177. HRESULT STDMETHODCALLTYPE ExecMethod( const BSTR, const BSTR, long, IWbemContext*,
  178. IWbemClassObject*, IWbemClassObject**, IWbemCallResult**)
  179. {return WBEM_E_NOT_SUPPORTED;}
  180. HRESULT STDMETHODCALLTYPE ExecMethodAsync(
  181. /* [in] */ const BSTR strObjectPath,
  182. /* [in] */ const BSTR strMethodName,
  183. /* [in] */ long lFlags,
  184. /* [in] */ IWbemContext __RPC_FAR *pCtx,
  185. /* [in] */ IWbemClassObject __RPC_FAR *pInParams,
  186. /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler);
  187. HRESULT DoSet();
  188. } m_XProvider;
  189. friend XProvider;
  190. class XInit : public CImpl<IWbemProviderInit, CPolicyRange>
  191. {
  192. public:
  193. XInit(CPolicyRange* pObj)
  194. : CImpl<IWbemProviderInit, CPolicyRange>(pObj){}
  195. HRESULT STDMETHODCALLTYPE Initialize(
  196. LPWSTR, LONG, LPWSTR, LPWSTR, IWbemServices*, IWbemContext*,
  197. IWbemProviderInitSink*);
  198. } m_XInit;
  199. friend XInit;
  200. private:
  201. // pointer back to win management
  202. IWbemServices* m_pWMIMgmt;
  203. // pointer to AD policy template table
  204. IADsContainer* m_pADMgmt;
  205. // templates for each type of object we support
  206. // NULL until we need it
  207. IWbemClassObject* m_pWMIPolicyClassObject;
  208. // a little something to keep our threads from getting tangled
  209. // will use a single critical section to protect all instance variables
  210. CCritSec m_CS;
  211. };
  212. #endif // __WBEM_POLICY_RANGE__H_