HLE: clear blocked DNS lookup results #1475

Closed
github-bot wants to merge 2 commits from gh-pr/1475/head into gh-pr/1475/base
Owner

@⁠ToxicmaggotRP on GitHub · 2026-11-24 18:18 UTC · original
ToxicmaggotRP:codex/net-lookup-output → main · +79 −4 · 1 files · 2 commits · closed without merging

Summary

When VIctory blocks a DNS lookup for a non-loopback host, the four Winsock wrappers returned WSAHOST_NOT_FOUND but left the caller's *result unchanged. A caller that reused a result variable could therefore retain a stale pointer after a failed lookup.

Changes

  • Clear the result pointer on blocked getaddrinfo, GetAddrInfoW, GetAddrInfoExA, and GetAddrInfoExW calls.
  • Add a regression test that passes a sentinel pointer through each wrapper and checks both the error code and null output.

This follows the API-compatibility practice illustrated by XCL's native API comparison for RegisterClassExA; this patch is an independent VIctory implementation and contains no copied XCL code. Refs #1242 (VIC-BT-023).

Validation

  • cargo test --locked -p victory-hle — 95 passed; integration test 1 passed.
  • rustfmt --edition 2024 --check crates/victory-hle/src/modules/net.rs — passed.
  • git diff --check — passed.
  • Workspace-wide cargo fmt --all -- --check reports existing formatting differences in untouched files.
**@⁠ToxicmaggotRP** on GitHub · 2026-11-24 18:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1475) `ToxicmaggotRP:codex/net-lookup-output` → `main` · +79 −4 · 1 files · 2 commits · closed without merging ## Summary When VIctory blocks a DNS lookup for a non-loopback host, the four Winsock wrappers returned `WSAHOST_NOT_FOUND` but left the caller's `*result` unchanged. A caller that reused a result variable could therefore retain a stale pointer after a failed lookup. ## Changes - Clear the result pointer on blocked `getaddrinfo`, `GetAddrInfoW`, `GetAddrInfoExA`, and `GetAddrInfoExW` calls. - Add a regression test that passes a sentinel pointer through each wrapper and checks both the error code and null output. This follows the API-compatibility practice illustrated by XCL's [native API comparison for `RegisterClassExA`](https://github.com/xcl-dev/xcl/pull/179); this patch is an independent VIctory implementation and contains no copied XCL code. Refs #1242 (VIC-BT-023). ## Validation - `cargo test --locked -p victory-hle` — 95 passed; integration test 1 passed. - `rustfmt --edition 2024 --check crates/victory-hle/src/modules/net.rs` — passed. - `git diff --check` — passed. - Workspace-wide `cargo fmt --all -- --check` reports existing formatting differences in untouched files.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:33:12 +00:00
github-bot closed this pull request 2026-11-26 04:33:12 +00:00
Author
Owner

@⁠acetonahard-code on GitHub · 2026-11-24 21:10 UTC · original

Heads-up: #1411 (opened about half an hour earlier) adds the same helper. A blocked forward lookup clears *result and returns WSAHOST_NOT_FOUND, in the same four wrappers. The two conflict in net.rs.

Tested on Windows 11 with the repo toolchain, merged into current main (ffe310e):

cargo test -p victory-hle passed failed ignored
main 95 0 0
main + this PR 96 0 0
  • The new test passes.
  • cargo clippy --all-targets -- -D warnings, with and without --all-features: clean.

I didn't test with game data.


Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.

**@⁠acetonahard-code** on GitHub · 2026-11-24 21:10 UTC · [original](https://github.com/Marvisak/VIctory/pull/1475#issuecomment-7144566505) Heads-up: #1411 (opened about half an hour earlier) adds the same helper. A blocked forward lookup clears `*result` and returns `WSAHOST_NOT_FOUND`, in the same four wrappers. The two conflict in `net.rs`. Tested on Windows 11 with the repo toolchain, merged into current `main` (ffe310e): | `cargo test -p victory-hle` | passed | failed | ignored | |---|---|---|---| | `main` | 95 | 0 | 0 | | `main` + this PR | 96 | 0 | 0 | - The new test passes. - `cargo clippy --all-targets -- -D warnings`, with and without `--all-features`: clean. I didn't test with game data. --- <sub>Tested locally with an AI-assisted script (Claude Code); I checked the results before posting.</sub>

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
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
github/Marvisak--VIctory!1475
No description provided.