Author: cgutman Date: Thu Oct 23 14:44:30 2008 New Revision: 36918
URL: http://svn.reactos.org/svn/reactos?rev=36918&view=rev Log: - Fix a typo - Add one more lock that I forgot - Fix a possible irp double completion
Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c
Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/netw... ============================================================================== --- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Thu Oct 23 14:44:30 2008 @@ -485,18 +485,22 @@ IrpSp = IoGetCurrentIrpStackLocation(Irp); DisReq = (PTDI_REQUEST_KERNEL_DISCONNECT)&IrpSp->Parameters;
+ TcpipRecursiveMutexEnter( &TCPLock, TRUE ); + /* Get associated connection endpoint file object. Quit if none exists */
TranContext = IrpSp->FileObject->FsContext; if (!TranContext) { TI_DbgPrint(MID_TRACE, ("Bad transport context.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; }
Connection = (PCONNECTION_ENDPOINT)TranContext->Handle.ConnectionContext; if (!Connection) { TI_DbgPrint(MID_TRACE, ("No connection endpoint file object.\n")); - return STATUS_INVALID_CONNECTION; + Status = STATUS_INVALID_CONNECTION; + goto done; }
Status = TCPDisconnect( @@ -507,7 +511,15 @@ DispDataRequestComplete, Irp );
- TI_DbgPrint(MAX_TRACE, ("TCP Connect returned %08x\n", Status)); +done: + if (Status != STATUS_PENDING) { + DispDataRequestComplete(Irp, Status, 0); + } else + IoMarkIrpPending(Irp); + + TcpipRecursiveMutexLeave( &TCPLock ); + + TI_DbgPrint(MAX_TRACE, ("TCP Disconnect returned %08x\n", Status));
return Status; } @@ -1490,7 +1502,7 @@
TI_DbgPrint(DEBUG_IRP, ("Completing IRP at (0x%X).\n", Irp));
- return IRPFinish(Irp, STATUS_INVALID_PARAMETER); + return Irp->IoStatus.Status; }
Status = DispPrepareIrpForCancel(TranContext, Irp, NULL);
Modified: branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c URL: http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/netw... ============================================================================== --- branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c [iso-8859-1] (original) +++ branches/aicom-network-fixes/drivers/network/tcpip/tcpip/main.c [iso-8859-1] Thu Oct 23 14:44:30 2008 @@ -437,6 +437,7 @@
case TDI_DISCONNECT: Status = DispTdiDisconnect(Irp); + Complete = FALSE; break;
case TDI_ASSOCIATE_ADDRESS: