[ros-diffs] [hpoussin] 18777: Fix some corner-cases (no .inf file in provided directory when creating driver list, or no suitable driver when destroying driver list)

hpoussin at svn.reactos.com hpoussin at svn.reactos.com
Wed Oct 26 20:19:24 CEST 2005


Fix some corner-cases (no .inf file in provided directory when creating
driver list, or no suitable driver when destroying driver list)
Modified: trunk/reactos/lib/setupapi/devinst.c
  _____  

Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c	2005-10-26 12:47:22 UTC
(rev 18776)
+++ trunk/reactos/lib/setupapi/devinst.c	2005-10-26 18:19:20 UTC
(rev 18777)
@@ -4314,6 +4314,14 @@

                 Buffer, RequiredSize,
                 &RequiredSize);
         }
+        if (!Result && GetLastError() == ERROR_FILE_NOT_FOUND)
+        {
+            /* No .inf file in specified directory. So, we should
+             * success as we created an empty driver info list.
+             */
+            ret = TRUE;
+            goto done;
+        }
         if (Result)
         {
             LPCWSTR filename;
@@ -4604,18 +4612,6 @@
         if (!DeviceInfoData)
             /* Fall back to destroying class driver list */
             DriverType = SPDIT_CLASSDRIVER;
-        if (DriverType == SPDIT_CLASSDRIVER)
-        {
-            if (!(InstallParams.Flags & DI_DIDCLASS))
-                /* The list was not created */
-                goto done;
-        }
-        else if (DriverType == SPDIT_COMPATDRIVER)
-        {
-            if (!(InstallParams.Flags & DI_DIDCOMPAT))
-                /* The list was not created */
-                goto done;
-        }
 
         if (DriverType == SPDIT_CLASSDRIVER)
         {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051026/3f5c64b6/attachment.html


More information about the Ros-diffs mailing list