mirror of
https://github.com/reactos/reactos.git
synced 2026-06-20 02:17:31 +08:00
[NETCFGX] Fix alternate configuration TCP/IP dialog
Gateway and name server ip address controls must only be enabled and initialized when a non-APIPA configuration has been selected.
This commit is contained in:
@@ -2207,8 +2207,6 @@ InitializeTcpipAltDlgCtrls(
|
||||
else
|
||||
{
|
||||
CheckRadioButton(hwndDlg, IDC_USEDHCP, IDC_NODHCP, IDC_NODHCP);
|
||||
EnableWindow(GetDlgItem(hwndDlg, IDC_DNS1), TRUE);
|
||||
EnableWindow(GetDlgItem(hwndDlg, IDC_DNS2), TRUE);
|
||||
|
||||
if (pCurSettings->Ip)
|
||||
{
|
||||
@@ -2217,26 +2215,20 @@ InitializeTcpipAltDlgCtrls(
|
||||
/* Set current hostmask */
|
||||
SendDlgItemMessageA(hwndDlg, IDC_SUBNETMASK, IPM_SETADDRESS, 0, (LPARAM)pCurSettings->Ip->u.Subnetmask);
|
||||
}
|
||||
}
|
||||
|
||||
if (pCurSettings->Gw && pCurSettings->Gw->IpAddress)
|
||||
{
|
||||
/* Set current gateway */
|
||||
SendDlgItemMessageA(hwndDlg, IDC_DEFGATEWAY, IPM_SETADDRESS, 0, (LPARAM)pCurSettings->Gw->IpAddress);
|
||||
}
|
||||
if (pCurSettings->Gw && pCurSettings->Gw->IpAddress)
|
||||
{
|
||||
/* Set current gateway */
|
||||
SendDlgItemMessageA(hwndDlg, IDC_DEFGATEWAY, IPM_SETADDRESS, 0, (LPARAM)pCurSettings->Gw->IpAddress);
|
||||
}
|
||||
|
||||
if (pCurSettings->Ns)
|
||||
{
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS1, IPM_SETADDRESS, 0, (LPARAM)pCurSettings->Ns->IpAddress);
|
||||
if (pCurSettings->Ns->Next)
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS2, IPM_SETADDRESS, 0, (LPARAM)pCurSettings->Ns->Next->IpAddress);
|
||||
else
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS2, IPM_CLEARADDRESS, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS1, IPM_CLEARADDRESS, 0, 0);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS2, IPM_CLEARADDRESS, 0, 0);
|
||||
if (pCurSettings->Ns)
|
||||
{
|
||||
/* Set name server addresses */
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS1, IPM_SETADDRESS, 0, (LPARAM)pCurSettings->Ns->IpAddress);
|
||||
if (pCurSettings->Ns->Next)
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS2, IPM_SETADDRESS, 0, (LPARAM)pCurSettings->Ns->Next->IpAddress);
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
@@ -2280,6 +2272,8 @@ TcpipAltConfDlg(
|
||||
SendDlgItemMessageW(hwndDlg, IDC_IPADDR, IPM_CLEARADDRESS, 0, 0);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_SUBNETMASK, IPM_CLEARADDRESS, 0, 0);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DEFGATEWAY, IPM_CLEARADDRESS, 0, 0);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS1, IPM_CLEARADDRESS, 0, 0);
|
||||
SendDlgItemMessageW(hwndDlg, IDC_DNS2, IPM_CLEARADDRESS, 0, 0);
|
||||
}
|
||||
|
||||
EnableWindow(GetDlgItem(hwndDlg, IDC_IPADDR), bNoDHCP);
|
||||
|
||||
Reference in New Issue
Block a user