Skip to content

fix(connect): pass WLAN interface GUIDs by reference for ARM64 - #425

Merged
mchave3 merged 1 commit into
mainfrom
fix/connect-wifi-arm64-424
Oct 8, 2026
Merged

mchave3 merged 1 commit into
mainfrom
fix/connect-wifi-arm64-424

Conversation

@mchave3

@mchave3 mchave3 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Foundry Connect showed no Wi-Fi networks on ARM64 devices and never reported a provisioned profile as connected, while the same media worked on x64.

Fixes #424

Reason

WlanGetAvailableNetworkList, WlanScan and WlanQueryInterface take the interface identifier as const GUID*. NativeWifiApi declared that parameter as a by-value Guid.

  • x64 passes 16-byte structures by reference, so the native side received a valid pointer by accident.
  • ARM64 passes them in two registers. The native side then reads GUID bytes as the pointer and every following argument is shifted by one slot, so the calls are rejected.

WlanEnumInterfaces has no GUID parameter, which is why the adapter was still detected. Discovery failures are caught and logged at Debug, so the UI only showed an empty list. Connection waits compare the SSID from WlanQueryInterface, so a provisioned profile could never be confirmed either.

Main changes

  • Declare the interface identifier as in Guid on the three affected imports and document the constraint on NativeWifiApi.
  • Add a Foundry.Connect.Tests guard that fails if a wlanapi import takes a Guid by value, because x64 tests and x64 runtime behavior cannot reveal this defect.

Testing

  • dotnet run --project src/Foundry.Connect.Tests/Foundry.Connect.Tests.csproj -c Release -p:Platform=x64: 133 passed. The new test failed before the fix.
  • Called the fixed NativeWifiApi against the real wlanapi.dll on an x64 machine: interface enumeration and network discovery still succeed.
  • dotnet build src/Foundry.Connect/Foundry.Connect.csproj -c Release -p:Platform=ARM64: succeeded.
  • scripts\Test-FoundryFormat.ps1: passed.
  • Not validated on ARM64 hardware. No ARM64 device was available, and no ARM64 session has reported remote logs, so the fix rests on the calling-convention analysis. Confirmation from the reporter on a Surface Laptop 7 is still needed.

🤖 Generated with Claude Code

WlanGetAvailableNetworkList, WlanScan and WlanQueryInterface take the
interface identifier as const GUID*, but the imports declared it as a
by-value Guid. That only works on x64, where 16-byte structures are
passed by reference. ARM64 passes them in two registers, which shifts
every following argument, so network discovery and connection state
queries always failed and Foundry Connect showed no Wi-Fi networks.

Refs #424

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added tests Test coverage or test infrastructure change project: foundry-connect Changes in the Foundry.Connect WinPE network provisioning application labels Oct 8, 2026
@mchave3 mchave3 self-assigned this Oct 8, 2026
@mchave3
mchave3 marked this pull request as ready for review October 8, 2026 14:14
Copilot AI balanced review requested due to automatic review settings October 8, 2026 14:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@mchave3
mchave3 merged commit 3050174 into main Oct 8, 2026
5 checks passed
@mchave3
mchave3 deleted the fix/connect-wifi-arm64-424 branch October 8, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

project: foundry-connect Changes in the Foundry.Connect WinPE network provisioning application tests Test coverage or test infrastructure change

Projects

Development

Successfully merging this pull request may close these issues.

[Bug]: No Wi-Fi networks visible on ARM64 device, but works fine on x86

2 participants