Author: cgutman
Date: Sun Aug 24 15:50:17 2008
New Revision: 35614
URL:
http://svn.reactos.org/svn/reactos?rev=35614&view=rev
Log:
- Merge aicom-network-fixes up to r35611
Modified:
trunk/reactos/drivers/network/afd/afd/listen.c
trunk/reactos/drivers/network/afd/afd/read.c
trunk/reactos/drivers/network/afd/afd/tdiconn.c
trunk/reactos/drivers/network/afd/afd/write.c
Modified: trunk/reactos/drivers/network/afd/afd/listen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/li…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/listen.c [iso-8859-1] Sun Aug 24 15:50:17 2008
@@ -330,8 +330,10 @@
ExFreePool( PendingConnObj );
- if( IsListEmpty( &FCB->PendingConnections ) )
+ if( IsListEmpty( &FCB->PendingConnections ) ) {
FCB->PollState &= ~AFD_EVENT_ACCEPT;
+ PollReeval( FCB->DeviceExt, FCB->FileObject );
+ }
SocketStateUnlock( FCB );
return Irp->IoStatus.Status;
Modified: trunk/reactos/drivers/network/afd/afd/read.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Sun Aug 24 15:50:17 2008
@@ -98,6 +98,7 @@
if( FCB->Recv.BytesUsed == FCB->Recv.Content ) {
FCB->Recv.BytesUsed = FCB->Recv.Content = 0;
FCB->PollState &= ~AFD_EVENT_RECEIVE;
+ PollReeval( FCB->DeviceExt, FCB->FileObject );
if( !FCB->ReceiveIrp.InFlightRequest ) {
AFD_DbgPrint(MID_TRACE,("Replenishing buffer\n"));
@@ -480,12 +481,16 @@
DatagramRecv->Address =
TaCopyTransportAddress( FCB->AddressFrom->RemoteAddress );
- InsertTailList( &FCB->DatagramList, &DatagramRecv->ListEntry );
+ if( !DatagramRecv->Address ) Status = STATUS_NO_MEMORY;
+
} else Status = STATUS_NO_MEMORY;
if( !NT_SUCCESS( Status ) ) {
+ if( DatagramRecv ) ExFreePool( DatagramRecv );
SocketStateUnlock( FCB );
return Status;
+ } else {
+ InsertTailList( &FCB->DatagramList, &DatagramRecv->ListEntry );
}
/* Satisfy as many requests as we can */
Modified: trunk/reactos/drivers/network/afd/afd/tdiconn.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/td…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/tdiconn.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/tdiconn.c [iso-8859-1] Sun Aug 24 15:50:17 2008
@@ -122,8 +122,10 @@
ExAllocatePool(NonPagedPool,
sizeof(TDI_CONNECTION_INFORMATION) +
TdiAddressSize);
- if (!ConnInfo)
- return STATUS_INSUFFICIENT_RESOURCES;
+ if (!ConnInfo) {
+ *ConnectionInfo = NULL;
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
Status = TdiBuildNullConnectionInfoInPlace( ConnInfo, Type );
Modified: trunk/reactos/drivers/network/afd/afd/write.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/wr…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Sun Aug 24 15:50:17 2008
@@ -140,8 +140,9 @@
SocketCalloutLeave( FCB );
} else {
FCB->PollState |= AFD_EVENT_SEND;
- PollReeval( FCB->DeviceExt, FCB->FileObject );
- }
+ }
+
+ PollReeval( FCB->DeviceExt, FCB->FileObject );
if( TotalBytesCopied > 0 ) {
UnlockBuffers( SendReq->BufferArray, SendReq->BufferCount, FALSE );
@@ -395,6 +396,8 @@
FCB->EventsFired &= ~AFD_EVENT_SEND;
FCB->PollState &= ~AFD_EVENT_SEND;
+ PollReeval( FCB->DeviceExt, FCB->FileObject );
+
/* Check that the socket is bound */
if( FCB->State != SOCKET_STATE_BOUND )
return UnlockAndMaybeComplete