Repository navigation
Conversation
The retail executable imports DStorageGetFactory from XCRDAPI.dll, the DirectStorage
import library (docs/runtime_imports.md, the RT-5 table: one import from that DLL), and
docs/audio_hal_exe_calls.md reads the single call site: the interface id, then a global
that is tested for null afterwards.
classify() answered HRESULT for DStorageGetFactory only when the importing DLL was
dstorage.dll or dstorage_xs.dll, so the XCRDAPI.dll import fell to Other. Under
LEONIDA_UNIMPLEMENTED=fail the thunk then returned 0 (S_OK) with the out pointer
unwritten, which is the state docs/retail_boot_chain.md row 5 records as a fatal assert
(the title asserts on the null factory). With this change the same call answers
E_NOTIMPL and the title's own failure path runs.
runtime/test/unimplemented_policy_test.cpp: one check for the XCRDAPI.dll import and one
that keeps another xcrdapi.dll name at Other, so the class stays name-scoped.
Before: "FAIL the import library the retail executable uses names it hresult too"
(98 checks, 1 failed) on the same test binary.
After: 98 checks, 0 failed; ctest -R unimplemented_policy passes.
EGEN-UNIMPL-XCRDAPI-DSTORAGE
abnalstlll-byte
left a comment
There was a problem hiding this comment.
Independent Windows review (commit e89fe454d07cbed168cae2258d107c433910cfc4)
What changed:
runtime/shims/registry.cpp:- Classifies
DStorageGetFactoryimported fromXCRDAPI.dllasReturnClass::HResult. - Fixes retail import falling through to
ReturnClass::Otherwhich returned fakeS_OKwith unwritten out-pointers under unimplemented fail policies. ReturnsE_NOTIMPL(0x80004001), triggering standard title fallback.
- Classifies
runtime/test/unimplemented_policy_test.cpp:- 98 checks pass.
Verification:
- Verified on Windows host: clean return class categorization.
- Clean diff: no game files.
Ready to merge.
|
Verified on native Windows 11 (
AI-assisted. |
|
Checked Pass
Needs changes
AI-assisted: Codex GPT-6.2 Sol ran the checks, Claude Opus 5.5 reviewed the report. The executable was read in place (SHA-256 |
|
Tested e89fe45 (merged onto main 867d922) on RTX 5070, NVIDIA 621.24, Windows 11 (build 26200), Vulkan validation layer on (
Ran the tests that belong to the test files this PR changes (ctest entries, or the test program directly when it is not registered), with no game files ( |
LaugeM
left a comment
There was a problem hiding this comment.
The classify() change here is the same line #8461 adds: dll == "xcrdapi.dll" next to dstorage.dll and dstorage_xs.dll in runtime/shims/registry.cpp. #8461 also adds the same pair of checks to runtime/test/unimplemented_policy_test.cpp. The two branches conflict in both files (git merge-tree of this head onto #8461).
Once #8461 lands, the import is served and the class only matters for a build without dstorage.cpp, which #8461's comment in registry.cpp already covers. So this PR adds nothing after #8461. I would close it in favour of #8461. If #8461 is held up, this one can land first, and #8461 then drops its copy of the hunk.
AI-assisted review (Opus 5.5). Read the diff against main; not built.
Claimed in the coordination issue as: EGEN-UNIMPL-XCRDAPI-DSTORAGE (#9065 (comment))
Depends on: none
What and why
classify()inruntime/shims/registry.cppdecides what an unbound import returns underLEONIDA_UNIMPLEMENTED=fail,and it answered
HRESULTforDStorageGetFactoryonly when the importing DLL wasdstorage.dllordstorage_xs.dll. The retail executable imports that function fromXCRDAPI.dll— the DirectStorage importlibrary, one import from that DLL, per the RT-5 table in
docs/runtime_imports.md— so the retail import fell toOtherand the thunk returned 0, which isS_OKwith the out pointer never written.docs/audio_hal_exe_calls.mdreads the single call site: the interface id, then a global that is tested for nullafterwards. That null factory with a success code is the state
docs/retail_boot_chain.mdrow 5 records as a fatalassert, so the policy built to make the title take its own failure path could not do it for this call. With the DLL
added to the same branch, the class is
HRESULTandfailanswersE_NOTIMPL.The name is still matched exactly, so another
xcrdapi.dllimport keepsOther.kNotHResult, the D3D12/DXGI/audionames and the shims are untouched.
Tested
Windows 11, no GPU involved (the change is in the import-return table, not the layer), MSVC 19.44, RelWithDebInfo,
base
main867d922f0, build directory outside the source tree (-G Ninja).runtime/test/unimplemented_policy_test.cppgained two checks:XCRDAPI.dll!DStorageGetFactoryishresult, andxcrdapi.dll!XMemAllocstaysother(the control that keeps the class name-scoped).FAIL the import library the retail executable uses names it hresult too—98 checks, 1 failed;ctest -R unimplemented_policyfails.98 checks, 0 failed, andctest -R unimplemented_policy --output-on-failure→1/1 Test #22: unimplemented_policy ... Passed. The in-processfailrows still reporthresult=80004001 other=00000000, theuntouched out parameter and
xmm0 = 0.0, so only the class of the XCRDAPI import moved.python -I scripts/check_no_game_data.py runtime/shims/registry.cpp runtime/test/unimplemented_policy_test.cppexits 0.
What this does not show: no run of the retail executable was made for this change, so the effect on the boot chain is
not measured. What it would take is the documented dry run on the player's copy
whose last line should change from
hresult=0 other=…tohresult=1 other=…for this import, and then a--runwith
LEONIDA_UNIMPLEMENTED=failto see the title's own DirectStorage failure path instead of the assert on the nullfactory. PR #8461 would serve the factory outright; that does not make the class wrong for a build or an import it
misses, which is why
gameinput.dll's class sits next to its shim in the same table.Neither builds on nor conflicts with #8280, which adds other names to a different branch of
classify().AI-assisted: yes (Cline).
Checklist
docs/design.md, with how it was confirmed.Tag: SHAYDERRR