Author: greatlrd
Date: Sat Jun 7 06:35:53 2008
New Revision: 33885
URL: http://svn.reactos.org/svn/reactos?rev=33885&view=rev
Log:
BugFix : NtGdiStretchDIBitsInternal
it did not check after some NULL pointer and did crash in firefox.
and some reason NtGdiCreateCompatibleBitmap fail in some case, that what happen in firefox 1.5.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/dibobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dibobj.c [iso-8859-1] Sat Jun 7 06:35:53 2008
@@ -781,7 +781,7 @@
UINT cjMaxBits,
HANDLE hcmXform)
{
- HBITMAP hBitmap, hOldBitmap;
+ HBITMAP hBitmap, hOldBitmap = NULL;
HDC hdcMem;
HPALETTE hPal = NULL;
PDC pDC;
@@ -793,9 +793,22 @@
}
hdcMem = NtGdiCreateCompatibleDC(hDC);
+ if (hdcMem == NULL)
+ {
+ DPRINT1("NtGdiCreateCompatibleDC fail create hdc\n");
+ return 0;
+ }
+
hBitmap = NtGdiCreateCompatibleBitmap(hDC, BitsInfo->bmiHeader.biWidth,
BitsInfo->bmiHeader.biHeight);
- hOldBitmap = NtGdiSelectBitmap(hdcMem, hBitmap);
+ if (hBitmap == NULL)
+ {
+ DPRINT1("NtGdiCreateCompatibleBitmap fail create bitmap\n");
+ DPRINT1("hDC : 0x%08x \n", hDC);
+ DPRINT1("BitsInfo->bmiHeader.biWidth : 0x%08x \n", BitsInfo->bmiHeader.biWidth);
+ DPRINT1("BitsInfo->bmiHeader.biWidth : 0x%08x \n", BitsInfo->bmiHeader.biHeight);
+ return 0;
+ }
if(Usage == DIB_PAL_COLORS)
{
@@ -817,16 +830,18 @@
}
pDC = DC_LockDc(hdcMem);
-
- /* Note BitsInfo->bmiHeader.biHeight is the number of scanline,
- * if it negitve we getting to many scanline for scanline is UINT not
- * a INT, so we need make the negtive value to positve and that make the
- * count correct for negtive bitmap, TODO : we need testcase for this api */
-
- IntSetDIBits(pDC, hBitmap, 0, abs(BitsInfo->bmiHeader.biHeight), Bits,
+ if (pDC != NULL)
+ {
+ /* Note BitsInfo->bmiHeader.biHeight is the number of scanline,
+ * if it negitve we getting to many scanline for scanline is UINT not
+ * a INT, so we need make the negtive value to positve and that make the
+ * count correct for negtive bitmap, TODO : we need testcase for this api */
+
+ IntSetDIBits(pDC, hBitmap, 0, abs(BitsInfo->bmiHeader.biHeight), Bits,
BitsInfo, Usage);
- DC_UnlockDc(pDC);
+ DC_UnlockDc(pDC);
+ }
/* Origin for DIBitmap may be bottom left (positive biHeight) or top
@@ -840,11 +855,17 @@
hdcMem, XSrc, abs(BitsInfo->bmiHeader.biHeight) - SrcHeight - YSrc,
SrcWidth, SrcHeight, ROP, 0);
+ /* cleanup */
if(hPal)
GdiSelectPalette(hdcMem, hPal, FALSE);
- NtGdiSelectBitmap(hdcMem, hOldBitmap);
+ if (hOldBitmap != NULL)
+ {
+ NtGdiSelectBitmap(hdcMem, hOldBitmap);
+ }
+
NtGdiDeleteObjectApp(hdcMem);
+
NtGdiDeleteObject(hBitmap);
return SrcHeight;
Author: greatlrd
Date: Sat Jun 7 05:15:38 2008
New Revision: 33884
URL: http://svn.reactos.org/svn/reactos?rev=33884&view=rev
Log:
fix one winetest for Bitmap and add note why some alpha blend test fails.
Modified:
trunk/reactos/subsystems/win32/win32k/eng/bitblt.c
Modified: trunk/reactos/subsystems/win32/win32k/eng/bitblt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/en…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/eng/bitblt.c [iso-8859-1] Sat Jun 7 05:15:38 2008
@@ -1081,10 +1081,13 @@
/* Validate input */
+ /* FIXME when WindowOrg.x or .y are negitve this check are not vaild,
+ * we need convert the inputRect to the windows org and do it right */
InputRect = *SourceRect;
if ( (InputRect.top < 0) || (InputRect.bottom < 0) ||
(InputRect.left < 0) || (InputRect.right < 0) )
{
+ SetLastWin32Error(ERROR_INVALID_PARAMETER);
return FALSE;
}
Author: fireball
Date: Sat Jun 7 04:20:05 2008
New Revision: 33882
URL: http://svn.reactos.org/svn/reactos?rev=33882&view=rev
Log:
- Revert 33881, PatBlt may be buggy, but what was introduced in 33881 was a non-working hack. Unregresses FF2.0 installer having a black rectangle in the bottom of its window.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/bitblt.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitblt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Sat Jun 7 04:20:05 2008
@@ -1069,13 +1069,10 @@
INT Height,
DWORD ROP)
{
- /* FIXME PatBlt code is wrong, we using NtGdiBitBlt to workaround this bug for now, like random crash, and so on */
-#if 0
PGDIBRUSHOBJ BrushObj;
DC *dc;
PDC_ATTR Dc_Attr;
BOOL ret;
-#endif
BOOL UsesSource = ROP3_USES_SOURCE(ROP);
if (UsesSource)
@@ -1084,9 +1081,6 @@
return NtGdiMaskBlt(hDC, XLeft, YLeft, Width, Height, 0,0,0,0,0,0,ROP,0);
}
- return NtGdiBitBlt( hDC, XLeft, YLeft, Width, Height, 0, 0, 0, ROP, 0, 0);
-
-#if 0
dc = DC_LockDc(hDC);
if (dc == NULL)
{
@@ -1123,7 +1117,6 @@
DC_UnlockDc(dc);
return ret;
-#endif
}
BOOL STDCALL
Author: greatlrd
Date: Sat Jun 7 02:58:39 2008
New Revision: 33881
URL: http://svn.reactos.org/svn/reactos?rev=33881&view=rev
Log:
disable NtGdiPatBlt code, in some case it can cause random crash and have some graphic glichters it need be rewrite.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/bitblt.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/bitblt.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/bitblt.c [iso-8859-1] Sat Jun 7 02:58:39 2008
@@ -1069,18 +1069,24 @@
INT Height,
DWORD ROP)
{
+ /* FIXME PatBlt code is wrong, we using NtGdiBitBlt to workaround this bug for now, like random crash, and so on */
+#if 0
PGDIBRUSHOBJ BrushObj;
DC *dc;
PDC_ATTR Dc_Attr;
+ BOOL ret;
+#endif
+
BOOL UsesSource = ROP3_USES_SOURCE(ROP);
- BOOL ret;
-
if (UsesSource)
{
/* in this case we call on GdiMaskBlt */
return NtGdiMaskBlt(hDC, XLeft, YLeft, Width, Height, 0,0,0,0,0,0,ROP,0);
}
+ return NtGdiBitBlt( hDC, XLeft, YLeft, Width, Height, 0, 0, 0, ROP, 0, 0);
+
+#if 0
dc = DC_LockDc(hDC);
if (dc == NULL)
{
@@ -1117,6 +1123,7 @@
DC_UnlockDc(dc);
return ret;
+#endif
}
BOOL STDCALL