Skip to content

winhttp_offline: credentials, auth schemes and auto-proxy detection answer for the offline handles - #8670

Closed
tedin7 wants to merge 5 commits into
ProjectLeonida:mainfrom
tedin7:c2-winhttp-credentials-autoproxy
Closed

tedin7 wants to merge 5 commits into
ProjectLeonida:mainfrom
tedin7:c2-winhttp-credentials-autoproxy

Conversation

@tedin7

@tedin7 tedin7 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What

Route WinHTTP credentials, authentication scheme queries and auto proxy discovery through the offline shim. Do not retain credentials or perform proxy discovery.

Why

The host rejects offline request handles with ERROR_INVALID_HANDLE.

Tested

  • Zero-flags review follow-up: p2 winhttp_offline_test passed 101 checks, 0 failures after recompiling the interposed shim; before the fix, 101 checks, 1 failure. No GPU used.

  • DNS-only and combined flags follow-up: p2 winhttp_offline_test passed 100 checks, 0 failures; an initial Wine prefix initialization failed before the test ran. No GPU used.

  • p2, Wine/Windows target: /root/fast_test_exe.sh /root/c2-winhttp-credentials-autoproxy winhttp_offline_test. On origin/main 867d922: 86 checks, 1 failure; with the change: 96 checks, 0 failures. Host credential and auth scheme calls both returned ERROR_INVALID_HANDLE for the offline request. No GPU used.

  • Review follow-up on p2: winhttp_offline_test passed 98 checks. Replacing the resolved auto-proxy function with native WinHTTP made the zero-flags negative control fail (97 checks, 1 failure); DHCP was not attempted in that run. No GPU used.

  • Valid-flags review follow-up: p2 winhttp_offline_test passed 98 checks; a test-only DHCP delegation to the intercepted native function failed the new check (98 checks, 1 failure), without network discovery. No GPU used.

  • git diff --check and python -I scripts/check_no_game_data.py runtime/shims/winhttp_offline.cpp runtime/test/winhttp_offline_test.cpp passed.

AI-assisted.

@ItsNotRexed: an exe PR, as you asked.

Claim: #8504 (comment)

@Grimkaaah Grimkaaah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent Linux CPU review (b33bf5c8)

What changed: winhttp_offline answers credentials / auth schemes / auto-proxy detection for offline handles; tests + CMake.

Checked:

  • Diff review of shim + tests (runtime not built here).
  • Credentials accepted but not retained; auto-proxy returns ERROR_WINHTTP_AUTODETECTION_FAILED.

Looks coherent for the offline shim; no game files.

@smowlyy

smowlyy commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Verified head b33bf5c8d merged onto main (867d922f0) on native Windows 11 (10.0.26300.9974, MSVC 19.44, RelWithDebInfo):

  • python -I scripts/check_no_game_data.py on all 4 changed files: clean (exit 0)
  • cmake --build runtime/build --target winhttp_offline_test --parallel: built cleanly
  • ctest --test-dir runtime/build -R winhttp_offline --output-on-failure -V: 1/1 passed (98 check(s), 0 failure(s))

AI-assisted.

@comtek21516

Copy link
Copy Markdown

Tested 16290ee6c on main at 867d922f0, in one tree with #8422, #8669, #8690, #8770, #8784 (six clean merges): pass.

For this change. winhttp_offline (with the new credential, auth-scheme and auto-proxy cases) passes natively and under Wine.

Setup. Built with MSVC 14.52 (Visual Studio 18), Windows SDK 10.0.26100, Vulkan SDK 1.4.363.1, Ninja RelWithDebInfo on Windows Server 2025 (no Vulkan driver there), then the same binaries run through scripts/run_wine_tests.py under wine-11.0 (WineHQ stable, xvfb-run) on a Quadro RTX 4000 (Turing), NVIDIA 615.71.09, Ubuntu 22.04.5.

passed failed skipped
native Windows, this tree 147 4 124
Wine on the GPU machine, main 867d922f0 210 12 54
Wine on the GPU machine, this tree 210 12 54

Under Wine the tree is test by test the same as main. The four native failures are gameinput_host, d3d12_sparse_queue_family, vk_bindless_ps_tex and vk_bindless_ps_imgatomic, which fail the same way on main on that machine (#7452). The 12 under Wine are the same 12 as on main (host comparisons Wine cannot answer, and d3d12_xdxr_rt, d3d12_indirect_rt, d3d12_indirect_dispatch_count).

Because the six were built together, there is no per-PR negative control in this run: a regression would have shown as a difference from main, and there is none. No game files used. AI-assisted (Claude Code).

@memorypressure

Copy link
Copy Markdown

Verified 16290ee against main 6312c05 (clean merge, tree 84f716b85; recheck clean at 5d74c27). C++/Windows diff — not runnable here; CI is the execution gate (checks pending at check time). check_no_game_data clean. Review: the three new offline answers match host error taxonomies, and the interposed-TU test (g_native_auto_proxy_calls) gives a genuine no-native-discovery guarantee, including the zero-flags ERROR_INVALID_PARAMETER case added by force-push. Nits: nonzero-but-invalid flags (e.g. 0x4) answer ERROR_WINHTTP_AUTODETECTION_FAILED where native gives ERROR_INVALID_PARAMETER, and integrated auth with a user set but NULL password is rejected though WinHTTP accepts it; neither can touch network or memory offline. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

Raxstreams added a commit to Raxstreams/Leonida that referenced this pull request Nov 23, 2026
ProjectLeonida#8919 fork integration. Each parent after the first is an exact reviewed PR head.

ProjectLeonida#8670 16290ee ProjectLeonida#8670 (comment)

AI-assisted integration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants