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.

533 lines
19 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1997.
  5. //
  6. // File: L A N U I . H
  7. //
  8. // Contents: Lan connection UI object.
  9. //
  10. // Notes:
  11. //
  12. // Author: danielwe 16 Oct 1997
  13. //
  14. //----------------------------------------------------------------------------
  15. #pragma once
  16. #include "nsbase.h" // must be first to include atl
  17. #include "chklist.h"
  18. #include "ncatlps.h"
  19. #include "netcfgp.h"
  20. #include "netcfgx.h"
  21. #include "netcon.h"
  22. #include "netconp.h"
  23. #include "ncras.h"
  24. #include "nsres.h"
  25. #include "resource.h"
  26. #include "netshell.h"
  27. #include "util.h"
  28. #include "HNetCfg.h"
  29. struct ADVANCED_ITEM_DATA
  30. {
  31. PWSTR szwName;
  32. INetCfgComponent * pncc;
  33. };
  34. class CLanConnectionUiDlg :
  35. public CDialogImpl<CLanConnectionUiDlg>
  36. {
  37. BEGIN_MSG_MAP(CLanConnectionUiDlg)
  38. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  39. END_MSG_MAP()
  40. enum { IDD = IDD_LAN_CONNECT};
  41. CLanConnectionUiDlg() { m_pconn = NULL; };
  42. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam,
  43. LPARAM lParam, BOOL& bHandled);
  44. VOID SetConnection(INetConnection *pconn) {m_pconn = pconn;}
  45. private:
  46. INetConnection * m_pconn;
  47. };
  48. static const UINT WM_DEFERREDINIT = WM_USER + 100;
  49. //
  50. // LAN Connection Networking Property Page
  51. //
  52. class CLanNetPage: public CPropSheetPage
  53. {
  54. public:
  55. CLanNetPage(
  56. IUnknown* punk,
  57. INetCfg* pnc,
  58. INetConnection* pconn,
  59. BOOLEAN fReadOnly,
  60. BOOLEAN fNeedReboot,
  61. BOOLEAN fAccessDenied,
  62. const DWORD * adwHelpIDs = NULL);
  63. ~CLanNetPage();
  64. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam,
  65. LPARAM lParam, BOOL& bHandled);
  66. LRESULT OnPaint(UINT uMsg, WPARAM wParam,
  67. LPARAM lParam, BOOL& bHandled);
  68. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  69. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  70. LRESULT OnDestroy(UINT uMsg, WPARAM wParam,
  71. LPARAM lParam, BOOL& bHandled);
  72. LRESULT OnSetCursor(UINT uMsg, WPARAM wParam,
  73. LPARAM lParam, BOOL& bHandled);
  74. LRESULT OnAddHelper(HWND hwndLV);
  75. LRESULT OnRemoveHelper(HWND hwndLV);
  76. LRESULT OnPropertiesHelper(HWND hwndLV);
  77. LRESULT OnConfigure(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  78. BOOL& bHandled);
  79. LRESULT OnKillActiveHelper(HWND hwndLV);
  80. LRESULT OnApply(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  81. LRESULT OnCancel(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  82. LRESULT OnDeferredInit(UINT uMsg, WPARAM wParam,
  83. LPARAM lParam, BOOL& bHandled);
  84. HRESULT HrRequestReboot();
  85. protected:
  86. INetConnection * m_pconn;
  87. INetCfg * m_pnc;
  88. IUnknown * m_punk;
  89. INetCfgComponent * m_pnccAdapter;
  90. HIMAGELIST m_hil;
  91. PSP_CLASSIMAGELIST_DATA m_pcild;
  92. HIMAGELIST m_hilCheckIcons;
  93. HCURSOR m_hPrevCurs;
  94. // The collection of BindingPathObj
  95. // This is for handling the checklist state stuff
  96. ListBPObj m_listBindingPaths;
  97. // Handles (add\remove\property buttons and description text)
  98. HANDLES m_handles;
  99. BOOLEAN m_fReadOnly;
  100. BOOLEAN m_fDirty;
  101. HRESULT static RaiseDeviceConfiguration(HWND hWndParent, INetCfgComponent* pAdapterConfigComponent);
  102. LRESULT OnChange(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  103. BOOL& bHandled);
  104. private:
  105. const DWORD * m_adwHelpIDs;
  106. INetLanConnection * m_plan;
  107. BOOLEAN m_fRebootAlreadyRequested;
  108. BOOLEAN m_fNeedReboot;
  109. BOOLEAN m_fAccessDenied;
  110. BOOLEAN m_fInitComplete;
  111. BOOLEAN m_fNetcfgInUse;
  112. BOOLEAN m_fNoCancel;
  113. BOOLEAN m_fLockDown;
  114. virtual HRESULT InitializeExtendedUI(void) = 0;
  115. virtual HRESULT UninitializeExtendedUI(void) = 0;
  116. };
  117. class CLanNetNormalPage : public CLanNetPage
  118. {
  119. public:
  120. BEGIN_MSG_MAP(CLanNetPage)
  121. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  122. MESSAGE_HANDLER(WM_PAINT, OnPaint)
  123. MESSAGE_HANDLER(WM_DEFERREDINIT, OnDeferredInit)
  124. MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
  125. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  126. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  127. MESSAGE_HANDLER(WM_HELP, OnHelp);
  128. COMMAND_ID_HANDLER(IDC_PSB_Configure, OnConfigure)
  129. COMMAND_ID_HANDLER(IDC_CHK_ShowIcon, OnChange);
  130. NOTIFY_CODE_HANDLER(PSN_QUERYCANCEL, OnCancel)
  131. NOTIFY_CODE_HANDLER(PSN_APPLY, OnApply)
  132. COMMAND_ID_HANDLER(IDC_PSB_Add, OnAdd)
  133. COMMAND_ID_HANDLER(IDC_PSB_Remove, OnRemove)
  134. COMMAND_ID_HANDLER(IDC_PSB_Properties, OnProperties)
  135. NOTIFY_CODE_HANDLER(PSN_KILLACTIVE, OnKillActive)
  136. // Listview handlers
  137. NOTIFY_CODE_HANDLER(LVN_DELETEITEM, OnDeleteItem)
  138. NOTIFY_CODE_HANDLER(NM_CLICK, OnClick)
  139. NOTIFY_CODE_HANDLER(NM_DBLCLK, OnDbClick)
  140. NOTIFY_CODE_HANDLER(LVN_KEYDOWN, OnKeyDown)
  141. NOTIFY_CODE_HANDLER(LVN_ITEMCHANGED, OnItemChanged)
  142. END_MSG_MAP()
  143. CLanNetNormalPage(
  144. IUnknown* punk,
  145. INetCfg* pnc,
  146. INetConnection* pconn,
  147. BOOLEAN fReadOnly,
  148. BOOLEAN fNeedReboot,
  149. BOOLEAN fAccessDenied,
  150. const DWORD * adwHelpIDs = NULL);
  151. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam,
  152. LPARAM lParam, BOOL& bHandled);
  153. LRESULT OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  154. LRESULT OnRemove(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  155. BOOL& bHandled);
  156. LRESULT OnProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  157. BOOL& bHandled);
  158. LRESULT OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  159. // listview handlers
  160. LRESULT OnDeleteItem(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  161. LRESULT OnClick(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  162. LRESULT OnDbClick(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  163. LRESULT OnKeyDown(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  164. LRESULT OnItemChanged(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  165. private:
  166. HWND m_hwndLV;
  167. virtual HRESULT InitializeExtendedUI(void);
  168. virtual HRESULT UninitializeExtendedUI(void);
  169. };
  170. class CLanNetBridgedPage : public CLanNetPage
  171. {
  172. public:
  173. BEGIN_MSG_MAP(CLanNetPage)
  174. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  175. MESSAGE_HANDLER(WM_PAINT, OnPaint)
  176. MESSAGE_HANDLER(WM_DEFERREDINIT, OnDeferredInit)
  177. MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
  178. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  179. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  180. MESSAGE_HANDLER(WM_HELP, OnHelp);
  181. COMMAND_ID_HANDLER(IDC_CHK_ShowIcon, OnChange);
  182. COMMAND_ID_HANDLER(IDC_PSB_Configure, OnConfigure)
  183. NOTIFY_CODE_HANDLER(PSN_QUERYCANCEL, OnCancel)
  184. NOTIFY_CODE_HANDLER(PSN_APPLY, OnApply)
  185. END_MSG_MAP()
  186. CLanNetBridgedPage(
  187. IUnknown* punk,
  188. INetCfg* pnc,
  189. INetConnection* pconn,
  190. BOOLEAN fReadOnly,
  191. BOOLEAN fNeedReboot,
  192. BOOLEAN fAccessDenied,
  193. const DWORD * adwHelpIDs = NULL);
  194. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam,
  195. LPARAM lParam, BOOL& bHandled);
  196. private:
  197. virtual HRESULT InitializeExtendedUI(void){return S_OK;};
  198. virtual HRESULT UninitializeExtendedUI(void){return S_OK;};
  199. };
  200. class CLanNetNetworkBridgePage : public CLanNetPage
  201. {
  202. public:
  203. BEGIN_MSG_MAP(CLanNetPage)
  204. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  205. MESSAGE_HANDLER(WM_PAINT, OnPaint)
  206. MESSAGE_HANDLER(WM_DEFERREDINIT, OnDeferredInit)
  207. MESSAGE_HANDLER(WM_SETCURSOR, OnSetCursor)
  208. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  209. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  210. MESSAGE_HANDLER(WM_HELP, OnHelp);
  211. COMMAND_ID_HANDLER(IDC_PSB_Configure, OnConfigure)
  212. NOTIFY_CODE_HANDLER(PSN_QUERYCANCEL, OnCancel)
  213. NOTIFY_CODE_HANDLER(PSN_APPLY, OnApply)
  214. COMMAND_ID_HANDLER(IDC_PSB_Add, OnAdd)
  215. COMMAND_ID_HANDLER(IDC_PSB_Remove, OnRemove)
  216. COMMAND_ID_HANDLER(IDC_PSB_Properties, OnProperties)
  217. NOTIFY_CODE_HANDLER(PSN_KILLACTIVE, OnKillActive)
  218. // Listview handlers
  219. NOTIFY_CODE_HANDLER(LVN_DELETEITEM, OnDeleteItem)
  220. NOTIFY_CODE_HANDLER(NM_CLICK, OnClick)
  221. NOTIFY_CODE_HANDLER(NM_DBLCLK, OnDbClick)
  222. NOTIFY_CODE_HANDLER(LVN_KEYDOWN, OnKeyDown)
  223. NOTIFY_CODE_HANDLER(LVN_ITEMCHANGED, OnItemChanged)
  224. END_MSG_MAP()
  225. CLanNetNetworkBridgePage(
  226. IUnknown* punk,
  227. INetCfg* pnc,
  228. INetConnection* pconn,
  229. BOOLEAN fReadOnly,
  230. BOOLEAN fNeedReboot,
  231. BOOLEAN fAccessDenied,
  232. const DWORD * adwHelpIDs = NULL);
  233. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam,
  234. LPARAM lParam, BOOL& bHandled);
  235. LRESULT OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  236. LRESULT OnRemove(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  237. BOOL& bHandled);
  238. LRESULT OnProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  239. BOOL& bHandled);
  240. LRESULT OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  241. // listview handlers
  242. LRESULT OnDeleteItem(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  243. LRESULT OnClick(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  244. LRESULT OnDbClick(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  245. LRESULT OnKeyDown(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  246. LRESULT OnItemChanged(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  247. LRESULT OnApply(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  248. LRESULT OnConfigure(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  249. BOOL& bHandled);
  250. private:
  251. HWND m_hwndLV;
  252. HWND m_hAdaptersListView;
  253. HIMAGELIST m_hAdaptersListImageList;
  254. virtual HRESULT InitializeExtendedUI(void);
  255. virtual HRESULT UninitializeExtendedUI(void);
  256. HRESULT FillListViewWithConnections(HWND ListView);
  257. };
  258. //
  259. // LAN Connection 'Advanced' property page
  260. //
  261. NOTHROW
  262. int
  263. WINAPIV
  264. NcRasMsgBoxWithErrorText (
  265. IN DWORD dwError,
  266. IN HINSTANCE hinst,
  267. IN HWND hwnd,
  268. IN UINT unIdCaption,
  269. IN UINT unIdCombineFormat,
  270. IN UINT unIdFormat,
  271. IN UINT unStyle,
  272. ...);
  273. class CLanAdvancedPage: public CPropSheetPage
  274. {
  275. public:
  276. BEGIN_MSG_MAP(CLanAdvancedPage)
  277. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  278. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  279. MESSAGE_HANDLER(WM_HELP, OnHelp);
  280. COMMAND_ID_HANDLER(IDC_CHK_Shared, OnShared)
  281. COMMAND_ID_HANDLER(IDC_CHK_Firewall, OnFirewall)
  282. COMMAND_ID_HANDLER(IDC_PSB_Settings, OnSettings)
  283. NOTIFY_CODE_HANDLER(PSN_KILLACTIVE, OnKillActive)
  284. NOTIFY_CODE_HANDLER(PSN_QUERYCANCEL, OnCancel)
  285. NOTIFY_CODE_HANDLER(PSN_APPLY, OnApply)
  286. NOTIFY_CODE_HANDLER(NM_CLICK, OnClick)
  287. NOTIFY_CODE_HANDLER(NM_RETURN, OnClick)
  288. END_MSG_MAP()
  289. CLanAdvancedPage(IUnknown *punk, INetConnection *pconn,
  290. BOOL fShared, BOOL fICSPrivate, BOOL fFirewalled, IHNetConnection *rgPrivateCons[],
  291. ULONG cPrivate, LONG lxCurrentPrivate,
  292. const DWORD * adwHelpIDs, IHNetConnection *pHNConn,
  293. IHNetCfgMgr *pHNetCfgMgr, IHNetIcsSettings *pHNetIcsSettings);
  294. ~CLanAdvancedPage();
  295. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam,
  296. LPARAM lParam, BOOL& bHandled);
  297. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  298. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  299. LRESULT OnApply(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  300. LRESULT OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  301. LRESULT OnCancel(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  302. LRESULT OnShared(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  303. LRESULT OnFirewall(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  304. LRESULT OnSettings(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  305. LRESULT OnClick(int idCtrl, LPNMHDR pnmh, BOOL& fHandled);
  306. private:
  307. INetConnection * m_pconn;
  308. IUnknown * m_punk;
  309. BOOL m_fShared;
  310. BOOL m_fICSPrivate;
  311. BOOL m_fFirewalled;
  312. BOOL m_fOtherShared;
  313. IHNetIcsPublicConnection * m_pOldSharedConnection;
  314. BOOL m_fResetPrivateAdapter;
  315. IHNetConnection ** m_rgPrivateCons;
  316. LONG m_lxCurrentPrivate;
  317. ULONG m_cPrivate;
  318. const DWORD * m_adwHelpIDs;
  319. IHNetCfgMgr * m_pHNetCfgMgr;
  320. IHNetIcsSettings * m_pHNetIcsSettings;
  321. IHNetConnection * m_pHNetConn;
  322. BOOL m_fShowDisableFirewallWarning;
  323. static INT_PTR CALLBACK DisableFirewallWarningDlgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  324. BOOL IsAdapterDHCPEnabled(IHNetConnection* pConnection);
  325. };
  326. //
  327. // CLanAddComponentDlg
  328. //
  329. class CLanAddComponentDlg:
  330. public CDialogImpl<CLanAddComponentDlg>
  331. {
  332. BEGIN_MSG_MAP(CLanAddComponentDlg)
  333. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  334. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  335. MESSAGE_HANDLER(WM_HELP, OnHelp);
  336. COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
  337. COMMAND_ID_HANDLER(IDC_PSB_Component_Add, OnAdd)
  338. NOTIFY_CODE_HANDLER(NM_DBLCLK, OnDblClick)
  339. NOTIFY_CODE_HANDLER(LVN_ITEMCHANGED, OnItemChanged)
  340. END_MSG_MAP()
  341. enum {IDD = IDD_LAN_COMPONENT_ADD};
  342. CLanAddComponentDlg(INetCfg *pnc, CI_FILTER_INFO* pcfi,
  343. const DWORD * adwHelpIDs = NULL)
  344. {
  345. m_pnc = pnc;
  346. m_pcfi = pcfi;
  347. m_adwHelpIDs = adwHelpIDs;
  348. }
  349. private:
  350. INetCfg * m_pnc;
  351. CI_FILTER_INFO* m_pcfi;
  352. HWND m_hwndLV;
  353. const DWORD * m_adwHelpIDs;
  354. LRESULT OnInitDialog (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  355. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam,LPARAM lParam, BOOL& bHandled);
  356. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  357. LRESULT OnItemChanged(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  358. LRESULT OnDblClick(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  359. LRESULT OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  360. LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  361. };
  362. //
  363. // LAN Connection Security Property Page
  364. //
  365. class CLanSecurityPage: public CPropSheetPage
  366. {
  367. public:
  368. BEGIN_MSG_MAP(CLanSecurityPage)
  369. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  370. MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
  371. MESSAGE_HANDLER(WM_CONTEXTMENU, OnContextMenu);
  372. MESSAGE_HANDLER(WM_HELP, OnHelp);
  373. COMMAND_ID_HANDLER(CID_CA_PB_Properties, OnProperties)
  374. COMMAND_ID_HANDLER(CID_CA_LB_EapPackages, OnEapPackages)
  375. COMMAND_ID_HANDLER(CID_CA_RB_Eap, OnEapSelection)
  376. NOTIFY_CODE_HANDLER(PSN_QUERYCANCEL, OnCancel)
  377. NOTIFY_CODE_HANDLER(PSN_APPLY, OnApply)
  378. NOTIFY_CODE_HANDLER(PSN_KILLACTIVE, OnKillActive)
  379. END_MSG_MAP()
  380. CLanSecurityPage(
  381. IUnknown* punk,
  382. INetCfg* pnc,
  383. INetConnection* pconn,
  384. const DWORD * adwHelpIDs = NULL);
  385. ~CLanSecurityPage();
  386. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam,
  387. LPARAM lParam, BOOL& bHandled);
  388. LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam,
  389. BOOL& bHandled);
  390. LRESULT OnHelp(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  391. LRESULT OnDestroy(UINT uMsg, WPARAM wParam,
  392. LPARAM lParam, BOOL& bHandled);
  393. LRESULT OnProperties(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  394. BOOL& bHandled);
  395. LRESULT OnEapPackages(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  396. BOOL& bHandled);
  397. LRESULT OnEapSelection(WORD wNotifyCode, WORD wID, HWND hWndCtl,
  398. BOOL& bHandled);
  399. LRESULT OnKillActive(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  400. LRESULT OnApply(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  401. LRESULT OnCancel(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  402. private:
  403. INetConnection * m_pconn;
  404. INetCfg * m_pnc;
  405. IUnknown * m_punk;
  406. const DWORD * m_adwHelpIDs;
  407. // Config information of the EAP Dlls
  408. DTLLIST * pListEapcfgs;
  409. BOOLEAN m_fNetcfgInUse;
  410. };
  411. //
  412. // Global functions
  413. //
  414. HRESULT HrGetDeviceIcon(HICON *phicon);
  415. HRESULT HrQueryLanAdvancedPage(INetConnection* pconn, IUnknown* punk,
  416. CPropSheetPage*& pspAdvanced, IHNetCfgMgr *pHNetCfgMgr,
  417. IHNetIcsSettings *pHNetIcsSettings, IHNetConnection *pHNetConn);
  418. HRESULT HrQueryLanFirewallPage(INetConnection* pconn, IUnknown* punk,
  419. CPropSheetPage*& pspFirewall, IHNetCfgMgr *pHNetCfgMgr,
  420. IHNetConnection *pHNetConn);
  421. HRESULT HrQueryUserAndRemoveComponent (HWND hwndParent, INetCfg* pnc,
  422. INetCfgComponent* pncc);
  423. HRESULT HrDisplayAddComponentDialog (HWND hwndParent, INetCfg* pnc,
  424. CI_FILTER_INFO* pcfi);
  425. //
  426. // Exported Interfaces
  427. //
  428. class ATL_NO_VTABLE CNetConnectionUiUtilities :
  429. public CComObjectRootEx <CComObjectThreadModel>,
  430. public CComCoClass <CNetConnectionUiUtilities, &CLSID_NetConnectionUiUtilities>,
  431. public INetConnectionUiUtilities
  432. {
  433. public:
  434. DECLARE_REGISTRY_RESOURCEID(IDR_COMMUIUTILITIES)
  435. BEGIN_COM_MAP(CNetConnectionUiUtilities)
  436. COM_INTERFACE_ENTRY(INetConnectionUiUtilities)
  437. END_COM_MAP()
  438. CNetConnectionUiUtilities() {};
  439. ~CNetConnectionUiUtilities() {};
  440. STDMETHODIMP QueryUserAndRemoveComponent(
  441. HWND hwndParent,
  442. INetCfg* pnc,
  443. INetCfgComponent* pncc);
  444. STDMETHODIMP QueryUserForReboot(
  445. HWND hwndParent,
  446. PCWSTR pszCaption,
  447. DWORD dwFlags);
  448. STDMETHODIMP DisplayAddComponentDialog (
  449. HWND hwndParent,
  450. INetCfg* pnc,
  451. CI_FILTER_INFO* pcfi);
  452. STDMETHODIMP_(BOOL) UserHasPermission(DWORD dwPerm);
  453. };