-- v7: gdiplus/test: Add GdipGetEffectParameterSize test. gdiplus: Add GdipGetEffectParameterSize stub and fix GdipDeleteEffect
From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 178592e35d9..0f17bb02d4d 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -612,7 +612,7 @@ 612 stdcall GdipGetImageItemData(ptr ptr) 613 stdcall GdipCreateEffect(int128 ptr) 614 stdcall GdipDeleteEffect(ptr) -615 stub GdipGetEffectParameterSize +615 stdcall GdipGetEffectParameterSize(ptr ptr) 616 stub GdipGetEffectParameters 617 stdcall GdipSetEffectParameters(ptr ptr long) 618 stdcall GdipInitializePalette(ptr long long long ptr) diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index eaf01cab65b..9362cdc344d 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -5525,11 +5525,26 @@ GpStatus WINGDIPAPI GdipCreateEffect(const GUID guid, CGpEffect **effect) GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect) { FIXME("(%p): stub\n", effect); + + if (!effect) + return InvalidParameter; /* note: According to Jose Roca's GDI+ Docs, this is not implemented * in Windows's gdiplus */ return NotImplemented; }
+/***************************************************************************** + * GdipGetEffectParameterSize [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipGetEffectParameterSize(CGpEffect *effect, UINT *size) +{ + FIXME("(%p,%p): stub\n", effect, size); + + if (!effect || !size) + return InvalidParameter; + return NotImplemented; +} + /***************************************************************************** * GdipSetEffectParameters [GDIPLUS.@] */
From: Bartosz Kosiorek gang65@poczta.onet.pl
--- dlls/gdiplus/tests/image.c | 60 +++++++++++++++++++++++++++++++------- 1 file changed, 50 insertions(+), 10 deletions(-)
diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 8fc9aa78225..d3ac65148d2 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -5407,20 +5407,40 @@ static void test_createeffect(void) static const GUID noneffect = { 0xcd0c3d4b, 0xe15e, 0x4cf2, { 0x9e, 0xa8, 0x6e, 0x1d, 0x65, 0x48, 0xc5, 0xa5 } }; GpStatus (WINAPI *pGdipCreateEffect)( const GUID guid, CGpEffect **effect); GpStatus (WINAPI *pGdipDeleteEffect)( CGpEffect *effect); + GpStatus (WINAPI *pGdipGetEffectParameterSize)(CGpEffect *effect, UINT *size); + GpStatus (WINAPI *pGdipGetEffectParameters)(CGpEffect *effect, const VOID *params, const UINT size); GpStatus stat; CGpEffect *effect; HMODULE mod = GetModuleHandleA("gdiplus.dll"); int i; - const GUID * const effectlist[] = - {&BlurEffectGuid, &SharpenEffectGuid, &ColorMatrixEffectGuid, &ColorLUTEffectGuid, - &BrightnessContrastEffectGuid, &HueSaturationLightnessEffectGuid, &LevelsEffectGuid, - &TintEffectGuid, &ColorBalanceEffectGuid, &RedEyeCorrectionEffectGuid, &ColorCurveEffectGuid}; + UINT param_size; + + static const struct test_data { + const GUID *effect; + const UINT parameters_number; + const BOOL todo; + } td[] = + { + { &BlurEffectGuid, 8, TRUE }, + { &BrightnessContrastEffectGuid, 8, TRUE }, + { &ColorBalanceEffectGuid, 12, TRUE }, + { &ColorCurveEffectGuid, 12, TRUE }, + { &ColorLUTEffectGuid, 1024, TRUE }, + { &ColorMatrixEffectGuid, 100, TRUE }, + { &HueSaturationLightnessEffectGuid, 12, TRUE }, + { &LevelsEffectGuid, 12, TRUE }, + { &RedEyeCorrectionEffectGuid, 8, TRUE }, + { &SharpenEffectGuid, 8, TRUE }, + { &TintEffectGuid, 8, TRUE }, + };
pGdipCreateEffect = (void*)GetProcAddress( mod, "GdipCreateEffect"); pGdipDeleteEffect = (void*)GetProcAddress( mod, "GdipDeleteEffect"); - if(!pGdipCreateEffect || !pGdipDeleteEffect) + pGdipGetEffectParameterSize = (void*)GetProcAddress( mod, "GdipGetEffectParameterSize"); + pGdipGetEffectParameters = (void*)GetProcAddress( mod, "GdipGetEffectParameters"); + if (!pGdipCreateEffect || !pGdipDeleteEffect || !pGdipGetEffectParameterSize || !pGdipGetEffectParameters) { - /* GdipCreateEffect/GdipDeleteEffect was introduced in Windows Vista. */ + /* GdipCreateEffect/GdipDeleteEffect/GdipGetEffectParameterSize/GdipGetEffectParameters were introduced in Windows Vista. */ win_skip("GDIPlus version 1.1 not available\n"); return; } @@ -5431,16 +5451,36 @@ static void test_createeffect(void) stat = pGdipCreateEffect(noneffect, &effect); todo_wine expect(Win32Error, stat);
- for(i=0; i < ARRAY_SIZE(effectlist); i++) + param_size = 0; + stat = pGdipGetEffectParameterSize(NULL, ¶m_size); + expect(InvalidParameter, stat); + expect(0, param_size); + + for (i = 0; i < ARRAY_SIZE(td); i++) { - stat = pGdipCreateEffect(*effectlist[i], &effect); - todo_wine expect(Ok, stat); - if(stat == Ok) + stat = pGdipCreateEffect(*(td[i].effect), &effect); + todo_wine_if(td[i].todo) expect(Ok, stat); + if (stat == Ok) { + param_size = 0; + stat = pGdipGetEffectParameterSize(effect, ¶m_size); + todo_wine_if(td[i].todo) expect(Ok, stat); +#ifdef _WIN64 + /* Parameter Size for Red Eye Correction effect is different for 64 bits build */ + if (td[i].effect == &RedEyeCorrectionEffectGuid) + todo_wine_if(td[i].todo) expect(16, param_size); + else + todo_wine_if(td[i].todo) expect(td[i].parameters_number, param_size); +#else + todo_wine_if(td[i].todo) expect(td[i].parameters_number, param_size); +#endif stat = pGdipDeleteEffect(effect); expect(Ok, stat); } } + + stat = pGdipDeleteEffect(NULL); + expect(InvalidParameter, stat); }
static void test_getadjustedpalette(void)
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=149239
Your paranoid android.
=== debian11b (64 bit WoW report) ===
kernel32: comm.c:1574: Test failed: AbortWaitCts hComPortEvent failed comm.c:1586: Test failed: Unexpected time 1001, expected around 500
Report validation errors: mshtml:script crashed (c0000005)