From 9c5d9d1b46c26258a1023902f5b8d16926b64763 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Tue, 1 May 2012 12:47:21 +0000 Subject: [PATCH] [WIN32K] Use user mode mem for bitmaps larger than 4K to save pool memory. svn path=/trunk/; revision=56462 --- reactos/win32ss/gdi/ntgdi/bitmaps.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/reactos/win32ss/gdi/ntgdi/bitmaps.c b/reactos/win32ss/gdi/ntgdi/bitmaps.c index 0302f128e0f..73b9df48358 100644 --- a/reactos/win32ss/gdi/ntgdi/bitmaps.c +++ b/reactos/win32ss/gdi/ntgdi/bitmaps.c @@ -143,7 +143,7 @@ NtGdiCreateBitmap( IN OPTIONAL LPBYTE pUnsafeBits) { HBITMAP hbmp; - ULONG cRealBpp, cjWidthBytes, iFormat; + ULONG cRealBpp, cjWidthBytes, iFormat, fjBitmap; ULONGLONG cjSize; PSURFACE psurf; @@ -165,12 +165,15 @@ NtGdiCreateBitmap( return NULL; } + /* Allocations larger than PAGE_SIZE go into user mem */ + fjBitmap = (cjSize > PAGE_SIZE) ? BMF_USERMEM : 0; + /* Allocate the surface (but don't set the bits) */ psurf = SURFACE_AllocSurface(STYPE_BITMAP, nWidth, nHeight, iFormat, - 0, + fjBitmap, 0, NULL); if (!psurf)