Author: cgutman
Date: Fri Oct 7 05:23:16 2011
New Revision: 54041
URL:
http://svn.reactos.org/svn/reactos?rev=54041&view=rev
Log:
[KBDCLASS/MOUCLASS]
- Fix a race condition in IRP queuing that can cause an assertion to fail in the
cancellation routine
Modified:
trunk/reactos/drivers/input/kbdclass/kbdclass.c
trunk/reactos/drivers/input/mouclass/mouclass.c
Modified: trunk/reactos/drivers/input/kbdclass/kbdclass.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/kbdclass/kbd…
==============================================================================
--- trunk/reactos/drivers/input/kbdclass/kbdclass.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/kbdclass/kbdclass.c [iso-8859-1] Fri Oct 7 05:23:16 2011
@@ -804,6 +804,8 @@
}
else
{
+ IoMarkIrpPending(Irp);
+ DeviceExtension->PendingIrp = Irp;
(VOID)IoSetCancelRoutine(Irp, ClassCancelRoutine);
if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL))
{
@@ -812,8 +814,6 @@
}
else
{
- IoMarkIrpPending(Irp);
- DeviceExtension->PendingIrp = Irp;
Status = STATUS_PENDING;
}
}
Modified: trunk/reactos/drivers/input/mouclass/mouclass.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/input/mouclass/mou…
==============================================================================
--- trunk/reactos/drivers/input/mouclass/mouclass.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/input/mouclass/mouclass.c [iso-8859-1] Fri Oct 7 05:23:16 2011
@@ -781,6 +781,8 @@
}
else
{
+ IoMarkIrpPending(Irp);
+ DeviceExtension->PendingIrp = Irp;
(VOID)IoSetCancelRoutine(Irp, ClassCancelRoutine);
if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL))
{
@@ -789,8 +791,6 @@
}
else
{
- IoMarkIrpPending(Irp);
- DeviceExtension->PendingIrp = Irp;
Status = STATUS_PENDING;
}
}