1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| DWORD SubScan(HANDLE hClient, PWLAN_INTERFACE_INFO pIfInfo) { HANDLE hEvent = CreateEventW(NULL, TRUE, FALSE, NULL); if (!hEvent) return GetLastError();
DWORD dwResult = WlanRegisterNotification( hClient, WLAN_NOTIFICATION_SOURCE_ACM, TRUE, SubScanProc, (PVOID)hEvent, NULL, NULL); if (dwResult != ERROR_SUCCESS) { CloseHandle(hEvent); return dwResult; }
dwResult = WlanScan(hClient, &pIfInfo->InterfaceGuid, NULL, NULL, NULL); if (dwResult == ERROR_SUCCESS) WaitForSingleObject(hEvent, INFINITE);
WlanRegisterNotification( hClient, WLAN_NOTIFICATION_SOURCE_ACM, TRUE, NULL, NULL, NULL, NULL);
CloseHandle(hEvent);
return dwResult; }
|