From 2e7e8a2b805b868eade36cc44fa14bf8ca2f8c2f Mon Sep 17 00:00:00 2001 From: Martin Petersson Date: Thu, 14 Apr 2011 11:04:10 +0200 Subject: QNativeWifiEngine: Fix problem with wifi polling on Windows On some Windows machines the wifi detection in QNativeWifiEngine::available does not work as WlanOpenHandle still succeed altough there is no WLAN card. So instead we can detect this using the WlanEnumInterfaces in requestUpdate() instead. Task-number: QTBUG-17219 Reviewed-by: Xizhi Zhu --- src/plugins/bearer/nativewifi/qnativewifiengine.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp index 16c2239..d5beeff 100644 --- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp +++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp @@ -501,6 +501,11 @@ void QNativeWifiEngine::requestUpdate() return; } + if (interfaceList->dwNumberOfItems == 0) { + local_WlanFreeMemory(interfaceList); + return; + } + bool requested = false; for (unsigned int i = 0; i < interfaceList->dwNumberOfItems; ++i) { result = local_WlanScan(handle, &interfaceList->InterfaceInfo[i].InterfaceGuid, 0, 0, 0); -- cgit v0.12