Author: phater
Date: Fri Nov 4 09:38:21 2016
New Revision: 73120
URL:
http://svn.reactos.org/svn/reactos?rev=73120&view=rev
Log:
[MSAFD] Disable setting blocking mode if there are WSPAsyncSelect or WSPEventSelect
pending calls. CORE-12104
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
Modified: trunk/reactos/dll/win32/msafd/misc/dllmain.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msafd/misc/dllma…
==============================================================================
--- trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msafd/misc/dllmain.c [iso-8859-1] Fri Nov 4 09:38:21 2016
@@ -2264,6 +2264,22 @@
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);