HLE: WSAConnectByList and GetAddrInfoExA fail where the host lacks them, not abort (Wine) #2247
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2249"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by desplmfao on 2026-11-25T08:49:53Z.
This is commit
d469fe9from @Slaktarn700'sproton-fixesbranch, carried onto currentmain(940d32f). Their commit keeps them as author. That branch was never opened upstream; this is the one change from it thatmainstill needs.Problem
net.rscallsWSAConnectByListandGetAddrInfoExAthroughhost!, andhost!panics when the host DLL lacks the export (files.rs). Wine'sws2_32.dlldoesn'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:
WSAConnectByListreturns failure withWSAEOPNOTSUPP.GetAddrInfoExAtakesmain'sblocked_lookup(result)path, so*resultis 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 insideonly_loopback_is_reachable.cargo clippy -p victory-hle --all-targets -- -D warnings: clean.AI-assisted (Claude Code).
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T09:02:27Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, Rust 1.98.1 MSVC):cargo test -p victory-hle --lib net::— 2 passed, 0 failedcargo clippy -p victory-hle --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean graceful failure for
WSAConnectByListandGetAddrInfoExAon hosts (such as Wine) that lack them instead of aborting. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T09:35:29Z.
Review: COMMENTED
HLE net: WSAConnectByList/GetAddrInfoExA fail cleanly with WSAEOPNOTSUPP when the host ws2_32 lacks them (Wine). Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T12:42:53Z.
Automated triage for the maintainers.
Merge candidate. In
crates/victory-hle/src/modules/net.rs,WSAConnectByListandGetAddrInfoExAnow look up their host function once. Where the host lacks it (Wine'sws2_32), they fail the call instead of the process aborting inhost!:WSAEOPNOTSUPPfor the connect, andblocked_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. CIcheckpasses, and the branch merges cleanly.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by ntgata1-dotcom on 2026-11-25T13:19:24Z.
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, runnerwine. Wine 11.22'sws2_32.dllexportsWSAConnectByNameAandGetAddrInfoExW, but notWSAConnectByListorGetAddrInfoExA.victory-hleunder Winemain940d32fonly_loopback_is_reachablepasses. Onmainit fails atws2_32.dll lacks WSAConnectByList. The one left isxgamesave::tests::a_kept_blob_past_the_link_limit_is_copied, which also fails onmain(the temp folder isn't NTFS here).blocked_name_lookups_clear_the_resultuses a blocked name, which is refused before them, and nothing callsWSAConnectByList. So I called both from a temporary local test (not part of this PR), the way a title would:WSAConnectByListwith one loopback address returns 0, andWSAGetLastErrorgives 10045 (WSAEOPNOTSUPP). Onmainthe same call panics withthe 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.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:55:23Z.
Code review and Windows 11 verification at head
3cd19eb63118merged cleanly ontomain(63bcca43c6a0):crates/victory-hle/src/modules/net.rs:323-346, 612-635, 1153):WSAConnectByListcacheshost::function("ws2_32.dll", "WSAConnectByList")inOnceLock<Option<usize>>, settingWSAEOPNOTSUPP(10045) and returning0when absent (e.g. Wine) while forwarding directly on Windows 11 with zero per-call lookup overhead.GetAddrInfoExAfollows the same cached lookup pattern, callingblocked_lookup(result)(writingnull_mut()when non-null and returningWSAHOST_NOT_FOUND = 11001) if absent, andhost_has_all_forwarded_exportscleanly excludes both symbols inMISSING_ON_WINE.cargo xtask policy:191 files ok;cargo clippy -p victory-hle --all-targets -- -D warnings: 0 warningscargo test --locked -p victory-hle --lib -- net::: 2/2 passed.LGTM.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-27T02:58:06Z.
Review: APPROVED
Reviewed at
3cd19eb6311805c491814aacedc63b740b0d1247— APPROVE.Verification
rustfmt --edition 2024 --check,cargo xtask policy(191 files ok), and all fourcargo clippy -p victory-hletargets (--lib,--tests,--all-targets,--all-featureswith-D warnings) passed cleanly.WSAConnectByList(8 args,extern "system" fn(...) -> i32, returning0/FALSEwithWSAEOPNOTSUPP10045) andGetAddrInfoExA(10 args,extern "system" fn(...) -> i32, clearing*resultand returningWSAHOST_NOT_FOUNDviablocked_lookup) match Win32 ABI and retain standard Windows forwarding whencrate::host::functionresolves the exports.cargo test -p victory-hle --lib modules::net(2/2).Non-blocking notes
GetAddrInfoExA's fallback path (crates/victory-hle/src/modules/net.rs:629) returnsWSAHOST_NOT_FOUNDand zeroes*resultviablocked_lookup, without callingwsa_error(WSAHOST_NOT_FOUND)to updateWSAGetLastError()(which may retain127fromGetProcAddressor a prior error).host!("ws2_32.dll", "WSASetLastError")insideWSAConnectByList's fallback (net.rs:339) assumesws2_32.dllitself loaded and exportsWSASetLastError(true on Wine, though guardingcrate::host::functiondirectly avoids any panic if the DLL ever failed to load).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.