Author: cgutman
Date: Sat Aug 2 09:52:19 2008
New Revision: 35038
URL:
http://svn.reactos.org/svn/reactos?rev=35038&view=rev
Log:
- We must complete the IRP if we fail because the function we were called from expects
the IRP to be completed after this call
- Return the correct status
Modified:
branches/aicom-network-fixes/drivers/network/afd/afd/listen.c
Modified: branches/aicom-network-fixes/drivers/network/afd/afd/listen.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/afd/listen.c [iso-8859-1] (original)
+++ branches/aicom-network-fixes/drivers/network/afd/afd/listen.c [iso-8859-1] Sat Aug 2
09:52:19 2008
@@ -18,7 +18,10 @@
PAFD_TDI_OBJECT_QELT Qelt ) {
PAFD_FCB FCB = NewFileObject->FsContext;
- if( !SocketAcquireStateLock( FCB ) ) return;
+ if( !SocketAcquireStateLock( FCB ) ) {
+ LostSocket( Irp );
+ return;
+ }
/* Transfer the connection to the new socket, launch the opening read */
AFD_DbgPrint(MID_TRACE,("Completing a real accept (FCB %x)\n", FCB));
@@ -203,7 +206,6 @@
NTSTATUS AfdWaitForListen( PDEVICE_OBJECT DeviceObject, PIRP Irp,
PIO_STACK_LOCATION IrpSp ) {
- NTSTATUS Status = STATUS_SUCCESS;
PFILE_OBJECT FileObject = IrpSp->FileObject;
PAFD_FCB FCB = FileObject->FsContext;
@@ -226,7 +228,7 @@
PollReeval( FCB->DeviceExt, FCB->FileObject );
SocketStateUnlock( FCB );
- return Status;
+ return Irp->IoStatus.Status;
} else {
AFD_DbgPrint(MID_TRACE,("Holding\n"));
@@ -311,10 +313,9 @@
FCB->PollState &= ~AFD_EVENT_ACCEPT;
SocketStateUnlock( FCB );
- return Status;
+ return Irp->IoStatus.Status;
}
}
- SocketStateUnlock( FCB );
- return STATUS_UNSUCCESSFUL;
-}
+ return UnlockAndMaybeComplete( FCB, STATUS_UNSUCCESSFUL, Irp, 0 , NULL );
+}