Repository navigation
Conversation
QueryApiImpl now hands out XPersistentLocalStorageImpl for its class id, which is IXPersistentLocalStorageImpl's interface id (xgameruntime-docs, facts only). The vtable follows the documented v1 order after IUnknown: GetPathSize, GetPath, GetSpaceInfo, PromptUserForSpaceAsync, PromptUserForSpaceResult, with signatures from Microsoft's public XPersistentLocalStorage reference. Only v1 is served. The layouts of IXPersistentLocalStorageImpl2 and 3 are unknown, and guessing their slots could crash a title where today it gets a clean refusal, so QueryApiImpl still logs and refuses those two (HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED)), as before. Other classes are dispatched exactly as before. - Folder: <overlay>\PersistentLocalStorage, created on the first GetPath or GetSpaceInfo. The overlay already holds everything a run writes, so the package is never modified. Without a configured overlay the calls fail with ERROR_PATH_NOT_FOUND. - GetPathSize and GetPath's pathUsed count the terminating NUL; a short buffer gets ERROR_INSUFFICIENT_BUFFER; pathUsed may be null. The path is in the ANSI code page, the one the file shims' *A functions widen with. - GetSpaceInfo: totalBytes is a 2048 MB quota (the size the package declares; the runtime doesn't parse MicrosoftGame.config), usedBytes the folder's files, totalFreeBytes the volume's free space, and availableFreeBytes the smaller of the free quota and that space. - The two PromptUserForSpace calls return E_NOTIMPL synchronously and log once: Microsoft documents them as not implemented on PC. - Null out pointers give E_INVALIDARG, as the neighbouring classes do. registry.cpp: XPersistentLocalStorage joins kXFamilies, since all five of its functions return HRESULT, so LEONIDA_UNIMPLEMENTED=fail answers E_NOTIMPL for an unbound import instead of S_OK with the buffer unwritten. No other name changes class. Tests: xgameruntime_test checks that v1 is served and v2/v3 are still refused, that GetPathSize and GetPath agree, that the folder exists, the short-buffer error and the null pathUsed, that GetSpaceInfo's fields are consistent, the E_NOTIMPL prompts and the null-argument refusals. unimplemented_policy_test checks the new classification. Full ctest (RelWithDebInfo, Ninja, MSVC 2022): 123/123 on main and 123/123 with this change (8 skipped in both, the same 8). AI-assisted.
kacper-serewis
left a comment
There was a problem hiding this comment.
At 4eb899f, runtime/shims/xgameruntime.cpp:806 stops directory traversal on iterator error and returns the subtotal. GetSpaceInfo at line 825 then reports S_OK with a potentially understated usedBytes. Please propagate enumeration errors as a failing HRESULT and add coverage for an unreadable subtree. This finding is from source inspection. Three targeted Windows x64 tests passed with MSVC 19.50 and SDK 10.0.26100.0, including ordinary file accounting. Private vtable order remains unverified against a retail caller. AI-assisted, synthetic CPU validation.
…d#3471) Another contributor claimed XPersistentLocalStorageImpl first (RT-219, ItsNotRexed#3471), so this branch no longer serves it: its vtable, object and QueryApiImpl entry, its xgameruntime_test checks and its docs/runtime_imports.md row go, and file_system.cpp/.h, file_system_test.cpp and CMakeLists.txt are back to main's content (the .gta6rt-pls listing filter and the extra file_system.cpp in xgameruntime_test only served the storage class). XGameRuntimeFeatureImpl keeps the class id in its table, so XGameRuntimeIsFeatureAvailable(XPersistentLocalStorage) follows QueryApiImpl: false now, true once the class is served. The test checks it with the other features that follow their class. XGameRuntimeFeatureImpl, XGameEventImpl, XSystemAnalyticsImpl and XDisplayImpl are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Code review of 4eb899f, about the interface versions (read only; I didn't build it). The PR keeps v2 and v3 refused because xgameruntime-docs leaves their slots unknown. A second source pins them down: the LGPL xgameruntime IDL (xodus-gaming/xgameruntime, So in that IDL, v2 adds no slot and v3 appends A suggestion, if you agree with the IDL as a source: answer for v2 and v3 too, with slot 8 as AI-assisted review (Claude Code). |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head merged with main f847748, MSVC 14.51):
Only these two tests were built and run, not the full ctest. No concerns. |
|
Correction to my comment above: after comparing the two sources across classes, the Wine IDL turns out to leave out methods xgameruntime-docs marks AI-assisted review (Claude Code). |
|
Windows + GPU check: AMD Radeon RX 9070 (RDNA4), Windows 11, MSVC Release, Vulkan SDK 1.4.363. Tested head 4eb899f merged onto AI-assisted (Claude Code); runs on my machine. |
|
This cannot merge as-is: runtime/shims/xgameruntime.cpp conflicts with current main, and the resolution is the interesting part — main already resolved RT-219 in 4c52ce2 (XPersistentLocalStorageImpl served from \persistent, with the Impl2/Impl3 interface ids and MountForPackage). Both sides define the same four pls_get_path* functions and a second object answering the same class id, so keeping both after the marker conflict simply will not compile. Since the underlying issue is fixed on main with broader interface coverage than this PR's v1-only class, this reads as superseded — reasonable to close as a duplicate. Thanks anyway, and sorry it got scooped. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
|
Closing as superseded: |
Item: RT-219 (claim), from kotorvr's finding.
QueryApiImplnow servesXPersistentLocalStorageImplfor interface version 1 only:f4faf4d4-…, thenGetPathSize,GetPath,GetSpaceInfo,PromptUserForSpaceAsyncandPromptUserForSpaceResultat slots 3–7.0x80070032as before. Their layouts are documented as unknown (v3 addsMountForPackageat an unknown slot), and a guessed slot could crash a title that today gets a clean refusal.Limit, stated up front: none of the package's DLLs ask for v1.
libHttpClient.GDK.dllonly carries v3's id. So this code runs only if the game's executable asks for v1, and which version it asks for will show in the first boot'sQueryApiImpllog (RT-5). It changes nothing for the other classes.Behaviour
<overlay>\PersistentLocalStorage, where every write of a run already goes (--overlay, default<game-dir>\overlay). It's created on the firstGetPathorGetSpaceInfo. Without an overlay, the calls returnHRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND)instead of writing elsewhere.GetPathSize/GetPath: the size includes the terminating NUL.pathUsed, which is optional, is the same count, asXPackageGetMountPathSizedoes. A buffer that's too small givesHRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), the PC answer. The path is in the ANSI code page, like the file shims'*Afunctions.GetSpaceInfo:MicrosoftGame.configyet.usedBytesis the folder's file sizes;totalFreeBytesis the volume's free space;availableFreeBytesis the smaller of the free quota and the free disk space.E_NOTIMPL, logged once, because Microsoft documents them as not implemented on PC.E_INVALIDARG.registry.cpp:XPersistentLocalStoragejoinskXFamilies, soLEONIDA_UNIMPLEMENTED=failno longer answersS_OKwith the buffer unwritten. No other name changes classification.Tests
xgameruntime_test: a newcheck_persistent_local_storagewith 13 checks covering:pathUsedmay be null;unimplemented_policy_test: the new family's classification.ctestonmainf847748cgives 123 tests (115 passed, 8 skipped, 0 failed), and with this change the same 123 with identical status.xgameruntime_testpasses 108 checks andunimplemented_policy_test97. Windows 11, MSVC 19.44, Ninja RelWithDebInfo. No GPU involved.Not verified: the slot order from a measured call (no thunk in the package uses this class); whether the real runtime adds a trailing backslash (this doesn't); and the 2048 MB against the package itself. Open #2203 and #2218 also edit
xgameruntime.cpp; this keeps to its own section plus one case inQueryApiImpl, so a rebase of either should be small.AI-assisted (Claude Code).