Author: cgutman
Date: Sun Aug 1 23:42:33 2010
New Revision: 48403
URL:
http://svn.reactos.org/svn/reactos?rev=48403&view=rev
Log:
[AFD]: Fix read data corruption when peeking at network data (TDI_RECEIVE_PEEK is
specified for a stream socket)
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] Sun Aug 1 23:42:33 2010
@@ -80,7 +80,7 @@
static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
PAFD_RECV_INFO RecvReq,
PUINT TotalBytesCopied ) {
- UINT i, BytesToCopy = 0,
+ UINT i, BytesToCopy = 0, FcbBytesCopied = FCB->Recv.BytesUsed;
BytesAvailable =
FCB->Recv.Content - FCB->Recv.BytesUsed;
PAFD_MAPBUF Map;
@@ -115,12 +115,13 @@
BytesToCopy));
RtlCopyMemory( Map[i].BufferAddress,
- FCB->Recv.Window + FCB->Recv.BytesUsed,
+ FCB->Recv.Window + FcbBytesCopied,
BytesToCopy );
MmUnmapLockedPages( Map[i].BufferAddress, Map[i].Mdl );
*TotalBytesCopied += BytesToCopy;
+ FcbBytesCopied += BytesToCopy;
if (!(RecvReq->TdiFlags & TDI_RECEIVE_PEEK)) {
FCB->Recv.BytesUsed += BytesToCopy;