diff --git a/reactos/win32ss/gdi/eng/floatobj.h b/reactos/win32ss/gdi/eng/floatobj.h index 16bc2d1a06d..91fe93e399b 100644 --- a/reactos/win32ss/gdi/eng/floatobj.h +++ b/reactos/win32ss/gdi/eng/floatobj.h @@ -80,9 +80,9 @@ extern const FLOATOBJ gef16; #define FLOATOBJ_16 16. #define FLOATOBJ_1_16 (1./16.) -#define gef0 FLOATOBJ_0 -#define gef1 FLOATOBJ_1 -#define gef16 FLOATOBJ_16 +static const FLOATOBJ gef0 = 0.; +static const FLOATOBJ gef1 = 1.; +static const FLOATOBJ gef16 = 16.; #define FLOATOBJ_Set0(fo) *(fo) = 0; #define FLOATOBJ_Set1(fo) *(fo) = 1; diff --git a/reactos/win32ss/gdi/eng/mapping.c b/reactos/win32ss/gdi/eng/mapping.c index 971aad6b239..3a99745c4e7 100644 --- a/reactos/win32ss/gdi/eng/mapping.c +++ b/reactos/win32ss/gdi/eng/mapping.c @@ -26,6 +26,13 @@ EngMapSectionView( PVOID pvBaseAddress; NTSTATUS Status; + /* Check if the size is ok (for 64 bit) */ + if (cjSize > ULONG_MAX) + { + DPRINT1("chSize out of range: 0x%Id\n", cjSize); + return NULL; + } + /* Align the offset at allocation granularity and compensate for the size */ liSectionOffset.QuadPart = cjOffset & ~(MM_ALLOCATION_GRANULARITY - 1); cjSize += cjOffset & (MM_ALLOCATION_GRANULARITY - 1); @@ -48,7 +55,7 @@ EngMapSectionView( } /* Secure the section memory */ - *phSecure = EngSecureMem(pvBaseAddress, cjSize); + *phSecure = EngSecureMem(pvBaseAddress, (ULONG)cjSize); if (!*phSecure) { ZwUnmapViewOfSection(NtCurrentProcess(), pvBaseAddress); @@ -76,10 +83,7 @@ EngUnmapSectionView( /* Unmap the section view */ Status = MmUnmapViewOfSection(PsGetCurrentProcess(), pvBits); - if (!NT_SUCCESS(Status)) - { - DPRINT1("Could not unmap section view!\n"); - } + ASSERT(NT_SUCCESS(Status)); }