[SETUP] Add support for archtitcure specific inf sections and use it for x64 computer...
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Sat, 27 Jul 2019 07:56:37 +0000 (09:56 +0200)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Sun, 8 Sep 2019 08:42:16 +0000 (10:42 +0200)
base/setup/lib/settings.c
boot/bootdata/txtsetup.sif

index 2d1c4e1..cafe247 100644 (file)
@@ -433,16 +433,18 @@ DefaultProcessEntry(
 }
 
 
 }
 
 
-PGENERIC_LIST
-CreateComputerTypeList(
-    IN HINF InfFile)
+BOOLEAN
+AddComputerTypeEntries(
+    _In_ HINF InfFile,
+    PGENERIC_LIST List,
+    _In_ PWSTR SectionName)
 {
 {
-    PGENERIC_LIST List;
     INFCONTEXT Context;
     PCWSTR KeyName;
     PCWSTR KeyValue;
     WCHAR ComputerIdentifier[128];
     WCHAR ComputerKey[32];
     INFCONTEXT Context;
     PCWSTR KeyName;
     PCWSTR KeyValue;
     WCHAR ComputerIdentifier[128];
     WCHAR ComputerKey[32];
+    ULONG Count1, Count2;
 
     /* Get the computer identification */
     if (!GetComputerIdentifier(ComputerIdentifier, 128))
 
     /* Get the computer identification */
     if (!GetComputerIdentifier(ComputerIdentifier, 128))
@@ -453,10 +455,10 @@ CreateComputerTypeList(
     DPRINT("Computer identifier: '%S'\n", ComputerIdentifier);
 
     /* Search for matching device identifier */
     DPRINT("Computer identifier: '%S'\n", ComputerIdentifier);
 
     /* Search for matching device identifier */
-    if (!SpInfFindFirstLine(InfFile, L"Map.Computer", NULL, &Context))
+    if (!SpInfFindFirstLine(InfFile, SectionName, NULL, &Context))
     {
         /* FIXME: error message */
     {
         /* FIXME: error message */
-        return NULL;
+        return FALSE;
     }
 
     do
     }
 
     do
@@ -467,7 +469,7 @@ CreateComputerTypeList(
         {
             /* FIXME: Handle error! */
             DPRINT("INF_GetDataField() failed\n");
         {
             /* FIXME: Handle error! */
             DPRINT("INF_GetDataField() failed\n");
-            return NULL;
+            return FALSE;
         }
 
         DPRINT("KeyValue: %S\n", KeyValue);
         }
 
         DPRINT("KeyValue: %S\n", KeyValue);
@@ -481,7 +483,7 @@ CreateComputerTypeList(
         {
             /* FIXME: Handle error! */
             DPRINT("INF_GetDataField() failed\n");
         {
             /* FIXME: Handle error! */
             DPRINT("INF_GetDataField() failed\n");
-            return NULL;
+            return FALSE;
         }
 
         DPRINT("Computer key: %S\n", KeyName);
         }
 
         DPRINT("Computer key: %S\n", KeyName);
@@ -489,16 +491,40 @@ CreateComputerTypeList(
         INF_FreeData(KeyName);
     } while (SpInfFindNextLine(&Context, &Context));
 
         INF_FreeData(KeyName);
     } while (SpInfFindNextLine(&Context, &Context));
 
+    Count1 = AddEntriesFromInfSection(List,
+                                      InfFile,
+                                      L"Computer",
+                                      &Context,
+                                      DefaultProcessEntry,
+                                      ComputerKey);
+    Count2 = AddEntriesFromInfSection(List,
+                                      InfFile,
+                                      L"Computer.NT" INF_ARCH,
+                                      &Context,
+                                      DefaultProcessEntry,
+                                      ComputerKey);
+    if ((Count1 == -1) && (Count2 == -1))
+    {
+        return FALSE;
+    }
+
+    return TRUE;
+}
+
+PGENERIC_LIST
+CreateComputerTypeList(
+    IN HINF InfFile)
+{
+    PGENERIC_LIST List;
+    BOOLEAN Success;
+
     List = CreateGenericList();
     if (List == NULL)
         return NULL;
 
     List = CreateGenericList();
     if (List == NULL)
         return NULL;
 
-    if (AddEntriesFromInfSection(List,
-                                 InfFile,
-                                 L"Computer",
-                                 &Context,
-                                 DefaultProcessEntry,
-                                 ComputerKey) == -1)
+    Success = AddComputerTypeEntries(InfFile, List, L"Map.Computer");
+    Success |= AddComputerTypeEntries(InfFile, List, L"Map.Computer.NT" INF_ARCH);
+    if (!Success)
     {
         DestroyGenericList(List, TRUE);
         return NULL;
     {
         DestroyGenericList(List, TRUE);
         return NULL;
index 8b662ef..82247b5 100644 (file)
@@ -220,14 +220,17 @@ UnicodeCasetable = l_intl.nls
 DefaultLayout    = 00000409
 DefaultLanguage  = 00000409
 
 DefaultLayout    = 00000409
 DefaultLanguage  = 00000409
 
-[Computer]
+[Computer.NTx86]
 pci_up = "Standard PC Uniprocessor"
 ;pci_mp = "Standard PC Multiprocessor"
 acpi_up = "ACPI PC Uniprocessor"
 ;acpi_mp = "ACPI PC Multiprocessor"
 xbox = "Original Xbox"
 
 pci_up = "Standard PC Uniprocessor"
 ;pci_mp = "Standard PC Multiprocessor"
 acpi_up = "ACPI PC Uniprocessor"
 ;acpi_mp = "ACPI PC Multiprocessor"
 xbox = "Original Xbox"
 
-[Map.Computer]
+[Computer.NTamd64]
+x64_up = "Standard x64 Uniprocessor"
+
+[Map.Computer.NTx86]
 ;<id> = <pnp id string>
 pci_up = "PC UP"
 ;pci_mp = "PC MP"
 ;<id> = <pnp id string>
 pci_up = "PC UP"
 ;pci_mp = "PC MP"
@@ -235,6 +238,9 @@ acpi_up = "ACPI UP"
 ;acpi_mp = "ACPI MP"
 xbox = "Xbox"
 
 ;acpi_mp = "ACPI MP"
 xbox = "Xbox"
 
+[Map.Computer.NTamd64]
+x64_up = "ACPI UP"
+
 [Files.pci_up]
 ntoskrnl.exe = 1,,,,,,,2,,,,1,2
 hal.dll      = 1,,,,,,,2,,,,1,2
 [Files.pci_up]
 ntoskrnl.exe = 1,,,,,,,2,,,,1,2
 hal.dll      = 1,,,,,,,2,,,,1,2
@@ -255,6 +261,10 @@ halacpi.dll  = 1,,,,,,,2,,,hal.dll,1,2
 ntoskrnl.exe = 1,,,,,,,2,,,,1,2
 halxbox.dll  = 1,,,,,,,2,,,hal.dll,1,2
 
 ntoskrnl.exe = 1,,,,,,,2,,,,1,2
 halxbox.dll  = 1,,,,,,,2,,,hal.dll,1,2
 
+[Files.x64_up]
+ntoskrnl.exe = 1,,,,,,,2,,,,1,2
+hal.dll      = 1,,,,,,,2,,,,1,2
+
 [Display]
 ;<id> = <user friendly name>,<spare>,<service key name>,<height>,<width>,<bpp>
 vga              = "VGA Display (640x480x4)",,Vga,640,480,4
 [Display]
 ;<id> = <user friendly name>,<spare>,<service key name>,<height>,<width>,<bpp>
 vga              = "VGA Display (640x480x4)",,Vga,640,480,4