Repository navigation
launcher: pre-bind System32 dwmapi.dll to avoid shadowing by extra DLL directories - #12
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes SKSE plugins that import dwmapi.dll (e.g. SKSE Menu Framework 3.14 & 3.18) - also nexus version of Immersive First Person Camera
failing to load under SkyrimTogether.exe with error 193 when a non-system
dwmapi.dll exists in the Steam folder.
Root cause: loader/PathRerouting.cpp:15 calls SetDefaultDllDirectories(
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS | LOAD_LIBRARY_SEARCH_USER_DIRS) and
steam/SteamLoader.cpp:33 adds the Steam folder with AddDllDirectory, so
user-added directories are searched before System32. A proxy dwmapi.dll in
the Steam folder then shadows the real one for every SKSE plugin.
Change: new header SystemDllPreload.h, called first in StartUp(), pre-binds
the System32 dwmapi.dll. Windows reuses an already-loaded module for
same-name imports, so later plugin imports resolve to it. Proxies that mods
rely on (d3d11, dxgi, d3d9, dinput8, version) are deliberately untouched.
Status: not yet built or tested. Test plan: restore the proxy
dwmapi.dll in the Steam folder, launch via SkyrimTogether.exe, and confirm
skse64.log shows SKSEMenuFramework.dll "loaded correctly".
(tested with STR 1.8.5, able to access all skse menu framework functions and settings via f1)
Relates to tiltedphoques#922
tiltedphoques#922