From: Jeff Smith whydoubt@gmail.com
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54748 --- dlls/gdiplus/image.c | 7 ++++++- dlls/gdiplus/tests/image.c | 30 +++++++++++++----------------- 2 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 50a666c5bc9..7ad3ca0347e 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -2760,7 +2760,12 @@ GpStatus WINGDIPAPI GdipGetPropertySize(GpImage *image, UINT *size, UINT *count) }
reader = ((GpBitmap *)image)->metadata_reader; - if (!reader) return PropertyNotFound; + if (!reader) + { + *count = 0; + *size = 0; + return Ok; + }
hr = IWICMetadataReader_GetCount(reader, &prop_count); if (FAILED(hr)) return hresult_to_status(hr); diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 27b6bc9b2de..3d0d5d7a16f 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -3661,7 +3661,7 @@ static void test_image_properties(void) { gifimage, sizeof(gifimage), ImageTypeBitmap, 1, 4, 4, ~0, 0x5100, ~0, 16 }, { wmfimage, sizeof(wmfimage), ImageTypeMetafile, 0, ~0, 0, ~0, 0, ~0, -GenericError } }; - GpStatus status; + GpStatus status, expected; GpImage *image; UINT prop_count, prop_size, i; PROPID prop_id[16] = { 0 }; @@ -3786,6 +3786,18 @@ static void test_image_properties(void) "expected property id %#lx, got %#lx\n", prop_id[0], item.data.id); }
+ status = GdipGetPropertySize(NULL, &prop_size, &prop_count); + expect(InvalidParameter, status); + status = GdipGetPropertySize(image, &prop_size, NULL); + expect(InvalidParameter, status); + status = GdipGetPropertySize(image, NULL, &prop_count); + expect(InvalidParameter, status); + status = GdipGetPropertySize(image, NULL, NULL); + expect(InvalidParameter, status); + expected = (image_type == ImageTypeMetafile) ? NotImplemented : Ok; + status = GdipGetPropertySize(image, &prop_size, &prop_count); + expect(expected, status); + GdipDisposeImage(image);
winetest_pop_context(); @@ -4150,14 +4162,6 @@ static void test_GdipGetAllPropertyItems(void)
HeapFree(GetProcessHeap(), 0, prop_id);
- status = GdipGetPropertySize(NULL, &total_size, &total_count); - expect(InvalidParameter, status); - status = GdipGetPropertySize(image, &total_size, NULL); - expect(InvalidParameter, status); - status = GdipGetPropertySize(image, NULL, &total_count); - expect(InvalidParameter, status); - status = GdipGetPropertySize(image, NULL, NULL); - expect(InvalidParameter, status); total_size = 0xdeadbeef; total_count = 0xdeadbeef; status = GdipGetPropertySize(image, &total_size, &total_count); @@ -4958,14 +4962,6 @@ static void test_gif_properties(void)
HeapFree(GetProcessHeap(), 0, prop_id);
- status = GdipGetPropertySize(NULL, &total_size, &total_count); - expect(InvalidParameter, status); - status = GdipGetPropertySize(image, &total_size, NULL); - expect(InvalidParameter, status); - status = GdipGetPropertySize(image, NULL, &total_count); - expect(InvalidParameter, status); - status = GdipGetPropertySize(image, NULL, NULL); - expect(InvalidParameter, status); total_size = 0xdeadbeef; total_count = 0xdeadbeef; status = GdipGetPropertySize(image, &total_size, &total_count);