--- trunk/reactos/ntoskrnl/io/cancel.c 2005-03-06 13:41:18 UTC (rev 13852)
+++ trunk/reactos/ntoskrnl/io/cancel.c 2005-03-06 13:48:04 UTC (rev 13853)
@@ -204,18 +204,23 @@
IoCancelIrp(PIRP Irp)
{
KIRQL oldlvl;
+ PDRIVER_CANCEL CancelRoutine;
DPRINT("IoCancelIrp(Irp %x)\n",Irp);
IoAcquireCancelSpinLock(&oldlvl);
+
Irp->Cancel = TRUE;
- if (Irp->CancelRoutine == NULL)
+
+ CancelRoutine = IoSetCancelRoutine(Irp, NULL);
+ if (CancelRoutine == NULL)
{
IoReleaseCancelSpinLock(oldlvl);
return(FALSE);
}
+
Irp->CancelIrql = oldlvl;
- Irp->CancelRoutine(IoGetCurrentIrpStackLocation(Irp)->DeviceObject, Irp);
+ CancelRoutine(IoGetCurrentIrpStackLocation(Irp)->DeviceObject, Irp);
return(TRUE);
}