Source code of Windows XP (NT5)
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.

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