Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Questions about Wine on Linux
Post Reply
nadeloehr
Newbie
Newbie
Posts: 3
Joined: Sat Aug 03, 2019 2:25 pm

Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by nadeloehr » Sun Mar 08, 2020 6:29 am

I am trying to get the old build in Windows 7 games to run on wine. Generally they are playable but some important functionality is missing.
I have created an entry for the Mahjong game in the AppDB: https://appdb.winehq.org/objectManager. ... &iId=38171
The biggest problem is the missing menu bar because you cannot access the options, statistics, undo. Keyboard shortcuts for Undo also do not work so maybe the problem is bigger than just the menu bar not displaying.
I have recently tested Mahjong again on wine-5.1-391-g7332de64a5, 64-bit with the same results (on ArchLinux).

Viewing the debug output with WINEDEBUG=+seh I get an exception (If I am interpreting it correctly) with code=400100006 (According to Debugging hints from OutputDebugString, which should be handled). But running with WINEDEBUG=+debugstr does not print anything new. Without WINEDEBUG set to anything I get at that point:

Code: Select all

003e:err:msvcrt:MSVCRT__invalid_parameter (null):0 (null): (null) 0
003e:err:msvcrt:MSVCRT__invalid_parameter (null):0 (null): (null) 0
Below I added the output from running Mahjong.exe with wine-5.1 without interacting with the program.

I hope somebody can give me some pointers where to look to fix this issue. Thanks in advance!

Code: Select all

002c:fixme:heap:RtlSetHeapInformation (nil) 1 (nil) 0 stub
002c:fixme:heap:RtlSetHeapInformation (nil) 1 (nil) 0 stub
002c:fixme:process:RegisterApplicationRestart (L"\"C:\\Program Files\\Microsoft Games\\Mahjong\\Mahjong.exe\"",0)
002c:fixme:process:RegisterApplicationRestart (L"\"C:\\Program Files\\Microsoft Games\\Mahjong\\Mahjong.exe\"",0)
002c:fixme:gameux:GameExplorerImpl_VerifyAccess (0000000000449C60, L"C:\\Program Files\\Microsoft Games\\Mahjong\\Mahjong.exe", 000000000022F330)
002c:fixme:gameux:GameExplorerImpl_VerifyAccess (0000000000449C60, L"C:\\Program Files\\Microsoft Games\\Mahjong\\Mahjong.exe", 000000000022F330)
002c:err:msvcrt:MSVCRT__invalid_parameter (null):0 (null): (null) 0
002c:err:msvcrt:MSVCRT__invalid_parameter (null):0 (null): (null) 0
002c:err:msvcrt:MSVCRT__invalid_parameter (null):0 (null): (null) 0
002c:err:msvcrt:MSVCRT__invalid_parameter (null):0 (null): (null) 0
002c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
002c:fixme:ntdll:NtQuerySystemInformation info_class SYSTEM_PERFORMANCE_INFORMATION
002c:fixme:wtsapi:WTSRegisterSessionNotification Stub 0000000000010054 0x00000000
002c:fixme:wtsapi:WTSRegisterSessionNotification Stub 0000000000010054 0x00000000
002c:fixme:gameux:GameStatisticsImpl_SetLastPlayedCategory stub
002c:fixme:gameux:GameStatisticsImpl_Save tracking changes not yet implemented
002c:fixme:gameux:GameStatisticsImpl_SetLastPlayedCategory stub
002c:fixme:gameux:GameStatisticsImpl_Save tracking changes not yet implemented
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (00000000014AEC80)->(00000000002FD270): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (00000000014AEC80)->(000000000022EE68): stub!
002d:fixme:d3d:state_linepattern_w Setting line patterns is not supported in OpenGL core contexts.
002d:fixme:d3d:state_linepattern_w Setting line patterns is not supported in OpenGL core contexts.
002c:fixme:wincodecs:JpegDecoder_Frame_CopyPalette (0x2068d98,0x15ec5a0): stub
002c:fixme:wincodecs:JpegDecoder_Frame_CopyPalette (0x2068d98,0x15ec5a0): stub
002c:fixme:wincodecs:JpegDecoder_Frame_CopyPalette (0x2068d98,0x14c5050): stub
002c:fixme:wincodecs:JpegDecoder_Frame_CopyPalette (0x2068d98,0x14c5050): stub
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001470B50)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001470B50)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001470B50)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001470B50)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001471A60)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001471A60)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001470B50)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001470B50)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001471A60)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001471A60)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001470B50)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001470B50)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001471A60)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001471A60)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001471A60)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001471A60)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001470B50)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001470B50)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001470B50)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001470B50)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001471A60)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001471A60)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001471A60)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001471A60)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001470B50)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001470B50)->(000000000022EE88): stub!
002c:fixme:wmvcore:WMSyncReader_OpenStream (0000000001470B50)->(00000000002FD2A0): stub!
002c:fixme:wmvcore:WMSyncReader_GetOutputCount (0000000001470B50)->(000000000022EE88): stub!
002c:fixme:gameux:GameStatisticsImpl_SetLastPlayedCategory stub
002c:fixme:gameux:GameStatisticsImpl_Save tracking changes not yet implemented
002c:fixme:gameux:GameStatisticsImpl_SetLastPlayedCategory stub
002c:fixme:gameux:GameStatisticsImpl_Save tracking changes not yet implemented
002c:fixme:ntdll:WinSqmIncrementDWORD (0, 6092, 0): stub
002c:fixme:wtsapi:WTSUnRegisterSessionNotification Stub 0000000000010054
002c:fixme:ntdll:WinSqmIncrementDWORD (0, 6092, 0): stub
002c:fixme:wtsapi:WTSUnRegisterSessionNotification Stub 0000000000010054

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Wed Apr 15, 2020 1:53 pm

All,

I have encountered the same issues with this game as well as Purble Pairs when launching the programs using Wine. In my testing, I have installed version 5.6 of Wine. The distro I am using for this test is Linux Mint 19.3 with the Cinnamon desktop. I did run the program with WINEDEBUG to capture the relay channel if that would be helpful. I just attempted to attach some screen images but they are evidently too large to send. If there is a drop-box or alternate location to which I can send the screen images and/or log please let me know.

As additional information, these programs utilize an ".mui" file stored in an "en-US" folder for multi-language support. Possibly, this is a clue as to the missing menu bar and missing text for dialog boxes.

Regards,

Craig

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Thu Apr 16, 2020 8:14 pm

All,

Since I had additional time today to try out some further testing with the ".mui" file, I placed a copy of the file in various locations within the wine "bottle" I created to see if any of these locations would add the missing menu bar and missing text on the dialog boxes. However, I had no success wherever I placed a copy of the file. So a simpler question would be "does the multi-language functionality work in wine version 5.6?" If it does, what registry entries and/or path entries need to be set up? Thanks in advance.

Regards,

Craig

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Sat Apr 18, 2020 2:31 pm

All,

In doing a bit more testing and acquiring a debug log of Mahjong Titans, I believe the extraneous text data appearing on the playing surface is coming from informational data stored within the Mahjong "dll" file. I've used the Qt Creator development tool which stores data like that in a resource file, but I don't think that information was intended to be retrieved and displayed. I've attached a couple of images to this message to elaborate. The "Mahjong_Titans.jpg" image is a snippet of the screen with the extraneous text overlaying the background and the "Mahjong_Log.jpg" image is a snippet of the debug log denoting the retrieval of the text.

Hopefully, this provides some further information as to the symptom with the extraneous text. Let me know if you want the entire log file.

Regards,

Craig
Attachments
Mahjong_Log.jpg
Mahjong_Titans.jpg

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Sun Apr 19, 2020 11:16 am

All,

With some further debugging, I noticed getting some path issues with locating "dll" files which made me wonder if the installation steps for installing the wine-devel package are placing objects in an incorrect folder structure of if a path definition is incorrect or if this is just a red herring. In my debug log, I am getting messages such as follows:

000b:warn:ntdll:FILE_CreateFile L"\\??\\Z:\\opt\\wine-devel\\bin\\..\\lib\\wine\\kernel32.dll" not found (c0000034)
000b:warn:ntdll:FILE_CreateFile L"\\??\\C:\\windows\\system32\\wineboot.exe.manifest" not found (c0000034)
000b:warn:ntdll:FILE_CreateFile L"\\??\\Z:\\opt\\wine-devel\\bin\\..\\lib\\wine\\advapi32.dll" not found (c0000034)
000b:warn:ntdll:FILE_CreateFile L"\\??\\Z:\\opt\\wine-devel\\bin\\..\\lib\\wine\\ucrtbase.dll" not found (c0000034)
000b:warn:ntdll:FILE_CreateFile L"\\??\\C:\\windows\\system32\\c_28604.nls" not found (c0000034)
000b:warn:ntdll:FILE_CreateFile L"\\??\\Z:\\opt\\wine-devel\\bin\\..\\share\\wine\\nls\\c_28604.nls" not found (c0000034)

When I scanned my drive for the location of the "kernel32.dll" file, this is what if find.

./opt/wine-devel/lib64/wine/fakedlls/kernel32.dll
./opt/wine-devel/lib/wine/fakedlls/kernel32.dll
./home/craig/Wine/FujiGolf/drive_c/windows/system32/kernel32.dll
./home/craig/Wine/Oberon/drive_c/windows/system32/kernel32.dll
./home/craig/Wine/Pinball/drive_c/windows/system32/kernel32.dll
./home/craig/Wine/Memory/drive_c/windows/system32/kernel32.dll
./home/craig/Wine/Comet/drive_c/windows/system32/kernel32.dll
./home/craig/.wine/drive_c/windows/system32/kernel32.dll
./home/craig/.wine/drive_c/windows/syswow64/kernel32.dll

The "./home/craig/Wine/..." folders are my wine bottles.

My guess or hope is that when the "dll" file is not initially found, the process is locating the "dll" file in the wine bottle and then executing properly. But I wanted to at least point out what appears to be a disconnect with the definition of the initial search path for the "dll" files. I hope that information helps.

Regards,

Craig

User avatar
DarkShadow44
Level 8
Level 8
Posts: 1057
Joined: Tue Nov 22, 2016 5:39 pm

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by DarkShadow44 » Sun Apr 19, 2020 12:37 pm

Probably bug https://bugs.winehq.org/show_bug.cgi?id=43670, wine doesn't have a MUI implementation.

However, for both Solitaire and SpiderSolitaire I get a strange messagebox trying to run it...
I took Solitaire from a 32bit win7 VM and tried to run it.

Which version did you use and did you take any dependencies, use native overrides etc? Because for me, in a clean WINEPREFIX, I don't even get as far as you get.

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Wed May 06, 2020 11:22 am

Hello DarkShadow44,

I reviewed your reply regarding lack of MUI support. That probably is the main contributor to the reason no menu bar information is being displayed. So, until MUI support is added, there probably will be no menu bar or other widgets displayed. Regarding your comment on receiving a strange message box when testing solitaire and spider solitaire, I do not encounter that issue for those two games. I do get a strange message box for when attempting the launch the chess game. The information displayed is mostly gibberish.

As far as my environment setup, my WINEPREFIX is set up as a "win32" environment, using winetricks I have installed the core fonts and the "tahoma" font, I have installed the "d3dx9" "dll", and using "winecfg" I installed the "Vistaluna Basic" theme. I hope that information helps.

Regards,

Craig

User avatar
DarkShadow44
Level 8
Level 8
Posts: 1057
Joined: Tue Nov 22, 2016 5:39 pm

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by DarkShadow44 » Wed May 06, 2020 12:13 pm

Interesting, maybe it's partially random... Thanks for the feedback, anyways.

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Thu May 07, 2020 4:36 pm

Hello DarkShadow44,

I examined the hack that was referenced in you earlier message where the code was changed in function "LoadMenuW" by the tester to force a resource association to an "mui" file if the resource is not found in the current executable file. Using that information, I scanned through the trace log I had from a previous debug session for the "LoadMenuW" call. The instance value appears to assume that it should just look in the current "exe" file as I am interpreting that the value of "00000000" in the "GetModuleHandleW" call immediately before the "LoadMenuW" call is referencing the current program object. I've pasted in the noted lines from my log.

0009:Call KERNEL32.GetModuleHandleW(00000000) ret=0103965a
0009:Ret KERNEL32.GetModuleHandleW() retval=01000000 ret=0103965a
0009:Call user32.LoadMenuW(01000000,00000077) ret=01039661
0009:Ret user32.LoadMenuW() retval=00000000 ret=01039661

So this does seem to confirm that currently there is no "mui" functionality which would look to an associated language specific file for menu information. Just something to add as information if and when "mui" functionality is added. Again, thanks for your input.

Regards,

Craig

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Tue May 12, 2020 6:07 pm

To DarkShadow44 and nadeloehr,

I had a chance to build a virtual machine and make it a sandbox, download the source for wine 5.7, and get it compiled. With that done and installed, I was able to poke around the various source code files for the code that builds the menus, dialog boxes, and strings to see if I could experiment with the MUI file reference as you referenced in that program hack. Adding in some code references for the MUI file, I was able to get the menu bar to appear along with the string values when I launched the Mahjong game. I've attached a jpeg file denoting the menu existence. So now functions such as undo and hints work.

The only thing I could not seem to zero in on was what dll or module was "writing" the extraneous text on the background and within some of the dialog boxes. I couldn't be certain, but the issue seemed to trace back to the commctl32.dll object. I've attached an example of the extra text within a dialog box. That doesn't deter from the functionality of the game though so that is not as big of a deal.

When I looked at the source code for "commctl32.dll", I noted that the developer appears to have MUI support on his list as a future task, so that would be great. The various widgets should appear properly once that is done.

As one last item, when I was experimenting with the game I noticed that there was no sound. To be brief, I found out the program utilizes "wma" files for sound. So, I used winetricks to install Windows Media Player bits and then I was able to get sound. You may want to try that if you wish to experiment some more.

Regards,

Craig
Attachments
Mahjong_Dialog.jpg
Mahjong_Dialog.jpg (12.44 KiB) Viewed 422 times
Mahjong_Menu.jpg
Mahjong_Menu.jpg (10.57 KiB) Viewed 422 times

nadeloehr
Newbie
Newbie
Posts: 3
Joined: Sat Aug 03, 2019 2:25 pm

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by nadeloehr » Sat May 16, 2020 12:17 pm

So I downloaded the latest wine version (commit 893080e4df5a45929320ebb88b8668eea316476c) and applied the patch described at https://bugs.winehq.org/attachment.cgi? ... ction=diff by hand. I also exchanged the "LoadLibraryA" parameter to "Mahjong.exe.mui". After recompiling wine, moving the file "Mahjong.exe.mui" from the en-US to the main directory and running Mahjong I also got a menu bar!
I also downloaded the UIRibbon.dll file somewhere and moved it to system32, but that had no discernible effect for me.

Thanks DarkShadow44 and cschulst!

But for me only the menu items Undo, Hint and New Game work. Statistics and Options do nothing.
To cschulst,
did you do anymore than the changes described in the patch linked above?
I would love to also get the Statistics window to show, at least.

After I installed Windows Media Player 11 I didn't get the "wmvcore" errors anymore for sounds in the terminal but I still couldn't here anything. Although that might be a problem with my wine configuration, at least I haven't checked that yet.

To DarkShadow44,
I downloaded the games from this website:https://winaero.com/request.php?1836. Those work with wine, even Solitaire and SpiderSolitaire, without strange messageboxes.
The 32bit version of Mahjong from a Windows 7 iso worked for me, but launching Solitaire/SpiderSolitaire I also get that messagebox.
I think these games required some binary editing to run on Windows 10, maybe that's fixed in the versions on winaero.

Hope that helps.

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Sat May 16, 2020 10:07 pm

To nadeloehr,

Besides forcing a reference to the MUI file in the menu.c program, you would also need to apply that override to the the dialog.c file and the resource.c file. These all reside in the user32 dll folder. For the dialog.c file, you would need to add the MUI reference into the CreateDialogParamW function and the DialogBoxParamW function. For the resource.c file, the additional coding would need to be added to the LoadAcceleratorsW function and the LoadStringW function. That should get you a pretty functional game. As I noted in some earlier posts, I cannot seem to find how the extraneous text displays on the initial screen, but it doesn't seem to detract from the game function once you bring up a game board. My best guess is that the program itself is directly calling some of the resource fetches rather than calling a "Load String" function. So, as I noted, we probably will just have to wait until MUI support is added.

Enjoy!

Regards,

Craig

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Tue May 19, 2020 12:07 pm

DarkShadow44 and nadeloehr,

FYI, I did some embellishing of the code for dialog.c, menu.c, and resource.c to soft code the retrieval of the "mui" file based upon some conventions I have observed with where the "mui" files are stored in relation to the executable file. Basically, I use a function to retrieve the module name for the executable, retrieve the language environment which provides me with a string value I can use to construct the proper folder/directory name (e.g. "en-US"), and then attempt to acquire a resource handle to the "mui" file. With that, I was able to make the other game programs that come with installing Mahjong work as well as noted in the attached image.

I can't seem to attach a copy of the source code files, so I've copied in a snippet of the code I added to the menu.c program to provide generic and rudimentary "mui" support.

/* The following code was added to provide rudimentary MUI functionality */

/* Construct the MUI file name for reference */

HRSRC hrsrc = NULL;
HINSTANCE mui = NULL;
HINSTANCE muix = NULL;
char szFilePathName[MAX_PATH];
char *szModuleName;
char szProgramName[20];
char muiName[20];
char muiLanguage[6];
char smallLanguage[3];
char bigLanguage[3];

memset(szProgramName, '\0', sizeof(szProgramName));
GetModuleFileNameA(NULL, szFilePathName, MAX_PATH);
szModuleName = strrchr(szFilePathName, 92);
strcpy(szProgramName, szModuleName+1);
strcpy(muiLanguage, getenv("LANGUAGE"));
lstrcpynA(smallLanguage, muiLanguage,3);
lstrcpynA(bigLanguage, muiLanguage+3,3);
strcpy(muiName, smallLanguage);
strcat(muiName, "-");
strcat(muiName, bigLanguage);
strcat(muiName, "/");
strcat(muiName, szProgramName);
strcat(muiName, ".mui");

/* Try to find a resource first in the MUI file and then fall back to the executable if no resource found */

muix = instance; /* Save a copy of the instance value in case we need to fall back */
mui = LoadLibraryA(muiName);

/* The original statement to find the resource is commented out and replaced by the statements in the "if" blocks */

/* HRSRC hrsrc = FindResourceW( instance, name, (LPWSTR)RT_MENU ); */
/* if (!hrsrc) return 0; */

if (mui) {

instance = mui;
hrsrc = FindResourceW( instance, name, (LPWSTR)RT_MENU );

if (!hrsrc) {
instance = muix;
hrsrc = FindResourceW( instance, name, (LPWSTR)RT_MENU );
if (!hrsrc) return 0;
}

} /* MUI was found */

if (!mui) {
hrsrc = FindResourceW( instance, name, (LPWSTR)RT_MENU );
if (!hrsrc) return 0;
} /* No MUI was found */

/* End of MUI functionality addition */

This code change was for the "LoadMenuW" function. You would also want to replicate similar code changes for the following source code and functions:

dialog.c

CreateDialogParamW

resource.c

LoadAcceleratorsW
LoadStringW

Also, for source code file, resource.c, I needed to add in #include <stdlib.h> for the string functions to work.

As I noted before, "enjoy"!

Regards,

Craig
Attachments
Games.jpg

qwertymnb
Level 4
Level 4
Posts: 128
Joined: Sun Jan 17, 2016 4:36 pm
Location: Eindhoven de gekste!

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by qwertymnb » Wed May 20, 2020 4:58 pm

Hi,
With that, I was able to make the other game programs that come with installing Mahjong work as well as noted in the attached image.
Cool!!! Nice job!

Could you make a diff file/patch of your changes to current wine source? And post/attach it here? I`d like to try it too, for another program that (I believe) suffers from same issue

Regards

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Thu May 21, 2020 4:49 pm

Dear qwertymnb,

FYI, I just used Gedit to enter my code changes and use the "make" command to rebuild the "user.dll" library, so I've used Notepad++ to do the code comparison. I grabbed images of the code and have attached them to this post. The first three images for the "dialog.c" seemed to attach just fine, but I am not sure if the images for the "menu.c" file and "resource.c" file attached. I may need to attach in a separate email but you can check. Anyway, some of the images for "menu.c" and "resource.c" might overlap a bit so pay attention to the statement numbers. I hope that gives you all of the information that you need.

Regards,

Craig
Attachments
Dialog_3.jpg
Dialog_2.jpg
Dialog_1.jpg

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Thu May 21, 2020 4:52 pm

Dear qwertymnb,

It looks like the images for "menu.c" and "resource.c" did not attach so I am attaching them in separate posts. Here are the images for "menu.c".

Regards,

Craig
Attachments
Menu_2.jpg
Menu_1.jpg

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Thu May 21, 2020 4:54 pm

Dear qwertymnb,

Here are the first three images for the "resource.c" file. This file had the most enhancements.

Regards,

Craig
Attachments
Resource_3.jpg
Resource_2.jpg
Resource_1.jpg

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Thu May 21, 2020 5:10 pm

Dear qwertymnb,

Finally, here are the other two images for the enhancements to file "resource.c". That should cover all of the code enhancements for the rudimentary MUI support.

FYI, once you have made the code changes and play those games, you will note that on some windows and dialog boxes that there are extra text and symbols. From what I could find out by adding some "WINE_FIXME" output into the various files to perform some "low tech" debugging, some of the game programs make a direct call to the "FindResourceExW" function to acquire a handle to the resource instead of using the "LoadStringW" function which is one of the functions where I added the MUI enhancements. So those parts of the game programs do not benefit from the MUI enhancements I've added. If you try out the various games you will see which games used the direct function calls instead of using "LoadStringW". For example, the game coders for the chess game exclusively used the "LoadStringW" function in lieu of the direct calls to "FindResourceExW" function and it shows in the cleaner appearance of the text. However, I did not find that this negatively affected the game performance or experience for any of the games. Also, if you do install the Windows Media Player via "winetricks" so that you have sound effects, version 9 appeared to work the best with these games.

Have fun.

Regards,

Craig
Attachments
Resource_5.jpg
Resource_4.jpg

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Thu May 21, 2020 5:12 pm

Dear qwertymnb,

Just one last thing. I was reviewing the posts I sent and I saw that I misnamed the "dll" file reference. It should reference "user32.dll" and not "user.dll".

Regards,

Craig

nadeloehr
Newbie
Newbie
Posts: 3
Joined: Sat Aug 03, 2019 2:25 pm

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by nadeloehr » Mon May 25, 2020 3:33 am

I have copied all the screenshots and created a patch with $ git format patch -1 HEAD.
Here is a link: https://pastebin.com/PRcV0Jx3
I created this on git commit 056c9df854817670dc4fb9c095cba29c99089ac8.

FYI, this will crash if your LANGUAGE environment variable is not set. I don't know why it wasn't on my system but after $ export LANGUAGE="de-DE" the Mahjong game worked for me.

Regards,

nadeloehr

User avatar
cschulst
Level 2
Level 2
Posts: 15
Joined: Wed Apr 15, 2020 1:23 pm
Location: United States

Re: Windows 7 Games (Mahjong, Minesweeper, Spider Solitaire, etc.) do not display menu bar (File, Edit, View)

Post by cschulst » Tue May 26, 2020 1:53 pm

Dear nadeloehr,

I took a quick look at the code noted on the pastebin link. Looks good. Thank you for setting that up.

Dear DarkShadow44,

Since I see that you are quite a high-level participant, perhaps you might want to post some type of link on the forum to alert folks of this work-around for MUI functionality. I'm sure there are others that have issues with MUI functionality and possibly this will provide them a temporary method to get by until MUI functionality is formally added to Wine. FYI, since version 5.9 of Wine has been rolled out, I built a new sandbox and applied the code changes to the "dialog.c" file, the "menu.c" file, and the "resource.c" file to that version to ensure that the rudimentary MUI functionality changes did not create any regressions and it appears that they did not.

Regards,

Craig

Post Reply