ReactOS  0.4.13-dev-100-gc8611ae
lanconnectui.cpp
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Shell
3  * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4  * PURPOSE: CNetConnectionPropertyUi: Network connection configuration dialog
5  * COPYRIGHT: Copyright 2008 Johannes Anderwald (johannes.anderwald@reactos.org)
6  */
7 
8 #include "precomp.h"
9 
11  m_pProperties(NULL)
12 {
13 }
14 
16 {
17  if (m_pNCfg)
18  m_pNCfg->Uninitialize();
19 
20  if (m_pProperties)
22 }
23 
24 VOID
25 AddItemToListView(HWND hDlgCtrl, PNET_ITEM pItem, LPWSTR szName, BOOL bChecked)
26 {
27  LVITEMW lvItem;
28 
29  ZeroMemory(&lvItem, sizeof(lvItem));
30  lvItem.mask = LVIF_TEXT | LVIF_PARAM;
31  lvItem.pszText = szName;
32  lvItem.lParam = (LPARAM)pItem;
33  lvItem.iItem = ListView_GetItemCount(hDlgCtrl);
34  lvItem.iItem = SendMessageW(hDlgCtrl, LVM_INSERTITEMW, 0, (LPARAM)&lvItem);
35  ListView_SetCheckState(hDlgCtrl, lvItem.iItem, bChecked);
36 }
37 
38 BOOL
39 CNetConnectionPropertyUi::GetINetCfgComponent(INetCfg *pNCfg, INetCfgComponent ** pOut)
40 {
41  LPWSTR pName;
42  HRESULT hr;
43  ULONG Fetched;
45 
46  hr = pNCfg->EnumComponents(&GUID_DEVCLASS_NET, &pEnumCfg);
48  return FALSE;
49 
50  while (TRUE)
51  {
53  hr = pEnumCfg->Next(1, &pNCg, &Fetched);
54  if (hr != S_OK)
55  break;
56 
57  hr = pNCg->GetDisplayName(&pName);
58  if (SUCCEEDED(hr))
59  {
61  {
62  *pOut = pNCg.Detach();
63  return TRUE;
64  }
66  }
67  }
68  return FALSE;
69 }
70 
71 VOID
72 CNetConnectionPropertyUi::EnumComponents(HWND hDlgCtrl, INetCfg *pNCfg, const GUID *CompGuid, UINT Type)
73 {
74  HRESULT hr;
76  ULONG Num;
77  DWORD dwCharacteristics;
78  LPOLESTR pDisplayName, pHelpText;
79  PNET_ITEM pItem;
80  BOOL bChecked;
81 
82  hr = pNCfg->EnumComponents(CompGuid, &pENetCfg);
84  return;
85 
86  while (TRUE)
87  {
88  CComPtr<INetCfgComponent> pNCfgComp;
90  CComPtr<INetCfgComponent> pAdapterCfgComp;
91 
92  hr = pENetCfg->Next(1, &pNCfgComp, &Num);
93  if (hr != S_OK)
94  break;
95 
96  hr = pNCfgComp->GetCharacteristics(&dwCharacteristics);
97  if (SUCCEEDED(hr) && (dwCharacteristics & NCF_HIDDEN))
98  continue;
99 
100  pDisplayName = NULL;
101  pHelpText = NULL;
102  hr = pNCfgComp->GetDisplayName(&pDisplayName);
103  hr = pNCfgComp->GetHelpText(&pHelpText);
104  bChecked = TRUE; //ReactOS hack
105  hr = pNCfgComp->QueryInterface(IID_PPV_ARG(INetCfgComponentBindings, &pCompBind));
106  if (SUCCEEDED(hr))
107  {
108  if (GetINetCfgComponent(pNCfg, &pAdapterCfgComp))
109  {
110  hr = pCompBind->IsBoundTo(pAdapterCfgComp);
111  if (hr == S_OK)
112  bChecked = TRUE;
113  else
114  bChecked = FALSE;
115  }
116  }
117 
118  pItem = static_cast<NET_ITEM*>(CoTaskMemAlloc(sizeof(NET_ITEM)));
119  if (!pItem)
120  continue;
121 
122  pItem->dwCharacteristics = dwCharacteristics;
123  pItem->szHelp = pHelpText;
124  pItem->Type = (NET_TYPE)Type;
125  pItem->pNCfgComp = pNCfgComp.Detach();
126  pItem->NumPropDialogOpen = 0;
127 
128  AddItemToListView(hDlgCtrl, pItem, pDisplayName, bChecked);
129  CoTaskMemFree(pDisplayName);
130  }
131 }
132 
133 VOID
135 {
136  HRESULT hr;
137  CComPtr<INetCfg> pNCfg;
138  CComPtr<INetCfgLock> pNCfgLock;
139  HWND hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST);
140  LVCOLUMNW lc;
141  RECT rc;
142  DWORD dwStyle;
143  LPWSTR pDisplayName;
144  LVITEMW li;
145 
148  {
149  /* check show item on taskbar*/
151  }
153  {
154  /* check notify item */
156  }
157 
158  memset(&lc, 0, sizeof(LV_COLUMN));
160  lc.fmt = LVCFMT_FIXED_WIDTH;
161  if (GetClientRect(hDlgCtrl, &rc))
162  {
163  lc.mask |= LVCF_WIDTH;
164  lc.cx = rc.right - rc.left;
165  }
166  lc.pszText = (LPWSTR)L"";
167  (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&lc);
168  dwStyle = (DWORD) SendMessage(hDlgCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
169  dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES;
170  SendMessage(hDlgCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
171 
172  hr = CoCreateInstance(CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(INetCfg, &pNCfg));
173  if (FAILED(hr))
174  return;
175 
176  hr = pNCfg->QueryInterface(IID_PPV_ARG(INetCfgLock, &pNCfgLock));
177  hr = pNCfgLock->AcquireWriteLock(100, L"", &pDisplayName);
178  if (hr == S_FALSE)
179  {
180  CoTaskMemFree(pDisplayName);
181  return;
182  }
183 
184  hr = pNCfg->Initialize(NULL);
185  if (FAILED_UNEXPECTEDLY(hr))
186  return;
187 
188  m_pNCfg = pNCfg;
189  m_NCfgLock = pNCfgLock;
190 
191  EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETCLIENT, NET_TYPE_CLIENT);
192  EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETSERVICE, NET_TYPE_SERVICE);
193  EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETTRANS, NET_TYPE_PROTOCOL);
194 
195  ZeroMemory(&li, sizeof(li));
196  li.mask = LVIF_STATE;
197  li.stateMask = (UINT)-1;
199  (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
200 }
201 
202 VOID
204 {
205  LVITEMW lvItem;
206  HWND hDlgCtrl;
207  UINT Index, Count;
208  HRESULT hr;
209  INetCfgComponent *pNCfgComp;
210  PNET_ITEM pItem;
211 
212  hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST);
213  Count = ListView_GetItemCount(hDlgCtrl);
214  if (!Count)
215  return;
216 
217  ZeroMemory(&lvItem, sizeof(LVITEMW));
218  lvItem.mask = LVIF_PARAM | LVIF_STATE;
219  lvItem.stateMask = (UINT)-1;
220  for (Index = 0; Index < Count; Index++)
221  {
222  lvItem.iItem = Index;
223  if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&lvItem))
224  {
225  if (lvItem.state & LVIS_SELECTED)
226  break;
227  }
228  }
229 
230  if (!(lvItem.state & LVIS_SELECTED))
231  {
232  return;
233  }
234 
235  pItem = (PNET_ITEM)lvItem.lParam;
236  pNCfgComp = (INetCfgComponent*)pItem->pNCfgComp;
237  hr = pNCfgComp->RaisePropertyUi(GetParent(hwndDlg), NCRP_QUERY_PROPERTY_UI, (INetConnectionConnectUi*)this);
238  if (SUCCEEDED(hr))
239  {
240  hr = pNCfgComp->RaisePropertyUi(GetParent(hwndDlg), NCRP_SHOW_PROPERTY_UI, (INetConnectionConnectUi*)this);
241  }
242 }
243 
244 INT_PTR
245 CALLBACK
247  HWND hwndDlg,
248  UINT uMsg,
249  WPARAM wParam,
250  LPARAM lParam)
251 {
253  LPNMLISTVIEW lppl;
254  LVITEMW li;
255  PNET_ITEM pItem;
257  LPPSHNOTIFY lppsn;
258  DWORD dwShowIcon, dwNotifyDisconnect;
259  HRESULT hr;
260  WCHAR szKey[200];
261  LPOLESTR pStr;
262  HKEY hKey;
263 
264  switch (uMsg)
265  {
266  case WM_INITDIALOG:
268  This = (CNetConnectionPropertyUi*)page->lParam;
269  This->InitializeLANPropertiesUIDlg(hwndDlg);
271  return TRUE;
272  case WM_NOTIFY:
273  lppl = (LPNMLISTVIEW) lParam;
274  lppsn = (LPPSHNOTIFY) lParam;
275  if (lppsn->hdr.code == PSN_APPLY)
276  {
278  if (This->m_pNCfg)
279  {
280  hr = This->m_pNCfg->Apply();
281  if (FAILED(hr))
282  return PSNRET_INVALID;
283  }
284 
286  dwShowIcon = 1;
287  else
288  dwShowIcon = 0;
289 
291  dwNotifyDisconnect = 1;
292  else
293  dwNotifyDisconnect = 0;
294 
295  //NOTE: Windows write these setting with the undocumented INetLanConnection::SetInfo
296  if (StringFromCLSID((CLSID)This->m_pProperties->guidId, &pStr) == ERROR_SUCCESS)
297  {
298  swprintf(szKey, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr);
299  CoTaskMemFree(pStr);
300  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szKey, 0, KEY_WRITE, &hKey) == ERROR_SUCCESS)
301  {
302  RegSetValueExW(hKey, L"ShowIcon", 0, REG_DWORD, (LPBYTE)&dwShowIcon, sizeof(DWORD));
303  RegSetValueExW(hKey, L"IpCheckingEnabled", 0, REG_DWORD, (LPBYTE)&dwNotifyDisconnect, sizeof(DWORD));
304  RegCloseKey(hKey);
305  }
306  }
307 
308  return PSNRET_NOERROR;
309  }
310 #if 0
311  else if (lppsn->hdr.code == PSN_CANCEL)
312  {
314  if (This->m_pNCfg)
315  {
316  hr = This->m_pNCfg->Cancel();
317  if (SUCCEEDED(hr))
318  return PSNRET_NOERROR;
319  else
320  return PSNRET_INVALID;
321  }
322  return PSNRET_NOERROR;
323  }
324 #endif
325  if (lppl->hdr.code == LVN_ITEMCHANGING)
326  {
327  ZeroMemory(&li, sizeof(li));
328  li.mask = LVIF_PARAM;
329  li.iItem = lppl->iItem;
330  if (!SendMessageW(lppl->hdr.hwndFrom, LVM_GETITEMW, 0, (LPARAM)&li))
331  return TRUE;
332 
333  pItem = (PNET_ITEM)li.lParam;
334  if (!pItem)
335  return TRUE;
336 
337  if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED))
338  {
339  /* new focused item */
342  else
344 
345  if (pItem->dwCharacteristics & NCF_HAS_UI)
347  else
349 
351  }
352  }
353  break;
354  case WM_COMMAND:
355  if (LOWORD(wParam) == IDC_PROPERTIES)
356  {
358  This->ShowNetworkComponentProperties(hwndDlg);
359  return FALSE;
360  }
361  else if (LOWORD(wParam) == IDC_CONFIGURE)
362  {
363  LPOLESTR DeviceInstanceID;
365 
366  if (This->GetDeviceInstanceID(&DeviceInstanceID))
367  {
368  WCHAR wszCmd[2*MAX_PATH];
369  StringCbPrintfW(wszCmd, sizeof(wszCmd), L"rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID %s", DeviceInstanceID);
370  CoTaskMemFree(DeviceInstanceID);
371 
372  STARTUPINFOW si;
374  ZeroMemory(&si, sizeof(si));
375  si.cb = sizeof(si);
376  if (!CreateProcessW(NULL, wszCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
377  break;
378 
379  CloseHandle(pi.hProcess);
380  CloseHandle(pi.hThread);
381  }
382  }
383  break;
384  }
385  return FALSE;
386 }
387 
388 BOOL
390  OUT LPOLESTR *DeviceInstanceID)
391 {
392  LPOLESTR pStr, pResult;
393  HKEY hKey;
394  DWORD dwInstanceID;
395  WCHAR szKeyName[2*MAX_PATH];
396  WCHAR szInstanceID[2*MAX_PATH];
397 
399  {
400  // failed to convert guid to string
401  return FALSE;
402  }
403 
404  StringCbPrintfW(szKeyName, sizeof(szKeyName), L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr);
405  CoTaskMemFree(pStr);
406 
407  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
408  {
409  // failed to open key
410  return FALSE;
411  }
412 
413  dwInstanceID = sizeof(szInstanceID);
414  if (RegGetValueW(hKey, NULL, L"PnpInstanceId", RRF_RT_REG_SZ, NULL, (PVOID)szInstanceID, &dwInstanceID) == ERROR_SUCCESS)
415  {
416  szInstanceID[MAX_PATH-1] = L'\0';
417  pResult = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(szInstanceID) + 1) * sizeof(WCHAR)));
418  if (pResult != 0)
419  {
420  wcscpy(pResult, szInstanceID);
421  *DeviceInstanceID = pResult;
422  RegCloseKey(hKey);
423  return TRUE;
424  }
425  }
426  RegCloseKey(hKey);
427  return FALSE;
428 }
429 
430 HRESULT
431 WINAPI
434  LPFNADDPROPSHEETPAGE pfnAddPage,
435  LPARAM lParam)
436 {
437  HPROPSHEETPAGE hProp;
438  BOOL ret;
439  HRESULT hr = E_FAIL;
440  INITCOMMONCONTROLSEX initEx;
441 
442  initEx.dwSize = sizeof(initEx);
443  initEx.dwICC = ICC_LISTVIEW_CLASSES;
444  if (!InitCommonControlsEx(&initEx))
445  return E_FAIL;
446 
447  hr = m_pCon->GetProperties(&m_pProperties);
448  if (FAILED_UNEXPECTEDLY(hr))
449  return hr;
450 
451  hProp = InitializePropertySheetPage(MAKEINTRESOURCEW(IDD_NETPROPERTIES), LANPropertiesUIDlg, reinterpret_cast<LPARAM>(this), NULL);
452  if (hProp)
453  {
454  ret = (*pfnAddPage)(hProp, lParam);
455  if (ret)
456  {
457  hr = NOERROR;
458  }
459  else
460  {
462  }
463  }
464  return hr;
465 }
466 
467 HRESULT
468 WINAPI
470  DWORD dwSize,
471  HICON *phIcon)
472 {
473  return E_NOTIMPL;
474 }
475 
476 HRESULT
477 WINAPI
479 {
480  CopyMemory(pGuid, &m_pProperties->guidId, sizeof(GUID));
481  return S_OK;
482 }
483 
484 HRESULT
485 WINAPI
487 {
488  if (!pCon)
489  return E_POINTER;
490 
491  m_pCon = pCon;
492  return S_OK;
493 }
494 
495 HRESULT
496 WINAPI
499  DWORD dwFlags)
500 {
501  if (!m_pCon)
502  return E_POINTER; //FIXME
503 
504  if (dwFlags & NCUC_NO_UI)
505  return m_pCon->Connect();
506 
507  return E_FAIL;
508 }
509 
510 HRESULT
511 WINAPI
514  DWORD dwFlags)
515 {
516  WCHAR szBuffer[100];
517  swprintf(szBuffer, L"INetConnectionConnectUi_fnDisconnect flags %x\n", dwFlags);
518  MessageBoxW(NULL, szBuffer, NULL, MB_OK);
519 
520  return S_OK;
521 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1975
VOID AddItemToListView(HWND hDlgCtrl, PNET_ITEM pItem, LPWSTR szName, BOOL bChecked)
static HICON
Definition: imagelist.c:84
#define TRUE
Definition: types.h:120
#define CloseHandle
Definition: compat.h:398
LPWSTR pszwDeviceName
Definition: netcon.h:85
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define LVCF_WIDTH
Definition: commctrl.h:2559
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
UINT uNewState
Definition: commctrl.h:3008
HRESULT hr
Definition: shlfolder.c:183
#define LVCF_TEXT
Definition: commctrl.h:2560
#define NOERROR
Definition: winerror.h:2354
CComPtr< INetConnection > m_pCon
Definition: lanconnectui.h:53
struct _PSHNOTIFY * LPPSHNOTIFY
BOOL GetINetCfgComponent(INetCfg *pNCfg, INetCfgComponent **pOut)
#define KEY_READ
Definition: nt_native.h:1023
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
Definition: propsheet.c:3135
#define LV_COLUMN
Definition: commctrl.h:2519
#define CALLBACK
Definition: compat.h:27
static INT_PTR CALLBACK LANPropertiesUIDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define LVS_EX_FULLROWSELECT
Definition: commctrl.h:2706
#define RRF_RT_REG_SZ
Definition: driver.c:575
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
#define ZeroMemory
Definition: winbase.h:1635
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
Definition: prsht.h:309
UINT_PTR WPARAM
Definition: windef.h:207
BOOL GetDeviceInstanceID(OUT LPOLESTR *DeviceInstanceID)
#define PSN_APPLY
Definition: prsht.h:117
LONG left
Definition: windef.h:291
int32_t INT_PTR
Definition: typedefs.h:62
virtual HRESULT WINAPI GetDeviceGuid(GUID *pGuid)
static LPOLESTR
Definition: stg_prop.c:27
LONG right
Definition: windef.h:293
#define IID_PPV_ARG(Itype, ppType)
#define E_FAIL
Definition: ddrawi.h:102
#define DWORD
Definition: nt_native.h:44
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
Definition: netshell.cpp:119
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
UINT stateMask
Definition: commctrl.h:2336
#define IDC_NOTIFYNOCONNECTION
Definition: resource.h:35
#define LVN_ITEMCHANGING
Definition: commctrl.h:3102
#define LVIF_TEXT
Definition: commctrl.h:2281
#define LVCF_SUBITEM
Definition: commctrl.h:2561
UINT code
Definition: winuser.h:3112
NMHDR hdr
Definition: prsht.h:312
#define IDC_UNINSTALL
Definition: resource.h:31
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
unsigned int BOOL
Definition: ntddk_ex.h:94
#define LVM_INSERTCOLUMNW
Definition: commctrl.h:2604
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
LPARAM lParam
Definition: commctrl.h:2340
#define S_FALSE
Definition: winerror.h:2357
#define NCF_NOT_USER_REMOVABLE
Definition: precomp.h:46
#define NCCF_NOTIFY_DISCONNECTED
Definition: precomp.h:76
#define NCF_HIDDEN
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
#define LVIS_SELECTED
Definition: commctrl.h:2291
static HWND hwndParent
Definition: cryptui.c:300
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
EXTERN_C const GUID CLSID_CNetCfg
Definition: netcfgx.h:299
UINT uOldState
Definition: commctrl.h:3009
LONG_PTR LPARAM
Definition: windef.h:208
#define ListView_GetItemCount(hwnd)
Definition: commctrl.h:2279
Definition: module.h:566
#define BM_GETCHECK
Definition: winuser.h:1879
HPROPSHEETPAGE InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
Definition: netshell.cpp:29
#define IDC_COMPONENTSLIST
Definition: resource.h:29
#define WM_SETTEXT
Definition: winuser.h:1599
#define IDC_NETCARDNAME
Definition: resource.h:27
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4623
VOID InitializeLANPropertiesUIDlg(HWND hwndDlg)
#define KEY_WRITE
Definition: nt_native.h:1031
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4917
virtual HRESULT WINAPI Disconnect(HWND hwndParent, DWORD dwFlags)
UINT NumPropDialogOpen
Definition: lanconnectui.h:19
#define BM_SETCHECK
Definition: winuser.h:1882
static LPSTR pName
Definition: security.c:75
VOID EnumComponents(HWND hDlgCtrl, INetCfg *pNCfg, const GUID *CompGuid, UINT Type)
DWORD cb
Definition: winbase.h:817
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
if(!(yy_init))
Definition: macro.lex.yy.c:714
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
virtual HRESULT WINAPI GetIcon(DWORD dwSize, HICON *phIcon)
LPWSTR pszText
Definition: commctrl.h:2337
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:35
#define MAX_PATH
Definition: compat.h:26
#define swprintf(buf, format,...)
Definition: sprintf.c:56
#define WINAPI
Definition: msvc.h:8
#define IDC_DESCRIPTION
Definition: resource.h:131
#define CopyMemory
Definition: winbase.h:1633
static const UCHAR Index[8]
Definition: usbohci.c:18
LPWSTR pszText
Definition: commctrl.h:2539
#define IDC_PROPERTIES
Definition: resource.h:32
unsigned long DWORD
Definition: ntddk_ex.h:95
#define LVM_SETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2696
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
UINT mask
Definition: commctrl.h:2332
#define PSNRET_NOERROR
Definition: prsht.h:129
static DWORD pi
Definition: protocol.c:150
int ret
DWORD dwCharacteristics
Definition: lanconnectui.h:16
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define LVS_EX_CHECKBOXES
Definition: commctrl.h:2703
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define DWLP_USER
Definition: winuser.h:866
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
#define NCF_HAS_UI
Definition: precomp.h:48
#define WM_COMMAND
Definition: winuser.h:1716
HWND hwndFrom
Definition: winuser.h:3110
UINT state
Definition: commctrl.h:2335
#define LVM_GETEXTENDEDLISTVIEWSTYLE
Definition: commctrl.h:2699
LPWSTR szHelp
Definition: lanconnectui.h:17
CComPtr< INetCfg > m_pNCfg
Definition: lanconnectui.h:55
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define IDC_SHOWTASKBAR
Definition: resource.h:34
HWND WINAPI GetParent(_In_ HWND)
#define LVM_INSERTITEMW
Definition: commctrl.h:2376
#define LVCF_FMT
Definition: commctrl.h:2558
#define S_OK
Definition: intsafe.h:59
#define ICC_LISTVIEW_CLASSES
Definition: commctrl.h:58
#define PSNRET_INVALID
Definition: prsht.h:130
struct tagNMLISTVIEW * LPNMLISTVIEW
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define E_NOTIMPL
Definition: ddrawi.h:99
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
NET_TYPE
Definition: lanconnectui.h:6
unsigned int UINT
Definition: ndis.h:50
#define MB_OK
Definition: winuser.h:784
#define BST_CHECKED
Definition: winuser.h:197
VOID ShowNetworkComponentProperties(HWND hwndDlg)
#define ListView_SetCheckState(hwndLV, i, fCheck)
Definition: commctrl.h:2646
#define LVM_SETITEMW
Definition: commctrl.h:2369
static const WCHAR szName[]
Definition: msipriv.h:1194
#define SendMessage
Definition: winuser.h:5709
#define LVM_GETITEMW
Definition: commctrl.h:2362
#define OUT
Definition: typedefs.h:39
CComPtr< INetCfgLock > m_NCfgLock
Definition: lanconnectui.h:54
#define LVIF_PARAM
Definition: commctrl.h:2283
struct NET_ITEM * PNET_ITEM
INetCfgComponent * pNCfgComp
Definition: lanconnectui.h:18
unsigned int ULONG
Definition: retypes.h:1
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GetWindowLongPtr
Definition: treelist.c:73
T * Detach()
Definition: atlcomcli.h:156
virtual HRESULT WINAPI AddPages(HWND hwndParent, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam)
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LVIF_STATE
Definition: commctrl.h:2284
#define E_POINTER
Definition: winerror.h:2365
#define memset(x, y, z)
Definition: compat.h:39
#define REG_DWORD
Definition: sdbapi.c:596
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406
#define LOWORD(l)
Definition: pedump.c:82
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
NET_TYPE Type
Definition: lanconnectui.h:15
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define LVIS_FOCUSED
Definition: commctrl.h:2290
#define IDD_NETPROPERTIES
Definition: resource.h:20
#define PROPSHEETPAGE
Definition: prsht.h:371
#define WM_NOTIFY
Definition: richedit.h:61
#define IDC_CONFIGURE
Definition: resource.h:28
#define SUCCEEDED(hr)
Definition: intsafe.h:57
virtual HRESULT WINAPI Connect(HWND hwndParent, DWORD dwFlags)
virtual HRESULT WINAPI SetConnection(INetConnection *pCon)
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
Definition: compobj.c:2321
NETCON_PROPERTIES * m_pProperties
Definition: lanconnectui.h:56