upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorNolan Cotter <186326284+NolanCotter@users.noreply.github.com>2026-11-22 09:13:17 -0700
committerNolan Cotter <186326284+NolanCotter@users.noreply.github.com>2026-11-22 16:40:33 -0700
commit2c6424bbc38adb892d8f752e500bf55717ccbfbb (patch)
tree4aad7a1c5ec1552a7c2d3be4bfcde74151db7eff /runtime
parentaa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff)
shims: classify the measured console ordinal imports (xaudio2_9 #1, gameinput #1)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/shims/registry.cpp8
-rw-r--r--runtime/test/unimplemented_policy_test.cpp5
2 files changed, 10 insertions, 3 deletions
diff --git a/runtime/shims/registry.cpp b/runtime/shims/registry.cpp
index 37ff540c5..3f084f45a 100644
--- a/runtime/shims/registry.cpp
+++ b/runtime/shims/registry.cpp
@@ -76,9 +76,11 @@ std::vector<Lookup> g_lookups;
76// left out on purpose. 76// left out on purpose.
77// gameinput.dll GameInputCreate: HRESULT (gaming/gdk/docs/reference/input/gameinput/functions/ 77// gameinput.dll GameInputCreate: HRESULT (gaming/gdk/docs/reference/input/gameinput/functions/
78// gameinputcreate). The shim implements it (runtime/shims/gameinput.cpp); the class is 78// gameinputcreate). The shim implements it (runtime/shims/gameinput.cpp); the class is
79// listed anyway for a build or import it misses. 79// listed anyway for a build or import it misses. "#1" is the same function by ordinal:
80// ordinal 1 is GameInputCreate in the console export inventory (docs/d3d12_vulkan.md §7).
80// xaudio2_9.dll XAudio2Create: HRESULT (learn.microsoft.com/windows/win32/api/xaudio2/ 81// xaudio2_9.dll XAudio2Create: HRESULT (learn.microsoft.com/windows/win32/api/xaudio2/
81// xaudio2_9redist.dll nf-xaudio2-xaudio2create). xaudio2_9.dll is the console name (docs/d3d12_vulkan.md §7). 82// xaudio2_9redist.dll nf-xaudio2-xaudio2create). xaudio2_9.dll is the console name (docs/d3d12_vulkan.md §7).
83// "#1" is XAudio2Create by ordinal, ordinal 1 verified in the same inventory.
82// dstorage.dll DStorageGetFactory: HRESULT (learn.microsoft.com/windows/win32/api/dstorage/ 84// dstorage.dll DStorageGetFactory: HRESULT (learn.microsoft.com/windows/win32/api/dstorage/
83// dstorage_xs.dll nf-dstorage-dstoragegetfactory). dstorage_xs.dll is the console name. 85// dstorage_xs.dll nf-dstorage-dstoragegetfactory). dstorage_xs.dll is the console name.
84const char* const kNotHResult[] = { 86const char* const kNotHResult[] = {
@@ -108,9 +110,9 @@ ReturnClass classify(const std::string& dll, const std::string& name) {
108 name == "DXGIDeclareAdapterRemovalSupport") 110 name == "DXGIDeclareAdapterRemovalSupport")
109 return ReturnClass::HResult; 111 return ReturnClass::HResult;
110 } else if (dll == "xaudio2_9.dll" || dll == "xaudio2_9redist.dll") { 112 } else if (dll == "xaudio2_9.dll" || dll == "xaudio2_9redist.dll") {
111 if (name == "XAudio2Create") return ReturnClass::HResult; 113 if (name == "XAudio2Create" || name == "#1") return ReturnClass::HResult;
112 } else if (dll == "gameinput.dll") { 114 } else if (dll == "gameinput.dll") {
113 if (name == "GameInputCreate") return ReturnClass::HResult; 115 if (name == "GameInputCreate" || name == "#1") return ReturnClass::HResult;
114 } else if (dll == "dstorage.dll" || dll == "dstorage_xs.dll") { 116 } else if (dll == "dstorage.dll" || dll == "dstorage_xs.dll") {
115 if (name == "DStorageGetFactory") return ReturnClass::HResult; 117 if (name == "DStorageGetFactory") return ReturnClass::HResult;
116 } else if (dll == "xgameruntime.dll") { 118 } else if (dll == "xgameruntime.dll") {
diff --git a/runtime/test/unimplemented_policy_test.cpp b/runtime/test/unimplemented_policy_test.cpp
index 77a6e5595..2f8c90fb9 100644
--- a/runtime/test/unimplemented_policy_test.cpp
+++ b/runtime/test/unimplemented_policy_test.cpp
@@ -229,6 +229,11 @@ void test_classification() {
229 check(cls("xaudio2_9redist.dll", "XAudio2Create") == ReturnClass::HResult, 229 check(cls("xaudio2_9redist.dll", "XAudio2Create") == ReturnClass::HResult,
230 "the redist name gets the same class"); 230 "the redist name gets the same class");
231 check(cls("gameinput.dll", "GameInputCreate") == ReturnClass::HResult, "GameInputCreate is hresult"); 231 check(cls("gameinput.dll", "GameInputCreate") == ReturnClass::HResult, "GameInputCreate is hresult");
232 check(cls("xaudio2_9.dll", "#1") == ReturnClass::HResult, "xaudio2_9 ordinal 1 is XAudio2Create");
233 check(cls("xaudio2_9redist.dll", "#1") == ReturnClass::HResult, "the redist ordinal gets the same class");
234 check(cls("gameinput.dll", "#1") == ReturnClass::HResult, "gameinput ordinal 1 is GameInputCreate");
235 check(cls("xaudio2_9.dll", "#2") == ReturnClass::Other, "another xaudio2_9 ordinal stays other");
236 check(cls("gameinput.dll", "#2") == ReturnClass::Other, "another gameinput ordinal stays other");
232 check(cls("dstorage_xs.dll", "DStorageGetFactory") == ReturnClass::HResult, 237 check(cls("dstorage_xs.dll", "DStorageGetFactory") == ReturnClass::HResult,
233 "the console dstorage name is hresult"); 238 "the console dstorage name is hresult");
234 check(cls("xg_xs.dll", "XGCreateTexture2DComputer") == ReturnClass::Other, "unmeasured xg_xs import is other"); 239 check(cls("xg_xs.dll", "XGCreateTexture2DComputer") == ReturnClass::Other, "unmeasured xg_xs import is other");