[PATCH 0/7] MR675: mciqtz32 window command improvements
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/mciqtz32/mciqtz.c | 11 ++++++++--- dlls/winmm/tests/mci.c | 5 ++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c index ee130b078d5..abbbbc07547 100644 --- a/dlls/mciqtz32/mciqtz.c +++ b/dlls/mciqtz32/mciqtz.c @@ -211,9 +211,14 @@ static bool create_window(WINE_MCIQTZ *wma, DWORD flags, const MCI_DGV_OPEN_PARM IVideoWindow_put_Owner(wma->vidwin, (OAHWND)wma->window); IVideoWindow_put_WindowStyle(wma->vidwin, WS_CHILD); /* reset window style */ - GetClientRect(wma->window, &rc); - width = rc.right; - height = rc.bottom; + if (style & (WS_POPUP | WS_CHILD)) + IBasicVideo_GetVideoSize(wma->vidbasic, &width, &height); + else + { + GetClientRect(wma->window, &rc); + width = rc.right; + height = rc.bottom; + } IVideoWindow_SetWindowPosition(wma->vidwin, 0, 0, width, height); IVideoWindow_put_Visible(wma->vidwin, OATRUE); diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index a529b3080d2..ba810f6f096 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1603,9 +1603,8 @@ static void test_video_window(void) * in particular if the video width is less than SM_CXMIN. */ GetClientRect(video_window, &rc); - todo_wine_if (style & (WS_POPUP | WS_CHILD)) - ok(EqualRect(&parm.where.rc, &rc), "Got destination rect %s, expected %s.\n", - wine_dbgstr_rect(&parm.where.rc), wine_dbgstr_rect(&rc)); + ok(EqualRect(&parm.where.rc, &rc), "Got destination rect %s, expected %s.\n", + wine_dbgstr_rect(&parm.where.rc), wine_dbgstr_rect(&rc)); /* Test the default video window size. */ rc = src_rc; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/675
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/winmm/tests/mci.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index ba810f6f096..fc24bec26a0 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1424,6 +1424,9 @@ static void test_asyncWaveTypeMpegvideo(HWND hwnd) Sleep(200); test_notification(hwnd,"play",0); + err = mciSendStringA("window mysound state hide", NULL, 0, NULL); + todo_wine ok(err == MCIERR_NO_WINDOW, "mci window state returned %s\n", dbg_mcierr(err)); + err = mciSendStringA("close mysound wait", NULL, 0, NULL); ok(!err,"mci close wait returned %s\n", dbg_mcierr(err)); test_notification(hwnd,"play (aborted by close)",MCI_NOTIFY_ABORTED); @@ -1689,6 +1692,12 @@ static void test_video_window(void) ok(IsWindow(video_window), "Video window should exist.\n"); ok(!IsWindowVisible(video_window), "Video window should be hidden.\n"); + /* Test MCI_DGV_WINDOW_STATE for the non-default window. */ + parm.win.nCmdShow = SW_MINIMIZE; + err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_STATE, (DWORD_PTR)&parm); + ok(!err, "Got %s.\n", dbg_mcierr(err)); + todo_wine ok(IsIconic(main_window), "Video window should be minimized.\n"); + /* video window is reset to the default window, which is visible again */ parm.win.hWnd = NULL; err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_HWND, (DWORD_PTR)&parm); @@ -1698,9 +1707,15 @@ static void test_video_window(void) err = mciSendCommandW(id, MCI_WHERE, MCI_DGV_WHERE_DESTINATION, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); - ok(EqualRect(&parm.where.rc, &src_rc), "Got destination rect %s, expected %s.\n", + todo_wine ok(EqualRect(&parm.where.rc, &src_rc), "Got destination rect %s, expected %s.\n", wine_dbgstr_rect(&parm.where.rc), wine_dbgstr_rect(&src_rc)); + /* Test MCI_DGV_WINDOW_STATE for the default window. */ + parm.win.nCmdShow = SW_MINIMIZE; + err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_STATE, (DWORD_PTR)&parm); + ok(!err, "Got %s.\n", dbg_mcierr(err)); + todo_wine ok(IsIconic(video_window), "Video window should be minimized.\n"); + err = mciSendCommandW(id, MCI_CLOSE, 0, 0); ok(!err, "Got %s.\n", dbg_mcierr(err)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/675
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/mciqtz32/mciqtz.c | 4 +++- dlls/winmm/tests/mci.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c index abbbbc07547..2cc12c5b8ec 100644 --- a/dlls/mciqtz32/mciqtz.c +++ b/dlls/mciqtz32/mciqtz.c @@ -1022,8 +1022,10 @@ static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMS } } if (dwFlags & MCI_DGV_WINDOW_STATE) { + if (!wma->parent) + return MCIERR_NO_WINDOW; TRACE("Setting nCmdShow to %d\n", lpParms->nCmdShow); - IVideoWindow_put_WindowState(wma->vidwin, lpParms->nCmdShow); + ShowWindow(wma->parent, lpParms->nCmdShow); } if (dwFlags & MCI_DGV_WINDOW_TEXT) { TRACE("Setting caption to %s\n", debugstr_w(lpParms->lpstrText)); diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index fc24bec26a0..921e7ec800f 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1425,7 +1425,7 @@ static void test_asyncWaveTypeMpegvideo(HWND hwnd) test_notification(hwnd,"play",0); err = mciSendStringA("window mysound state hide", NULL, 0, NULL); - todo_wine ok(err == MCIERR_NO_WINDOW, "mci window state returned %s\n", dbg_mcierr(err)); + ok(err == MCIERR_NO_WINDOW, "mci window state returned %s\n", dbg_mcierr(err)); err = mciSendStringA("close mysound wait", NULL, 0, NULL); ok(!err,"mci close wait returned %s\n", dbg_mcierr(err)); @@ -1696,7 +1696,7 @@ static void test_video_window(void) parm.win.nCmdShow = SW_MINIMIZE; err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_STATE, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); - todo_wine ok(IsIconic(main_window), "Video window should be minimized.\n"); + ok(IsIconic(main_window), "Video window should be minimized.\n"); /* video window is reset to the default window, which is visible again */ parm.win.hWnd = NULL; @@ -1707,14 +1707,14 @@ static void test_video_window(void) err = mciSendCommandW(id, MCI_WHERE, MCI_DGV_WHERE_DESTINATION, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); - todo_wine ok(EqualRect(&parm.where.rc, &src_rc), "Got destination rect %s, expected %s.\n", + ok(EqualRect(&parm.where.rc, &src_rc), "Got destination rect %s, expected %s.\n", wine_dbgstr_rect(&parm.where.rc), wine_dbgstr_rect(&src_rc)); /* Test MCI_DGV_WINDOW_STATE for the default window. */ parm.win.nCmdShow = SW_MINIMIZE; err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_STATE, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); - todo_wine ok(IsIconic(video_window), "Video window should be minimized.\n"); + ok(IsIconic(video_window), "Video window should be minimized.\n"); err = mciSendCommandW(id, MCI_CLOSE, 0, 0); ok(!err, "Got %s.\n", dbg_mcierr(err)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/675
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 full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=121536 Your paranoid android. === w1064 (64 bit report) === winmm: 1c8c:mci: unhandled exception c0000005 at 00007FFEE45E5A9D
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/winmm/tests/mci.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index 921e7ec800f..b2f3c2c8d45 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1427,6 +1427,9 @@ static void test_asyncWaveTypeMpegvideo(HWND hwnd) err = mciSendStringA("window mysound state hide", NULL, 0, NULL); ok(err == MCIERR_NO_WINDOW, "mci window state returned %s\n", dbg_mcierr(err)); + err = mciSendStringA("window mysound text abracadabra", NULL, 0, NULL); + todo_wine ok(err == MCIERR_NO_WINDOW, "mci window text returned %s\n", dbg_mcierr(err)); + err = mciSendStringA("close mysound wait", NULL, 0, NULL); ok(!err,"mci close wait returned %s\n", dbg_mcierr(err)); test_notification(hwnd,"play (aborted by close)",MCI_NOTIFY_ABORTED); @@ -1494,6 +1497,7 @@ static void test_video_window(void) { const WCHAR *filename = load_resource(L"test.mpg"); MCI_PARMS_UNION parm; + WCHAR buffer[256]; unsigned int i; MCIDEVICEID id; MCIERROR err; @@ -1698,6 +1702,13 @@ static void test_video_window(void) ok(!err, "Got %s.\n", dbg_mcierr(err)); ok(IsIconic(main_window), "Video window should be minimized.\n"); + /* Test MCI_DGV_WINDOW_TEXT for the non-default window. */ + parm.win.lpstrText = (LPWSTR)L"foobar"; + err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_TEXT, (DWORD_PTR)&parm); + ok(!err, "Got %s.\n", dbg_mcierr(err)); + GetWindowTextW(main_window, buffer, ARRAY_SIZE(buffer)); + todo_wine ok(!wcscmp(buffer, parm.win.lpstrText), "Got %s, expected %s\n", wine_dbgstr_w(buffer), wine_dbgstr_w(parm.win.lpstrText)); + /* video window is reset to the default window, which is visible again */ parm.win.hWnd = NULL; err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_HWND, (DWORD_PTR)&parm); @@ -1716,6 +1727,13 @@ static void test_video_window(void) ok(!err, "Got %s.\n", dbg_mcierr(err)); ok(IsIconic(video_window), "Video window should be minimized.\n"); + /* Test MCI_DGV_WINDOW_TEXT for the default window. */ + parm.win.lpstrText = (LPWSTR)L"abracadabra"; + err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_TEXT, (DWORD_PTR)&parm); + ok(!err, "Got %s.\n", dbg_mcierr(err)); + GetWindowTextW(video_window, buffer, ARRAY_SIZE(buffer)); + todo_wine ok(!wcscmp(buffer, parm.win.lpstrText), "Got %s, expected %s\n", wine_dbgstr_w(buffer), wine_dbgstr_w(parm.win.lpstrText)); + err = mciSendCommandW(id, MCI_CLOSE, 0, 0); ok(!err, "Got %s.\n", dbg_mcierr(err)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/675
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/mciqtz32/mciqtz.c | 4 +++- dlls/winmm/tests/mci.c | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c index 2cc12c5b8ec..092b445fb02 100644 --- a/dlls/mciqtz32/mciqtz.c +++ b/dlls/mciqtz32/mciqtz.c @@ -1028,8 +1028,10 @@ static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMS ShowWindow(wma->parent, lpParms->nCmdShow); } if (dwFlags & MCI_DGV_WINDOW_TEXT) { + if (!wma->parent) + return MCIERR_NO_WINDOW; TRACE("Setting caption to %s\n", debugstr_w(lpParms->lpstrText)); - IVideoWindow_put_Caption(wma->vidwin, lpParms->lpstrText); + SetWindowTextW(wma->parent, lpParms->lpstrText); } return 0; } diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index b2f3c2c8d45..764b3b13d0e 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1428,7 +1428,7 @@ static void test_asyncWaveTypeMpegvideo(HWND hwnd) ok(err == MCIERR_NO_WINDOW, "mci window state returned %s\n", dbg_mcierr(err)); err = mciSendStringA("window mysound text abracadabra", NULL, 0, NULL); - todo_wine ok(err == MCIERR_NO_WINDOW, "mci window text returned %s\n", dbg_mcierr(err)); + ok(err == MCIERR_NO_WINDOW, "mci window text returned %s\n", dbg_mcierr(err)); err = mciSendStringA("close mysound wait", NULL, 0, NULL); ok(!err,"mci close wait returned %s\n", dbg_mcierr(err)); @@ -1707,7 +1707,7 @@ static void test_video_window(void) err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_TEXT, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); GetWindowTextW(main_window, buffer, ARRAY_SIZE(buffer)); - todo_wine ok(!wcscmp(buffer, parm.win.lpstrText), "Got %s, expected %s\n", wine_dbgstr_w(buffer), wine_dbgstr_w(parm.win.lpstrText)); + ok(!wcscmp(buffer, parm.win.lpstrText), "Got %s, expected %s\n", wine_dbgstr_w(buffer), wine_dbgstr_w(parm.win.lpstrText)); /* video window is reset to the default window, which is visible again */ parm.win.hWnd = NULL; @@ -1732,7 +1732,7 @@ static void test_video_window(void) err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_TEXT, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); GetWindowTextW(video_window, buffer, ARRAY_SIZE(buffer)); - todo_wine ok(!wcscmp(buffer, parm.win.lpstrText), "Got %s, expected %s\n", wine_dbgstr_w(buffer), wine_dbgstr_w(parm.win.lpstrText)); + ok(!wcscmp(buffer, parm.win.lpstrText), "Got %s, expected %s\n", wine_dbgstr_w(buffer), wine_dbgstr_w(parm.win.lpstrText)); err = mciSendCommandW(id, MCI_CLOSE, 0, 0); ok(!err, "Got %s.\n", dbg_mcierr(err)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/675
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/winmm/tests/mci.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index 764b3b13d0e..d2ab6731300 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1430,6 +1430,14 @@ static void test_asyncWaveTypeMpegvideo(HWND hwnd) err = mciSendStringA("window mysound text abracadabra", NULL, 0, NULL); ok(err == MCIERR_NO_WINDOW, "mci window text returned %s\n", dbg_mcierr(err)); + sprintf(buf, "window mysound handle %lu", PtrToUlong(GetDesktopWindow())); + err = mciSendStringA(buf, NULL, 0, NULL); + todo_wine ok(err == MCIERR_INTERNAL, "mci window handle (desktop) returned %s\n", dbg_mcierr(err)); + + sprintf(buf, "window mysound handle %lu", (unsigned long)0xdeadbeef); + err = mciSendStringA(buf, NULL, 0, NULL); + todo_wine ok(err == MCIERR_NO_WINDOW, "mci window handle (deadbeef) returned %s\n", dbg_mcierr(err)); + err = mciSendStringA("close mysound wait", NULL, 0, NULL); ok(!err,"mci close wait returned %s\n", dbg_mcierr(err)); test_notification(hwnd,"play (aborted by close)",MCI_NOTIFY_ABORTED); @@ -1649,6 +1657,10 @@ static void test_video_window(void) ok(IsWindowVisible(video_window), "Video window should be visible.\n"); /* Test MCI_DGV_WINDOW_HWND. */ + parm.win.hWnd = (HWND)0xdeadbeef; + err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_HWND, (DWORD_PTR)&parm); + todo_wine ok(err == MCIERR_NO_WINDOW, "Got %s.\n", dbg_mcierr(err)); + parm.win.hWnd = main_window; err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_HWND, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/675
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> --- dlls/mciqtz32/mciqtz.c | 9 +++++++-- dlls/winmm/tests/mci.c | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c index 092b445fb02..6fb9c2f43b4 100644 --- a/dlls/mciqtz32/mciqtz.c +++ b/dlls/mciqtz32/mciqtz.c @@ -1000,8 +1000,13 @@ static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMS if (dwFlags & MCI_TEST) return 0; - if (dwFlags & MCI_DGV_WINDOW_HWND && (IsWindow(lpParms->hWnd) || !lpParms->hWnd)) { - HWND hwnd = lpParms->hWnd ? lpParms->hWnd : wma->window; + if (dwFlags & MCI_DGV_WINDOW_HWND) { + HWND hwnd; + if (lpParms->hWnd && !IsWindow(lpParms->hWnd)) + return MCIERR_NO_WINDOW; + if (!wma->parent) + return MCIERR_INTERNAL; + hwnd = lpParms->hWnd ? lpParms->hWnd : wma->window; TRACE("Setting parent window to %p.\n", hwnd); if (wma->parent != hwnd) { diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index d2ab6731300..f6654912515 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1432,11 +1432,11 @@ static void test_asyncWaveTypeMpegvideo(HWND hwnd) sprintf(buf, "window mysound handle %lu", PtrToUlong(GetDesktopWindow())); err = mciSendStringA(buf, NULL, 0, NULL); - todo_wine ok(err == MCIERR_INTERNAL, "mci window handle (desktop) returned %s\n", dbg_mcierr(err)); + ok(err == MCIERR_INTERNAL, "mci window handle (desktop) returned %s\n", dbg_mcierr(err)); sprintf(buf, "window mysound handle %lu", (unsigned long)0xdeadbeef); err = mciSendStringA(buf, NULL, 0, NULL); - todo_wine ok(err == MCIERR_NO_WINDOW, "mci window handle (deadbeef) returned %s\n", dbg_mcierr(err)); + ok(err == MCIERR_NO_WINDOW, "mci window handle (deadbeef) returned %s\n", dbg_mcierr(err)); err = mciSendStringA("close mysound wait", NULL, 0, NULL); ok(!err,"mci close wait returned %s\n", dbg_mcierr(err)); @@ -1659,7 +1659,7 @@ static void test_video_window(void) /* Test MCI_DGV_WINDOW_HWND. */ parm.win.hWnd = (HWND)0xdeadbeef; err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_HWND, (DWORD_PTR)&parm); - todo_wine ok(err == MCIERR_NO_WINDOW, "Got %s.\n", dbg_mcierr(err)); + ok(err == MCIERR_NO_WINDOW, "Got %s.\n", dbg_mcierr(err)); parm.win.hWnd = main_window; err = mciSendCommandW(id, MCI_WINDOW, MCI_DGV_WINDOW_HWND, (DWORD_PTR)&parm); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/675
This merge request was approved by Zebediah Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/675
participants (4)
-
Akihiro Sagawa -
Akihiro Sagawa (@sgwaki) -
Marvin -
Zebediah Figura (@zfigura)