Author: tfaber
Date: Sun Jun 14 07:54:19 2015
New Revision: 68130
URL:
http://svn.reactos.org/svn/reactos?rev=68130&view=rev
Log:
[AFD]
- Don't leave the IRP queued if TdiSendDatagram does not perform its downcall.
Complete it instead.
CORE-9810
Modified:
trunk/reactos/drivers/network/afd/afd/write.c
Modified: trunk/reactos/drivers/network/afd/afd/write.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/afd/afd/wr…
==============================================================================
--- trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/afd/afd/write.c [iso-8859-1] Sun Jun 14 07:54:19 2015
@@ -379,13 +379,23 @@
Status = QueueUserModeIrp(FCB, Irp, FUNCTION_SEND);
if (Status == STATUS_PENDING)
{
- TdiSendDatagram(&FCB->SendIrp.InFlightRequest,
- FCB->AddressFile.Object,
- SendReq->BufferArray[0].buf,
- SendReq->BufferArray[0].len,
- TargetAddress,
- PacketSocketSendComplete,
- FCB);
+ Status = TdiSendDatagram(&FCB->SendIrp.InFlightRequest,
+ FCB->AddressFile.Object,
+ SendReq->BufferArray[0].buf,
+ SendReq->BufferArray[0].len,
+ TargetAddress,
+ PacketSocketSendComplete,
+ FCB);
+ if (Status != STATUS_PENDING)
+ {
+ NT_VERIFY(RemoveHeadList(&FCB->PendingIrpList[FUNCTION_SEND])
== &Irp->Tail.Overlay.ListEntry);
+ Irp->IoStatus.Status = Status;
+ Irp->IoStatus.Information = 0;
+ (void)IoSetCancelRoutine(Irp, NULL);
+ UnlockBuffers(SendReq->BufferArray, SendReq->BufferCount,
FALSE);
+ UnlockRequest(Irp, IoGetCurrentIrpStackLocation(Irp));
+ IoCompleteRequest(Irp, IO_NETWORK_INCREMENT);
+ }
}
ExFreePool( TargetAddress );
@@ -631,13 +641,23 @@
Status = QueueUserModeIrp(FCB, Irp, FUNCTION_SEND);
if (Status == STATUS_PENDING)
{
- TdiSendDatagram(&FCB->SendIrp.InFlightRequest,
- FCB->AddressFile.Object,
- SendReq->BufferArray[0].buf,
- SendReq->BufferArray[0].len,
- TargetAddress,
- PacketSocketSendComplete,
- FCB);
+ Status = TdiSendDatagram(&FCB->SendIrp.InFlightRequest,
+ FCB->AddressFile.Object,
+ SendReq->BufferArray[0].buf,
+ SendReq->BufferArray[0].len,
+ TargetAddress,
+ PacketSocketSendComplete,
+ FCB);
+ if (Status != STATUS_PENDING)
+ {
+ NT_VERIFY(RemoveHeadList(&FCB->PendingIrpList[FUNCTION_SEND]) ==
&Irp->Tail.Overlay.ListEntry);
+ Irp->IoStatus.Status = Status;
+ Irp->IoStatus.Information = 0;
+ (void)IoSetCancelRoutine(Irp, NULL);
+ UnlockBuffers(SendReq->BufferArray, SendReq->BufferCount, FALSE);
+ UnlockRequest(Irp, IoGetCurrentIrpStackLocation(Irp));
+ IoCompleteRequest(Irp, IO_NETWORK_INCREMENT);
+ }
}
ExFreePool(TargetAddress);