查找使用Windows API的通道

Find what is the channel using Windows API

本文关键字:通道 API Windows 查找      更新时间:2023-10-16

我正在尝试使用windows API获取通道。到目前为止,我已经尝试将wlan_intf_opcode_channel_number与WlanQueryInterface函数一起使用。我不太确定这个回复是什么意思,希望有人能澄清一下。

ULONG channel = 0;
DWORD dwSizeChannel = sizeof(channel);
dwResult = WlanQueryInterface(
    hClient, 
    InterfaceGuid, 
    wlan_intf_opcode_channel_number, 
    NULL, 
    &dwSizeChannel, 
    (PVOID*)&channel, 
    NULL);

我不知道在这里之后要做什么。任何帮助将不胜感激!检查后,我发现在调用WlanQueryInterface

之前,我总是得到与channel相同的值。

操作码的MS文档似乎是错误的。如果您在这里尝试类似的操作:

<>之前ULONG *channel = NULL;DWORD dwSizeChannel = sizeof(*channel);DWORD rc = WlanQueryInterfacehClient InterfaceGuid,wlan_intf_opcode_channel_number,NULL, &dwSizeChannel, &channel, NULL);if (rc == ERROR_SUCCESS && channel) {printf ("Channel: %lun", * Channel):WlanFreeMemory(渠道);}之前

我确实得到了预期的

通道:5

同样适用于wlan_intf_opcode_current_operation_mode和其他简单的ULONG操作码。

我用文档中的输入尝试了WlanQueryInterface:https://msdn.microsoft.com/en-us/library/windows/desktop/ms706765 (v = vs.85) . aspx

当触发基于"wlan_intf_opcode_channel_number"的查询时,我得到的数据为"13"。从以下维基百科链接提供的WLAN信息中可以得出频率为2472Mhz:https://en.wikipedia.org/wiki/List_of_WLAN_channels