Author: hpoussin
Date: Mon Dec 3 11:04:26 2007
New Revision: 30977
URL:
http://svn.reactos.org/svn/reactos?rev=30977&view=rev
Log:
Remove "Unknown device" wizards
Modified:
trunk/reactos/boot/bootdata/hivesys.inf
trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
Modified: trunk/reactos/boot/bootdata/hivesys.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys.inf?…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesys.inf (original)
+++ trunk/reactos/boot/bootdata/hivesys.inf Mon Dec 3 11:04:26 2007
@@ -36,9 +36,6 @@
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"
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnpmgr.c Mon Dec 3 11:04:26 2007
@@ -2147,11 +2147,14 @@
ZwClose(InstanceKey);
- DeviceNode->Flags |= DNF_PROCESSED;
-
- /* Report the device to the user-mode pnp manager */
- IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
- &DeviceNode->InstancePath);
+ IopDeviceNodeSetFlag(DeviceNode, DNF_PROCESSED);
+
+ if (!IopDeviceNodeHasFlag(DeviceNode, DNF_LEGACY_DRIVER))
+ {
+ /* Report the device to the user-mode pnp manager */
+ IopQueueTargetDeviceEvent(&GUID_DEVICE_ARRIVAL,
+ &DeviceNode->InstancePath);
+ }
return STATUS_SUCCESS;
}
Modified: trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/pnpmgr/pnproot…
==============================================================================
--- trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c (original)
+++ trunk/reactos/ntoskrnl/io/pnpmgr/pnproot.c Mon Dec 3 11:04:26 2007
@@ -328,6 +328,7 @@
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];
@@ -405,8 +406,16 @@
/* Terminate the string */
KeyInfo->Name[KeyInfo->NameLength / sizeof(WCHAR)] = 0;
+ /* 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 */
- RtlInitUnicodeString(&SubKeyName, KeyInfo->Name);
InitializeObjectAttributes(
&ObjectAttributes,
&SubKeyName,