[PATCH 0/1] MR9657: msvfw32: Retry with avivideo device type if open fails.
King's Quest: Mask of Eternity (demo) has an AVI file named "w32opn_1.dll" and tries to open it with MCIWndCreate(). Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36514 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9657
From: Akihiro Sagawa <sagawa.aki(a)gmail.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36514 --- dlls/msvfw32/mciwnd.c | 11 +++++++++++ dlls/msvfw32/tests/mciwnd.c | 2 -- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/msvfw32/mciwnd.c b/dlls/msvfw32/mciwnd.c index 227dd0ebed6..5ab9b698e13 100644 --- a/dlls/msvfw32/mciwnd.c +++ b/dlls/msvfw32/mciwnd.c @@ -559,6 +559,7 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lPa static const WCHAR formatW[] = {'%','d',0}; static const WCHAR mci32W[] = {'m','c','i','3','2',0}; static const WCHAR system_iniW[] = {'s','y','s','t','e','m','.','i','n','i',0}; + static const WCHAR avivideoW[] = {'a','v','i','v','i','d','e','o',0}; TRACE("MCIWNDM_OPENW %s\n", debugstr_w((LPWSTR)lParam)); @@ -583,6 +584,16 @@ static LRESULT WINAPI MCIWndProc(HWND hWnd, UINT wMsg, WPARAM wParam, LPARAM lPa mwi->lasterror = mciSendCommandW(mwi->mci, MCI_OPEN, MCI_OPEN_ELEMENT | MCI_OPEN_ALIAS | MCI_WAIT, (DWORD_PTR)&mci_open); + + if (mwi->lasterror) + { + mci_open.lpstrDeviceType = avivideoW; + mwi->lasterror = mciSendCommandW(mwi->mci, MCI_OPEN, + MCI_OPEN_ELEMENT | MCI_OPEN_TYPE | + MCI_OPEN_ALIAS | MCI_WAIT, + (DWORD_PTR)&mci_open); + } + SetCursor(hCursor); if (mwi->lasterror && !(mwi->dwStyle & MCIWNDF_NOERRORDLG)) diff --git a/dlls/msvfw32/tests/mciwnd.c b/dlls/msvfw32/tests/mciwnd.c index 1d9a2204f65..6599fd4be85 100644 --- a/dlls/msvfw32/tests/mciwnd.c +++ b/dlls/msvfw32/tests/mciwnd.c @@ -139,8 +139,6 @@ static BOOL create_avi_file(char *fname) return FALSE; DeleteFileA(fname); - lstrcatA(fname, ".avi"); - hFile = CreateFileA(fname, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); ok(hFile != INVALID_HANDLE_VALUE, "Failed to create a file, err %ld\n", GetLastError()); if (hFile == INVALID_HANDLE_VALUE) return FALSE; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9657
participants (2)
-
Akihiro Sagawa -
Akihiro Sagawa (@sgwaki)