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

Closed
leonida/mandy
ItsMrDubey wants to merge 0 commits from xcrdapi-dstorage-class into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

ItsMrDubey commented 2026-11-24 02:23:44 +00:00

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.
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`.
ubiquitarianism commented 2026-11-24 03:36:45 +00:00

#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.

#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.
piyonchu commented 2026-11-25 01:06:21 +00:00

@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).

@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).
MoonEyes commented 2026-11-28 17:58:41 +00:00

Hi @ItsMrDubey, thanks for this pull request. It currently conflicts with main (conflicting file(s): runtime/shims/registry.cpp, runtime/test/unimplemented_policy_test.cpp), so it carries the needs rebase label. CONTRIBUTING.md asks authors to rebase their branch on main; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here.

AI-assisted (Claude Code, Claude Opus 5.5).

Hi @ItsMrDubey, thanks for this pull request. It currently conflicts with `main` (conflicting file(s): `runtime/shims/registry.cpp`, `runtime/test/unimplemented_policy_test.cpp`), so it carries the `needs rebase` label. CONTRIBUTING.md asks authors to rebase their branch on `main`; once it merges cleanly the label goes within the hour, and reviews start with the pull requests that do. Could you update the branch when you have a moment? If you no longer plan to continue with it, please say so here. AI-assisted (Claude Code, Claude Opus 5.5).
MoonEyes commented 2026-11-30 18:59:53 +00:00

Closing as superseded by current main. registry.cpp already classifies xcrdapi.dll!DStorageGetFactory as HRESULT, and unimplemented_policy_test.cpp now has the exact XCRDAPI assertion plus a negative control for other XCRDAPI imports. The implementation and the test-only remainder are both present; this branch is dirty and its latest checks include failures, so no merge is needed.

Closing as superseded by current `main`. `registry.cpp` already classifies `xcrdapi.dll!DStorageGetFactory` as HRESULT, and `unimplemented_policy_test.cpp` now has the exact XCRDAPI assertion plus a negative control for other XCRDAPI imports. The implementation and the test-only remainder are both present; this branch is dirty and its latest checks include failures, so no merge is needed.
MoonEyes commented 2026-11-30 18:59:55 +00:00

Superseded: the classifier change and XCRDAPI-specific coverage are now on main.

Superseded: the classifier change and XCRDAPI-specific coverage are now on main.
Sign in to join this conversation.
No description provided.