home *** CD-ROM | disk | FTP | other *** search
/ PCNET 2006 September - Disc 1 / PCNET_CD_2006_09.iso / surpriz / MSRMesh-VirtualWIFI.MSI / notify.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-06-24  |  7.1 KB  |  276 lines

  1. /*
  2.  * Author   : Ranveer Chandra
  3.  * Directory: VirtualWiFi_Root\notifyob
  4.  * File Name: notify.h
  5.  * Purpose  : VirtualWiFi notify object header file.
  6.  */
  7.  
  8. #ifndef NOTIFY_H_INCLUDE
  9.  
  10. #define NOTIFY_H_INCLUDE
  11.  
  12. #include <windows.h>
  13.  
  14. #include <atlbase.h>
  15. extern CComModule _Module;  // required by atlcom.h
  16. #include <atlcom.h>
  17. #include <devguid.h>
  18. #include <setupapi.h>
  19.  
  20. #include <notifyn.h>
  21. #include "list.h"
  22. #include "adapter.h"
  23. #include "resource.h"
  24. #include "common.h"
  25.  
  26.  
  27. //
  28. // CMuxNotify Object - Base class for the entire notify object
  29. //
  30.  
  31.  
  32. class CMuxNotify :
  33.  
  34.                //
  35.                // Must inherit from CComObjectRoot(Ex) for reference count
  36.                // management and default threading model.
  37.                //
  38.  
  39.                public CComObjectRoot,
  40.  
  41.                //
  42.                // Define the default class factory and aggregation model.
  43.                //
  44.  
  45.                public CComCoClass<CMuxNotify, &CLSID_CMuxNotify>,
  46.  
  47.                //
  48.                // Notify Object's interfaces.
  49.                //
  50.  
  51.                public INetCfgComponentControl,
  52.                public INetCfgComponentSetup,
  53.                public INetCfgComponentPropertyUi,
  54.                public INetCfgComponentNotifyBinding,
  55.                public INetCfgComponentNotifyGlobal
  56. {
  57.  
  58.    //
  59.    // Public members.
  60.    //
  61.  
  62.    public:
  63.  
  64.       //
  65.       // Constructor
  66.       //
  67.  
  68.       CMuxNotify(VOID);
  69.  
  70.       //
  71.       // Destructors.
  72.       //
  73.  
  74.       ~CMuxNotify(VOID);
  75.  
  76.       //
  77.       // Notify Object's interfaces.
  78.       //
  79.  
  80.       BEGIN_COM_MAP(CMuxNotify)
  81.          COM_INTERFACE_ENTRY(INetCfgComponentControl)
  82.          COM_INTERFACE_ENTRY(INetCfgComponentSetup)
  83.          COM_INTERFACE_ENTRY(INetCfgComponentPropertyUi)
  84.          COM_INTERFACE_ENTRY(INetCfgComponentNotifyBinding)
  85.          COM_INTERFACE_ENTRY(INetCfgComponentNotifyGlobal)
  86.       END_COM_MAP()
  87.  
  88.       //
  89.       // Uncomment the the line below if you don't want your object to
  90.       // support aggregation. The default is to support it
  91.       //
  92.       // DECLARE_NOT_AGGREGATABLE(CMuxNotify)
  93.       //
  94.  
  95.       DECLARE_REGISTRY_RESOURCEID(IDR_REG_SAMPLE_NOTIFY)
  96.  
  97.       //
  98.       // INetCfgComponentControl
  99.       //
  100.  
  101.       STDMETHOD (Initialize) (
  102.                    IN INetCfgComponent  *pIComp,
  103.                    IN INetCfg           *pINetCfg,
  104.                    IN BOOL              fInstalling);
  105.  
  106.       STDMETHOD (CancelChanges) ();
  107.  
  108.       STDMETHOD (ApplyRegistryChanges) ();
  109.  
  110.       STDMETHOD (ApplyPnpChanges) (
  111.                    IN INetCfgPnpReconfigCallback* pICallback);
  112.  
  113.       //
  114.       // INetCfgComponentSetup
  115.       //
  116.  
  117.       STDMETHOD (Install) (
  118.                    IN DWORD dwSetupFlags);
  119.  
  120.       STDMETHOD (Upgrade) (
  121.                    IN DWORD dwSetupFlags,
  122.                    IN DWORD dwUpgradeFromBuildNo);
  123.  
  124.       STDMETHOD (ReadAnswerFile) (
  125.                    IN PCWSTR szAnswerFile,
  126.                    IN PCWSTR szAnswerSections);
  127.  
  128.       STDMETHOD (Removing) ();
  129.  
  130.       //
  131.       // INetCfgComponentPropertyUi
  132.       //
  133.  
  134.         STDMETHOD (QueryPropertyUi) (
  135.                    IN IUnknown* pUnk);
  136.  
  137.         STDMETHOD (SetContext) (
  138.                    IN IUnknown* pUnk);
  139.  
  140.         STDMETHOD (MergePropPages) (
  141.                    IN OUT DWORD* pdwDefPages,
  142.                    OUT LPBYTE* pahpspPrivate,
  143.                    OUT UINT* pcPrivate,
  144.                    IN HWND hwndParent,
  145.                    OUT PCWSTR* pszStartPage);
  146.  
  147.         STDMETHOD (ValidateProperties) (
  148.                    HWND hwndSheet);
  149.  
  150.         STDMETHOD (CancelProperties) ();
  151.  
  152.         STDMETHOD (ApplyProperties) ();
  153.  
  154.       //
  155.       // INetCfgNotifyBinding
  156.       //
  157.  
  158.       STDMETHOD (QueryBindingPath) (
  159.                    IN DWORD dwChangeFlag,
  160.                    IN INetCfgBindingPath* pncbp);
  161.  
  162.       STDMETHOD (NotifyBindingPath) (
  163.                    IN DWORD dwChangeFlag,
  164.                    IN INetCfgBindingPath* pncbp);
  165.  
  166.       //
  167.       // INetCfgNotifyGlobal
  168.       //
  169.  
  170.       STDMETHOD (GetSupportedNotifications) (
  171.                    OUT DWORD* pdwNotificationFlag );
  172.  
  173.       STDMETHOD (SysQueryBindingPath) (
  174.                    IN DWORD dwChangeFlag,
  175.                    IN INetCfgBindingPath* pncbp);
  176.  
  177.       STDMETHOD (SysNotifyBindingPath) (
  178.                    IN DWORD dwChangeFlag,
  179.                    IN INetCfgBindingPath* pncbp);
  180.             
  181.       STDMETHOD (SysNotifyComponent) (
  182.                    IN DWORD dwChangeFlag,
  183.                    IN INetCfgComponent* pncc);
  184.  
  185.   //
  186.   // Private members.
  187.   //
  188.  
  189.   private:
  190.  
  191.      //
  192.      // Private member variables.
  193.      //
  194.  
  195.      INetCfgComponent  *m_pncc;  // Protocol's Net Config component
  196.      INetCfg           *m_pnc;
  197.      ConfigAction      m_eApplyAction;
  198.      IUnknown*         m_pUnkContext;
  199.  
  200.      //
  201.      // List of physical adapters currently installed.
  202.      //
  203.  
  204.      List<CMuxPhysicalAdapter *, GUID> m_AdaptersList;
  205.  
  206.      //
  207.      // List of physical adapters to be removed.
  208.      //
  209.  
  210.      List<CMuxPhysicalAdapter *, GUID> m_AdaptersToRemove;
  211.  
  212.      //
  213.      // List of physical adapters to be added.
  214.      //
  215.  
  216.      List<CMuxPhysicalAdapter *, GUID> m_AdaptersToAdd;
  217.  
  218.      //
  219.      // Private member functions.
  220.      //
  221.  
  222.      HRESULT HrLoadAdapterConfiguration (VOID);
  223.  
  224.      HRESULT HrGetUpperAndLower (INetCfgBindingPath* pncbp,
  225.                                  INetCfgComponent **ppnccUpper,
  226.                                  INetCfgComponent **ppnccLower);
  227.  
  228.      HRESULT HrAddAdapter (INetCfgComponent *pnccAdapter);
  229.  
  230.      HRESULT HrRemoveAdapter (INetCfgComponent *pnccAdapter);
  231.  
  232.      HRESULT HrAddMiniport (CMuxPhysicalAdapter *pAdapter,
  233.                             GUID *guidAdapter);
  234.  
  235.      HRESULT HrRemoveMiniport (CMuxPhysicalAdapter *pAdapter,
  236.                             GUID *guidAdapter);
  237.  
  238. #ifdef DISABLE_PROTOCOLS_TO_PHYSICAL
  239.  
  240.     VOID EnableBindings (INetCfgComponent *pnccAdapter,
  241.                          BOOL bEnable);
  242.  
  243.     BOOL IfExistMux (INetCfgBindingPath *pncbp);
  244.  
  245.     HRESULT HrGetBindingPathEnum (INetCfgComponent *pnccAdapter,
  246.                                   DWORD dwBindingType,
  247.                                   IEnumNetCfgBindingPath **ppencbp);
  248.  
  249.     HRESULT HrGetBindingPath (IEnumNetCfgBindingPath *pencbp,
  250.                               INetCfgBindingPath **ppncbp);
  251.  
  252.     HRESULT HrGetBindingInterfaceEnum (INetCfgBindingPath *pncbp,
  253.                                        IEnumNetCfgBindingInterface **ppencbi);
  254.  
  255.     HRESULT HrGetBindingInterface (IEnumNetCfgBindingInterface *pencbi,
  256.                                    INetCfgBindingInterface **ppncbi);
  257. #endif
  258.  
  259.   public:
  260.  
  261.      LRESULT OnInitDialog (IN HWND hWnd);
  262.      LRESULT OnOk (IN HWND hWnd);
  263.      LRESULT OnCancel (IN HWND hWnd);
  264. };
  265.  
  266.  
  267. LRESULT CALLBACK NotifyDialogProc (HWND hWnd,
  268.                                    UINT uMsg,
  269.                                    WPARAM wParam,
  270.                                    LPARAM lParam);
  271. UINT CALLBACK NotifyPropSheetPageProc (HWND hWnd,
  272.                                        UINT uMsg,
  273.                                        LPPROPSHEETPAGE ppsp);
  274. #endif // NOTIFY_H_INCLUDE
  275.  
  276.