69 const INetCfgComponentPropertyUi *
lpVtbl;
135 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
175 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
179 if (pPort->MaxNum == 65536)
195 if (Num > pPort->MaxNum || Num == 0)
197 if (pPort->MaxNum == 65536)
207 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
216 li.pszText = szBuffer;
295 for(iIndex = 0; iIndex < iCount; iIndex++)
300 li.pszText = szBuffer;
301 li.cchTextMax =
sizeof(szBuffer) /
sizeof(
WCHAR);
346 Port.MaxNum = MaxItem;
347 Port.hDlgCtrl = hDlgCtrl;
470 if (pContext->pCurrentConfig->pFilter)
472 CoTaskMemFree(pContext->pCurrentConfig->pFilter->szTCPAllowedPorts);
473 CoTaskMemFree(pContext->pCurrentConfig->pFilter->szUDPAllowedPorts);
474 CoTaskMemFree(pContext->pCurrentConfig->pFilter->szRawIPAllowedProtocols);
477 pContext->pCurrentConfig->pFilter = pFilter;
549 szText[(
sizeof(szText)/
sizeof(
WCHAR))-1] =
L'\0';
556 szText[(
sizeof(szText)/
sizeof(
WCHAR))-1] =
L'\0';
612 lc.
fmt = LVCFMT_FIXED_WIDTH;
635 li.iItem = itemCount;
637 dwIpAddr =
pAddr->IpAddress;
641 li.pszText = szBuffer;
647 dwIpAddr =
pAddr->u.Subnetmask;
661 li.pszText = szBuffer;
682 if (
This->pCurrentConfig->DhcpEnabled)
688 li.pszText = szBuffer;
739 if (pGwSettings->
bAdd)
743 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
753 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
816 if (!pGwSettings->
bAdd)
851 li.pszText = pGwSettings->
szIP;
856 li.pszText = szBuffer;
900 if (pIpSettings->
bAdd)
904 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
913 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
957 else if (!pIpSettings->
bAdd)
1005 if (!pSettings->
bAdd)
1010 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1020 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1039 if (pSettings->Suffix)
1069 UINT iItemCount, iIndex;
1075 for (iIndex = 0; iIndex < iItemCount; iIndex++)
1099 li.pszText = pIpSettings->
szIP;
1144 while((pNext =
wcschr(pNext,
L'.')))
1148 dwIpAddr |= (Val <<
Index * 8);
1153 dwIpAddr |=
_wtoi(pLast);
1183 pNext =
pAddr->Next;
1196 li.pszText = szBuffer;
1198 li.iSubItem = SubIndex;
1221 for(iIndex = 0; iIndex < iCount; iIndex++)
1230 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1235 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1272 WCHAR szBuffer[200];
1299 (!
This->pCurrentConfig->DhcpEnabled);
1353 li.pszText = Ip.szIP;
1359 li.pszText = Ip.szMask;
1383 li.pszText = Ip.szIP;
1385 li.pszText = Ip.szMask;
1406 li.pszText =
Gw.szIP;
1414 li.pszText = szBuffer;
1421 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1423 li.pszText = szBuffer;
1450 li.pszText =
Gw.szIP;
1456 li.pszText = szBuffer;
1463 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1465 li.pszText = szBuffer;
1492 WCHAR szBuffer[100];
1501 if (!pSettings->
bAdd)
1505 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1515 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1533 if (pSettings->
bAdd)
1538 if (!pSettings->
bAdd)
1569 WCHAR szBuffer[200];
1578 dwIpAddr =
pAddr->IpAddress;
1587 if (!
This->pCurrentConfig->pDNS)
1590 if (
This->pCurrentConfig->pDNS->RegisterAdapterName)
1595 if (
This->pCurrentConfig->pDNS->RegistrationEnabled)
1598 if (
This->pCurrentConfig->pDNS->szDomain[0])
1601 if (
This->pCurrentConfig->pDNS->UseDomainNameDevolution)
1604 if (!
This->pCurrentConfig->pDNS->szSearchList || (
wcslen(
This->pCurrentConfig->pDNS->szSearchList) == 0))
1612 pList =
This->pCurrentConfig->pDNS->szSearchList;
1653 if (lResult < lCount -1)
1678 WCHAR szBuffer[100];
1706 if (lResult + 1 < lCount)
1720 LPWSTR pszSearchList, pItem;
1723 if (!iCount || iCount ==
LB_ERR)
1728 for (iIndex = 0; iIndex < iCount; iIndex++)
1741 pItem = pszSearchList;
1742 for (iIndex = 0; iIndex < iCount; iIndex++)
1752 if (iIndex != iCount -1)
1759 return pszSearchList;
1775 if (!iCount || iCount ==
LB_ERR)
1781 for(iIndex = 0; iIndex < iCount; iIndex++)
1800 This->pCurrentConfig->AutoconfigActive =
FALSE;
1818 WCHAR szSuffix[100];
1819 WCHAR szFormat[200];
1820 WCHAR szBuffer[300];
1846 szSuffix[(
sizeof(szSuffix)/
sizeof(
WCHAR))-1] =
L'\0';
1851 szFormat[(
sizeof(szFormat)/
sizeof(
WCHAR))-1] =
L'\0';
1852 swprintf(szBuffer, szFormat, szSuffix);
1854 szFormat[(
sizeof(szFormat)/
sizeof(
WCHAR))-1] =
L'\0';
1856 szFormat[0] =
L'\0';
1869 if (!
This->pCurrentConfig->pDNS)
1876 This->pCurrentConfig->pDNS->szSearchList =
NULL;
1878 This->pCurrentConfig->pDNS->UseDomainNameDevolution =
TRUE;
1880 This->pCurrentConfig->pDNS->UseDomainNameDevolution =
FALSE;
1885 This->pCurrentConfig->pDNS->szSearchList =
NULL;
1886 This->pCurrentConfig->pDNS->UseDomainNameDevolution =
FALSE;
1892 This->pCurrentConfig->pDNS->RegisterAdapterName =
TRUE;
1894 This->pCurrentConfig->pDNS->RegistrationEnabled =
TRUE;
1896 This->pCurrentConfig->pDNS->RegistrationEnabled =
FALSE;
1900 This->pCurrentConfig->pDNS->RegisterAdapterName =
FALSE;
1901 This->pCurrentConfig->pDNS->RegistrationEnabled =
FALSE;
2060 Suffix.
Suffix[lLength] =
L'\0';
2107 WCHAR szBuffer[100];
2115 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
2117 szBuffer[0] =
L'\0';
2123 pinfo.u3.
phpage = hppages;
2184 if (pCurSettings->
Ip)
2199 if (pCurSettings->
Ns)
2202 if (pCurSettings->
Ns->
Next)
2235 if (
This->pCurrentConfig)
2297 This->pCurrentConfig->DhcpEnabled =
FALSE;
2307 if (!
This->pCurrentConfig->Ip)
2310 if (!
This->pCurrentConfig->Ip)
2314 This->pCurrentConfig->Ip->IpAddress = dwIpAddr;
2338 This->pCurrentConfig->Ip->u.Subnetmask = dwIpAddr;
2342 This->pCurrentConfig->DhcpEnabled =
TRUE;
2347 if (!
This->pCurrentConfig->Gw)
2350 if (!
This->pCurrentConfig->Gw)
2355 This->pCurrentConfig->Gw->IpAddress = dwIpAddr;
2359 if (
This->pCurrentConfig->Gw)
2361 IP_ADDR * pNextGw =
This->pCurrentConfig->Gw->Next;
2363 This->pCurrentConfig->Gw = pNextGw;
2370 This->pCurrentConfig->AutoconfigActive =
FALSE;
2373 if (!
This->pCurrentConfig->Ns)
2376 if (!
This->pCurrentConfig->Ns)
2380 This->pCurrentConfig->Ns->IpAddress = dwIpAddr;
2382 else if (
This->pCurrentConfig->Ns)
2387 This->pCurrentConfig->Ns = pTemp;
2394 if (!
This->pCurrentConfig->Ns || bSkip)
2396 if (!
This->pCurrentConfig->Ns)
2399 if (!
This->pCurrentConfig->Ns)
2403 This->pCurrentConfig->Ns->IpAddress = dwIpAddr;
2405 else if (!
This->pCurrentConfig->Ns->Next)
2408 if (!
This->pCurrentConfig->Ns->Next)
2411 This->pCurrentConfig->Ns->Next->IpAddress = dwIpAddr;
2415 This->pCurrentConfig->Ns->Next->IpAddress = dwIpAddr;
2420 if (
This->pCurrentConfig->Ns &&
This->pCurrentConfig->Ns->Next)
2422 if (
This->pCurrentConfig->Ns->Next->Next)
2424 IP_ADDR *pTemp =
This->pCurrentConfig->Ns->Next->Next;
2426 This->pCurrentConfig->Ns->Next = pTemp;
2431 This->pCurrentConfig->Ns->Next =
NULL;
2438 This->pCurrentConfig->AutoconfigActive =
TRUE;
2485 if (pCurSettings->
Ip)
2511 if (pCurSettings->
Ns)
2514 if (pCurSettings->
Ns->
Next)
2568 if (szMetric && szMetric[0] !=
L'\0')
2571 szMetric +=
wcslen(szMetric) + 1;
2581 pCurrent = pCurrent->
Next;
2611 if (
This->pCurrentConfig)
2714 INetCfgComponentPropertyUi * iface,
2749 INetCfgComponentPropertyUi * iface)
2760 INetCfgComponentPropertyUi * iface)
2775 INetCfgComponentPropertyUi * iface,
2778 INetLanConnectionUiInfo * pLanInfo;
2797 INetCfgComponentPropertyUi * iface,
2814 WCHAR szBuffer[200];
2820 if (!
This->pCurrentConfig->pDNS)
2828 swprintf(szBuffer,
L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%s", pStr);
2838 dwSize =
sizeof(
This->pCurrentConfig->pDNS->szDomain);
2853 if (
This->pCurrentConfig->pDNS->szSearchList)
2858 This->pCurrentConfig->pDNS->szSearchList =
NULL;
2895 WCHAR szBuffer[200];
2904 This->pCurrentConfig->pFilter = pFilter;
2922 swprintf(szBuffer,
L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%s", pStr);
2951 if (
This->pCurrentConfig)
2980 pCurrentAdapter = pInfo;
2982 while(pCurrentAdapter)
2984 szBuffer[0] =
L'\0';
2987 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
2994 pCurrentAdapter = pCurrentAdapter->
Next;
3012 This->pCurrentConfig = pCurSettings;
3014 pCurSettings->
Index = pCurrentAdapter->
Index;
3045 if (!
Info.AutoconfigActive)
3066 INetCfgComponentPropertyUi * iface,
3068 BYTE **pahpspPrivate,
3082 if (
This->pCurrentConfig->DhcpEnabled)
3108 *pahpspPrivate = (
BYTE*)hppages;
3109 *pcPages = NumPages;
3117 INetCfgComponentPropertyUi * iface,
3127 INetCfgComponentPropertyUi * iface)
3137 INetCfgComponentPropertyUi * iface)
3163 INetCfgComponentControl * iface,
3174 INetCfgComponentControl * iface)
3183 INetCfgComponentControl * iface)
3192 INetCfgComponentControl * iface,
3193 INetCfgComponent *pIComp,
3199 This->pNCfg = pINetCfg;
3200 This->pNComp = pIComp;
3235 pTemp = pTemp->
Next;
3275 pStr +=
wcslen(pStr) + 1;
3277 pTemp = pTemp->
Next;
3288 INetCfgComponentControl * iface)
3293 WCHAR szBuffer[200];
3296 DWORD DhcpApiVersion;
3300 pCurrentConfig =
This->pCurrentConfig;
3305 This->pCurrentConfig = pCurrentConfig;
3308 pOldConfig =
This->pCurrentConfig;
3309 This->pCurrentConfig = pCurrentConfig;
3316 if (pCurrentConfig->
pDNS)
3333 swprintf(szBuffer,
L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%s", pStr);
3338 if (pCurrentConfig->
pDNS)
3384 if (pIpForwardTable)
3423 pCurrentConfig->
Index,
3448 if (pIpForwardTable)
3466 if (pCurrentConfig->
Gw)
3524 INetCfgComponentControl * iface,
3525 INetCfgPnpReconfigCallback *pICallback)
3534 INetCfgComponentControl * iface)
#define InterlockedIncrement
#define InterlockedDecrement
static void AddButton(HWND hwndToolBar, int nImage, int nCommand)
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
void WINAPI DhcpCApiCleanup(void)
DWORD APIENTRY DhcpCApiInitialize(LPDWORD Version)
DWORD APIENTRY DhcpStaticRefreshParams(DWORD AdapterIndex, DWORD Address, DWORD Netmask)
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
#define MultiByteToWideChar
HINSTANCE netcfgx_hInstance
#define IDS_TCPFILTERDESC
#define IDS_DISABLE_FILTER
#define IDD_TCPIP_ADVOPT_DLG