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)