Author: ion
Date: Wed Jul 5 10:45:00 2006
New Revision: 22859
URL:
http://svn.reactos.org/svn/reactos?rev=22859&view=rev
Log:
- Make IoCreateFile use deferred I/O completion.
- Fixed a bug in TCP/IP that was making it complete IRP_MJ_CREATE with STATUS_SUCCESS yet
with the IRP marked as pending.
Modified:
trunk/reactos/drivers/network/tcpip/tcpip/irp.c
trunk/reactos/drivers/network/tcpip/tcpip/main.c
trunk/reactos/ntoskrnl/io/iomgr/file.c
Modified: trunk/reactos/drivers/network/tcpip/tcpip/irp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/irp.c (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/irp.c Wed Jul 5 10:45:00 2006
@@ -18,7 +18,7 @@
}
NTSTATUS IRPFinish( PIRP Irp, NTSTATUS Status ) {
- TI_DbgPrint(MID_TRACE,("Called: Irp %x, Status %x Event %x\n", Irp, Status,
Irp->UserEvent));
+ DbgPrint("Called: Irp %x, Status %x Event %x\n", Irp, Status,
Irp->UserEvent);
#ifdef MEMTRACK
UntrackFL( __FILE__, __LINE__, Irp );
Modified: trunk/reactos/drivers/network/tcpip/tcpip/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/main.c (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/main.c Wed Jul 5 10:45:00 2006
@@ -385,11 +385,7 @@
RIRP(Irp);
- TI_DbgPrint(DEBUG_IRP, ("Called. DeviceObject is at (0x%X), IRP is at
(0x%X).\n", DeviceObject, Irp));
-
- IoMarkIrpPending(Irp);
- Irp->IoStatus.Status = STATUS_PENDING;
- Irp->IoStatus.Information = 0;
+ DbgPrint("Called. DeviceObject is at (0x%X), IRP is at (0x%X).\n",
DeviceObject, Irp);
IrpSp = IoGetCurrentIrpStackLocation(Irp);
@@ -417,7 +413,7 @@
Status = STATUS_INVALID_DEVICE_REQUEST;
}
- TI_DbgPrint(DEBUG_IRP, ("Leaving. Status is (0x%X)\n", Status));
+ DbgPrint("Leaving. Status is (0x%X)\n", Status);
return IRPFinish( Irp, Status );
}
Modified: trunk/reactos/ntoskrnl/io/iomgr/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/io/iomgr/file.c?r…
==============================================================================
--- trunk/reactos/ntoskrnl/io/iomgr/file.c (original)
+++ trunk/reactos/ntoskrnl/io/iomgr/file.c Wed Jul 5 10:45:00 2006
@@ -892,6 +892,9 @@
NTSTATUS Status = STATUS_SUCCESS;
AUX_DATA AuxData;
ACCESS_STATE AccessState;
+ KIRQL OldIrql;
+ PKNORMAL_ROUTINE NormalRoutine;
+ PVOID NormalContext;
DPRINT("IoCreateFile(FileHandle 0x%p, DesiredAccess %x, "
"ObjectAttributes 0x%p ObjectAttributes->ObjectName->Buffer
%S)\n",
@@ -1063,8 +1066,8 @@
Irp->Tail.Overlay.OriginalFileObject = FileObject;
Irp->RequestorMode = AccessMode;
Irp->Flags = IRP_CREATE_OPERATION |
- IRP_SYNCHRONOUS_API;// |
- //IRP_DEFER_IO_COMPLETION;
+ IRP_SYNCHRONOUS_API |
+ IRP_DEFER_IO_COMPLETION;
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
Irp->UserEvent = &FileObject->Event;
Irp->UserIosb = IoStatusBlock;
@@ -1130,21 +1133,18 @@
NULL);
Status = IoStatusBlock->Status;
}
-#if 0
else
{
/* We'll have to complete it ourselves */
ASSERT(!Irp->PendingReturned);
KeRaiseIrql(APC_LEVEL, &OldIrql);
- FileObject->Event.Header.SignalState = 1;
- if ((Irp->Flags & IRP_BUFFERED_IO) && (Irp->Flags &
IRP_DEALLOCATE_BUFFER))
- {
- ExFreePool(Irp->AssociatedIrp.SystemBuffer);
- }
- IoFreeIrp(Irp);
+ IopCompleteRequest(&Irp->Tail.Apc,
+ &NormalRoutine,
+ &NormalContext,
+ (PVOID*)&FileObject,
+ &NormalContext);
KeLowerIrql(OldIrql);
}
-#endif
if (!NT_SUCCESS(Status))
{
DPRINT("Failing create request with status %x\n", Status);