IN SECTION_INHERIT InheritDisposition,
IN ULONG AllocationType,
IN ULONG Protect);
-
+
//
// PeFmtCreateSection depends on the following:
//
#define SHARE_COUNT_FROM_SSE(E) (((E) & 0x00000FFE) >> 1)
#define IS_SWAP_FROM_SSE(E) ((E) & 0x00000001)
#define MAX_SHARE_COUNT 0x7FF
-#define MAKE_SSE(P, C) ((P) | ((C) << 1))
+#define MAKE_SSE(P, C) ((ULONG)(P) | ((C) << 1))
#define SWAPENTRY_FROM_SSE(E) ((E) >> 1)
-#define MAKE_SWAP_SSE(S) (((S) << 1) | 0x1)
+#define MAKE_SWAP_SSE(S) (((ULONG)(S) << 1) | 0x1)
static const INFORMATION_CLASS_INFO ExSectionInfoClass[] =
{
PMM_SECTION_SEGMENT pssSegments;
LARGE_INTEGER lnOffset;
PVOID pBuffer;
- ULONG nPrevVirtualEndOfSegment = 0;
+ SIZE_T nPrevVirtualEndOfSegment = 0;
ULONG nFileSizeOfHeaders = 0;
ULONG i;
if(pioh64OptHeader->SizeOfStackReserve > MAXULONG_PTR)
DIE(("SizeOfStackReserve exceeds the address space\n"));
- ImageSectionObject->StackReserve = pioh64OptHeader->SizeOfStackReserve;
+ ImageSectionObject->StackReserve = (ULONG_PTR)pioh64OptHeader->SizeOfStackReserve;
}
if(RTL_CONTAINS_FIELD(pioh64OptHeader, cbOptHeaderSize, SizeOfStackCommit))
if(pioh64OptHeader->SizeOfStackCommit > MAXULONG_PTR)
DIE(("SizeOfStackCommit exceeds the address space\n"));
- ImageSectionObject->StackCommit = pioh64OptHeader->SizeOfStackCommit;
+ ImageSectionObject->StackCommit = (ULONG_PTR)pioh64OptHeader->SizeOfStackCommit;
}
break;
ImageSectionObject->Segments = AllocateSegmentsCb(ImageSectionObject->NrSegments);
if(ImageSectionObject->Segments == NULL)
- DIE(("AllocateSegments failed\n"));
+ DIE(("AllocateSegments failed\n"));
/* initialize the headers segment */
pssSegments = ImageSectionObject->Segments;
// ASSERT(IsAligned(cbHeadersSize, nFileAlignment));
if(!AlignUp(&nFileSizeOfHeaders, cbHeadersSize, nFileAlignment))
- DIE(("Cannot align the size of the section headers\n"));
+ DIE(("Cannot align the size of the section headers\n"));
- if(!AlignUp(&nPrevVirtualEndOfSegment, cbHeadersSize, nSectionAlignment))
- DIE(("Cannot align the size of the section headers\n"));
+ nPrevVirtualEndOfSegment = ALIGN_UP_BY(cbHeadersSize, nSectionAlignment);
+ if (nPrevVirtualEndOfSegment < cbHeadersSize)
+ DIE(("Cannot align the size of the section headers\n"));
pssSegments[0].FileOffset = 0;
pssSegments[0].Protection = PAGE_READONLY;
else
pssSegments[i].Length = pishSectionHeaders[i].Misc.VirtualSize;
- if(!AlignUp(&pssSegments[i].Length, pssSegments[i].Length, nSectionAlignment))
+ pssSegments[i].Length = ALIGN_UP_BY(pssSegments[i].Length, nSectionAlignment);
+ if (pssSegments[i].Length < pssSegments[i].Length)
DIE(("Cannot align the virtual size of section %u\n", i));
- ASSERT(IsAligned(pssSegments[i].Length, nSectionAlignment));
-
if(pssSegments[i].Length == 0)
DIE(("Virtual size of section %u is null\n", i));
pssSegments[i].Characteristics = pishSectionHeaders[i].Characteristics;
/* ensure the memory image is no larger than 4GB */
- if(!Intsafe_AddULong32(&nPrevVirtualEndOfSegment, pssSegments[i].VirtualAddress, pssSegments[i].Length))
- DIE(("The image is larger than 4GB\n"));
+ nPrevVirtualEndOfSegment = pssSegments[i].VirtualAddress + pssSegments[i].Length;
+ if (nPrevVirtualEndOfSegment < pssSegments[i].VirtualAddress)
+ DIE(("The image is too large\n"));
}
if(nSectionAlignment >= PAGE_SIZE)
VOID
NTAPI
MmSetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment,
- ULONG Offset,
- ULONG Entry)
+ ULONG_PTR Offset,
+ ULONG_PTR Entry)
{
PSECTION_PAGE_TABLE Table;
- ULONG DirectoryOffset;
- ULONG TableOffset;
+ ULONG_PTR DirectoryOffset;
+ ULONG_PTR TableOffset;
if (Segment->Length <= NR_SECTION_PAGE_TABLES * PAGE_SIZE)
{
}
}
TableOffset = PAGE_TO_SECTION_PAGE_TABLE_OFFSET(Offset);
- Table->Entry[TableOffset] = Entry;
+ Table->Entry[TableOffset] = (ULONG)Entry;
}
ULONG
NTAPI
MmGetPageEntrySectionSegment(PMM_SECTION_SEGMENT Segment,
- ULONG Offset)
+ ULONG_PTR Offset)
{
PSECTION_PAGE_TABLE Table;
ULONG Entry;
- ULONG DirectoryOffset;
- ULONG TableOffset;
+ ULONG_PTR DirectoryOffset;
+ ULONG_PTR TableOffset;
DPRINT("MmGetPageEntrySection(Segment %x, Offset %x)\n", Segment, Offset);
VOID
NTAPI
MmSharePageEntrySectionSegment(PMM_SECTION_SEGMENT Segment,
- ULONG Offset)
+ ULONG_PTR Offset)
{
ULONG Entry;
PEPROCESS Process;
KIRQL Irql;
PVOID TempAddress;
-
+
Process = PsGetCurrentProcess();
TempAddress = MiMapPageInHyperSpace(Process, DestPage, &Irql);
if (TempAddress == NULL)
NTSTATUS
NTAPI
MiReadPage(PMEMORY_AREA MemoryArea,
- ULONG SegOffset,
+ ULONG_PTR SegOffset,
PPFN_NUMBER Page)
/*
* FUNCTION: Read a page for a section backed memory area.
*/
{
ULONG BaseOffset;
- ULONG FileOffset;
+ ULONG_PTR FileOffset;
PVOID BaseAddress;
BOOLEAN UptoDate;
PCACHE_SEGMENT CacheSeg;
PFILE_OBJECT FileObject;
NTSTATUS Status;
- ULONG RawLength;
+ ULONG_PTR RawLength;
PBCB Bcb;
BOOLEAN IsImageSection;
- ULONG Length;
+ ULONG_PTR Length;
FileObject = MemoryArea->Data.SectionData.Section->FileObject;
Bcb = FileObject->SectionObjectPointer->SharedCacheMap;
* alignment less than the file system block size.
*/
Status = CcRosGetCacheSegment(Bcb,
- FileOffset,
+ (ULONG)FileOffset,
&BaseOffset,
&BaseAddress,
&UptoDate,
PEPROCESS Process;
KIRQL Irql;
PVOID PageAddr;
- ULONG CacheSegOffset;
+ ULONG_PTR CacheSegOffset;
/*
* Allocate a page, this is rather complicated by the possibility
return(Status);
}
Status = CcRosGetCacheSegment(Bcb,
- FileOffset,
+ (ULONG)FileOffset,
&BaseOffset,
&BaseAddress,
&UptoDate,
MiUnmapPageInHyperSpace(Process, PageAddr, Irql);
CcRosReleaseCacheSegment(Bcb, CacheSeg, TRUE, FALSE, FALSE);
Status = CcRosGetCacheSegment(Bcb,
- FileOffset + CacheSegOffset,
+ (ULONG)(FileOffset + CacheSegOffset),
&BaseOffset,
&BaseAddress,
&UptoDate,
*/
{
MM_REQUIRED_RESOURCES Resources = { };
-
+
Resources.Context = MemoryArea->Data.SectionData.Section->FileObject;
- Resources.FileOffset.QuadPart = SegOffset +
+ Resources.FileOffset.QuadPart = SegOffset +
MemoryArea->Data.SectionData.Segment->FileOffset;
Resources.Consumer = MC_USER;
Resources.Amount = PAGE_SIZE;
NTAPI
MmNotPresentFaultSectionView(PMMSUPPORT AddressSpace,
MEMORY_AREA* MemoryArea,
- PVOID Address,
- BOOLEAN Locked)
+ PVOID Address)
{
ULONG Offset;
PFN_NUMBER Page;
NTSTATUS Status;
- PVOID PAddress;
PROS_SECTION_OBJECT Section;
PMM_SECTION_SEGMENT Segment;
- ULONG Entry;
- ULONG Entry1;
+ ULONG_PTR Entry;
+ ULONG_PTR Entry1;
ULONG Attributes;
PMM_PAGEOP PageOp;
PMM_REGION Region;
BOOLEAN HasSwapEntry;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
-
+
/*
* There is a window between taking the page fault and locking the
* address space when another thread could load the page so we check
{
return(STATUS_SUCCESS);
}
+
+ /*
+ * Check for the virtual memory area being deleted.
+ */
+ if (MemoryArea->DeleteInProgress)
+ {
+ return(STATUS_UNSUCCESSFUL);
+ }
- PAddress = MM_ROUND_DOWN(Address, PAGE_SIZE);
- Offset = (ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress
- + MemoryArea->Data.SectionData.ViewOffset;
+ Address = MM_ROUND_DOWN(Address, PAGE_SIZE);
+ Offset = (ULONG)((ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress
+ + MemoryArea->Data.SectionData.ViewOffset);
Segment = MemoryArea->Data.SectionData.Segment;
Section = MemoryArea->Data.SectionData.Section;
if (!MmIsPagePresent(Process, Address))
{
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
- HasSwapEntry = MmIsPageSwapEntry(Process, (PVOID)PAddress);
+ HasSwapEntry = MmIsPageSwapEntry(Process, (PVOID)Address);
if (PAGE_FROM_SSE(Entry) == 0 || HasSwapEntry)
{
DPRINT1("Unable to create virtual mapping\n");
KeBugCheck(MEMORY_MANAGEMENT);
}
- MmInsertRmap(Page, Process, (PVOID)PAddress);
+ MmInsertRmap(Page, Process, Address);
}
MmUnlockSectionSegment(Segment);
PageOp->Status = STATUS_SUCCESS;
return(STATUS_SUCCESS);
}
- HasSwapEntry = MmIsPageSwapEntry(Process, (PVOID)PAddress);
+ HasSwapEntry = MmIsPageSwapEntry(Process, Address);
if (HasSwapEntry)
{
/*
}
MmUnlockSectionSegment(Segment);
- MmDeletePageFileMapping(Process, (PVOID)PAddress, &SwapEntry);
+ MmDeletePageFileMapping(Process, Address, &SwapEntry);
MmUnlockAddressSpace(AddressSpace);
MI_SET_USAGE(MI_USAGE_SECTION);
/*
* Add the page to the process's working set
*/
- MmInsertRmap(Page, Process, (PVOID)PAddress);
-
+ MmInsertRmap(Page, Process, Address);
/*
* Finish the operation
*/
KeBugCheck(MEMORY_MANAGEMENT);
return(Status);
}
- MmInsertRmap(Page, Process, (PVOID)PAddress);
+ MmInsertRmap(Page, Process, Address);
/*
* Cleanup and release locks
{
DPRINT1("MmRequestPageMemoryConsumer failed (Status %x)\n", Status);
}
-
+
}
else
{
DPRINT1("Unable to create virtual mapping\n");
KeBugCheck(MEMORY_MANAGEMENT);
}
- MmInsertRmap(Page, Process, (PVOID)PAddress);
+ MmInsertRmap(Page, Process, Address);
PageOp->Status = STATUS_SUCCESS;
MmspCompleteAndReleasePageOp(PageOp);
DPRINT1("Unable to create virtual mapping\n");
KeBugCheck(MEMORY_MANAGEMENT);
}
- MmInsertRmap(Page, Process, (PVOID)PAddress);
+ MmInsertRmap(Page, Process, Address);
PageOp->Status = STATUS_SUCCESS;
MmspCompleteAndReleasePageOp(PageOp);
DPRINT("Address 0x%.8X\n", Address);
DPRINT1("Unable to create virtual mapping\n");
KeBugCheck(MEMORY_MANAGEMENT);
}
- MmInsertRmap(Page, Process, (PVOID)PAddress);
+ MmInsertRmap(Page, Process, Address);
PageOp->Status = STATUS_SUCCESS;
MmspCompleteAndReleasePageOp(PageOp);
DPRINT("Address 0x%.8X\n", Address);
NTAPI
MmAccessFaultSectionView(PMMSUPPORT AddressSpace,
MEMORY_AREA* MemoryArea,
- PVOID Address,
- BOOLEAN Locked)
+ PVOID Address)
{
PMM_SECTION_SEGMENT Segment;
PROS_SECTION_OBJECT Section;
PFN_NUMBER OldPage;
PFN_NUMBER NewPage;
NTSTATUS Status;
- PVOID PAddress;
ULONG Offset;
PMM_PAGEOP PageOp;
PMM_REGION Region;
ULONG Entry;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
-
- DPRINT("MmAccessFaultSectionView(%x, %x, %x, %x)\n", AddressSpace, MemoryArea, Address, Locked);
+
+ DPRINT("MmAccessFaultSectionView(%x, %x, %x, %x)\n", AddressSpace, MemoryArea, Address);
/*
- * Check if the page has been paged out or has already been set readwrite
+ * Check if the page has already been set readwrite
*/
- if (!MmIsPagePresent(Process, Address) ||
- MmGetPageProtect(Process, Address) & PAGE_READWRITE)
+ if (MmGetPageProtect(Process, Address) & PAGE_READWRITE)
{
DPRINT("Address 0x%.8X\n", Address);
return(STATUS_SUCCESS);
/*
* Find the offset of the page
*/
- PAddress = MM_ROUND_DOWN(Address, PAGE_SIZE);
- Offset = (ULONG_PTR)PAddress - (ULONG_PTR)MemoryArea->StartingAddress
- + MemoryArea->Data.SectionData.ViewOffset;
+ Address = MM_ROUND_DOWN(Address, PAGE_SIZE);
+ Offset = (ULONG)((ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress
+ + MemoryArea->Data.SectionData.ViewOffset);
Segment = MemoryArea->Data.SectionData.Segment;
Section = MemoryArea->Data.SectionData.Section;
*/
MmLockSectionSegment(Segment);
- OldPage = MmGetPfnForProcess(NULL, Address);
+ OldPage = MmGetPfnForProcess(Process, Address);
Entry = MmGetPageEntrySectionSegment(Segment, Offset);
MmUnlockSectionSegment(Segment);
PFN_FROM_SSE(Entry) != OldPage)
{
/* This is a private page. We must only change the page protection. */
- MmSetPageProtect(Process, PAddress, Region->Protect);
+ MmSetPageProtect(Process, Address, Region->Protect);
return(STATUS_SUCCESS);
}
/*
* Copy the old page
*/
- MiCopyFromUserPage(NewPage, PAddress);
+ MiCopyFromUserPage(NewPage, Address);
MmLockAddressSpace(AddressSpace);
/*
/*
* Unshare the old page.
*/
- MmDeleteRmap(OldPage, Process, PAddress);
- MmInsertRmap(NewPage, Process, PAddress);
+ MmDeleteRmap(OldPage, Process, Address);
+ MmInsertRmap(NewPage, Process, Address);
MmLockSectionSegment(Segment);
MmUnsharePageEntrySectionSegment(Section, Segment, Offset, FALSE, FALSE);
MmUnlockSectionSegment(Segment);
BOOLEAN IsImageSection;
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
KIRQL OldIrql;
-
+
Address = (PVOID)PAGE_ROUND_DOWN(Address);
/*
Context.Segment = MemoryArea->Data.SectionData.Segment;
Context.Section = MemoryArea->Data.SectionData.Section;
- Context.Offset = (ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress
- + MemoryArea->Data.SectionData.ViewOffset;
+ Context.Offset = (ULONG)((ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress
+ + MemoryArea->Data.SectionData.ViewOffset);
FileOffset = Context.Offset + Context.Segment->FileOffset;
IsImageSection = Context.Section->AllocationAttributes & SEC_IMAGE ? TRUE : FALSE;
Page = MmGetPfnForProcess(Process, Address);
SwapEntry = MmGetSavedSwapEntryPage(Page);
+ /*
+ * Check the reference count to ensure this page can be paged out
+ */
+ if (MmGetReferenceCountPage(Page) != 1)
+ {
+ DPRINT1("Cannot page out locked section page: 0x%p (RefCount: %d)\n",
+ Page, MmGetReferenceCountPage(Page));
+ PageOp->Status = STATUS_UNSUCCESSFUL;
+ MmspCompleteAndReleasePageOp(PageOp);
+ return STATUS_UNSUCCESSFUL;
+ }
+
/*
* Prepare the context structure for the rmap delete call.
*/
PVOID Address,
PMM_PAGEOP PageOp)
{
- ULONG Offset;
+ ULONG_PTR Offset;
PROS_SECTION_OBJECT Section;
PMM_SECTION_SEGMENT Segment;
PFN_NUMBER Page;
{
ASSERT(SwapEntry == 0);
#ifndef NEWCC
- CcRosMarkDirtyCacheSegment(Bcb, Offset + Segment->FileOffset);
+ CcRosMarkDirtyCacheSegment(Bcb, (ULONG)Offset + Segment->FileOffset);
#endif
PageOp->Status = STATUS_SUCCESS;
MmspCompleteAndReleasePageOp(PageOp);
static VOID
MmAlterViewAttributes(PMMSUPPORT AddressSpace,
PVOID BaseAddress,
- ULONG RegionSize,
+ SIZE_T RegionSize,
ULONG OldType,
ULONG OldProtect,
ULONG NewType,
PEPROCESS Process = MmGetAddressSpaceOwner(AddressSpace);
MemoryArea = MmLocateMemoryAreaByAddress(AddressSpace, BaseAddress);
+ ASSERT(MemoryArea);
Segment = MemoryArea->Data.SectionData.Segment;
if ((Segment->WriteCopy) &&
*/
if (DoCOW && MmIsPagePresent(Process, Address))
{
- ULONG Offset;
+ ULONG_PTR Offset;
ULONG Entry;
PFN_NUMBER Page;
MmProtectSectionView(PMMSUPPORT AddressSpace,
PMEMORY_AREA MemoryArea,
PVOID BaseAddress,
- ULONG Length,
+ SIZE_T Length,
ULONG Protect,
PULONG OldProtect)
{
MaxLength = (ULONG_PTR)MemoryArea->EndingAddress - (ULONG_PTR)BaseAddress;
if (Length > MaxLength)
- Length = MaxLength;
+ Length = (ULONG)MaxLength;
Region = MmFindRegion(MemoryArea->StartingAddress,
&MemoryArea->Data.SectionData.RegionListHead,
ULONG Length;
ULONG Offset;
ULONG Entry;
- ULONG SavedSwapEntry;
+ SWAPENTRY SavedSwapEntry;
PFN_NUMBER Page;
Page = 0;
ObjectTypeInitializer.CloseProcedure = MmpCloseSection;
ObjectTypeInitializer.ValidAccessMask = SECTION_ALL_ACCESS;
ObCreateObjectType(&Name, &ObjectTypeInitializer, NULL, &MmSectionObjectType);
-
+
MmCreatePhysicalMemorySection();
return(STATUS_SUCCESS);
if(NT_SUCCESS(Status))
{
- UsedSize = Iosb.Information;
+ UsedSize = (ULONG)Iosb.Information;
}
}
#endif
EffectiveSegment->VirtualAddress = PAGE_ROUND_DOWN(VirtualAddress);
/* Round up the virtual size to the nearest page */
- EffectiveSegment->Length = PAGE_ROUND_UP(VirtualAddress + EffectiveSegment->Length) -
- EffectiveSegment->VirtualAddress;
+ EffectiveSegment->Length = (ULONG)(PAGE_ROUND_UP(VirtualAddress + EffectiveSegment->Length) -
+ EffectiveSegment->VirtualAddress);
/* Adjust the raw address and size */
VirtualOffset = VirtualAddress - EffectiveSegment->VirtualAddress;
- if (EffectiveSegment->FileOffset < VirtualOffset)
+ if (EffectiveSegment->FileOffset < (LONG_PTR)VirtualOffset)
{
return FALSE;
}
* offset point in curious and odd places, but that's what we were
* asked for
*/
- EffectiveSegment->FileOffset -= VirtualOffset;
- EffectiveSegment->RawLength += VirtualOffset;
+ EffectiveSegment->FileOffset -= (ULONG)VirtualOffset;
+ EffectiveSegment->RawLength += (ULONG)VirtualOffset;
}
else
{
*/
ASSERT(PAGE_ROUND_UP(Segment->VirtualAddress + Segment->Length) >= EndOfEffectiveSegment);
- EffectiveSegment->Length = PAGE_ROUND_UP(Segment->VirtualAddress + Segment->Length) -
- EffectiveSegment->VirtualAddress;
+ EffectiveSegment->Length = (ULONG)(PAGE_ROUND_UP(Segment->VirtualAddress + Segment->Length) -
+ EffectiveSegment->VirtualAddress);
/*
* Merge the protection
Address = (PVOID)PAGE_ROUND_DOWN(Address);
- Offset = ((ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress) +
- MemoryArea->Data.SectionData.ViewOffset;
+ Offset = (ULONG)(((ULONG_PTR)Address - (ULONG_PTR)MemoryArea->StartingAddress) +
+ MemoryArea->Data.SectionData.ViewOffset);
Section = MemoryArea->Data.SectionData.Section;
Segment = MemoryArea->Data.SectionData.Segment;
Offset -= PAGE_SIZE;
PageOp = MmCheckForPageOp(MemoryArea, NULL, NULL,
MemoryArea->Data.SectionData.Segment,
- Offset + MemoryArea->Data.SectionData.ViewOffset);
+ (ULONG)Offset + MemoryArea->Data.SectionData.ViewOffset);
if (PageOp)
{
MmUnlockAddressSpace(AddressSpace);
ExSectionInfoClass,
sizeof(ExSectionInfoClass) / sizeof(ExSectionInfoClass[0]),
SectionInformation,
- SectionInformationLength,
+ (ULONG)SectionInformationLength,
NULL,
ResultLength,
PreviousMode);
return(Status);
}
-
+
/**********************************************************************
* NAME EXPORTED
* MmMapViewOfSection
AllocationType,
Protect);
}
-
+
ASSERT(Process);
if (!Protect || Protect & ~PAGE_FLAGS_VALID_FOR_SECTION)
ULONG i;
ULONG NrSegments;
ULONG_PTR ImageBase;
- ULONG ImageSize;
+ SIZE_T ImageSize;
PMM_IMAGE_SECTION_OBJECT ImageSectionObject;
PMM_SECTION_SEGMENT SectionSegments;
ImageSize = max(ImageSize, MaxExtent);
}
- ImageSectionObject->ImageSize = ImageSize;
+ ImageSectionObject->ImageSize = (ULONG)ImageSize;
+
+ /* Check for an illegal base address */
+ if ((ImageBase + ImageSize) > (ULONG_PTR)MmHighestUserAddress)
+ {
+ ImageBase = PAGE_ROUND_DOWN((ULONG_PTR)MmHighestUserAddress - ImageSize);
+ }
/* Check there is enough space to map the section at that point. */
if (MmLocateMemoryAreaByRegion(AddressSpace, (PVOID)ImageBase,
else
{
/* Something must gone wrong
- * how can we have a Section but no
+ * how can we have a Section but no
* reference? */
DPRINT("ERROR: DataSectionObject without reference!\n");
}
PMMSUPPORT AddressSpace;
NTSTATUS Status;
PAGED_CODE();
-
+
if ((ULONG_PTR)SectionObject & 1)
{
extern PVOID MmSession;
DPRINT("MmUnmapViewInSystemSpace() called\n");
AddressSpace = MmGetKernelAddressSpace();
+
+ MmLockAddressSpace(AddressSpace);
Status = MmUnmapViewOfSegment(AddressSpace, MappedBase);
+
+ MmUnlockAddressSpace(AddressSpace);
return Status;
}
{
ULONG Protection;
PROS_SECTION_OBJECT *SectionObject = (PROS_SECTION_OBJECT *)Section;
-
+
/* Check if an ARM3 section is being created instead */
if (AllocationAttributes & 1)
{