- Refactor creation of component data under the HARDWARE\DESCRIPTION node to use separate routines in a new ARC file, so that registry routines are factored out of the process. This allows 1) Better portability with PPC branch (which will need to do the same kind of hardware work) 2) Ability to eventually get rid of the registry calls and build a true ARC hardware device tree instead (which the kernel will have to parse during boot). The idea is to remove registry writing support from freeldr (because the code is old and freeldr shouldn't be touching the registry anyway). Patch by Alex.

svn path=/trunk/; revision=31113
This commit is contained in:
Aleksey Bragin 2007-12-09 20:17:56 +00:00
parent a0da7760d4
commit 0e2f7faae4
7 changed files with 397 additions and 735 deletions

View file

@ -233,41 +233,12 @@ HalpCalibrateStallExecution(VOID)
delay_count /= (MILLISEC / 2); /* Calculate delay_count for 1ms */
}
VOID
SetComponentInformation(FRLDRHKEY ComponentKey,
ULONG Flags,
ULONG Key,
ULONG Affinity)
{
CM_COMPONENT_INFORMATION CompInfo;
LONG Error;
CompInfo.Flags = Flags;
CompInfo.Version = 0;
CompInfo.Key = Key;
CompInfo.Affinity = Affinity;
/* Set 'Component Information' value */
Error = RegSetValue(ComponentKey,
L"Component Information",
REG_BINARY,
(PCHAR)&CompInfo,
sizeof(CM_COMPONENT_INFORMATION));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
}
}
static VOID
DetectPnpBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
{
PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
PCM_PNP_BIOS_DEVICE_NODE DeviceNode;
PCM_PNP_BIOS_INSTALLATION_CHECK InstData;
WCHAR Buffer[80];
FRLDRHKEY BusKey;
ULONG x;
ULONG NodeSize = 0;
@ -278,7 +249,6 @@ DetectPnpBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
ULONG PnpBufferSize;
ULONG Size;
char *Ptr;
LONG Error;
InstData = (PCM_PNP_BIOS_INSTALLATION_CHECK)PnpBiosSupported();
if (InstData == NULL || strncmp((CHAR*)InstData->Signature, "$PnP", 4))
@ -304,38 +274,18 @@ DetectPnpBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
DbgPrint((DPRINT_HWDETECT, "MaxNodeSize %u NodeCount %u\n", NodeSize, NodeCount));
DbgPrint((DPRINT_HWDETECT, "Estimated buffer size %u\n", NodeSize * NodeCount));
/* Create new bus key */
swprintf(Buffer,
L"MultifunctionAdapter\\%u", *BusNumber);
Error = RegCreateKey(SystemKey,
Buffer,
&BusKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
return;
}
/* Increment bus number */
/* Create component key */
FldrCreateComponentKey(SystemKey, L"MultifunctionAdapter", *BusNumber, &BusKey);
(*BusNumber)++;
/* Set 'Component Information' value similar to my NT4 box */
SetComponentInformation(BusKey,
/* Set the component information */
FldrSetComponentInformation(BusKey,
0x0,
0x0,
0xFFFFFFFF);
/* Set 'Identifier' value */
Error = RegSetValue(BusKey,
L"Identifier",
REG_SZ,
(PCHAR)L"PNP BIOS",
9 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
return;
}
/* Set the identifier */
FldrSetIdentifier(BusKey, L"PNP BIOS");
/* Set 'Configuration Data' value */
Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) + (NodeSize * NodeCount);
@ -405,19 +355,8 @@ DetectPnpBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
DbgPrint((DPRINT_HWDETECT, "Real buffer size: %u\n", PnpBufferSize));
DbgPrint((DPRINT_HWDETECT, "Resource size: %u\n", Size));
/* Set 'Configuration Data' value */
Error = RegSetValue(BusKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(BusKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
}
}
@ -431,7 +370,6 @@ SetHarddiskConfigurationData(FRLDRHKEY DiskKey,
EXTENDED_GEOMETRY ExtGeometry;
GEOMETRY Geometry;
ULONG Size;
LONG Error;
/* Set 'Configuration Data' value */
Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) +
@ -490,18 +428,8 @@ SetHarddiskConfigurationData(FRLDRHKEY DiskKey,
DiskGeometry->SectorsPerTrack,
DiskGeometry->BytesPerSector));
Error = RegSetValue(DiskKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(DiskKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
}
}
@ -516,7 +444,6 @@ SetHarddiskIdentifier(FRLDRHKEY DiskKey,
ULONG Signature;
WCHAR Identifier[20];
CHAR ArcName[256];
LONG Error;
/* Read the MBR */
if (!MachDiskReadLogicalSectors(DriveNumber, 0ULL, 1, (PVOID)DISKREADBUFFER))
@ -573,17 +500,7 @@ SetHarddiskIdentifier(FRLDRHKEY DiskKey,
DbgPrint((DPRINT_HWDETECT, "Identifier: %S\n", Identifier));
/* Set identifier */
Error = RegSetValue(DiskKey,
L"Identifier",
REG_SZ,
(PCHAR)Identifier,
sizeof(Identifier));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Identifier) failed (Error %u)\n",
(int)Error));
}
FldrSetIdentifier(DiskKey, Identifier);
}
@ -594,12 +511,10 @@ DetectBiosDisks(FRLDRHKEY SystemKey,
PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
PCM_INT13_DRIVE_PARAMETER Int13Drives;
GEOMETRY Geometry;
WCHAR Buffer[80];
FRLDRHKEY DiskKey;
ULONG DiskCount;
ULONG Size;
ULONG i;
LONG Error;
BOOLEAN Changed;
/* Count the number of visible drives */
@ -680,37 +595,17 @@ DetectBiosDisks(FRLDRHKEY SystemKey,
}
/* Set 'Configuration Data' value */
Error = RegSetValue(SystemKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(SystemKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
/* Create and fill subkey for each harddisk */
for (i = 0; i < DiskCount; i++)
{
/* Create disk key */
swprintf (Buffer,
L"DiskController\\0\\DiskPeripheral\\%u",
i);
Error = RegCreateKey(BusKey,
Buffer,
FldrCreateComponentKey(BusKey,
L"DiskController\\0\\DiskPeripheral",
i,
&DiskKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create drive key\n"));
continue;
}
DbgPrint((DPRINT_HWDETECT, "Created key: %S\n", Buffer));
/* Set disk values */
SetHarddiskConfigurationData(DiskKey, 0x80 + i);
@ -764,11 +659,9 @@ DetectBiosFloppyPeripheral(FRLDRHKEY ControllerKey)
PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
PCM_FLOPPY_DEVICE_DATA FloppyData;
WCHAR KeyName[32];
WCHAR Identifier[20];
FRLDRHKEY PeripheralKey;
ULONG Size;
LONG Error;
ULONG FloppyNumber;
UCHAR FloppyType;
ULONG MaxDensity[6] = {0, 360, 1200, 720, 1440, 2880};
@ -785,21 +678,13 @@ DetectBiosFloppyPeripheral(FRLDRHKEY ControllerKey)
Ptr = GetInt1eTable();
swprintf(KeyName, L"FloppyDiskPeripheral\\%u", FloppyNumber);
Error = RegCreateKey(ControllerKey,
KeyName,
FldrCreateComponentKey(ControllerKey,
L"FloppyDiskPeripheral",
FloppyNumber,
&PeripheralKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create peripheral key\n"));
return;
}
DbgPrint((DPRINT_HWDETECT, "Created key: %S\n", KeyName));
/* Set 'ComponentInformation' value */
SetComponentInformation(PeripheralKey,
FldrSetComponentInformation(PeripheralKey,
0x0,
FloppyNumber,
0xFFFFFFFF);
@ -838,33 +723,12 @@ DetectBiosFloppyPeripheral(FRLDRHKEY ControllerKey)
FloppyData->DataTransferRate = 0;
/* Set 'Configuration Data' value */
Error = RegSetValue(PeripheralKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(PeripheralKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
/* Set 'Identifier' value */
swprintf(Identifier, L"FLOPPY%u", FloppyNumber + 1);
Error = RegSetValue(PeripheralKey,
L"Identifier",
REG_SZ,
(PCHAR)Identifier,
(wcslen(Identifier) + 1) * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue() failed (Error %u)\n",
(int)Error));
}
FldrSetIdentifier(PeripheralKey, Identifier);
}
}
@ -877,7 +741,6 @@ DetectBiosFloppyController(FRLDRHKEY SystemKey,
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
FRLDRHKEY ControllerKey;
ULONG Size;
LONG Error;
ULONG FloppyCount;
FloppyCount = GetFloppyCount();
@ -888,20 +751,15 @@ DetectBiosFloppyController(FRLDRHKEY SystemKey,
if (FloppyCount == 0)
return;
Error = RegCreateKey(BusKey,
L"DiskController\\0",
FldrCreateComponentKey(SystemKey,
L"DiskController",
0,
&ControllerKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create controller key\n"));
return;
}
DbgPrint((DPRINT_HWDETECT, "Created key: DiskController\\0\n"));
/* Set 'ComponentInformation' value */
SetComponentInformation(ControllerKey,
0x64,
FldrSetComponentInformation(ControllerKey,
Output | Input | Removable,
0,
0xFFFFFFFF);
@ -950,19 +808,8 @@ DetectBiosFloppyController(FRLDRHKEY SystemKey,
PartialDescriptor->u.Dma.Port = 0;
/* Set 'Configuration Data' value */
Error = RegSetValue(ControllerKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(ControllerKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
DetectBiosFloppyPeripheral(ControllerKey);
}
@ -1153,7 +1000,6 @@ DetectSerialPointerPeripheral(FRLDRHKEY ControllerKey,
ULONG i;
ULONG j;
ULONG k;
LONG Error;
DbgPrint((DPRINT_HWDETECT,
"DetectSerialPointerPeripheral()\n"));
@ -1281,21 +1127,16 @@ DetectSerialPointerPeripheral(FRLDRHKEY ControllerKey,
}
/* Create 'PointerPeripheral' key */
Error = RegCreateKey(ControllerKey,
L"PointerPeripheral\\0",
FldrCreateComponentKey(ControllerKey,
L"PointerPeripheral",
0,
&PeripheralKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"Failed to create peripheral key\n"));
return;
}
DbgPrint((DPRINT_HWDETECT,
"Created key: PointerPeripheral\\0\n"));
/* Set 'ComponentInformation' value */
SetComponentInformation(PeripheralKey,
0x20,
FldrSetComponentInformation(PeripheralKey,
Input,
0,
0xFFFFFFFF);
@ -1307,31 +1148,13 @@ DetectSerialPointerPeripheral(FRLDRHKEY ControllerKey,
FullResourceDescriptor.PartialResourceList.Revision = 1;
FullResourceDescriptor.PartialResourceList.Count = 0;
Error = RegSetValue(PeripheralKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR)&FullResourceDescriptor,
FldrSetConfigurationData(PeripheralKey,
&FullResourceDescriptor,
sizeof(CM_FULL_RESOURCE_DESCRIPTOR) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
}
/* Set 'Identifier' value */
Error = RegSetValue(PeripheralKey,
L"Identifier",
REG_SZ,
(PCHAR)Identifier,
(wcslen(Identifier) + 1) * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue() failed (Error %u)\n",
(int)Error));
}
FldrSetIdentifier(PeripheralKey, Identifier);
}
}
@ -1349,7 +1172,6 @@ DetectSerialPorts(FRLDRHKEY BusKey)
ULONG ControllerNumber = 0;
FRLDRHKEY ControllerKey;
ULONG i;
LONG Error;
ULONG Size;
DbgPrint((DPRINT_HWDETECT, "DetectSerialPorts()\n"));
@ -1368,23 +1190,14 @@ DetectSerialPorts(FRLDRHKEY BusKey)
Base));
/* Create controller key */
swprintf(Buffer,
L"SerialController\\%u",
ControllerNumber);
Error = RegCreateKey(BusKey,
Buffer,
FldrCreateComponentKey(BusKey,
L"SerialController",
ControllerNumber,
&ControllerKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create controller key\n"));
continue;
}
DbgPrint((DPRINT_HWDETECT, "Created key: %S\n", Buffer));
/* Set 'ComponentInformation' value */
SetComponentInformation(ControllerKey,
0x78,
FldrSetComponentInformation(ControllerKey,
Output | Input | ConsoleIn | ConsoleOut,
ControllerNumber,
0xFFFFFFFF);
@ -1438,35 +1251,12 @@ DetectSerialPorts(FRLDRHKEY BusKey)
SerialDeviceData->BaudClock = 1843200; /* UART Clock frequency (Hertz) */
/* Set 'Configuration Data' value */
Error = RegSetValue(ControllerKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(ControllerKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
}
/* Set 'Identifier' value */
swprintf(Buffer,
L"COM%u",
i + 1);
Error = RegSetValue(ControllerKey,
L"Identifier",
REG_SZ,
(PCHAR)Buffer,
(wcslen(Buffer) + 1) * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue() failed (Error %u)\n",
(int)Error));
continue;
}
swprintf(Buffer, L"COM%u", i + 1);
FldrSetIdentifier(ControllerKey, Buffer);
DbgPrint((DPRINT_HWDETECT,
"Created value: Identifier %s\n",
Buffer));
@ -1494,7 +1284,6 @@ DetectParallelPorts(FRLDRHKEY BusKey)
ULONG Base;
ULONG ControllerNumber;
ULONG i;
LONG Error;
ULONG Size;
DbgPrint((DPRINT_HWDETECT, "DetectParallelPorts() called\n"));
@ -1513,23 +1302,14 @@ DetectParallelPorts(FRLDRHKEY BusKey)
Base));
/* Create controller key */
swprintf(Buffer,
L"ParallelController\\%u",
ControllerNumber);
Error = RegCreateKey(BusKey,
Buffer,
FldrCreateComponentKey(BusKey,
L"ParallelController",
ControllerNumber,
&ControllerKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create controller key\n"));
continue;
}
DbgPrint((DPRINT_HWDETECT, "Created key: %S\n", Buffer));
/* Set 'ComponentInformation' value */
SetComponentInformation(ControllerKey,
0x40,
FldrSetComponentInformation(ControllerKey,
Output,
ControllerNumber,
0xFFFFFFFF);
@ -1576,35 +1356,12 @@ DetectParallelPorts(FRLDRHKEY BusKey)
}
/* Set 'Configuration Data' value */
Error = RegSetValue(ControllerKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(ControllerKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
}
/* Set 'Identifier' value */
swprintf(Buffer,
L"PARALLEL%u",
i + 1);
Error = RegSetValue(ControllerKey,
L"Identifier",
REG_SZ,
(PCHAR)Buffer,
(wcslen(Buffer) + 1) * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue() failed (Error %u)\n",
(int)Error));
continue;
}
swprintf(Buffer, L"PARALLEL%u", i + 1);
FldrSetIdentifier(ControllerKey, Buffer);
DbgPrint((DPRINT_HWDETECT,
"Created value: Identifier %s\n",
Buffer));
@ -1695,25 +1452,20 @@ DetectKeyboardPeripheral(FRLDRHKEY ControllerKey)
PCM_KEYBOARD_DEVICE_DATA KeyboardData;
FRLDRHKEY PeripheralKey;
ULONG Size;
LONG Error;
/* HACK: don't call DetectKeyboardDevice() as it fails in Qemu 0.8.2 */
if (TRUE || DetectKeyboardDevice())
{
/* Create controller key */
Error = RegCreateKey(ControllerKey,
L"KeyboardPeripheral\\0",
FldrCreateComponentKey(ControllerKey,
L"KeyboardPeripheral",
0,
&PeripheralKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create peripheral key\n"));
return;
}
DbgPrint((DPRINT_HWDETECT, "Created key: KeyboardPeripheral\\0\n"));
/* Set 'ComponentInformation' value */
SetComponentInformation(ControllerKey,
0x28,
FldrSetComponentInformation(ControllerKey,
Input | ConsoleIn,
0,
0xFFFFFFFF);
@ -1749,31 +1501,11 @@ DetectKeyboardPeripheral(FRLDRHKEY ControllerKey)
KeyboardData->KeyboardFlags = 0x20;
/* Set 'Configuration Data' value */
Error = RegSetValue(PeripheralKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR)FullResourceDescriptor,
Size);
FldrSetConfigurationData(PeripheralKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
}
/* Set 'Identifier' value */
Error = RegSetValue(PeripheralKey,
L"Identifier",
REG_SZ,
(PCHAR)L"PCAT_ENHANCED",
14 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue() failed (Error %u)\n",
(int)Error));
}
FldrSetIdentifier(PeripheralKey, L"PCAT_ENHANCED");
}
}
@ -1785,22 +1517,17 @@ DetectKeyboardController(FRLDRHKEY BusKey)
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
FRLDRHKEY ControllerKey;
ULONG Size;
LONG Error;
/* Create controller key */
Error = RegCreateKey(BusKey,
L"KeyboardController\\0",
FldrCreateComponentKey(BusKey,
L"KeyboardController",
0,
&ControllerKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create controller key\n"));
return;
}
DbgPrint((DPRINT_HWDETECT, "Created key: KeyboardController\\0\n"));
/* Set 'ComponentInformation' value */
SetComponentInformation(ControllerKey,
0x28,
FldrSetComponentInformation(ControllerKey,
Input | ConsoleIn,
0,
0xFFFFFFFF);
@ -1851,19 +1578,8 @@ DetectKeyboardController(FRLDRHKEY BusKey)
PartialDescriptor->u.Port.Length = 1;
/* Set 'Configuration Data' value */
Error = RegSetValue(ControllerKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR)FullResourceDescriptor,
Size);
FldrSetConfigurationData(ControllerKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
DetectKeyboardPeripheral(ControllerKey);
}
@ -1984,26 +1700,21 @@ DetectPS2Mouse(FRLDRHKEY BusKey)
CM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
FRLDRHKEY ControllerKey;
FRLDRHKEY PeripheralKey;
LONG Error;
if (DetectPS2AuxPort())
{
DbgPrint((DPRINT_HWDETECT, "Detected PS2 port\n"));
/* Create controller key */
Error = RegCreateKey(BusKey,
L"PointerController\\0",
FldrCreateComponentKey(BusKey,
L"PointerController",
0,
&ControllerKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create controller key\n"));
return;
}
DbgPrint((DPRINT_HWDETECT, "Created key: PointerController\\0\n"));
/* Set 'ComponentInformation' value */
SetComponentInformation(ControllerKey,
0x20,
FldrSetComponentInformation(ControllerKey,
Input,
0,
0xFFFFFFFF);
@ -2025,38 +1736,24 @@ DetectPS2Mouse(FRLDRHKEY BusKey)
FullResourceDescriptor.PartialResourceList.PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF;
/* Set 'Configuration Data' value */
Error = RegSetValue(ControllerKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR)&FullResourceDescriptor,
FldrSetConfigurationData(ControllerKey,
&FullResourceDescriptor,
sizeof(CM_FULL_RESOURCE_DESCRIPTOR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
if (DetectPS2AuxDevice())
{
DbgPrint((DPRINT_HWDETECT, "Detected PS2 mouse\n"));
/* Create peripheral key */
Error = RegCreateKey(ControllerKey,
L"PointerPeripheral\\0",
FldrCreateComponentKey(ControllerKey,
L"PointerController",
0,
&PeripheralKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create peripheral key\n"));
return;
}
DbgPrint((DPRINT_HWDETECT, "Created key: PointerPeripheral\\0\n"));
/* Set 'ComponentInformation' value */
SetComponentInformation(PeripheralKey,
0x20,
FldrSetComponentInformation(PeripheralKey,
Input,
0,
0xFFFFFFFF);
@ -2069,33 +1766,13 @@ DetectPS2Mouse(FRLDRHKEY BusKey)
FullResourceDescriptor.PartialResourceList.Count = 0;
/* Set 'Configuration Data' value */
Error = RegSetValue(PeripheralKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR)&FullResourceDescriptor,
FldrSetConfigurationData(PeripheralKey,
&FullResourceDescriptor,
sizeof(CM_FULL_RESOURCE_DESCRIPTOR) -
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
/* Set 'Identifier' value */
Error = RegSetValue(PeripheralKey,
L"Identifier",
REG_SZ,
(PCHAR)L"MICROSOFT PS2 MOUSE",
20 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue() failed (Error %u)\n",
(int)Error));
return;
}
FldrSetIdentifier(PeripheralKey, L"MICROSOFT PS2 MOUSE");
}
}
}
@ -2107,20 +1784,15 @@ DetectDisplayController(FRLDRHKEY BusKey)
WCHAR Buffer[80];
FRLDRHKEY ControllerKey;
USHORT VesaVersion;
LONG Error;
Error = RegCreateKey(BusKey,
L"DisplayController\\0",
FldrCreateComponentKey(BusKey,
L"DisplayController",
0,
&ControllerKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "Failed to create controller key\n"));
return;
}
DbgPrint((DPRINT_HWDETECT, "Created key: DisplayController\\0\n"));
/* Set 'ComponentInformation' value */
SetComponentInformation(ControllerKey,
FldrSetComponentInformation(ControllerKey,
0x00,
0,
0xFFFFFFFF);
@ -2153,18 +1825,7 @@ DetectDisplayController(FRLDRHKEY BusKey)
}
/* Set 'Identifier' value */
Error = RegSetValue(ControllerKey,
L"Identifier",
REG_SZ,
(PCHAR)Buffer,
(wcslen(Buffer) + 1) * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue() failed (Error %u)\n",
(int)Error));
return;
}
FldrSetIdentifier(ControllerKey, Buffer);
/* FIXME: Add display peripheral (monitor) data */
}
@ -2174,25 +1835,17 @@ static VOID
DetectIsaBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
{
PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
WCHAR Buffer[80];
FRLDRHKEY BusKey;
ULONG Size;
LONG Error;
/* Create new bus key */
swprintf(Buffer,
L"MultifunctionAdapter\\%u", *BusNumber);
Error = RegCreateKey(SystemKey,
Buffer,
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
&BusKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
return;
}
/* Set 'Component Information' value similar to my NT4 box */
SetComponentInformation(BusKey,
FldrSetComponentInformation(BusKey,
0x0,
0x0,
0xFFFFFFFF);
@ -2201,16 +1854,7 @@ DetectIsaBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
(*BusNumber)++;
/* Set 'Identifier' value */
Error = RegSetValue(BusKey,
L"Identifier",
REG_SZ,
(PCHAR)L"ISA",
4 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
return;
}
FldrSetIdentifier(BusKey, L"ISA");
/* Set 'Configuration Data' value */
Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR) -
@ -2232,19 +1876,8 @@ DetectIsaBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
FullResourceDescriptor->PartialResourceList.Count = 0;
/* Set 'Configuration Data' value */
Error = RegSetValue(BusKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(BusKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
/* Detect ISA/BIOS devices */
DetectBiosDisks(SystemKey, BusKey);
@ -2270,19 +1903,11 @@ PcHwDetect(VOID)
{
FRLDRHKEY SystemKey;
ULONG BusNumber = 0;
LONG Error;
DbgPrint((DPRINT_HWDETECT, "DetectHardware()\n"));
/* Create the 'System' key */
Error = RegCreateKey(NULL,
L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System",
&SystemKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
return;
}
FldrCreateSystemKey(&SystemKey);
/* Detect buses */
DetectPciBios(SystemKey, &BusNumber);

View file

@ -51,28 +51,21 @@ FindAcpiBios(VOID)
VOID
DetectAcpiBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
{
WCHAR Buffer[80];
FRLDRHKEY BiosKey;
LONG Error;
if (FindAcpiBios())
{
AcpiPresent = TRUE;
/* Create new bus key */
swprintf(Buffer,
L"MultifunctionAdapter\\%u", *BusNumber);
Error = RegCreateKey(SystemKey,
Buffer,
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
&BiosKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
return;
}
#if 0
/* Set 'Component Information' */
SetComponentInformation(BiosKey,
FldrSetComponentInformation(BiosKey,
0x0,
0x0,
0xFFFFFFFF);
@ -82,18 +75,10 @@ DetectAcpiBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
(*BusNumber)++;
/* Set 'Identifier' value */
Error = RegSetValue(BiosKey,
L"Identifier",
REG_SZ,
(PCHAR)L"ACPI BIOS",
10 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
return;
FldrSetIdentifier(BiosKey, L"ACPI BIOS");
}
}
/* FIXME: Add congiguration data */
}
/* EOF */

View file

@ -56,27 +56,19 @@ FindApmBios(VOID)
VOID
DetectApmBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
{
WCHAR Buffer[80];
FRLDRHKEY BiosKey;
LONG Error;
if (FindApmBios())
{
/* Create new bus key */
swprintf(Buffer,
L"MultifunctionAdapter\\%u", *BusNumber);
Error = RegCreateKey(SystemKey,
Buffer,
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
&BiosKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
return;
}
#if 0
/* Set 'Component Information' */
SetComponentInformation(BiosKey,
FldrSetComponentInformation(BiosKey,
0x0,
0x0,
0xFFFFFFFF);
@ -86,17 +78,7 @@ DetectApmBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
(*BusNumber)++;
/* Set 'Identifier' value */
Error = RegSetValue(BiosKey,
L"Identifier",
REG_SZ,
(PCHAR)L"APM",
4 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
return;
}
FldrSetIdentifier(BiosKey, L"APM");
}
/* FIXME: Add congiguration data */

View file

@ -147,39 +147,25 @@ DetectPciIrqRoutingTable(FRLDRHKEY BusKey)
PPCI_IRQ_ROUTING_TABLE Table;
FRLDRHKEY TableKey;
ULONG Size;
LONG Error;
Table = GetPciIrqRoutingTable();
if (Table != NULL)
{
DbgPrint((DPRINT_HWDETECT, "Table size: %u\n", Table->Size));
Error = RegCreateKey(BusKey,
L"RealModeIrqRoutingTable\\0",
FldrCreateComponentKey(BusKey,
L"RealModeIrqRoutingTable",
0,
&TableKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
return;
}
/* Set 'Component Information' */
SetComponentInformation(TableKey,
FldrSetComponentInformation(TableKey,
0x0,
0x0,
0xFFFFFFFF);
/* Set 'Identifier' value */
Error = RegSetValue(TableKey,
L"Identifier",
REG_SZ,
(PCHAR)L"PCI Real-mode IRQ Routing Table",
32 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
return;
}
FldrSetIdentifier(TableKey, L"PCI Real-mode IRQ Routing Table");
/* Set 'Configuration Data' value */
Size = FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR, PartialResourceList.PartialDescriptors) +
@ -216,19 +202,8 @@ DetectPciIrqRoutingTable(FRLDRHKEY BusKey)
Table->Size);
/* Set 'Configuration Data' value */
Error = RegSetValue(TableKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(TableKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
}
}
@ -238,10 +213,8 @@ DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
{
PCM_FULL_RESOURCE_DESCRIPTOR FullResourceDescriptor;
CM_PCI_BUS_DATA BusData;
WCHAR Buffer[80];
FRLDRHKEY BiosKey;
ULONG Size;
LONG Error;
#if 0
FRLDRHKEY BusKey;
ULONG i;
@ -252,19 +225,13 @@ DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
if (FindPciBios(&BusData))
{
/* Create new bus key */
swprintf(Buffer,
L"MultifunctionAdapter\\%u", *BusNumber);
Error = RegCreateKey(SystemKey,
Buffer,
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
&BiosKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
return;
}
/* Set 'Component Information' */
SetComponentInformation(BiosKey,
FldrSetComponentInformation(BiosKey,
0x0,
0x0,
0xFFFFFFFF);
@ -273,16 +240,7 @@ DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
(*BusNumber)++;
/* Set 'Identifier' value */
Error = RegSetValue(BiosKey,
L"Identifier",
REG_SZ,
(PCHAR)L"PCI BIOS",
9 * sizeof(WCHAR));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
return;
}
FldrSetIdentifier(BiosKey, L"PCI BIOS");
/* Set 'Configuration Data' value */
Size = sizeof(CM_FULL_RESOURCE_DESCRIPTOR);
@ -307,19 +265,8 @@ DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
FullResourceDescriptor->PartialResourceList.PartialDescriptors[0].u.BusNumber.Length = 1;
/* Set 'Configuration Data' value */
Error = RegSetValue(BiosKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
(PCHAR) FullResourceDescriptor,
Size);
FldrSetConfigurationData(BiosKey, FullResourceDescriptor, Size);
MmFreeMemory(FullResourceDescriptor);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
(int)Error));
return;
}
DetectPciIrqRoutingTable(BiosKey);
@ -333,20 +280,13 @@ DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
/* Report PCI buses */
for (i = 0; i < (ULONG)BusData.BusCount; i++)
{
swprintf(Buffer,
L"MultifunctionAdapter\\%u", *BusNumber);
Error = RegCreateKey(SystemKey,
Buffer,
&BusKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", (int)Error));
printf("RegCreateKey() failed (Error %u)\n", (int)Error);
return;
}
FldrCreateComponentKey(SystemKey,
L"MultifunctionAdapter",
*BusNumber,
&BiosKey);
/* Set 'Component Information' */
SetComponentInformation(BusKey,
FldrSetComponentInformation(BusKey,
0x0,
0x0,
0xFFFFFFFF);
@ -354,21 +294,10 @@ DetectPciBios(FRLDRHKEY SystemKey, ULONG *BusNumber)
/* Increment bus number */
(*BusNumber)++;
/* Set 'Identifier' value */
Error = RegSetValue(BusKey,
L"Identifier",
REG_SZ,
(PCSTR)szPci,
sizeof(szPci));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", (int)Error));
return;
}
FldrSetIdentifier(BiosKey, szPci);
}
#endif
}
}

View file

@ -46,6 +46,7 @@
<directory name="reactos">
<file>registry.c</file>
<file>arcname.c</file>
<file>archwsup.c</file>
<file>binhive.c</file>
<file>reactos.c</file>
</directory>

View file

@ -25,34 +25,52 @@
#include "../../reactos/registry.h"
#endif
/* CM_PARTIAL_RESOURCE_DESCRIPTOR.Flags */
#define CM_RESOURCE_PORT_MEMORY 0x0000
#define CM_RESOURCE_PORT_IO 0x0001
#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0x0000
#define CM_RESOURCE_INTERRUPT_LATCHED 0x0001
typedef struct _CM_COMPONENT_INFORMATION
{
ULONG Flags;
ULONG Version;
ULONG Key;
ULONG Affinity;
} __attribute__((packed)) CM_COMPONENT_INFORMATION, *PCM_COMPONENT_INFORMATION;
/* CM_COMPONENT_INFORMATION.Flags */
#define Failed 0x00000001
//#define ReadOnly 0x00000002
#define Removable 0x00000004
#define ConsoleIn 0x00000008
#define ConsoleOut 0x00000010
#define Input 0x00000020
#define Output 0x00000040
#define CONFIG_CMD(bus, dev_fn, where) \
(0x80000000 | (((ULONG)(bus)) << 16) | (((dev_fn) & 0x1F) << 11) | (((dev_fn) & 0xE0) << 3) | ((where) & ~3))
//
// ARC Component Configuration Routines
//
VOID
NTAPI
FldrSetComponentInformation(
IN FRLDRHKEY ComponentKey,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity
);
VOID
NTAPI
FldrSetIdentifier(
IN FRLDRHKEY ComponentKey,
IN PWCHAR Identifier
);
VOID
NTAPI
FldrCreateSystemKey(
OUT FRLDRHKEY *SystemKey
);
VOID
NTAPI
FldrCreateComponentKey(
IN FRLDRHKEY SystemKey,
IN PWCHAR BusName,
IN ULONG BusNumber,
OUT FRLDRHKEY *ComponentKey
);
VOID
NTAPI
FldrSetConfigurationData(
IN FRLDRHKEY ComponentKey,
IN PVOID ConfigurationData,
IN ULONG Size
);
/* PROTOTYPES ***************************************************************/
/* hardware.c */
@ -61,11 +79,6 @@ VOID StallExecutionProcessor(ULONG Microseconds);
VOID HalpCalibrateStallExecution(VOID);
VOID SetComponentInformation(FRLDRHKEY ComponentKey,
ULONG Flags,
ULONG Key,
ULONG Affinity);
/* hwacpi.c */
VOID DetectAcpiBios(FRLDRHKEY SystemKey, ULONG *BusNumber);

View file

@ -0,0 +1,127 @@
/*
* PROJECT: ReactOS Boot Loader (FreeLDR)
* LICENSE: GPL - See COPYING in the top level directory
* FILE: boot/freeldr/freeldr/reactos/archwsup.c
* PURPOSE: Routines for ARC Hardware Tree and Configuration Data
* PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
*/
/* INCLUDES *******************************************************************/
#include <freeldr.h>
#define NDEBUG
#include <debug.h>
/* FUNCTIONS ******************************************************************/
VOID
NTAPI
FldrSetComponentInformation(IN FRLDRHKEY ComponentKey,
IN IDENTIFIER_FLAG Flags,
IN ULONG Key,
IN ULONG Affinity)
{
CONFIGURATION_COMPONENT ConfigurationComponent;
LONG Error;
/* Build the component information */
ConfigurationComponent.Flags = Flags;
ConfigurationComponent.Version = 0;
ConfigurationComponent.Revision = 0;
ConfigurationComponent.Key = Key;
ConfigurationComponent.AffinityMask = Affinity;
/* Set the value */
Error = RegSetValue(ComponentKey,
L"Component Information",
REG_BINARY,
(PVOID)&ConfigurationComponent.Flags,
FIELD_OFFSET(CONFIGURATION_COMPONENT, ConfigurationDataLength) -
FIELD_OFFSET(CONFIGURATION_COMPONENT, Flags));
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", Error));
}
}
VOID
NTAPI
FldrSetIdentifier(IN FRLDRHKEY ComponentKey,
IN PWCHAR Identifier)
{
LONG Error;
ULONG IdentifierLength = (wcslen(Identifier) + 1) * sizeof(WCHAR);
/* Set the key */
Error = RegSetValue(ComponentKey,
L"Identifier",
REG_SZ,
(PCHAR)Identifier,
IdentifierLength);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegSetValue() failed (Error %u)\n", Error));
return;
}
}
VOID
NTAPI
FldrCreateSystemKey(OUT FRLDRHKEY *SystemKey)
{
LONG Error;
/* Create the key */
Error = RegCreateKey(NULL,
L"\\Registry\\Machine\\HARDWARE\\DESCRIPTION\\System",
SystemKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", Error));
return;
}
}
VOID
NTAPI
FldrCreateComponentKey(IN FRLDRHKEY SystemKey,
IN PWCHAR BusName,
IN ULONG BusNumber,
OUT FRLDRHKEY *ComponentKey)
{
LONG Error;
WCHAR Buffer[80];
/* Build the key name */
swprintf(Buffer, L"%s\\%u", BusName, BusNumber);
/* Create the key */
Error = RegCreateKey(SystemKey, Buffer, ComponentKey);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT, "RegCreateKey() failed (Error %u)\n", Error));
return;
}
}
VOID
NTAPI
FldrSetConfigurationData(IN FRLDRHKEY ComponentKey,
IN PVOID ConfigurationData,
IN ULONG Size)
{
LONG Error;
/* Set 'Configuration Data' value */
Error = RegSetValue(ComponentKey,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
ConfigurationData,
Size);
if (Error != ERROR_SUCCESS)
{
DbgPrint((DPRINT_HWDETECT,
"RegSetValue(Configuration Data) failed (Error %u)\n",
Error));
}
}