Author: fireball
Date: Mon Oct 18 15:30:18 2010
New Revision: 49197
URL:
http://svn.reactos.org/svn/reactos?rev=49197&view=rev
Log:
- Forward BitBlt with NULL source DC to PatBlt. Fixes this kind of crashes in different
apps (ab)using this feature of WinAPI.
See issue #5628 for more details.
Modified:
branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c
Modified: branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winen…
==============================================================================
--- branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/winent.drv/gdidrv.c [iso-8859-1] Mon Oct 18
15:30:18 2010
@@ -28,6 +28,8 @@
/* FUNCTIONS **************************************************************/
+BOOL CDECL RosDrv_PatBlt( NTDRV_PDEVICE *physDev, INT left, INT top, INT width, INT
height, DWORD rop );
+
BOOL CDECL RosDrv_AlphaBlend(NTDRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT widthDst,
INT heightDst,
NTDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, INT widthSrc,
INT heightSrc,
BLENDFUNCTION blendfn)
@@ -95,7 +97,15 @@
INT width, INT height, NTDRV_PDEVICE *physDevSrc,
INT xSrc, INT ySrc, DWORD rop )
{
+ BOOL useSrc;
POINT pts[2], ptBrush;
+
+ useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000));
+ if (!physDevSrc && useSrc) return FALSE;
+
+ /* Forward to PatBlt if src dev is missing */
+ if (!physDevSrc)
+ return RosDrv_PatBlt(physDevDst, xDst, yDst, width, height, rop);
/* map source coordinates */
if (physDevSrc)
@@ -897,7 +907,11 @@
NTDRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc,
INT widthSrc, INT heightSrc, DWORD rop )
{
+ BOOL useSrc;
POINT pts[2], ptBrush;
+
+ useSrc = (((rop >> 2) & 0x330000) != (rop & 0x330000));
+ if (!physDevSrc && useSrc) return FALSE;
/* map source coordinates */
if (physDevSrc)