HLE: implement blocking and prefix-enumeration XGameSave vtable slots #883

Open
sagouindupm wants to merge 2 commits from upstream-pr/884 into main
sagouindupm commented 2026-11-25 11:45:23 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by sagouindupm on 2026-11-25T11:45:23Z.


Implements the remaining six missing::<...> slots in crates/victory-hle/src/modules/xgamesave.rs matching the Microsoft GDK XGameSave API signatures:

Vtable slot Offset Method Shared helper
3 0x18 XGameSaveInitializeProvider (blocking) open_at (shared with initialize_async)
7 0x38 XGameSaveGetRemainingQuota (blocking) remaining_quota (shared with quota_async)
10 0x50 XGameSaveDeleteContainer (blocking) remove_container (shared with delete_async)
15 0x78 XGameSaveEnumerateContainerInfoByName Prefix filter over report, shared with enumerate_containers (0x70)
18 0x90 XGameSaveEnumerateBlobInfo Delegates to enumerate_blobs (0x98) with null prefix
27 0xd8 XGameSaveSubmitUpdate (blocking) Delegates directly to Update::submit

Verification

Run on Windows 11 Pro (x86_64-pc-windows-msvc, Rust 1.98.1):

  • cargo test --release -j 2 -p victory-hle -> 99 passed; 0 failed (lib) + 1 passed; 0 failed (no_dll_planting), including new modules::xgamesave::tests::blocking_and_prefix_methods_work covering all six vtable offsets (0x18, 0x38, 0x50, 0x78, 0x90, 0xd8), null/invalid arguments (E_INVALIDARG, INVALID_CONTAINER_NAME, NO_ACCESS), prefix filtering, blob enumeration, blocking submit, quota tracking, and deletion.
  • cargo clippy -j 2 -p victory-hle --all-targets --no-deps -- -D warnings -> 0 warnings, exit 0 (uses --no-deps because workspace dependency victory-gpu on f85101b has two pre-existing lints noted in #855).
  • cargo run -j 2 -p xtask -- policy -> asset policy: 175 files ok.

Note: Tested via synthetic unit tests in victory-hle; the new unit test validates all six slots end-to-end without requiring game files.

AI-assisted: code, tests, and PR description were written with AI assistance.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6603736070 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/884). Originally posted by [sagouindupm](https://github.com/sagouindupm) on 2026-11-25T11:45:23Z. --- Implements the remaining six `missing::<...>` slots in `crates/victory-hle/src/modules/xgamesave.rs` matching the Microsoft GDK `XGameSave` API signatures: | Vtable slot | Offset | Method | Shared helper | |---:|---:|---|---| | 3 | `0x18` | `XGameSaveInitializeProvider` (blocking) | `open_at` (shared with `initialize_async`) | | 7 | `0x38` | `XGameSaveGetRemainingQuota` (blocking) | `remaining_quota` (shared with `quota_async`) | | 10 | `0x50` | `XGameSaveDeleteContainer` (blocking) | `remove_container` (shared with `delete_async`) | | 15 | `0x78` | `XGameSaveEnumerateContainerInfoByName` | Prefix filter over `report`, shared with `enumerate_containers` (`0x70`) | | 18 | `0x90` | `XGameSaveEnumerateBlobInfo` | Delegates to `enumerate_blobs` (`0x98`) with `null` prefix | | 27 | `0xd8` | `XGameSaveSubmitUpdate` (blocking) | Delegates directly to `Update::submit` | ### Verification Run on Windows 11 Pro (x86_64-pc-windows-msvc, Rust 1.98.1): - `cargo test --release -j 2 -p victory-hle` -> **99 passed; 0 failed** (lib) + **1 passed; 0 failed** (`no_dll_planting`), including new `modules::xgamesave::tests::blocking_and_prefix_methods_work` covering all six vtable offsets (`0x18`, `0x38`, `0x50`, `0x78`, `0x90`, `0xd8`), null/invalid arguments (`E_INVALIDARG`, `INVALID_CONTAINER_NAME`, `NO_ACCESS`), prefix filtering, blob enumeration, blocking submit, quota tracking, and deletion. - `cargo clippy -j 2 -p victory-hle --all-targets --no-deps -- -D warnings` -> **0 warnings, exit 0** *(uses `--no-deps` because workspace dependency `victory-gpu` on `f85101b` has two pre-existing lints noted in #855)*. - `cargo run -j 2 -p xtask -- policy` -> **`asset policy: 175 files ok`**. *Note: Tested via synthetic unit tests in `victory-hle`; the new unit test validates all six slots end-to-end without requiring game files.* AI-assisted: code, tests, and PR description were written with AI assistance.
avt0m4t48 commented 2026-11-25 14:10:50 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T13:36:45Z.


I found one missing failure output in the blocking provider initializer on de1f1f0. The GDK declares its provider parameter _Outptr_result_nullonfailure_. This implementation returns the error from open_at() and leaves the caller's old output value in place. Microsoft API contract

I reproduced it through slot 0x18 on Windows with a synthetic storage root. Opening a valid root returns a provider. With an ordinary file blocking the next provider's path, the next call returns NO_ACCESS and leaves that earlier provider value in the output. Clearing out with put(out, std::ptr::null_mut()) in the Err(hr) arm passed the new failure test and the existing blocking/prefix test. Synthetic probe · Windows run

AI-assisted using Codex.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7164031267 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/884#issuecomment-7164031267). Originally posted by [avt0m4t48](https://github.com/avt0m4t48) on 2026-11-25T13:36:45Z. --- I found one missing failure output in the blocking provider initializer on `de1f1f0`. The GDK declares its provider parameter `_Outptr_result_nullonfailure_`. This implementation returns the error from `open_at()` and leaves the caller's old output value in place. [Microsoft API contract](https://learn.microsoft.com/en-us/gaming/gdk/docs/reference/system/xgamesave/functions/xgamesaveinitializeprovider?view=gdk-2510) I reproduced it through slot `0x18` on Windows with a synthetic storage root. Opening a valid root returns a provider. With an ordinary file blocking the next provider's path, the next call returns `NO_ACCESS` and leaves that earlier provider value in the output. Clearing `out` with `put(out, std::ptr::null_mut())` in the `Err(hr)` arm passed the new failure test and the existing blocking/prefix test. [Synthetic probe](https://github.com/avt0m4t48/victory-fork/commit/de7eb8b38cea712bc4d2cb4fe154e243903e28c3) · [Windows run](https://github.com/avt0m4t48/victory-fork/actions/runs/45624873259) AI-assisted using Codex.
sagouindupm commented 2026-11-25 16:12:52 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by sagouindupm on 2026-11-25T15:30:37Z.


Good catch @avt0m4t48! Fixed in 94061d07 (clear out to null_mut() on failure in initialize_at per _Outptr_result_nullonfailure_, plus regression test in blocking_and_prefix_methods_work).

Verified on Windows (cargo test --release -p victory-hle, clippy -D warnings, xtask policy).

AI-assisted: Gemini / Claude.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7166953635 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/884#issuecomment-7166953635). Originally posted by [sagouindupm](https://github.com/sagouindupm) on 2026-11-25T15:30:37Z. --- Good catch @avt0m4t48! Fixed in 94061d07 (clear `out` to `null_mut()` on failure in `initialize_at` per `_Outptr_result_nullonfailure_`, plus regression test in `blocking_and_prefix_methods_work`). Verified on Windows (`cargo test --release -p victory-hle`, `clippy -D warnings`, `xtask policy`). AI-assisted: Gemini / Claude.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/884:upstream-pr/884'
git switch 'upstream-pr/884'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/884'
git switch 'upstream-pr/884'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/884'
git switch 'upstream-pr/884'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/884'
git switch 'main'
git merge --squash 'upstream-pr/884'
git switch 'main'
git merge --ff-only 'upstream-pr/884'
git switch 'main'
git merge 'upstream-pr/884'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
fxceless/victory-fork!883
No description provided.