Wait the opening of mouclass device to connect the underlying mouse port driver
Modified: trunk/reactos/drivers/input/mouclass/mouclass.c

Modified: trunk/reactos/drivers/input/mouclass/mouclass.c
--- trunk/reactos/drivers/input/mouclass/mouclass.c	2005-06-03 16:57:55 UTC (rev 15750)
+++ trunk/reactos/drivers/input/mouclass/mouclass.c	2005-06-03 17:09:47 UTC (rev 15751)
@@ -19,6 +19,8 @@
 #define NDEBUG
 #include <debug.h>
 
+PDEVICE_OBJECT MouclassDeviceObject;
+
 BOOLEAN MouseClassCallBack(
    PDEVICE_OBJECT ClassDeviceObject, PMOUSE_INPUT_DATA MouseDataStart,
    PMOUSE_INPUT_DATA MouseDataEnd, PULONG ConsumedCount)
@@ -160,7 +162,7 @@
    switch (Stack->MajorFunction)
    {
       case IRP_MJ_CREATE:
-         Status = STATUS_SUCCESS;
+         Status = ConnectMousePortDriver(MouclassDeviceObject);
          break;
 
       case IRP_MJ_CLOSE:
@@ -264,13 +266,7 @@
       return Status;
    }
 
-   Status = ConnectMousePortDriver(DeviceObject);
-   if (!NT_SUCCESS(Status))
-   {
-      IoDeleteSymbolicLink(&SymlinkName);
-      IoDeleteDevice(DeviceObject);
-      return Status;
-   }
+   MouclassDeviceObject = DeviceObject;
 
    return STATUS_SUCCESS;
 }