Repository navigation
Conversation
c04e2d4 to
ea68567
Compare
ea68567 to
34bd51f
Compare
|
Self-check of the served slots against Microsoft's reference pages: |
34bd51f to
e52ac36
Compare
Flyander
left a comment
There was a problem hiding this comment.
I found two remaining contract gaps in the offline package object:
-
Installation progress slot 7: the vtable uses
PN(7), whose helper has theHRESULT(void*)prototype and ignores all arguments. The documented method isvoid XPackageGetInstallationProgress(XPackageInstallationMonitorHandle, XPackageInstallationProgress*); callers expect the output structure to be initialized. Please use the correct ABI and provide deterministic offline progress values. Microsoft reference -
User locale:
pkg_user_localereturnsGetUserDefaultLocaleName()unconditionally.XPackageGetUserLocalereturns the closest locale declared by the package; if package locale information is absent, it succeeds without writing a locale. A host locale such asfr-FRcan therefore be returned even when the package only declaresen-US/de-DE. Please use the package's declared locale information where available, or avoid presenting an arbitrary host locale as the package locale. Microsoft reference
I reviewed this statically and did not run tests.
|
Tested 34bd51f on an NVIDIA GeForce RTX 3050 Laptop GPU, driver 32.0.16.2101, Windows 11, native MSVC (VS 2022 Build Tools, Ninja, RelWithDebInfo), with
AI-assisted (Claude Code). |
|
I tested A mapped The attached patch reuses The patch adds an optional expected-root argument to the fixture. Run |
Flyander
left a comment
There was a problem hiding this comment.
The two earlier findings remain at this head: slot 7 still uses an HRESULT(void*) thunk for XPackageGetInstallationProgress, which is a void method that writes an output structure, and XPackageGetUserLocale still returns the Windows locale instead of the package-declared locale.
Two additional ABI issues need correction:
- Slots 8, 10, 22 and 34 are boolean methods (
XPackageUpdateInstallationMonitor, the progress/package unregister methods, andXPackageUninstallPackage), but they use the genericHRESULT(void*)stub.E_NOTIMPLis nonzero in its low byte, so a caller reading the result asboolseestrue, even when an operation did nothing. QueryInterfaceaccepts the class ID andIXPackageImpl3only. It also needs to return the inheritedIXPackageImplandIXPackageImpl2interfaces for this object; those have distinct IIDs.
Please correct the output and boolean slot signatures, support the inherited IIDs, and keep the earlier progress/locale findings in scope.
e52ac36 to
a80b585
Compare
|
@Flyander thanks, all four addressed in a80b585, on the rebased #2203.
I also folded in @Ingenioeren's finding: |
Flyander
left a comment
There was a problem hiding this comment.
Re-reviewed at a80b585. The progress output and bool slots now use their documented ABI; locale handling uses the package configuration; and the inherited package IIDs are covered. No remaining concrete issue found in this change.
|
One thing the Narrowing (Edited: I corrected what main returned before, and that the CP_ACP conversion only avoids the throw.) AI-assisted review (Claude Code), read-only; I didn't build or run it. |
a80b585 to
d884194
Compare
d884194 to
e366272
Compare
|
Rebased onto
AI-assisted (Claude Code). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts with ItsNotRexed#2218's XPackageImpl: kept both. find_object() also finds package_object(), so XGameRuntimeIsFeatureAvailable(XPackage) now follows the served XPackageImpl; the feature table reuses ItsNotRexed#2218's kPackageClass instead of a second definition. Both test blocks kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested e52ac36 on Tiger Lake (Xe-LP) iGPU 0x9a78 (subgroup 8..32, no mesh), driver 32.0.101.7088, Windows 11, MSVC 14.44: pass Built the stacked head as-is: base main + the #2169/#2203 commits + this PR's own top commit e52ac36 (XPackageImpl/IXPackageImpl3 through QueryApiImpl). Full ctest: 105/107 pass, 7 skipped (shader_library_corpus, bink_decode, bink_audio, vk_sync_validation, d3d12_queue_wait, d3d12_rgb9e5_rtv skip; gameinput disabled — no SDL3 wired here). The PR's own surface: The 2 failing tests are pre-existing Intel-main failures this PR does not touch (its files are runtime/shims/xgameruntime.cpp, runtime/test/xgameruntime_test.cpp, runtime/test/fixtures/tiny_gdk_load.cpp, docs/runtime_imports.md): d3d12_buffer_tiles (assert line 177, tile words != expected) and d3d12_descriptor (2D LOD view 1/2 and array LOD 1.75 read 64/64 mismatched texels — the known Intel LOD/minLOD mismatch class on this driver). AI-assisted (GLM, operated by the account owner). |
|
@poke900310-lgtm thanks, you were right about AI-assisted (Claude Code). |
|
Follow-up from checking my own reply: the AI-assisted (Claude Code). |
libHttpClient.GDK.dll asks QueryApiImpl for XPackageImpl with IXPackageImpl3's id through 30 thunks (slots 3-19, 22, 24-27, 30, 32-34, 37-40), each in the argument shape of the method at that position of xgameruntime-docs' IXPackageImpl (3-34), IXPackageImpl2 (35-38) and IXPackageImpl3 (39-40) lists, e.g. 10 (monitor, token, bool), 14 (id, count, selectors), 24-26 the mount path trio, 39 (kind, scope, context, callback). Slots with an offline answer forward to the XPackage functions already on main, so the vtable and the named exports agree: 3 the package identifier, 4 packaged process, 25 the mount path; plus 11 the host user's locale, 24 the mount path size (exactly what 25 needs) and 26 closing a mount (nothing to release). Every other slot logs its number once and returns E_NOTIMPL, so the first boot lists what the title needs. xgameruntime_test +6 (80): the IXPackageImpl3 id, 3 and 4 equal the exports, the locale and its short-buffer error, 24/25 sizes, 5/40 stubs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, IIDs, --game-dir) Review (@Flyander): - slot 7 is void XPackageGetInstallationProgress(monitor, XPackageInstallationProgress*): it now writes an installed, launchable, completed package instead of an HRESULT stub ignoring its output. - slots 8, 10, 22, 34 are bool methods (UpdateInstallationMonitor, the two Unregister* calls, UninstallPackage); E_NOTIMPL read as true. They return false / true / true / false, as documented for nothing to do offline. - XPackageGetUserLocale returns the package-declared locale closest to the user's (MicrosoftGame.Config <Resource Language>, from LEONIDA_GAME_DIR or --game-dir), never the host locale; with none declared it succeeds without writing, as Microsoft documents. - QueryInterface answers IXPackageImpl and IXPackageImpl2 too (the IDL chain IXPackageImpl3 : IXPackageImpl2 : IXPackageImpl). And @Ingenioeren's finding: XPackageGetMountPath uses gta6rt's --game-dir (rt::fs::game_dir()) after LEONIDA_GAME_DIR, before the launcher folder. xgameruntime_test links file_system.cpp; +6 checks (88). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GetEnvironmentVariableA narrowed a game folder named outside the ANSI code page (e.g. a runic or CJK character on cp1252), so the package locale lookup missed its MicrosoftGame.Config. Read the variable and open the file wide. The test uses U+16A0, which no ANSI code page has (it fails with the narrow read). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
f74b8eb to
895f76f
Compare
|
Tested 895f76f on Windows 11 (MSVC RelWithDebInfo): full runtime build, then ctest for the shim/loader tests (loader, pe_loader, loader_tls, dll_thread_calls, unimplemented_policy, startup_trace, xmem, process_cmdline, file_system, winhttp_offline, xgameruntime, run_tiny_*, allocator_proxy) — 27 of 27 passed. AI-assisted. |
Depends on #2203 → #2169 (stacked: each adds an object to
QueryApiImpl's list). This PR's own change is the top commit.What and why
libHttpClient.GDK.dllasksQueryApiImplforXPackageImpl(af406016-…) withIXPackageImpl3's id (e2a4734b-…), through 30 thunks calling slots 3–19, 22, 24–27, 30, 32–34 and 37–40. I measured them as in #1877, disassembling the package's own DLL without running code. Every slot's argument shape matches the method at that position of xgameruntime-docs'IXPackageImpllist (slots 3–34), thenIXPackageImpl2(35–38) andIXPackageImpl3(39–40). Some examples:UnregisterInstallationProgressChanged(monitor, token, bool)ChangeChunkInstallOrder(id, u32 count, selectors)GetMountPathSize,GetMountPath,CloseMountHandle(mount handle first)MountWithUiAsync(id, async),MountWithUiResult(async, mount pointer)EnumeratePackages(kind, scope, context, callback)The class was refused, so every XPackage call through the thunks failed, including the identifier and mount-path queries a title makes at boot.
The change
A 41-entry vtable (IUnknown + 32 + 4 + 2). The slots with an offline answer forward to the XPackage functions already on
main(#1798's area), so the vtable and the named exports give the same answers:XPackageGetCurrentProcessPackageIdentifier, 4XPackageIsPackagedProcess, 25XPackageGetMountPath;XPackageGetUserLocale: the host user's locale name, withERROR_INSUFFICIENT_BUFFERon a short buffer;XPackageGetMountPathSize: exactly the size 25 needs, terminator included;XPackageCloseMountHandle: nothing to release offline.Every other slot (installation monitors, chunks, mount, enumeration, write stats, uninstall) logs its slot number once and returns
E_NOTIMPL. The first boot with the executable then shows which ones the title needs, instead of a blanket "class not provided".docs/runtime_imports.md: theXPackageImplrow lists the served slots.Tests
xgameruntime_test(+6, 80 total):IXPackageImpl3id;E_NOTIMPL.ctest -R "xgameruntime|tiny_gdk|loader": 6/6, Windows 11 / MSVC.Disclosure: written with an AI assistant (Claude Code). I reviewed it and ran the tests above.
🤖 Generated with Claude Code