Author: tkreuzer Date: Tue Jul 31 18:53:17 2012 New Revision: 57007
URL: http://svn.reactos.org/svn/reactos?rev=57007&view=rev Log: [WIN32K] - Use a global trivial CLIPOBJ if a NULL one is passed - Don't pass a pointer to uninitialized memory to DrvBitBlt
Modified: trunk/reactos/win32ss/gdi/eng/bitblt.c trunk/reactos/win32ss/gdi/eng/bitblt_new.c trunk/reactos/win32ss/gdi/eng/engobjects.h trunk/reactos/win32ss/gdi/eng/transblt.c
Modified: trunk/reactos/win32ss/gdi/eng/bitblt.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/bitblt.c?re... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/bitblt.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/bitblt.c [iso-8859-1] Tue Jul 31 18:53:17 2012 @@ -11,6 +11,12 @@
#define NDEBUG #include <debug.h> + +XCLIPOBJ gxcoTrivial = +{ + {0, {LONG_MIN, LONG_MIN, LONG_MAX, LONG_MAX}, DC_TRIVIAL, FC_RECT, TC_RECTANGLES, 0}, + 0, 0, 0 +};
typedef BOOLEAN (APIENTRY *PBLTRECTFUNC)(SURFOBJ* OutputObj, SURFOBJ* InputObj, @@ -590,6 +596,8 @@ if (pco->iDComplexity == DC_RECT) pco = NULL; } + else + pco = &gxcoTrivial.ClipObj;
if (ROP4_USES_SOURCE(Rop4)) { @@ -601,6 +609,7 @@ rclSrc.top = pptlSrc->y + rclClipped.top - prclTrg->top; rclSrc.right = rclSrc.left + rclClipped.right - rclClipped.left; rclSrc.bottom = rclSrc.top + rclClipped.bottom - rclClipped.top; + pptlSrc = (PPOINTL)&rclSrc; } else { @@ -647,7 +656,7 @@ pco, pxlo, &rclClipped, - (POINTL*)&rclSrc, + pptlSrc, pptlMask, pbo, pptlBrush ? &ptlBrush : NULL,
Modified: trunk/reactos/win32ss/gdi/eng/bitblt_new.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/bitblt_new.... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/bitblt_new.c [iso-8859-1] Tue Jul 31 18:53:17 2012 @@ -5,9 +5,12 @@
#define SURFOBJ_flags(pso) (CONTAINING_RECORD(pso, SURFACE, SurfObj)->flags)
-#define XCLIPOBJ CLIPGDI - -XCLIPOBJ gxcoTrivial; +// FIXME this needs to be updated, once we use the new structure +XCLIPOBJ gxcoTrivial = +{ + {0, {LONG_MIN, LONG_MIN, LONG_MAX, LONG_MAX}, DC_TRIVIAL, FC_RECT, TC_RECTANGLES, 0}, + 0, 0, 0 +};
static
Modified: trunk/reactos/win32ss/gdi/eng/engobjects.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/engobjects.... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/engobjects.h [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/engobjects.h [iso-8859-1] Tue Jul 31 18:53:17 2012 @@ -75,6 +75,11 @@ ENUMRECTS EnumRects; } CLIPGDI, *PCLIPGDI;
+// HACK, until we use the original structure +#define XCLIPOBJ CLIPGDI + +extern XCLIPOBJ gxcoTrivial; + /*ei What is this for? */ typedef struct _DRVFUNCTIONSGDI { HDEV hdev;
Modified: trunk/reactos/win32ss/gdi/eng/transblt.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/eng/transblt.c?... ============================================================================== --- trunk/reactos/win32ss/gdi/eng/transblt.c [iso-8859-1] (original) +++ trunk/reactos/win32ss/gdi/eng/transblt.c [iso-8859-1] Tue Jul 31 18:53:17 2012 @@ -1,4 +1,4 @@ -/* +/* * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel * PURPOSE: GDI TransparentBlt Function @@ -226,6 +226,9 @@ ASSERT(psurfDest); ASSERT(psurfSource);
+ /* If no clip object is given, use trivial one */ + if (!Clip) Clip = &gxcoTrivial.ClipObj; + InputClippedRect = *DestRect; if(InputClippedRect.right < InputClippedRect.left) { @@ -241,7 +244,7 @@ InputRect = *SourceRect; /* Clip against the bounds of the clipping region so we won't try to write * outside the surface */ - if(Clip) + if (Clip->iDComplexity != DC_TRIVIAL) { if(!RECTL_bIntersectRect(&OutputRect, &InputClippedRect, &Clip->rclBounds)) {