Fix DLL loading with LOAD_WITH_ALTERED_SEARCH_PATH, add missing flat API exports, and enable Release logging#6
Merged
Conversation
- Fix InitSteamClient: use filename instead of full path for concatenation, restore LOAD_WITH_ALTERED_SEARCH_PATH for dependency resolution - Add isteamgamesearch.h SDK header with full interface definition - Replace ISteamGameSearch empty stub with proper vtable implementation, point m_pSteamGameSearch to stub instance instead of nullptr - Add flat C API exports for ISteamGameSearch in api_flat.h - Hook ISteamApps::BIsSubscribedApp to always return true, fixes games with hardcoded AppID subscription checks (e.g. Godot games)
…arch class, add MinHook.h include
- Define ISteamMusicRemote class with all 32 virtual methods (stub) - Add CSteamMusicRemoteStub returning false for all methods - Export SteamAPI_ISteamClient_GetISteamMusicRemote in flat API - Add SteamMusicRemote() global accessor returning stub instance
UCOLOG and UCOColor were disabled in Release mode, making debugging impossible. Now logs will always write to %TEMP%\uc_online2.log
…team path resolution (same pattern as InitSteamClient)
…d upstream sync guide
…d for saves not in VDF manifest
…, DLL dir, exe dir)
…D folder, no hardcoded game names
…r SteamID folder, no hardcoded game names" This reverts commit d401c4b.
…ATA, cwd, DLL dir, exe dir)" This reverts commit 437a357.
…escription" This reverts commit 24a4637.
…leWrite/FileWriteAsync (Steam writes with epoch 0)
…xes timestamp 1970 issue)
…stamps on Roaming saves
…lid timestamps on Roaming saves" This reverts commit baeb382.
…alid timestamps on Roaming saves" This reverts commit 1068ed8.
…when Steam returns nothing
…lback description
…sion strings, stubs
f0fd710 to
69637b0
Compare
veeeanti
approved these changes
May 12, 2026
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.
English
This PR fixes critical issues with Steam DLL loading and adds missing flat API exports.
Bug 1: Missing
LOAD_WITH_ALTERED_SEARCH_PATHinInitSteamClient()(line 389, 396)LoadLibraryA(fullPath)was used without theLOAD_WITH_ALTERED_SEARCH_PATHflag. When Windows resolves dependencies ofsteamclient64.dll(tier0_s64.dll, vstdlib_s64.dll), it searches the game executable's directory instead of the Steam directory, causing load failures even whensteamclient64.dllitself is found.Fix: Use
LoadLibraryExAwithLOAD_WITH_ALTERED_SEARCH_PATH. Also improved core DLL loading inuc_loader.hwithPathFindFileNameA+LOAD_WITH_ALTERED_SEARCH_PATH.Bug 2:
LoadGameOverlay()uses hardcoded path and weak Steam path resolution (line 477)GetModuleHandleused a hardcoded path (C:\Program Files (x86)\Steam\GameOverlayRenderer64.dll) instead of checking by module name. This causes false negatives when Steam is installed in a non-default location.Fix: Applied the same pattern as the fixed
InitSteamClient():GetModuleHandleA(moduleName)instead of hardcoded pathSteamAPI_GetSteamInstallPath()cacheMissing flat API exports
uc-online2 was missing a number of flat API exports that some games and frameworks expect to find via P/Invoke. This PR adds the missing exports to improve compatibility:
ISteamMusicRemoteflat API exports (RegisterSteamMusicRemote, etc.)ISteamGameSearchflat API stubs (AcceptGame, DeclineGame, EndGame, etc.)ISteamFriends_SetPersonaNameandISteamFriends_GetUserRestrictionsg_pSteamClientGameServerexport (with correctS_APIdeclaration beforeglobals.hinclude)Other Fixes
UCOLOGwas guarded by#ifdef _DEBUG, making it completely silent in Release builds. Removed the guard.g_pSteamClientGameServerexport: MovedS_APIdeclaration beforeglobals.hinclude to avoid missing export.中文
本 PR 修复了 Steam DLL 加载的关键问题,并补全了缺失的 flat API 导出。
Bug 1:
InitSteamClient()缺少LOAD_WITH_ALTERED_SEARCH_PATH(第 389、396 行)LoadLibraryA(fullPath)没有使用LOAD_WITH_ALTERED_SEARCH_PATH标志。Windows 在解析steamclient64.dll的依赖项(tier0_s64.dll、vstdlib_s64.dll)时,会从游戏 exe 所在目录查找而不是 Steam 目录,导致即使找到了steamclient64.dll本身也会加载失败。修复:改用
LoadLibraryExA+LOAD_WITH_ALTERED_SEARCH_PATH。同时修复了uc_loader.h中 core DLL 的加载路径问题(PathFindFileNameA+LOAD_WITH_ALTERED_SEARCH_PATH)。Bug 2:
LoadGameOverlay()使用硬编码路径且 Steam 路径解析不健壮(第 477 行)GetModuleHandle使用硬编码路径(C:\Program Files (x86)\Steam\GameOverlayRenderer64.dll)而非模块名检查。当 Steam 安装在非默认位置时,会误判 overlay 已加载。修复:采用与修复后的
InitSteamClient()相同的模式:GetModuleHandleA(模块名)替代硬编码路径SteamAPI_GetSteamInstallPath()缓存补全缺失的 flat API 导出
uc-online2 缺失了部分 flat API 导出,某些游戏和框架会通过 P/Invoke 查找这些导出。本 PR 补全了这些导出以提升兼容性:
ISteamMusicRemoteflat API 导出(RegisterSteamMusicRemote 等)ISteamGameSearchflat API 存根(AcceptGame、DeclineGame、EndGame 等)ISteamFriends_SetPersonaName和ISteamFriends_GetUserRestrictionsg_pSteamClientGameServer导出(在globals.h之前用S_API正确声明)其他修复
UCOLOG被#ifdef _DEBUG包裹,Release 构建下完全无日志。已移除守卫。g_pSteamClientGameServer导出:将S_API声明移到globals.h引入之前,修复缺失导出问题。