http://bugs.winehq.org/show_bug.cgi?id=36514
Bug ID: 36514 Summary: MCIWndCreate does not create a child window if parent is specified Product: Wine Version: 1.7.19 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: msvfw32 Assignee: wine-bugs@winehq.org Reporter: nicode@gmx.net
WS_CHILD is commented out in the default style for MCIWnd child windows (parent window specified). But it should be included.
At least one application (King's Quest: Mask of Eternity) depends on the documented API behavior.
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #1 from Austin English austinenglish@gmail.com --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine?
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #2 from Nico Bendlin nicode@gmx.net --- WS_CHILD is still not enforced (commented out) in MCIWndCreate.
https://bugs.winehq.org/show_bug.cgi?id=36514
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|MCIWndCreate does not |King's Quest: Mask of |create a child window if |Eternity requires |parent is specified |MCIWndCreate to create a | |child window when parent is | |specified
--- Comment #3 from Bruno Jesus 00cpxxx@gmail.com --- I believe that code is like that since it was created [1] and I don't expect Dmitry to remember why that was commented.
Maybe it is possible to create a test related to what the game attempts to do. Where is the documented API behavior you talk about?
Can you reproduce the bug with the demo game? http://www.fileplanet.com/11159/10000/fileinfo/King%27s-Quest:-Mask-of-Etern...
[1] http://source.winehq.org/git/wine.git/commitdiff/cd61ce85298b365382e783c736e...
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #4 from Nico Bendlin nico@nicode.net --- Two demos have been released: - Swamp Demo (MaskDemo, English, game version 1.0.0.0) - Daventry Demo (MaskCh1, English, game version 1.0.0.1) Only the latter includes the intro video.
Both demos can be downloaded from: http://www.sierrahelp.com/Misc/Demos.html#K Note that the Sierra Help Pages (SHP) setup install a modified game version 1.0.0.3 binary. You can use them if the original setup (16-bit installer) does not work.
MCI in Wine does not support playing AVIs with unregistered file extensions (the videos in KQMoE are named W32*_1.dll). For Wine you have to rename the file and replace "w32opn_1.dll" with "w32opn_1.avi" in the Mask.exe.
Another problem is the Indeo Video 5.0 codec that has been used for the original videos. You can download more compatible videos (Cinepak/MSADPCM) from: http://nicode.net/games/kqmoe/
The current documentation for MCIWndCreate can be found here: https://msdn.microsoft.com/en-us/library/dd757172%28v=vs.85%29.aspx It explicitly states that the default style includes WS_CHILD if a parent window is specified.
I created a runtime shim library that fixes several issues in KQMoE. Adding WS_CHILD for the MCIWndCreate call did not work in Wine. I had to change the window style and make the MCI window a child of the parent after the MCIWndCreate call to make the videos work in Wine.
Currently my spare time is very limited. It might take some time to retest it with my current Wine package (wine-development (1.7.52) on Debian "stretch", had no time to switch back to wine (1.8~rc1-1)).
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #5 from Nico Bendlin nico@nicode.net --- If you want to test what happens if the game explicitly specifies WS_CHILD in the MCIWndCreateA call without rebuilding Wine, you can replace the following byte sequence (valid for all known Mask.exe versions):
; ; old ; ; 8B 84 24 B8 00 00 00 mov eax, [esp+000000B8h] ; 8B 4C 24 10 mov ecx, [esp+10h] ; 8B 54 24 1C mov edx, [esp+1Ch] ; 50 push eax ; szFile ; 6A 02 push 02h ; dwStyle (MCIWNDF_NOPLAYBAR) ; 51 push ecx ; hInstance ; 52 push edx ; hwndParent ; E8 __ __ __ __ call MCIWndCreateA ; 8B 84 24 B8 00 00 00 8B 4C 24 10 8B 54 24 1C 50 6A 02 51 52 E8 ; ; new ; ; FF B4 24 B8 00 00 00 push dword ptr [esp+000000B8h] ; szFile ; 68 02 00 00 40 push 40000002h ; dwStyle (WS_CHILD | MCIWNDF_NOPLAYBAR) ; FF 74 24 18 push dword ptr [esp+18h] ; hInstance ; FF 74 24 28 push dword ptr [esp+28h] ; hwndParent ; E8 __ __ __ __ call MCIWndCreateA ; FF B4 24 B8 00 00 00 68 02 00 00 40 FF 74 24 18 FF 74 24 28 E8
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #6 from Nico Bendlin nico@nicode.net --- Created attachment 53031 --> https://bugs.winehq.org/attachment.cgi?id=53031 AV without WS_CHILD
Attached last 10000 line of: env WINEDEBUG=+tid,+seh,+relay,+ddraw,+mci wine Mask.exe >>MaskCh1.log 2>&1
- Original Daventry Demo (downloaded from SHP) - Wine 1.8~rc2-1 on Debian testing - "W32OPN_1.DLL" renamed to "W32OPN_1.AVI" - in Mask.exe "w32opn_1.dll" replaced with "w32opn_1.avi"
- main.kq made writable - in main.kq "aviPlayed=0" changed to "aviPlayed=1" (to avoid direct video playback on start)
- in Options.cs "assignGModeName Glide" changed to "assignGModeName Software" (Glide and D3D are often broken"
The AV does not happen if WS_CHILD is specified in the MCIWndCreateA call (see Comment #5).
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #7 from Nico Bendlin nico@nicode.net --- The proposed patch in Comment #5 breaks the compatibility with Windows (invisible MCI window):
; ; old (MCIWNDF_NOPLAYBAR) ; ; 8B 84 24 B8 00 00 00 mov eax, [esp+000000B8h] ; 8B 4C 24 10 mov ecx, [esp+10h] ; 8B 54 24 1C mov edx, [esp+1Ch] ; 50 push eax ; szFile ; 6A 02 push 02h ; dwStyle ; 51 push ecx ; hInstance ; 52 push edx ; hwndParent ; E8 __ __ __ __ call MCIWndCreateA ; 8B 84 24 B8 00 00 00 8B 4C 24 10 8B 54 24 1C 50 6A 02 51 52 E8 ; ; new (WS_VISIBLE | WS_CHILD | WS_BORDER | MCIWNDF_NOPLAYBAR) ; ; FF B4 24 B8 00 00 00 push dword ptr [esp+000000B8h] ; szFile ; 68 02 00 80 50 push 50800002h ; dwStyle ; FF 74 24 18 push dword ptr [esp+18h] ; hInstance ; FF 74 24 28 push dword ptr [esp+28h] ; hwndParent ; E8 __ __ __ __ call MCIWndCreateA ; FF B4 24 B8 00 00 00 68 02 00 80 50 FF 74 24 18 FF 74 24 28 E8
The original implementation of the API does not add WS_VISIBLE if any WS_* is specified:
HWND VFWAPIV MCIWndCreate(HWND hwndParent, HINSTANCE hInstance, DWORD dwStyle, LPCTSTR szFile) { int Y = 0; int X = 0; HMENU hMenu = NULL; if (!MCIWndRegisterClass()) return (NULL); if (NULL == hInstance) hInstance = GetModuleHandle(NULL); if (!HIWORD(dwStyle)) { /* only MCIWNDF_Xxx, no WS_Xxx */ if (hwndParent) dwStyle |= WS_VISIBLE | WS_CHILD | WS_BORDER; else dwStyle |= WS_VISIBLE | WS_OVERLAPPEDWINDOW; } dwStyle |= WS_CLIPSIBLINGS | WS_CLIPCHILDREN; if ((NULL == hwndParent) && !(WS_POPUP & dwStyle)) { X = CW_USEDEFAULT; if (WS_VISIBLE & dwStyle) Y = 5; } if (WS_CHILD & dwStyle) hMenu = (HMENU)66; /* child-window identifier */ return (CreateWindowEx(0, MCIWND_WINDOW_CLASS, TEXT(""), dwStyle, X, Y, 300, 0, hwndParent, hMenu, hInstance, szFile)); }
https://bugs.winehq.org/show_bug.cgi?id=36514
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #8 from joaopa jeremielapuree@yahoo.fr --- Bug still there in current wine Can an administrator put the working link at the URL place http://www.sierrahelp.com/Files/Demos/KQMoEDaventryDemoSetup.zip
https://bugs.winehq.org/show_bug.cgi?id=36514
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |http://www.sierrahelp.com/F | |iles/Demos/KQMoEDaventryDem | |oSetup.zip
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #9 from Nico Bendlin nico@nicode.net --- For preservation purposes I provide a download of the unpacked original demos here: http://kqmoe.nicode.net/demo/
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #10 from joaopa jeremielapuree@yahoo.fr --- Does the bug still occurs with wine-4.17?
https://bugs.winehq.org/show_bug.cgi?id=36514
Dan Fandrich dan@coneharvesters.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dan@coneharvesters.com
--- Comment #11 from Dan Fandrich dan@coneharvesters.com --- It still occurs with wine 4.0.3, at least.
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #12 from joaopa jeremielapuree@yahoo.fr --- Can you test with vanilla wine-5.11. Wine-4.0.3 is pretty old.
https://bugs.winehq.org/show_bug.cgi?id=36514
Anya animegirl@stronzi.org changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |animegirl@stronzi.org
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #13 from joaopa jeremielapuree@yahoo.fr --- Created attachment 67647 --> https://bugs.winehq.org/attachment.cgi?id=67647 Test for MciWndCreate
At least, the attached tests show that WS_CHILD is set when parent is non-zero. But test show that WS_OVERLAPPEDWINDOWS is also set in some conditions when parent is non-zero.
https://bugs.winehq.org/show_bug.cgi?id=36514
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #67647|0 |1 is obsolete| |
--- Comment #14 from joaopa jeremielapuree@yahoo.fr --- Created attachment 67660 --> https://bugs.winehq.org/attachment.cgi?id=67660 Test for MCIWndCreate
A binch of tests for MCIWndCreate
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #15 from joaopa jeremielapuree@yahoo.fr --- Created attachment 67661 --> https://bugs.winehq.org/attachment.cgi?id=67661 Patch for bug 36514
This patch fixes the issue for this bug. All the tests are OK.
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #16 from joaopa jeremielapuree@yahoo.fr --- In fact, I ca not even reach the point where the game call MciCreateWindow. The game crashes before for me. Surely previous commenters managed to workaround the first bugs to reach this point.
https://bugs.winehq.org/show_bug.cgi?id=36514
Nico Bendlin nico@nicode.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |nico@nicode.net
--- Comment #17 from Nico Bendlin nico@nicode.net --- Created attachment 68325 --> https://bugs.winehq.org/attachment.cgi?id=68325 shell script to setup a wine prefix with the second demo
https://bugs.winehq.org/show_bug.cgi?id=36514
--- Comment #18 from Nico Bendlin nico@nicode.net --- (In reply to joaopa from comment #16)
In fact, I ca not even reach the point where the game call MciCreateWindow. The game crashes before for me. Surely previous commenters managed to workaround the first bugs to reach this point.
see https://bugs.winehq.org/attachment.cgi?id=68325 for a demo setup the game needs some tweaks beyond the bug entry - disable video autoplay on first start in main.kq and use kq8fix to redirect DLL to AVI (don't know the current state, but back in the days the MCI implementation in wine required the files to end with .avi).
https://bugs.winehq.org/show_bug.cgi?id=36514
Sven Arvidsson sa@whiz.se changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sa@whiz.se
--- Comment #19 from Sven Arvidsson sa@whiz.se --- (In reply to joaopa from comment #16)
In fact, I ca not even reach the point where the game call MciCreateWindow. The game crashes before for me. Surely previous commenters managed to workaround the first bugs to reach this point.
Hi,
The patch seems to work for me with wine-6.5-275-gac65e154096 and the modified videos files, nice work!
I still have other issues (with or without the patch). In Direct3D mode the game crashes when the video stops playing. In Software mode there's no issues with the video, but the game instead crashes during loading.
https://bugs.winehq.org/show_bug.cgi?id=36514
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Status|UNCONFIRMED |NEW Ever confirmed|0 |1 URL|http://www.sierrahelp.com/F |https://web.archive.org/web |iles/Demos/KQMoEDaventryDem |/20170702223731/http://sier |oSetup.zip |rahelp.com/Files/Demos/KQMo | |EDaventryDemoSetup.zip
--- Comment #20 from Anastasius Focht focht@gmx.net --- Hello folks,
adding stable download link via Internet Archive.
https://web.archive.org/web/20170702223731/http://sierrahelp.com/Files/Demos...
$ sha1sum KQMoEDaventryDemoSetup.zip e88c2463ceb0c7f1e977cf2f65e86b9e43026e6e KQMoEDaventryDemoSetup.zip
$ du -sh KQMoEDaventryDemoSetup.zip 92M KQMoEDaventryDemoSetup.zip
Regards
https://bugs.winehq.org/show_bug.cgi?id=36514
soredake broaden_acid002@simplelogin.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|broaden_acid002@simplelogin | |.com |