www.pudn.com > PPPOE.rar > COPPPOENotify.h
// COPPPOENotify.h : Declaration of the CCOPPPOENotify #pragma once #include "resource.h" // main symbols #include "netcfgn.h" #include "CoNotify.h" // CCOPPPOENotify class ATL_NO_VTABLE CCOPPPOENotify : public CComObjectRootEx, public CComCoClass , public IDispatchImpl , public INetCfgComponentControl, //public INetCfgComponentPropertyUi, public INetCfgComponentNotifyBinding, public INetCfgComponentNotifyGlobal, public INetCfgComponentSetup { public: CCOPPPOENotify(); DECLARE_REGISTRY_RESOURCEID(IDR_COPPPOENOTIFY) BEGIN_COM_MAP(CCOPPPOENotify) COM_INTERFACE_ENTRY(ICOPPPOENotify) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(INetCfgComponentControl) COM_INTERFACE_ENTRY(INetCfgComponentSetup) //COM_INTERFACE_ENTRY(INetCfgComponentPropertyUi) COM_INTERFACE_ENTRY(INetCfgComponentNotifyBinding) COM_INTERFACE_ENTRY(INetCfgComponentNotifyGlobal) END_COM_MAP() DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } public: public: // for INetCfgComponentControl STDMETHOD (Initialize)(IN INetCfgComponent* pIComp,IN INetCfg* pINetCfg,IN BOOL fInstalling); STDMETHOD (ApplyRegistryChanges)(); STDMETHOD (ApplyPnpChanges)(IN INetCfgPnpReconfigCallback* pICallback); STDMETHOD (CancelChanges)(); // for INetCfgComponentSetup STDMETHOD (ReadAnswerFile)(IN PCWSTR szAnswerFile,IN PCWSTR szAnswerSections); STDMETHOD (Upgrade)(IN DWORD dwSetupFlags,IN DWORD dwUpgradeFromBuildNo); STDMETHOD (Install)(IN DWORD dwSetupFlags); STDMETHOD (Removing)(); // for INetCfgComponentPropertyUi //STDMETHOD (QueryPropertyUi)(IN IUnknown* pUnk); //STDMETHOD (SetContext)(IN IUnknown* pUnk); //STDMETHOD (MergePropPages)(IN OUT DWORD* pdwDefPages,OUT LPBYTE* pahpspPrivate,OUT UINT* pcPrivate,IN HWND hwndParent,OUT PCWSTR* pszStartPage); //STDMETHOD (ValidateProperties)(IN HWND hWndSheet); //STDMETHOD (CancelProperties)(); //STDMETHOD (ApplyProperties)(); // for INetCfgComponentNotifyBinding STDMETHOD (QueryBindingPath)(IN DWORD dwChangeFlag,IN INetCfgBindingPath* pncbp); STDMETHOD (NotifyBindingPath)(IN DWORD dwChangeFlag,IN INetCfgBindingPath* pncbp); // for INetCfgComponentNotifyGlobal STDMETHOD (GetSupportedNotifications)(OUT DWORD* pdwNotificationFlag); STDMETHOD (SysQueryBindingPath)(IN DWORD dwChangeFlag,IN INetCfgBindingPath* pncbp); STDMETHOD (SysNotifyBindingPath)(IN DWORD dwChangeFlag,IN INetCfgBindingPath* pncbp); STDMETHOD (SysNotifyComponent)(IN DWORD dwChangeFlag,IN INetCfgComponent* pncbp); private: //BOOL FindDevice(IN LPCTSTR pszHardwareId); //BOOL InstallRootEnumeratedDriver(IN LPCTSTR pszHardwareId,IN LPCTSTR pszInfPath,OUT PBOOL pRebootRequired OPTIONAL); HRESULT FindInstance (GUID &guidInstance,INetCfgComponent **ppnccMiniport); HRESULT InstallMiniport(); HRESULT RemoveMiniport(); private: INetCfgComponent* m_pNetCfgComponent; INetCfg* m_pNetCfg; IUnknown* m_pUnkContext; GUID m_guidMiniport; DWORD m_dwChangeType; static DWORD const InstallDriver = 0; static DWORD const RemoveDriver = 1; }; OBJECT_ENTRY_AUTO(__uuidof(COPPPOENotify), CCOPPPOENotify)