13#define IP_STRING_MIN_LENGTH 8
14#define IP_STRING_MAX_LENGTH 16
185 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
205 pAdapter =
This->pAdapterListHead;
211 pAdapter = pAdapter->
pNext;
246 if (pszIpAddress ==
NULL)
253 wcscpy(pszIpAddress,
L"0.0.0.0");
274 *ppszIpAddress = pszIpAddress;
309 if (pszSubnetMask ==
NULL)
316 wcscpy(pszSubnetMask,
L"0.0.0.0");
337 *ppszSubnetMask = pszSubnetMask;
371 if (pszDefGateway ==
NULL)
395 TRACE(
"DefaultGateway %S\n", pszDefGateway);
399 if (pszGatewayMetric ==
NULL)
411 if (
pString != pszGatewayMetric)
423 TRACE(
"Gateway Metric %S\n", pszGatewayMetric);
435 if (pszNameServers ==
NULL)
459 TRACE(
"Name Servers %S\n", pszNameServers);
477 if (pszParameters ==
NULL)
484 L"DefGw=%s;GwMetric=%s;IfMetric=%lu;DNS=%s;",
490 TRACE(
"Parameters %S\n", pszParameters);
492 *ppszParameters = pszParameters;
498 if (pszGatewayMetric)
534 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
538 if (pPort->MaxNum == 65536)
554 if (Num > pPort->MaxNum || Num == 0)
556 if (pPort->MaxNum == 65536)
566 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
575 li.pszText = szBuffer;
654 for(iIndex = 0; iIndex < iCount; iIndex++)
659 li.pszText = szBuffer;
660 li.cchTextMax =
sizeof(szBuffer) /
sizeof(
WCHAR);
683 Port.MaxNum = MaxItem;
684 Port.hDlgCtrl = hDlgCtrl;
805 pContext->pTcpIpSettings->EnableSecurityFilters =
TRUE;
812 pContext->pTcpIpSettings->EnableSecurityFilters =
FALSE;
813 if (pContext->pCurrentAdapter->szTCPAllowedPorts)
816 pContext->pCurrentAdapter->szTCPAllowedPorts =
NULL;
817 pContext->pCurrentAdapter->TCPSize = 0;
819 if (pContext->pCurrentAdapter->szUDPAllowedPorts)
822 pContext->pCurrentAdapter->szUDPAllowedPorts =
NULL;
823 pContext->pCurrentAdapter->UDPSize = 0;
825 if (pContext->pCurrentAdapter->szRawIPAllowedProtocols)
827 CoTaskMemFree(pContext->pCurrentAdapter->szRawIPAllowedProtocols);
828 pContext->pCurrentAdapter->szRawIPAllowedProtocols =
NULL;
829 pContext->pCurrentAdapter->RawIPSize = 0;
902 szText[(
sizeof(szText)/
sizeof(
WCHAR))-1] =
L'\0';
909 szText[(
sizeof(szText)/
sizeof(
WCHAR))-1] =
L'\0';
965 lc.
fmt = LVCFMT_FIXED_WIDTH;
988 li.iItem = itemCount;
990 dwIpAddr =
pAddr->IpAddress;
994 li.pszText = szBuffer;
1000 dwIpAddr =
pAddr->u.SubnetMask;
1006 if (
pAddr->u.Metric)
1014 li.pszText = szBuffer;
1029 WCHAR szBuffer[100];
1035 if (
This->pCurrentAdapter->NewDhcpEnabled)
1041 li.pszText = szBuffer;
1064 if (
This->pCurrentAdapter->NewMetric)
1102 if (pGwSettings->
bAdd)
1106 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1116 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1179 if (!pGwSettings->
bAdd)
1214 li.pszText = pGwSettings->
szIP;
1219 li.pszText = szBuffer;
1263 if (pIpSettings->
bAdd)
1267 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1276 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1320 else if (!pIpSettings->
bAdd)
1360 WCHAR szBuffer[100];
1368 if (!pSettings->
bAdd)
1373 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1383 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1402 if (pSettings->Suffix)
1409 pSettings->Suffix =
NULL;
1417 pSettings->Suffix =
NULL;
1434 UINT iItemCount, iIndex;
1440 for (iIndex = 0; iIndex < iItemCount; iIndex++)
1464 li.pszText = pIpSettings->
szIP;
1513 dwIpAddr |= (Val <<
Index * 8);
1518 dwIpAddr |=
_wtoi(pLast);
1561 li.pszText = szBuffer;
1563 li.iSubItem = SubIndex;
1586 for(iIndex = 0; iIndex < iCount; iIndex++)
1595 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1600 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1610 This->pCurrentAdapter->NewIp =
pCur;
1612 This->pCurrentAdapter->NewGw =
pCur;
1637 WCHAR szBuffer[200];
1664 (!
This->pCurrentAdapter->NewDhcpEnabled);
1690 if ((
val < 1) || (
val > 9999))
1702 This->pCurrentAdapter->NewGw =
NULL;
1704 This->pCurrentAdapter->NewIp =
NULL;
1709 This->pCurrentAdapter->NewMetric = 0;
1735 li.pszText = Ip.szIP;
1741 li.pszText = Ip.szMask;
1765 li.pszText = Ip.szIP;
1767 li.pszText = Ip.szMask;
1788 li.pszText =
Gw.szIP;
1796 li.pszText = szBuffer;
1803 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1805 li.pszText = szBuffer;
1832 li.pszText =
Gw.szIP;
1838 li.pszText = szBuffer;
1845 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1847 li.pszText = szBuffer;
1875 WCHAR szBuffer[100];
1884 if (!pSettings->
bAdd)
1888 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1898 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
1916 if (pSettings->
bAdd)
1921 if (!pSettings->
bAdd)
1952 WCHAR szBuffer[200];
1961 dwIpAddr =
pAddr->IpAddress;
1970 if (
This->pCurrentAdapter->NewRegisterAdapterName)
1975 if (
This->pCurrentAdapter->NewRegistrationEnabled)
1978 if (
This->pCurrentAdapter->szDomain[0])
1981 if (
This->pTcpIpSettings->UseDomainNameDevolution)
1984 if (!
This->pTcpIpSettings->szSearchList || (
wcslen(
This->pTcpIpSettings->szSearchList) == 0))
1992 pList =
This->pTcpIpSettings->szSearchList;
2033 if (lResult < lCount -1)
2058 WCHAR szBuffer[100];
2086 if (lResult + 1 < lCount)
2100 LPWSTR pszSearchList, pItem;
2103 if (!iCount || iCount ==
LB_ERR)
2108 for (iIndex = 0; iIndex < iCount; iIndex++)
2121 pItem = pszSearchList;
2122 for (iIndex = 0; iIndex < iCount; iIndex++)
2132 if (iIndex != iCount -1)
2139 return pszSearchList;
2152 This->pCurrentAdapter->NewNs =
NULL;
2155 if (!iCount || iCount ==
LB_ERR)
2161 for(iIndex = 0; iIndex < iCount; iIndex++)
2173 This->pCurrentAdapter->NewNs =
pCur;
2197 WCHAR szSuffix[100];
2198 WCHAR szFormat[200];
2199 WCHAR szBuffer[300];
2225 szSuffix[(
sizeof(szSuffix)/
sizeof(
WCHAR))-1] =
L'\0';
2230 szFormat[(
sizeof(szFormat)/
sizeof(
WCHAR))-1] =
L'\0';
2231 _swprintf(szBuffer, szFormat, szSuffix);
2233 szFormat[(
sizeof(szFormat)/
sizeof(
WCHAR))-1] =
L'\0';
2235 szFormat[0] =
L'\0';
2253 This->pTcpIpSettings->szSearchList =
NULL;
2255 This->pTcpIpSettings->UseDomainNameDevolution =
TRUE;
2257 This->pTcpIpSettings->UseDomainNameDevolution =
FALSE;
2262 This->pTcpIpSettings->szSearchList =
NULL;
2263 This->pTcpIpSettings->UseDomainNameDevolution =
FALSE;
2269 This->pCurrentAdapter->NewRegisterAdapterName =
TRUE;
2271 This->pCurrentAdapter->NewRegistrationEnabled =
TRUE;
2273 This->pCurrentAdapter->NewRegistrationEnabled =
FALSE;
2277 This->pCurrentAdapter->NewRegisterAdapterName =
FALSE;
2278 This->pCurrentAdapter->NewRegistrationEnabled =
FALSE;
2437 Suffix.
Suffix[lLength] =
L'\0';
2484 WCHAR szBuffer[100];
2492 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
2494 szBuffer[0] =
L'\0';
2500 pinfo.u3.
phpage = hppages;
2559 This->pCurrentAdapter->AltConfig.IpAddress = dwAddr;
2562 This->pCurrentAdapter->AltConfig.SubnetMask = dwAddr;
2565 This->pCurrentAdapter->AltConfig.DefaultGateway = dwAddr;
2568 This->pCurrentAdapter->AltConfig.DnsServer1 = dwAddr;
2571 This->pCurrentAdapter->AltConfig.DnsServer2 = dwAddr;
2613 if (
This->pCurrentAdapter->AltConfig.IpAddress == 0)
2627 if (
This->pCurrentAdapter->AltConfig.IpAddress)
2631 if (
This->pCurrentAdapter->AltConfig.SubnetMask)
2635 if (
This->pCurrentAdapter->AltConfig.DefaultGateway)
2639 if (
This->pCurrentAdapter->AltConfig.DnsServer1)
2643 if (
This->pCurrentAdapter->AltConfig.DnsServer2)
2766 This->pCurrentAdapter->NewDhcpEnabled =
FALSE;
2777 if (!
This->pCurrentAdapter->NewIp)
2780 if (!
This->pCurrentAdapter->NewIp)
2784 This->pCurrentAdapter->NewIp->IpAddress = dwIpAddr;
2808 This->pCurrentAdapter->NewIp->u.SubnetMask = dwIpAddr;
2812 if (!
This->pCurrentAdapter->NewGw)
2815 if (!
This->pCurrentAdapter->NewGw)
2821 This->pCurrentAdapter->NewGw->IpAddress = dwIpAddr;
2826 This->pCurrentAdapter->NewDhcpEnabled =
TRUE;
2829 if (
This->pCurrentAdapter->NewIp)
2831 IP_ADDR * pNextIp =
This->pCurrentAdapter->NewIp->Next;
2833 This->pCurrentAdapter->NewIp = pNextIp;
2837 if (
This->pCurrentAdapter->NewGw)
2839 IP_ADDR * pNextGw =
This->pCurrentAdapter->NewGw->Next;
2841 This->pCurrentAdapter->NewGw = pNextGw;
2847 This->pCurrentAdapter->DnsDhcpEnabled =
FALSE;
2852 if (!
This->pCurrentAdapter->NewNs)
2855 if (!
This->pCurrentAdapter->NewNs)
2859 This->pCurrentAdapter->NewNs->IpAddress = dwIpAddr;
2861 else if (
This->pCurrentAdapter->NewNs)
2863 IP_ADDR *pTemp =
This->pCurrentAdapter->NewNs->Next;
2866 This->pCurrentAdapter->NewNs = pTemp;
2872 if (!
This->pCurrentAdapter->NewNs || bSkip)
2874 if (!
This->pCurrentAdapter->NewNs)
2877 if (!
This->pCurrentAdapter->NewNs)
2881 This->pCurrentAdapter->NewNs->IpAddress = dwIpAddr;
2883 else if (!
This->pCurrentAdapter->NewNs->Next)
2886 if (!
This->pCurrentAdapter->NewNs->Next)
2889 This->pCurrentAdapter->NewNs->Next->IpAddress = dwIpAddr;
2893 This->pCurrentAdapter->NewNs->Next->IpAddress = dwIpAddr;
2898 if (
This->pCurrentAdapter->NewNs &&
This->pCurrentAdapter->NewNs->Next)
2900 if (
This->pCurrentAdapter->NewNs->Next->Next)
2902 IP_ADDR *pTemp =
This->pCurrentAdapter->NewNs->Next->Next;
2904 This->pCurrentAdapter->NewNs->Next = pTemp;
2909 This->pCurrentAdapter->NewNs->Next =
NULL;
2916 This->pCurrentAdapter->DnsDhcpEnabled =
TRUE;
2919 if (
This->pCurrentAdapter->NewNs)
2921 IP_ADDR * pNextNs =
This->pCurrentAdapter->NewNs->Next;
2923 This->pCurrentAdapter->NewNs = pNextNs;
2963 if (
This->pCurrentAdapter->NewDhcpEnabled)
2975 if (
This->pCurrentAdapter->NewIp)
2983 if (
This->pCurrentAdapter->NewGw &&
This->pCurrentAdapter->NewGw->IpAddress)
2990 if (
This->pCurrentAdapter->DnsDhcpEnabled)
3001 if (
This->pCurrentAdapter->NewNs)
3004 if (
This->pCurrentAdapter->NewNs->Next)
3058 if (szMetric && szMetric[0] !=
L'\0')
3061 szMetric +=
wcslen(szMetric) + 1;
3071 pCurrent = pCurrent->
Next;
3101 if (
This->pCurrentAdapter)
3207 if (
This->pTcpIpSettings)
3209 if (
This->pTcpIpSettings->szSearchList)
3215 while (
This->pAdapterListHead)
3217 pAdapter =
This->pAdapterListHead;
3220 while (pAdapter->
NewIp)
3224 pAdapter->
NewIp = NextIp;
3227 while (pAdapter->
OldIp)
3231 pAdapter->
OldIp = NextIp;
3235 while (pAdapter->
NewGw)
3239 pAdapter->
NewGw = NextIp;
3242 while (pAdapter->
OldGw)
3246 pAdapter->
OldGw = NextIp;
3250 while (pAdapter->
NewNs)
3254 pAdapter->
NewNs = NextIp;
3257 while (pAdapter->
OldNs)
3261 pAdapter->
OldNs = NextIp;
3274 This->pAdapterListHead = pAdapter->
pNext;
3290 pNew = pAdapter->
NewIp;
3291 pOld = pAdapter->
OldIp;
3292 while (pNew && pOld)
3305 if (Changed ==
FALSE)
3307 if (((pNew ==
NULL) && (pOld !=
NULL)) ||
3308 ((pNew !=
NULL) && (pOld ==
NULL)))
3323 pNew = pAdapter->
NewGw;
3324 pOld = pAdapter->
OldGw;
3325 while (pNew && pOld)
3338 if (Changed ==
FALSE)
3340 if (((pNew ==
NULL) && (pOld !=
NULL)) ||
3341 ((pNew !=
NULL) && (pOld ==
NULL)))
3356 pNew = pAdapter->
NewNs;
3357 pOld = pAdapter->
OldNs;
3358 while (pNew && pOld)
3370 if (Changed ==
FALSE)
3372 if (((pNew ==
NULL) && (pOld !=
NULL)) ||
3373 ((pNew !=
NULL) && (pOld ==
NULL)))
3387 INetCfgComponentPropertyUi *iface,
3391 TRACE(
"INetCfgComponentPropertyUi_fnQueryInterface()\n");
3399 INetCfgComponentPropertyUi *iface)
3401 TRACE(
"INetCfgComponentPropertyUi_fnAddRef()\n");
3409 INetCfgComponentPropertyUi *iface)
3411 TRACE(
"INetCfgComponentPropertyUi_fnRelease()\n");
3419 INetCfgComponentPropertyUi * iface,
3422 TRACE(
"INetCfgComponentPropertyUi_fnQueryPropertyUi()\n");
3429 INetCfgComponentPropertyUi * iface,
3432 TRACE(
"INetCfgComponentPropertyUi_fnSetContext()\n");
3433 INetLanConnectionUiInfo * pLanInfo;
3455 pAdapter =
This->pAdapterListHead;
3460 This->pCurrentAdapter = pAdapter;
3463 pAdapter = pAdapter->
pNext;
3549 This->pTcpIpSettings = pSettings;
3567 IP_ADDR *pNewAddrEntry, *pOldAddrEntry, *pNewLast =
NULL, *pOldLast =
NULL;
3577 if (pszBuffer ==
NULL)
3593 TRACE(
"RtlIpv4StringToAddressW Status 0x%08lx\n",
Status);
3609 pAdapter->
NewNs = pNewAddrEntry;
3611 pNewLast->
Next = pNewAddrEntry;
3613 pNewLast = pNewAddrEntry;
3623 pAdapter->
OldNs = pOldAddrEntry;
3625 pOldLast->
Next = pOldAddrEntry;
3627 pOldLast = pOldAddrEntry;
3650 HKEY hAdapterKey =
NULL, hConfigKey;
3651 WCHAR szKeyName[200];
3661 _swprintf(szKeyName,
L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%s", pAdapterName);
3711 if (
This->pAdapterListHead ==
NULL)
3713 This->pAdapterListHead = pAdapter;
3714 This->pAdapterListTail = pAdapter;
3718 This->pAdapterListTail->pNext = pAdapter;
3719 pAdapter->
pPrev =
This->pAdapterListTail;
3720 This->pAdapterListTail = pAdapter;
3728 _swprintf(szKeyName,
L"SYSTEM\\CurrentControlSet\\Services\\DHCP\\Configurations\\Alternate_%s", pAdapterName);
3754 if (
This->pAdapterListHead)
3773 pCurrentAdapter = pInfo;
3774 while (pCurrentAdapter)
3776 szBuffer[0] =
L'\0';
3779 szBuffer[(
sizeof(szBuffer)/
sizeof(
WCHAR))-1] =
L'\0';
3782 TRACE(
"Adapter: %S\n", szBuffer);
3788 pCurrentAdapter = pCurrentAdapter->
Next;
3804 INetCfgComponentPropertyUi * iface,
3806 BYTE **pahpspPrivate,
3811 TRACE(
"INetCfgComponentPropertyUi_fnMergePropPages()\n");
3816 if (
This->pCurrentAdapter->NewDhcpEnabled)
3842 *pahpspPrivate = (
BYTE*)hppages;
3843 *pcPages = NumPages;
3851 INetCfgComponentPropertyUi * iface,
3854 TRACE(
"INetCfgComponentPropertyUi_fnValidateProperties()\n");
3861 INetCfgComponentPropertyUi * iface)
3863 TRACE(
"INetCfgComponentPropertyUi_fnApplyProperties()\n");
3870 INetCfgComponentPropertyUi * iface)
3872 TRACE(
"INetCfgComponentPropertyUi_fnCancelProperties()\n");
3896 INetCfgComponentControl *iface,
3900 TRACE(
"INetCfgComponentControl_fnQueryInterface()\n");
3914 *ppvObj = (
LPVOID*)&
This->lpVtblCompPropertyUi;
3926 *ppvObj = (
LPVOID*)&
This->lpVtblTcpipProperties;
3937 INetCfgComponentControl *iface)
3939 TRACE(
"INetCfgComponentControl_fnAddRef()\n");
3949 INetCfgComponentControl *iface)
3951 TRACE(
"INetCfgComponentControl_fnRelease()\n");
3966 INetCfgComponentControl *iface,
3967 INetCfgComponent *pIComp,
3971 TRACE(
"INetCfgComponentControl_fnInitialize()\n");
3975 This->pNCfg = pINetCfg;
3976 This->pNComp = pIComp;
3981 ERR(
"INetCfgComponentControl_fnInitialize failed\n");
3985 TRACE(
"INetCfgComponentControl_fnInitialize success\n");
4020 pTemp = pTemp->
Next;
4060 pStr +=
wcslen(pStr) + 1;
4062 pTemp = pTemp->
Next;
4073 INetCfgComponentControl * iface)
4076 WCHAR szBuffer[200];
4081 TRACE(
"INetCfgComponentControl_fnApplyRegistryChanges()\n");
4085 if (
This->pTcpIpSettings)
4099 pAdapter =
This->pAdapterListHead;
4102 _swprintf(szBuffer,
L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters\\Interfaces\\%s", pAdapter->
AdapterName);
4152 if (pAdapter->
NewGw)
4177 if (!pAdapter->
NewNs)
4194 if (pCurrentConfig->pFilter)
4196 if (pCurrentConfig->pFilter->szTCPAllowedPorts)
4199 (
LPBYTE)pCurrentConfig->pFilter->szTCPAllowedPorts,
4200 pCurrentConfig->pFilter->TCPSize);
4202 if (pCurrentConfig->pFilter->szUDPAllowedPorts)
4205 (
LPBYTE)pCurrentConfig->pFilter->szUDPAllowedPorts,
4206 pCurrentConfig->pFilter->UDPSize);
4208 if (pCurrentConfig->pFilter->szRawIPAllowedProtocols)
4211 (
LPBYTE)pCurrentConfig->pFilter->szRawIPAllowedProtocols,
4212 pCurrentConfig->pFilter->IPSize);
4220 if (pCurrentConfig->AltConfig.IpAddress == 0)
4233 _swprintf(pStr,
L"Alternate_%s", pAdapterName);
4238 _swprintf(szBuffer,
L"SYSTEM\\CurrentControlSet\\Services\\DHCP\\Configurations\\Alternate_%s", pAdapterName);
4251 pAdapter = pAdapter->
pNext;
4260 INetCfgComponentControl *iface,
4261 INetCfgPnpReconfigCallback *pICallback)
4264 DWORD DhcpApiVersion;
4268 TRACE(
"INetCfgComponentControl_fnApplyPnpChanges()\n");
4272 pAdapter =
This->pAdapterListHead;
4329 if (pIpForwardTable)
4346 if (pAdapter->
NewGw)
4379 SC_HANDLE hManager, hService;
4382 TRACE(
"Notify the dnscache service!\n");
4398 pAdapter = pAdapter->
pNext;
4407 INetCfgComponentControl * iface)
4409 TRACE(
"INetCfgComponentControl_fnCancelChanges()\n");
4432 INetCfgComponentSetup *iface,
4436 TRACE(
"INetCfgComponentSetup_fnQueryInterface()\n");
4444 INetCfgComponentSetup *iface)
4446 TRACE(
"INetCfgComponentSetup_fnAddRef()\n");
4454 INetCfgComponentSetup *iface)
4456 TRACE(
"INetCfgComponentSetup_fnRelease()\n");
4464 INetCfgComponentSetup *iface,
4467 TRACE(
"INetCfgComponentSetup_fnInstall()\n");
4474 INetCfgComponentSetup *iface,
4476 DWORD dwUpgradeFromBuildNo)
4478 TRACE(
"INetCfgComponentSetup_fnUpgrade()\n");
4485 INetCfgComponentSetup *iface,
4489 TRACE(
"INetCfgComponentSetup_fnReadAnswerFile()\n");
4496 INetCfgComponentSetup *iface)
4498 TRACE(
"INetCfgComponentSetup_fnRemoving()\n");
4521 ITcpipProperties *iface,
4525 TRACE(
"ITcpipProperties_fnQueryInterface()\n");
4533 ITcpipProperties *iface)
4535 TRACE(
"ITcpipProperties_fnAddRef()\n");
4543 ITcpipProperties *iface)
4545 TRACE(
"ITcpipProperties_fnRelease()\n");
4553 ITcpipProperties *iface,
4566 ERR(
"ITcpipProperties_fnUnknown1(%s %p)\n",
wine_dbgstr_guid(pAdapterName), ppProperties);
4570 if (pAdapter ==
NULL)
4578 TRACE(
"IpAddress string: %S\n", pszIpAddress);
4585 TRACE(
"SubnetMask string: %S\n", pszSubnetMask);
4592 TRACE(
"Parameters string: %S\n", pszParameters);
4600 if (pProperties ==
NULL)
4610 pPtr = (
PWSTR)(pProperties + 1);
4614 pPtr += (
wcslen(pszIpAddress) + 1);
4618 pPtr += (
wcslen(pszSubnetMask) + 1);
4623 *ppProperties = pProperties;
#define InterlockedIncrement
#define InterlockedDecrement
static void AddButton(HWND hwndToolBar, int nImage, int nCommand)
static SERVICE_STATUS ServiceStatus
#define RegCloseKey(hKey)
#define ERROR_INSUFFICIENT_BUFFER
DWORD APIENTRY DhcpCApiInitialize(_Out_ LPDWORD Version)
DWORD APIENTRY DhcpStaticRefreshParams(DWORD AdapterIndex, DWORD Address, DWORD Netmask)
VOID APIENTRY DhcpCApiCleanup(VOID)
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)
HRESULT WINAPI StringFromCLSID(REFCLSID clsid, LPOLESTR *str)
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage)
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage)
#define GetProcAddress(x, y)
#define MultiByteToWideChar
_ACRTIMP int __cdecl _scwprintf(const wchar_t *,...)
_ACRTIMP int __cdecl _wtoi(const wchar_t *)
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
HINSTANCE netcfgx_hInstance
#define IDS_TCPFILTERDESC
#define IDS_DISABLE_FILTER
#define IDD_TCPIP_ADVOPT_DLG
#define IDC_DNSSUFFIXLIST
#define IDD_TCPIPADDIP_DLG
#define IDC_DNSSUFFIXDOWN
#define IDD_TCPIP_ALTCF_DLG
#define IDD_TCPIP_FILTER_DLG
#define IDD_TCPIP_ADVIP_DLG
#define IDS_DOMAIN_SUFFIX
#define IDC_UDP_ALLOW_ALL
#define IDC_TCP_ALLOW_ALL
#define IDS_NO_SUBMASK_SET
#define IDD_TCPIP_BASIC_DLG
#define IDD_TCPIPSUFFIX_DLG
#define IDD_TCPIP_ADVDNS_DLG
#define IDC_ALTSUBNETMASK
#define IDS_NO_IPADDR_SET
#define IDC_TOPPRIMSUFFIX
#define IDD_TCPIP_PORT_DLG
#define IDC_ALTDEFGATEWAY
PWDF_CHILD_ADDRESS_DESCRIPTION_HEADER pAddr
DWORD WINAPI AddIPAddress(IPAddr Address, IPMask Netmask, DWORD IfIndex, PULONG NteContext, PULONG NteInstance)
DWORD WINAPI GetIpForwardTable(PMIB_IPFORWARDTABLE pIpForwardTable, PULONG pdwSize, BOOL bOrder)
DWORD WINAPI DeleteIpForwardEntry(PMIB_IPFORWARDROW pRoute)
DWORD WINAPI GetAdaptersInfo(PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen)
DWORD WINAPI CreateIpForwardEntry(PMIB_IPFORWARDROW pRoute)
DWORD WINAPI DeleteIPAddress(ULONG NTEContext)
struct _MIB_IPFORWARDTABLE * PMIB_IPFORWARDTABLE
#define RtlEqualMemory(dst, src, len)
TCHAR szTitle[MAX_LOADSTRING]
void *WINAPI CoTaskMemAlloc(SIZE_T size)
void WINAPI CoTaskMemFree(void *ptr)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define _swprintf(buf, format,...)
struct _PSP * HPROPSHEETPAGE
NTSYSAPI PWSTR NTAPI RtlIpv4AddressToStringW(_In_ const struct in_addr *Addr, _Out_writes_(16) PWCHAR S)
NTSYSAPI NTSTATUS NTAPI RtlIpv4StringToAddressW(_In_ PCWSTR String, _In_ BOOLEAN Strict, _Out_ PCWSTR *Terminator, _Out_ struct in_addr *Addr)
EXTERN_C const IID IID_INetCfgComponentPropertyUi
EXTERN_C const IID IID_INetCfgComponentControl
EXTERN_C const IID IID_INetLanConnectionUiInfo
#define INetCfgComponentControl_QueryInterface(p, a, b)
#define INetCfgComponentControl_Release(p)
EXTERN_C const IID IID_INetCfgComponentSetup
#define INetCfgComponentControl_AddRef(p)
#define INetLanConnectionUiInfo_GetDeviceGuid(p, a)
struct _TCPIP_PROPERTIES TCPIP_PROPERTIES
EXTERN_C const IID IID_ITcpipProperties
_In_ ULONG _In_ ULONG _In_ ULONG Length
static const WCHAR szName[]
#define PropSheet_Changed(d, w)
struct _PROPSHEETPAGEW PROPSHEETPAGEW
struct _PROPSHEETHEADERW PROPSHEETHEADERW
struct _PSHNOTIFY * LPPSHNOTIFY
#define FOURTH_IPADDRESS(x)
struct tagNMIPADDRESS * LPNMIPADDRESS
#define MAKEIPADDRESS(b1, b2, b3, b4)
#define FIRST_IPADDRESS(x)
#define MAKEIPRANGE(low, high)
#define ListView_GetItemCount(hwnd)
#define SECOND_IPADDRESS(x)
struct tagNMLISTVIEW * LPNMLISTVIEW
#define LVM_INSERTCOLUMNW
#define THIRD_IPADDRESS(x)
#define ListView_DeleteItem(hwnd, i)
#define IsEqualGUID(rguid1, rguid2)
#define IsEqualIID(riid1, riid2)
#define SERVICE_CONTROL_PARAMCHANGE
#define SC_MANAGER_CONNECT
#define SERVICE_PAUSE_CONTINUE
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
BOOL WINAPI ControlService(SC_HANDLE hService, DWORD dwControl, LPSERVICE_STATUS lpServiceStatus)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
static __inline const char * wine_dbgstr_guid(const GUID *id)
AdapterSettings * pAdapterListHead
TcpipSettings * pTcpIpSettings
INetCfgComponent * pNComp
const ITcpipProperties * lpVtblTcpipProperties
AdapterSettings * pCurrentAdapter
const INetCfgComponentControl * lpVtbl
const INetCfgComponentSetup * lpVtblCompSetup
const INetCfgComponentPropertyUi * lpVtblCompPropertyUi
AdapterSettings * pAdapterListTail
DWORD UseDomainNameDevolution
DWORD EnableSecurityFilters
DWORD NewRegisterAdapterName
DWORD OldRegistrationEnabled
DWORD OldRegisterAdapterName
DWORD NewRegistrationEnabled
AlternateConfiguration AltConfig
LPWSTR szRawIPAllowedProtocols
struct _AdapterSettings * pNext
struct _AdapterSettings * pPrev
struct _IP_ADAPTER_INFO * Next
IP_ADDR_STRING IpAddressList
char AdapterName[MAX_ADAPTER_NAME_LENGTH+4]
IP_ADDR_STRING GatewayList
struct _IP_ADDR_STRING * Next
IP_ADDRESS_STRING IpAddress
IF_INDEX dwForwardIfIndex
MIB_IPFORWARDROW table[1]
struct _SINGLE_LIST_ENTRY * Next
INT_PTR CALLBACK TcpipFilterSettingsDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
HPROPSHEETPAGE InitializePropertySheetPage(LPWSTR resname, DLGPROC dlgproc, LPARAM lParam, LPWSTR szTitle)
HRESULT ParseNameServer(HKEY hAdapterKey, AdapterSettings *pAdapter)
HRESULT WINAPI INetCfgComponentPropertyUi_fnCancelProperties(INetCfgComponentPropertyUi *iface)
HRESULT WINAPI ITcpipProperties_fnQueryInterface(ITcpipProperties *iface, REFIID iid, LPVOID *ppvObj)
struct tagIP_ADDR IP_ADDR
HRESULT CopyIpAddrString(IP_ADDR_STRING *pSrc, IP_ADDR **pTarget, COPY_TYPE Type, LPWSTR szMetric)
HRESULT WINAPI INetCfgComponentPropertyUi_fnMergePropPages(INetCfgComponentPropertyUi *iface, DWORD *pdwDefPages, BYTE **pahpspPrivate, UINT *pcPages, HWND hwndParent, LPCWSTR *pszStartPage)
#define IP_STRING_MAX_LENGTH
UINT GetIpAddressFromStringW(WCHAR *szBuffer)
static HRESULT BuildIpAddressString(AdapterSettings *pAdapter, LPWSTR *ppszIpAddress)
VOID DisplayError(UINT ResTxt, UINT ResTitle, UINT Type)
static BOOL NameServersChanged(AdapterSettings *pAdapter)
VOID InitializeTcpipAdvancedIpDlg(HWND hwndDlg, TcpipConfNotifyImpl *This)
HRESULT WINAPI INetCfgComponentControl_fnQueryInterface(INetCfgComponentControl *iface, REFIID iid, LPVOID *ppvObj)
HRESULT LoadAdapterSettings(TcpipConfNotifyImpl *This, LPOLESTR pAdapterName, IP_ADAPTER_INFO *pAdapterInfo)
VOID FreeIPAddr(IP_ADDR *pAddr)
LPWSTR LoadTcpFilterSettingsFromRegistry(HKEY hKey, LPCWSTR szName, LPDWORD Size)
VOID InsertIpAddressToListView(HWND hDlgCtrl, IP_ADDR *pAddr, BOOL bSubMask)
VOID StoreIPSettings(HWND hDlgCtrl, TcpipConfNotifyImpl *This, BOOL bSubmask)
VOID LaunchAdvancedTcpipSettings(HWND hwndDlg, TcpipConfNotifyImpl *This)
LPWSTR CreateFilterList(HWND hDlgCtrl, LPDWORD Size)
VOID DeleteItemFromList(HWND hDlgCtrl)
BOOL GetGWListEntry(HWND hDlgCtrl, INT Index, TcpipGwSettings *pGwSettings)
struct _AdapterSettings AdapterSettings
ULONG WINAPI ITcpipProperties_fnAddRef(ITcpipProperties *iface)
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
VOID AddAlternativeDialog(HWND hDlg, TcpipConfNotifyImpl *This)
HRESULT WINAPI INetCfgComponentPropertyUi_fnQueryPropertyUi(INetCfgComponentPropertyUi *iface, IUnknown *pUnkReserved)
static VOID DelItem(HWND hDlgCtrl)
static __inline LPTcpipConfNotifyImpl impl_from_ITcpipProperties(ITcpipProperties *iface)
HRESULT InitializeTcpipAltDlgCtrls(HWND hwndDlg, TcpipConfNotifyImpl *This)
ULONG WINAPI INetCfgComponentSetup_fnAddRef(INetCfgComponentSetup *iface)
UINT GetIpAddressFromStringA(char *sBuffer)
INT_PTR CALLBACK TcpipAdvancedDnsDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
HRESULT LoadTcpipSettings(TcpipConfNotifyImpl *This)
static BOOL IpAddressesChanged(AdapterSettings *pAdapter)
static const ITcpipPropertiesVtbl vt_TcpipProperties
HRESULT WINAPI INetCfgComponentControl_fnCancelChanges(INetCfgComponentControl *iface)
HRESULT WINAPI INetCfgComponentSetup_fnInstall(INetCfgComponentSetup *iface, DWORD dwSetupFlags)
HRESULT WINAPI INetCfgComponentControl_fnInitialize(INetCfgComponentControl *iface, INetCfgComponent *pIComp, INetCfg *pINetCfg, BOOL fInstalling)
BOOL VerifyDNSSuffix(LPWSTR szName)
static HRESULT BuildParametersString(AdapterSettings *pAdapter, LPWSTR *ppszParameters)
VOID InsertColumnToListView(HWND hDlgCtrl, UINT ResId, UINT SubItem, UINT Size)
VOID FreeSettings(TcpipConfNotifyImpl *This)
HRESULT InitializeTcpipBasicDlgCtrls(HWND hwndDlg, TcpipConfNotifyImpl *This)
VOID MoveItem(HWND hDlgCtrl, INT pos)
HRESULT WINAPI INetCfgComponentControl_fnApplyPnpChanges(INetCfgComponentControl *iface, INetCfgPnpReconfigCallback *pICallback)
#define IP_STRING_MIN_LENGTH
INT GetSelectedItem(HWND hDlgCtrl)
HRESULT WINAPI INetCfgComponentSetup_fnUpgrade(INetCfgComponentSetup *iface, DWORD dwSetupFlags, DWORD dwUpgradeFromBuildNo)
HRESULT WINAPI INetCfgComponentSetup_fnRemoving(INetCfgComponentSetup *iface)
ULONG WINAPI INetCfgComponentPropertyUi_fnAddRef(INetCfgComponentPropertyUi *iface)
INT_PTR CALLBACK TcpipFilterPortDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
DWORD(WINAPI * PDHCPFALLBACKREFRESHPARAMS)(PWSTR pAdapterName)
ULONG WINAPI INetCfgComponentSetup_fnRelease(INetCfgComponentSetup *iface)
BOOL GetListViewItem(HWND hDlgCtrl, UINT Index, UINT SubIndex, WCHAR *szBuffer, UINT BufferSize)
HRESULT WINAPI INetCfgComponentPropertyUi_fnApplyProperties(INetCfgComponentPropertyUi *iface)
HRESULT WINAPI INetCfgComponentPropertyUi_fnSetContext(INetCfgComponentPropertyUi *iface, IUnknown *pUnkReserved)
VOID RemoveItem(HWND hDlgCtrl)
static BOOL GatewaysChanged(AdapterSettings *pAdapter)
static LPWSTR CreateMultiSzString(IP_ADDR *pAddr, COPY_TYPE Type, LPDWORD Size, BOOL bComma)
INT_PTR CALLBACK TcpipAddSuffixDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK TcpipAdvancedOptDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR StoreTcpipBasicSettings(HWND hwndDlg, TcpipConfNotifyImpl *This, BOOL bApply)
HRESULT WINAPI INetCfgComponentPropertyUi_fnValidateProperties(INetCfgComponentPropertyUi *iface, HWND hwndDlg)
HRESULT WINAPI INetCfgComponentPropertyUi_fnQueryInterface(INetCfgComponentPropertyUi *iface, REFIID iid, LPVOID *ppvObj)
static HRESULT BuildSubnetMaskString(AdapterSettings *pAdapter, LPWSTR *ppszSubnetMask)
ULONG WINAPI INetCfgComponentPropertyUi_fnRelease(INetCfgComponentPropertyUi *iface)
HRESULT WINAPI INetCfgComponentSetup_fnReadAnswerFile(INetCfgComponentSetup *iface, LPCWSTR pszwAnswerFile, LPCWSTR pszwAnswerSections)
static AdapterSettings * GetAdapterByGuid(TcpipConfNotifyImpl *This, GUID *pAdapterGuid)
static const INetCfgComponentSetupVtbl vt_NetCfgComponentSetup
static const INetCfgComponentControlVtbl vt_NetCfgComponentControl
VOID InitializeTcpipAdvancedDNSDlg(HWND hwndDlg, TcpipConfNotifyImpl *This)
HRESULT WINAPI ITcpipProperties_fnUnknown1(ITcpipProperties *iface, GUID *pAdapterName, PTCPIP_PROPERTIES *ppProperties)
INT_PTR CALLBACK TcpipAdvancedIpDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR StoreTcpipAlternateSettings(HWND hwndDlg, TcpipConfNotifyImpl *This, BOOL bApply)
VOID InitFilterListBox(LPWSTR pData, HWND hwndDlg, HWND hDlgCtrl, UINT AllowButton, UINT RestrictButton, UINT AddButton, UINT DelButton)
VOID StoreDNSSettings(HWND hDlgCtrl, TcpipConfNotifyImpl *This)
INT_PTR CALLBACK TcpipAltConfDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID ToggleUpDown(HWND hwndDlg, HWND hDlgCtrl, UINT UpButton, UINT DownButton, UINT ModButton, UINT DelButton)
HRESULT WINAPI INetCfgComponentSetup_fnQueryInterface(INetCfgComponentSetup *iface, REFIID iid, LPVOID *ppvObj)
INT_PTR CALLBACK TcpipAddDNSDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
VOID InitializeTcpipAdvancedOptDlg(HWND hwndDlg, TcpipConfNotifyImpl *This)
static const INetCfgComponentPropertyUiVtbl vt_NetCfgComponentPropertyUi
ULONG WINAPI INetCfgComponentControl_fnRelease(INetCfgComponentControl *iface)
static __inline LPTcpipConfNotifyImpl impl_from_INetCfgComponentSetup(INetCfgComponentSetup *iface)
INT_PTR CALLBACK TcpipAddIpDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
HRESULT WINAPI TcpipConfigNotify_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
ULONG WINAPI INetCfgComponentControl_fnAddRef(INetCfgComponentControl *iface)
HRESULT WINAPI INetCfgComponentControl_fnApplyRegistryChanges(INetCfgComponentControl *iface)
LPWSTR GetListViewEntries(HWND hDlgCtrl)
BOOL GetIPListEntry(HWND hDlgCtrl, INT Index, TcpipIpSettings *pIpSettings)
INT_PTR CALLBACK TcpipAdvGwDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
INT_PTR CALLBACK TcpipBasicDlg(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static __inline LPTcpipConfNotifyImpl impl_from_INetCfgComponentPropertyUi(INetCfgComponentPropertyUi *iface)
struct TcpipConfNotifyImpl * LPTcpipConfNotifyImpl
ULONG WINAPI ITcpipProperties_fnRelease(ITcpipProperties *iface)
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
#define FIELD_OFFSET(t, f)
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
WINBASEAPI _In_ DWORD nLength
#define ERROR_BUFFER_OVERFLOW
#define HKEY_LOCAL_MACHINE
BOOL WINAPI CheckDlgButton(_In_ HWND, _In_ int, _In_ UINT)
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)
UINT WINAPI IsDlgButtonChecked(_In_ HWND, _In_ int)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetDlgItemInt(_In_ HWND, _In_ int, _In_ UINT, _In_ BOOL)
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI CheckRadioButton(_In_ HWND, _In_ int, _In_ int, _In_ int)
#define MB_ICONINFORMATION
UINT WINAPI GetDlgItemInt(_In_ HWND, _In_ int, _Out_opt_ PBOOL, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
#define SendDlgItemMessage
LRESULT WINAPI SendDlgItemMessageA(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)