hle: return S_OK with null handle when PowerSetRequest returns ERROR_NOT_SUPPORTED #1664
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1664
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1664/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Satanyuga on GitHub · 2026-11-24 20:34 UTC · original
Satanyuga:fix/display-deferral-not-supported→main· +64 −7 · 1 files · 1 commits · closed without mergingFixes issue #727: program crashed on Windows
ERROR_NOT_SUPPORTED(0x32) fromPowerSetRequestinacquire_deferral.Changes:
map_power_set_request_error(hr, out):hr == NOT_SUPPORTED(0x8007_0032), writesnulltooutviaput()and returnsS_OK.outuntouched (COM rules).handle_power_set_request_failurecloses the request handle and delegates to the helper, passing theoutpointer — eliminates UB from uninitializedoutonS_OKreturn.acquire_deferralcalls the new helper onPowerSetRequestfailure.Tests added (all passing):
error_not_supported_returns_ok_with_null_handle— callsmap_power_set_request_error(NOT_SUPPORTED, &mut out)and assertshr == S_OK+out.is_null(), plus verifiesE_FAILleavesoutuntouched (sentinel preserved).close_deferral_safely_ignores_null_handle— verifiesclose_deferralno-ops on null handle.Verified:
cargo test -p victory-hle— 96 tests passcargo clippy -p victory-hle --all-targets -- -D warnings— 0 warnings, 0 errors@acetonahard-code on GitHub · 2026-11-24 22:10 UTC · original
Heads-up: #1155 (opened about four hours earlier) also says it fixes #727, the
PowerSetRequestERROR_NOT_SUPPORTEDfailure inacquire_deferral. The two conflict indisplay.rs, so only one can land as-is.Tested on Windows 11 with the repo toolchain, merged into current
main(70564ae):cargo test -p victory-hlemainmain+ this PRcargo clippy --all-targets -- -D warnings, with and without--all-features: clean.I didn't test with game data.
Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.
@Marvisak on GitHub · 2026-11-25 01:23 UTC · original
Automated triage for the maintainers. Closing because another open pull request covers the same change.
See #1155. Same fix for #727 as #1155, but it hands the title S_OK with a null handle; #1155's non-null no-op handle is the safer form of the same idea.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed