[pr-fix][linux-proton] Network calls whose export the host lacks fail instead of ending the process #346

Manually merged
TrustNo1 merged 1 commit from ntsthay/wine-net-missing-exports into main 2026-12-05 04:49:19 +00:00 AGit
Contributor

Not run in the game. Two unit tests show the problem under Wine.

Contributor role (optional)

  • Fluxer ID:

What it changes

Wine's ws2_32.dll has no WSAConnectByList and no GetAddrInfoExA. Our overrides reached the host through host!, which panics when the export is missing, so a title that called either one under Wine or Proton ended the process. On f3840d7, only_loopback_is_reachable fails under Wine with "ws2_32.dll lacks WSAConnectByList".

Both overrides now look the export up with crate::host::function. When it is missing, the call fails with WSAEOPNOTSUPP, and GetAddrInfoExA also sets the result to null. On Windows the export is there and the call goes to the host as before.

I compared the exports of Proton's ws2_32.dll and winhttp.dll with every network override. These two are the only ones that call the host and are missing. WinHttpGetProxySettingsEx is missing too, but its override never calls the host.

The tests change in the same file:

  • only_loopback_is_reachable lets those two exports be missing, only under Wine.
  • the_boundary_holds_at_its_edges still checks the guard everywhere. It checks the loopback connection through WSAConnectByNameW only off Wine, because Wine's WSAConnectByNameW returns FALSE without connecting.

How it was tested

  • Tested revision: 3c12163, this branch on f3840d7.
  • Commands and results: cargo nextest run -p darner-hle -E 'test(/modules::net::/)' under Proton (proton-cachyos, RTX 4080): 4 passed. On f3840d7 two of them fail.
  • Gates 1 and 2 (cargo clippy --workspace --all-targets --locked -- -D warnings, and the same with --all-features) are clean. Gate 3 ran under Wine, not on Windows.
  • Gameplay: not run.
  • Coverage gaps: no run on Windows and no game run.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found
Not run in the game. Two unit tests show the problem under Wine. ## Contributor role (optional) - Fluxer ID: ## What it changes Wine's `ws2_32.dll` has no `WSAConnectByList` and no `GetAddrInfoExA`. Our overrides reached the host through `host!`, which panics when the export is missing, so a title that called either one under Wine or Proton ended the process. On `f3840d7`, `only_loopback_is_reachable` fails under Wine with "ws2_32.dll lacks WSAConnectByList". Both overrides now look the export up with `crate::host::function`. When it is missing, the call fails with `WSAEOPNOTSUPP`, and `GetAddrInfoExA` also sets the result to null. On Windows the export is there and the call goes to the host as before. I compared the exports of Proton's `ws2_32.dll` and `winhttp.dll` with every network override. These two are the only ones that call the host and are missing. `WinHttpGetProxySettingsEx` is missing too, but its override never calls the host. The tests change in the same file: - `only_loopback_is_reachable` lets those two exports be missing, only under Wine. - `the_boundary_holds_at_its_edges` still checks the guard everywhere. It checks the loopback connection through `WSAConnectByNameW` only off Wine, because Wine's `WSAConnectByNameW` returns FALSE without connecting. ## How it was tested - Tested revision: `3c12163`, this branch on `f3840d7`. - Commands and results: `cargo nextest run -p darner-hle -E 'test(/modules::net::/)'` under Proton (proton-cachyos, RTX 4080): 4 passed. On `f3840d7` two of them fail. - Gates 1 and 2 (`cargo clippy --workspace --all-targets --locked -- -D warnings`, and the same with `--all-features`) are clean. Gate 3 ran under Wine, not on Windows. - Gameplay: not run. - Coverage gaps: no run on Windows and no game run. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found
TrustNo1 manually merged commit 3b41c794e2 into main 2026-12-05 04:49:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
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
TrustNo1/Darner!346
No description provided.