Repository navigation
xgameruntime: implement XPackageImpl::XPackageEnumeratePackages (slots 35 & 39) - #8623
auswhalen999-debug wants to merge 1 commit into
Conversation
Xiiano
left a comment
There was a problem hiding this comment.
No blocking bugs or memory-safety issues found.
The change is consistent with the repository’s existing file_mode.published_mode and replace_retry.replace patterns. Its staged-file cleanup also preserves the original publish exception if Windows cleanup cannot remove or chmod the staged file.
Validation
python -I tests/test_replace_retry.py — 10/10 passed
python -I tests/test_file_mode.py — passed; 2 POSIX-only tests skipped
python -I tests/test_world_names.py — 28 passed, 2 skipped, with 1 unrelated Windows-only failure in test_an_unreadable_subtree_does_not_replace_the_dictionary caused by doubled backslashes in the assertion
The complete test file loaded and ran the new publishing tests successfully
AI brand/model: Microsoft Copilot SDK — model not exposed in this session.
|
Tested 00a07dd merged onto main 867d922 (the head already contains that main, so the merge is a fast-forward). Machine: Linux, Ryzen 9 7950X3D, Wine 11.22 (Staging). Pass. All new slot 35 / 39 checks pass, and the run up to the first failure gets 18 more PASS lines than main, with no new failures. Result:
Read:
Minor (not blockers):
AI-assisted (Claude Code, Claude Opus 5.5). |
|
Tested
|
Claimed in the coordination issue as: #8504 (comment)
What and why
XPackageImplslots 35 (IXPackageImpl2::XPackageEnumeratePackages) and 39 (IXPackageImpl3::XPackageEnumeratePackages) inruntime/shims/xgameruntime.cpppreviously logged once and returnedE_NOTIMPL.This implements both slots offline against Microsoft's public GDK
XPackageEnumeratePackages/XPackageDetailscontract:XPackageKind,XPackageEnumerationScope, and the 80-byteXPackageDetailsstruct withstatic_assertchecks for member offsets (includingageRestrictedat offset 68 forIXPackageImpl2andtitleIDat offset 72 forIXPackageImpl3). Since each revision only appends fields and the struct is passed byconst XPackageDetails*to the callback, both slots sharepkg_enumerate_packages.XPackageKind/XPackageEnumerationScopereturnsE_INVALIDARG.XPackageKind::Game(any valid scope), reports the current process package usingLEONIDA_PACKAGE_ID(or the existing default identifier) and populatesversion,displayName,description,publisher,storeId, and 8-digit uppercase hextitleIDfromMicrosoftGame.Configwhen present (all string pointers remain valid non-null C strings when absent, withinstalling = falseandageRestricted = false).XPackageKind::Content, enumerates unique content package identifiers configured inLEONIDA_CONTENT_PACKAGES(skipping the main game identifier) with accurateindex/countand emptytitleID(zero callbacks when unset), stopping early and returningS_OKwhen the callback returnsfalse.XPackageKind::PublisherContent, invokes the callback zero times and returnsS_OK._Init_thread_headerreferences) and leaves#6986's chunk, installation-monitor, and mount-with-UI slots untouched.docs/runtime_imports.mdand adds synthetic coverage for both slots inruntime/test/xgameruntime_test.cpp.Tested
Built
xgameruntime_testandgta6rtwithclang-cl 23.1.6+xwin-sdk(Windows 11, CPU-only synthetic tests,LEONIDA_SDL3=OFF,LEONIDA_REQUIRE_VULKAN=OFF):xgameruntime_test.exe:xgameruntime_test: OK (161 checks)(covering slots 35 & 39 null/enum validation, defaultGamepackage,MicrosoftGame.Configmetadata +LEONIDA_PACKAGE_IDacrossThisOnly/ThisAndRelated/ThisPublisher, empty & multi-entryLEONIDA_CONTENT_PACKAGESenumeration with deduplication andXPackageMountcompatibility, early stop on callbackfalse, andPublisherContent).python -I scripts/check_no_game_data.py runtime/shims/xgameruntime.cpp runtime/test/xgameruntime_test.cpp docs/runtime_imports.md: exit 0.AI-assisted: yes
Checklist
docs/design.md, with how it was confirmed. (N/A — runtime shim only.)