37 lvItem.
iItem = 0x7fffffff;
51 hr = pNCfg->EnumComponents(&GUID_DEVCLASS_NET, &pEnumCfg);
58 hr = pEnumCfg->Next(1, &pNCg, &Fetched);
62 hr = pNCg->GetDisplayName(&
pName);
82 DWORD dwCharacteristics;
87 hr = pNCfg->EnumComponents(CompGuid, &pENetCfg);
97 hr = pENetCfg->Next(1, &pNCfgComp, &Num);
101 hr = pNCfgComp->GetCharacteristics(&dwCharacteristics);
107 hr = pNCfgComp->GetDisplayName(&pDisplayName);
108 hr = pNCfgComp->GetHelpText(&pHelpText);
110 hr = pNCfgComp->QueryInterface(
IID_PPV_ARG(INetCfgComponentBindings, &pCompBind));
115 hr = pCompBind->IsBoundTo(pAdapterCfgComp);
126 pItem->
szHelp = pHelpText;
165 lc.
fmt = LVCFMT_FIXED_WIDTH;
181 hr = pNCfg->QueryInterface(
IID_PPV_ARG(INetCfgLock, &pNCfgLock));
182 hr = pNCfgLock->AcquireWriteLock(100,
L"", &pDisplayName);
189 hr = pNCfg->Initialize(
NULL);
192 pNCfgLock->ReleaseWriteLock();
200 spcid.
cbSize =
sizeof(spcid);
228 INetCfgComponent *pNCfgComp;
255 pNCfgComp = (INetCfgComponent*)pItem->
pNCfgComp;
277 DWORD dwShowIcon, dwNotifyDisconnect;
288 This->InitializeLANPropertiesUIDlg(hwndDlg);
299 hr =
This->m_pNCfg->Apply();
310 dwNotifyDisconnect = 1;
312 dwNotifyDisconnect = 0;
317 swprintf(szKey,
L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr);
330 else if (lppsn->
hdr.
code == PSN_CANCEL)
335 hr =
This->m_pNCfg->Cancel();
347 This->ShowNetworkComponentProperties(hwndDlg);
384 This->ShowNetworkComponentProperties(hwndDlg);
392 if (
This->GetDeviceInstanceID(&DeviceInstanceID))
395 StringCbPrintfW(wszCmd,
sizeof(wszCmd),
L"rundll32.exe devmgr.dll,DeviceProperties_RunDLL /DeviceID %s", DeviceInstanceID);
430 StringCbPrintfW(szKeyName,
sizeof(szKeyName),
L"SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}\\%s\\Connection", pStr);
439 dwInstanceID =
sizeof(szInstanceID);
446 wcscpy(pResult, szInstanceID);
447 *DeviceInstanceID = pResult;
468 initEx.
dwSize =
sizeof(initEx);
543 swprintf(szBuffer,
L"INetConnectionConnectUi_fnDisconnect flags %x\n",
dwFlags);
#define RegCloseKey(hKey)
VOID EnumComponents(HWND hDlgCtrl, INetCfg *pNCfg, const GUID *CompGuid, UINT Type, PSP_CLASSIMAGELIST_DATA pCILD)
CComPtr< INetCfgLock > m_NCfgLock
STDMETHOD() AddPages(HWND hwndParent, LPFNADDPROPSHEETPAGE pfnAddPage, LPARAM lParam) override
STDMETHOD() GetDeviceGuid(GUID *pGuid) override
CNetConnectionPropertyUi()
STDMETHOD() Connect(HWND hwndParent, DWORD dwFlags) override
STDMETHOD() GetIcon(DWORD dwSize, HICON *phIcon) override
CComPtr< INetCfg > m_pNCfg
static INT_PTR CALLBACK LANPropertiesUIDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID ShowNetworkComponentProperties(HWND hwndDlg)
~CNetConnectionPropertyUi()
CComPtr< INetConnection > m_pCon
BOOL GetINetCfgComponent(INetCfg *pNCfg, INetCfgComponent **pOut)
STDMETHOD() SetConnection(INetConnection *pCon) override
VOID InitializeLANPropertiesUIDlg(HWND hwndDlg)
STDMETHOD() Disconnect(HWND hwndParent, DWORD dwFlags) override
NETCON_PROPERTIES * m_pProperties
BOOL GetDeviceInstanceID(OUT LPOLESTR *DeviceInstanceID)
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
#define NCF_NOT_USER_REMOVABLE
#define NCCF_NOTIFY_DISCONNECTED
#define IDD_NETPROPERTIES
#define IDC_NOTIFYNOCONNECTION
#define IDC_COMPONENTSLIST
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
HIMAGELIST WINAPI ImageList_Duplicate(HIMAGELIST himlSrc)
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
#define FAILED_UNEXPECTEDLY(hr)
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)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI StringFromCLSID(REFCLSID id, LPOLESTR *idstr)
BOOL WINAPI SetupDiDestroyClassImageList(IN PSP_CLASSIMAGELIST_DATA ClassImageListData)
BOOL WINAPI SetupDiGetClassImageIndex(IN PSP_CLASSIMAGELIST_DATA ClassImageListData, IN CONST GUID *ClassGuid, OUT PINT ImageIndex)
BOOL WINAPI SetupDiGetClassImageList(OUT PSP_CLASSIMAGELIST_DATA ClassImageListData)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
VOID AddItemToListView(HWND hDlgCtrl, PNET_ITEM pItem, LPWSTR szName, BOOL bChecked, UINT Image)
struct NET_ITEM * PNET_ITEM
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
struct _PSP * HPROPSHEETPAGE
EXTERN_C const GUID CLSID_CNetCfg
HPROPSHEETPAGE InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
VOID WINAPI NcFreeNetconProperties(NETCON_PROPERTIES *pProps)
static const WCHAR szName[]
BOOL(CALLBACK * LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM)
struct _PSHNOTIFY * LPPSHNOTIFY
#define ListView_SetItemState(hwndLV, i, data, mask)
#define ListView_SetCheckState(hwndLV, i, fCheck)
#define ListView_SetImageList(hwnd, himl, iImageList)
#define LVS_EX_CHECKBOXES
#define LVS_EX_FULLROWSELECT
#define ListView_GetItemCount(hwnd)
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVM_INSERTCOLUMNW
#define LVM_GETEXTENDEDLISTVIEWSTYLE
#define ICC_LISTVIEW_CLASSES
#define LVM_SETEXTENDEDLISTVIEWSTYLE
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
INetCfgComponent * pNCfgComp
_In_ WDFCOLLECTION _In_ ULONG Index
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define HKEY_LOCAL_MACHINE
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
#define MAKEINTRESOURCEW(i)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define IID_PPV_ARG(Itype, ppType)