From 978a879fe90c76fa1ef27389eb76275a13040649 Mon Sep 17 00:00:00 2001 From: Art Yerkes Date: Sat, 23 Aug 2008 23:04:15 +0000 Subject: [PATCH] Catch failure to release the cancel spinlock. Would've spotted my error in tcpip.sys. svn path=/trunk/; revision=35581 --- reactos/ntoskrnl/io/iomgr/irp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/reactos/ntoskrnl/io/iomgr/irp.c b/reactos/ntoskrnl/io/iomgr/irp.c index 0f7b11e19f1..d9e6b9ebe6a 100644 --- a/reactos/ntoskrnl/io/iomgr/irp.c +++ b/reactos/ntoskrnl/io/iomgr/irp.c @@ -970,12 +970,14 @@ NTAPI IoCancelIrp(IN PIRP Irp) { KIRQL OldIrql; + KIRQL IrqlAtEntry; PDRIVER_CANCEL CancelRoutine; IOTRACE(IO_IRP_DEBUG, "%s - Canceling IRP %p\n", __FUNCTION__, Irp); ASSERT(Irp->Type == IO_TYPE_IRP); + IrqlAtEntry = KeGetCurrentIrql(); /* Acquire the cancel lock and cancel the IRP */ IoAcquireCancelSpinLock(&OldIrql); @@ -999,6 +1001,7 @@ IoCancelIrp(IN PIRP Irp) /* Set the cancel IRQL And call the routine */ Irp->CancelIrql = OldIrql; CancelRoutine(IoGetCurrentIrpStackLocation(Irp)->DeviceObject, Irp); + ASSERT(IrqlAtEntry == KeGetCurrentIrql()); return TRUE; }