- if( CantReadMore( FCB ) ) {
- /* Success here means that we got an EOF. Complete a pending read
- * with zero bytes if we haven't yet overread, then kill the others.
- */
- while( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_RECV] ) ) {
- NextIrpEntry =
- RemoveHeadList(&FCB->PendingIrpList[FUNCTION_RECV]);
- NextIrp =
- CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry);
- NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp );
- RecvReq = NextIrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
-
- AFD_DbgPrint(MID_TRACE,("Completing recv %x (%d)\n", NextIrp,
- TotalBytesCopied));
- UnlockBuffers( RecvReq->BufferArray,
- RecvReq->BufferCount, FALSE );
- Status = NextIrp->IoStatus.Status =
- FCB->Overread ? STATUS_END_OF_FILE : STATUS_SUCCESS;
- NextIrp->IoStatus.Information = 0;
- if( NextIrp == Irp ) RetStatus = Status;
- if( NextIrp->MdlAddress ) UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) );
- IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
- FCB->Overread = TRUE;
- //FCB->PollState |= AFD_EVENT_DISCONNECT;
- PollReeval( FCB->DeviceExt, FCB->FileObject );
- }
- } else {
- /* Kick the user that receive would be possible now */
- /* XXX Not implemented yet */
-
- AFD_DbgPrint(MID_TRACE,("FCB %x Receive data waiting %d\n",
- FCB, FCB->Recv.Content));
- /*OskitDumpBuffer( FCB->Recv.Window, FCB->Recv.Content );*/
-
- /* Try to clear some requests */
- while( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_RECV] ) ) {
- NextIrpEntry =
- RemoveHeadList(&FCB->PendingIrpList[FUNCTION_RECV]);
- NextIrp =
- CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry);
- NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp );
- RecvReq = NextIrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
-
- AFD_DbgPrint(MID_TRACE,("RecvReq @ %x\n", RecvReq));
-
- Status = TryToSatisfyRecvRequestFromBuffer
- ( FCB, RecvReq, &TotalBytesCopied );
-
- if( Status == STATUS_PENDING ) {
- AFD_DbgPrint(MID_TRACE,("Ran out of data for %x\n", NextIrp));
- InsertHeadList(&FCB->PendingIrpList[FUNCTION_RECV],
- &NextIrp->Tail.Overlay.ListEntry);
- break;
- } else {
- AFD_DbgPrint(MID_TRACE,("Completing recv %x (%d)\n", NextIrp,
- TotalBytesCopied));
- UnlockBuffers( RecvReq->BufferArray,
- RecvReq->BufferCount, FALSE );
- NextIrp->IoStatus.Status = Status;
- NextIrp->IoStatus.Information = TotalBytesCopied;
- if( NextIrp == Irp ) {
- RetStatus = Status;
- RetBytesCopied = TotalBytesCopied;
- }
- if( NextIrp->MdlAddress ) UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) );
- IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
- }
+ /* Kick the user that receive would be possible now */
+ /* XXX Not implemented yet */
+
+ AFD_DbgPrint(MID_TRACE,("FCB %x Receive data waiting %d\n",
+ FCB, FCB->Recv.Content));
+
+ /* Try to clear some requests */
+ while( !IsListEmpty( &FCB->PendingIrpList[FUNCTION_RECV] ) ) {
+ NextIrpEntry = RemoveHeadList(&FCB->PendingIrpList[FUNCTION_RECV]);
+ NextIrp = CONTAINING_RECORD(NextIrpEntry, IRP, Tail.Overlay.ListEntry);
+ NextIrpSp = IoGetCurrentIrpStackLocation( NextIrp );
+ RecvReq = NextIrpSp->Parameters.DeviceIoControl.Type3InputBuffer;
+
+ AFD_DbgPrint(MID_TRACE,("RecvReq @ %x\n", RecvReq));
+
+ Status = TryToSatisfyRecvRequestFromBuffer( FCB, RecvReq, &TotalBytesCopied );
+
+ if( Status == STATUS_PENDING ) {
+ AFD_DbgPrint(MID_TRACE,("Ran out of data for %x\n", NextIrp));
+ InsertHeadList(&FCB->PendingIrpList[FUNCTION_RECV],
+ &NextIrp->Tail.Overlay.ListEntry);
+ break;
+ } else {
+ AFD_DbgPrint(MID_TRACE,("Completing recv %x (%d)\n", NextIrp,
+ TotalBytesCopied));
+ UnlockBuffers( RecvReq->BufferArray,
+ RecvReq->BufferCount, FALSE );
+ NextIrp->IoStatus.Status = Status;
+ NextIrp->IoStatus.Information = TotalBytesCopied;
+ if( NextIrp == Irp ) {
+ RetStatus = Status;
+ RetBytesCopied = TotalBytesCopied;