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

Open
github-bot wants to merge 2 commits from github-bot/gh-884 into main AGit
Owner

@⁠sagouindupm on GitHub · 2026-11-25 11:45 UTC · original
sagouindupm:xgamesave-sync-and-enum → main · +315 −42 · 1 files · 2 commits · open

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.

**@⁠sagouindupm** on GitHub · 2026-11-25 11:45 UTC · [original](https://github.com/fxceless/victory-fork/pull/884) `sagouindupm:xgamesave-sync-and-enum` → `main` · +315 −42 · 1 files · 2 commits · open 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:53:09 +00:00
Author
Owner

@⁠avt0m4t48 on GitHub · 2026-11-25 13:36 UTC · original

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.

**@⁠avt0m4t48** on GitHub · 2026-11-25 13:36 UTC · [original](https://github.com/fxceless/victory-fork/pull/884#issuecomment-7164031267) 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.
Author
Owner

@⁠sagouindupm on GitHub · 2026-11-25 15:30 UTC · original

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.

**@⁠sagouindupm** on GitHub · 2026-11-25 15:30 UTC · [original](https://github.com/fxceless/victory-fork/pull/884#issuecomment-7166953635) 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/884/head:github-bot/gh-884'
git switch 'github-bot/gh-884'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-884'
git switch 'github-bot/gh-884'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-884'
git switch 'github-bot/gh-884'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-884'
git switch 'main'
git merge --squash 'github-bot/gh-884'
git switch 'main'
git merge --ff-only 'github-bot/gh-884'
git switch 'main'
git merge 'github-bot/gh-884'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.