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.

237 lines
8.7 KiB

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