mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 08:06:46 +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:
parent
be40e4a043
commit
e98fc993d1
1 changed files with 3 additions and 2 deletions
|
@ -80,7 +80,7 @@ static VOID RefillSocketBuffer( PAFD_FCB FCB ) {
|
||||||
static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
|
static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
|
||||||
PAFD_RECV_INFO RecvReq,
|
PAFD_RECV_INFO RecvReq,
|
||||||
PUINT TotalBytesCopied ) {
|
PUINT TotalBytesCopied ) {
|
||||||
UINT i, BytesToCopy = 0,
|
UINT i, BytesToCopy = 0, FcbBytesCopied = FCB->Recv.BytesUsed;
|
||||||
BytesAvailable =
|
BytesAvailable =
|
||||||
FCB->Recv.Content - FCB->Recv.BytesUsed;
|
FCB->Recv.Content - FCB->Recv.BytesUsed;
|
||||||
PAFD_MAPBUF Map;
|
PAFD_MAPBUF Map;
|
||||||
|
@ -115,12 +115,13 @@ static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
|
||||||
BytesToCopy));
|
BytesToCopy));
|
||||||
|
|
||||||
RtlCopyMemory( Map[i].BufferAddress,
|
RtlCopyMemory( Map[i].BufferAddress,
|
||||||
FCB->Recv.Window + FCB->Recv.BytesUsed,
|
FCB->Recv.Window + FcbBytesCopied,
|
||||||
BytesToCopy );
|
BytesToCopy );
|
||||||
|
|
||||||
MmUnmapLockedPages( Map[i].BufferAddress, Map[i].Mdl );
|
MmUnmapLockedPages( Map[i].BufferAddress, Map[i].Mdl );
|
||||||
|
|
||||||
*TotalBytesCopied += BytesToCopy;
|
*TotalBytesCopied += BytesToCopy;
|
||||||
|
FcbBytesCopied += BytesToCopy;
|
||||||
|
|
||||||
if (!(RecvReq->TdiFlags & TDI_RECEIVE_PEEK)) {
|
if (!(RecvReq->TdiFlags & TDI_RECEIVE_PEEK)) {
|
||||||
FCB->Recv.BytesUsed += BytesToCopy;
|
FCB->Recv.BytesUsed += BytesToCopy;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue