The GroupOrder registry value should start with a ULONG containing the number
authorGé van Geldorp <ge@gse.nl>
Fri, 11 Nov 2005 21:39:57 +0000 (21:39 +0000)
committerGé van Geldorp <ge@gse.nl>
Fri, 11 Nov 2005 21:39:57 +0000 (21:39 +0000)
of entries following it.

svn path=/trunk/; revision=19150

reactos/lib/setupapi/install.c

index bdd13cc..8dcacca 100644 (file)
@@ -1212,7 +1212,7 @@ BOOL WINAPI SetupInstallServicesFromInfSectionExW( HINF hinf, PCWSTR sectionname
             }
             rc = RegQueryValueExW(hGroupOrderListKey, lpLoadOrderGroup, NULL, &dwRegType, NULL, &bufferSize);
             if (rc == ERROR_FILE_NOT_FOUND)
-                bufferSize = 0;
+                bufferSize = sizeof(DWORD);
             else if (rc != ERROR_SUCCESS)
             {
                 SetLastError(rc);
@@ -1246,10 +1246,17 @@ BOOL WINAPI SetupInstallServicesFromInfSectionExW( HINF hinf, PCWSTR sectionname
                     goto cleanup;
                 }
             }
+            else
+            {
+                GroupOrder[0] = 0;
+            }
             if (flags & SPSVCINST_TAGTOFRONT)
-                GroupOrder[0] = tagId;
+                GroupOrder[1] = tagId;
             else
+            {
+                GroupOrder[0]++;
                 GroupOrder[bufferSize / sizeof(DWORD)] = tagId;
+            }
 
             rc = RegSetValueExW(
                 hGroupOrderListKey,