From da2021e46fb05addd74b1bab32f971d88ab5b347 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 3 Nov 2016 23:34:44 +0300 Subject: [PATCH] gdiplus: Return success from GdipImageSetAbort(). Signed-off-by: Nikolay Sivov Signed-off-by: Vincent Povirk Signed-off-by: Alexandre Julliard --- dlls/gdiplus/image.c | 11 +++++++++-- dlls/gdiplus/tests/image.c | 27 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index e4eba2bb6ea..21d5a3ac8d0 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -5373,8 +5373,15 @@ GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type) */ GpStatus WINGDIPAPI GdipImageSetAbort(GpImage *image, GdiplusAbort *pabort) { - FIXME("(%p, %p): stub\n", image, pabort); - return NotImplemented; + TRACE("(%p, %p)\n", image, pabort); + + if (!image) + return InvalidParameter; + + if (pabort) + FIXME("Abort callback is not supported.\n"); + + return Ok; } /***************************************************************************** diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index ad0cc6f1bd0..6abd02631be 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -32,6 +32,7 @@ static GpStatus (WINAPI *pGdipBitmapGetHistogramSize)(HistogramFormat,UINT*); static GpStatus (WINAPI *pGdipBitmapGetHistogram)(GpBitmap*,HistogramFormat,UINT,UINT*,UINT*,UINT*,UINT*); +static GpStatus (WINAPI *pGdipImageSetAbort)(GpImage*,GdiplusAbort*); #define expect(expected, got) ok((got) == (expected), "Expected %d, got %d\n", (UINT)(expected), (UINT)(got)) #define expectf(expected, got) ok(fabs((expected) - (got)) < 0.0001, "Expected %f, got %f\n", (expected), (got)) @@ -4916,6 +4917,30 @@ static void test_histogram(void) GdipDisposeImage((GpImage*)bm); } +static void test_imageabort(void) +{ + GpStatus stat; + GpBitmap *bm; + + if (!pGdipImageSetAbort) + { + win_skip("GdipImageSetAbort() is not supported.\n"); + return; + } + + bm = NULL; + stat = GdipCreateBitmapFromScan0(8, 8, 0, PixelFormat24bppRGB, NULL, &bm); + expect(Ok, stat); + + stat = pGdipImageSetAbort(NULL, NULL); + expect(InvalidParameter, stat); + + stat = pGdipImageSetAbort((GpImage*)bm, NULL); + expect(Ok, stat); + + GdipDisposeImage((GpImage*)bm); +} + START_TEST(image) { HMODULE mod = GetModuleHandleA("gdiplus.dll"); @@ -4931,6 +4956,7 @@ START_TEST(image) pGdipBitmapGetHistogramSize = (void*)GetProcAddress(mod, "GdipBitmapGetHistogramSize"); pGdipBitmapGetHistogram = (void*)GetProcAddress(mod, "GdipBitmapGetHistogram"); + pGdipImageSetAbort = (void*)GetProcAddress(mod, "GdipImageSetAbort"); test_supported_encoders(); test_CloneBitmapArea(); @@ -4979,6 +5005,7 @@ START_TEST(image) test_createeffect(); test_getadjustedpalette(); test_histogram(); + test_imageabort(); GdiplusShutdown(gdiplusToken); } -- 2.11.4.GIT