Invalidate the start value if start key doesn't exist.
authorHartmut Birr <osexpert@googlemail.com>
Sun, 16 Oct 2005 14:24:11 +0000 (14:24 +0000)
committerHartmut Birr <osexpert@googlemail.com>
Sun, 16 Oct 2005 14:24:11 +0000 (14:24 +0000)
svn path=/trunk/; revision=18498

reactos/boot/freeldr/freeldr/reactos/reactos.c

index d6f6813..f3c37d8 100644 (file)
@@ -439,6 +439,7 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
                 /* Read the Start Value */
                 ValueSize = sizeof(ULONG);
                 rc = RegQueryValue(hDriverKey, "Start", &ValueType, (PUCHAR)&StartValue, &ValueSize);
                 /* Read the Start Value */
                 ValueSize = sizeof(ULONG);
                 rc = RegQueryValue(hDriverKey, "Start", &ValueType, (PUCHAR)&StartValue, &ValueSize);
+               if (rc != ERROR_SUCCESS) StartValue = (ULONG)-1;
                 DbgPrint((DPRINT_REACTOS, "  Start: %x  \n", (int)StartValue));
 
                 /* Read the Tag */
                 DbgPrint((DPRINT_REACTOS, "  Start: %x  \n", (int)StartValue));
 
                 /* Read the Tag */
@@ -486,7 +487,7 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
                 } else {
 
                     DbgPrint((DPRINT_REACTOS, "  Skipping driver '%s' with Start %d, Tag %d and Group '%s' (Current Tag %d, current group '%s')\n",
                 } else {
 
                     DbgPrint((DPRINT_REACTOS, "  Skipping driver '%s' with Start %d, Tag %d and Group '%s' (Current Tag %d, current group '%s')\n",
-                    ServiceName, StartValue, TagValue, DriverGroup, OrderList[TagIndex], GroupName));
+                             ServiceName, StartValue, TagValue, DriverGroup, OrderList[TagIndex], GroupName));
                 }
 
                 Index++;
                 }
 
                 Index++;
@@ -511,6 +512,7 @@ FrLdrLoadBootDrivers(PCHAR szSystemRoot,
             /* Read the Start Value */
             ValueSize = sizeof(ULONG);
             rc = RegQueryValue(hDriverKey, "Start", &ValueType, (PUCHAR)&StartValue, &ValueSize);
             /* Read the Start Value */
             ValueSize = sizeof(ULONG);
             rc = RegQueryValue(hDriverKey, "Start", &ValueType, (PUCHAR)&StartValue, &ValueSize);
+            if (rc != ERROR_SUCCESS) StartValue = (ULONG)-1;
             DbgPrint((DPRINT_REACTOS, "  Start: %x  \n", (int)StartValue));
 
             /* Read the Tag */
             DbgPrint((DPRINT_REACTOS, "  Start: %x  \n", (int)StartValue));
 
             /* Read the Tag */