[AFD]: BytesAvailable needs to be updated even when peeking so we don't run off the...
[reactos.git] / reactos / drivers / network / afd / afd / read.c
index dd55e0f..339a012 100644 (file)
@@ -122,11 +122,10 @@ static NTSTATUS TryToSatisfyRecvRequestFromBuffer( PAFD_FCB FCB,
 
             *TotalBytesCopied += BytesToCopy;
                        FcbBytesCopied += BytesToCopy;
+                       BytesAvailable -= BytesToCopy;
 
-            if (!(RecvReq->TdiFlags & TDI_RECEIVE_PEEK)) {
+            if (!(RecvReq->TdiFlags & TDI_RECEIVE_PEEK))
                 FCB->Recv.BytesUsed += BytesToCopy;
-                BytesAvailable -= BytesToCopy;
-            }
                }
     }