XCL_NETWORK=0: GetAddrInfoExW answers local names like getaddrinfo does #2312
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2312
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2312/head"
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?
@gefydev on GitHub · 2026-11-25 13:32 UTC · original
gefydev:netoff-getaddrinfoex-local-names→main· +28 −3 · 1 files · 1 commits · merged 2026-11-25 16:15 UTCWith
XCL_NETWORK=0,GetAddrInfoExWrefused every name,localhostand the machine's own name included. The module promises that lookups of local names keep working, andgetaddrinfoandGetAddrInfoWkeep that promise by calling the original for them; theExentry, which the async lookups use, was hooked with a refusal for all names. A title that resolved its own name that way gotWSAHOST_NOT_FOUND(11001).What is in it
crates/xcl/src/hle/netoff.rs: a declaration of the system'sGetAddrInfoExW, its original (O_GETADDRINFO_EX, with theorig_wrapper the other two have) and the hook table's entry using it instead of a spare trampoline.getaddrinfo_exreads the name asgetaddrinfo_wdoes (null is the empty name), calls the original with all ten arguments for a local name, and refuses the rest as before, now naming the host in the log line.the_systems_own_network_functions_refusealso calls the system'sGetAddrInfoExWthroughGetProcAddress:example.comis still refused with 11001 andoutstays null,localhostreaches the original.Tested
assertion left != right failed, both 11001, forlocalhost) and passes with it. Nothing leaves the machine: the names areexample.com, refused before any lookup, andlocalhost.cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4oned56bca: 1250 passed, 0 failed, 46 ignored. 26 SKIPPED, none of them on a path this change touches: 20 wave64 cases ("no wave64" on this GPU), 3 per-lane f16 cases the per-lane form refuses, 1 "no heap windows", 2 for the D3D12 debug layer not being installed.Regression run
scripts/smoke.ps1 -Game <title folder> -Seconds 60, release builds, the same machine and title for both, one after the other. The smoke runs setXCL_NETWORK=0, so they do load the hooks.main:
PR:
Not tested
GetAddrInfoExW(an overlapped call with a completion routine) for a local name: the hook passes all ten arguments to the original unchanged, but only the synchronous call is in the test.netoff.rs(#808local_name, #807WSASendTo, #619 mapped loopback); none changes this hook.AI use
@oni-swr on GitHub · 2026-11-25 13:45 UTC · original
CPU-only review of #2312 at head
ed56bca4c3d31b2d928e545d5a9a9a222932099f, onorigin/mainafc5ee86ae3a9521c9f15d96505cd73fe72f2191(the PR is based on1a0bbe3; it merges into currentmainwithout conflicts).Tested
origin/main(all three merge cleanly together) and rancargo test -p xcl --lib --no-run: compiles; the 2 warnings are in code these PRs do not touch.cargo test -p xcl --lib hle::netoff:: -- --test-threads=1: 2 passed, 0 failed, 0 ignored (the_systems_own_network_functions_refusenow also calls the hookedGetAddrInfoExW: an external name getsWSAHOST_NOT_FOUNDand a null result,localhostdoes not). These tests install the process-wide hooks and use only loopback; no network traffic to outside hosts.Review
O_GETADDRINFO_EX), asgetaddrinfo/GetAddrInfoWalready do, and logs the name for refused lookups. A null name is treated as the empty name. The async arguments (overlapped, completion routine, handle) are passed through unchanged for local names. The test only covers the synchronous call; the async/overlapped path was read, not run. No issues found.Overlap
hle/netoff.rs(local_nameparsing,WSAConnectByList). Both merge with this PR without conflicts (checked withgit merge-tree), but #808 changes whatlocal_nameaccepts, which this PR now also uses forGetAddrInfoExW; whichever lands second should rerun this test.Not tested
scripts/smoke.ps1/ any title run. This is not a replacement for the GPU suite or the smoke run the PR template asks for.AI use
stable-x86_64-pc-windows-msvc, debug build, CPU only. I read the full diff; nothing was changed or pushed.@gefydev on GitHub · 2026-11-25 13:48 UTC · original
@oni-swr thank you for the review of #2312 at
ed56bca:hle::netoff::2 passed, 0 failed, a clean merge with #808 and #821 (git merge-tree), and no issues. Agreed on both points: only the synchronous call is in the test, the overlapped path was read and not run, and whichever of #808 and this PR lands second should rerunthe_systems_own_network_functions_refuse, because #808 changes whatlocal_nameaccepts.AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev.
@nnonno91 on GitHub · 2026-11-25 14:47 UTC · original
Independent Windows event-based asynchronous localhost check on
ed56bca4c3d31b2d928e545d5a9a9a222932099f.Tested
XCL_NETWORK=0.cargo test --locked -p xcl --lib hle::netoff:: -- --nocapture --test-threads=1gave 2 passed, 0 failed on the unchanged head.the_systems_own_network_functions_refuseafter the existing hook checks. It initialized Winsock and called the hookedGetAddrInfoExWforlocalhostwith anOVERLAPPEDevent. The call returned 997, the event signaled within five seconds, andGetAddrInfoExOverlappedResultreturned 0 with a non-null address result. The added lookup was local.cargo test --locked -p xcl --lib hle::netoff::tests::the_systems_own_network_functions_refuse -- --exact --nocapture --test-threads=1gave 1 passed, 0 failed. Both runs had 0 ignored and no skips. The temporary fixture edit was restored.Not tested
Completion-routine callbacks, a retail title and the full workspace suite.
AI use
OpenAI Codex (GPT-6.2 Sol) added the temporary asynchronous check, ran the tests and wrote this report.
@gefydev on GitHub · 2026-11-25 15:16 UTC · original
@nnonno91 thank you for the asynchronous check of #2312 at
ed56bca(Ryzen 7 9800X3D, Windows 11 build 26200.9974, Rust 1.100.0,XCL_NETWORK=0, unoptimized profile). It covers the overlapped path the description lists as not tested:hle::netoff::2 passed, 0 failed on the unchanged head, and with your temporary fixture the hookedGetAddrInfoExWforlocalhostwith anOVERLAPPEDevent returned 997, the event signaled within five seconds, andGetAddrInfoExOverlappedResultreturned 0 with a non-null address result. Completion-routine callbacks, a title and the full suite were not part of your run, as you say.AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev.
@DavidM1911 on GitHub · 2026-11-25 17:41 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!