Author: cfinck
Date: Sat May 31 07:53:55 2008
New Revision: 33787
URL:
http://svn.reactos.org/svn/reactos?rev=33787&view=rev
Log:
Implement support for FIONREAD in WSPIoctl. (hope I did it properly)
It works correctly with the wininet I'll commit later and a test app I wrote myself.
Modified:
trunk/reactos/dll/win32/msafd/misc/dllmain.c
trunk/reactos/drivers/network/afd/afd/info.c
trunk/reactos/include/reactos/drivers/afd/shared.h
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 May 31 07:53:55 2008
@@ -1517,6 +1517,9 @@
Handle, Socket->SharedData.NonBlocking));
return 0;
+ case FIONREAD:
+ return GetSocketInformation(Socket, AFD_INFO_RECEIVE_CONTENT_SIZE,
(PULONG)lpvOutBuffer, NULL);
+
default:
*lpErrno = WSAEINVAL;
return SOCKET_ERROR;
Modified: trunk/reactos/drivers/network/afd/afd/info.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/in…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/info.c [iso-8859-1] Sat May 31 07:53:55 2008
@@ -47,6 +47,14 @@
case AFD_INFO_BLOCKING_MODE:
InfoReq->Information.Ulong = 0;
break;
+
+ case AFD_INFO_RECEIVE_CONTENT_SIZE:
+ /* Only touch InfoReq if we actually have a valid connection.
+ Behaviour was verified under WinXP SP2. */
+ if(FCB->Connection.Handle)
+ InfoReq->Information.Ulong = FCB->Recv.Content -
FCB->Recv.BytesUsed;
+
+ break;
default:
AFD_DbgPrint(MID_TRACE,("Unknown info id %x\n",
Modified: trunk/reactos/include/reactos/drivers/afd/shared.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/drivers/af…
==============================================================================
--- trunk/reactos/include/reactos/drivers/afd/shared.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/drivers/afd/shared.h [iso-8859-1] Sat May 31 07:53:55
2008
@@ -149,6 +149,7 @@
#define AFD_INFO_RECEIVE_WINDOW_SIZE 0x06L
#define AFD_INFO_SEND_WINDOW_SIZE 0x07L
#define AFD_INFO_GROUP_ID_TYPE 0x10L
+#define AFD_INFO_RECEIVE_CONTENT_SIZE 0x11L
/* AFD Share Flags */
#define AFD_SHARE_UNIQUE 0x0L