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

Closed
ItsMrDubey wants to merge 1 commit from upstream-pr/124 into main
ItsMrDubey commented 2026-11-24 02:23:44 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ItsMrDubey on 2026-11-24T02:23:44Z.


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.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5464887965 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/124). Originally posted by [ItsMrDubey](https://github.com/ItsMrDubey) on 2026-11-24T02:23:44Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by ubiquitarianism on 2026-11-24T03:36:45Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7121259202 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/124#issuecomment-7121259202). Originally posted by [ubiquitarianism](https://github.com/ubiquitarianism) on 2026-11-24T03:36:45Z. --- #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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by piyonchu on 2026-11-25T01:06:21Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7149210423 --> Imported from [ubiquitarianism/leonida](https://github.com/ubiquitarianism/leonida/pull/124#issuecomment-7149210423). Originally posted by [piyonchu](https://github.com/piyonchu) on 2026-11-25T01:06:21Z. --- @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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T17:58:41Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7243433161 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/124#issuecomment-7243433161). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-28T17:58:41Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T18:59:53Z.


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.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7288684135 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/124#issuecomment-7288684135). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T18:59:53Z. --- 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 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-30T18:59:55Z.


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

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7288684973 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/124#issuecomment-7288684973). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-11-30T18:59:55Z. --- Superseded: the classifier change and XCRDAPI-specific coverage are now on main.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
ProjectLeonida/mandy!124
No description provided.