Repository navigation
fix(connect): pass WLAN interface GUIDs by reference for ARM64 - #425
Merged
Merged
Conversation
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>
1 task done
mchave3
marked this pull request as ready for review
October 8, 2026 14:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,WlanScanandWlanQueryInterfacetake the interface identifier asconst GUID*.NativeWifiApideclared that parameter as a by-valueGuid.WlanEnumInterfaceshas 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 fromWlanQueryInterface, so a provisioned profile could never be confirmed either.Main changes
in Guidon the three affected imports and document the constraint onNativeWifiApi.Foundry.Connect.Testsguard that fails if awlanapiimport takes aGuidby 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.NativeWifiApiagainst the realwlanapi.dllon 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.🤖 Generated with Claude Code