2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Serial mouse driver
4 * FILE: drivers/input/sermouse/misc.c
5 * PURPOSE: Misceallenous operations
7 * PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
16 ForwardIrpAndWaitCompletion(
17 IN PDEVICE_OBJECT DeviceObject
,
21 if (Irp
->PendingReturned
)
22 KeSetEvent((PKEVENT
)Context
, IO_NO_INCREMENT
, FALSE
);
23 return STATUS_MORE_PROCESSING_REQUIRED
;
28 IN PDEVICE_OBJECT DeviceObject
,
31 PDEVICE_OBJECT LowerDevice
= ((PSERMOUSE_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
)->LowerDevice
;
35 KeInitializeEvent(&Event
, NotificationEvent
, FALSE
);
36 IoCopyCurrentIrpStackLocationToNext(Irp
);
38 DPRINT("Calling lower device %p [%wZ]\n", LowerDevice
, &LowerDevice
->DriverObject
->DriverName
);
39 IoSetCompletionRoutine(Irp
, ForwardIrpAndWaitCompletion
, &Event
, TRUE
, TRUE
, TRUE
);
41 Status
= IoCallDriver(LowerDevice
, Irp
);
42 if (Status
== STATUS_PENDING
)
44 Status
= KeWaitForSingleObject(&Event
, Suspended
, KernelMode
, FALSE
, NULL
);
45 if (NT_SUCCESS(Status
))
46 Status
= Irp
->IoStatus
.Status
;
54 IN PDEVICE_OBJECT DeviceObject
,
57 PDEVICE_OBJECT LowerDevice
= ((PSERMOUSE_DEVICE_EXTENSION
)DeviceObject
->DeviceExtension
)->LowerDevice
;
59 IoSkipCurrentIrpStackLocation(Irp
);
60 return IoCallDriver(LowerDevice
, Irp
);