[PR #124] RT-XCRDAPI-CLASS: classify XCRDAPI.dll!DStorageGetFactory as HRESULT (Refs #47) #177

Open
opened 2026-11-26 20:17:02 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/124
Author: @ItsMrDubey
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: xcrdapi-dstorage-class


📝 Commits (1)

  • 1c6d62d shims: DStorageGetFactory from XCRDAPI.dll is classified as HRESULT

📊 Changes

2 files changed (+5 additions, -2 deletions)

View changed files

📝 runtime/shims/registry.cpp (+3 -2)
📝 runtime/test/unimplemented_policy_test.cpp (+2 -0)

📄 Description

Claimed in the coordination issue as: RT-XCRDAPI-CLASS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964)

What and why

This is the classification half of #47. runtime/shims/registry.cpp gave DStorageGetFactory ReturnClass::HResult only for dstorage.dll / dstorage_xs.dll. The retail executable imports it from XCRDAPI.dll (docs/runtime_imports.md:161), so classify() fell through to ReturnClass::Other. That is the hresult=0 other=1 in the #47 dry run. Under LEONIDA_UNIMPLEMENTED=fail the import returned 0 (S_OK with a null factory) instead of E_NOTIMPL.

The fix adds xcrdapi.dll to the DStorage branch of classify() and to the comment block that documents each DLL's class. unimplemented_policy_test.cpp now also asserts the retail spelling (XCRDAPI.dll, mixed case, which also exercises the lowercasing).

This is the same change as the registry.cpp hunk of old-pr/9964 by @piyonchu ("implement console DirectStorage shims (XCRDAPI / dstorage_xs)"), credited in the commit message. The 849-line DirectStorage shim from that branch is not carried here. Stop 5 itself (a working DStorageGetFactory, i.e. old-pr/9964 or old-pr/4348) still needs someone with the game to carry and verify it.

Refs #47

Tested

Windows 11, MSVC 14.29 (VS 2019 Build Tools), CMake 4.4 + Ninja, no GPU. Built only unimplemented_policy_test in a separate build dir. This machine has no full 10.0.26100 SDK (only the WDK headers) and its 14.29 STL predates src/crt_timed_wait.cpp, so I configured with -DGTA6RT_SDK_HAS_ROOT_SIGNATURE_1_2=1 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded. Neither affects this target's sources. No CMakeLists changes.

cmake -S runtime -B <build> -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_SDL3=OFF ...
cmake --build <build> --target unimplemented_policy_test && <build>/unimplemented_policy_test.exe
  • Test change only (before the fix): FAIL the retail XCRDAPI name is hresult and 99 checks, 1 failed, exit 1
  • With the fix: ok the retail XCRDAPI name is hresult and 99 checks, 0 failed, exit 0
  • python -I scripts/check_no_game_data.py runtime/shims/registry.cpp runtime/test/unimplemented_policy_test.cpp: clean

AI-assisted: yes

Checklist

  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • No new translator rule, so nothing to add to the contract table of docs/design.md.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/124 **Author:** [@ItsMrDubey](https://github.com/ItsMrDubey) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `xcrdapi-dstorage-class` --- ### 📝 Commits (1) - [`1c6d62d`](https://github.com/ubiquitarianism/leonida/commit/1c6d62dc2f442334e8dec09a0274fcd8cf4731a1) shims: DStorageGetFactory from XCRDAPI.dll is classified as HRESULT ### 📊 Changes **2 files changed** (+5 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `runtime/shims/registry.cpp` (+3 -2) 📝 `runtime/test/unimplemented_policy_test.cpp` (+2 -0) </details> ### 📄 Description Claimed in the coordination issue as: RT-XCRDAPI-CLASS (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7119646964) ### What and why This is the classification half of #47. `runtime/shims/registry.cpp` gave `DStorageGetFactory` `ReturnClass::HResult` only for `dstorage.dll` / `dstorage_xs.dll`. The retail executable imports it from `XCRDAPI.dll` (`docs/runtime_imports.md:161`), so `classify()` fell through to `ReturnClass::Other`. That is the `hresult=0 other=1` in the #47 dry run. Under `LEONIDA_UNIMPLEMENTED=fail` the import returned 0 (S_OK with a null factory) instead of `E_NOTIMPL`. The fix adds `xcrdapi.dll` to the DStorage branch of `classify()` and to the comment block that documents each DLL's class. `unimplemented_policy_test.cpp` now also asserts the retail spelling (`XCRDAPI.dll`, mixed case, which also exercises the lowercasing). This is the same change as the `registry.cpp` hunk of `old-pr/9964` by @piyonchu ("implement console DirectStorage shims (XCRDAPI / dstorage_xs)"), credited in the commit message. The 849-line DirectStorage shim from that branch is **not** carried here. Stop 5 itself (a working `DStorageGetFactory`, i.e. old-pr/9964 or old-pr/4348) still needs someone with the game to carry and verify it. Refs #47 ### Tested Windows 11, MSVC 14.29 (VS 2019 Build Tools), CMake 4.4 + Ninja, no GPU. Built only `unimplemented_policy_test` in a separate build dir. This machine has no full 10.0.26100 SDK (only the WDK headers) and its 14.29 STL predates `src/crt_timed_wait.cpp`, so I configured with `-DGTA6RT_SDK_HAS_ROOT_SIGNATURE_1_2=1 -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded`. Neither affects this target's sources. No CMakeLists changes. ``` cmake -S runtime -B <build> -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLEONIDA_SDL3=OFF ... cmake --build <build> --target unimplemented_policy_test && <build>/unimplemented_policy_test.exe ``` - Test change only (before the fix): `FAIL the retail XCRDAPI name is hresult` and `99 checks, 1 failed`, exit 1 - With the fix: `ok the retail XCRDAPI name is hresult` and `99 checks, 0 failed`, exit 0 - `python -I scripts/check_no_game_data.py runtime/shims/registry.cpp runtime/test/unimplemented_policy_test.cpp`: clean AI-assisted: yes ### Checklist - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] No new translator rule, so nothing to add to the contract table of `docs/design.md`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#177
No description provided.