Author: cgutman
Date: Sat Oct 3 20:21:14 2009
New Revision: 43270
URL:
http://svn.reactos.org/svn/reactos?rev=43270&view=rev
Log:
- Fix the crash in ws2_32_winetest during the ioctlsocket test
- Pass the blocking mode down to AFD
- Dedicated to encoded
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] Sat Oct 3 20:21:14 2009
@@ -1735,12 +1735,18 @@
switch( dwIoControlCode )
{
case FIONBIO:
- if( cbInBuffer < sizeof(INT) )
+ if( cbInBuffer < sizeof(INT) || IS_INTRESOURCE(lpvInBuffer) )
+ {
+ *lpErrno = WSAEFAULT;
return SOCKET_ERROR;
- Socket->SharedData.NonBlocking = *((PINT)lpvInBuffer) ? 1 : 0;
- AFD_DbgPrint(MID_TRACE,("[%x] Set nonblocking %d\n", Handle,
Socket->SharedData.NonBlocking));
- return 0;
+ }
+ return SetSocketInformation(Socket, AFD_INFO_BLOCKING_MODE,
(PULONG)lpvInBuffer, NULL);
case FIONREAD:
+ if( cbOutBuffer < sizeof(INT) || IS_INTRESOURCE(lpvOutBuffer) )
+ {
+ *lpErrno = WSAEFAULT;
+ return SOCKET_ERROR;
+ }
return GetSocketInformation(Socket, AFD_INFO_RECEIVE_CONTENT_SIZE,
(PULONG)lpvOutBuffer, NULL);
default:
*lpErrno = WSAEINVAL;