mirror of
https://github.com/reactos/reactos.git
synced 2026-06-21 21:22:49 +08:00
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. svn path=/trunk/; revision=33787
This commit is contained in:
@@ -1517,6 +1517,9 @@ WSPIoctl(
|
||||
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;
|
||||
|
||||
@@ -48,6 +48,14 @@ AfdGetInfo( PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||
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",
|
||||
InfoReq->InformationClass));
|
||||
|
||||
@@ -149,6 +149,7 @@ typedef struct _AFD_DISCONNECT_INFO {
|
||||
#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
|
||||
|
||||
Reference in New Issue
Block a user