fix SetLastError value ERROR_MORE_DATA -> ERROR_INSUFFICIENT_BUFFER
Modified: trunk/reactos/lib/setupapi/devinst.c

Modified: trunk/reactos/lib/setupapi/devinst.c
--- trunk/reactos/lib/setupapi/devinst.c	2005-10-21 21:16:36 UTC (rev 18667)
+++ trunk/reactos/lib/setupapi/devinst.c	2005-10-21 23:40:09 UTC (rev 18668)
@@ -2153,7 +2153,7 @@
         PropertyBufferSizeW,
         &RequiredSizeW);
 
-    if (bResult || GetLastError() == ERROR_MORE_DATA)
+    if (bResult || GetLastError() == ERROR_INSUFFICIENT_BUFFER)
     {
         bIsStringProperty = (RegType == REG_SZ || RegType == REG_MULTI_SZ || RegType == REG_EXPAND_SZ);
 
@@ -2327,10 +2327,16 @@
                     &BufferSize);
                 if (RequiredSize)
                     *RequiredSize = BufferSize;
-                if (rc == ERROR_SUCCESS)
-                    ret = TRUE;
-                else
-                    SetLastError(rc);
+                switch(rc) {
+                    case ERROR_SUCCESS:
+                        ret = TRUE;
+                        break;
+                    case ERROR_MORE_DATA:  
+                        SetLastError(ERROR_INSUFFICIENT_BUFFER);
+			break;
+                    default:
+                        SetLastError(rc);
+                }
                 RegCloseKey(hKey);
                 break;
             }