Skip to content

launcher: pre-bind System32 dwmapi.dll to avoid shadowing by extra DLL directories - #12

Merged
absol89 merged 1 commit into
absol89:masterfrom
mailamea10:fix/preload-system-dwmapi
Oct 11, 2026
Merged

absol89 merged 1 commit into
absol89:masterfrom
mailamea10:fix/preload-system-dwmapi

Conversation

@mailamea10

@mailamea10 mailamea10 commented Oct 11, 2026 •

Copy link
Copy Markdown

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

@absol89
absol89 merged commit e72c022 into absol89:master Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants