ReactOS  0.4.14-dev-49-gfb4591c
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 = FALSE;
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  }
114  }
115 
116  pItem = static_cast<NET_ITEM*>(CoTaskMemAlloc(sizeof(NET_ITEM)));
117  if (!pItem)
118  continue;
119 
120  pItem->dwCharacteristics = dwCharacteristics;
121  pItem->szHelp = pHelpText;
122  pItem->Type = (NET_TYPE)Type;
123  pItem->pNCfgComp = pNCfgComp.Detach();
124  pItem->NumPropDialogOpen = 0;
125 
126  AddItemToListView(hDlgCtrl, pItem, pDisplayName, bChecked);
127  CoTaskMemFree(pDisplayName);
128  }
129 }
130 
131 VOID
133 {
134  HRESULT hr;
135  CComPtr<INetCfg> pNCfg;
136  CComPtr<INetCfgLock> pNCfgLock;
137  HWND hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST);
138  LVCOLUMNW lc;
139  RECT rc;
140  DWORD dwStyle;
141  LPWSTR pDisplayName;
142  LVITEMW li;
143 
146  {
147  /* check show item on taskbar*/
149  }
151  {
152  /* check notify item */
154  }
155 
156  memset(&lc, 0, sizeof(LV_COLUMN));
158  lc.fmt = LVCFMT_FIXED_WIDTH;
159  if (GetClientRect(hDlgCtrl, &rc))
160  {
161  lc.mask |= LVCF_WIDTH;
162  lc.cx = rc.right - rc.left;
163  }
164  lc.pszText = (LPWSTR)L"";
165  (void)SendMessageW(hDlgCtrl, LVM_INSERTCOLUMNW, 0, (LPARAM)&lc);
166  dwStyle = (DWORD) SendMessage(hDlgCtrl, LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
167  dwStyle = dwStyle | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES;
168  SendMessage(hDlgCtrl, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
169 
170  hr = CoCreateInstance(CLSID_CNetCfg, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(INetCfg, &pNCfg));
171  if (FAILED(hr))
172  return;
173 
174  hr = pNCfg->QueryInterface(IID_PPV_ARG(INetCfgLock, &pNCfgLock));
175  hr = pNCfgLock->AcquireWriteLock(100, L"", &pDisplayName);
176  if (hr == S_FALSE)
177  {
178  CoTaskMemFree(pDisplayName);
179  return;
180  }
181 
182  hr = pNCfg->Initialize(NULL);
183  if (FAILED_UNEXPECTEDLY(hr))
184  return;
185 
186  m_pNCfg = pNCfg;
187  m_NCfgLock = pNCfgLock;
188 
189  EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETCLIENT, NET_TYPE_CLIENT);
190  EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETSERVICE, NET_TYPE_SERVICE);
191  EnumComponents(hDlgCtrl, pNCfg, &GUID_DEVCLASS_NETTRANS, NET_TYPE_PROTOCOL);
192 
193  ZeroMemory(&li, sizeof(li));
194  li.mask = LVIF_STATE;
195  li.stateMask = (UINT)-1;
197  (void)SendMessageW(hDlgCtrl, LVM_SETITEMW, 0, (LPARAM)&li);
198 }
199 
200 VOID
202 {
203  LVITEMW lvItem;
204  HWND hDlgCtrl;
205  UINT Index, Count;
206  HRESULT hr;
207  INetCfgComponent *pNCfgComp;
208  PNET_ITEM pItem;
209 
210  hDlgCtrl = GetDlgItem(hwndDlg, IDC_COMPONENTSLIST);
211  Count = ListView_GetItemCount(hDlgCtrl);
212  if (!Count)
213  return;
214 
215  ZeroMemory(&lvItem, sizeof(LVITEMW));
216  lvItem.mask = LVIF_PARAM | LVIF_STATE;
217  lvItem.stateMask = (UINT)-1;
218  for (Index = 0; Index < Count; Index++)
219  {
220  lvItem.iItem = Index;
221  if (SendMessageW(hDlgCtrl, LVM_GETITEMW, 0, (LPARAM)&lvItem))
222  {
223  if (lvItem.state & LVIS_SELECTED)
224  break;
225  }
226  }
227 
228  if (!(lvItem.state & LVIS_SELECTED))
229  {
230  return;
231  }
232 
233  pItem = (PNET_ITEM)lvItem.lParam;
234  pNCfgComp = (INetCfgComponent*)pItem->pNCfgComp;
235  hr = pNCfgComp->RaisePropertyUi(GetParent(hwndDlg), NCRP_QUERY_PROPERTY_UI, (INetConnectionConnectUi*)this);
236  if (SUCCEEDED(hr))
237  {
238  hr = pNCfgComp->RaisePropertyUi(GetParent(hwndDlg), NCRP_SHOW_PROPERTY_UI, (INetConnectionConnectUi*)this);
239  }
240 }
241 
242 INT_PTR
243 CALLBACK
245  HWND hwndDlg,
246  UINT uMsg,
247  WPARAM wParam,
248  LPARAM lParam)
249 {
251  LPNMLISTVIEW lppl;
252  LVITEMW li;
253  PNET_ITEM pItem;
255  LPPSHNOTIFY lppsn;
256  DWORD dwShowIcon, dwNotifyDisconnect;
257  HRESULT hr;
258  WCHAR szKey[200];
259  LPOLESTR pStr;
260  HKEY hKey;
261 
262  switch (uMsg)
263  {
264  case WM_INITDIALOG:
266  This = (CNetConnectionPropertyUi*)page->lParam;
267  This->InitializeLANPropertiesUIDlg(hwndDlg);
269  return TRUE;
270  case WM_NOTIFY:
271  lppl = (LPNMLISTVIEW) lParam;
272  lppsn = (LPPSHNOTIFY) lParam;
273  if (lppsn->hdr.code == PSN_APPLY)
274  {
276  if (This->m_pNCfg)
277  {
278  hr = This->m_pNCfg->Apply();
279  if (FAILED(hr))
280  return PSNRET_INVALID;
281  }
282 
284  dwShowIcon = 1;
285  else
286  dwShowIcon = 0;
287 
289  dwNotifyDisconnect = 1;
290  else
291  dwNotifyDisconnect = 0;
292 
293  //NOTE: Windows write these setting with the undocumented INetLanConnection::SetInfo
294  if (StringFromCLSID((CLSID)This->m_pProperties->guidId, &pStr) == ERROR_SUCCESS)
295  {
296  swprintf(szKey, L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr);
297  CoTaskMemFree(pStr);
298  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szKey, 0, KEY_WRITE, &hKey) == ERROR_SUCCESS)
299  {
300  RegSetValueExW(hKey, L"ShowIcon", 0, REG_DWORD, (LPBYTE)&dwShowIcon, sizeof(DWORD));
301  RegSetValueExW(hKey, L"IpCheckingEnabled", 0, REG_DWORD, (LPBYTE)&dwNotifyDisconnect, sizeof(DWORD));
302  RegCloseKey(hKey);
303  }
304  }
305 
306  return PSNRET_NOERROR;
307  }
308 #if 0
309  else if (lppsn->hdr.code == PSN_CANCEL)
310  {
312  if (This->m_pNCfg)
313  {
314  hr = This->m_pNCfg->Cancel();
315  if (SUCCEEDED(hr))
316  return PSNRET_NOERROR;
317  else
318  return PSNRET_INVALID;
319  }
320  return PSNRET_NOERROR;
321  }
322 #endif
323  if (lppl->hdr.code == LVN_ITEMCHANGING)
324  {
325  ZeroMemory(&li, sizeof(li));
326  li.mask = LVIF_PARAM;
327  li.iItem = lppl->iItem;
328  if (!SendMessageW(lppl->hdr.hwndFrom, LVM_GETITEMW, 0, (LPARAM)&li))
329  return TRUE;
330 
331  pItem = (PNET_ITEM)li.lParam;
332  if (!pItem)
333  return TRUE;
334 
335  if (!(lppl->uOldState & LVIS_FOCUSED) && (lppl->uNewState & LVIS_FOCUSED))
336  {
337  /* new focused item */
340  else
342 
343  if (pItem->dwCharacteristics & NCF_HAS_UI)
345  else
347 
349  }
350  }
351  break;
352  case WM_COMMAND:
353  if (LOWORD(wParam) == IDC_PROPERTIES)
354  {
356  This->ShowNetworkComponentProperties(hwndDlg);
357  return FALSE;
358  }
359  else if (LOWORD(wParam) == IDC_CONFIGURE)
360  {
361  LPOLESTR DeviceInstanceID;
363 
364  if (This->GetDeviceInstanceID(&DeviceInstanceID))
365  {
366  WCHAR wszCmd[2*MAX_PATH];
367  StringCbPrintfW(wszCmd, sizeof(wszCmd), L"rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID %s", DeviceInstanceID);
368  CoTaskMemFree(DeviceInstanceID);
369 
370  STARTUPINFOW si;
372  ZeroMemory(&si, sizeof(si));
373  si.cb = sizeof(si);
374  if (!CreateProcessW(NULL, wszCmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
375  break;
376 
377  CloseHandle(pi.hProcess);
378  CloseHandle(pi.hThread);
379  }
380  }
381  break;
382  }
383  return FALSE;
384 }
385 
386 BOOL
388  OUT LPOLESTR *DeviceInstanceID)
389 {
390  LPOLESTR pStr, pResult;
391  HKEY hKey;
392  DWORD dwInstanceID;
393  WCHAR szKeyName[2*MAX_PATH];
394  WCHAR szInstanceID[2*MAX_PATH];
395 
397  {
398  // failed to convert guid to string
399  return FALSE;
400  }
401 
402  StringCbPrintfW(szKeyName, sizeof(szKeyName), L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr);
403  CoTaskMemFree(pStr);
404 
405  if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, szKeyName, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
406  {
407  // failed to open key
408  return FALSE;
409  }
410 
411  dwInstanceID = sizeof(szInstanceID);
412  if (RegGetValueW(hKey, NULL, L"PnpInstanceId", RRF_RT_REG_SZ, NULL, (PVOID)szInstanceID, &dwInstanceID) == ERROR_SUCCESS)
413  {
414  szInstanceID[MAX_PATH-1] = L'\0';
415  pResult = static_cast<LPOLESTR>(CoTaskMemAlloc((wcslen(szInstanceID) + 1) * sizeof(WCHAR)));
416  if (pResult != 0)
417  {
418  wcscpy(pResult, szInstanceID);
419  *DeviceInstanceID = pResult;
420  RegCloseKey(hKey);
421  return TRUE;
422  }
423  }
424  RegCloseKey(hKey);
425  return FALSE;
426 }
427 
428 HRESULT
429 WINAPI
432  LPFNADDPROPSHEETPAGE pfnAddPage,
433  LPARAM lParam)
434 {
435  HPROPSHEETPAGE hProp;
436  BOOL ret;
437  HRESULT hr = E_FAIL;
438  INITCOMMONCONTROLSEX initEx;
439 
440  initEx.dwSize = sizeof(initEx);
441  initEx.dwICC = ICC_LISTVIEW_CLASSES;
442  if (!InitCommonControlsEx(&initEx))
443  return E_FAIL;
444 
445  hr = m_pCon->GetProperties(&m_pProperties);
446  if (FAILED_UNEXPECTEDLY(hr))
447  return hr;
448 
449  hProp = InitializePropertySheetPage(MAKEINTRESOURCEW(IDD_NETPROPERTIES), LANPropertiesUIDlg, reinterpret_cast<LPARAM>(this), NULL);
450  if (hProp)
451  {
452  ret = (*pfnAddPage)(hProp, lParam);
453  if (ret)
454  {
455  hr = NOERROR;
456  }
457  else
458  {
460  }
461  }
462  return hr;
463 }
464 
465 HRESULT
466 WINAPI
468  DWORD dwSize,
469  HICON *phIcon)
470 {
471  return E_NOTIMPL;
472 }
473 
474 HRESULT
475 WINAPI
477 {
478  CopyMemory(pGuid, &m_pProperties->guidId, sizeof(GUID));
479  return S_OK;
480 }
481 
482 HRESULT
483 WINAPI
485 {
486  if (!pCon)
487  return E_POINTER;
488 
489  m_pCon = pCon;
490  return S_OK;
491 }
492 
493 HRESULT
494 WINAPI
497  DWORD dwFlags)
498 {
499  if (!m_pCon)
500  return E_POINTER; //FIXME
501 
502  if (dwFlags & NCUC_NO_UI)
503  return m_pCon->Connect();
504 
505  return E_FAIL;
506 }
507 
508 HRESULT
509 WINAPI
512  DWORD dwFlags)
513 {
514  WCHAR szBuffer[100];
515  swprintf(szBuffer, L"INetConnectionConnectUi_fnDisconnect flags %x\n", dwFlags);
516  MessageBoxW(NULL, szBuffer, NULL, MB_OK);
517 
518  return S_OK;
519 }
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1965
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:3141
#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:3133
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:1900
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:4593
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:4895
virtual HRESULT WINAPI Disconnect(HWND hwndParent, DWORD dwFlags)
UINT NumPropDialogOpen
Definition: lanconnectui.h:19
#define BM_SETCHECK
Definition: winuser.h:1903
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:71
#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:1722
HWND hwndFrom
Definition: winuser.h:3131
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:5744
#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:3366
#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:1721
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