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/loc... ============================================================================== --- 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... ============================================================================== --- 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;