Avoid attempts to reinstall a driver on reboot when a previous attempt has already...
[reactos.git] / reactos / base / services / umpnpmgr / umpnpmgr.c
index 35c3911..9bc4e4b 100644 (file)
@@ -21,7 +21,7 @@
  * PROJECT:          ReactOS kernel
  * FILE:             base/services/umpnpmgr/umpnpmgr.c
  * PURPOSE:          User-mode Plug and Play manager
- * PROGRAMMER:       Eric Kohl
+ * PROGRAMMER:       Eric Kohl (eric.kohl@reactos.org)
  *                   HervĂ© Poussineau (hpoussin@reactos.org)
  *                   Colin Finck (colin@reactos.org)
  */
@@ -3230,6 +3230,22 @@ InstallDevice(PCWSTR DeviceInstance, BOOL ShowWizard)
             return TRUE;
         }
 
+        BytesWritten = sizeof(DWORD);
+        if (RegQueryValueExW(DeviceKey,
+                             L"ConfigFlags",
+                             NULL,
+                             NULL,
+                             (PBYTE)&Value,
+                             &BytesWritten) == ERROR_SUCCESS)
+        {
+            if (Value & CONFIGFLAG_FAILEDINSTALL)
+            {
+                DPRINT("No need to install: %S\n", DeviceInstance);
+                RegCloseKey(DeviceKey);
+                return TRUE;
+            }
+        }
+
         RegCloseKey(DeviceKey);
     }