XGameSave: a save whose blob path passes MAX_PATH fails (MoveFileExW without the verbatim prefix) #722
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#722
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@lordon1a on GitHub · 2026-11-24 04:04 UTC · original
replace_file(crates/xcl/src/hle/xgameruntime/gamesave.rs) passes the plain paths toMoveFileExW. Unless a path is in its\\?\form,MoveFileExWrefuses it once it reaches 260 characters, withERROR_PATH_NOT_FOUND(3). The temp file written just before it goes throughstd::fs, which adds\\?\itself. So the write works and only the final move fails, and every save to such a container returnsE_FAIL.With the data folder under
%LOCALAPPDATA%\XCL\<title>\gamesave\<id>\, a blob path passes 260 characters at a container name of about 170 characters. The GDK allows 256. This is separate from #326: the hashed folders in #481 / #492 start only past 200 characters ofenc(name), so names of roughly 170–200 characters still fail. I checked this on each of those PRs merged withmainf4ce27c: a 190-character container name gives a 267-character container folder in the test data folder, andXGameSaveSubmitUpdatereturnsE_FAIL.Measured on
main, in a unit test (same folder, same temp file):Failing test (in
gamesave.rs'smod tests):On
mainit fails withleft: -2147467259(E_FAIL).Proposed fix: give both paths their
\\?\form (or\\?\UNC\for a share) before the call:Branch with the test and the fix, one commit on
mainf4ce27c: https://github.com/lordon1a/xcl/tree/gamesave-long-pathWith the fix, the new test passes, and so does a save through the API (
XGameSaveCreateContainerwith a 190-character name, a blob write,XGameSaveSubmitUpdatereturnsS_OK).cargo test -p xcl --lib -- --test-threads=4gives 661 passed, 0 failed, 21 ignored. The fix touches the same function as #543 (#324) but not the same lines, so whichever lands second needs a small rebase.Tested
x86_64-pc-windows-gnullvm, debug,--libtests onlyNot tested
cargo test --workspace\\?\UNC\branch is not exercised)scripts/smoke.ps1: I have no title. This is a runtime change, so a PR needs someone who can make the twoxcl-smokeblocks; the branch is ready for that.AI use
mainand passing with the fix.@ldeep98154deep-jpg on GitHub · 2026-11-24 04:13 UTC · original
Claiming this