Author: arty
Date: Wed Nov 18 08:13:08 2009
New Revision: 44223
URL:
http://svn.reactos.org/svn/reactos?rev=44223&view=rev
Log:
io: don't need these references.
data: pair references to section on map and unmap, pair references to file on
section build, teardown and segment create and teardown.
Modified:
branches/arty-newcc/ntoskrnl/mm/section/data.c
branches/arty-newcc/ntoskrnl/mm/section/io.c
Modified: branches/arty-newcc/ntoskrnl/mm/section/data.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/mm/section/…
==============================================================================
--- branches/arty-newcc/ntoskrnl/mm/section/data.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/mm/section/data.c [iso-8859-1] Wed Nov 18 08:13:08 2009
@@ -1715,6 +1715,7 @@
ExAcquireFastMutex(&Segment->Lock);
DPRINT("Filling out Segment info (No previous data section)\n");
+ ObReferenceObject(FileObject);
Segment->FileObject = FileObject;
Segment->Protection = SectionPageProtection;
Segment->Flags = MM_DATAFILE_SEGMENT;
@@ -2201,6 +2202,7 @@
ASSERT(FALSE);
}
MiFreePageTablesSectionSegment(Segment);
+ ObDereferenceObject(Segment->FileObject);
ExFreePool(Segment);
FileObject->SectionObjectPointer->DataSectionObject = NULL;
@@ -3078,6 +3080,9 @@
MmUnlockSectionSegment(Section->Segment);
MmUnlockAddressSpace(AddressSpace);
+
+ if (Status == STATUS_SUCCESS)
+ ObReferenceObject(Section);
return Status;
}
Modified: branches/arty-newcc/ntoskrnl/mm/section/io.c
URL:
http://svn.reactos.org/svn/reactos/branches/arty-newcc/ntoskrnl/mm/section/…
==============================================================================
--- branches/arty-newcc/ntoskrnl/mm/section/io.c [iso-8859-1] (original)
+++ branches/arty-newcc/ntoskrnl/mm/section/io.c [iso-8859-1] Wed Nov 18 08:13:08 2009
@@ -263,8 +263,6 @@
Irp->Flags |= IRP_PAGING_IO | IRP_SYNCHRONOUS_PAGING_IO | IRP_NOCACHE |
IRP_SYNCHRONOUS_API;
- ObReferenceObject(FileObject);
-
Irp->UserEvent = &ReadWait;
Irp->Tail.Overlay.OriginalFileObject = FileObject;
Irp->Tail.Overlay.Thread = PsGetCurrentThread();
@@ -286,12 +284,9 @@
{
DPRINT1("Warning: Failed to wait for synchronous IRP\n");
ASSERT(FALSE);
- ObDereferenceObject(FileObject);
return Status;
}
}
-
- ObDereferenceObject(FileObject);
DPRINT("Paging IO Done: %08x\n", ReadStatus->Status);
Status =