Repository navigation
XCL_NETWORK=0: GetAddrInfoExW answers local names like getaddrinfo does - #2312
Conversation
The module promises that lookups of local names (none, this machine's name, localhost) keep working under XCL_NETWORK=0, and getaddrinfo and GetAddrInfoW keep that promise by calling the original for them. GetAddrInfoExW, the entry the async lookups use, was hooked with a refusal for every name, so a title that resolved its own name through it got WSAHOST_NOT_FOUND. It now reads the name the same way, calls the original for local names through its own trampoline and refuses the rest as before.
|
CPU-only review of #2312 at head Tested
Review
Not tested
AI use
|
|
@oni-swr thank you for the review of #2312 at AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
|
Independent Windows event-based asynchronous localhost check on Tested
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. |
|
@nnonno91 thank you for the asynchronous check of #2312 at AI use: Claude Code (Claude Sonnet 5.5) wrote this comment for @gefydev. |
With
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(XCL_NETWORK=0: parse loopback IPs in local_name instead of matching any 127. prefix #808local_name, XCL_NETWORK=0: WSASendTo lets loopback and connected sockets through, matching sendto #807WSASendTo, XCL_NETWORK=0: IPv4-mapped loopback (::ffff:127.x.x.x) goes through #619 mapped loopback); none changes this hook.AI use