mirror of
https://github.com/reactos/reactos.git
synced 2024-08-05 11:00:55 +00:00
[NTOSKRNL]
- Don't always use the value name as the device description - Fixes bug 3416 svn path=/trunk/; revision=46500
This commit is contained in:
parent
79cb786ef5
commit
fd3fa1abb6
|
@ -2192,6 +2192,7 @@ IopEnumerateDetectedDevices(
|
||||||
UNICODE_STRING HardwareIdKey;
|
UNICODE_STRING HardwareIdKey;
|
||||||
PUNICODE_STRING pHardwareId;
|
PUNICODE_STRING pHardwareId;
|
||||||
ULONG DeviceIndex = 0;
|
ULONG DeviceIndex = 0;
|
||||||
|
BOOLEAN IsDeviceDesc;
|
||||||
|
|
||||||
if (RelativePath)
|
if (RelativePath)
|
||||||
{
|
{
|
||||||
|
@ -2418,16 +2419,19 @@ IopEnumerateDetectedDevices(
|
||||||
{
|
{
|
||||||
pHardwareId = &HardwareIdSerial;
|
pHardwareId = &HardwareIdSerial;
|
||||||
DeviceIndex = DeviceIndexSerial++;
|
DeviceIndex = DeviceIndexSerial++;
|
||||||
|
IsDeviceDesc = TRUE;
|
||||||
}
|
}
|
||||||
else if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierKeyboard, FALSE) == 0)
|
else if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierKeyboard, FALSE) == 0)
|
||||||
{
|
{
|
||||||
pHardwareId = &HardwareIdKeyboard;
|
pHardwareId = &HardwareIdKeyboard;
|
||||||
DeviceIndex = DeviceIndexKeyboard++;
|
DeviceIndex = DeviceIndexKeyboard++;
|
||||||
|
IsDeviceDesc = FALSE;
|
||||||
}
|
}
|
||||||
else if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierMouse, FALSE) == 0)
|
else if (RelativePath && RtlCompareUnicodeString(RelativePath, &IdentifierMouse, FALSE) == 0)
|
||||||
{
|
{
|
||||||
pHardwareId = &HardwareIdMouse;
|
pHardwareId = &HardwareIdMouse;
|
||||||
DeviceIndex = DeviceIndexMouse++;
|
DeviceIndex = DeviceIndexMouse++;
|
||||||
|
IsDeviceDesc = FALSE;
|
||||||
}
|
}
|
||||||
else if (NT_SUCCESS(Status))
|
else if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -2436,17 +2440,20 @@ IopEnumerateDetectedDevices(
|
||||||
{
|
{
|
||||||
pHardwareId = &HardwareIdPci;
|
pHardwareId = &HardwareIdPci;
|
||||||
DeviceIndex = DeviceIndexPci++;
|
DeviceIndex = DeviceIndexPci++;
|
||||||
|
IsDeviceDesc = FALSE;
|
||||||
}
|
}
|
||||||
else if (RtlCompareUnicodeString(&ValueName, &IdentifierIsa, FALSE) == 0)
|
else if (RtlCompareUnicodeString(&ValueName, &IdentifierIsa, FALSE) == 0)
|
||||||
{
|
{
|
||||||
pHardwareId = &HardwareIdIsa;
|
pHardwareId = &HardwareIdIsa;
|
||||||
DeviceIndex = DeviceIndexIsa++;
|
DeviceIndex = DeviceIndexIsa++;
|
||||||
|
IsDeviceDesc = FALSE;
|
||||||
}
|
}
|
||||||
#ifdef ENABLE_ACPI
|
#ifdef ENABLE_ACPI
|
||||||
else if (RtlCompareUnicodeString(&ValueName, &IdentifierAcpi, FALSE) == 0)
|
else if (RtlCompareUnicodeString(&ValueName, &IdentifierAcpi, FALSE) == 0)
|
||||||
{
|
{
|
||||||
pHardwareId = &HardwareIdAcpi;
|
pHardwareId = &HardwareIdAcpi;
|
||||||
DeviceIndex = DeviceIndexAcpi++;
|
DeviceIndex = DeviceIndexAcpi++;
|
||||||
|
IsDeviceDesc = FALSE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
else /* Now let's detect devices with a device number at the end */
|
else /* Now let's detect devices with a device number at the end */
|
||||||
|
@ -2459,12 +2466,14 @@ IopEnumerateDetectedDevices(
|
||||||
{
|
{
|
||||||
pHardwareId = &HardwareIdFloppy;
|
pHardwareId = &HardwareIdFloppy;
|
||||||
DeviceIndex = DeviceIndexFloppy++;
|
DeviceIndex = DeviceIndexFloppy++;
|
||||||
|
IsDeviceDesc = FALSE;
|
||||||
}
|
}
|
||||||
/* Nope, is it a parallel port? */
|
/* Nope, is it a parallel port? */
|
||||||
else if (RtlCompareUnicodeString(&ValueName, &IdentifierParallel, FALSE) == 0)
|
else if (RtlCompareUnicodeString(&ValueName, &IdentifierParallel, FALSE) == 0)
|
||||||
{
|
{
|
||||||
pHardwareId = &HardwareIdParallel;
|
pHardwareId = &HardwareIdParallel;
|
||||||
DeviceIndex = DeviceIndexParallel++;
|
DeviceIndex = DeviceIndexParallel++;
|
||||||
|
IsDeviceDesc = FALSE;
|
||||||
}
|
}
|
||||||
/* Nope, out of ideas so let's skip this one */
|
/* Nope, out of ideas so let's skip this one */
|
||||||
else
|
else
|
||||||
|
@ -2522,6 +2531,8 @@ IopEnumerateDetectedDevices(
|
||||||
goto nextdevice;
|
goto nextdevice;
|
||||||
}
|
}
|
||||||
DPRINT("Found %wZ #%lu (%wZ)\n", &ValueName, DeviceIndex, &HardwareIdKey);
|
DPRINT("Found %wZ #%lu (%wZ)\n", &ValueName, DeviceIndex, &HardwareIdKey);
|
||||||
|
if (IsDeviceDesc)
|
||||||
|
{
|
||||||
Status = ZwSetValueKey(hLevel2Key, &DeviceDescU, 0, REG_SZ, ValueName.Buffer, ValueName.MaximumLength);
|
Status = ZwSetValueKey(hLevel2Key, &DeviceDescU, 0, REG_SZ, ValueName.Buffer, ValueName.MaximumLength);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
@ -2529,6 +2540,7 @@ IopEnumerateDetectedDevices(
|
||||||
ZwDeleteKey(hLevel2Key);
|
ZwDeleteKey(hLevel2Key);
|
||||||
goto nextdevice;
|
goto nextdevice;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Status = ZwSetValueKey(hLevel2Key, &HardwareIDU, 0, REG_MULTI_SZ, pHardwareId->Buffer, pHardwareId->MaximumLength);
|
Status = ZwSetValueKey(hLevel2Key, &HardwareIDU, 0, REG_MULTI_SZ, pHardwareId->Buffer, pHardwareId->MaximumLength);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue