Remove "Unknown device" wizards
authorHervé Poussineau <hpoussin@reactos.org>
Mon, 3 Dec 2007 08:04:26 +0000 (08:04 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Mon, 3 Dec 2007 08:04:26 +0000 (08:04 +0000)
svn path=/trunk/; revision=30977

reactos/boot/bootdata/hivesys.inf
reactos/ntoskrnl/io/pnpmgr/pnpmgr.c
reactos/ntoskrnl/io/pnpmgr/pnproot.c

index ebbefdc..0054aef 100644 (file)
@@ -36,9 +36,6 @@ HKLM,"SYSTEM\CurrentControlSet\Control\DeviceClasses",,0x00000012
 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"
index b62ad63..3ad01f8 100644 (file)
@@ -2147,11 +2147,14 @@ IopActionInterrogateDeviceStack(PDEVICE_NODE DeviceNode,
 
    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;
 }
index 23e281e..b5b4a83 100644 (file)
@@ -328,6 +328,7 @@ EnumerateDevices(
   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 @@ EnumerateDevices(
     /* 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,