mirror of https://github.com/reactos/reactos.git
[AFD] ReceiveActivity: Don't return STATUS_FILE_CLOSED in case of FCB overread (#4972)
Based on patch by KRosUser. Remove the Overread member. The new test in ws2_32:recv confirms that this special behavior is never needed. CORE-18328
This commit is contained in:
parent
a027eb7ccb
commit
9f9b81e396
|
@ -751,9 +751,6 @@ AfdDisconnect(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||||
FCB->Recv.Content = 0;
|
FCB->Recv.Content = 0;
|
||||||
FCB->Recv.BytesUsed = 0;
|
FCB->Recv.BytesUsed = 0;
|
||||||
|
|
||||||
/* Mark us as overread to complete future reads with an error */
|
|
||||||
FCB->Overread = TRUE;
|
|
||||||
|
|
||||||
/* Set a successful receive status to indicate a shutdown on overread */
|
/* Set a successful receive status to indicate a shutdown on overread */
|
||||||
FCB->LastReceiveStatus = STATUS_SUCCESS;
|
FCB->LastReceiveStatus = STATUS_SUCCESS;
|
||||||
|
|
||||||
|
|
|
@ -175,23 +175,16 @@ static NTSTATUS ReceiveActivity( PAFD_FCB FCB, PIRP Irp ) {
|
||||||
TotalBytesCopied));
|
TotalBytesCopied));
|
||||||
UnlockBuffers( RecvReq->BufferArray,
|
UnlockBuffers( RecvReq->BufferArray,
|
||||||
RecvReq->BufferCount, FALSE );
|
RecvReq->BufferCount, FALSE );
|
||||||
if (FCB->Overread && FCB->LastReceiveStatus == STATUS_SUCCESS)
|
|
||||||
{
|
/* Unexpected disconnect by the remote host or graceful disconnect */
|
||||||
/* Overread after a graceful disconnect so complete with an error */
|
Status = FCB->LastReceiveStatus;
|
||||||
Status = STATUS_FILE_CLOSED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/* Unexpected disconnect by the remote host or initial read after a graceful disconnect */
|
|
||||||
Status = FCB->LastReceiveStatus;
|
|
||||||
}
|
|
||||||
NextIrp->IoStatus.Status = Status;
|
NextIrp->IoStatus.Status = Status;
|
||||||
NextIrp->IoStatus.Information = 0;
|
NextIrp->IoStatus.Information = 0;
|
||||||
if( NextIrp == Irp ) RetStatus = Status;
|
if( NextIrp == Irp ) RetStatus = Status;
|
||||||
if( NextIrp->MdlAddress ) UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) );
|
if( NextIrp->MdlAddress ) UnlockRequest( NextIrp, IoGetCurrentIrpStackLocation( NextIrp ) );
|
||||||
(void)IoSetCancelRoutine(NextIrp, NULL);
|
(void)IoSetCancelRoutine(NextIrp, NULL);
|
||||||
IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
|
IoCompleteRequest( NextIrp, IO_NETWORK_INCREMENT );
|
||||||
FCB->Overread = TRUE;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Kick the user that receive would be possible now */
|
/* Kick the user that receive would be possible now */
|
||||||
|
|
|
@ -159,7 +159,7 @@ typedef struct _AFD_STORED_DATAGRAM {
|
||||||
} AFD_STORED_DATAGRAM, *PAFD_STORED_DATAGRAM;
|
} AFD_STORED_DATAGRAM, *PAFD_STORED_DATAGRAM;
|
||||||
|
|
||||||
typedef struct _AFD_FCB {
|
typedef struct _AFD_FCB {
|
||||||
BOOLEAN Locked, Critical, Overread, NonBlocking, OobInline, TdiReceiveClosed, SendClosed;
|
BOOLEAN Locked, Critical, NonBlocking, OobInline, TdiReceiveClosed, SendClosed;
|
||||||
UINT State, Flags, GroupID, GroupType;
|
UINT State, Flags, GroupID, GroupType;
|
||||||
KIRQL OldIrql;
|
KIRQL OldIrql;
|
||||||
UINT LockCount;
|
UINT LockCount;
|
||||||
|
|
Loading…
Reference in New Issue