xbtp: honor the session QueryInterface output contract #311
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!311
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/311/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?
@BaggyALPHA on GitHub · 2026-11-23 17:33 UTC · original
BaggyALPHA:fix/xbtp-session-queryinterface→main· +53 −0 · 1 files · 1 commits · closed without mergingThe XBTP client session's
QueryInterfacedereferences a null output address for a supported IID, and leaves the caller's previous output pointer intact when returningE_NOINTERFACEfor an unsupported IID.Validate the output address first, returning
E_POINTERwhen it is null, and clear the result before checking the IID. Successful queries retain the existing COM identity and add exactly one reference.Library / area:
xbtp,SessionImpl::QueryInterfaceand vtable regression tests.Exports changed (exports.txt rows): None.
Source of the behaviour: Microsoft's IUnknown::QueryInterface contract. The existing
DispatcherComimplementation in this repository already follows these output rules.Validation:
Three tests exercise the actual COM vtable: unsupported IID clears a pre-populated result without AddRef; null output addresses return
E_POINTERwithout AddRef; all supported IIDs preserve identity and balance AddRef/Release.The stale-output test fails before the fix and passes afterward. No pre-fix null-pointer crash was executed.
cargo test --locked -p xbtp --lib --test dispatch_link --test link_dev -- --test-threads=1: 120 unit tests and five integration tests passed.cargo check --locked -p xbtp --all-targets: passed.Contribution gate, whitespace check, and patch application check: passed.
Full default suite attempted:
cargo test --locked -p xbtp --no-fail-fast -- --test-threads=1. All 120 unit tests plusdispatch_link(1) andlink_dev(4) passed outside the Codex sandbox. The full command exits unsuccessfully because all threeconsole_fixedtests require unavailable console DLL fixtures (two require at least four images). The eightverify_oracletests report success after returning early without a console DLL; they are not console validation.No game or console files and no binaries included.
No fake success; no export status changes.
Related to #1. This fixes one documented COM error-handling contract; it does not claim to complete that issue or establish console/title compatibility. No console oracle was used, and existing tests that return early without reference fixtures are not evidence of console equivalence.
CI status: GitHub currently reports
action_requiredfor this PR’s workflow runs, with zero Rust jobs started. Maintainer action is still needed before upstream CI results are available. Local validation is not a substitute for successful required CI.@omonkeyz on GitHub · 2026-11-25 13:49 UTC · original
Applied on main in
74afeb3(cherry-picked onto the current history with your authorship kept; comment lines stripped per CONTRIBUTING). Thank you.Pull request closed