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

Questions about Wine on Linux
User avatar
cschulst
Level 2
Level 2
Posts: 42
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 Aug 30, 2020 12:01 pm

Dear DarkShadow44,

I again did some testing of the "MUI" support enhancement after downloading the latest development version of Wine (5.16) to make sure that there were no knock-on effects within the latest version. I also reviewed one of my condition tests in the "LoadResource" function and determined there was some redundancy in the test. So, I simplified the test for calling the "get_mui" function. I then ran through all of the same unit test scenarios in the unit test document that I have attached to my Github project and the results were identical. I also launched and played all eight games that make up the Wineaero game set and they all functioned quite well. I have committed those changes to file "loader.c" in my Github project if you wish to review.

Regards,

Craig

User avatar
DarkShadow44
Level 8
Level 8
Posts: 1109
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 Aug 30, 2020 1:12 pm

Hi Craig,

do you also have automatic tests? If you want to, you can take a look at the Wine test suite included in wine source code on how to do that. That will probably be required for inclusion into wine.

Regards,
DarkShadow44

User avatar
cschulst
Level 2
Level 2
Posts: 42
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 » Mon Aug 31, 2020 12:54 pm

Dear DarkShadow44,

I viewed the Wine conformance testing link which discussed running an end-to-end test of the Wine application along with how to test a specific file. Strangely, the test for the "loader.c" file was in the "kernel32/tests" folder rather than in the "kernelbase/tests" so that confused me a bit. Anyway, I went to the "kernel32/tests" folder and ran the "make" command specifically for the "loader.c" file. I did not get the "loader.ok" file as there were failures. I've copied the verbiage below.

craig@Sandbox:~/Wine5/dlls/kernel32/tests$ make loader.ok
../../../wine-5.16/tools/runtest -q -P wine -T ../../.. -M kernel32.dll -p kernel32_test.exe.so loader && touch loader.ok
0478:fixme:module:LoadPackagedLibrary semi-stub, name L"kernel32.dll", reserved 0.
loader.c:3930: Test failed: ntdll.dll:0: wrong FileHeader.NumberOfSections 2 / 11
loader.c:3932: Test failed: ntdll.dll:0: wrong OptionalHeader.AddressOfEntryPoint 3b540 / 60280
loader.c:3941: Test failed: ntdll.dll:0: wrong OptionalHeader.DataDirectory.VirtualAddress 9511c / 75000
loader.c:3946: Test failed: ntdll.dll:0: wrong OptionalHeader.DataDirectory.Size 9de4 / 13416
loader.c:3941: Test failed: ntdll.dll:1: wrong OptionalHeader.DataDirectory.VirtualAddress 0 / 89000
loader.c:3946: Test failed: ntdll.dll:1: wrong OptionalHeader.DataDirectory.Size 0 / 14
loader.c:3941: Test failed: ntdll.dll:2: wrong OptionalHeader.DataDirectory.VirtualAddress 9ef1c / 8a000
loader.c:3941: Test failed: ntdll.dll:5: wrong OptionalHeader.DataDirectory.VirtualAddress 0 / 8b000
loader.c:3946: Test failed: ntdll.dll:5: wrong OptionalHeader.DataDirectory.Size 0 / 3b3c
loader.c:3952: Test failed: ntdll.dll: wrong section 0
loader.c:3952: Test failed: ntdll.dll: wrong section 1
Makefile:820: recipe for target 'loader.ok' failed
make: *** [loader.ok] Error 11
craig@Sandbox:~/Wine5/dlls/kernel32/tests$

To determine if this failure was a function of my code enhancement, I reverted back to the unmodified version of the "loader.c" program, reran the "make" command to rebuild/reset the Wine application back to an unmodified version, and then reran the above test. I got the same error verbiage. So, I am at a loss as how to provide a test report with my enhancements. This probably illustrates my low level of expertise with testing out Wine enhancements. Any feedback or suggestions would be great. Perhaps someone at Codeweavers needs to review my code and test this. I'm not sure what the next step is.

Regards,

Craig

User avatar
DarkShadow44
Level 8
Level 8
Posts: 1109
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 » Mon Aug 31, 2020 2:02 pm

Hello Craig,

Well, the important thing is, that you don't add new test errors. You'd probably have to write tests with exe/dll combinations that contain resources in a certain order, and check which one of them is loaded (if at all). Does that make sense? Basically, turn your documents into a test program.
Theoretically I could help there, but I don't have much time currently.

Regards,
DarkShadow44

User avatar
cschulst
Level 2
Level 2
Posts: 42
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 » Mon Aug 31, 2020 5:42 pm

Dear DarkShadow44,

I was able to determine what test was producing the "ntdll" errors. For some reason, the testers set a boolean flag argument differently for the "ntdll.dll" test differently than the other "dll" tests. I don't know why, but when I set the boolean flag to be the same as the other tests, the test passes and I get an "OK" file.
Loader_Test.jpg
Loader_Test.jpg

I do not know what the ramifications are of changing that flag setting as it pertains to the total test occurring for the loader program file, but I guess there is a reason that flag was set differently.

I did notice that the loader test function ran successfully, insofar as it creates temporary files with a set of "PE" sections and successfully tests the files. The sequence of events are the creation of a file with a name of "ldrnnnn.tmp" (where "nnnn" is just a sequential number) in the user's "Temp" folder, testing of the "PE" sections identifying if the tests were successful or not, and then removing the temporary file. To expand this test to check the "MUI" functionality I added, the loader test function would need to have additional code to temporarily create a language specific folder within the user's "Temp" folder, copy the temporary file to the language specific folder, rename the file by adding an ".mui" suffix to the file, and then test out the "get_mui" function enhancement. Following is an image of how that might look. The first image is how the test program currently works when a temporary file is added. The second image in the group displays the creation of the language specific folder, and the third image in the group displays the creation of the multi-language support file.
Create_PE_Mockup.jpg
You probably already know this but the main difference between a standard executable file being represented by the temporary file and a language specific resource file that would be represented by the temporary multi-language file is that the multi-language file would just have ".rsrc" sections and not a ".text" section. But for the purpose of testing, having a temporary file with a ".text" section should not matter.

Conceptually, I can see what would need to be done to expand the loader test, but actual coding is way beyond my skill level as a C coder. Perhaps my enhancement to file "loader.c" can be sent to someone at CodeWeavers for them to evaluate. That's just a thought. For me, I just apply the code change to the current development version of Wine and I am good to go for game playing. I just think others would benefit from this enhancement. Again, thank you for all your input.

Regards,

Craig
Attachments
Loader_OK.jpg

User avatar
cschulst
Level 2
Level 2
Posts: 42
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 Sep 27, 2020 7:09 pm

All,

Again, with a new release of Wine (5.18), I applied the MUI enhancement to the "loader.c" file and ran the enhancement through various tests. I found that there had been some changes to the memory mapping function (or up to this point, I had just been lucky) that allowed the MUI file to be located in a virtual memory location that was greater than the memory location of the executable file. Therefore, I included additional functionality in the "LoadResource" function to account for this scenario and keep the enhancement robust. After applying the additional test conditions, all of the various programs I tested worked correctly.

The latest revised version of the "loader.c" file has been placed up on my Github project if you wish to review and use. The link to that project is in an earlier post within this issue.

Regards,

Craig

User avatar
cschulst
Level 2
Level 2
Posts: 42
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 Oct 24, 2020 4:37 pm

All,

I have done a bit of rearrangement of the code enhancements to version 5.20 of program file loader.c so that other than the static variable field additions, all of the additional code and revised code resides within the same general vicinity in the source code file. I've again tested out the enhancements and language specific resources are acquired to make games like Mahjong Titans play properly. The latest version of the enhanced source code is out at my Github project. Enjoy!

Regards,

Craig

User avatar
cschulst
Level 2
Level 2
Posts: 42
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 » Fri Oct 30, 2020 10:44 am

Dear DarkShadow44,

FYI, with the various refinements I have made to this enhancement within the "loader.c" file, I decided to go ahead and submit the enhancements as a patch. I will see if the folks at Codeweavers feel the enhancement has merit. From what I have found in researching the web for information on how resources from an "mui" file are loaded via the Windows operating system, my enhancement mimics that function, only in a decoupled manner.

Regards,

Craig

nadeloehr
Level 1
Level 1
Posts: 5
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 Oct 31, 2020 2:54 pm

Hi Craig,

thank you! I got all the games I cared about to run with the code you provided! Hopefully they accept your patch.

User avatar
cschulst
Level 2
Level 2
Posts: 42
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 Nov 21, 2020 9:13 pm

All,

The source code changes have been applied to version 5.22 of the Wine application and tested. FYI, the patch I submitted at the beginning of the month is still in the queue. I am guessing that it is waiting on the assignment of a code reviewer. I will keep monitoring the progress through the patch process and hopefully the patch will be accepted.

Regards,

Craig

Post Reply