Wine: fall back where ws2_32 lacks exports; hook and cfg fixes #217

Closed
github-bot wants to merge 1 commit from gh-pr/217/head into gh-pr/217/base
Owner

@⁠Naitrate on GitHub · 2026-11-24 01:32 UTC · original
Naitrate:wine-host-fallbacks → main · +145 −19 · 3 files · 1 commits · closed without merging

What

Three small fixes for running VIctory under Wine or Proton. They work with either Linux toolchain, including the one in #191, and are split out of #195, which was closed as a duplicate of #191.

  • Missing Winsock exports: Wine's ws2_32.dll lacks WSAConnectByList and GetAddrInfoExA, and its winhttp.dll lacks WinHttpGetProxySettingsEx. Forwarding to the first two panicked with the host lacks ws2_32.dll!..., so a title call ended the run.
    • WSAConnectByList now tries each vetted candidate in turn with connect when the host has no WSAConnectByList. It blocks, and the timeout isn't honoured.
    • GetAddrInfoExA answers WSAHOST_NOT_FOUND when the host lacks it, as it already does for a blocked name.
    • WinHttpGetProxySettingsEx never reaches the host. The export test exempts all three, and a new test covers the connect fallback.
  • view_format is #[cfg(windows)], like host_resource, its only callee. victory-gpu failed to compile on non-Windows hosts with cannot find function host_resource.
  • .githooks/pre-commit is executable (100755). Git ignored the hook on Linux even after cargo xtask install-hooks reported it as installed, so the asset-policy check never ran on commit.

Why

Found while running VIctory under Wine 11.21 with VKD3D-Proton. only_loopback_is_reachable panicked on ws2_32.dll lacks WSAConnectByList, and a title connecting through WSAConnectByList would end the same way.

Testing

  • Under Wine 11.21 (cross-built for x86_64-pc-windows-msvc), cargo test -p victory-hle passes all 87 tests, including only_loopback_is_reachable and the new connect_by_list_falls_back_to_connect.
  • cargo check -p victory-gpu passes natively on Linux.
  • The commit itself ran through the now-executable hook (asset policy: 3 files ok).

Not run on Windows. There, WSAConnectByList and GetAddrInfoExA still forward to the host as before, since the host exports them.

🤖 Generated with Claude Code

**@⁠Naitrate** on GitHub · 2026-11-24 01:32 UTC · [original](https://github.com/Marvisak/VIctory/pull/217) `Naitrate:wine-host-fallbacks` → `main` · +145 −19 · 3 files · 1 commits · closed without merging ## What Three small fixes for running VIctory under Wine or Proton. They work with either Linux toolchain, including the one in #191, and are split out of #195, which was closed as a duplicate of #191. - **Missing Winsock exports:** Wine's `ws2_32.dll` lacks `WSAConnectByList` and `GetAddrInfoExA`, and its `winhttp.dll` lacks `WinHttpGetProxySettingsEx`. Forwarding to the first two panicked with `the host lacks ws2_32.dll!...`, so a title call ended the run. - `WSAConnectByList` now tries each vetted candidate in turn with `connect` when the host has no `WSAConnectByList`. It blocks, and the timeout isn't honoured. - `GetAddrInfoExA` answers `WSAHOST_NOT_FOUND` when the host lacks it, as it already does for a blocked name. - `WinHttpGetProxySettingsEx` never reaches the host. The export test exempts all three, and a new test covers the `connect` fallback. - **`view_format` is `#[cfg(windows)]`**, like `host_resource`, its only callee. `victory-gpu` failed to compile on non-Windows hosts with `cannot find function host_resource`. - **`.githooks/pre-commit` is executable (100755).** Git ignored the hook on Linux even after `cargo xtask install-hooks` reported it as installed, so the asset-policy check never ran on commit. ## Why Found while running VIctory under Wine 11.21 with VKD3D-Proton. `only_loopback_is_reachable` panicked on `ws2_32.dll lacks WSAConnectByList`, and a title connecting through `WSAConnectByList` would end the same way. ## Testing - Under Wine 11.21 (cross-built for `x86_64-pc-windows-msvc`), `cargo test -p victory-hle` passes all 87 tests, including `only_loopback_is_reachable` and the new `connect_by_list_falls_back_to_connect`. - `cargo check -p victory-gpu` passes natively on Linux. - The commit itself ran through the now-executable hook (`asset policy: 3 files ok`). Not run on Windows. There, `WSAConnectByList` and `GetAddrInfoExA` still forward to the host as before, since the host exports them. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Wine's ws2_32 lacks WSAConnectByList and GetAddrInfoExA, and its winhttp
WinHttpGetProxySettingsEx. Forwarding to the first two panicked (the
host lacks ...). WSAConnectByList now tries each vetted candidate with
connect (blocking, the timeout not kept) where the host has none, and
GetAddrInfoExA answers WSAHOST_NOT_FOUND, as for a blocked name.
WinHttpGetProxySettingsEx never reaches the host. The export test
skips the three only where the host lacks them (it already did so for
WinHttpGetProxySettingsEx); a new test covers the connect fallback.

view_format is Windows-only like host_resource, its only callee, so
victory-gpu builds on non-Windows hosts again.

The pre-commit hook is executable: git skipped it on Linux, where
`cargo xtask install-hooks` said it was installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:55:12 +00:00
github-bot closed this pull request 2026-11-26 03:55:12 +00:00
Author
Owner

@⁠Bushyon on GitHub · 2026-11-24 02:27 UTC · original

Tested dbbe37d under Wine on Linux: only_loopback_is_reachable goes from failing to passing, and the new connect_by_list_falls_back_to_connect passes.

Setup: Fedora 44, RX 7800 XT (RADV 26.2.6). Proton Experimental 11.0-20261112 (wine-11.0, vkd3d-proton 2576c0b4a, DXVK dxgi), its own prefix. Debug test binaries cross-built for x86_64-pc-windows-msvc with clang-cl, lld-link and xwin (rustc 1.98.1).

cargo test -p victory-hle --lib:

passed failed
main d2a4bae 85 1 (only_loopback_is_reachable, panics at net.rs:1058)
#217 dbbe37d 87 0
**@⁠Bushyon** on GitHub · 2026-11-24 02:27 UTC · [original](https://github.com/Marvisak/VIctory/pull/217#issuecomment-7120168620) Tested `dbbe37d` under Wine on Linux: `only_loopback_is_reachable` goes from failing to passing, and the new `connect_by_list_falls_back_to_connect` passes. **Setup:** Fedora 44, RX 7800 XT (RADV 26.2.6). Proton Experimental 11.0-20261112 (`wine-11.0`, vkd3d-proton `2576c0b4a`, DXVK dxgi), its own prefix. Debug test binaries cross-built for `x86_64-pc-windows-msvc` with clang-cl, lld-link and xwin (rustc 1.98.1). `cargo test -p victory-hle --lib`: | | passed | failed | |---|---:|---:| | `main` `d2a4bae` | 85 | 1 (`only_loopback_is_reachable`, panics at `net.rs:1058`) | | #217 `dbbe37d` | 87 | 0 |
Author
Owner

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

Automated triage for the maintainers. Closing because it is outside the project's scope (VIctory targets Windows hosts; ports, launchers and tooling for other platforms are not being taken).

Out of scope: fallbacks for exports Wine's ws2_32 lacks (real Windows has them), a non-Windows cfg in victory-gpu and the pre-commit hook's file mode, all for running under Wine/Proton on Linux. The network guard is not loosened.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/217#issuecomment-7148037649) Automated triage for the maintainers. Closing because it is outside the project's scope (VIctory targets Windows hosts; ports, launchers and tooling for other platforms are not being taken). Out of scope: fallbacks for exports Wine's ws2_32 lacks (real Windows has them), a non-Windows cfg in victory-gpu and the pre-commit hook's file mode, all for running under Wine/Proton on Linux. The network guard is not loosened. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Author
Owner

@⁠Naitrate on GitHub · 2026-11-25 04:18 UTC · original

Thanks for taking a look. Nothing was missed: these only matter under Wine, and real Windows hosts have the exports. I'll keep them in my fork.

**@⁠Naitrate** on GitHub · 2026-11-25 04:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/217#issuecomment-7152726657) Thanks for taking a look. Nothing was missed: these only matter under Wine, and real Windows hosts have the exports. I'll keep them in my fork.

Pull request closed

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!217
No description provided.