Storage: a path buffer too small fails with E_FAIL, as on Xbox #371
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/371"
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?
Imported from Marvisak/VIctory. Originally posted by marquezinii on 2026-11-24T02:43:00Z.
XPersistentLocalStorageGetPathwith a buffer smaller than the path returnedHRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)throughput_string. The GDK reference says that is the PC result, and that Xbox devices getE_FAIL: "If the function fails because pathSize is less than the length of the PLS path, the return value is set to E_FAIL for Xbox devices and to HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) for PC devices."Slot 0x20 is the one Grand Theft Auto VI calls, so this answers as the console would.
Tested: the existing storage test now also asks with a 3-byte buffer for
X:\; it got 0x8007007A before the change and getsE_FAILnow.cargo test -p victory-hlepasses.https://learn.microsoft.com/gaming/gdk/docs/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetpath
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T06:40:41Z.
Review: APPROVED
Tested
376b3cfon Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (264 passed, 0 failed).size <= path.len()is the right bound, since the path needslen + 1bytes with its NUL. That matchesput_string's own check, so an exact fit still succeeds. The doc quote supportsE_FAILfor Xbox.put_stringwrite the required size throughusedon a short buffer. This earlyE_FAILreturn bypasses that, so for this one getterusedstays untouched on failure. That seems fine, since titles size this buffer throughXPersistentLocalStorageGetPathSize(path_size), but it is a small inconsistency if both land.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-24T04:07:27Z.
Thanks @marquezinii for this platform-compatibility fix. I tested head
376b3cf1785380cc397fdf89027f46e3472a6b55with:Result: 1 passed, 0 failed (85 filtered out). The storage-object test now covers a too-small path buffer returning
E_FAIL, alongside the drive-root path and quota behavior. This is a unit test of the HLE object; I did not exercise a title call.