Game saves: names Windows does not keep as file names stay intact #54
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/55"
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 gefydev on 2026-11-22T22:50:02Z.
gamesave.rsturns container and blob names into file names withenc, which only escapes characters outside[A-Za-z0-9._- ]. Some names that pass through unchanged are ones Windows treats specially:"."and"..":pr.root.join(enc(name))is the provider's folder or its parent.XGameSaveDeleteContainer(p, "..")runsremove_dir_allongamesave\, deleting every provider's saves;"."deletes the whole provider.aux,CON.dat,COM1, ...): the write opens the device andXGameSaveSubmitUpdatereturnsE_FAIL.save.is enumerated assave.encnow escapes one more character for these (..→%2E%2E,aux→%41ux,save.→save%2E).decalready reverses%XX, and every other name keeps the file name it had, so existing saves are still found.Validation
names_windows_would_change_round_trip: containersaux,..andslot., each with blobsaux,CON.dat,save.andsave, all enumerate back with their names and sizes; deleting..and.leaves the provider's folder. Onmainit fails at the first submit (E_FAILforaux). Separately, onmain,XGameSaveDeleteContainer(p, ".")removes the provider's folder.cargo test -p xcl --lib: 340 passed, 0 failed, on Windows GNU under Wine.Imported from ivall/xcl. Originally posted by ivall on 2026-11-23T09:45:14Z.
Merged (
331b734). On top (ff5c940): a device name with spaces before its extension (nul .txt) is escaped too – Win32 drops trailing spaces of the base; added tonames_windows_would_change_round_trip.Tested on Windows 11 (RX 9070):
cargo test --workspacegreen (lib 351, e2e), and a 45 s Unicorn Overlord run on the release build (VFS hooks active, ~60 fps, clean exit). Thanks!