mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 12:23:25 +00:00
[FREELDR]
Round up to pages when updating LoaderPagesSpanned to avoid a bug when the last memory region is not mapped. svn path=/branches/ros-amd64-bringup/; revision=43602
This commit is contained in:
@@ -75,8 +75,8 @@ PVOID MmAllocateMemoryWithType(ULONG MemorySize, TYPE_OF_MEMORY MemoryType)
|
||||
#endif // DBG
|
||||
|
||||
// Update LoaderPagesSpanned count
|
||||
if ((((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT) > LoaderPagesSpanned)
|
||||
LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT);
|
||||
if ((((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT) > LoaderPagesSpanned)
|
||||
LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT);
|
||||
|
||||
// Now return the pointer
|
||||
return MemPointer;
|
||||
@@ -175,8 +175,8 @@ PVOID MmAllocateMemoryAtAddress(ULONG MemorySize, PVOID DesiredAddress, TYPE_OF_
|
||||
#endif // DBG
|
||||
|
||||
// Update LoaderPagesSpanned count
|
||||
if ((((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT) > LoaderPagesSpanned)
|
||||
LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize) >> PAGE_SHIFT);
|
||||
if ((((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT) > LoaderPagesSpanned)
|
||||
LoaderPagesSpanned = (((ULONG_PTR)MemPointer + MemorySize + PAGE_SIZE - 1) >> PAGE_SHIFT);
|
||||
|
||||
// Now return the pointer
|
||||
return MemPointer;
|
||||
|
||||
Reference in New Issue
Block a user