Author: cfinck
Date: Sat May 31 07:51:22 2008
New Revision: 33786
URL:
http://svn.reactos.org/svn/reactos?rev=33786&view=rev
Log:
Implement support for MSG_PEEK.
Patch by Art Yerkes with small fix by me to make it working correctly. (verified with a
test app)
Modified:
trunk/reactos/drivers/network/afd/afd/read.c
Modified: trunk/reactos/drivers/network/afd/afd/read.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/re…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/read.c [iso-8859-1] Sat May 31 07:51:22 2008
@@ -85,9 +85,12 @@
MmUnmapLockedPages( Map[i].BufferAddress, Map[i].Mdl );
- FCB->Recv.BytesUsed += BytesToCopy;
- *TotalBytesCopied += BytesToCopy;
- BytesAvailable -= BytesToCopy;
+ *TotalBytesCopied += BytesToCopy;
+
+ if (!(RecvReq->TdiFlags & TDI_RECEIVE_PEEK)) {
+ FCB->Recv.BytesUsed += BytesToCopy;
+ BytesAvailable -= BytesToCopy;
+ }
}
}
@@ -405,8 +408,11 @@
MmUnmapLockedPages( Map[0].BufferAddress, Map[0].Mdl );
- FCB->Recv.BytesUsed = 0;
- *TotalBytesCopied = BytesToCopy;
+ *TotalBytesCopied = BytesToCopy;
+
+ if (!RecvReq->TdiFlags & TDI_RECEIVE_PEEK) {
+ FCB->Recv.BytesUsed = 0;
+ }
}
Status = Irp->IoStatus.Status = STATUS_SUCCESS;