[NETCFGX]
authorGregor Schneider <grschneider@gmail.com>
Sun, 25 Apr 2010 10:47:10 +0000 (10:47 +0000)
committerGregor Schneider <grschneider@gmail.com>
Sun, 25 Apr 2010 10:47:10 +0000 (10:47 +0000)
- Save DHCP and DNS settings from the basic TCP/IP panel independently of each other
See issue #5193 for more details.

svn path=/trunk/; revision=47010

reactos/dll/win32/netcfgx/tcpipconf_notify.c

index e582da4..14b9a4a 100644 (file)
@@ -3280,23 +3280,25 @@ INetCfgComponentControl_fnApplyRegistryChanges(
                 RegSetValueExW(hKey, L"DefaultGateway", 0, REG_MULTI_SZ, (LPBYTE)L"", 1 * sizeof(WCHAR));
                 RegSetValueExW(hKey, L"DefaultGatewayMetric", 0, REG_MULTI_SZ, (LPBYTE)L"\0", sizeof(WCHAR) * 2);
             }
+        }
 
-            if (!pCurrentConfig->Ns || pCurrentConfig->AutoconfigActive)
-            {
-                RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)L"", 1 * sizeof(WCHAR));
-            }
-            else
+        if (!pCurrentConfig->Ns || pCurrentConfig->AutoconfigActive)
+        {
+            RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)L"", 1 * sizeof(WCHAR));
+        }
+        else
+        {
+            pStr = CreateMultiSzString(pCurrentConfig->Ns, IPADDR, &dwSize, TRUE);
+            if(pStr)
             {
-                pStr = CreateMultiSzString(pCurrentConfig->Ns, IPADDR, &dwSize, TRUE);
-                if(pStr)
-                {
-                    RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)pStr, dwSize);
-                    RegDeleteValueW(hKey, L"DhcpNameServer");
-                    CoTaskMemFree(pStr);
-                }
+
+                RegSetValueExW(hKey, L"NameServer", 0, REG_SZ, (LPBYTE)pStr, dwSize);
+                RegDeleteValueW(hKey, L"DhcpNameServer");
+                CoTaskMemFree(pStr);
             }
-            RegCloseKey(hKey);
         }
+
+        RegCloseKey(hKey);
     }
     return S_OK;
 }