XGameSave: a container name too long for a folder gets a hashed one #488
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/493"
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 ivall/xcl. Originally posted by pablogonz12 on 2026-11-24T01:01:41Z.
A container's folder is
enc(name). A valid name has up to 256 characters, andencturns each escaped byte into three, so past 255 characters the folder cannot be created:XGameSaveCreateContainerreturnsS_OKand everyXGameSaveSubmitUpdateto that container fails withE_FAIL. Fixes #326.What is in it
crates/xcl/src/hle/xgameruntime/gamesave.rs:container_folder(name):enc(name)when it fits in 255 characters (so every folder that works today keeps its name); otherwise the start ofenc(name)(never cut inside a%XX),~and a 64-bit FNV-1a hash of the lowercase name.encnever writes~, so the two kinds never meet; the hash is of the lowercase name because container names match ignoring case, as theenc(name)folders do on NTFS.apply()writes the exact name to the folder'snamefile when the folder is a hashed one;each_containerreads it back throughcontainer_name(dir).XGameSaveCreateContainer,XGameSaveDeleteContainer(Async)usecontainer_folder.long_container_names_are_saved_listed_and_deleted: the two names from the issue (256 letters;"a/" × 85 + "x", 341 characters encoded) are written, read back, found byXGameSaveGetContainerInfoin upper case, listed byXGameSaveEnumerateContainerInfowith their exact names, and deleted; a 255-character name keeps its plain folder.Tested
cargo test -p xcl --lib --release --target x86_64-pc-windows-gnu(llvm-mingw 20261117), test binary run under Wine with--test-threads=4:820ff6a): 632 passed, 5 failed, 21 ignored;main(a6f5f7a): 631 passed, 5 failed, 21 ignored – the same five fail on both (gpu_f64_roots,gpu_f64_math_random,gpu_nonfused_mad_and_mac_prevent_fma_contraction,xma2_source_voice_decodes_and_manages_lifetime, andpe::tests::parses_own_test_binary_tls, which #464 fixes for this toolchain).cargo test ... gamesave: 11 passed. The new test onmain'sgamesave.rs(without its twocontainer_folderasserts): FAILED at the firstXGameSaveSubmitUpdate, as the issue describes.Regression run
Made with
scripts/linux/smoke.shfrom #257 under Wine (notsmoke.ps1), MSVC builds (cargo xwin) of both commits. Themainblock was made with a local copy of the script with two lines changed so that a run which does not reach its end still prints its block (set -euinstead ofset -euo pipefail; thedata:fallback as anif).Not tested
x86_64-pc-windows-gnuunder Wine on Linux (the Linux file system has the same 255-byte limit on a name).AI use
Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-24T01:01:50Z.
Closing: duplicate of #481 (and #492), which were opened before this one for the same issue. Sorry for the noise.
Pull request closed