Author: tkreuzer
Date: Sat Mar 23 21:50:27 2013
New Revision: 58597
URL:
http://svn.reactos.org/svn/reactos?rev=58597&view=rev
Log:
[WIN32K]
- Fix amd64 build
- Add an overflow check, ASSERT success when unmapping a section view
Modified:
trunk/reactos/win32ss/gdi/eng/floatobj.h
trunk/reactos/win32ss/gdi/eng/mapping.c
Modified: trunk/reactos/win32ss/gdi/eng/floatobj.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/floatobj.h…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/floatobj.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/floatobj.h [iso-8859-1] Sat Mar 23 21:50:27 2013
@@ -80,9 +80,9 @@
#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;
Modified: trunk/reactos/win32ss/gdi/eng/mapping.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/mapping.c?…
==============================================================================
--- trunk/reactos/win32ss/gdi/eng/mapping.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/eng/mapping.c [iso-8859-1] Sat Mar 23 21:50:27 2013
@@ -25,6 +25,13 @@
LARGE_INTEGER liSectionOffset;
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);
@@ -48,7 +55,7 @@
}
/* Secure the section memory */
- *phSecure = EngSecureMem(pvBaseAddress, cjSize);
+ *phSecure = EngSecureMem(pvBaseAddress, (ULONG)cjSize);
if (!*phSecure)
{
ZwUnmapViewOfSection(NtCurrentProcess(), pvBaseAddress);
@@ -76,10 +83,7 @@
/* Unmap the section view */
Status = MmUnmapViewOfSection(PsGetCurrentProcess(), pvBits);
- if (!NT_SUCCESS(Status))
- {
- DPRINT1("Could not unmap section view!\n");
- }
+ ASSERT(NT_SUCCESS(Status));
}