upleb.uk

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

summaryrefslogtreecommitdiff
path: root/runtime/shims/registry.cpp
diff options
context:
space:
mode:
authorMumogg <104529023+Mumogg@users.noreply.github.com>2026-11-23 20:23:21 -0600
committerMumogg <104529023+Mumogg@users.noreply.github.com>2026-11-23 20:23:21 -0600
commit2d7be48dec529446e0ead3393e2b3acabb29ff64 (patch)
treee33ffbd80a396f79ea4842fbd3e45d7f145df73e /runtime/shims/registry.cpp
parent9ec34cdff41b19d7671bc260e5f40dc69790d905 (diff)
runtime: restore the console DirectStorage shim (DStorageGetFactory) on main
The merge that brought the mirrored pull requests into main (6dece9231) left the DirectStorage shim out, noting that it "needs the typed-error zlib inflate". The shim's commits (f87d05fdd, ac1843da2, 00551ba00, by mariuslozo-boop and Kelebek) are ancestors of main, but its files are not in the tree, so the retail executable's XCRDAPI.dll!DStorageGetFactory import is unimplemented (issue #47, stop 5 of docs/retail_boot_chain.md). - shims/dstorage.cpp, shims/dstorage_xs_abi.h, test/dstorage_test.cpp and docs/directstorage.md are back as those commits left them. - leonida::zlib_inflate reports why it failed through an optional ZlibError* (header, data, checksum, limit), which the shim turns into its E_DSTORAGE_ZLIB_* codes. This is the same interface the shim was written against, added to main's current table-driven inflater; callers that pass no pointer behave as before. - registry.cpp classes xcrdapi.dll!DStorageGetFactory as an HRESULT import, the retail spelling #47 found missing. - CMake and scripts/build_runtime.ps1 build the shim into gta6rt, and CMake builds and registers dstorage_test. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HxBQf4pXH8PWpC5oZsM4bt
Diffstat (limited to 'runtime/shims/registry.cpp')
-rw-r--r--runtime/shims/registry.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/shims/registry.cpp b/runtime/shims/registry.cpp
index 9b3ea0437..6ec36e31c 100644
--- a/runtime/shims/registry.cpp
+++ b/runtime/shims/registry.cpp
@@ -80,7 +80,10 @@ std::vector<Lookup> g_lookups;
80// xaudio2_9.dll XAudio2Create: HRESULT (learn.microsoft.com/windows/win32/api/xaudio2/ 80// 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). 81// xaudio2_9redist.dll nf-xaudio2-xaudio2create). xaudio2_9.dll is the console name (docs/d3d12_vulkan.md §7).
82// dstorage.dll DStorageGetFactory: HRESULT (learn.microsoft.com/windows/win32/api/dstorage/ 82// 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. 83// dstorage_xs.dll nf-dstorage-dstoragegetfactory, and the GDK's gaming/gdk/docs/reference/system/dstorage/
84// xcrdapi.dll functions/dstoragegetfactory). dstorage_xs.dll is the console name; xcrdapi.dll is a
85// console module the title may import it from (docs/directstorage.md). dstorage.cpp serves
86// it; the class is kept for a build without that shim.
84const char* const kNotHResult[] = { 87const char* const kNotHResult[] = {
85 "XAsyncCancel", "XAsyncComplete", 88 "XAsyncCancel", "XAsyncComplete",
86 "XTaskQueueCloseHandle", "XTaskQueueDispatch", "XTaskQueueGetCurrentProcessTaskQueue", 89 "XTaskQueueCloseHandle", "XTaskQueueDispatch", "XTaskQueueGetCurrentProcessTaskQueue",
@@ -111,7 +114,7 @@ ReturnClass classify(const std::string& dll, const std::string& name) {
111 if (name == "XAudio2Create") return ReturnClass::HResult; 114 if (name == "XAudio2Create") return ReturnClass::HResult;
112 } else if (dll == "gameinput.dll") { 115 } else if (dll == "gameinput.dll") {
113 if (name == "GameInputCreate") return ReturnClass::HResult; 116 if (name == "GameInputCreate") return ReturnClass::HResult;
114 } else if (dll == "dstorage.dll" || dll == "dstorage_xs.dll") { 117 } else if (dll == "dstorage.dll" || dll == "dstorage_xs.dll" || dll == "xcrdapi.dll") {
115 if (name == "DStorageGetFactory") return ReturnClass::HResult; 118 if (name == "DStorageGetFactory") return ReturnClass::HResult;
116 } else if (dll == "acphal.dll") { 119 } else if (dll == "acphal.dll") {
117 if (name == "AcpHalAllocateShapeContexts" || name == "AcpHalCreate" || 120 if (name == "AcpHalAllocateShapeContexts" || name == "AcpHalCreate" ||