プロジェクトのダウンロード

DWORD dwCurVersion = 0;
DWORD dwResult = 0;
WCHAR GuidString[39] = { 0 };
HANDLE hClient = NULL;
dwResult = WlanOpenHandle(2, NULL, &dwCurVersion, &hClient);
if (dwResult == ERROR_SUCCESS)
{
	PWLAN_INTERFACE_INFO_LIST pIfList = NULL;
	dwResult = WlanEnumInterfaces(hClient, NULL, &pIfList);
	if (dwResult == ERROR_SUCCESS)
	{
		for (int i = 0; i < (int)pIfList->dwNumberOfItems; ++i)
		{
			PWLAN_INTERFACE_INFO pIfInfo = (WLAN_INTERFACE_INFO *)&pIfList->InterfaceInfo[i];
			StringFromGUID2(pIfInfo->InterfaceGuid, (LPOLESTR)&GuidString, sizeof(GuidString) / sizeof(*GuidString));
			if (pIfInfo->isState == wlan_interface_state_connected)
			{
				PWLAN_AVAILABLE_NETWORK_LIST pBssList = NULL;
				dwResult = WlanGetAvailableNetworkList(hClient, &pIfInfo->InterfaceGuid, 0, NULL, &pBssList);
				if (dwResult == ERROR_SUCCESS)
				{
					for (int j = 0; j < (int)pBssList->dwNumberOfItems; ++j)
					{
						PWLAN_AVAILABLE_NETWORK pBssEntry = (WLAN_AVAILABLE_NETWORK *)& pBssList->Network[j];
						if (pBssEntry->dwFlags & WLAN_AVAILABLE_NETWORK_CONNECTED)
						{
							// シグナルの強度
							pBssEntry->wlanSignalQuality
							//
						}
					}
				}
				if (pBssList != NULL)
				{
					WlanFreeMemory(pBssList);
					pBssList = NULL;
				}
			}
		}
		if (pIfList != NULL)
		{
			WlanFreeMemory(pIfList);
			pIfList = NULL;
		}
	}
	WlanCloseHandle(hClient, NULL);
}

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です