- 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

svn path=/trunk/; revision=46479
This commit is contained in:
Cameron Gutman 2010-03-27 00:00:21 +00:00
parent e8ce733165
commit c0ce6da513
2 changed files with 13 additions and 2 deletions

View file

@ -380,7 +380,18 @@ AfdStreamSocketConnect(PDEVICE_OBJECT DeviceObject, PIRP Irp,
#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:

View file

@ -229,7 +229,7 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
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 );