mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[MSAFD]
- Only shutdown the socket if it has not already been shutdown - Fixes EINVAL messages svn path=/trunk/; revision=52518
This commit is contained in:
parent
3657f4ff79
commit
df556f104f
1 changed files with 21 additions and 17 deletions
|
@ -514,24 +514,28 @@ WSPCloseSocket(IN SOCKET Handle,
|
|||
{
|
||||
DisconnectInfo.Timeout = RtlConvertLongToLargeInteger(0);
|
||||
DisconnectInfo.DisconnectType = LingerWait < 0 ? AFD_DISCONNECT_SEND : AFD_DISCONNECT_ABORT;
|
||||
|
||||
/* Send IOCTL */
|
||||
Status = NtDeviceIoControlFile((HANDLE)Handle,
|
||||
SockEvent,
|
||||
NULL,
|
||||
NULL,
|
||||
&IoStatusBlock,
|
||||
IOCTL_AFD_DISCONNECT,
|
||||
&DisconnectInfo,
|
||||
sizeof(DisconnectInfo),
|
||||
NULL,
|
||||
0);
|
||||
|
||||
/* Wait for return */
|
||||
if (Status == STATUS_PENDING)
|
||||
|
||||
if (((DisconnectInfo.DisconnectType & AFD_DISCONNECT_SEND) && (!Socket->SharedData.SendShutdown)) ||
|
||||
((DisconnectInfo.DisconnectType & AFD_DISCONNECT_ABORT) && (!Socket->SharedData.ReceiveShutdown)))
|
||||
{
|
||||
WaitForSingleObject(SockEvent, INFINITE);
|
||||
Status = IoStatusBlock.Status;
|
||||
/* Send IOCTL */
|
||||
Status = NtDeviceIoControlFile((HANDLE)Handle,
|
||||
SockEvent,
|
||||
NULL,
|
||||
NULL,
|
||||
&IoStatusBlock,
|
||||
IOCTL_AFD_DISCONNECT,
|
||||
&DisconnectInfo,
|
||||
sizeof(DisconnectInfo),
|
||||
NULL,
|
||||
0);
|
||||
|
||||
/* Wait for return */
|
||||
if (Status == STATUS_PENDING)
|
||||
{
|
||||
WaitForSingleObject(SockEvent, INFINITE);
|
||||
Status = IoStatusBlock.Status;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue