hle(display): fall back to no-op deferral when PowerSetRequest returns ERROR_NOT_SUPPORTED #1155

Closed
github-bot wants to merge 1 commit from gh-pr/1155/head into gh-pr/1155/base
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-24 16:16 UTC · original
geiyiliyabumo:fix/display-deferral-not-supported → main · +102 −12 · 1 files · 1 commits · closed without merging

Summary

Fixes #727

Full verification details and change notes are documented in #727 (commit 5c37528, based on main ffe310e).

 crates/victory-hle/src/modules/display.rs | 114 ++++++++++++++++++++++++++----
 1 file changed, 102 insertions(+), 12 deletions(-)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 16:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/1155) `geiyiliyabumo:fix/display-deferral-not-supported` → `main` · +102 −12 · 1 files · 1 commits · closed without merging ### Summary Fixes #727 Full verification details and change notes are documented in #727 (commit `5c37528`, based on `main` `ffe310e`). ```text crates/victory-hle/src/modules/display.rs | 114 ++++++++++++++++++++++++++---- 1 file changed, 102 insertions(+), 12 deletions(-) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:21:29 +00:00
github-bot closed this pull request 2026-11-26 04:21:29 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:01 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 5c37528: cargo test -p victory-hle passes, 98 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 18:01 UTC · [original](https://github.com/Marvisak/VIctory/pull/1155#issuecomment-7140039124) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 5c37528: `cargo test -p victory-hle` passes, 98 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:19 UTC · original

Automated triage for the maintainers.

Merge candidate. This fixes #727. On some hosts (headless sessions, RDP, no display route), PowerSetRequest(…, PowerRequestDisplayRequired) fails with ERROR_NOT_SUPPORTED, so acquire_deferral in crates/victory-hle/src/modules/display.rs failed and sdr_and_display_deferrals failed with it.

Now finish_failed_deferral closes the request in every failure case. For ERROR_NOT_SUPPORTED only, it logs once and returns S_OK with a non-null sentinel handle. close_deferral_with skips the OS calls for that sentinel and for null. Every other error still returns HRESULT_FROM_WIN32, with GetLastError read before CloseHandle. The three new tests use closures in place of the OS calls, so they pass on any host.

This overlaps #1664. That PR hands back a null handle with S_OK, which a title may treat as a failure. The sentinel here is the safer choice, and this branch merges cleanly.

CI: not run.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/1155#issuecomment-7149433926) <!-- victory-triage v1 head=5c375286acb5e42f9a620a40fdf0f588a8b83d00 verdict=merge-candidate at=2026-11-25T01:19:39Z --> Automated triage for the maintainers. **Merge candidate.** This fixes #727. On some hosts (headless sessions, RDP, no display route), `PowerSetRequest(…, PowerRequestDisplayRequired)` fails with `ERROR_NOT_SUPPORTED`, so `acquire_deferral` in `crates/victory-hle/src/modules/display.rs` failed and `sdr_and_display_deferrals` failed with it. Now `finish_failed_deferral` closes the request in every failure case. For `ERROR_NOT_SUPPORTED` only, it logs once and returns `S_OK` with a non-null sentinel handle. `close_deferral_with` skips the OS calls for that sentinel and for null. Every other error still returns `HRESULT_FROM_WIN32`, with `GetLastError` read before `CloseHandle`. The three new tests use closures in place of the OS calls, so they pass on any host. This overlaps #1664. That PR hands back a null handle with `S_OK`, which a title may treat as a failure. The sentinel here is the safer choice, and this branch merges cleanly. CI: not run. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 21:59 UTC · original

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because the issue it fixes (#727, the unit test failing on hosts that refuse display power requests) was fixed in main by efe102ed, and the runtime change makes no difference to the title: its one acquire site ignores the returned HRESULT and its one close site only closes a non-null handle, so a failed acquire already ends in a skipped close. Merged with main it also leaves the NOT_SUPPORTED arm of sdr_and_display_deferrals unreachable.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 21:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1155#issuecomment-7175795531) Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because the issue it fixes (#727, the unit test failing on hosts that refuse display power requests) was fixed in `main` by efe102ed, and the runtime change makes no difference to the title: its one acquire site ignores the returned HRESULT and its one close site only closes a non-null handle, so a failed acquire already ends in a skipped close. Merged with `main` it also leaves the NOT_SUPPORTED arm of `sdr_and_display_deferrals` unreachable. If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

Pull request closed

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/Marvisak--VIctory!1155
No description provided.