net: skip newer-Windows-only exports in only_loopback_is_reachable #152

Merged
Makto94 merged 2 commits from upstream-pr/152 into main 2026-11-24 07:52:07 +00:00
Makto94 commented 2026-11-24 00:59:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Makto94 on 2026-11-24T00:59:03Z.


Fixes #118.

only_loopback_is_reachable asserts that every HLE override names a real export of its host DLL. WinHttpGetProxySettingsEx is absent from Windows 10's winhttp.dll; the HLE supplies it itself (registry lookup runs before host resolution, lib.rs resolve), so the test panicked there for no real problem.

This adds a small allow-list of newer-Windows-only exports and skips them only when the host lacks them. Every other export is still checked, so a typo in an override name still fails the test (a blanket continue on any missing export would hide that).

Tested on Windows 11 with the pinned 1.98.1 toolchain:

  • cargo test -p victory-hle --lib → 86 passed, 0 failed
  • cargo clippy -p victory-hle --tests → no warnings in net.rs
  • rustfmt --check clean on net.rs

Not yet run on Windows 10 itself; the issue author's environment would confirm.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6572156219 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/152). Originally posted by [Makto94](https://github.com/Makto94) on 2026-11-24T00:59:03Z. --- Fixes #118. `only_loopback_is_reachable` asserts that every HLE override names a real export of its host DLL. `WinHttpGetProxySettingsEx` is absent from Windows 10's `winhttp.dll`; the HLE supplies it itself (registry lookup runs before host resolution, `lib.rs` `resolve`), so the test panicked there for no real problem. This adds a small allow-list of newer-Windows-only exports and skips them **only when the host lacks them**. Every other export is still checked, so a typo in an override name still fails the test (a blanket `continue` on any missing export would hide that). Tested on Windows 11 with the pinned 1.98.1 toolchain: - `cargo test -p victory-hle --lib` → 86 passed, 0 failed - `cargo clippy -p victory-hle --tests` → no warnings in `net.rs` - `rustfmt --check` clean on `net.rs` Not yet run on Windows 10 itself; the issue author's environment would confirm.
DaviTostes commented 2026-11-24 06:54:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DaviTostes on 2026-11-24T01:25:04Z.


Tested fff664d under Wine 11.22 + vkd3d-proton 3.1 (Arch Linux x86_64, AMD RX 9060 XT, RADV 26.3.1), Windows build of victory-hle: the Windows 10 case is fixed, but Wine still fails on a different export.

  • victory_hle: 85 passed, 1 failed. The failure is still only_loopback_is_reachable:
    ws2_32.dll lacks WSAConnectByList   (net.rs:1066)
    
    Wine's ws2_32 is missing WSAConnectByList, so the allow-list (WinHttpGetProxySettingsEx only) does not cover it. If keeping the HLE suite green under Wine matters, adding WSAConnectByList to NEWER_WINDOWS_ONLY would do it; the test correctly still catches the missing-export case on Windows.
  • No other regression in the suite.

No game data used.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7119079354 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/152#issuecomment-7119079354). Originally posted by [DaviTostes](https://github.com/DaviTostes) on 2026-11-24T01:25:04Z. --- Tested `fff664d` under **Wine 11.22 + vkd3d-proton 3.1** (Arch Linux x86_64, AMD RX 9060 XT, RADV 26.3.1), Windows build of `victory-hle`: **the Windows 10 case is fixed, but Wine still fails on a different export**. - `victory_hle`: **85 passed, 1 failed**. The failure is still `only_loopback_is_reachable`: ``` ws2_32.dll lacks WSAConnectByList (net.rs:1066) ``` Wine's `ws2_32` is missing `WSAConnectByList`, so the allow-list (`WinHttpGetProxySettingsEx` only) does not cover it. If keeping the HLE suite green under Wine matters, adding `WSAConnectByList` to `NEWER_WINDOWS_ONLY` would do it; the test correctly still catches the missing-export case on Windows. - No other regression in the suite. No game data used.
derinsh0 commented 2026-11-24 06:55:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by derinsh0 on 2026-11-24T01:59:12Z.


Can confirm this resolved an error with winhttp.dll on Windows 10.

Previous result:

failures:

---- modules::net::tests::only_loopback_is_reachable stdout ----

thread 'modules::net::tests::only_loopback_is_reachable' (7584) panicked at crates\victory-hle\src\modules\net.rs:1058:13:
winhttp.dll lacks WinHttpGetProxySettingsEx
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    modules::net::tests::only_loopback_is_reachable

test result: FAILED. 85 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.35s

Passes building the tests with these changes.

#256 is a dupe with a minor variation in implementation.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7119643467 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/152#issuecomment-7119643467). Originally posted by [derinsh0](https://github.com/derinsh0) on 2026-11-24T01:59:12Z. --- Can confirm this resolved an error with winhttp.dll on Windows 10. Previous result: ``` failures: ---- modules::net::tests::only_loopback_is_reachable stdout ---- thread 'modules::net::tests::only_loopback_is_reachable' (7584) panicked at crates\victory-hle\src\modules\net.rs:1058:13: winhttp.dll lacks WinHttpGetProxySettingsEx note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace failures: modules::net::tests::only_loopback_is_reachable test result: FAILED. 85 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.35s ``` Passes building the tests with these changes. #256 is a dupe with a minor variation in implementation.
erLCoder commented 2026-11-24 06:56:22 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by erLCoder on 2026-11-24T06:25:50Z.


Tested PR head 18b2716a2c on Windows 10 Enterprise 22H2 (winhttp.dll 10.0.19041.4522), Rust 1.98.1.

cargo test --offline --locked -p victory-hle --features diagnostics --lib -- --nocapture --test-threads=1 passed 86/86, including only_loopback_is_reachable, with no skipped or filtered tests. The prior upstream build had failed that test because WinHttpGetProxySettingsEx is missing on this Windows installation.

No game launch was involved. AI-assisted test report.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7123924213 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/152#issuecomment-7123924213). Originally posted by [erLCoder](https://github.com/erLCoder) on 2026-11-24T06:25:50Z. --- Tested PR head 18b2716a2c73e37ed8db346bcc3dcc0479f4b632 on Windows 10 Enterprise 22H2 (winhttp.dll 10.0.19041.4522), Rust 1.98.1. `cargo test --offline --locked -p victory-hle --features diagnostics --lib -- --nocapture --test-threads=1` passed 86/86, including `only_loopback_is_reachable`, with no skipped or filtered tests. The prior upstream build had failed that test because `WinHttpGetProxySettingsEx` is missing on this Windows installation. No game launch was involved. AI-assisted test report.
mercuryVM commented 2026-11-24 07:21:32 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by mercuryVM on 2026-11-24T07:21:32Z.

Review: COMMENTED


Tested 18b2716 on Windows 11, RTX 5070, MSVC. On this branch cargo test --workspace doesn't compile: E0428: the name tests is defined multiple times in crates/victory-gpu/src/host.rs. That is the duplicate test module #129 fixed on main after this branch was cut, so it is not caused by this change.

The logic is right. It skips the allow-listed export only when the host really lacks it, and still asserts everything else, so a typo in an override still fails. It is also slightly stricter than #349, which skips WinHttpGetProxySettingsEx even on a host that has it.

#349 and this PR fix the same #118 in the same lines and will conflict. #256 is a third attempt, and it makes the assert unreachable. Maintainers should pick one. Of the two correct ones, this one's "skip only if absent" is the better check.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:review:6035183920 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/152#pullrequestreview-6035183920). Originally posted by [mercuryVM](https://github.com/mercuryVM) on 2026-11-24T07:21:32Z. **Review:** COMMENTED --- Tested 18b2716 on Windows 11, RTX 5070, MSVC. On this branch `cargo test --workspace` doesn't compile: `E0428: the name tests is defined multiple times` in `crates/victory-gpu/src/host.rs`. That is the duplicate test module #129 fixed on main after this branch was cut, so it is not caused by this change. The logic is right. It skips the allow-listed export only when the host really lacks it, and still asserts everything else, so a typo in an override still fails. It is also slightly stricter than #349, which skips `WinHttpGetProxySettingsEx` even on a host that has it. #349 and this PR fix the same #118 in the same lines and will conflict. #256 is a third attempt, and it makes the assert unreachable. Maintainers should pick one. Of the two correct ones, this one's "skip only if absent" is the better check. AI-assisted (Claude Code).
upstream-sync closed this pull request 2026-11-24 08:01:52 +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!152
No description provided.