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.

242 lines
9.0 KiB

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