From 93a03949bf7a21850734c6f37fd0779b3e74b559 Mon Sep 17 00:00:00 2001 From: Dmitry Gorbachev Date: Fri, 16 Mar 2007 16:54:34 +0000 Subject: [PATCH] Fix bugs #2049 and #2084 (thanks to Peter Krawies) svn path=/trunk/; revision=26117 --- reactos/boot/freeldr/freeldr/include/video.h | 2 +- reactos/ntoskrnl/mm/section.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/include/video.h b/reactos/boot/freeldr/freeldr/include/video.h index ba66d7771c4..34d00c7ab9d 100644 --- a/reactos/boot/freeldr/freeldr/include/video.h +++ b/reactos/boot/freeldr/freeldr/include/video.h @@ -29,7 +29,7 @@ typedef struct extern PVOID VideoOffScreenBuffer; -USHORT BiosIsVesaSupported(VOID); // Implemented in i386vid.S, returns the VESA version +USHORT BiosIsVesaSupported(VOID); // Implemented in i386vid.c, returns the VESA version PVOID VideoAllocateOffScreenBuffer(VOID); // Returns a pointer to an off-screen buffer sufficient for the current video mode diff --git a/reactos/ntoskrnl/mm/section.c b/reactos/ntoskrnl/mm/section.c index a1157fc4ffa..082f99451c7 100644 --- a/reactos/ntoskrnl/mm/section.c +++ b/reactos/ntoskrnl/mm/section.c @@ -3716,7 +3716,7 @@ NtMapViewOfSection(IN HANDLE SectionHandle, if(SectionOffset != NULL) { ProbeForWriteLargeInteger(SectionOffset); - SafeSectionOffset = *SectionOffset; + SafeSectionOffset.QuadPart = PAGE_ROUND_DOWN(SectionOffset->QuadPart); } ProbeForWriteSize_t(ViewSize); SafeViewSize = *ViewSize; @@ -3735,7 +3735,8 @@ NtMapViewOfSection(IN HANDLE SectionHandle, else { SafeBaseAddress = (BaseAddress != NULL ? *BaseAddress : NULL); - SafeSectionOffset.QuadPart = (SectionOffset != NULL ? SectionOffset->QuadPart : 0); + SafeSectionOffset.QuadPart = + (SectionOffset != NULL ? PAGE_ROUND_DOWN(SectionOffset->QuadPart) : 0); SafeViewSize = (ViewSize != NULL ? *ViewSize : 0); }