Author: cgutman
Date: Sat Mar 27 01:00:21 2010
New Revision: 46479
URL:
http://svn.reactos.org/svn/reactos?rev=46479&view=rev
Log:
[AFD]
- Allow connection requests for connectionless sockets (they associate a default remote
address with the socket required for use in AfdConnectedSocketWriteData and
AfdConnectedSocketReadData)
- Add a check for a disconnected socket
Modified:
trunk/reactos/drivers/network/afd/afd/connect.c
trunk/reactos/drivers/network/afd/afd/write.c
Modified: trunk/reactos/drivers/network/afd/afd/connect.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/co…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/connect.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/connect.c [iso-8859-1] Sat Mar 27 01:00:21 2010
@@ -380,7 +380,18 @@
#endif
if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS )
- return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp, 0 );
+ {
+ if( FCB->RemoteAddress ) ExFreePool( FCB->RemoteAddress );
+ FCB->RemoteAddress =
+ TaCopyTransportAddress( &ConnectReq->RemoteAddress );
+
+ if( !FCB->RemoteAddress )
+ Status = STATUS_NO_MEMORY;
+ else
+ Status = STATUS_SUCCESS;
+
+ return UnlockAndMaybeComplete( FCB, Status, Irp, 0 );
+ }
switch( FCB->State ) {
case SOCKET_STATE_CONNECTED:
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] Sat Mar 27 01:00:21 2010
@@ -229,7 +229,7 @@
PTDI_CONNECTION_INFORMATION TargetAddress;
/* Check that the socket is bound */
- if( FCB->State != SOCKET_STATE_BOUND )
+ if( FCB->State != SOCKET_STATE_BOUND || !FCB->RemoteAddress )
return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp,
0 );