[ros-diffs] [fireball] 27615: - Firstly mark the IRP as pending, and only then release the lock (otherwise IRP is firstly completed/freed, and then tried to be marked as pending). This makes FireFox 1.5 working again. - NULLify handle in case of TdiOpenDevice() failure.

fireball at svn.reactos.org fireball at svn.reactos.org
Thu Jul 12 14:38:25 CEST 2007


Author: fireball
Date: Thu Jul 12 16:38:25 2007
New Revision: 27615

URL: http://svn.reactos.org/svn/reactos?rev=27615&view=rev
Log:
- Firstly mark the IRP as pending, and only then release the lock (otherwise IRP is firstly completed/freed, and then tried to be marked as pending). This makes FireFox 1.5 working again.
- NULLify handle in case of TdiOpenDevice() failure.

Modified:
    trunk/reactos/drivers/network/afd/afd/lock.c
    trunk/reactos/drivers/network/afd/afd/tdi.c

Modified: trunk/reactos/drivers/network/afd/afd/lock.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/lock.c?rev=27615&r1=27614&r2=27615&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/lock.c (original)
+++ trunk/reactos/drivers/network/afd/afd/lock.c Thu Jul 12 16:38:25 2007
@@ -237,10 +237,15 @@
   UINT Information,
   PIO_COMPLETION_ROUTINE Completion,
   BOOL ShouldUnlock ) {
+
+    if( Status == STATUS_PENDING ) {
+	/* We should firstly mark this IRP as pending, because 
+	   otherwise it may be completed by StreamSocketConnectComplete()
+	   before we return from SocketStateUnlock(). */
+	IoMarkIrpPending( Irp );
     SocketStateUnlock( FCB );
-    if( Status == STATUS_PENDING ) {
-	IoMarkIrpPending( Irp );
     } else {
+	SocketStateUnlock( FCB );
 	Irp->IoStatus.Status = Status;
 	Irp->IoStatus.Information = Information;
 	if( Completion )

Modified: trunk/reactos/drivers/network/afd/afd/tdi.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/tdi.c?rev=27615&r1=27614&r2=27615&view=diff
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/tdi.c (original)
+++ trunk/reactos/drivers/network/afd/afd/tdi.c Thu Jul 12 16:38:25 2007
@@ -143,6 +143,7 @@
         }
     } else {
         AFD_DbgPrint(MIN_TRACE, ("ZwCreateFile() failed with status (0x%X)\n", Status));
+        *Handle = NULL;
     }
 
     return Status;




More information about the Ros-diffs mailing list