A Microsoft platform for building and publishing apps for Windows devices.
Use Windows wireless tracing to determine where the Wi‑Fi Direct connection flow breaks, then correlate that with the API hang.
- Capture a wireless trace on the Windows device before reproducing the issue:
if not exist c:\tmp md c:\tmp
netsh trace start wireless_dbg capture=yes overwrite=yes maxsize=4096 tracefile=c:\tmp\wireless.etl
wireless_dbg is a legacy scenario that is still available. For new support cases, the documented preference is the TSS NET_WLAN scenario.
- Reproduce the failure and record the exact time when:
- Android completes Provision Discovery
- Android shows WPS PBC on Windows as inactive
-
WiFiDirectDevice::FromIdAsync(client.Id(), params)starts hanging
- Stop and convert the trace:
netsh trace stop
netsh trace convert c:\tmp\wireless.etl
This produces wireless.etl, wireless.cab, and after conversion wireless.txt.
- Analyze the ETW trace with TextAnalysisTool and start with the connection state machine:
- Apply the FSM transition filter first.
- Identify the last known good state before the failure.
- Windows Wi‑Fi connection states to look for are: Reset, Ihv_Configuring, Configuring, Associating, Authenticating, Connected, Roaming, Wait_For_Disconnected, and Disconnected.
- If the failure occurs after the main state machine advances but before completion, inspect lower layers in the same trace:
- Enable
FSM transition - Enable
SecMgr Transition - Enable
AuthMgr Transition - Review
Microsoft-Windows-WLAN-AutoConfigevents immediately before the bad transition
- Enable
- Pay special attention to evidence that the failure is propagating up from lower wireless components. The documented example shows that a
SecMgr Transition DEACTIVATEcan propagate back to the main connection state machine, and that tracing backward can reveal aReceived IHV PORT DOWNevent. That pattern indicates the issue may be closer to the wireless hardware, miniport, or lower Native Wi‑Fi stack rather than only the app layer. - Since the hang occurs in
WiFiDirectDevice::FromIdAsync(...), also verify the Wi‑Fi Direct prerequisites on Windows:- Wi‑Fi Direct support for desktop apps is in the Native Wifi API starting with Windows 8 / Windows Server 2012.
- For desktop apps, Wi‑Fi Direct devices must be paired first through the Windows pairing UI so that a stored profile exists and a Wi‑Fi Direct session can be started.
- The Native Wifi Wi‑Fi Direct flow includes opening a handle/session with functions such as
WFDOpenHandle,WFDOpenLegacySession, and closing/canceling withWFDCloseSession,WFDCancelOpenSession, andWFDCloseHandle.
- If the issue is intermittent, compare a good trace and a bad trace at the same phase:
- Find the last matching state in both traces.
- Then compare the next
Microsoft-Windows-WLAN-AutoConfig, SecMgr, and AuthMgr events. - This usually isolates whether the break happens during configuration, association, authentication, or due to a lower-layer port event.
- Rule out common platform causes on the affected Windows client:
- Restart the WLAN AutoConfig service (
WlanSvc). - Remove third-party connection managers if present.
- Check whether client policy or recent updates correlate with the failures.
- Restart the WLAN AutoConfig service (
If the trace shows the connection flow stopping after Provision Discovery with no progress beyond the relevant WLAN state transition, the most useful evidence is the ETW sequence immediately before the stall, especially any Microsoft-Windows-WLAN-AutoConfig, SecMgr/AuthMgr, or port-down indications.