Author: tfaber
Date: Wed Sep 14 11:46:19 2016
New Revision: 72673
URL:
http://svn.reactos.org/svn/reactos?rev=72673&view=rev
Log:
[TCPIP]
- Don't try to mark IRPs as pending when they might already be completed. For
simplicity, always pend them instead.
CORE-11962
Modified:
trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
Modified: trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/dispatch.c [iso-8859-1] Wed Sep 14 11:46:19
2016
@@ -400,6 +400,8 @@
IrpSp = IoGetCurrentIrpStackLocation(Irp);
+ IoMarkIrpPending(Irp);
+
/* Get associated connection endpoint file object. Quit if none exists */
TranContext = IrpSp->FileObject->FsContext;
@@ -434,12 +436,11 @@
done:
if (Status != STATUS_PENDING) {
DispDataRequestComplete(Irp, Status, 0);
- } else
- IoMarkIrpPending(Irp);
+ }
TI_DbgPrint(MAX_TRACE, ("TCP Connect returned %08x\n", Status));
- return Status;
+ return STATUS_PENDING;
}
@@ -501,6 +502,8 @@
IrpSp = IoGetCurrentIrpStackLocation(Irp);
DisReq = (PTDI_REQUEST_KERNEL_DISCONNECT)&IrpSp->Parameters;
+
+ IoMarkIrpPending(Irp);
/* Get associated connection endpoint file object. Quit if none exists */
@@ -537,12 +540,11 @@
done:
if (Status != STATUS_PENDING) {
DispDataRequestComplete(Irp, Status, 0);
- } else
- IoMarkIrpPending(Irp);
+ }
TI_DbgPrint(MAX_TRACE, ("TCP Disconnect returned %08x\n", Status));
- return Status;
+ return STATUS_PENDING;
}
@@ -566,6 +568,8 @@
TI_DbgPrint(DEBUG_IRP, ("Called.\n"));
IrpSp = IoGetCurrentIrpStackLocation(Irp);
+
+ IoMarkIrpPending(Irp);
/* Get associated connection endpoint file object. Quit if none exists */
@@ -649,12 +653,11 @@
done:
if (Status != STATUS_PENDING) {
DispDataRequestComplete(Irp, Status, 0);
- } else
- IoMarkIrpPending(Irp);
+ }
TI_DbgPrint(MID_TRACE,("Leaving %x\n", Status));
- return Status;
+ return STATUS_PENDING;
}
@@ -806,6 +809,8 @@
IrpSp = IoGetCurrentIrpStackLocation(Irp);
ReceiveInfo = (PTDI_REQUEST_KERNEL_RECEIVE)&(IrpSp->Parameters);
+
+ IoMarkIrpPending(Irp);
TranContext = IrpSp->FileObject->FsContext;
if (TranContext == NULL)
@@ -844,12 +849,11 @@
done:
if (Status != STATUS_PENDING) {
DispDataRequestComplete(Irp, Status, BytesReceived);
- } else
- IoMarkIrpPending(Irp);
+ }
TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status));
- return Status;
+ return STATUS_PENDING;
}
@@ -874,6 +878,8 @@
IrpSp = IoGetCurrentIrpStackLocation(Irp);
DgramInfo = (PTDI_REQUEST_KERNEL_RECEIVEDG)&(IrpSp->Parameters);
+
+ IoMarkIrpPending(Irp);
TranContext = IrpSp->FileObject->FsContext;
if (TranContext == NULL)
@@ -918,12 +924,11 @@
done:
if (Status != STATUS_PENDING) {
DispDataRequestComplete(Irp, Status, BytesReceived);
- } else
- IoMarkIrpPending(Irp);
+ }
TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status));
- return Status;
+ return STATUS_PENDING;
}
@@ -947,6 +952,8 @@
IrpSp = IoGetCurrentIrpStackLocation(Irp);
SendInfo = (PTDI_REQUEST_KERNEL_SEND)&(IrpSp->Parameters);
+
+ IoMarkIrpPending(Irp);
TranContext = IrpSp->FileObject->FsContext;
if (TranContext == NULL)
@@ -990,12 +997,11 @@
done:
if (Status != STATUS_PENDING) {
DispDataRequestComplete(Irp, Status, BytesSent);
- } else
- IoMarkIrpPending(Irp);
+ }
TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status));
- return Status;
+ return STATUS_PENDING;
}
@@ -1019,6 +1025,8 @@
IrpSp = IoGetCurrentIrpStackLocation(Irp);
DgramInfo = (PTDI_REQUEST_KERNEL_SENDDG)&(IrpSp->Parameters);
+
+ IoMarkIrpPending(Irp);
TranContext = IrpSp->FileObject->FsContext;
if (TranContext == NULL)
@@ -1074,12 +1082,11 @@
done:
if (Status != STATUS_PENDING) {
DispDataRequestComplete(Irp, Status, Irp->IoStatus.Information);
- } else
- IoMarkIrpPending(Irp);
+ }
TI_DbgPrint(DEBUG_IRP, ("Leaving.\n"));
- return Status;
+ return STATUS_PENDING;
}