Leaked source code of windows server 2003
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.

162 lines
5.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: L A N U I O B J. H
  7. //
  8. // Contents: Declaration of the LAN ConnectionUI object
  9. //
  10. // Notes:
  11. //
  12. // Created: tongl 8 Oct 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "nsbase.h" // must be first to include atl
  17. #include "lanwiz.h"
  18. #include "ncatlps.h"
  19. #include "netshell.h"
  20. #include "netcfgn.h"
  21. #include "nsres.h"
  22. #include "wzcui.h"
  23. class ATL_NO_VTABLE CLanConnectionUi :
  24. public CComObjectRootEx <CComObjectThreadModel>,
  25. public CComCoClass <CLanConnectionUi, &CLSID_LanConnectionUi>,
  26. public INetConnectionConnectUi,
  27. public INetConnectionPropertyUi2,
  28. public INetConnectionUiLock,
  29. public INetConnectionWizardUi,
  30. public INetLanConnectionUiInfo,
  31. public INetLanConnectionWizardUi
  32. {
  33. public:
  34. CLanConnectionUi()
  35. {
  36. m_pconn = NULL;
  37. m_pspNet = NULL;
  38. m_pspAdvanced = NULL;
  39. m_pspSecurity = NULL;
  40. m_pspWZeroConf = NULL;
  41. m_pspHomenetUnavailable = NULL;
  42. m_fReadOnly = FALSE;
  43. m_fNeedReboot = FALSE;
  44. m_fAccessDenied = FALSE;
  45. m_pContext = NULL;
  46. m_pnc = NULL;
  47. m_pnccAdapter = NULL;
  48. m_pWizPage = NULL;
  49. m_pLanConn = NULL;
  50. m_strConnectionName = c_szEmpty;
  51. }
  52. ~CLanConnectionUi()
  53. {
  54. ReleaseObj(m_pconn);
  55. delete m_pspNet;
  56. delete m_pspAdvanced;
  57. delete m_pspSecurity;
  58. delete m_pspWZeroConf;
  59. delete m_pspHomenetUnavailable;
  60. ReleaseObj(m_pnc);
  61. ReleaseObj(m_pnccAdapter);
  62. ReleaseObj(m_pContext);
  63. delete m_pWizPage;
  64. ReleaseObj(m_pLanConn);
  65. }
  66. DECLARE_REGISTRY_RESOURCEID(IDR_LAN_UI)
  67. BEGIN_COM_MAP(CLanConnectionUi)
  68. COM_INTERFACE_ENTRY(INetConnectionConnectUi)
  69. COM_INTERFACE_ENTRY(INetConnectionPropertyUi)
  70. COM_INTERFACE_ENTRY(INetConnectionPropertyUi2)
  71. COM_INTERFACE_ENTRY(INetConnectionUiLock)
  72. COM_INTERFACE_ENTRY(INetConnectionWizardUi)
  73. COM_INTERFACE_ENTRY(INetLanConnectionUiInfo)
  74. COM_INTERFACE_ENTRY(INetLanConnectionWizardUi)
  75. END_COM_MAP()
  76. // INetConnectionConnectUi
  77. //
  78. STDMETHOD (SetConnection)(INetConnection* pCon);
  79. STDMETHOD (Connect)(HWND hwndParent, DWORD dwFlags);
  80. STDMETHOD (Disconnect)(HWND hwndParent, DWORD dwFlags);
  81. // INetConnectionPropertyUi2
  82. //
  83. STDMETHOD (AddPages)(HWND hwndParent,
  84. LPFNADDPROPSHEETPAGE pfnAddPage,
  85. LPARAM lParam);
  86. STDMETHOD (GetIcon) (
  87. DWORD dwSize,
  88. HICON *phIcon );
  89. // INetConnectionWizardUi
  90. STDMETHOD (QueryMaxPageCount) (INetConnectionWizardUiContext* pContext,
  91. DWORD* pcMaxPages);
  92. STDMETHOD (AddPages) ( INetConnectionWizardUiContext* pContext,
  93. LPFNADDPROPSHEETPAGE pfnAddPage,
  94. LPARAM lParam);
  95. STDMETHOD (GetNewConnectionInfo) (
  96. DWORD* pdwFlags,
  97. NETCON_MEDIATYPE* pMediaType);
  98. STDMETHOD (GetSuggestedConnectionName)(PWSTR* ppszwSuggestedName);
  99. STDMETHOD (SetConnectionName) (PCWSTR pszwConnectionName);
  100. STDMETHOD (GetNewConnection) (INetConnection** ppCon);
  101. // INetLanConnectionWizardUi
  102. STDMETHOD (SetDeviceComponent) (const GUID * pguid);
  103. // INetLanConnectionUiInfo
  104. STDMETHOD (GetDeviceGuid) (GUID * pguid);
  105. // INetConnectionUiLock
  106. STDMETHOD (QueryLock) (PWSTR* ppszwLockHolder);
  107. public:
  108. private:
  109. //==============
  110. // Data members
  111. //==============
  112. INetConnection * m_pconn; // Pointer to LAN connection object
  113. CPropSheetPage * m_pspNet; // Networking property page
  114. CPropSheetPage * m_pspAdvanced; // 'Advanced' property page
  115. CPropSheetPage * m_pspHomenetUnavailable; // Homenet is unavailable page
  116. CPropSheetPage * m_pspSecurity; // EAPOL security page
  117. CWZeroConfPage * m_pspWZeroConf; // Wireless Zero Configuration page
  118. // =====================
  119. // Wizard data members
  120. // =====================
  121. INetConnectionWizardUiContext* m_pContext; // The WizardUI context
  122. INetCfg * m_pnc; // This is the writable INetCfg passed to the Lan Wizard
  123. INetCfgComponent * m_pnccAdapter; // The adapter that represents this connection
  124. tstring m_strConnectionName; // Unique name of this LAN connection
  125. class CLanWizPage * m_pWizPage; // Lan wizard page
  126. INetLanConnection * m_pLanConn; // Lan conection created through the wizard
  127. BOOLEAN m_fReadOnly; // If TRUE, then access to inetcfg is RO
  128. BOOLEAN m_fNeedReboot; // If TRUE, then we are readonly becuase INetCfg needs a reboot
  129. BOOLEAN m_fAccessDenied;// If TRUE, the user is not logged on as admin
  130. // =====================
  131. // Wizard help functions
  132. // =====================
  133. HRESULT HrSetupWizPages(INetConnectionWizardUiContext* pContext,
  134. HPROPSHEETPAGE ** pahpsp, INT * pcPages);
  135. HRESULT HrGetLanConnection(INetLanConnection ** ppcon);
  136. };