[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
This commit is contained in:
Cameron Gutman 2011-10-07 05:23:16 +00:00
parent bfafe61483
commit 8b969e61ec
2 changed files with 4 additions and 4 deletions

View file

@ -804,6 +804,8 @@ HandleReadIrp(
} }
else else
{ {
IoMarkIrpPending(Irp);
DeviceExtension->PendingIrp = Irp;
(VOID)IoSetCancelRoutine(Irp, ClassCancelRoutine); (VOID)IoSetCancelRoutine(Irp, ClassCancelRoutine);
if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL)) if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL))
{ {
@ -812,8 +814,6 @@ HandleReadIrp(
} }
else else
{ {
IoMarkIrpPending(Irp);
DeviceExtension->PendingIrp = Irp;
Status = STATUS_PENDING; Status = STATUS_PENDING;
} }
} }

View file

@ -781,6 +781,8 @@ HandleReadIrp(
} }
else else
{ {
IoMarkIrpPending(Irp);
DeviceExtension->PendingIrp = Irp;
(VOID)IoSetCancelRoutine(Irp, ClassCancelRoutine); (VOID)IoSetCancelRoutine(Irp, ClassCancelRoutine);
if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL)) if (Irp->Cancel && IoSetCancelRoutine(Irp, NULL))
{ {
@ -789,8 +791,6 @@ HandleReadIrp(
} }
else else
{ {
IoMarkIrpPending(Irp);
DeviceExtension->PendingIrp = Irp;
Status = STATUS_PENDING; Status = STATUS_PENDING;
} }
} }