- Fix epic naming fail (DhcpEnabled -> EnableDHCP
[reactos.git] / reactos / dll / win32 / netcfgx / netcfgx.c
index ba89dff..1fb9fc1 100644 (file)
@@ -290,6 +290,7 @@ InstallAdditionalServices(
        IN HWND hWnd)
 {
        BOOL ret;
+       UNICODE_STRING TcpipServicePath = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Tcpip");
 
        /* Install TCP/IP protocol */
        ret = InstallInfSection(
@@ -302,6 +303,17 @@ InstallAdditionalServices(
                DPRINT("InstallInfSection() failed with error 0x%lx\n", GetLastError());
                return GetLastError();
        }
+       else if (ret)
+       {
+               /* Start the TCP/IP driver */
+               ret = NtLoadDriver(&TcpipServicePath);
+               if (ret)
+               {
+                       /* This isn't really fatal but we want to warn anyway */
+                       DPRINT1("NtLoadDriver(TCPIP) failed with NTSTATUS 0x%lx\n", (NTSTATUS)ret);
+               }
+       }
+        
 
        /* You can add here more clients (SMB...) and services (DHCP server...) */
 
@@ -324,7 +336,7 @@ InstallNetDevice(
        HKEY hNetworkKey = NULL;
        HKEY hLinkageKey = NULL;
        HKEY hConnectionKey = NULL;
-       DWORD dwShowIcon, dwLength;
+       DWORD dwShowIcon, dwLength, dwValue;
 
        /* Get Instance ID */
        if (SetupDiGetDeviceInstanceIdW(DeviceInfoSet, DeviceInfoData, NULL, 0, &dwLength))
@@ -410,6 +422,13 @@ InstallNetDevice(
                DPRINT("RegSetValueExW() failed with error 0x%lx\n", rc);
                goto cleanup;
        }
+        dwValue = 1;
+       rc = RegSetValueExW(hKey, L"EnableDHCP", 0, REG_DWORD, (const BYTE*)&dwValue, sizeof(DWORD));
+       if (rc != ERROR_SUCCESS)
+       {
+               DPRINT("RegSetValueExW() failed with error 0x%lx\n", rc);
+               goto cleanup;
+       }
        RegCloseKey(hKey);
        hKey = NULL;