From a5a8fc4a5a62c6cb8eb16e82f5d567f307315c98 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Wed, 28 Aug 2002 07:17:22 +0000 Subject: [PATCH] Removed dereferencing of the event/file object for paging IO. svn path=/trunk/; revision=3423 --- reactos/ntoskrnl/io/cleanup.c | 54 +++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/reactos/ntoskrnl/io/cleanup.c b/reactos/ntoskrnl/io/cleanup.c index 9d73c3df9ef..c1be1884d2c 100644 --- a/reactos/ntoskrnl/io/cleanup.c +++ b/reactos/ntoskrnl/io/cleanup.c @@ -48,18 +48,23 @@ IopCompleteRequest1(struct _KAPC* Apc, { *Irp->UserIosb=Irp->IoStatus; } - if (Irp->UserEvent!=NULL) - { - KeSetEvent(Irp->UserEvent,PriorityBoost,FALSE); - // if the event is not the one in the file object, it needs dereferenced - if( FileObject && Irp->UserEvent != &FileObject->Event ) - ObDereferenceObject( Irp->UserEvent ); - } - if (FileObject != NULL && IoStack->MajorFunction != IRP_MJ_CLOSE) - { - ObDereferenceObject(FileObject); - } + if (Irp->UserEvent) + { + KeSetEvent(Irp->UserEvent,PriorityBoost,FALSE); + } + + if (!(Irp->Flags & IRP_PAGING_IO) && FileObject) + { + // if the event is not the one in the file object, it needs dereferenced + if (Irp->UserEvent && Irp->UserEvent != &FileObject->Event) + ObDereferenceObject(Irp->UserEvent); + + if (IoStack->MajorFunction != IRP_MJ_CLOSE) + { + ObDereferenceObject(FileObject); + } + } IoFreeIrp(Irp); @@ -241,18 +246,23 @@ VOID IoSecondStageCompletion(PIRP Irp, CCHAR PriorityBoost) { *Irp->UserIosb=Irp->IoStatus; } - if (Irp->UserEvent!=NULL) - { - KeSetEvent(Irp->UserEvent,PriorityBoost,FALSE); - // if the event is not the one in the file object, it needs dereferenced - if( FileObject && Irp->UserEvent != &FileObject->Event ) - ObDereferenceObject( Irp->UserEvent ); - } - if (FileObject != NULL && IoStack->MajorFunction != IRP_MJ_CLOSE) - { - ObDereferenceObject(FileObject); - } + if (Irp->UserEvent) + { + KeSetEvent(Irp->UserEvent,PriorityBoost,FALSE); + } + + if (!(Irp->Flags & IRP_PAGING_IO) && FileObject) + { + // if the event is not the one in the file object, it needs dereferenced + if (Irp->UserEvent && Irp->UserEvent != &FileObject->Event) + ObDereferenceObject(Irp->UserEvent); + + if (IoStack->MajorFunction != IRP_MJ_CLOSE) + { + ObDereferenceObject(FileObject); + } + } IoFreeIrp(Irp); }