feat(xgameruntime): add the XPackage HLE (identity, mount, chunks and installation monitors) #37
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Freminet--ScarlettX!37
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-37"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@wildheathen on GitHub · 2026-11-21 18:39 UTC · original
wildheathen:feat/xpackage→main· +1263 −0 · 4 files · 3 commits · openSummary
Adds the public
XPackagesurface of the GDK (XPackage.h, 31 functions) toxgameruntimeas an offline, deterministic HLE. The title always runs as a single packaged title, so every query describes exactly one package (the calling process), with no features, no DLC and nothing to download; installation is always complete.XPackageIsPackagedProcess,XPackageGetCurrentProcessPackageIdentifier,XPackageGetUserLocale(overridable withSCARLETTX_PACKAGE_IDENTIFIER/SCARLETTX_USER_LOCALE).XPackageEnumeratePackages,XPackageGetPackageKind,XPackageMount,XPackageGetMountPathSize,XPackageGetMountPath,XPackageCloseMountHandle,XPackageMountWithUiAsync/Result,XPackageEnumerateFeatures,XPackageGetWriteStats,XPackageEstimateDownloadSize,XPackageUninstallPackage,XPackageUninstallUWPInstance. The mounted folder isSCARLETTX_PACKAGE_ROOTwhen set, otherwise the folder that holds the executable.XPackageEnumerateChunkAvailability,XPackageFindChunkAvailability,XPackageChangeChunkInstallOrder,XPackageInstallChunks/Async/Result,XPackageUninstallChunks, the installation monitor functions and the progress-changed / package-installed registrations (tokens are accepted once by the matching unregister; callbacks never fire because nothing ever changes).Signatures and documented error codes come from the public reference pages on learn.microsoft.com (GDK,
gdk-2610view). Enums are exposed asuint32_tplus constants, like the rest ofxgameruntime_abi.h.Layout
Everything lives in new files so the change does not overlap the open XUser / XGameSave / XMem work:
src/shims/xgr_package.cpp(registered inCMakeLists.txt) andtests/test_xpackage.cpp(newtest_xpackagetarget). The header gets one hunk, inside a new// XPackage.hsection.xgameruntime_shim.cppandtest_xgameruntime_abi.cppare untouched.Three commits, each building and passing
test_xpackageon its own: identity and locale, enumeration and mount, chunks and installation.Verification
test_xpackageandtest_xgameruntime_abiseparately.21/24. The three failing tests,test_boot_hello_scarlett,test_boot_rt_showcase(the systemxgameruntime.dllwins over our shim when the guest starts as a child process) andtest_d3d12_guest_texture, fail the same way on a build of unmodifiedorigin/mainand are unrelated to this change (see #1 and #2).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.