From: Kamil Hornicek Date: Mon, 28 Feb 2011 12:47:01 +0000 (+0000) Subject: [WIN32K] X-Git-Tag: ReactOS-0.3.13~108 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=9fb8200d9b935c394ceaba30585474055d3c77b2;ds=sidebyside [WIN32K] Fix calculating of ScanLines and source point in NtGdiGetDIBitsInternal for top-down bitmaps to more closely mimic win xp behavior. (Timo - high five for your test app) See issue #5524 for more details. svn path=/trunk/; revision=50935 --- diff --git a/reactos/subsystems/win32/win32k/objects/dibobj.c b/reactos/subsystems/win32/win32k/objects/dibobj.c index 963f152acbd..1a26cd6f49f 100644 --- a/reactos/subsystems/win32/win32k/objects/dibobj.c +++ b/reactos/subsystems/win32/win32k/objects/dibobj.c @@ -939,9 +939,26 @@ NtGdiGetDIBitsInternal( rcDest.bottom = ScanLines; rcDest.right = psurf->SurfObj.sizlBitmap.cx; - srcPoint.x = 0; - srcPoint.y = height < 0 ? - psurf->SurfObj.sizlBitmap.cy - (StartScan + ScanLines) : StartScan; + srcPoint.x = 0; + + if(height < 0) + { + srcPoint.y = 0; + + if(ScanLines <= StartScan) + { + ScanLines = 1; + SURFACE_ShareUnlockSurface(psurfDest); + GreDeleteObject(hBmpDest); + goto done; + } + + ScanLines -= StartScan; + } + else + { + srcPoint.y = StartScan; + } EXLATEOBJ_vInitialize(&exlo, psurf->ppal, psurfDest->ppal, 0xffffff, 0xffffff, 0);