HLE: preserve non-S_OK success HRESULTs in xasync::finished #2402

Manually merged
github merged 1 commit from github-bot/gh-2402 into main 2026-11-30 14:17:00 +00:00 AGit
Owner

@⁠fuzeofficlal on GitHub · 2026-11-29 12:44 UTC · original
fuzeofficlal:fix/hle-xasync-finished-status → main · +54 −16 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC

Summary

Ported from Marvisak/VIctory#3132 (52d69c7e24).

xasync::finished is documented to complete an AsyncBlock with the caller-supplied HRESULT and no payload, and XAsyncGetResultSize treats nonnegative statuses such as S_FALSE (1) as valid completion codes. Previously, finished mapped every nonnegative value to Ok(Vec::new()) in finished_with, whose OP_BEGIN handler overwrote every Ok result with S_OK (0), silently dropping S_FALSE and other positive HRESULT codes.

Changes

  • Extract finished_status shared by finished and finished_with in crates/victory-hle/src/modules/xasync.rs so finished preserves hr directly while finished_with(Ok(bytes)) continues to complete with S_OK.
  • Add modules::xasync::tests::finished_preserves_the_completion_status verifying S_FALSE, positive HRESULT, S_OK, and E_ABORT across XAsyncGetStatus, XAsyncGetResultSize, and XAsyncGetResult.

Verification

  • cargo test --locked -p victory-hle: all passing.
  • cargo clippy --locked -p victory-hle --all-targets -- -D warnings and --all-features: 0 warnings.
  • cargo xtask policy --staged: passed.
**@⁠fuzeofficlal** on GitHub · 2026-11-29 12:44 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2402) `fuzeofficlal:fix/hle-xasync-finished-status` → `main` · +54 −16 · 1 files · 1 commits · merged 2026-11-30 14:12 UTC ## Summary Ported from `Marvisak/VIctory#3132` (`52d69c7e24`). `xasync::finished` is documented to complete an `AsyncBlock` with the caller-supplied `HRESULT` and no payload, and `XAsyncGetResultSize` treats nonnegative statuses such as `S_FALSE` (`1`) as valid completion codes. Previously, `finished` mapped every nonnegative value to `Ok(Vec::new())` in `finished_with`, whose `OP_BEGIN` handler overwrote every `Ok` result with `S_OK` (`0`), silently dropping `S_FALSE` and other positive `HRESULT` codes. ## Changes - Extract `finished_status` shared by `finished` and `finished_with` in `crates/victory-hle/src/modules/xasync.rs` so `finished` preserves `hr` directly while `finished_with(Ok(bytes))` continues to complete with `S_OK`. - Add `modules::xasync::tests::finished_preserves_the_completion_status` verifying `S_FALSE`, positive `HRESULT`, `S_OK`, and `E_ABORT` across `XAsyncGetStatus`, `XAsyncGetResultSize`, and `XAsyncGetResult`. ## Verification - `cargo test --locked -p victory-hle`: all passing. - `cargo clippy --locked -p victory-hle --all-targets -- -D warnings` and `--all-features`: 0 warnings. - `cargo xtask policy --staged`: passed.
Ported from Marvisak/VIctory#3132 (52d69c7e24a4ebee7b35a5f5e541c205157af7d9).

Share an internal finished_status helper between finished and finished_with
so nonnegative success codes such as S_FALSE are preserved through
XAsyncGetStatus, XAsyncGetResultSize, and XAsyncGetResult instead of being
collapsed to S_OK.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 12:49:20 +00:00
Author
Owner

@⁠Dukestar69 on GitHub · 2026-11-29 12:46 UTC · original · approved these changes

Tested locally merged onto main (829188e9).

  • Merge: Clean merge in crates/victory-hle/src/modules/xasync.rs.
  • Tests: cargo test -p victory-hle --lib xasync passed (32 passed; 0 failed, including finished_preserves_the_completion_status and a_nonnegative_completion_still_returns_its_payload) with 0 warnings in victory-hle.

Clean HRESULT preservation fix for non-S_OK success codes in xasync::finished. LGTM.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

**@⁠Dukestar69** on GitHub · 2026-11-29 12:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2402#pullrequestreview-6102932365) · **approved these changes** Tested locally merged onto `main` (`829188e9`). - **Merge**: Clean merge in `crates/victory-hle/src/modules/xasync.rs`. - **Tests**: `cargo test -p victory-hle --lib xasync` passed (`32 passed; 0 failed`, including `finished_preserves_the_completion_status` and `a_nonnegative_completion_still_returns_its_payload`) with 0 warnings in `victory-hle`. Clean HRESULT preservation fix for non-`S_OK` success codes in `xasync::finished`. LGTM. Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
github manually merged commit 52327c7e50 into main 2026-11-30 14:17:00 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2402
No description provided.