Commit in freeldr/freeldr on MAIN
include/version.h+2-21.44 -> 1.45
reactos/reactos.c+123-121.37 -> 1.38
CHANGELOG+51.42 -> 1.43
+130-14
3 modified files
- Implemented the driver loading by the sequence of tag entries in the GroupOrderList key.

freeldr/freeldr/include
version.h 1.44 -> 1.45
diff -u -r1.44 -r1.45
--- version.h	30 Aug 2004 10:50:39 -0000	1.44
+++ version.h	20 Sep 2004 18:02:32 -0000	1.45
@@ -22,7 +22,7 @@
 
 
 /* just some stuff */
-#define VERSION			"FreeLoader v1.8.23"
+#define VERSION			"FreeLoader v1.8.24"
 #define COPYRIGHT		"Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>"
 #define AUTHOR_EMAIL	"<brianp@sginet.com>"
 #define BY_AUTHOR		"by Brian Palmer"
@@ -36,7 +36,7 @@
 //
 #define FREELOADER_MAJOR_VERSION	1
 #define FREELOADER_MINOR_VERSION	8
-#define FREELOADER_PATCH_VERSION	23
+#define FREELOADER_PATCH_VERSION	24
 
 
 #ifndef ASM

freeldr/freeldr/reactos
reactos.c 1.37 -> 1.38
diff -u -r1.37 -r1.38
--- reactos.c	1 Sep 2004 00:37:29 -0000	1.37
+++ reactos.c	20 Sep 2004 18:02:36 -0000	1.38
@@ -227,16 +227,19 @@
 LoadBootDrivers(PCHAR szSystemRoot, int nPos)
 {
   S32 rc = 0;
-  HKEY hGroupKey, hServiceKey, hDriverKey;
-  char ValueBuffer[512];
+  HKEY hGroupKey, hOrderKey, hServiceKey, hDriverKey;
+  char GroupNameBuffer[512];
   char ServiceName[256];
+  U32 OrderList[128];
   U32 BufferSize;
   U32 Index;
+  U32 TagIndex;
   char *GroupName;
 
   U32 ValueSize;
   U32 ValueType;
   U32 StartValue;
+  U32 TagValue;
   UCHAR DriverGroup[256];
   U32 DriverGroupSize;
 
@@ -249,7 +252,17 @@
 		  &hGroupKey);
   if (rc != ERROR_SUCCESS)
     {
-      DbgPrint((DPRINT_REACTOS, "Failed to open the 'ServiceGroupOrder key (rc %d)\n", (int)rc));
+      DbgPrint((DPRINT_REACTOS, "Failed to open the 'ServiceGroupOrder' key (rc %d)\n", (int)rc));
+      return;
+    }
+  
+  /* get 'group order list' key */
+  rc = RegOpenKey(NULL,
+                  "\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\Control\\GroupOrderList",
+		  &hOrderKey);
+  if (rc != ERROR_SUCCESS)
+    {
+      DbgPrint((DPRINT_REACTOS, "Failed to open the 'GroupOrderList' key (rc %d)\n", (int)rc));
       return;
     }
 
@@ -263,26 +276,110 @@
       return;
     }
 
-  BufferSize = sizeof(ValueBuffer);
-  rc = RegQueryValue(hGroupKey, "List", NULL, (PUCHAR)ValueBuffer, &BufferSize);
+  BufferSize = sizeof(GroupNameBuffer);
+  rc = RegQueryValue(hGroupKey, "List", NULL, (PUCHAR)GroupNameBuffer, &BufferSize);
   DbgPrint((DPRINT_REACTOS, "RegQueryValue(): rc %d\n", (int)rc));
   if (rc != ERROR_SUCCESS)
     return;
 
   DbgPrint((DPRINT_REACTOS, "BufferSize: %d \n", (int)BufferSize));
 
-  DbgPrint((DPRINT_REACTOS, "ValueBuffer: '%s' \n", ValueBuffer));
+  DbgPrint((DPRINT_REACTOS, "GroupNameBuffer: '%s' \n", GroupNameBuffer));
 
-  GroupName = ValueBuffer;
+  GroupName = GroupNameBuffer;
   while (*GroupName)
     {
       DbgPrint((DPRINT_REACTOS, "Driver group: '%s'\n", GroupName));
 
-      /* enumerate all drivers */
+      BufferSize = sizeof(OrderList);
+      rc = RegQueryValue(hOrderKey, GroupName, NULL, (PUCHAR)OrderList, &BufferSize);
+      if (rc != ERROR_SUCCESS)
+        {
+	  OrderList[0] = 0;
+	}
+      
+      for (TagIndex = 1; TagIndex <= OrderList[0]; TagIndex++)
+        {
+	  /* enumerate all drivers */
+	  Index = 0;
+	  while (TRUE)
+	    {
+	      ValueSize = sizeof(ServiceName);
+	      rc = RegEnumKey(hServiceKey, Index, ServiceName, &ValueSize);
+	      DbgPrint((DPRINT_REACTOS, "RegEnumKey(): rc %d\n", (int)rc));
+	      if (rc == ERROR_NO_MORE_ITEMS)
+	        break;
+	      if (rc != ERROR_SUCCESS)
+	        return;
+	      DbgPrint((DPRINT_REACTOS, "Service %d: '%s'\n", (int)Index, ServiceName));
+
+	      /* open driver Key */
+	      rc = RegOpenKey(hServiceKey, ServiceName, &hDriverKey);
+
+	      ValueSize = sizeof(U32);
+	      rc = RegQueryValue(hDriverKey, "Start", &ValueType, (PUCHAR)&StartValue, &ValueSize);
+	      DbgPrint((DPRINT_REACTOS, "  Start: %x  \n", (int)StartValue));
+
+	      ValueSize = sizeof(U32);
+	      rc = RegQueryValue(hDriverKey, "Tag", &ValueType, (PUCHAR)&TagValue, &ValueSize);
+	      if (rc != ERROR_SUCCESS)
+	        {
+		  TagValue = (U32)-1;
+		}
+	      DbgPrint((DPRINT_REACTOS, "  Tag:   %x  \n", (int)TagValue));
+		  
+
+	      DriverGroupSize = 256;
+	      rc = RegQueryValue(hDriverKey, "Group", NULL, (PUCHAR)DriverGroup, &DriverGroupSize);
+	      DbgPrint((DPRINT_REACTOS, "  Group: '%s'  \n", DriverGroup));
+
+	      if ((StartValue == 0) && (TagValue == OrderList[TagIndex]) &&(stricmp(DriverGroup, GroupName) == 0))
+	        {
+	          ValueSize = 256;
+	          rc = RegQueryValue(hDriverKey,
+				     "ImagePath",
+				     NULL,
+				     (PUCHAR)TempImagePath,
+				     &ValueSize);
+	          if (rc != ERROR_SUCCESS)
+		    {
+		      DbgPrint((DPRINT_REACTOS, "  ImagePath: not found\n"));
+		      strcpy(ImagePath, szSystemRoot);
+		      strcat(ImagePath, "system32\\drivers\\");
+		      strcat(ImagePath, ServiceName);
+		      strcat(ImagePath, ".sys");
+		    }
+	          else if (TempImagePath[0] != '\\')
+		    {
+		      strcpy(ImagePath, szSystemRoot);
+		      strcat(ImagePath, TempImagePath);
+		    }
+	          else
+		    {
+		      strcpy(ImagePath, TempImagePath);
+		      DbgPrint((DPRINT_REACTOS, "  ImagePath: '%s'\n", ImagePath));
+		    }
+	          DbgPrint((DPRINT_REACTOS, "  Loading driver: '%s'\n", ImagePath));
+
+	          if (nPos < 100)
+		    nPos += 5;
+
+	          LoadDriver(ImagePath, nPos);
+	          LoadSymbolFile(szSystemRoot, ImagePath, nPos);
+	        }
+	      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));
+	        }
+	      Index++;
+	    }
+	}  
+
       Index = 0;
       while (TRUE)
 	{
-	  ValueSize = sizeof(ValueBuffer);
+	  ValueSize = sizeof(ServiceName);
 	  rc = RegEnumKey(hServiceKey, Index, ServiceName, &ValueSize);
 	  DbgPrint((DPRINT_REACTOS, "RegEnumKey(): rc %d\n", (int)rc));
 	  if (rc == ERROR_NO_MORE_ITEMS)
@@ -298,11 +395,25 @@
 	  rc = RegQueryValue(hDriverKey, "Start", &ValueType, (PUCHAR)&StartValue, &ValueSize);
 	  DbgPrint((DPRINT_REACTOS, "  Start: %x  \n", (int)StartValue));
 
+	  ValueSize = sizeof(U32);
+	  rc = RegQueryValue(hDriverKey, "Tag", &ValueType, (PUCHAR)&TagValue, &ValueSize);
+	  if (rc != ERROR_SUCCESS)
+	    {
+	      TagValue = (U32)-1;
+	    }
+	  DbgPrint((DPRINT_REACTOS, "  Tag:   %x  \n", (int)TagValue));
+
 	  DriverGroupSize = 256;
 	  rc = RegQueryValue(hDriverKey, "Group", NULL, (PUCHAR)DriverGroup, &DriverGroupSize);
 	  DbgPrint((DPRINT_REACTOS, "  Group: '%s'  \n", DriverGroup));
 
-	  if ((StartValue == 0) && (stricmp(DriverGroup, GroupName) == 0))
+          for (TagIndex = 1; TagIndex <= OrderList[0]; TagIndex++)
+	    {
+	      if (TagValue == OrderList[TagIndex])
+	        break;
+	    }
+
+	  if ((StartValue == 0) && (TagIndex > OrderList[0]) && (stricmp(DriverGroup, GroupName) == 0))
 	    {
 	      ValueSize = 256;
 	      rc = RegQueryValue(hDriverKey,
@@ -338,8 +449,8 @@
 	    }
 	  else
 	    {
-	      DbgPrint((DPRINT_REACTOS, "  Skipping driver '%s' with Start %d and Group '%s' (Current group '%s')\n",
-	          ImagePath, StartValue, DriverGroup, GroupName));
+	      DbgPrint((DPRINT_REACTOS, "  Skipping driver '%s' with Start %d, Tag %d and Group '%s' (Current group '%s')\n",
+	               ServiceName, StartValue, TagValue, DriverGroup, GroupName));
 	    }
 	  Index++;
 	}

freeldr/freeldr
CHANGELOG 1.42 -> 1.43
diff -u -r1.42 -r1.43
--- CHANGELOG	30 Aug 2004 10:53:38 -0000	1.42
+++ CHANGELOG	20 Sep 2004 18:02:36 -0000	1.43
@@ -1,3 +1,8 @@
+Changes in v1.8.24 (09/20/2004) (hbirr)
+
+- Implemented the driver loading by the sequence of tag entries 
+  in the GroupOrderList key.
+
 Changes in v1.8.23 (30/08/2004) (ekohl)
 
 - Fixed some compiler warnings.
CVSspam 0.2.8