upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/shims/gameinput.cpp
diff options
context:
space:
mode:
authorGustavo Kissel <kisselgustavo@gmail.com>2026-11-23 13:13:19 -0300
committerMumogg <104529023+Mumogg@users.noreply.github.com>2026-11-23 20:23:21 -0600
commite0f76d28b5e84f69c8bd05a3b6fb414438f7e2b4 (patch)
tree05a01b8fe80c7311e2bc6b027ffc4ee48147f768 /runtime/shims/gameinput.cpp
parent9ec34cdff41b19d7671bc260e5f40dc69790d905 (diff)
gameinput: serve GameInput.dll's ordinal 1, the retail executable's GameInputCreate import
The retail executable imports GameInputCreate from GameInput.dll by ordinal 1. The loader looks ordinal imports up as "#1", which the shim table did not have, so the import bound to the host's GameInput.dll. On Windows the installed GameInput answers; under Wine it is the builtin stub, the call fails and the title stops on its result. The alias maps #1 to the same GameInputCreate, and gameinput_test checks it. (cherry picked from commit 5e45c7da942d7ac08fc57561e9ed924bcfc76476)
Diffstat (limited to 'runtime/shims/gameinput.cpp')
-rw-r--r--runtime/shims/gameinput.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/shims/gameinput.cpp b/runtime/shims/gameinput.cpp
index 47ee190e3..402179cde 100644
--- a/runtime/shims/gameinput.cpp
+++ b/runtime/shims/gameinput.cpp
@@ -2724,7 +2724,11 @@ void set_hid_backend(const HidBackend* backend) { g_hid = backend ? backend : &k
2724 2724
2725} // namespace rt::gameinput 2725} // namespace rt::gameinput
2726 2726
2727// GameInputCreate is GameInput.dll's export 1, and the retail executable imports it by that ordinal, which the loader
2728// looks up as "#1". Without the alias the import misses the shim and binds to the host's GameInput.dll; under Wine that
2729// is the builtin stub, which fails, and the title stops on the result.
2727SHIM_TABLE(gameinput, 2730SHIM_TABLE(gameinput,
2728 {"gameinput.dll", "GameInputCreate", reinterpret_cast<void*>(&GameInputCreate)}, 2731 {"gameinput.dll", "GameInputCreate", reinterpret_cast<void*>(&GameInputCreate)},
2732 {"gameinput.dll", "#1", reinterpret_cast<void*>(&GameInputCreate)},
2729 {"xgameruntime.dll", "GameInputCreate", reinterpret_cast<void*>(&GameInputCreate)}, 2733 {"xgameruntime.dll", "GameInputCreate", reinterpret_cast<void*>(&GameInputCreate)},
2730); 2734);