Revert simplification of SearchForLegacyDrivers done in r21188, because it breaks...
authorHervé Poussineau <hpoussin@reactos.org>
Sun, 26 Feb 2006 12:14:48 +0000 (12:14 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Sun, 26 Feb 2006 12:14:48 +0000 (12:14 +0000)
svn path=/trunk/; revision=21195

reactos/drivers/input/kbdclass/kbdclass.c

index 7308264..d039b08 100644 (file)
@@ -747,11 +747,33 @@ SearchForLegacyDrivers(
                        continue;
                }
 
                        continue;
                }
 
-               Status = ClassAddDevice(DriverObject, PortDeviceObject);
-               if (!NT_SUCCESS(Status))
+               /* Connect the port device object */
+               if (DriverExtension->ConnectMultiplePorts)
+               {
+                       Status = ConnectPortDriver(PortDeviceObject, DriverExtension->MainClassDeviceObject);
+                       if (!NT_SUCCESS(Status))
+                       {
+                               /* FIXME: Log the error */
+                               DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
+                       }
+               }
+               else
                {
                {
-                       /* FIXME: Log the error */
-                       DPRINT("ClassAddDevice() failed with status 0x%08lx\n", Status);
+                       PDEVICE_OBJECT ClassDO;
+                       Status = CreateClassDeviceObject(DriverObject, &ClassDO);
+                       if (!NT_SUCCESS(Status))
+                       {
+                               /* FIXME: Log the error */
+                               DPRINT("CreatePointerClassDeviceObject() failed with status 0x%08lx\n", Status);
+                               continue;
+                       }
+                       Status = ConnectPortDriver(PortDeviceObject, ClassDO);
+                       if (!NT_SUCCESS(Status))
+                       {
+                               /* FIXME: Log the error */
+                               DPRINT("ConnectPortDriver() failed with status 0x%08lx\n", Status);
+                               IoDeleteDevice(ClassDO);
+                       }
                }
        }
        if (Status == STATUS_NO_MORE_ENTRIES)
                }
        }
        if (Status == STATUS_NO_MORE_ENTRIES)