HLE: WSAConnectByList and GetAddrInfoExA fail where the host lacks them, not abort (Wine) #2249

Open
github-bot wants to merge 1 commit from github-bot/gh-2249 into main AGit
Owner

@⁠desplmfao on GitHub · 2026-11-25 08:49 UTC · original
desplmfao:port/slak-net → main · +50 −3 · 1 files · 1 commits · open

This is commit d469fe9 from @⁠Slaktarn700's proton-fixes branch, carried onto current main (940d32f). Their commit keeps them as author. That branch was never opened upstream; this is the one change from it that main still needs.

Problem

net.rs calls WSAConnectByList and GetAddrInfoExA through host!, and host! panics when the host DLL lacks the export (files.rs). Wine's ws2_32.dll doesn't export these two, so a title calling either one under Wine/Proton ends with "the host lacks ws2_32.dll!…" instead of getting an error back.

Change

Where the host lacks either function, the call now fails cleanly:

  • WSAConnectByList returns failure with WSAEOPNOTSUPP.
  • GetAddrInfoExA takes main's blocked_lookup(result) path, so *result is cleared the same way as for any other blocked lookup.

On Windows hosts that have the exports, nothing changes.

Tested

  • cargo test -p victory-hle net:: (Windows x64, under Proton here): 2 passed. The export check is inside only_loopback_is_reachable.
  • cargo clippy -p victory-hle --all-targets -- -D warnings: clean.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠desplmfao** on GitHub · 2026-11-25 08:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/2249) `desplmfao:port/slak-net` → `main` · +50 −3 · 1 files · 1 commits · open This is commit `d469fe9` from @⁠Slaktarn700's [`proton-fixes`](https://github.com/Slaktarn700/VIctory/commits/proton-fixes/) branch, carried onto current `main` (`940d32f`). Their commit keeps them as author. That branch was never opened upstream; this is the one change from it that `main` still needs. ## Problem `net.rs` calls `WSAConnectByList` and `GetAddrInfoExA` through `host!`, and `host!` panics when the host DLL lacks the export (`files.rs`). Wine's `ws2_32.dll` doesn't export these two, so a title calling either one under Wine/Proton ends with "the host lacks ws2_32.dll!…" instead of getting an error back. ## Change Where the host lacks either function, the call now fails cleanly: - `WSAConnectByList` returns failure with `WSAEOPNOTSUPP`. - `GetAddrInfoExA` takes `main`'s `blocked_lookup(result)` path, so `*result` is cleared the same way as for any other blocked lookup. On Windows hosts that have the exports, nothing changes. ## Tested - `cargo test -p victory-hle net::` (Windows x64, under Proton here): 2 passed. The export check is inside `only_loopback_is_reachable`. - `cargo clippy -p victory-hle --all-targets -- -D warnings`: clean. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Wine's ws2_32 exports neither; a title calling them panicked in the host!
lookup and aborted. The overrides now fail the call (WSAEOPNOTSUPP, or the
name is not found), and the export test skips them where they are missing.

Co-Authored-By: slaktarn <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:59:52 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 12:42 UTC · original

Automated triage for the maintainers.

Merge candidate. In crates/victory-hle/src/modules/net.rs, WSAConnectByList and GetAddrInfoExA now look up their host function once. Where the host lacks it (Wine's ws2_32), they fail the call instead of the process aborting in host!: WSAEOPNOTSUPP for the connect, and blocked_lookup (name not found) for the lookup.

This does not loosen the offline guards. Both overrides still run their existing checks first (the loopback-only connect check, resolvable), and the new fallback only fails calls. The export test skips these two only when the host lacks them, so Windows still requires them. CI check passes, and the branch merges cleanly.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 12:42 UTC · [original](https://github.com/Marvisak/VIctory/pull/2249#issuecomment-7162753678) <!-- victory-triage v1 head=3cd19eb6311805c491814aacedc63b740b0d1247 verdict=merge-candidate at=2026-11-25T12:45:00Z --> Automated triage for the maintainers. **Merge candidate.** In `crates/victory-hle/src/modules/net.rs`, `WSAConnectByList` and `GetAddrInfoExA` now look up their host function once. Where the host lacks it (Wine's `ws2_32`), they fail the call instead of the process aborting in `host!`: `WSAEOPNOTSUPP` for the connect, and `blocked_lookup` (name not found) for the lookup. This does not loosen the offline guards. Both overrides still run their existing checks first (the loopback-only connect check, `resolvable`), and the new fallback only fails calls. The export test skips these two only when the host lacks them, so Windows still requires them. CI `check` passes, and the branch merges cleanly. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠ntgata1-dotcom on GitHub · 2026-11-25 13:19 UTC · original

Wine 11.22: the export test passes, and both fallbacks work as described

Arch Linux, system Wine 11.22, at 3cd19eb. cargo xwin test --locked --no-fail-fast --target x86_64-pc-windows-msvc -p victory-hle --lib, runner wine. Wine 11.22's ws2_32.dll exports WSAConnectByNameA and GetAddrInfoExW, but not WSAConnectByList or GetAddrInfoExA.

victory-hle under Wine passed failed
main 940d32f 141 2
this PR 142 1
  • only_loopback_is_reachable passes. On main it fails at ws2_32.dll lacks WSAConnectByList. The one left is xgamesave::tests::a_kept_blob_past_the_link_limit_is_copied, which also fails on main (the temp folder isn't NTFS here).
  • No test reaches the new fallbacks: blocked_name_lookups_clear_the_result uses a blocked name, which is refused before them, and nothing calls WSAConnectByList. So I called both from a temporary local test (not part of this PR), the way a title would:
    • WSAConnectByList with one loopback address returns 0, and WSAGetLastError gives 10045 (WSAEOPNOTSUPP). On main the same call panics with the host lacks ws2_32.dll!WSAConnectByList.
    • GetAddrInfoExA("localhost") returns 11001 (WSAHOST_NOT_FOUND) and clears the result.

Not run: Windows.

AI-assisted (Claude Code); numbers from my own runs.

**@⁠ntgata1-dotcom** on GitHub · 2026-11-25 13:19 UTC · [original](https://github.com/Marvisak/VIctory/pull/2249#issuecomment-7163609707) **Wine 11.22: the export test passes, and both fallbacks work as described** Arch Linux, system Wine 11.22, at `3cd19eb`. `cargo xwin test --locked --no-fail-fast --target x86_64-pc-windows-msvc -p victory-hle --lib`, runner `wine`. Wine 11.22's `ws2_32.dll` exports `WSAConnectByNameA` and `GetAddrInfoExW`, but not `WSAConnectByList` or `GetAddrInfoExA`. | `victory-hle` under Wine | passed | failed | |---|---|---| | `main` `940d32f` | 141 | 2 | | this PR | 142 | 1 | - `only_loopback_is_reachable` passes. On `main` it fails at `ws2_32.dll lacks WSAConnectByList`. The one left is `xgamesave::tests::a_kept_blob_past_the_link_limit_is_copied`, which also fails on `main` (the temp folder isn't NTFS here). - No test reaches the new fallbacks: `blocked_name_lookups_clear_the_result` uses a blocked name, which is refused before them, and nothing calls `WSAConnectByList`. So I called both from a temporary local test (not part of this PR), the way a title would: - `WSAConnectByList` with one loopback address returns 0, and `WSAGetLastError` gives 10045 (`WSAEOPNOTSUPP`). On `main` the same call panics with `the host lacks ws2_32.dll!WSAConnectByList`. - `GetAddrInfoExA("localhost")` returns 11001 (`WSAHOST_NOT_FOUND`) and clears the result. Not run: Windows. AI-assisted (Claude Code); numbers from my own runs.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 00:55 UTC · original

Code review and Windows 11 verification at head 3cd19eb63118 merged cleanly onto main (63bcca43c6a0):

  • Code review (crates/victory-hle/src/modules/net.rs:323-346, 612-635, 1153):
    • WSAConnectByList caches host::function("ws2_32.dll", "WSAConnectByList") in OnceLock<Option<usize>>, setting WSAEOPNOTSUPP (10045) and returning 0 when absent (e.g. Wine) while forwarding directly on Windows 11 with zero per-call lookup overhead.
    • GetAddrInfoExA follows the same cached lookup pattern, calling blocked_lookup(result) (writing null_mut() when non-null and returning WSAHOST_NOT_FOUND = 11001) if absent, and host_has_all_forwarded_exports cleanly excludes both symbols in MISSING_ON_WINE.
  • Verified (Windows 11, Rust 1.98.1):
    • cargo xtask policy: 191 files ok; cargo clippy -p victory-hle --all-targets -- -D warnings: 0 warnings
    • cargo test --locked -p victory-hle --lib -- net::: 2/2 passed.

LGTM.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 00:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/2249#issuecomment-7179248837) Code review and Windows 11 verification at head `3cd19eb63118` merged cleanly onto `main` (`63bcca43c6a0`): - **Code review (`crates/victory-hle/src/modules/net.rs:323-346, 612-635, 1153`)**: - `WSAConnectByList` caches `host::function("ws2_32.dll", "WSAConnectByList")` in `OnceLock<Option<usize>>`, setting `WSAEOPNOTSUPP` (`10045`) and returning `0` when absent (e.g. Wine) while forwarding directly on Windows 11 with zero per-call lookup overhead. - `GetAddrInfoExA` follows the same cached lookup pattern, calling `blocked_lookup(result)` (writing `null_mut()` when non-null and returning `WSAHOST_NOT_FOUND = 11001`) if absent, and `host_has_all_forwarded_exports` cleanly excludes both symbols in `MISSING_ON_WINE`. - **Verified (Windows 11, Rust 1.98.1)**: - `cargo xtask policy`: `191 files ok`; `cargo clippy -p victory-hle --all-targets -- -D warnings`: 0 warnings - `cargo test --locked -p victory-hle --lib -- net::`: **2/2 passed**. LGTM.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2249/head:github-bot/gh-2249'
git switch 'github-bot/gh-2249'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2249'
git switch 'github-bot/gh-2249'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2249'
git switch 'github-bot/gh-2249'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2249'
git switch 'main'
git merge --squash 'github-bot/gh-2249'
git switch 'main'
git merge --ff-only 'github-bot/gh-2249'
git switch 'main'
git merge 'github-bot/gh-2249'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2249
No description provided.