Wait the opening of mouclass device to connect the underlying mouse port driver

svn path=/trunk/; revision=15751
This commit is contained in:
Hervé Poussineau 2005-06-03 17:09:47 +00:00
parent 5a2cbdf365
commit 525d26d031

View file

@ -19,6 +19,8 @@
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
PDEVICE_OBJECT MouclassDeviceObject;
BOOLEAN MouseClassCallBack( BOOLEAN MouseClassCallBack(
PDEVICE_OBJECT ClassDeviceObject, PMOUSE_INPUT_DATA MouseDataStart, PDEVICE_OBJECT ClassDeviceObject, PMOUSE_INPUT_DATA MouseDataStart,
PMOUSE_INPUT_DATA MouseDataEnd, PULONG ConsumedCount) PMOUSE_INPUT_DATA MouseDataEnd, PULONG ConsumedCount)
@ -160,7 +162,7 @@ NTSTATUS STDCALL MouseClassDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
switch (Stack->MajorFunction) switch (Stack->MajorFunction)
{ {
case IRP_MJ_CREATE: case IRP_MJ_CREATE:
Status = STATUS_SUCCESS; Status = ConnectMousePortDriver(MouclassDeviceObject);
break; break;
case IRP_MJ_CLOSE: case IRP_MJ_CLOSE:
@ -264,13 +266,7 @@ DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
return Status; return Status;
} }
Status = ConnectMousePortDriver(DeviceObject); MouclassDeviceObject = DeviceObject;
if (!NT_SUCCESS(Status))
{
IoDeleteSymbolicLink(&SymlinkName);
IoDeleteDevice(DeviceObject);
return Status;
}
return STATUS_SUCCESS; return STATUS_SUCCESS;
} }