IoCancelIrp didnt remove the cancel routine from the irp after canceling it

svn path=/trunk/; revision=13853
This commit is contained in:
Gunnar Dalsnes 2005-03-06 13:48:04 +00:00
parent 4369eecce7
commit c02ae1b606

View file

@ -204,18 +204,23 @@ BOOLEAN STDCALL
IoCancelIrp(PIRP Irp) IoCancelIrp(PIRP Irp)
{ {
KIRQL oldlvl; KIRQL oldlvl;
PDRIVER_CANCEL CancelRoutine;
DPRINT("IoCancelIrp(Irp %x)\n",Irp); DPRINT("IoCancelIrp(Irp %x)\n",Irp);
IoAcquireCancelSpinLock(&oldlvl); IoAcquireCancelSpinLock(&oldlvl);
Irp->Cancel = TRUE; Irp->Cancel = TRUE;
if (Irp->CancelRoutine == NULL)
CancelRoutine = IoSetCancelRoutine(Irp, NULL);
if (CancelRoutine == NULL)
{ {
IoReleaseCancelSpinLock(oldlvl); IoReleaseCancelSpinLock(oldlvl);
return(FALSE); return(FALSE);
} }
Irp->CancelIrql = oldlvl; Irp->CancelIrql = oldlvl;
Irp->CancelRoutine(IoGetCurrentIrpStackLocation(Irp)->DeviceObject, Irp); CancelRoutine(IoGetCurrentIrpStackLocation(Irp)->DeviceObject, Irp);
return(TRUE); return(TRUE);
} }