diff options
Diffstat (limited to 'runtime/src/pe_loader.cpp')
| -rw-r--r-- | runtime/src/pe_loader.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/src/pe_loader.cpp b/runtime/src/pe_loader.cpp index 387051756..c55520571 100644 --- a/runtime/src/pe_loader.cpp +++ b/runtime/src/pe_loader.cpp | |||
| @@ -709,10 +709,12 @@ void* Loader::resolve_forwarder(const std::string& spec, Binding& binding, int d | |||
| 709 | } | 709 | } |
| 710 | } | 710 | } |
| 711 | 711 | ||
| 712 | // shim_key, not the bare module name: forwarder strings usually leave out ".dll" ("MSVCP140.?foo"), and the host | ||
| 713 | // CRT copies are named with it, so a forwarded CRT symbol must skip the bundled Xbox build as a direct import does. | ||
| 712 | const std::filesystem::path candidates[] = {game_dir_ / module, game_dir_ / (module + ".dll")}; | 714 | const std::filesystem::path candidates[] = {game_dir_ / module, game_dir_ / (module + ".dll")}; |
| 713 | for (const auto& candidate : candidates) { | 715 | for (const auto& candidate : candidates) { |
| 714 | std::error_code ec; | 716 | std::error_code ec; |
| 715 | if (prefer_host_copy(lower(module)) || !std::filesystem::exists(candidate, ec)) continue; | 717 | if (prefer_host_copy(shim_key) || !std::filesystem::exists(candidate, ec)) continue; |
| 716 | Module& dep = load(candidate); | 718 | Module& dep = load(candidate); |
| 717 | if (auto it = dep.exports.find(symbol); it != dep.exports.end()) { | 719 | if (auto it = dep.exports.find(symbol); it != dep.exports.end()) { |
| 718 | binding = Binding::Module; | 720 | binding = Binding::Module; |