Skip to content

Game saves: names Windows does not keep as file names stay intact - #55

Merged
ivall merged 1 commit into
xcl-dev:mainfrom
gefydev:gamesave-windows-names
Nov 23, 2026
Merged

ivall merged 1 commit into
xcl-dev:mainfrom
gefydev:gamesave-windows-names

Conversation

@gefydev

@gefydev gefydev commented Nov 22, 2026

Copy link
Copy Markdown
Member

gamesave.rs turns container and blob names into file names with enc, 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, "..") runs remove_dir_all on gamesave\, deleting every provider's saves; "." deletes the whole provider.
  • Device names (aux, CON.dat, COM1, ...): the write opens the device and XGameSaveSubmitUpdate returns E_FAIL.
  • A trailing dot or space is dropped by Win32, so a blob written as save. is enumerated as save.

enc now escapes one more character for these (.. → %2E%2E, aux → %41ux, save. → save%2E). dec already reverses %XX, and every other name keeps the file name it had, so existing saves are still found.

Validation

  • New test names_windows_would_change_round_trip: containers aux, .. and slot., each with blobs aux, CON.dat, save. and save , all enumerate back with their names and sizes; deleting .. and . leaves the provider's folder. On main it fails at the first submit (E_FAIL for aux). Separately, on main, XGameSaveDeleteContainer(p, ".") removes the provider's folder.
  • cargo test -p xcl --lib: 340 passed, 0 failed, on Windows GNU under Wine.

Container and blob names become file names with only unusual characters
escaped, so some names reached the file system as names Windows treats
specially:

- "." and ".." were the provider's folder and its parent: deleting a
  container named ".." deleted every provider's saves, "." the whole
  provider.
- a device name (aux, CON.dat, COM1, ...) opened the device, so the
  write failed with E_FAIL.
- a trailing dot or space was dropped, so "save." came back as "save".

Such names now get one more character escaped (%XX), which the existing
decoding already reverses. Other names keep their file names, so
existing saves are found as before.
@ivall
ivall merged commit 331b734 into xcl-dev:main Nov 23, 2026
@ivall

ivall commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

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 to names_windows_would_change_round_trip.

Tested on Windows 11 (RX 9070): cargo test --workspace green (lib 351, e2e), and a 45 s Unicorn Overlord run on the release build (VFS hooks active, ~60 fps, clean exit). Thanks!

kacper-serewis pushed a commit to kacper-serewis/xcl that referenced this pull request Nov 24, 2026
…elta

A title's xcl-dev#31 is the PC's SetPredication (xcl-dev#55, `console_remap`), but no
XCL code ran on it: slot 31 was in neither `console_slots` nor
`NEWER_LIST_SLOTS`. XCL places some buffers below the title's address
and keeps the difference in `BUFFER_DELTA`; every other PC method that
takes a buffer offset adds `buffer_delta(res)` (ResolveQueryData,
CopyBufferRegion, CopyTextureRegion, ExecuteIndirect). SetPredication
did not, so after ResolveQueryData(heap, BINARY_OCCLUSION, i, 1, buf,
off) wrote the predicate at off + delta, SetPredication(buf, off, op)
read it at off.

`set_predication_x` adds the delta (a null buffer passes through) and
is installed at xcl-dev#31. Tests: with a delta of 0x200, xcl-dev#31 at offset 0x10
reaches the PC method at 0x210 (it reached it at 0x10 before), and
console slot 31 has the handler.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 449dcb4)
CalvyPZ pushed a commit to CalvyPZ/xcl that referenced this pull request Nov 24, 2026
…elta

A title's xcl-dev#31 is the PC's SetPredication (xcl-dev#55, `console_remap`), but no
XCL code ran on it: slot 31 was in neither `console_slots` nor
`NEWER_LIST_SLOTS`. XCL places some buffers below the title's address
and keeps the difference in `BUFFER_DELTA`; every other PC method that
takes a buffer offset adds `buffer_delta(res)` (ResolveQueryData,
CopyBufferRegion, CopyTextureRegion, ExecuteIndirect). SetPredication
did not, so after ResolveQueryData(heap, BINARY_OCCLUSION, i, 1, buf,
off) wrote the predicate at off + delta, SetPredication(buf, off, op)
read it at off.

`set_predication_x` adds the delta (a null buffer passes through) and
is installed at xcl-dev#31. Tests: with a delta of 0x200, xcl-dev#31 at offset 0x10
reaches the PC method at 0x210 (it reached it at 0x10 before), and
console slot 31 has the handler.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
CalvyPZ pushed a commit to CalvyPZ/xcl that referenced this pull request Nov 24, 2026
Adds host-driver parity and contract tests (without console game files)
covering ID3D12Device::CheckFeatureSupport (xcl-dev#13), CreateReservedResource
(xcl-dev#30), CreateReservedResource1 (xcl-dev#55), and GetResourceTiling (xcl-dev#42).

Verifies D3D12 feature queries, oversized/undersized buffer fallbacks,
console-only formats (116..=120), reserved resource creation and unknown
IID fallback, note_reserved Map(E_INVALIDARG), vram::place tiling parity,
and vendor-independent 64 KiB tiling invariants.

Part of xcl-dev#480

Assisted-by: Antigravity (model name not provided to agent)
emirduran707 added a commit to emirduran707/xcl that referenced this pull request Nov 25, 2026
…elta

A title's xcl-dev#31 is the PC's SetPredication (xcl-dev#55, `console_remap`), but no
XCL code ran on it: slot 31 was in neither `console_slots` nor
`NEWER_LIST_SLOTS`. XCL places some buffers below the title's address
and keeps the difference in `BUFFER_DELTA`; every other PC method that
takes a buffer offset adds `buffer_delta(res)` (ResolveQueryData,
CopyBufferRegion, CopyTextureRegion, ExecuteIndirect). SetPredication
did not, so after ResolveQueryData(heap, BINARY_OCCLUSION, i, 1, buf,
off) wrote the predicate at off + delta, SetPredication(buf, off, op)
read it at off.

`set_predication_x` adds the delta (a null buffer passes through) and
is installed at xcl-dev#31. Tests: with a delta of 0x200, xcl-dev#31 at offset 0x10
reaches the PC method at 0x210 (it reached it at 0x10 before), and
console slot 31 has the handler.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants