mirror of
https://github.com/reactos/reactos.git
synced 2025-07-06 18:31:21 +00:00
[AFD]
- Fix shutdown(SD_RECEIVE) so it no longer brings down the entire connection svn path=/trunk/; revision=53141
This commit is contained in:
parent
fc43b3ef78
commit
d4b83ece4b
1 changed files with 33 additions and 6 deletions
|
@ -670,7 +670,7 @@ AfdDisconnect(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||||
PAFD_FCB FCB = FileObject->FsContext;
|
PAFD_FCB FCB = FileObject->FsContext;
|
||||||
PAFD_DISCONNECT_INFO DisReq;
|
PAFD_DISCONNECT_INFO DisReq;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
USHORT Flags = 0;
|
USHORT Flags;
|
||||||
PLIST_ENTRY CurrentEntry;
|
PLIST_ENTRY CurrentEntry;
|
||||||
PIRP CurrentIrp;
|
PIRP CurrentIrp;
|
||||||
|
|
||||||
|
@ -680,11 +680,38 @@ AfdDisconnect(PDEVICE_OBJECT DeviceObject, PIRP Irp,
|
||||||
return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY,
|
return UnlockAndMaybeComplete( FCB, STATUS_NO_MEMORY,
|
||||||
Irp, 0 );
|
Irp, 0 );
|
||||||
|
|
||||||
if( DisReq->DisconnectType & AFD_DISCONNECT_SEND )
|
/* Shutdown(SD_SEND) */
|
||||||
Flags |= TDI_DISCONNECT_RELEASE;
|
if ((DisReq->DisconnectType & AFD_DISCONNECT_SEND) &&
|
||||||
if( DisReq->DisconnectType & AFD_DISCONNECT_RECV ||
|
!(DisReq->DisconnectType & AFD_DISCONNECT_RECV))
|
||||||
DisReq->DisconnectType & AFD_DISCONNECT_ABORT )
|
{
|
||||||
Flags |= TDI_DISCONNECT_ABORT;
|
/* Perform a controlled disconnect */
|
||||||
|
Flags = TDI_DISCONNECT_RELEASE;
|
||||||
|
}
|
||||||
|
/* Shutdown(SD_RECEIVE) */
|
||||||
|
else if (DisReq->DisconnectType & AFD_DISCONNECT_RECV)
|
||||||
|
{
|
||||||
|
/* Mark that we can't issue another receive request */
|
||||||
|
FCB->TdiReceiveClosed = TRUE;
|
||||||
|
|
||||||
|
/* Discard any pending data */
|
||||||
|
FCB->Recv.Content = 0;
|
||||||
|
FCB->Recv.BytesUsed = 0;
|
||||||
|
|
||||||
|
/* Mark us as overread to complete future reads with an error */
|
||||||
|
FCB->Overread = TRUE;
|
||||||
|
|
||||||
|
/* Clear the receive event */
|
||||||
|
FCB->PollState &= ~AFD_EVENT_RECEIVE;
|
||||||
|
|
||||||
|
/* We're done (no need to tell the TDI transport driver) */
|
||||||
|
return UnlockAndMaybeComplete( FCB, STATUS_SUCCESS, Irp, 0 );
|
||||||
|
}
|
||||||
|
/* Shutdown(SD_BOTH) */
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Perform an abortive disconnect */
|
||||||
|
Flags = TDI_DISCONNECT_ABORT;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS))
|
if (!(FCB->Flags & AFD_ENDPOINT_CONNECTIONLESS))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue