mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
[NTOS:MM]
- Directly pass the file object to MmCreateDataFileSection svn path=/trunk/; revision=75104
This commit is contained in:
parent
220e2a29b0
commit
1ee7db3ccc
1 changed files with 3 additions and 22 deletions
|
@ -2898,7 +2898,7 @@ MmCreateDataFileSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
PLARGE_INTEGER UMaximumSize,
|
PLARGE_INTEGER UMaximumSize,
|
||||||
ULONG SectionPageProtection,
|
ULONG SectionPageProtection,
|
||||||
ULONG AllocationAttributes,
|
ULONG AllocationAttributes,
|
||||||
HANDLE FileHandle)
|
PFILE_OBJECT FileObject)
|
||||||
/*
|
/*
|
||||||
* Create a section backed by a data file
|
* Create a section backed by a data file
|
||||||
*/
|
*/
|
||||||
|
@ -2906,9 +2906,7 @@ MmCreateDataFileSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
PROS_SECTION_OBJECT Section;
|
PROS_SECTION_OBJECT Section;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
LARGE_INTEGER MaximumSize;
|
LARGE_INTEGER MaximumSize;
|
||||||
PFILE_OBJECT FileObject;
|
|
||||||
PMM_SECTION_SEGMENT Segment;
|
PMM_SECTION_SEGMENT Segment;
|
||||||
ULONG FileAccess;
|
|
||||||
FILE_STANDARD_INFORMATION FileInfo;
|
FILE_STANDARD_INFORMATION FileInfo;
|
||||||
ULONG Length;
|
ULONG Length;
|
||||||
|
|
||||||
|
@ -2926,6 +2924,7 @@ MmCreateDataFileSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
(PVOID*)&Section);
|
(PVOID*)&Section);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
|
ObDereferenceObject(FileObject);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
@ -2937,22 +2936,6 @@ MmCreateDataFileSection(PROS_SECTION_OBJECT *SectionObject,
|
||||||
Section->SectionPageProtection = SectionPageProtection;
|
Section->SectionPageProtection = SectionPageProtection;
|
||||||
Section->AllocationAttributes = AllocationAttributes;
|
Section->AllocationAttributes = AllocationAttributes;
|
||||||
|
|
||||||
/*
|
|
||||||
* Reference the file handle
|
|
||||||
*/
|
|
||||||
FileAccess = MiArm3GetCorrectFileAccessMask(SectionPageProtection);
|
|
||||||
Status = ObReferenceObjectByHandle(FileHandle,
|
|
||||||
FileAccess,
|
|
||||||
IoFileObjectType,
|
|
||||||
ExGetPreviousMode(),
|
|
||||||
(PVOID*)(PVOID)&FileObject,
|
|
||||||
NULL);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
ObDereferenceObject(Section);
|
|
||||||
return(Status);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: This is propably not entirely correct. We can't look into
|
* FIXME: This is propably not entirely correct. We can't look into
|
||||||
* the standard FCB header because it might not be initialized yet
|
* the standard FCB header because it might not be initialized yet
|
||||||
|
@ -5132,9 +5115,7 @@ MmCreateSection (OUT PVOID * Section,
|
||||||
MaximumSize,
|
MaximumSize,
|
||||||
SectionPageProtection,
|
SectionPageProtection,
|
||||||
AllocationAttributes,
|
AllocationAttributes,
|
||||||
FileHandle);
|
FileObject);
|
||||||
if (FileObject)
|
|
||||||
ObDereferenceObject(FileObject);
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
else if (FileHandle != NULL || FileObject != NULL)
|
else if (FileHandle != NULL || FileObject != NULL)
|
||||||
|
|
Loading…
Reference in a new issue