NTSTATUS
NTAPI
-MiLoadImageSection(IN OUT PVOID *SectionPtr,
- OUT PVOID *ImageBase,
- IN PUNICODE_STRING FileName,
- IN BOOLEAN SessionLoad,
- IN PLDR_DATA_TABLE_ENTRY LdrEntry)
+MiLoadImageSection(_Inout_ PSECTION *SectionPtr,
+ _Out_ PVOID *ImageBase,
+ _In_ PUNICODE_STRING FileName,
+ _In_ BOOLEAN SessionLoad,
+ _In_ PLDR_DATA_TABLE_ENTRY LdrEntry)
{
- PROS_SECTION_OBJECT Section = *SectionPtr;
+ PSECTION Section = *SectionPtr;
NTSTATUS Status;
PEPROCESS Process;
PVOID Base = NULL;
}
/* Reserve system PTEs needed */
- PteCount = ROUND_TO_PAGES(Section->ImageSection->ImageInformation.ImageFileSize) >> PAGE_SHIFT;
+ PteCount = ROUND_TO_PAGES(((PMM_IMAGE_SECTION_OBJECT)Section->Segment)->ImageInformation.ImageFileSize) >> PAGE_SHIFT;
PointerPte = MiReserveSystemPtes(PteCount, SystemPteSpace);
if (!PointerPte)
{
PWCHAR MissingDriverName;
HANDLE SectionHandle;
ACCESS_MASK DesiredAccess;
- PVOID Section = NULL;
+ PSECTION Section = NULL;
BOOLEAN LockOwned = FALSE;
PLIST_ENTRY NextEntry;
IMAGE_INFO ImageInfo;
SECTION_MAP_EXECUTE,
MmSectionObjectType,
KernelMode,
- &Section,
+ (PVOID*)&Section,
NULL);
ZwClose(SectionHandle);
if (!NT_SUCCESS(Status)) goto Quickie;
ASSERT(Status != STATUS_ALREADY_COMMITTED);
/* Get the size of the driver */
- DriverSize = ((PROS_SECTION_OBJECT)Section)->ImageSection->ImageInformation.ImageFileSize;
+ DriverSize = ((PMM_IMAGE_SECTION_OBJECT)Section->Segment)->ImageInformation.ImageFileSize;
/* Make sure we're not being loaded into session space */
if (!Flags)
VOID NTAPI
MmpDeleteSection(PVOID ObjectBody)
{
- PROS_SECTION_OBJECT Section = (PROS_SECTION_OBJECT)ObjectBody;
+ PROS_SECTION_OBJECT Section = ObjectBody;
/* Check if it's an ARM3, or ReactOS section */
if (!MiIsRosSectionObject(Section))
* until the image section is properly initialized we shouldn't
* process further here.
*/
- if (Section->ImageSection == NULL)
+ if (Section->Segment == NULL)
return;
- SectionSegments = Section->ImageSection->Segments;
- NrSegments = Section->ImageSection->NrSegments;
+ SectionSegments = ((PMM_IMAGE_SECTION_OBJECT)Section->Segment)->Segments;
+ NrSegments = ((PMM_IMAGE_SECTION_OBJECT)Section->Segment)->NrSegments;
for (i = 0; i < NrSegments; i++)
{
return(Status);
}
- Section->ImageSection = ImageSectionObject;
+ Section->Segment = (PSEGMENT)ImageSectionObject;
ASSERT(ImageSectionObject->Segments);
/*
ExFreePool(ImageSectionObject->Segments);
ExFreePool(ImageSectionObject);
ImageSectionObject = FileObject->SectionObjectPointer->ImageSectionObject;
- Section->ImageSection = ImageSectionObject;
+ Section->Segment = (PSEGMENT)ImageSectionObject;
SectionSegments = ImageSectionObject->Segments;
for (i = 0; i < ImageSectionObject->NrSegments; i++)
}
ImageSectionObject = FileObject->SectionObjectPointer->ImageSectionObject;
- Section->ImageSection = ImageSectionObject;
+ Section->Segment = (PSEGMENT)ImageSectionObject;
SectionSegments = ImageSectionObject->Segments;
/*
PMM_SECTION_SEGMENT Segment;
Segment = MemoryArea->SectionData.Segment;
- ImageSectionObject = Section->ImageSection;
+ ImageSectionObject = ((PMM_IMAGE_SECTION_OBJECT)Section->Segment);
SectionSegments = ImageSectionObject->Segments;
NrSegments = ImageSectionObject->NrSegments;
{
if (RosSection->u.Flags.Image)
{
- PMM_IMAGE_SECTION_OBJECT ImageSectionObject;
- ImageSectionObject = RosSection->ImageSection;
+ PMM_IMAGE_SECTION_OBJECT ImageSectionObject = ((PMM_IMAGE_SECTION_OBJECT)Section->Segment);
*Sii = ImageSectionObject->ImageInformation;
}
PMM_IMAGE_SECTION_OBJECT ImageSectionObject;
PMM_SECTION_SEGMENT SectionSegments;
- ImageSectionObject = Section->ImageSection;
+ ImageSectionObject = ((PMM_IMAGE_SECTION_OBJECT)Section->Segment);
SectionSegments = ImageSectionObject->Segments;
NrSegments = ImageSectionObject->NrSegments;