Author: cgutman
Date: Sat Aug 23 16:53:37 2008
New Revision: 35578
URL:
http://svn.reactos.org/svn/reactos?rev=35578&view=rev
Log:
- Code cleanup
- Make sure FCB->RemoteAddress is non-NULL
Modified:
branches/aicom-network-fixes/drivers/network/afd/afd/connect.c
Modified: branches/aicom-network-fixes/drivers/network/afd/afd/connect.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/drivers/net…
==============================================================================
--- branches/aicom-network-fixes/drivers/network/afd/afd/connect.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/drivers/network/afd/afd/connect.c [iso-8859-1] Sat Aug 23
16:53:37 2008
@@ -33,7 +33,6 @@
}
NTSTATUS MakeSocketIntoConnection( PAFD_FCB FCB ) {
- NTSTATUS Status;
/* Allocate the receive area and start receiving */
FCB->Recv.Window =
@@ -51,16 +50,14 @@
FCB->State = SOCKET_STATE_CONNECTED;
- Status = TdiReceive( &FCB->ReceiveIrp.InFlightRequest,
- FCB->Connection.Object,
- TDI_RECEIVE_NORMAL,
- FCB->Recv.Window,
- FCB->Recv.Size,
- &FCB->ReceiveIrp.Iosb,
- ReceiveComplete,
- FCB );
-
- return Status;
+ return TdiReceive( &FCB->ReceiveIrp.InFlightRequest,
+ FCB->Connection.Object,
+ TDI_RECEIVE_NORMAL,
+ FCB->Recv.Window,
+ FCB->Recv.Size,
+ &FCB->ReceiveIrp.Iosb,
+ ReceiveComplete,
+ FCB );
}
static NTSTATUS NTAPI StreamSocketConnectComplete
@@ -84,15 +81,15 @@
if( NT_SUCCESS(Irp->IoStatus.Status) ) {
FCB->PollState |= AFD_EVENT_CONNECT | AFD_EVENT_SEND;
+ AFD_DbgPrint(MID_TRACE,("Going to connected state %d\n", FCB->State));
FCB->State = SOCKET_STATE_CONNECTED;
- AFD_DbgPrint(MID_TRACE,("Going to connected state %d\n", FCB->State));
- PollReeval( FCB->DeviceExt, FCB->FileObject );
} else {
FCB->PollState |= AFD_EVENT_CONNECT_FAIL | AFD_EVENT_RECEIVE;
AFD_DbgPrint(MID_TRACE,("Going to bound state\n"));
FCB->State = SOCKET_STATE_BOUND;
- PollReeval( FCB->DeviceExt, FCB->FileObject );
- }
+ }
+
+ PollReeval( FCB->DeviceExt, FCB->FileObject );
/* Succeed pending irps on the FUNCTION_CONNECT list */
while( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_CONNECT] ) ) {
@@ -199,6 +196,11 @@
FCB->RemoteAddress =
TaCopyTransportAddress( &ConnectReq->RemoteAddress );
+ if( !FCB->RemoteAddress ) {
+ Status = STATUS_NO_MEMORY;
+ break;
+ }
+
if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS )
{
Status = STATUS_SUCCESS;