Skip to content

compat-common: GetNetworkConnectivityHint without the host export (Wine) - #38

Open
fffluffy-dev wants to merge 1 commit into
mainfrom
claude/wine-iphlpapi-hint
Open

fffluffy-dev wants to merge 1 commit into
mainfrom
claude/wine-iphlpapi-hint

Conversation

@fffluffy-dev

Copy link
Copy Markdown
Owner

Part of #35 (upstream omonkeyz/xbox-emulator#293, host shim 2).

Wine 9 and Wine 11.11 do not export iphlpapi!GetNetworkConnectivityHint. This caused two problems:

  1. compat-common imported it statically, so on stock Wine every compat DLL that links compat-common had an unresolved import.
  2. Titles that import it themselves, such as GTA VI, got an unresolved stub.

Changes

  • gdk/net.rs:
    • looks up the host export at run time and returns None when it is missing;
    • new title_hint() and get_network_connectivity_hint(), which answer from the same level as XNetworking: the TOMBOX_CONNECTIVITY setting, else the host, else InternetAccess. The cost comes from the host, else unrestricted.
  • os_host/mod.rs: title imports of iphlpapi.dll!GetNetworkConnectivityHint are hooked, like the other os_host imports. This avoids a replacement iphlpapi.dll that would hide every other export.
  • New test file tests/net_hint_host.rs.

Verification
I compared the imports of the windows-gnu builds of xcrdapi.dll and d3d12_xs.dll against the exports of Wine 9's builtin DLLs (API sets aside):

  • before this change, IPHLPAPI.DLL!GetNetworkConnectivityHint was unresolved;
  • after it, nothing is unresolved.

The new test builds (--no-run) but was not run: CI does not test compat-common, and the container's Wine 9 crashes in wineboot.


Generated by Claude Code

Wine 9 and Wine 11.11 have no iphlpapi!GetNetworkConnectivityHint (upstream
omonkeyz#293, host shim 2). compat-common imported it
statically, so every compat DLL that links it failed to load there, and titles
such as GTA VI 1.0.2.1 that import it call an unresolved stub.

compat-common now looks the export up at run time and falls back to its own
hint when it is missing. Title imports of the function are hooked like the
other os_host imports and answered from the same hint as XNetworking: the
TOMBOX_CONNECTIVITY setting, else the host's level, else InternetAccess.

Checked by comparing the imports of the windows-gnu builds of xcrdapi.dll and
d3d12_xs.dll with the exports of Wine 9's builtin DLLs (api sets aside,
which Wine resolves itself): before, the only
unresolved import was IPHLPAPI.DLL!GetNetworkConnectivityHint; after, none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014vTZArnDeG1xtBcLprpoCq
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.

2 participants