[ros-diffs] [weiden] 20384: minor error handling fixes

weiden at svn.reactos.com weiden at svn.reactos.com
Wed Dec 28 00:17:53 CET 2005


minor error handling fixes
Modified: trunk/reactos/lib/devmgr/advprop.c
  _____  

Modified: trunk/reactos/lib/devmgr/advprop.c
--- trunk/reactos/lib/devmgr/advprop.c	2005-12-27 23:05:34 UTC (rev
20383)
+++ trunk/reactos/lib/devmgr/advprop.c	2005-12-27 23:17:43 UTC (rev
20384)
@@ -808,17 +808,13 @@

                 else
                 {
                     /* cleanup, we were unable to get the device
property sheets */
+                    iPage = nDriverPages;
                     dap->nDevPropSheets -= nDriverPages;
                     nDriverPages = 0;
-                    if (dap->nDevPropSheets == 0)
-                    {
-                        HeapFree(GetProcessHeap(),
-                                 0,
-                                 dap->DevPropSheets);
-                        dap->DevPropSheets = NULL;
-                    }
                 }
             }
+            else
+                iPage = 0;
 
             /* add the driver page if necessary */
             if (dap->HasDriverPage)
@@ -841,6 +837,7 @@
                     else
                     {
 
dap->pDestroyPropertySheetPage(dap->DevPropSheets[iPage]);
+                        dap->DevPropSheets[iPage] = NULL;
                     }
                 }
             }
@@ -1105,7 +1102,7 @@
         DevIdSize = (DWORD)wcslen(lpDeviceID) + 1;
     }
 
-    if (lpMachineName != NULL)
+    if (lpMachineName != NULL && lpMachineName[0] != L'\0')
     {
         CONFIGRET cr = CM_Connect_Machine(lpMachineName,
                                           &hMachine);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20051228/9d68d615/attachment.html


More information about the Ros-diffs mailing list