From 8b969e61ec1f7ac14f8036c46fb1242648347dd7 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 7 Oct 2011 05:23:16 +0000 Subject: [PATCH] [KBDCLASS/MOUCLASS] - Fix a race condition in IRP queuing that can cause an assertion to fail in the cancellation routine svn path=/trunk/; revision=54041 --- reactos/drivers/input/kbdclass/kbdclass.c | 4 ++-- reactos/drivers/input/mouclass/mouclass.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reactos/drivers/input/kbdclass/kbdclass.c b/reactos/drivers/input/kbdclass/kbdclass.c index f7fe08facae..38da20ccb88 100644 --- a/reactos/drivers/input/kbdclass/kbdclass.c +++ b/reactos/drivers/input/kbdclass/kbdclass.c @@ -804,6 +804,8 @@ HandleReadIrp( } else { + IoMarkIrpPending(Irp); + DeviceExtension->PendingIrp = Irp; (VOID)IoSetCancelRoutine(Irp, ClassCancelRoutine); if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL)) { @@ -812,8 +814,6 @@ HandleReadIrp( } else { - IoMarkIrpPending(Irp); - DeviceExtension->PendingIrp = Irp; Status = STATUS_PENDING; } } diff --git a/reactos/drivers/input/mouclass/mouclass.c b/reactos/drivers/input/mouclass/mouclass.c index 987e84ffd6e..775931b9701 100644 --- a/reactos/drivers/input/mouclass/mouclass.c +++ b/reactos/drivers/input/mouclass/mouclass.c @@ -781,6 +781,8 @@ HandleReadIrp( } else { + IoMarkIrpPending(Irp); + DeviceExtension->PendingIrp = Irp; (VOID)IoSetCancelRoutine(Irp, ClassCancelRoutine); if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL)) { @@ -789,8 +791,6 @@ HandleReadIrp( } else { - IoMarkIrpPending(Irp); - DeviceExtension->PendingIrp = Irp; Status = STATUS_PENDING; } }