Am Freitag, den 11.09.2009, 01:56 +0400 schrieb Nikolay Sivov:
> Just correct your patch (as you mentioned before), include simple
> testcase and resend.
> So nothing to wait for.
>
> Basic test shows it doesn't crash on Windows and doesn't change last
> error - I already
> check this on XP and it passes.
>
Ok, attached you will find my second try. Testcase of Nicolay included
this time. Hopefully it will be better this time.
Best regards.
diff -ru wine/dlls/gdi32/bitblt.c new/dlls/gdi32/bitblt.c
--- wine/dlls/gdi32/bitblt.c 2009-09-10 22:44:09.000000000 +0200
+++ new/dlls/gdi32/bitblt.c 2009-09-11 00:29:39.000000000 +0200
@@ -518,9 +518,11 @@
DC *dcDst, *dcSrc;
dcSrc = get_dc_ptr( hdcSrc );
+ if ( !dcSrc ) return ret;
+
if ((dcDst = get_dc_ptr( hdcDst )))
{
- if (dcSrc) update_dc( dcSrc );
+ update_dc( dcSrc );
update_dc( dcDst );
TRACE("%p %d,%d %dx%d -> %p %d,%d %dx%d op=%02x flags=%02x srcconstalpha=%02x alphafmt=%02x\n",
hdcSrc, xSrc, ySrc, widthSrc, heightSrc,
@@ -533,7 +535,7 @@
xSrc, ySrc, widthSrc, heightSrc, blendFunction );
release_dc_ptr( dcDst );
}
- if (dcSrc) release_dc_ptr( dcSrc );
+ release_dc_ptr( dcSrc );
return ret;
}
diff -ru wine/dlls/gdi32/tests/bitmap.c new/dlls/gdi32/tests/bitmap.c
--- wine/dlls/gdi32/tests/bitmap.c 2009-09-10 22:44:09.000000000 +0200
+++ new/dlls/gdi32/tests/bitmap.c 2009-09-11 00:35:22.000000000 +0200
@@ -2393,6 +2393,10 @@
expect_eq(pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, -1, 0, 30, 30, blend), TRUE, BOOL, "%d");
expect_eq(pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, hdcSrc, 0, -1, 30, 30, blend), TRUE, BOOL, "%d");
+ SetLastError(0xdeadbeef);
+ expect_eq(pGdiAlphaBlend(hdcDst, 0, 0, 20, 20, NULL, 0, 0, 20, 20, blend), FALSE, BOOL, "%d");
+ expect_eq(GetLastError(), 0xdeadbeef, int, "%d");
+
SelectObject(hdcDst, oldDst);
SelectObject(hdcSrc, oldSrc);
DeleteObject(bmpSrc);