GameInput: next and previous readings of a disconnected device fail #428
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by marquezinii on 2026-11-24T03:15:45Z.
GetNextReadingandGetPreviousReadingwith 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
Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T05:11:44Z.
Review: APPROVED
Tested
a312333on Windows 11, RTX 5070, MSVC:cargo test --workspace --no-fail-fastpasses (265 passed, 0 failed).device == reference.devicecheck, soindexis the filtered device's slot. TheDEVICE_DISCONNECTEDresult matches whatcurrent_readingalready returns for a disconnected filter device.devicenull) are unchanged and can still walk the history of an unplugged device, which seems right since the docs only describe the filtered case.No issues found.
AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T03:32:50Z.
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).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:29:27Z.
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
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T10:01:38Z.
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
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.