XNetworking: wire UDP port change callbacks and UTF-16 security queries #1248

Merged
ashrafsdrop merged 1 commit from upstream-pr/1248 into main 2026-11-25 00:13:37 +00:00
ashrafsdrop commented 2026-11-24 16:46:48 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ashrafsdrop on 2026-11-24T16:46:48Z.


Summary

Completes the remaining unimplemented slots in the XNetworking COM-style interface (Methods<18>):

  1. UDP Port Change Callbacks (Slots 6 & 7 / 0x30, 0x38):

    • Wired register (XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged) and unregister (XNetworkingUnregisterPreferredLocalUdpMultiplayerPortChanged).
    • The default local multiplayer UDP port (3074) is fixed offline, so registration tokens are allocated via token() and the callback never needs to fire, avoiding E_NOTIMPL when titles register for port changes during startup or socket binding.
  2. UTF-16 Security Queries (Slots 11, 12, 13 / 0x58, 0x60, 0x68):

    • Added security_info_utf16_async for XNetworkingQuerySecurityInformationForUrlUtf16Async, logging wide URLs and completing the async task with UNREACHABLE (0x800704CF), matching the UTF-8 version.
    • Wired security_info_size and security_info_result into slots 0x60 and 0x68.
  3. Tests:

    • Added unit test assertions covering registration/unregistration of port change callbacks and async resolution of UTF-16 security queries.

Verification

  • cargo test -p victory-hle passed (94 tests, 0 failures).
  • cargo clippy -p victory-hle passed with zero warnings.
  • cargo run -p xtask -- policy verified (154 files ok).
<!-- greyfinch-sync:Marvisak/VIctory:issue:6586853789 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1248). Originally posted by [ashrafsdrop](https://github.com/ashrafsdrop) on 2026-11-24T16:46:48Z. --- ### Summary Completes the remaining unimplemented slots in the `XNetworking` COM-style interface (`Methods<18>`): 1. **UDP Port Change Callbacks (Slots 6 & 7 / `0x30`, `0x38`)**: - Wired `register` (`XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged`) and `unregister` (`XNetworkingUnregisterPreferredLocalUdpMultiplayerPortChanged`). - The default local multiplayer UDP port (`3074`) is fixed offline, so registration tokens are allocated via `token()` and the callback never needs to fire, avoiding `E_NOTIMPL` when titles register for port changes during startup or socket binding. 2. **UTF-16 Security Queries (Slots 11, 12, 13 / `0x58`, `0x60`, `0x68`)**: - Added `security_info_utf16_async` for `XNetworkingQuerySecurityInformationForUrlUtf16Async`, logging wide URLs and completing the async task with `UNREACHABLE` (`0x800704CF`), matching the UTF-8 version. - Wired `security_info_size` and `security_info_result` into slots `0x60` and `0x68`. 3. **Tests**: - Added unit test assertions covering registration/unregistration of port change callbacks and async resolution of UTF-16 security queries. ### Verification - `cargo test -p victory-hle` passed (94 tests, 0 failures). - `cargo clippy -p victory-hle` passed with zero warnings. - `cargo run -p xtask -- policy` verified (154 files ok).
DenRakEiw commented 2026-11-24 17:04:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-24T16:56:48Z.

Review: APPROVED


Tested head 64a33ec (fast-forward on main ffe310e) on Windows 11 x64 (Rust 1.98.1 MSVC):

  • cargo test -p victory-hle: 94 passed, 0 failed (plus no_dll_planting: 1 passed)
  • cargo clippy -p victory-hle --all-targets: 0 warnings
  • cargo xtask policy: ok

Clean wiring of XNetworking UDP port-change callbacks and UTF-16 security queries. Approving.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6043697522 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1248#pullrequestreview-6043697522). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-24T16:56:48Z. **Review:** APPROVED --- Tested head `64a33ec` (fast-forward on `main` `ffe310e`) on Windows 11 x64 (Rust 1.98.1 MSVC): - `cargo test -p victory-hle`: **94 passed, 0 failed** (plus `no_dll_planting`: 1 passed) - `cargo clippy -p victory-hle --all-targets`: **0 warnings** - `cargo xtask policy`: ok Clean wiring of XNetworking UDP port-change callbacks and UTF-16 security queries. Approving. AI-assisted (Gemini 4 Neon).
mercuryVM commented 2026-11-24 18:04:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T17:40:02Z.

Review: APPROVED


Tested 64a33ec7 on Windows 11, RTX 5070, MSVC:

  • cargo test -p victory-hle passes on the head (94 passed).
  • Merged into our fork: workspace tests, shader tests and clippy -D warnings (default and all features) are all clean.

The change looks right:

  • XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged takes the same (queue, context, callback, token) arguments as the connectivity-hint registration, so reusing register/unregister at 0x30/0x38 fits.
  • Offline, the port never changes, so a callback that never runs is correct.
  • The UTF-16 security-information path reuses the size and result slots. That works because the async block finishes with UNREACHABLE either way.

Nit: the new test has a doubled blank line after the first Unregister assert, which rustfmt will collapse.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6044351799 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1248#pullrequestreview-6044351799). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T17:40:02Z. **Review:** APPROVED --- Tested 64a33ec7 on Windows 11, RTX 5070, MSVC: - `cargo test -p victory-hle` passes on the head (94 passed). - Merged into our fork: workspace tests, shader tests and `clippy -D warnings` (default and all features) are all clean. The change looks right: - `XNetworkingRegisterPreferredLocalUdpMultiplayerPortChanged` takes the same (queue, context, callback, token) arguments as the connectivity-hint registration, so reusing `register`/`unregister` at 0x30/0x38 fits. - Offline, the port never changes, so a callback that never runs is correct. - The UTF-16 security-information path reuses the size and result slots. That works because the async block finishes with `UNREACHABLE` either way. Nit: the new test has a doubled blank line after the first `Unregister` assert, which `rustfmt` will collapse. AI-assisted (Claude Code).
Zipettte commented 2026-11-24 18:06:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T17:59:27Z.


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

Tested with AI assistance (Claude).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139996916 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1248#issuecomment-7139996916). Originally posted by [Zipettte](https://github.com/Zipettte) on 2026-11-24T17:59:27Z. --- Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 64a33ec: `cargo test -p victory-hle` passes, 95 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
ashrafsdrop commented 2026-11-24 18:06:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ashrafsdrop on 2026-11-24T18:01:48Z.


Thanks @Zipettte for testing across AMD RDNA3 hardware! Great to see it clean across both NVIDIA and AMD setups.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7140054087 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/1248#issuecomment-7140054087). Originally posted by [ashrafsdrop](https://github.com/ashrafsdrop) on 2026-11-24T18:01:48Z. --- Thanks [@Zipettte](https://github.com/Zipettte) for testing across AMD RDNA3 hardware! Great to see it clean across both NVIDIA and AMD setups.
upstream-sync closed this pull request 2026-11-25 01:06:01 +00:00
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!1248
No description provided.