[NETCFGX]
[reactos.git] / reactos / dll / win32 / netcfgx / netcfgx.c
index c9d8a45..175e208 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...) */
 
@@ -325,7 +337,6 @@ InstallNetDevice(
        HKEY hLinkageKey = NULL;
        HKEY hConnectionKey = NULL;
        DWORD dwShowIcon, dwLength;
-       SP_DEVINSTALL_PARAMS_W installParams;
 
        /* Get Instance ID */
        if (SetupDiGetDeviceInstanceIdW(DeviceInfoSet, DeviceInfoData, NULL, 0, &dwLength))
@@ -550,31 +561,6 @@ InstallNetDevice(
                goto cleanup;
        }
 
-       /* HACK: hpoussin, Dec 2005. TCP/IP driver is not able to manage devices
-        * which are installed after its startup. So, we have to reboot to take
-        * this new netcard into account.
-        */
-       /* Should we reboot? */
-       installParams.cbSize = sizeof(SP_DEVINSTALL_PARAMS_W);
-       if (!SetupDiGetDeviceInstallParamsW(
-               DeviceInfoSet,
-               DeviceInfoData,
-               &installParams))
-       {
-               rc = GetLastError();
-               DPRINT("SetupDiGetDeviceInstallParams() failed with error 0x%lx\n", rc);
-               goto cleanup;
-       }
-       installParams.Flags |= DI_NEEDRESTART;
-       if (!SetupDiSetDeviceInstallParamsW(
-               DeviceInfoSet,
-               DeviceInfoData,
-               &installParams))
-       {
-               rc = GetLastError();
-               DPRINT("SetupDiSetDeviceInstallParams() failed with error 0x%lx\n", rc);
-               goto cleanup;
-       }
        rc = ERROR_SUCCESS;
 
 cleanup: