XCL_NETWORK=0: ConnectEx still connects (main a6f5f7a) #444
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#444
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@Kalmarv on GitHub · 2026-11-24 00:22 UTC · original
Follow-up to #305 (closed, fixed in
db1ddb2). On maina6f5f7a, with the system hooks installed, a socket still connects throughConnectEx.connectto the same address is refused.ConnectExis not an export: a caller gets its address fromWSAIoctl(SIO_GET_EXTENSION_FUNCTION_POINTER), so none of the 18 hooks is on its path. Code that connects on a completion port uses it.A scratch test added to
hle/netoff.rscalls each function before and afterinstall_system_hooks(). Nothing leaves the machine: the listener is on 127.0.0.1 and is reached as::ffff:127.0.0.1, an address the hooks do not count as loopback, so the hookedconnectrefuses it like any other host. "REACHED" means the listener accepted a connection (or, for a lookup, an address came back).WSAConnectByNameWandGetAddrInfoExAare not hooked either, but both are refused: each logsXCL_NETWORK=0: GetAddrInfoExW fails (no network), so they go through the hookedGetAddrInfoExW.ConnectExcaller that needs a name from one of the hooked lookups gets no address. What is open is a connection to an address it already has.WSAIoctland answerWSAID_CONNECTEXwith a function that refuses asconnectdoes.The test (appended to
crates/xcl/src/hle/netoff.rs)Tested
Windows 11 26200, Ryzen 9 9950X, main
a6f5f7aplus the test above, debug. CPU only, loopback only.cargo test -p xcl --lib -- gap_tests --nocapture: 0 passed, 1 failed, the same table in 3 runs.Not tested
DnsQuery_*indnsapi.dll,WSAConnectByList,WSAConnectByNameA).🤖 Claude Fable 5.2