HKLM,"SYSTEM\CurrentControlSet\Control\IDConfigDB",,0x00000012
HKLM,"SYSTEM\CurrentControlSet\Control\IDConfigDB","CurrentConfig",0x00010001,0x00000000
HKLM,"SYSTEM\CurrentControlSet\Control\IDConfigDB\Hardware Profiles\0000","FriendlyName",0x00000000,"New Hardware Profile"
-; The following line is only here to prevent the "New hardware wizard" to display a window for "Unknown device".
-; This device comes from Root plug and play bus (ntoskrnl/io/pnproot.c) and this one should never appear
-HKLM,"SYSTEM\CurrentControlSet\Enum\Root\LEGACY_UNKNOWN\0000","ConfigFlags",0x00010001,0x00000040
; Keyboard Layouts
HKLM,"SYSTEM\CurrentControlSet\Control\KeyboardLayouts\00000406","Layout File",0x00000000,"kbdda.dll"
ZwClose(InstanceKey);
- DeviceNode->Flags |= DNF_PROCESSED;
+ IopDeviceNodeSetFlag(DeviceNode, DNF_PROCESSED);
- /* Report the device to the user-mode pnp manager */
- IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
- &DeviceNode->InstancePath);
+ if (!IopDeviceNodeHasFlag(DeviceNode, DNF_LEGACY_DRIVER))
+ {
+ /* Report the device to the user-mode pnp manager */
+ IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
+ &DeviceNode->InstancePath);
+ }
return STATUS_SUCCESS;
}
PPNPROOT_FDO_DEVICE_EXTENSION DeviceExtension;
OBJECT_ATTRIBUTES ObjectAttributes;
PKEY_BASIC_INFORMATION KeyInfo = NULL, SubKeyInfo = NULL;
+ UNICODE_STRING LegacyU = RTL_CONSTANT_STRING(L"LEGACY_");
UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"\\Registry\\Machine\\" REGSTR_PATH_SYSTEMENUM L"\\" REGSTR_KEY_ROOTENUM);
UNICODE_STRING SubKeyName;
WCHAR DevicePath[MAX_PATH + 1];
/* Terminate the string */
KeyInfo->Name[KeyInfo->NameLength / sizeof(WCHAR)] = 0;
- /* Open the key */
+ /* Check if it is a legacy driver */
RtlInitUnicodeString(&SubKeyName, KeyInfo->Name);
+ if (RtlPrefixUnicodeString(&LegacyU, &SubKeyName, FALSE))
+ {
+ DPRINT("Ignoring legacy driver '%wZ'\n", &SubKeyName);
+ Index1++;
+ continue;
+ }
+
+ /* Open the key */
InitializeObjectAttributes(
&ObjectAttributes,
&SubKeyName,