简体   繁体   中英

Override WinSxS mechanism in UWP. Specifically for ComCtl32.dll

I am creating a Universal Windows App which uses a dynamic library (wkhtmltopdf) that seems to have a dependency on comctl32.dll through its Qt implementation. Now, I am able to run the application just fine on my development machine (Windows 10 Pro 1607 Build 14393.1770) however, on the target machine (Windows 10 Enterprise 2015 LTSB) I get the following error:

LdrpInitializeNode - ERROR: Init routine 67ABDD60 for DLL "C:\\Windows\\WinSxS\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c\\COMCTL32.dll" failed during DLL_PROCESS_ATTACH

When running the application I noticed my dev machine has different version of this library (5.82.14393.447). I understand comctl32.dll 6.0 is not redistributable but I haven't seen the same remark for 5.82. I still decided to package my version of the library and call LoadPackagedLibrary manually. This, on my dev machine ends up loading both version (as shown in the Visual Studio Modules window); on my target machine, it loads the "newer" version yet still tries to load the one on WinSxS and the failure still happens:

LdrpPreprocessDllName - INFO: DLL COMCTL32.dll was redirected to C:\\Windows\\WinSxS\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c\\COMCTL32.dll by SxS

It seems I simply do need to make WinSxS not load its version of ComCtl32.dll since, I hacked by replacing C:\\Windows\\WinSxS\\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.10240.16384_none_49c02355cf03478c\\COMCTL32.dll in the target machine with my version of the library. However, this is not desired.

Is there a way to redistribute the working version of ComCtl32.dll such that it won't try to load it from WinSxS? Perhaps through a manifest file or a running an MSI on the target machine?

Comctl32 is not supported at all for UWP. Even if you manage to get it to "work" it might break at any point in time - - if you run the Windows App Certification Kit (WACK) on your project it will give you errors.

I'm pretty sure Fusion (the thing that supports binding to different DLL versions) is disabled for UWP as well. Because apps are self-contained and don't install / share system libraries like legacy apps, binding redirection is not needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM