mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 19:26:32 +00:00
[AFD]: Fix read data corruption when peeking at network data (TDI_RECEIVE_PEEK is specified for a stream socket)
svn path=/trunk/; revision=48403
This commit is contained in:
@@ -80,7 +80,7 @@ static VOID RefillSocketBuffer( PAFD_FCB FCB ) {
|
||||
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 @@ static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user