我想wlan_intf_opcode_bss_type
使用WlanQueryInterface
功能。
我的代码:
PDOT11_BSS_TYPE wlanInterfaceState = NULL;
DWORD wlanInterfaceStateSize = sizeof(wlanInterfaceState);
DWORD interfaceStateResult;
interfaceStateResult = WlanQueryInterface(hClient, &pIfInfo->InterfaceGuid, wlan_intf_opcode_bss_type, NULL, &wlanInterfaceStateSize, (PVOID *)&wlanInterfaceState, NULL);
if (interfaceStateResult != ERROR_SUCCESS) {
qDebug() << "Error";
} else {
qDebug() << wlanInterfaceState;
}
我得到十六进制值。当我使用 switch 枚举时wlanInterfaceState
出现错误:
error: C2450: switch expression of type 'PDOT11_BSS_TYPE' is illegal
更新:
DOT11_BSS_TYPE
来自 MSDN 的枚举语法:
typedef enum _DOT11_BSS_TYPE {
dot11_BSS_type_infrastructure = 1,
dot11_BSS_type_independent = 2,
dot11_BSS_type_any = 3
} DOT11_BSS_TYPE, *PDOT11_BSS_TYPE;
如何使用这些枚举wlanInterfaceState
?谢谢。