Implement support for MSG_PEEK.

Patch by Art Yerkes with small fix by me to make it working correctly. (verified with a test app)

svn path=/trunk/; revision=33786
This commit is contained in:
Colin Finck 2008-05-31 12:51:22 +00:00
parent cb57056f4b
commit 923017639c

View file

@ -85,9 +85,12 @@ static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
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 @@ SatisfyPacketRecvRequest( PAFD_FCB FCB, PIRP Irp,
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;