Repository navigation
Runtime: use game-facing shims for GetProcAddress on host modules - #2750
ItsNotRexed merged 2 commits into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Code read of One concern:
AI-assisted review (Claude Code). |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
Tested Full On the base Cause: Run by hand from
So the dynamic
(Making AI-assisted (Claude Code). No game files. |
|
Built and ran this on Windows 11 (MSVC 14.51, RTX 4080 SUPER and Intel UHD 770). The dynamically resolved |
|
Tested 663c4d9 (on
So the shim path itself works. The test as wired fails on this setup: either the checker passes |
|
Tested Windows 11 Pro 26300, MSVC 19.44 (VS 2022 Build Tools), Ninja RelWithDebInfo via The failing line is
The host's This one-line change makes - COMMAND ${RUNNER} "${LOADER}" --run "${guest_name}" -- host-shim-probe
+ COMMAND ${RUNNER} "${LOADER}" --game-dir "${guest_dir}" --run "${guest_name}" -- host-shim-probe
Separately, |
|
Follow-up: #2957 fixes the empty |
|
Independent integration check on Windows 11 (26200), MSVC 19.44 x64 Release: applied the three runtime-file changes from |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…est_docs_cli_flags FORK.md: boot-prep is upstream main 3faac55 + ItsNotRexed#2861, ItsNotRexed#1895, fork/first-boot and gdk-offline-classes (ItsNotRexed#3476, after its merge of main). ItsNotRexed#2218, ItsNotRexed#2784, ItsNotRexed#2594, ItsNotRexed#2839, ItsNotRexed#2954, ItsNotRexed#2957, ItsNotRexed#2750, ItsNotRexed#2833 and our ItsNotRexed#3455 are upstream now; fork/first-boot and gdk-runtime-calls are gone, so the fork-only files are carried as a patch when boot-prep is rebuilt. gta6rt now seeds its VkPipelineCache from the pipeline_cache.bin beside it when the header matches the device. tests/test_docs_cli_flags.py failed on boot-prep only: FORK.md, merged from fork/first-boot, quotes git commands, and the test wants every --flag in a Markdown page to appear in a source file. git's flags join FOREIGN, next to gh's and pip's (fork-only line). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claiming: Before this fix,
runtime/shims/library_loader.cpp:170-207handled pseudo-handles and bundled modules but fell through to hostGetProcAddressat line 208 for real host-module handles, bypassing the registry used by static imports (runtime/src/pe_loader.cpp:1006). This makes dynamically resolved command-line and GAME: file APIs disagree with direct imports. No behavioral overlap with #2021 (bundled runtime loading), #2075 (mapped module identity/exports), #2490 (static import binding for shim-owned DLLs), or RT-107 (additional filesystem API coverage); the fix is exclusively the real host-module named-export fallback.Claimed in the coordination issue as: new item (claim above; no comment posted to #2716). The item ID can be added by the coordinator.
What and why
After the existing pseudo-handle and bundled-module branches, identify a real host module by its host-reported filename and consult the existing
rt::shims::findregistry using the normalized DLL basename and requested name. Return a registered shim before falling back to host GetProcAddress. There are no duplicated shim tables or kernel32-only special cases.Unshimmed names and ordinals retain host resolution, including NULL and ERROR_PROC_NOT_FOUND for missing symbols. Restore last error after the module-name probe so it does not contaminate lookup behavior. Pseudo-handle and bundled/mapped module handling is unchanged.
Extend the existing package-free tiny_gdk_load fixture and its CMake subprocess checker rather than adding a build target. Under
gta6rt --run -- host-shim-probe, test both kernel32 and kernelbase handles: dynamically resolved GetCommandLineA/W must match direct imports and contain the game argument; dynamically resolved CreateFileW must open a synthetic GAME: file and read its expected contents. An unshimmed GetCurrentProcessId and a nonexistent symbol exercise host fallback and failure behavior. Existing GDK pseudo-handle tests still run. The checker creates and removes only its own synthetic file. No game data is involved.Tested
Not compiled locally: Linux without MSVC, and cmake/ctest are not installed. Relies on the Windows runtime.yml workflow for compilation and the run_tiny_gdk_load regression test. Runtime execution remains unverified locally; no workflow was dispatched as part of this change. CPU-only, no GPU or driver involved. AI-assisted (Devin).
git diff --checkcompleted without output. Manually reviewed Windows API signatures, explicit standard-library includes, host fallback, and the final diff.Checklist
docs/design.md(n/a: no translator change).