[FREELDR] Cleanup some FldrCreateComponentKey() calls and archwsup.c
authorHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 5 Jun 2023 11:31:20 +0000 (13:31 +0200)
committerHermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Mon, 5 Jun 2023 20:39:47 +0000 (22:39 +0200)
boot/freeldr/freeldr/arch/archwsup.c
boot/freeldr/freeldr/arch/arm/macharm.c
boot/freeldr/freeldr/arch/i386/hwacpi.c
boot/freeldr/freeldr/arch/i386/hwapm.c
boot/freeldr/freeldr/arch/i386/hwpci.c
boot/freeldr/freeldr/arch/i386/pc/machpc.c
boot/freeldr/freeldr/arch/i386/pc/pchw.c
boot/freeldr/freeldr/arch/i386/pc98/pc98hw.c
boot/freeldr/freeldr/arch/i386/xbox/machxbox.c
boot/freeldr/freeldr/include/arch/archwsup.h

index e4e4487..f112270 100644 (file)
 #include <freeldr.h>
 
 #include <debug.h>
+DBG_DEFAULT_CHANNEL(HWDETECT);
 
 /* GLOBALS ********************************************************************/
 
+/* Strings corresponding to CONFIGURATION_TYPE */
+const PCSTR ArcTypes[MaximumType + 1] = // CmTypeName
+{
+    "System",
+    "CentralProcessor",
+    "FloatingPointProcessor",
+    "PrimaryICache",
+    "PrimaryDCache",
+    "SecondaryICache",
+    "SecondaryDCache",
+    "SecondaryCache",
+    "EisaAdapter",
+    "TcAdapter",
+    "ScsiAdapter",
+    "DtiAdapter",
+    "MultifunctionAdapter",
+    "DiskController",
+    "TapeController",
+    "CdRomController",
+    "WormController",
+    "SerialController",
+    "NetworkController",
+    "DisplayController",
+    "ParallelController",
+    "PointerController",
+    "KeyboardController",
+    "AudioController",
+    "OtherController",
+    "DiskPeripheral",
+    "FloppyDiskPeripheral",
+    "TapePeripheral",
+    "ModemPeripheral",
+    "MonitorPeripheral",
+    "PrinterPeripheral",
+    "PointerPeripheral",
+    "KeyboardPeripheral",
+    "TerminalPeripheral",
+    "OtherPeripheral",
+    "LinePeripheral",
+    "NetworkPeripheral",
+    "SystemMemory",
+    "DockingInformation",
+    "RealModeIrqRoutingTable",
+    "RealModePCIEnumeration",
+    "Undefined"
+};
+
 PCONFIGURATION_COMPONENT_DATA FldrArcHwTreeRoot;
 
 // ARC Disk Information
@@ -51,12 +99,11 @@ AddReactOSArcDiskInfo(
 // ARC Component Configuration Routines
 //
 
-VOID
-NTAPI
-FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
-                  IN PCHAR IdentifierString)
+static VOID
+FldrSetIdentifier(
+    _In_ PCONFIGURATION_COMPONENT Component,
+    _In_ PCSTR IdentifierString)
 {
-    PCONFIGURATION_COMPONENT Component = &ComponentData->ComponentEntry;
     SIZE_T IdentifierLength;
     PCHAR Identifier;
 
@@ -74,10 +121,10 @@ FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
 }
 
 VOID
-NTAPI
-FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
-                         IN PCM_PARTIAL_RESOURCE_LIST ResourceList,
-                         IN ULONG Size)
+FldrSetConfigurationData(
+    _Inout_ PCONFIGURATION_COMPONENT_DATA ComponentData,
+    _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList,
+    _In_ ULONG Size)
 {
     /* Set component information */
     ComponentData->ConfigurationData = ResourceList;
@@ -85,8 +132,9 @@ FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
 }
 
 VOID
-NTAPI
-FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
+FldrCreateSystemKey(
+    _Out_ PCONFIGURATION_COMPONENT_DATA* SystemNode,
+    _In_ PCSTR IdentifierString)
 {
     PCONFIGURATION_COMPONENT Component;
 
@@ -108,14 +156,18 @@ FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
     Component->Key = 0;
     Component->AffinityMask = 0xFFFFFFFF;
 
+    /* Set identifier */
+    if (IdentifierString)
+        FldrSetIdentifier(Component, IdentifierString);
+
     /* Return the node */
     *SystemNode = FldrArcHwTreeRoot;
 }
 
 static VOID
-NTAPI
-FldrLinkToParent(IN PCONFIGURATION_COMPONENT_DATA Parent,
-                 IN PCONFIGURATION_COMPONENT_DATA Child)
+FldrLinkToParent(
+    _In_ PCONFIGURATION_COMPONENT_DATA Parent,
+    _In_ PCONFIGURATION_COMPONENT_DATA Child)
 {
     PCONFIGURATION_COMPONENT_DATA Sibling;
 
@@ -143,17 +195,17 @@ FldrLinkToParent(IN PCONFIGURATION_COMPONENT_DATA Parent,
 }
 
 VOID
-NTAPI
-FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode,
-                       IN CONFIGURATION_CLASS Class,
-                       IN CONFIGURATION_TYPE Type,
-                       IN IDENTIFIER_FLAG Flags,
-                       IN ULONG Key,
-                       IN ULONG Affinity,
-                       IN PCHAR IdentifierString,
-                       IN PCM_PARTIAL_RESOURCE_LIST ResourceList,
-                       IN ULONG Size,
-                       OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
+FldrCreateComponentKey(
+    _In_ PCONFIGURATION_COMPONENT_DATA SystemNode,
+    _In_ CONFIGURATION_CLASS Class,
+    _In_ CONFIGURATION_TYPE Type,
+    _In_ IDENTIFIER_FLAG Flags,
+    _In_ ULONG Key,
+    _In_ ULONG Affinity,
+    _In_ PCSTR IdentifierString,
+    _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList,
+    _In_ ULONG Size,
+    _Out_ PCONFIGURATION_COMPONENT_DATA* ComponentKey)
 {
     PCONFIGURATION_COMPONENT_DATA ComponentData;
     PCONFIGURATION_COMPONENT Component;
@@ -180,12 +232,14 @@ FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode,
 
     /* Set identifier */
     if (IdentifierString)
-        FldrSetIdentifier(ComponentData, IdentifierString);
+        FldrSetIdentifier(Component, IdentifierString);
 
     /* Set configuration data */
     if (ResourceList)
         FldrSetConfigurationData(ComponentData, ResourceList, Size);
 
+    TRACE("Created key: %s\\%d\n", ArcTypes[min(Type, MaximumType)], Key);
+
     /* Return the child */
     *ComponentKey = ComponentData;
 }
index b62ba47..2179a59 100644 (file)
@@ -100,7 +100,7 @@ ArmHwDetect(VOID)
 
     /* Create the root node */
     if (ArmHwDetectRan++) return RootNode;
-    FldrCreateSystemKey(&RootNode);
+    FldrCreateSystemKey(&RootNode, "");
 
     /*
      * TODO:
index 120de9e..ccd42b1 100644 (file)
@@ -116,8 +116,8 @@ DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
         FldrCreateComponentKey(SystemKey,
                                AdapterClass,
                                MultiFunctionAdapter,
-                               0x0,
-                               0x0,
+                               0,
+                               0,
                                0xFFFFFFFF,
                                "ACPI BIOS",
                                PartialResourceList,
index 313cf90..cd0dfb0 100644 (file)
@@ -73,7 +73,7 @@ DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
     FldrCreateComponentKey(SystemKey,
                            AdapterClass,
                            MultiFunctionAdapter,
-                           0x0,
+                           0,
                            0,
                            0xFFFFFFFF,
                            "APM",
index 94bd4b5..54d1cfc 100644 (file)
@@ -161,8 +161,8 @@ DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
         FldrCreateComponentKey(BusKey,
                                PeripheralClass,
                                RealModeIrqRoutingTable,
-                               0x0,
-                               0x0,
+                               0,
+                               0,
                                0xFFFFFFFF,
                                "PCI Real-mode IRQ Routing Table",
                                PartialResourceList,
@@ -202,8 +202,8 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
         FldrCreateComponentKey(SystemKey,
                                AdapterClass,
                                MultiFunctionAdapter,
-                               0x0,
-                               0x0,
+                               0,
+                               0,
                                0xFFFFFFFF,
                                "PCI BIOS",
                                PartialResourceList,
@@ -268,8 +268,8 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
             FldrCreateComponentKey(SystemKey,
                                    AdapterClass,
                                    MultiFunctionAdapter,
-                                   0x0,
-                                   0x0,
+                                   0,
+                                   0,
                                    0xFFFFFFFF,
                                    "PCI",
                                    PartialResourceList,
index 43baec3..f20fa2b 100644 (file)
@@ -357,8 +357,8 @@ DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
     FldrCreateComponentKey(SystemKey,
                            AdapterClass,
                            MultiFunctionAdapter,
-                           0x0,
-                           0x0,
+                           0,
+                           0,
                            0xFFFFFFFF,
                            "PNP BIOS",
                            PartialResourceList,
@@ -687,14 +687,12 @@ DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey,
                                PeripheralClass,
                                PointerPeripheral,
                                Input,
-                               0x0,
+                               0,
                                0xFFFFFFFF,
                                Identifier,
                                PartialResourceList,
                                Size,
                                &PeripheralKey);
-
-        TRACE("Created key: PointerPeripheral\\0\n");
     }
 }
 
@@ -723,7 +721,7 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetS
     PCM_SERIAL_DEVICE_DATA SerialDeviceData;
     ULONG Irq;
     ULONG Base;
-    CHAR Buffer[80];
+    CHAR Identifier[80];
     ULONG ControllerNumber = 0;
     PCONFIGURATION_COMPONENT_DATA ControllerKey;
     ULONG i;
@@ -740,7 +738,7 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetS
         TRACE("Found COM%u port at 0x%x\n", i + 1, Base);
 
         /* Set 'Identifier' value */
-        sprintf(Buffer, "COM%ld", i + 1);
+        RtlStringCbPrintfA(Identifier, sizeof(Identifier), "COM%ld", i + 1);
 
         /* Build full device descriptor */
         Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
@@ -796,7 +794,7 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetS
                                Output | Input | ConsoleIn | ConsoleOut,
                                ControllerNumber,
                                0xFFFFFFFF,
-                               Buffer,
+                               Identifier,
                                PartialResourceList,
                                Size,
                                &ControllerKey);
@@ -817,7 +815,7 @@ DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
     PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
     PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
     ULONG Irq[MAX_LPT_PORTS] = {7, 5, (ULONG) - 1};
-    CHAR Buffer[80];
+    CHAR Identifier[80];
     PCONFIGURATION_COMPONENT_DATA ControllerKey;
     PUSHORT BasePtr;
     ULONG Base;
@@ -843,7 +841,7 @@ DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
         TRACE("Parallel port %u: %x\n", ControllerNumber, Base);
 
         /* Set 'Identifier' value */
-        sprintf(Buffer, "PARALLEL%ld", i + 1);
+        RtlStringCbPrintfA(Identifier, sizeof(Identifier), "PARALLEL%ld", i + 1);
 
         /* Build full device descriptor */
         Size = sizeof(CM_PARTIAL_RESOURCE_LIST);
@@ -891,7 +889,7 @@ DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
                                Output,
                                ControllerNumber,
                                0xFFFFFFFF,
-                               Buffer,
+                               Identifier,
                                PartialResourceList,
                                Size,
                                &ControllerKey);
@@ -1027,13 +1025,12 @@ DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
                                PeripheralClass,
                                KeyboardPeripheral,
                                Input | ConsoleIn,
-                               0x0,
+                               0,
                                0xFFFFFFFF,
                                "PCAT_ENHANCED",
                                PartialResourceList,
                                Size,
                                &PeripheralKey);
-        TRACE("Created key: KeyboardPeripheral\\0\n");
     }
 }
 
@@ -1094,13 +1091,12 @@ DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
                            ControllerClass,
                            KeyboardController,
                            Input | ConsoleIn,
-                           0x0,
+                           0,
                            0xFFFFFFFF,
                            NULL,
                            PartialResourceList,
                            Size,
                            &ControllerKey);
-    TRACE("Created key: KeyboardController\\0\n");
 
     DetectKeyboardPeripheral(ControllerKey);
 }
@@ -1254,13 +1250,12 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
                                ControllerClass,
                                PointerController,
                                Input,
-                               0x0,
+                               0,
                                0xFFFFFFFF,
                                NULL,
                                PartialResourceList,
                                sizeof(CM_PARTIAL_RESOURCE_LIST),
                                &ControllerKey);
-        TRACE("Created key: PointerController\\0\n");
 
         if (DetectPS2AuxDevice())
         {
@@ -1286,13 +1281,12 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
                                    ControllerClass,
                                    PointerPeripheral,
                                    Input,
-                                   0x0,
+                                   0,
                                    0xFFFFFFFF,
                                    "MICROSOFT PS2 MOUSE",
                                    PartialResourceList,
                                    Size,
                                    &PeripheralKey);
-            TRACE("Created key: PointerPeripheral\\0\n");
         }
     }
 }
@@ -1306,7 +1300,7 @@ BOOLEAN BiosVesaReadEdid(VOID);
 static VOID
 DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
 {
-    CHAR Buffer[80];
+    PCSTR Identifier;
     PCONFIGURATION_COMPONENT_DATA ControllerKey;
     USHORT VesaVersion;
 
@@ -1325,25 +1319,20 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
     }
 
     if (VesaVersion >= 0x0200)
-    {
-        strcpy(Buffer, "VBE Display");
-    }
+        Identifier = "VBE Display";
     else
-    {
-        strcpy(Buffer, "VGA Display");
-    }
+        Identifier = "VGA Display";
 
     FldrCreateComponentKey(BusKey,
                            ControllerClass,
                            DisplayController,
-                           0x0,
-                           0x0,
+                           Output | ConsoleOut,
+                           0,
                            0xFFFFFFFF,
-                           Buffer,
+                           Identifier,
                            NULL,
                            0,
                            &ControllerKey);
-    TRACE("Created key: DisplayController\\0\n");
 
     /* FIXME: Add display peripheral (monitor) data */
     if (VesaVersion != 0)
@@ -1354,7 +1343,6 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
             if (BiosVesaReadEdid())
             {
                 TRACE("EDID data read successfully!\n");
-
             }
         }
     }
@@ -1388,8 +1376,8 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
     FldrCreateComponentKey(SystemKey,
                            AdapterClass,
                            MultiFunctionAdapter,
-                           0x0,
-                           0x0,
+                           0,
+                           0,
                            0xFFFFFFFF,
                            "ISA",
                            PartialResourceList,
@@ -1434,9 +1422,8 @@ PcHwDetect(VOID)
     TRACE("DetectHardware()\n");
 
     /* Create the 'System' key */
-    FldrCreateSystemKey(&SystemKey);
     // TODO: Discover and set the other machine types
-    FldrSetIdentifier(SystemKey, "AT/AT COMPATIBLE");
+    FldrCreateSystemKey(&SystemKey, "AT/AT COMPATIBLE");
 
     GetHarddiskConfigurationData = PcGetHarddiskConfigurationData;
     FindPciBios = PcFindPciBios;
index 6ade22f..1dfa46b 100644 (file)
@@ -223,7 +223,7 @@ DetectBiosFloppyPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
         Ptr = GetInt1eTable();
 
         /* Set 'Identifier' value */
-        sprintf(Identifier, "FLOPPY%d", FloppyNumber + 1);
+        RtlStringCbPrintfA(Identifier, sizeof(Identifier), "FLOPPY%d", FloppyNumber + 1);
 
         Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
                sizeof(CM_FLOPPY_DEVICE_DATA);
@@ -333,7 +333,6 @@ DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey)
                            PartialResourceList,
                            Size,
                            &ControllerKey);
-    TRACE("Created key: DiskController\\0\n");
 
     if (FloppyCount)
         DetectBiosFloppyPeripheral(ControllerKey);
@@ -414,7 +413,7 @@ DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
     /* Create and fill subkey for each harddisk */
     for (i = 0; i < DiskCount; i++)
     {
-        PCHAR Identifier;
+        PCSTR Identifier;
 
         DriveNumber = 0x80 + i;
 
index 8e4f235..a404237 100644 (file)
@@ -220,7 +220,6 @@ DetectBiosFloppyPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
                                PartialResourceList,
                                Size,
                                &PeripheralKey);
-        TRACE("Created key: FloppyDiskPeripheral\\%d\n", FloppyNumber);
     }
 }
 
@@ -306,7 +305,6 @@ DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey)
                            PartialResourceList,
                            Size,
                            &ControllerKey);
-    TRACE("Created key: DiskController\\0\n");
 
     if (FloppyCount)
         DetectBiosFloppyPeripheral(ControllerKey);
@@ -444,7 +442,7 @@ DetectBiosDisks(
     /* Create and fill subkey for each harddisk */
     for (i = 0; i < DiskCount; i++)
     {
-        PCHAR Identifier;
+        PCSTR Identifier;
 
         DriveNumber = 0x80 + i;
 
@@ -463,7 +461,6 @@ DetectBiosDisks(
                                PartialResourceList,
                                Size,
                                &DiskKey);
-        TRACE("Created key: DiskPeripheral\\%d\n", i);
     }
 }
 
@@ -501,7 +498,6 @@ DetectPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
                            PartialResourceList,
                            Size,
                            &PeripheralKey);
-    TRACE("Created key: PointerPeripheral\\0\n");
 }
 
 static VOID
@@ -577,7 +573,6 @@ DetectPointerController(PCONFIGURATION_COMPONENT_DATA BusKey)
                            PartialResourceList,
                            Size,
                            &ControllerKey);
-    TRACE("Created key: PointerController\\0\n");
 
     DetectPointerPeripheral(ControllerKey);
 }
@@ -589,7 +584,7 @@ DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
     PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
     PCM_KEYBOARD_DEVICE_DATA KeyboardData;
     PCONFIGURATION_COMPONENT_DATA PeripheralKey;
-    CHAR Identifier[80];
+    PCSTR Identifier;
     ULONG Size;
     REGS Regs;
     UCHAR KeyboardType = ((*(PUCHAR)MEM_KEYB_TYPE & 0x40) >> 5) |
@@ -636,11 +631,11 @@ DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
                                   ((Regs.b.al & 0x01) << 1);
 
     if (KeyboardType == 0)
-        RtlStringCbPrintfA(Identifier, sizeof(Identifier), "PC98_NmodeKEY");
+        Identifier = "PC98_NmodeKEY";
     else if (KeyboardType == 2)
-        RtlStringCbPrintfA(Identifier, sizeof(Identifier), "PC98_106KEY");
+        Identifier = "PC98_106KEY";
     else
-        RtlStringCbPrintfA(Identifier, sizeof(Identifier), "PC98_LaptopKEY");
+        Identifier = "PC98_LaptopKEY";
 
     /* Create controller key */
     FldrCreateComponentKey(ControllerKey,
@@ -653,7 +648,6 @@ DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
                            PartialResourceList,
                            Size,
                            &PeripheralKey);
-    TRACE("Created key: KeyboardPeripheral\\0\n");
 }
 
 static VOID
@@ -714,7 +708,6 @@ DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
                            PartialResourceList,
                            Size,
                            &ControllerKey);
-    TRACE("Created key: KeyboardController\\0\n");
 
     DetectKeyboardPeripheral(ControllerKey);
 }
@@ -801,7 +794,6 @@ DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
                            PartialResourceList,
                            Size,
                            &ControllerKey);
-    TRACE("Created key: ParallelController\\0\n");
 }
 
 static VOID
@@ -898,7 +890,6 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
                                PartialResourceList,
                                Size,
                                &ControllerKey);
-        TRACE("Created key: SerialController\\%d\n", ControllerNumber);
 
         ++ControllerNumber;
     }
@@ -963,7 +954,6 @@ DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
                                PartialResourceList,
                                Size,
                                &ControllerKey);
-        TRACE("Created key: SerialController\\%d\n", ControllerNumber);
 
         ++ControllerNumber;
     }
@@ -994,7 +984,7 @@ DetectCBusBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
     FldrCreateComponentKey(SystemKey,
                            AdapterClass,
                            MultiFunctionAdapter,
-                           0x0,
+                           0,
                            0,
                            0xFFFFFFFF,
                            "ISA",
@@ -1043,7 +1033,7 @@ DetectNesaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
     FldrCreateComponentKey(SystemKey,
                            AdapterClass,
                            MultiFunctionAdapter,
-                           0x0,
+                           0,
                            0,
                            0xFFFFFFFF,
                            "EISA",
@@ -1178,8 +1168,8 @@ DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
     FldrCreateComponentKey(SystemKey,
                            AdapterClass,
                            MultiFunctionAdapter,
-                           0x0,
-                           0x0,
+                           0,
+                           0,
                            0xFFFFFFFF,
                            "PNP BIOS",
                            PartialResourceList,
@@ -1198,8 +1188,7 @@ Pc98HwDetect(VOID)
     TRACE("DetectHardware()\n");
 
     /* Create the 'System' key */
-    FldrCreateSystemKey(&SystemKey);
-    FldrSetIdentifier(SystemKey, "NEC PC-98");
+    FldrCreateSystemKey(&SystemKey, "NEC PC-98");
 
     GetHarddiskConfigurationData = Pc98GetHarddiskConfigurationData;
     FindPciBios = PcFindPciBios;
index 0aba6db..0574cd3 100644 (file)
@@ -157,7 +157,6 @@ XboxGetHarddiskConfigurationData(UCHAR DriveNumber, ULONG* pSize)
 static VOID
 DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
 {
-    CHAR Buffer[80];
     PCONFIGURATION_COMPONENT_DATA ControllerKey;
     PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
     PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
@@ -166,8 +165,6 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
     if (FrameBufferSize == 0)
         return;
 
-    strcpy(Buffer, "NV2A Framebuffer");
-
     Size = sizeof(CM_PARTIAL_RESOURCE_LIST);
     PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
     if (PartialResourceList == NULL)
@@ -193,15 +190,13 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
     FldrCreateComponentKey(BusKey,
                            ControllerClass,
                            DisplayController,
-                           0x0,
-                           0x0,
+                           Output | ConsoleOut,
+                           0,
                            0xFFFFFFFF,
-                           Buffer,
+                           "NV2A Framebuffer",
                            PartialResourceList,
                            Size,
                            &ControllerKey);
-
-    TRACE("Created key: DisplayController\\0\n");
 }
 
 static
@@ -232,8 +227,8 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
     FldrCreateComponentKey(SystemKey,
                            AdapterClass,
                            MultiFunctionAdapter,
-                           0x0,
-                           0x0,
+                           0,
+                           0,
                            0xFFFFFFFF,
                            "ISA",
                            PartialResourceList,
@@ -276,8 +271,7 @@ XboxHwDetect(VOID)
     TRACE("DetectHardware()\n");
 
     /* Create the 'System' key */
-    FldrCreateSystemKey(&SystemKey);
-    FldrSetIdentifier(SystemKey, "Original Xbox (PC/AT like)");
+    FldrCreateSystemKey(&SystemKey, "Original Xbox (PC/AT like)");
 
     GetHarddiskConfigurationData = XboxGetHarddiskConfigurationData;
     FindPciBios = XboxFindPciBios;
index bbf50dc..c8f2cd0 100644 (file)
@@ -33,39 +33,27 @@ AddReactOSArcDiskInfo(
 // ARC Component Configuration Routines
 //
 VOID
-NTAPI
-FldrSetIdentifier(
-    IN PCONFIGURATION_COMPONENT_DATA ComponentData,
-    IN PCHAR IdentifierString
-);
-
-VOID
-NTAPI
 FldrSetConfigurationData(
-    IN PCONFIGURATION_COMPONENT_DATA ComponentData,
-    IN PCM_PARTIAL_RESOURCE_LIST ResourceList,
-    IN ULONG Size
-);
+    _Inout_ PCONFIGURATION_COMPONENT_DATA ComponentData,
+    _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList,
+    _In_ ULONG Size);
 
 VOID
-NTAPI
 FldrCreateSystemKey(
-    OUT PCONFIGURATION_COMPONENT_DATA *SystemKey
-);
+    _Out_ PCONFIGURATION_COMPONENT_DATA* SystemNode,
+    _In_ PCSTR IdentifierString);
 
 VOID
-NTAPI
 FldrCreateComponentKey(
-    IN PCONFIGURATION_COMPONENT_DATA SystemKey,
-    IN CONFIGURATION_CLASS Class,
-    IN CONFIGURATION_TYPE Type,
-    IN IDENTIFIER_FLAG Flags,
-    IN ULONG Key,
-    IN ULONG Affinity,
-    IN PCHAR IdentifierString,
-    IN PCM_PARTIAL_RESOURCE_LIST ResourceList,
-    IN ULONG Size,
-    OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey
-);
+    _In_ PCONFIGURATION_COMPONENT_DATA SystemNode,
+    _In_ CONFIGURATION_CLASS Class,
+    _In_ CONFIGURATION_TYPE Type,
+    _In_ IDENTIFIER_FLAG Flags,
+    _In_ ULONG Key,
+    _In_ ULONG Affinity,
+    _In_ PCSTR IdentifierString,
+    _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList,
+    _In_ ULONG Size,
+    _Out_ PCONFIGURATION_COMPONENT_DATA* ComponentKey);
 
 /* EOF */