mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
[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 svn path=/trunk/; revision=46479
This commit is contained in:
parent
e8ce733165
commit
c0ce6da513
2 changed files with 13 additions and 2 deletions
|
@ -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:
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
Loading…
Reference in a new issue