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

Open
github-bot wants to merge 1 commit from github-bot/gh-124 into main AGit
Owner

@⁠ItsMrDubey on GitHub · 2026-11-24 02:23 UTC · original
ItsMrDubey:xcrdapi-dstorage-class → main · +5 −2 · 2 files · 1 commits · open

Claimed in the coordination issue as: RT-XCRDAPI-CLASS (#14)

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.
**@⁠ItsMrDubey** on GitHub · 2026-11-24 02:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/124) `ItsMrDubey:xcrdapi-dstorage-class` → `main` · +5 −2 · 2 files · 1 commits · open Claimed in the coordination issue as: RT-XCRDAPI-CLASS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/14) ### 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`.
The retail executable imports DStorageGetFactory from XCRDAPI.dll, not
dstorage.dll or dstorage_xs.dll, so classify() returned Other for it and
LEONIDA_UNIMPLEMENTED=fail made the import return 0 instead of E_NOTIMPL.
The test now asserts the retail spelling too. Refs #47.

Same change as old-pr/9964 by piyonchu (its registry.cpp hunk only; the
DirectStorage shim itself is not carried here).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 08:45:18 +00:00
Author
Owner

@⁠ubiquitarianism on GitHub · 2026-11-24 03:36 UTC · original

#131 is now merged and makes the same classify() change for xcrdapi.dll in registry.cpp, so this PR conflicts with main. #131 doesn't include your XCRDAPI.dll assertion in unimplemented_policy_test.cpp. If you'd like it kept, please rebase down to just that test change and I'll merge it; otherwise this can be closed.

**@⁠ubiquitarianism** on GitHub · 2026-11-24 03:36 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/124#issuecomment-7121259202) #131 is now merged and makes the same `classify()` change for `xcrdapi.dll` in `registry.cpp`, so this PR conflicts with main. #131 doesn't include your `XCRDAPI.dll` assertion in `unimplemented_policy_test.cpp`. If you'd like it kept, please rebase down to just that test change and I'll merge it; otherwise this can be closed.
Author
Owner

@⁠piyonchu on GitHub · 2026-11-25 01:06 UTC · original

@⁠ubiquitarianism Confirmed — #131 already landed the xcrdapi.dll!DStorageGetFactory classify() rule, and unimplemented_policy_test.cpp already tests the DStorageGetFactory branch under dstorage_xs.dll, so #124 can be closed cleanly (unable to push to ItsMrDubey's fork directly).

**@⁠piyonchu** on GitHub · 2026-11-25 01:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/124#issuecomment-7149210423) @⁠ubiquitarianism Confirmed — `#131` already landed the `xcrdapi.dll!DStorageGetFactory` `classify()` rule, and `unimplemented_policy_test.cpp` already tests the `DStorageGetFactory` branch under `dstorage_xs.dll`, so `#124` can be closed cleanly (unable to push to `ItsMrDubey`'s fork directly).
This pull request has changes conflicting with the target branch.
  • runtime/shims/registry.cpp
  • runtime/test/unimplemented_policy_test.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/124/head:github-bot/gh-124'
git switch 'github-bot/gh-124'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-124'
git switch 'github-bot/gh-124'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-124'
git switch 'github-bot/gh-124'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-124'
git switch 'main'
git merge --squash 'github-bot/gh-124'
git switch 'main'
git merge --ff-only 'github-bot/gh-124'
git switch 'main'
git merge 'github-bot/gh-124'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.