XGameRuntime & advapi32legacy: UE4 startup, login, and hotfix parity #24
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!24
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/24/head"
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?
@raylitebull on GitHub · 2026-11-21 22:41 UTC · original
raylitebull:xgameruntime-startup-parity→main· +2325 −152 · 9 files · 1 commits · merged 2026-11-21 22:47 UTCSummary
Implements missing XGameRuntime and
advapi32legacy.dllsemantics needed by UE4/GDK console titles (e.g. Fortnite startup, login, and hotfix flows), written cleanly in XCL's idioms without touchingd3d12x,xg.rs, ortitle_textures.rsand preserving XCL's offlineXStorerefusal policy.Changes
XUserGetTokenAndSignature{,Utf16}{Async,ResultSize,Result}+ XSTS v1 ECDSA P-256 signing (crates/xcl/src/hle/xgameruntime/xsign.rs,mod.rs,api.rs):bcrypt.dll, zero new crate dependencies) and produces a real Base64-encoded 76-byte XSTS v1 signature header ([version=1 BE][filetime BE][64-byte raw P-256 sig]) alongside an offlineXBL3.0authorization token.GameChat2,libHttpClient.GDK,EOSSDK) that reject or mis-index empty signatures.PayloadBuf/begin_with_fixupsinxasync.rsso internal result-struct pointers (token,signature) are relocated inOP_GET_RESULTfor both XCL's ownXAsyncand the PCxgameruntime.dllpath.User device association & controller lookup (
mod.rs,api.rs):XUserFindForDevice(slot #3 onXUSER_DEVICE) now associates controllers with the local signed-in user (S_OK) instead of returningE_GAMEUSER_USER_NOT_FOUND.XUserFindControllerForUserWithUiAsync/Result(slots #9–#10).XNetworkingHLE (37e56907/bf2346b2, slots #3–#17) (crates/xcl/src/hle/xgameruntime/networking.rs,api.rs):3074, sync + async), per-URL HTTP security information (UTF-8 & UTF-16, TLS 1.2|1.3, exact GDK(block, bufSize, bufUsed, buf, outPtr)argument order), connectivity hint viaiphlpapi.dll, registration tokens, andXNetworkingVerifyServerCertificate(real CryptoAPI SSL chain + SHA-1 thumbprint pin verification with plain-HTTP loopback allowance for local servers).XTaskQueuecomposite queues, monitors, andXAsynclifecycle + fallback (taskqueue.rs,xasync.rs,api.rs):PorttoArc<Port>with weak-referenced port handles (XTaskQueueGetPort#14,XTaskQueueCreateComposite#13) and per-queue item ownership so terminating a composite queue cancels only its own work and never aborts sibling work on shared ports.XTaskQueueRegisterMonitor/UnregisterMonitorcallbacks andXThreadVerifyNotTimeSensitive/XThreadAssertNotTimeSensitive.XAsyncBlockstate retention leak by removing completed/consumed entries fromACTIVEwhile storing a compact completion header inblock.internal, fixes double-XAsyncGetResultto returnE_ILLEGAL_METHOD_CALL(0x8000000E), and snapshots callback/queue pointers before wakingXAsyncGetStatuswaiters.XASYNCCOM object as an automatic fallback inQueryApiImplwhenSystem32\xgameruntime.dll(Gaming Services) is absent (while continuing to use PCxgameruntime.dllwhen present).Console GDK 19041/2020 IID compatibility,
XErrorCOM class, and vtable fixes (api.rs):XPackagev1 (be3f3e9f, slot 28XPackageEnumeratePackages),XPackagev2 (f92d8712, slots 35/36EnumeratePackages/RegisterPackageInstalled),XSystemv3 (6fd71f09, slot 4XSystemGetAppSpecificDeviceIdinstead ofSandboxId), plusXPackageGetIdentifier(slot 27) and compatible alias IIDs (XUserv2,XSystemv2,XGamev1,XPLSv1).SLOTSfrom80to96so GDK table slots80..=83are not truncated.XErrorCOM class (8ca467f7, slots #3–#5) without triggeringDebugBreak.XGameUi) so querying an older IID does not poison the main IID's cached PC vtable pointer.advapi32legacy.dllLSA & Advapi32 system fallback (crates/xcl/src/hle/mod.rs,crates/xcl/src/resolver.rs):advapi32.dllandsechost.dlltoKERNELX.fallbackso non-hooked imports fromadvapi32legacy.dll(such asLsaOpenPolicy,LsaQueryInformationPolicy,LsaClose,LookupPrivilegeValueW) resolve to Windows' realadvapi32.dll/sechost.dllinstead of auto-stubbing to0(for both static PE imports andLoadLibrary+GetProcAddress).Verification
cargo build --workspace: 0 new warnings.cargo test --workspace -- --test-threads=4: all tests passed (xcllib 258 passed including 18 new unit tests acrossxsign,networking,taskqueue,xasync,api, andresolver;console_dlls_e2e12 passed;console_shaders1 passed;e2e1 passed including newxcl_testtitlechecks;gpu_pso_e2e6 passed;xg_oracle3 passed).@ivall on GitHub · 2026-11-21 22:47 UTC · original
Reviewed and merged, thanks. Checked on top of current main: full workspace tests pass (258 lib tests, e2e, console-library tests), no new build warnings.
Notes from the review:
XBL3.0 x=xcl;local-<id>token and the ephemeral P-256 signature never reach real services - fine with the project rule of no Xbox Live.networking.rs), a uselessvec!, a hand-writtenunwrap_or.