mirror of
https://github.com/reactos/reactos.git
synced 2024-10-01 06:57:08 +00:00
[MSAFD] Disable setting blocking mode if there are WSPAsyncSelect or WSPEventSelect pending calls. CORE-12104
svn path=/trunk/; revision=73120
This commit is contained in:
parent
509c345083
commit
7f3c674aee
|
@ -2264,6 +2264,22 @@ WSPIoctl(IN SOCKET Handle,
|
|||
break;
|
||||
}
|
||||
NonBlocking = *((PULONG)lpvInBuffer) ? TRUE : FALSE;
|
||||
/* Don't allow to go in blocking mode if WSPAsyncSelect or WSPEventSelect is pending */
|
||||
if (!NonBlocking)
|
||||
{
|
||||
/* If there is an WSPAsyncSelect pending, fail with WSAEINVAL */
|
||||
if (Socket->SharedData->AsyncEvents & (~Socket->SharedData->AsyncDisabledEvents))
|
||||
{
|
||||
Errno = WSAEINVAL;
|
||||
break;
|
||||
}
|
||||
/* If there is an WSPEventSelect pending, fail with WSAEINVAL */
|
||||
if (Socket->NetworkEvents)
|
||||
{
|
||||
Errno = WSAEINVAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Socket->SharedData->NonBlocking = NonBlocking ? 1 : 0;
|
||||
NeedsCompletion = FALSE;
|
||||
Errno = SetSocketInformation(Socket, AFD_INFO_BLOCKING_MODE, &NonBlocking, NULL, NULL, lpOverlapped, lpCompletionRoutine);
|
||||
|
|
Loading…
Reference in a new issue