Storage: a path buffer too small fails with E_FAIL, as on Xbox #371

Manually merged
github merged 1 commit from gh-pr/371/head into gh-pr/371/base 2026-11-26 04:01:21 +00:00
Owner

@⁠marquezinii on GitHub · 2026-11-24 02:43 UTC · original
marquezinii:fix/pls-path-small-buffer → main · +6 −0 · 1 files · 1 commits · merged 2026-11-24 08:06 UTC

XPersistentLocalStorageGetPath with a buffer smaller than the path returned HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) through put_string. The GDK reference says that is the PC result, and that Xbox devices get E_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 gets E_FAIL now. cargo test -p victory-hle passes.

https://learn.microsoft.com/gaming/gdk/docs/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetpath

**@⁠marquezinii** on GitHub · 2026-11-24 02:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/371) `marquezinii:fix/pls-path-small-buffer` → `main` · +6 −0 · 1 files · 1 commits · merged 2026-11-24 08:06 UTC `XPersistentLocalStorageGetPath` with a buffer smaller than the path returned `HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)` through `put_string`. The GDK reference says that is the PC result, and that Xbox devices get `E_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 gets `E_FAIL` now. `cargo test -p victory-hle` passes. https://learn.microsoft.com/gaming/gdk/docs/reference/system/xpersistentlocalstorage/functions/xpersistentlocalstoragegetpath
XPersistentLocalStorageGetPath documents E_FAIL for a pathSize smaller
than the path on Xbox devices; ERROR_INSUFFICIENT_BUFFER is the PC
result, which put_string gave us.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:01:19 +00:00
github manually merged commit 376b3cf178 into gh-pr/371/base 2026-11-26 04:01:21 +00:00
Author
Owner

@⁠jeremygold02 on GitHub · 2026-11-24 04:07 UTC · original

Thanks @⁠marquezinii for this platform-compatibility fix. I tested head 376b3cf1785380cc397fdf89027f46e3472a6b55 with:

cargo test --locked -p victory-hle --lib serves_a_drive_over_the_title_folder_and_its_quota -- --test-threads=1

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.

**@⁠jeremygold02** on GitHub · 2026-11-24 04:07 UTC · [original](https://github.com/Marvisak/VIctory/pull/371#issuecomment-7121728059) Thanks @⁠marquezinii for this platform-compatibility fix. I tested head `376b3cf1785380cc397fdf89027f46e3472a6b55` with: ``` cargo test --locked -p victory-hle --lib serves_a_drive_over_the_title_folder_and_its_quota -- --test-threads=1 ``` 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.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!371
No description provided.