[ros-diffs] [cgutman] 41629: - Acquire the cancel spin lock before calling IoSetCancelRoutine - Remove some extra junk

cgutman at svn.reactos.org cgutman at svn.reactos.org
Sun Jun 28 10:32:00 CEST 2009


Author: cgutman
Date: Sat Jun 27 07:14:06 2009
New Revision: 41629

URL: http://svn.reactos.org/svn/reactos?rev=41629&view=rev
Log:
 - Acquire the cancel spin lock before calling IoSetCancelRoutine
 - Remove some extra junk

Modified:
    trunk/reactos/drivers/network/tcpip/tcpip/irp.c

Modified: trunk/reactos/drivers/network/tcpip/tcpip/irp.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpip/irp.c?rev=41629&r1=41628&r2=41629&view=diff
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/irp.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/irp.c [iso-8859-1] Sat Jun 27 07:14:06 2009
@@ -16,10 +16,7 @@
 }
 
 NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) {
-    KIRQL Irql;
-    PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
-
-    //DbgPrint("Called: Irp %x, Status %x Event %x\n", Irp, Status, Irp->UserEvent);
+    KIRQL OldIrql;
 
     UntrackFL( __FILE__, __LINE__, Irp, IRP_TAG );
 
@@ -28,15 +25,11 @@
     if( Status == STATUS_PENDING )
 	IoMarkIrpPending( Irp );
     else {
-	Irql = KeGetCurrentIrql();
+        IoAcquireCancelSpinLock(&OldIrql);
+	(void)IoSetCancelRoutine( Irp, NULL );
+        IoReleaseCancelSpinLock(OldIrql);
 
-	(void)IoSetCancelRoutine( Irp, NULL );
 	IoCompleteRequest( Irp, IO_NETWORK_INCREMENT );
-	if (KeGetCurrentIrql() != Irql) {
-	    DbgPrint("WARNING: IO COMPLETION RETURNED AT WRONG IRQL:\n");
-	    DbgPrint("WARNING: IRP TYPE WAS %d\n", IrpSp->MajorFunction);
-	}
-	ASSERT(KeGetCurrentIrql() == Irql);
     }
 
     return Status;



More information about the Ros-diffs mailing list