Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
prime

comctl32.dll load error

Recommended Posts

Hi there,

Compiling from git MESSUI repository....using recommended mame build environment on windows 10 X64

Compile of both messui and winui with "make PTR64=1 SUBTARGET=mess OSD=newui" and "make PTR64=1 SUBTARGET=mess OSD=messui" complete successfully and produce mame64.exe and mameui64.exe

However when I try to run mameui64.exe I get a popup box with "MESSUI64 has detected an old version of comctl32.dll. Unable to proceed"

Investigating with process monitor I find that it's trying to load the DLL from "C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.19041.488_none_4238de57f6b64d28\comctl32.dll"

Which is version 5.82 of the DLL, so strange that it's failing the test.

On further inversigation in mui_util.cpp, it seems to be failing the following test :

			FARPROC lpfnDLLI = GetProcAddress(hModule, "DllInstall");

			if (NULL != lpfnDLLI)
			{
				.....
			} 
			return PACKVERSION(4,7);

commenting out the if alows the test to pass and 5 82 is returned to the calling code in winui.cpp, however then it crahes with "Win32UI_init: Error creating main dialog, aborting"

So something's wrong :(

Cheers.

Phill.

 

Share this post


Link to post
Share on other sites

I can only support what I build. See the notice at https://messui.1emulation.com/

Quote

You can compile your own binary by accessing the listed github repository, and using the tools and options listed above. This is provided as a license requirement only. Compile issues are not supported. You're on your own.

You should tell your windows to use the comctl32.dll that is in c:\windows\system32. You might need to register the dll. On my system it says File version 5.82.18362.1139 and Product version 10.0.18362.1139

The things that are in winsxs are for system restores, and should not be accessible to the normal user.

 

Share this post


Link to post
Share on other sites

I think the crux of the matter is that the init code *ASSUMES* that if "DllInstall" is not exported by comctl32.dll that it is 4.7 or below, however reading the documetation for comctl32.dll it seems that DllInstall only exists for versions 4.71 to 5.81.

Versions higher than 5.82 don't have DllInstall, which means that the code in mui_util.cpp assumes it is 4.71 or below which is incorrect.

Also during investigation I found that InitCommonControls() is effectively nop, and needs to be replaced with calls to InitCommonControlsEx() Documented by MS : https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nf-commctrl-initcommoncontrols

Cheers.

Phill.

Share this post


Link to post
Share on other sites

The code already says InitCommonControlsEx. (mui_util.cpp, line 427, current git). I'm not sure about "DllInstall", but since it works for me it can't be an issue.

Do the following:

From the command line, do

>mameui64 > x

When it has started up (or in your case failed), exit back to the command line.

>type x | find "controlversion"

In my case it says

Win32UI_init: Common controlversion 6 16

what does it say for you?

 

Share this post


Link to post
Share on other sites
On 11/27/2020 at 12:31 PM, Robert said:

In my case it says

Win32UI_init: Common controlversion 6 16

what does it say for you?

 

$ ./messui64.exe
MAMEUI starting
Win32UI_init: About to init options
OptionsInit: About to load MESSUI.ini
OptionsInit: About to load MESS_g.ini
game_opts.h::load_file : Rebuilding cache
game_opts.h::load_file : Finished Rebuilding cache
OptionsInit: Finished
emuOptsInit: About to load ini\ui.ini
emuOptsInit: About to load Global Options
emuOptsInit: Finished
G:\EmulateDev\messui-2020-11-27\
Win32UI_init: Options loaded
Win32UI_init: Common controlversion 4 7

On my normal Windows 10 machine.

So 4.7, but as I said at the head of the post the comctl32.dll that is getting loaded is from the WinSXS (windows side by side, not for system restores apparently) folder, and is version 5.82 Product version 10.0.19041.488.

I also tried compiling on a Windows 7 machine just to iliminate the windows version.

That also says version 4.7 but this time loads from : C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18837_none_a4d981ff711297b6\comctl32.dll and again is version 5.82

My build environment is : latest mame deveolpment environment from the mame website on Windows 10 X64, it is the Enterprise version, and has the latest 20H2 update on it.

Oddly on both platforms if I do messui64 -v it runs though behaves like mess64.

Cheers.

Phill.

On 11/27/2020 at 12:31 PM, Robert said:

 

 

Share this post


Link to post
Share on other sites

I can only repeat that WinSXS should not be accessible to users. It's for system restores only, and for the TrustedInstaller.

If you add command-line arguments, it causes the command-line version to run, that is normal.

There's nothing more I can say, since I have not encountered this problem, and up till now, nobody else has either.

Share this post


Link to post
Share on other sites
16 hours ago, Robert said:

I can only repeat that WinSXS should not be accessible to users. It's for system restores only, and for the TrustedInstaller.

If you add command-line arguments, it causes the command-line version to run, that is normal.

There's nothing more I can say, since I have not encountered this problem, and up till now, nobody else has either.

You keep saying it's for system restores, that does not appear to be the case : https://en.wikipedia.org/wiki/Side-by-side_assembly

Well it worked for me on a version checked out  on nov 1st, and reports comctl version 6 16.

$ ./messui64.exe
MAMEUI starting
Win32UI_init: About to init options
OptionsInit: About to load MAMEUI.ini
OptionsInit: About to load ini\ui.ini
OptionsInit: About to load MAME_g.ini
OptionsInit: About to load Global Options
OptionsInit: Finished
Win32UI_init: Options loaded
Win32UI_init: Common controlversion 6 16

The next version checked out on 20th of Nov started exhibiting the above behavior.

So something changed in that time period that has borked it.

As for no one else experiencing this if they checked out before the latest changes the problem might not have shown up.

Can I ask what is your exact build environment? Windows version, etc?

Cheers.

Phill.

 

Share this post


Link to post
Share on other sites

Windows 10, 64 bit. It's a few months behind updates though. Not using 20H2 - I never use their bleeding-edge version, because of the bugs that they always seem to include. I'll most likely get the minimum of updates around end-of-year.

Share this post


Link to post
Share on other sites

Additional information :

Investiagting the working early Nov verses Non working Nov 20th, the windows manifest is different for the two versions the working version contains the lines :

		<dependentAssembly>
			<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" publicKeyToken="6595b64144ccf1df" language="*" processorArchitecture="*"/>
		</dependentAssembly>

Which is I guess why it is loading the correct comctl32.dll, the later non working exe does not contain these lines.

On investigation it appears that the manifest is not being included at build time, it was previously included from : src/osd/winui/mameui.rc putting the line to load it back in and rebuilding and when running it reports version 6 16 as for the working version but then bombs out saying "Win32UI_init: Error creating main dialog, aborting".

I also notice that "build\mingw-gcc\obj\x64\Release\mess.res" is 9K in the non working version 495K in the working version so I suspect that the resources are not being built correctly. It's possible that you have not seen the probleb because there are old versions of the file that are being linked and therefore everything works. Have you tried checking out from the repository and building from there (or doing a make clean)?

Cheers.

Phill.

 

Share this post


Link to post
Share on other sites

I'll have a look at that. Things were changed around in messui recently. However this particular change was not done with mameui or hbmame; are you able to build and run them?

 

Share this post


Link to post
Share on other sites
10 hours ago, Robert said:

I'll have a look at that. Things were changed around in messui recently. However this particular change was not done with mameui or hbmame; are you able to build and run them?

 

I'll checkout mameui and try that, and report back.

Cheers.

Phill.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...