DPRINTM(DPRINT_HWDETECT, "MaxNodeSize %u NodeCount %u\n", NodeSize, NodeCount);
DPRINTM(DPRINT_HWDETECT, "Estimated buffer size %u\n", NodeSize * NodeCount);
- /* Create component key */
- FldrCreateComponentKey(SystemKey,
- AdapterClass,
- MultiFunctionAdapter,
- 0x0,
- 0x0,
- 0xFFFFFFFF,
- "PNP BIOS",
- &BusKey);
- (*BusNumber)++;
-
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + (NodeSize * NodeCount);
PartialResourceList = MmHeapAlloc(Size);
DPRINTM(DPRINT_HWDETECT, "Real buffer size: %u\n", PnpBufferSize);
DPRINTM(DPRINT_HWDETECT, "Resource size: %u\n", Size);
-
- FldrSetConfigurationData(BusKey, PartialResourceList, Size);
+
+ /* Create component key */
+ FldrCreateComponentKey(SystemKey,
+ AdapterClass,
+ MultiFunctionAdapter,
+ 0x0,
+ 0x0,
+ 0xFFFFFFFF,
+ "PNP BIOS",
+ PartialResourceList,
+ Size,
+ &BusKey);
+
+ (*BusNumber)++;
+
MmHeapFree(PartialResourceList);
}
-static VOID
-SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey,
- ULONG DriveNumber)
+static PCM_PARTIAL_RESOURCE_LIST
+GetHarddiskConfigurationData(ULONG DriveNumber, ULONG* pSize)
{
PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry;
GEOMETRY Geometry;
ULONG Size;
+ //
+ // Initialize returned size
+ //
+ *pSize = 0;
+
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_DISK_GEOMETRY_DEVICE_DATA);
{
DPRINTM(DPRINT_HWDETECT,
"Failed to allocate a full resource descriptor\n");
- return;
+ return NULL;
}
memset(PartialResourceList, 0, Size);
{
DPRINTM(DPRINT_HWDETECT, "Reading disk geometry failed\n");
MmHeapFree(PartialResourceList);
- return;
+ return NULL;
}
DPRINTM(DPRINT_HWDETECT,
"Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
DiskGeometry->SectorsPerTrack,
DiskGeometry->BytesPerSector);
- FldrSetConfigurationData(DiskKey, PartialResourceList, Size);
- MmHeapFree(PartialResourceList);
+ //
+ // Return configuration data
+ //
+ *pSize = Size;
+ return PartialResourceList;
}
typedef struct tagDISKCONTEXT
/* Set 'Identifier' value */
sprintf(Identifier, "FLOPPY%ld", FloppyNumber + 1);
- FldrCreateComponentKey(ControllerKey,
- PeripheralClass,
- FloppyDiskPeripheral,
- Input | Output,
- FloppyNumber,
- 0xFFFFFFFF,
- Identifier,
- &PeripheralKey);
-
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_FLOPPY_DEVICE_DATA);
PartialResourceList = MmHeapAlloc(Size);
FloppyData->MaximumTrackValue = (FloppyType == 1) ? 39 : 79;
FloppyData->DataTransferRate = 0;
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size);
+ FldrCreateComponentKey(ControllerKey,
+ PeripheralClass,
+ FloppyDiskPeripheral,
+ Input | Output,
+ FloppyNumber,
+ 0xFFFFFFFF,
+ Identifier,
+ PartialResourceList,
+ Size,
+ &PeripheralKey);
+
MmHeapFree(PartialResourceList);
}
}
static VOID
-DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey,
- PCONFIGURATION_COMPONENT_DATA ControllerKey)
+DetectBiosFloppyController(PCONFIGURATION_COMPONENT_DATA BusKey)
{
+ PCONFIGURATION_COMPONENT_DATA ControllerKey;
PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
ULONG Size;
PartialDescriptor->u.Dma.Channel = 2;
PartialDescriptor->u.Dma.Port = 0;
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(ControllerKey, PartialResourceList, Size);
+ /* Create floppy disk controller */
+ FldrCreateComponentKey(BusKey,
+ ControllerClass,
+ DiskController,
+ Output | Input,
+ 0x0,
+ 0xFFFFFFFF,
+ NULL,
+ PartialResourceList,
+ Size,
+ &ControllerKey);
+ DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
+
MmHeapFree(PartialResourceList);
if (FloppyCount) DetectBiosFloppyPeripheral(ControllerKey);
}
-static VOID
-DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
- PCONFIGURATION_COMPONENT_DATA BusKey)
+static PCONFIGURATION_COMPONENT_DATA
+DetectSystem(VOID)
{
+ PCONFIGURATION_COMPONENT_DATA SystemKey;
PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
PCM_INT13_DRIVE_PARAMETER Int13Drives;
GEOMETRY Geometry;
- PCONFIGURATION_COMPONENT_DATA DiskKey, ControllerKey;
ULONG DiskCount;
ULONG Size;
ULONG i;
- BOOLEAN Changed, BootDriveReported = FALSE;
- CHAR BootPath[512];
+ BOOLEAN Changed;
/* Count the number of visible drives */
DiskReportError(FALSE);
DPRINTM(DPRINT_HWDETECT, "BIOS reports %d harddisk%s\n",
(int)DiskCount, (DiskCount == 1) ? "": "s");
- FldrCreateComponentKey(BusKey,
- ControllerClass,
- DiskController,
- Output | Input | Removable,
- 0x0,
- 0xFFFFFFFF,
- NULL,
- &ControllerKey);
- DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
-
- DetectBiosFloppyController(BusKey, ControllerKey);
-
/* Allocate resource descriptor */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_INT13_DRIVE_PARAMETER) * DiskCount;
{
DPRINTM(DPRINT_HWDETECT,
"Failed to allocate resource descriptor\n");
- return;
+ return NULL;
}
/* Initialize resource descriptor */
Int13Drives = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
for (i = 0; i < DiskCount; i++)
{
- if (BootDrive == 0x80 + i)
- BootDriveReported = TRUE;
-
if (MachDiskGetDriveGeometry(0x80 + i, &Geometry))
{
Int13Drives[i].DriveSelect = 0x80 + i;
Geometry.BytesPerSector);
}
}
-
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
+
+ FldrCreateComponentKey(NULL,
+ SystemClass,
+ MaximumType,
+ 0x0,
+ 0x0,
+ 0xFFFFFFFF,
+ NULL,
+ PartialResourceList,
+ Size,
+ &SystemKey);
+
MmHeapFree(PartialResourceList);
+
+ return SystemKey;
+}
+
+static ULONG
+GetDiskCount(PCONFIGURATION_COMPONENT_DATA BusKey)
+{
+ PCONFIGURATION_COMPONENT_DATA System;
+ ULONG ConfigurationDataLength;
+ ULONG DiskCount = 0;
+
+ //
+ // Get root component
+ //
+ System = BusKey;
+ while (System->Parent)
+ System = System->Parent;
+
+ //
+ // Get root configuration data length
+ //
+ ConfigurationDataLength = System->ComponentEntry.ConfigurationDataLength;
+
+ //
+ // We assume that nothing wrong happened, and that configuration
+ // only consists of one CM_PARTIAL_RESOURCE_LIST entry, followed
+ // by n entries of CM_INT13_DRIVE_PARAMETER
+ //
+ if (ConfigurationDataLength > 0)
+ DiskCount = (ConfigurationDataLength - sizeof(CM_PARTIAL_RESOURCE_LIST))
+ / sizeof(CM_INT13_DRIVE_PARAMETER);
+
+ //
+ // Return number of disks
+ //
+ DPRINTM(DPRINT_HWDETECT, "Retrieving %lu INT13 disks\\0\n");
+ return DiskCount;
+};
+
+static VOID
+DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA BusKey)
+{
+ PCONFIGURATION_COMPONENT_DATA DiskKey, ControllerKey;
+ BOOLEAN BootDriveReported = FALSE;
+ ULONG i;
+ ULONG DiskCount = GetDiskCount(BusKey);
+ CHAR BootPath[512];
+
+ FldrCreateComponentKey(BusKey,
+ ControllerClass,
+ DiskController,
+ Output | Input,
+ 0x0,
+ 0xFFFFFFFF,
+ NULL,
+ NULL,
+ 0,
+ &ControllerKey);
+ DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
/* Create and fill subkey for each harddisk */
for (i = 0; i < DiskCount; i++)
{
+ PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
+ ULONG Size;
CHAR Identifier[20];
+ if (BootDrive == 0x80 + i)
+ BootDriveReported = TRUE;
+
/* Get disk values */
+ PartialResourceList = GetHarddiskConfigurationData(0x80 + i, &Size);
GetHarddiskIdentifier(Identifier, 0x80 + i);
/* Create disk key */
0x0,
0xFFFFFFFF,
Identifier,
+ PartialResourceList,
+ Size,
&DiskKey);
-
- /* Set disk values */
- SetHarddiskConfigurationData(DiskKey, 0x80 + i);
}
/* Get the drive we're booting from */
}
}
+ /* Set 'Configuration Data' value */
+ memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
+ PartialResourceList.Version = 1;
+ PartialResourceList.Revision = 1;
+ PartialResourceList.Count = 0;
+
/* Create 'PointerPeripheral' key */
FldrCreateComponentKey(ControllerKey,
PeripheralClass,
0x0,
0xFFFFFFFF,
Identifier,
+ &PartialResourceList,
+ sizeof(CM_PARTIAL_RESOURCE_LIST) -
+ sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR),
&PeripheralKey);
- DPRINTM(DPRINT_HWDETECT,
- "Created key: PointerPeripheral\\0\n");
-
- /* Set 'Configuration Data' value */
- memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
- PartialResourceList.Version = 1;
- PartialResourceList.Revision = 1;
- PartialResourceList.Count = 0;
- FldrSetConfigurationData(PeripheralKey,
- &PartialResourceList,
- sizeof(CM_PARTIAL_RESOURCE_LIST) -
- sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+ DPRINTM(DPRINT_HWDETECT,
+ "Created key: PointerPeripheral\\0\n");
}
}
/* Set 'Identifier' value */
sprintf(Buffer, "COM%ld", i + 1);
- /* Create controller key */
- FldrCreateComponentKey(BusKey,
- ControllerClass,
- SerialController,
- Output | Input | ConsoleIn | ConsoleOut,
- ControllerNumber,
- 0xFFFFFFFF,
- Buffer,
- &ControllerKey);
-
/* Build full device descriptor */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) +
(PCM_SERIAL_DEVICE_DATA)&PartialResourceList->PartialDescriptors[3];
SerialDeviceData->BaudClock = 1843200; /* UART Clock frequency (Hertz) */
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(ControllerKey, PartialResourceList, Size);
+ /* Create controller key */
+ FldrCreateComponentKey(BusKey,
+ ControllerClass,
+ SerialController,
+ Output | Input | ConsoleIn | ConsoleOut,
+ ControllerNumber,
+ 0xFFFFFFFF,
+ Buffer,
+ PartialResourceList,
+ Size,
+ &ControllerKey);
+
MmHeapFree(PartialResourceList);
if (!Rs232PortInUse(Base))
/* Set 'Identifier' value */
sprintf(Buffer, "PARALLEL%ld", i + 1);
- /* Create controller key */
- FldrCreateComponentKey(BusKey,
- ControllerClass,
- ParallelController,
- Output,
- ControllerNumber,
- 0xFFFFFFFF,
- Buffer,
- &ControllerKey);
-
/* Build full device descriptor */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST);
if (Irq[i] != (ULONG)-1)
PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
}
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(ControllerKey, PartialResourceList, Size);
+ /* Create controller key */
+ FldrCreateComponentKey(BusKey,
+ ControllerClass,
+ ParallelController,
+ Output,
+ ControllerNumber,
+ 0xFFFFFFFF,
+ Buffer,
+ PartialResourceList,
+ Size,
+ &ControllerKey);
+
MmHeapFree(PartialResourceList);
ControllerNumber++;
/* HACK: don't call DetectKeyboardDevice() as it fails in Qemu 0.8.2 */
if (TRUE || DetectKeyboardDevice())
{
- /* Create controller key */
- FldrCreateComponentKey(ControllerKey,
- PeripheralClass,
- KeyboardPeripheral,
- Input | ConsoleIn,
- 0x0,
- 0xFFFFFFFF,
- "PCAT_ENHANCED",
- &PeripheralKey);
- DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardPeripheral\\0\n");
-
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_KEYBOARD_DEVICE_DATA);
KeyboardData->Subtype = 0;
KeyboardData->KeyboardFlags = 0x20;
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(PeripheralKey, PartialResourceList, Size);
+ /* Create controller key */
+ FldrCreateComponentKey(ControllerKey,
+ PeripheralClass,
+ KeyboardPeripheral,
+ Input | ConsoleIn,
+ 0x0,
+ 0xFFFFFFFF,
+ "PCAT_ENHANCED",
+ PartialResourceList,
+ Size,
+ &PeripheralKey);
+ DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardPeripheral\\0\n");
+
MmHeapFree(PartialResourceList);
}
}
PCONFIGURATION_COMPONENT_DATA ControllerKey;
ULONG Size;
- /* Create controller key */
- FldrCreateComponentKey(BusKey,
- ControllerClass,
- KeyboardController,
- Input | ConsoleIn,
- 0x0,
- 0xFFFFFFFF,
- NULL,
- &ControllerKey);
- DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardController\\0\n");
-
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
PartialDescriptor->u.Port.Start.HighPart = 0x0;
PartialDescriptor->u.Port.Length = 1;
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(ControllerKey, PartialResourceList, Size);
+ /* Create controller key */
+ FldrCreateComponentKey(BusKey,
+ ControllerClass,
+ KeyboardController,
+ Input | ConsoleIn,
+ 0x0,
+ 0xFFFFFFFF,
+ NULL,
+ PartialResourceList,
+ Size,
+ &ControllerKey);
+ DPRINTM(DPRINT_HWDETECT, "Created key: KeyboardController\\0\n");
+
MmHeapFree(PartialResourceList);
DetectKeyboardPeripheral(ControllerKey);
{
DPRINTM(DPRINT_HWDETECT, "Detected PS2 port\n");
- /* Create controller key */
- FldrCreateComponentKey(BusKey,
- ControllerClass,
- PointerController,
- Input,
- 0x0,
- 0xFFFFFFFF,
- NULL,
- &ControllerKey);
- DPRINTM(DPRINT_HWDETECT, "Created key: PointerController\\0\n");
-
memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
/* Initialize resource descriptor */
PartialResourceList.PartialDescriptors[0].u.Interrupt.Vector = 0;
PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF;
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(ControllerKey,
- &PartialResourceList,
- sizeof(CM_PARTIAL_RESOURCE_LIST));
+ /* Create controller key */
+ FldrCreateComponentKey(BusKey,
+ ControllerClass,
+ PointerController,
+ Input,
+ 0x0,
+ 0xFFFFFFFF,
+ NULL,
+ &PartialResourceList,
+ sizeof(CM_PARTIAL_RESOURCE_LIST),
+ &ControllerKey);
+ DPRINTM(DPRINT_HWDETECT, "Created key: PointerController\\0\n");
if (DetectPS2AuxDevice())
{
DPRINTM(DPRINT_HWDETECT, "Detected PS2 mouse\n");
+ /* Initialize resource descriptor */
+ memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
+ PartialResourceList.Version = 1;
+ PartialResourceList.Revision = 1;
+ PartialResourceList.Count = 0;
+
/* Create peripheral key */
FldrCreateComponentKey(ControllerKey,
ControllerClass,
0x0,
0xFFFFFFFF,
"MICROSOFT PS2 MOUSE",
+ &PartialResourceList,
+ sizeof(CM_PARTIAL_RESOURCE_LIST) -
+ sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR),
&PeripheralKey);
- DPRINTM(DPRINT_HWDETECT, "Created key: PointerPeripheral\\0\n");
-
- /* Initialize resource descriptor */
- memset(&PartialResourceList, 0, sizeof(CM_PARTIAL_RESOURCE_LIST));
- PartialResourceList.Version = 1;
- PartialResourceList.Revision = 1;
- PartialResourceList.Count = 0;
-
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(PeripheralKey,
- &PartialResourceList,
- sizeof(CM_PARTIAL_RESOURCE_LIST) -
- sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+ DPRINTM(DPRINT_HWDETECT, "Created key: PointerPeripheral\\0\n");
}
}
}
0x0,
0xFFFFFFFF,
Buffer,
+ NULL,
+ 0,
&ControllerKey);
DPRINTM(DPRINT_HWDETECT, "Created key: DisplayController\\0\n");
PCONFIGURATION_COMPONENT_DATA BusKey;
ULONG Size;
- /* Create new bus key */
- FldrCreateComponentKey(SystemKey,
- AdapterClass,
- MultiFunctionAdapter,
- 0x0,
- 0x0,
- 0xFFFFFFFF,
- "ISA",
- &BusKey);
-
/* Increment bus number */
(*BusNumber)++;
PartialResourceList->Revision = 1;
PartialResourceList->Count = 0;
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(BusKey, PartialResourceList, Size);
+ /* Create new bus key */
+ FldrCreateComponentKey(SystemKey,
+ AdapterClass,
+ MultiFunctionAdapter,
+ 0x0,
+ 0x0,
+ 0xFFFFFFFF,
+ "ISA",
+ PartialResourceList,
+ Size,
+ &BusKey);
+
MmHeapFree(PartialResourceList);
/* Detect ISA/BIOS devices */
- DetectBiosDisks(SystemKey, BusKey);
+ DetectBiosDisks(BusKey);
+
+ DetectBiosFloppyController(BusKey);
DetectSerialPorts(BusKey);
DPRINTM(DPRINT_HWDETECT, "DetectHardware()\n");
/* Create the 'System' key */
- FldrCreateSystemKey(&SystemKey);
+ SystemKey = DetectSystem();
/* Detect buses */
DetectPciBios(SystemKey, &BusNumber);
extern ARC_DISK_SIGNATURE reactos_arc_disk_info[];
extern char reactos_arc_strings[32][256];
-static VOID
-SetHarddiskConfigurationData(PCONFIGURATION_COMPONENT_DATA DiskKey,
- ULONG DriveNumber)
+static PCM_PARTIAL_RESOURCE_LIST
+GetHarddiskConfigurationData(ULONG DriveNumber, ULONG* pSize)
{
PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry;
GEOMETRY Geometry;
ULONG Size;
+ //
+ // Initialize returned size
+ //
+ *pSize = 0;
+
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
sizeof(CM_DISK_GEOMETRY_DEVICE_DATA);
{
DPRINTM(DPRINT_HWDETECT,
"Failed to allocate a full resource descriptor\n");
- return;
+ return NULL;
}
memset(PartialResourceList, 0, Size);
{
DPRINTM(DPRINT_HWDETECT, "Reading disk geometry failed\n");
MmHeapFree(PartialResourceList);
- return;
+ return NULL;
}
DPRINTM(DPRINT_HWDETECT,
"Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
DiskGeometry->SectorsPerTrack,
DiskGeometry->BytesPerSector);
- FldrSetConfigurationData(DiskKey, PartialResourceList, Size);
- MmHeapFree(PartialResourceList);
+ //
+ // Return configuration data
+ //
+ *pSize = Size;
+ return PartialResourceList;
}
DPRINTM(DPRINT_HWDETECT, "BIOS reports %d harddisk%s\n",
(int)DiskCount, (DiskCount == 1) ? "": "s");
- FldrCreateComponentKey(BusKey,
- ControllerClass,
- DiskController,
- Output | Input | Removable,
- 0,
- 0xFFFFFFFF,
- NULL,
- &ControllerKey);
- DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
-
- //DetectBiosFloppyController(BusKey, ControllerKey);
+ //DetectBiosFloppyController(BusKey);
/* Allocate resource descriptor */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
}
}
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(SystemKey, PartialResourceList, Size);
+ FldrCreateComponentKey(BusKey,
+ ControllerClass,
+ DiskController,
+ Output | Input,
+ 0,
+ 0xFFFFFFFF,
+ NULL,
+ PartialResourceList,
+ Size,
+ &ControllerKey);
+ DPRINTM(DPRINT_HWDETECT, "Created key: DiskController\\0\n");
+
MmHeapFree(PartialResourceList);
/* Create and fill subkey for each harddisk */
for (i = 0; i < DiskCount; i++)
{
+ PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
+ ULONG Size;
CHAR Identifier[20];
/* Get disk values */
+ PartialResourceList = GetHarddiskConfigurationData(0x80 + i, &Size);
GetHarddiskIdentifier(Identifier, 0x80 + i);
/* Create disk key */
0,
0xFFFFFFFF,
Identifier,
+ PartialResourceList,
+ Size,
&DiskKey);
-
- /* Set disk values */
- SetHarddiskConfigurationData(DiskKey, 0x80 + i);
+
+ if (PartialResourceList)
+ MmHeapFree(PartialResourceList);
}
}
PCONFIGURATION_COMPONENT_DATA BusKey;
ULONG Size;
- /* Create new bus key */
- FldrCreateComponentKey(SystemKey,
- AdapterClass,
- MultiFunctionAdapter,
- 0x0,
- 0x0,
- 0xFFFFFFFF,
- "ISA",
- &BusKey);
-
- /* Increment bus number */
- (*BusNumber)++;
-
/* Set 'Configuration Data' value */
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
PartialResourceList->Revision = 1;
PartialResourceList->Count = 0;
- /* Set 'Configuration Data' value */
- FldrSetConfigurationData(BusKey, PartialResourceList, Size);
- MmHeapFree(PartialResourceList);
+ /* Create new bus key */
+ FldrCreateComponentKey(SystemKey,
+ AdapterClass,
+ MultiFunctionAdapter,
+ 0x0,
+ 0x0,
+ 0xFFFFFFFF,
+ "ISA",
+ PartialResourceList,
+ Size,
+ &BusKey);
+
+ /* Increment bus number */
+ (*BusNumber)++;
+ MmHeapFree(PartialResourceList);
/* Detect ISA/BIOS devices */
DetectBiosDisks(SystemKey, BusKey);