GameInput: next and previous readings of a disconnected device fail #428
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!428
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-428"
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?
@marquezinii on GitHub · 2026-11-24 03:15 UTC · original
marquezinii:fix/gameinput-walk-disconnected→main· +25 −0 · 1 files · 1 commits · openGetNextReadingandGetPreviousReadingwith a device filter kept walking a device's history after it was unplugged. Both reference pages say the call "Returns aNULLvalue and failureHRESULTif [...] a device filter is provided for a disconnected device", andGetCurrentReadinghere already returnsGAMEINPUT_E_DEVICE_DISCONNECTEDin that case.With the old code, Next returned
GAMEINPUT_E_READING_NOT_FOUNDand Previous an old reading. The polling loop on those pages keeps going onREADING_NOT_FOUNDand resets only on another failure, so a title written that way never noticed the pad was gone.relativenow fails withDEVICE_DISCONNECTEDwhen a device is given and its slot is not connected, ascurrent_readingdoes. Without a device filter nothing changes.Tested with a new test that walks forward and back from a pad's reading after the fake host drops the pad: before the change it gets
READING_NOT_FOUND, nowDEVICE_DISCONNECTEDboth ways.cargo test -p victory-hlepasses and clippy reports nothing new. Not tried with a real pad being unplugged.https://learn.microsoft.com/gaming/gdk/docs/reference/input/gameinput/interfaces/igameinput/methods/igameinput_getnextreading
@DaviTostes on GitHub · 2026-11-24 03:32 UTC · original
Verified
a312333on Arch Linux x86_64 with the Windows build under Wine 11.22 (cargo xwin,x86_64-pc-windows-msvc, release, rustc 1.98.1):victory-hle: 86 passed, 1 failed. The failure ismodules::net::tests::only_loopback_is_reachable— the known WineWSAConnectByListenvironment gap (#217), not this change.walks_filtered_by_a_disconnected_pad_failpasses.no_dll_planting: 1 passed.gameinput.rs):git merge-tree --write-tree 191e335 a312333merges cleanly.Not covered: a physical pad disconnect during polling, and title behaviour (no game data on this machine).
@Marvisak on GitHub · 2026-11-25 00:29 UTC · original · edited 2026-11-25 01:16 UTC
Automated triage for the maintainers.
Needs rebase. This pull request conflicts with
main(conflicting:crates/victory-hle/src/modules/gameinput.rs). It will be reviewed once it is rebased onto the currentmain.Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 10:01 UTC · original
I rebased your disconnected-device fix on current main (
940d32f) inf023c6c. The conflict was around the history scan changed by #361. Your guard and regression are preserved, along with your Git author. The disconnected-pad test passes on Windows.The rebase also exposed a separate case. A reference reading marks a position in the stream. A caller can filter the returned readings to a device, as documented in GameInput readings. With two synthetic pads sampled in one poll,
940d32fandf023c6cboth returnE_INVALIDARGwhen the filter names the other pad. The separate366ca98selects readings from the requested pad in both directions. The original disconnected-pad test still passes.The combined branch passes all 10 GameInput tests and all 145
victory-hlelibrary tests on native Windows, plus strict Clippy and staged asset policy. You can takef023c6cby itself if you want to keep this PR focused on disconnects. If you fold in the separate filter change, please retainCo-authored-by: andrewpozdnakov7-jpg <[email protected]>.Filter coordination claim
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.