[PATCH v3 0/2] MR10086: comctl32/animate: Always return FALSE for ACM_OPEN with a NULL LPARAM.
-- v3: comctl32/animate: Always return FALSE for ACM_OPEN with a NULL LPARAM. https://gitlab.winehq.org/wine/wine/-/merge_requests/10086
From: Zhiyi Zhang <zzhang@codeweavers.com> --- dlls/comctl32/tests/animate.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/comctl32/tests/animate.c b/dlls/comctl32/tests/animate.c index ad7e16ace65..0b9c99fc0b8 100644 --- a/dlls/comctl32/tests/animate.c +++ b/dlls/comctl32/tests/animate.c @@ -150,6 +150,25 @@ static void test_play(void) ok(res != 0, "Load AVI resource failed\n"); res = SendMessageA(hAnimateWnd, ACM_PLAY, (WPARAM) -1, MAKELONG(0, -1)); ok(res != 0, "Play should have worked\n"); + /* Test ACM_OPEN after playing an animation */ + res = SendMessageA(hAnimateWnd, ACM_OPENA, 0, 0); + todo_wine + ok(res == 0, "ACM_OPENA with a NULL lparam while playing should return 0\n"); + destroy_animate(); + + /* Test ACM_OPEN after opening an animation */ + create_animate(0, 0); + res = SendMessageA(hAnimateWnd, ACM_OPENA, (WPARAM)shell32, MAKEINTRESOURCE(SEARCHING_AVI_INDEX)); + ok(res != 0, "Load AVI resource failed\n"); + res = SendMessageA(hAnimateWnd, ACM_OPENA, 0, 0); + todo_wine + ok(res == 0, "ACM_OPENA with a NULL lparam should return 0\n"); + destroy_animate(); + + /* Test ACM_OPEN without opening an animation */ + create_animate(0, 0); + res = SendMessageA(hAnimateWnd, ACM_OPENA, 0, 0); + ok(res == 0, "ACM_OPENA with a NULL lparam should return 0\n"); destroy_animate(); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10086
From: Zhiyi Zhang <zzhang@codeweavers.com> --- dlls/comctl32/animate.c | 3 ++- dlls/comctl32/tests/animate.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c index 436faf920b4..cbea08350a9 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -182,6 +182,7 @@ static void ANIMATE_Free(ANIMATE_INFO *infoPtr) { ANIMATE_DoStop(infoPtr); mmioClose(infoPtr->hMMio, 0); + infoPtr->hMMio = NULL; if (infoPtr->hRes) { FreeResource(infoPtr->hRes); @@ -693,7 +694,7 @@ static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lps { TRACE("Closing avi.\n"); /* installer of thebat! v1.62 requires FALSE here */ - return (infoPtr->hMMio != 0); + return FALSE; } if (!hInstance) diff --git a/dlls/comctl32/tests/animate.c b/dlls/comctl32/tests/animate.c index 0b9c99fc0b8..ea89a9b994b 100644 --- a/dlls/comctl32/tests/animate.c +++ b/dlls/comctl32/tests/animate.c @@ -152,7 +152,6 @@ static void test_play(void) ok(res != 0, "Play should have worked\n"); /* Test ACM_OPEN after playing an animation */ res = SendMessageA(hAnimateWnd, ACM_OPENA, 0, 0); - todo_wine ok(res == 0, "ACM_OPENA with a NULL lparam while playing should return 0\n"); destroy_animate(); @@ -161,7 +160,6 @@ static void test_play(void) res = SendMessageA(hAnimateWnd, ACM_OPENA, (WPARAM)shell32, MAKEINTRESOURCE(SEARCHING_AVI_INDEX)); ok(res != 0, "Load AVI resource failed\n"); res = SendMessageA(hAnimateWnd, ACM_OPENA, 0, 0); - todo_wine ok(res == 0, "ACM_OPENA with a NULL lparam should return 0\n"); destroy_animate(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10086
On Thu Feb 12 12:48:38 2026 +0000, Nikolay Sivov wrote:
Maybe we should reset hMMio in ANIMATE_Free? Good catch! We should do that as well. Otherwise, mmioClose() might be called with an already released hMMio. Since hMMio is NULL after ANIMATE_Free(), there is no need to check it when deciding what value to return when ACM_OPEN lparam is NULL.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10086#note_129522
This merge request was approved by Nikolay Sivov. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10086
participants (3)
-
Nikolay Sivov (@nsivov) -
Zhiyi Zhang -
Zhiyi Zhang (@zhiyi)