#ifndef __WBEM_POLICY_GPO__H_ #define __WBEM_POLICY_GPO__H_ class CPolicyGPO : public CUnk { enum { AD_LOCAL_CONTEXT = 0, AD_GLOBAL_CONTEXT, AD_MAX_CONTEXT }; public: CPolicyGPO(CLifeControl* pControl = NULL, IUnknown* pOuter = NULL) : CUnk(pControl, pOuter), m_XProvider(this), m_XInit(this), m_pWMIMgmt(NULL), m_pADMgmt(NULL) {} ~CPolicyGPO(); void* GetInterface(REFIID riid); // stuff for our internal use IWbemServices* GetWMIServices(); IADsContainer* GetADServices(wchar_t *DsPath = NULL); bool SetWMIServices(IWbemServices* pServices); bool SetADServices(IADsContainer* pServices); protected: class XProvider : public CImpl { public: XProvider(CPolicyGPO* pObj) : CImpl(pObj),m_pWMIGPOClassObject(NULL) {} ~XProvider(); protected: /* object support */ IWbemClassObject* GetWMIGPOClass(); IWbemClassObject* GetWMIGPOInstance(); private: // templates for each type of object we support // NULL until we need it IWbemClassObject* m_pWMIGPOClassObject; public: HRESULT STDMETHODCALLTYPE OpenNamespace( /* [in] */ const BSTR Namespace, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [unique][in][out] */ IWbemServices __RPC_FAR *__RPC_FAR *ppWorkingNamespace, /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppResult) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE CancelAsyncCall( /* [in] */ IWbemObjectSink __RPC_FAR *pSink) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE QueryObjectSink( /* [in] */ long lFlags, /* [out] */ IWbemObjectSink __RPC_FAR *__RPC_FAR *ppResponseHandler) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE GetObject( /* [in] */ const BSTR ObjectPath, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [unique][in][out] */ IWbemClassObject __RPC_FAR *__RPC_FAR *ppObject, /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE GetObjectAsync( /* [in] */ const BSTR ObjectPath, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler); HRESULT STDMETHODCALLTYPE PutClass( /* [in] */ IWbemClassObject __RPC_FAR *pObject, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE PutClassAsync( /* [in] */ IWbemClassObject __RPC_FAR *pObject, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE DeleteClass( /* [in] */ const BSTR Class, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE DeleteClassAsync( /* [in] */ const BSTR Class, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE CreateClassEnum( /* [in] */ const BSTR Superclass, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE CreateClassEnumAsync( /* [in] */ const BSTR Superclass, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE PutInstance( /* [in] */ IWbemClassObject __RPC_FAR *pInst, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE PutInstanceAsync( /* [in] */ IWbemClassObject __RPC_FAR *pInst, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler); HRESULT STDMETHODCALLTYPE DeleteInstance( /* [in] */ const BSTR ObjectPath, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [unique][in][out] */ IWbemCallResult __RPC_FAR *__RPC_FAR *ppCallResult) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE DeleteInstanceAsync( /* [in] */ const BSTR ObjectPath, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler); HRESULT STDMETHODCALLTYPE CreateInstanceEnum( /* [in] */ const BSTR Class, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE CreateInstanceEnumAsync( /* [in] */ const BSTR Class, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler); HRESULT STDMETHODCALLTYPE ExecQuery( /* [in] */ const BSTR QueryLanguage, /* [in] */ const BSTR Query, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE ExecQueryAsync( /* [in] */ const BSTR QueryLanguage, /* [in] */ const BSTR Query, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler); HRESULT STDMETHODCALLTYPE ExecNotificationQuery( /* [in] */ const BSTR QueryLanguage, /* [in] */ const BSTR Query, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [out] */ IEnumWbemClassObject __RPC_FAR *__RPC_FAR *ppEnum) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE ExecNotificationQueryAsync( /* [in] */ const BSTR QueryLanguage, /* [in] */ const BSTR Query, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler) {return WBEM_E_NOT_SUPPORTED;}; HRESULT STDMETHODCALLTYPE ExecMethod( const BSTR, const BSTR, long, IWbemContext*, IWbemClassObject*, IWbemClassObject**, IWbemCallResult**) {return WBEM_E_NOT_SUPPORTED;} HRESULT STDMETHODCALLTYPE ExecMethodAsync( /* [in] */ const BSTR strObjectPath, /* [in] */ const BSTR strMethodName, /* [in] */ long lFlags, /* [in] */ IWbemContext __RPC_FAR *pCtx, /* [in] */ IWbemClassObject __RPC_FAR *pInParams, /* [in] */ IWbemObjectSink __RPC_FAR *pResponseHandler); } m_XProvider; friend XProvider; class XInit : public CImpl { public: XInit(CPolicyGPO* pObj) : CImpl(pObj){} HRESULT STDMETHODCALLTYPE Initialize( LPWSTR, LONG, LPWSTR, LPWSTR, IWbemServices*, IWbemContext*, IWbemProviderInitSink*); } m_XInit; friend XInit; private: // pointer back to win management IWbemServices* m_pWMIMgmt; IADsContainer *m_pADMgmt; CComVariant m_vDsConfigContext, m_vDsLocalContext; // a little something to keep our threads from getting tangled // will use a single critical section to protect all instance variables CCritSec m_CS; }; #endif // __WBEM_POLICY_GPO__H_