http://bugs.winehq.org/show_bug.cgi?id=58198
Bug ID: 58198 Summary: Wine missing WH_JOURNALPLAYBACK, required by VB SendKeys Product: Wine Version: 8.0 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: user16 Assignee: wine-bugs@winehq.org Reporter: jxvhulzowyrobfwwze@nbmbb.com Distribution: ---
Wine doesn’t implement WH_JOURNALPLAYBACK, which is required by the Visual Basic SendKeys function. This makes the game “Mordor: The Depths of Dejenol” unplayable after entering the dungeon.
I’ve confirmed with 32-bit Wine 8 and 16-bit VB3, but the logic seems unchanged in more recent Wine (and VB) versions. Microsoft eventually released a VB6 runtime that reimplemented SendKeys using SendInput instead of WH_JOURNALPLAYBACK, but that only fixes VB6 binaries.
https://archives.miloush.net/michkap/archive/2007/09/10/4850360.html
https://web.archive.org/web/20130615064311/http://blogs.msdn.com/b/michkap/a...
The story gets worse for programs that invoke DoEvents after SendKeys. Since DoEvents “first clears all pending keystrokes from the SendKeys function,” it enters an endless loop waiting for PeekMessage to return the expected WH_JOURNALPLAYBACK messages. CPU usage goes to 100%, and it’s easy to run out of stack space if DoEvents is invoked repeatedly.
https://nolongerset.com/how-doevents-works/
Thankfully, running with WINEDEBUG=warn emits a clear message, “SetWindowsHookEx16 hook type 1 broken in Win16” pointing us to https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/user.exe16/hook.c
This game is particularly creative, using SendKeys as some sort of input filter. Many keyboard and mouse inputs are apparently translated to SendKeys calls. I don’t fully understand the logic, except that the game is unplayable without it.
I can’t say whether it’s worth fixing this or not. At the very least, it’s helpful to know why this game doesn’t work, without having to keep trying each new Wine release.
The free demo of “Mordor: The Depths of Dejenol” can be downloaded from https://www.decklinsdemise.com/mordor.htm
http://bugs.winehq.org/show_bug.cgi?id=58198
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download URL| |https://www.decklinsdemise. | |com/mordor.htm
http://bugs.winehq.org/show_bug.cgi?id=58198
--- Comment #1 from Mark jxvhulzowyrobfwwze@nbmbb.com --- Partial workaround for this game: Open MORDOR.EXE in a hex editor, and look for “5D 53” which is the VB3 SendKeys opcode. There’ll be a “1F 49” (which seems to be a no-op) eight bytes earlier. Overwrite this section with “1F 49” over and over, like this:
Original: 1F 49 xx xx xx xx xx xx 5D 53 (35 49 …)
Fixed: 1F 49 1F 49 1F 49 1F 49 1F 49 (35 49 …)
That eliminates the SendKeys call (along with its arguments) and makes the game somewhat playable. The only downside is that you have to press every key twice. The game ignores every other keypress since it expects SendKeys to be duplicating everything.
So it’s not perfect, but it’s better than nothing!