mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 21:22:24 +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
|
#endif
|
||||||
|
|
||||||
if( FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS )
|
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 ) {
|
switch( FCB->State ) {
|
||||||
case SOCKET_STATE_CONNECTED:
|
case SOCKET_STATE_CONNECTED:
|
||||||
|
|
|
@ -229,7 +229,7 @@ AfdConnectedSocketWriteData(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||||
PTDI_CONNECTION_INFORMATION TargetAddress;
|
PTDI_CONNECTION_INFORMATION TargetAddress;
|
||||||
|
|
||||||
/* Check that the socket is bound */
|
/* 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,
|
return UnlockAndMaybeComplete( FCB, STATUS_INVALID_PARAMETER, Irp,
|
||||||
0 );
|
0 );
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue