1

我正在写一种 wlanapi 的包装器。通过WlanRegisterNotification接收通知时,我收到带有代码590x3B十六进制)的意外媒体特定模块 (MSM) 通知。WLAN_NOTIFICATION_MSM MSDN 页面不包含任何有用信息。Mywlanapi.h也不包含这样的值,实际上这个枚举是从零开始的并且只包含18值 - from 0to 17

有谁知道这种通知的含义,为什么根本没有记录?

这是我到目前为止所拥有的。

看起来此通知是常规连接过程的一部分。也就是说,我在连接到无线网络时得到它 - 无论以前的连接状态如何。这是每次连接到网络时发生的通知序列:

wlan_notification_msm_associating
wlan_notification_msm_associated
wlan_notification_msm_authenticating
59 (0x3B)
wlan_notification_msm_signal_quality_change

wlan_notification_msm_associatedwlan_notification_msm_authenticating在同一时刻触发,然后立即(在 10-20 毫秒内)使用代码59( 0x3F) 触发通知。

此通知有 16 字节的有效负载。数据结构对我来说看起来并不熟悉,如果有人看起来很熟悉,请发布此信息(10 个事件):

80805E08 009B0000 F1F10800 C400D634 <-- Switching between two networks here and below in random order
D0D049FA 009B0000 A6A60800 01542A00
80805E08 009B0000 696902FF 00FF4C6F
80805E08 00C40000 04040E00 000093DF
80805E08 009B0000 04040900 6F009361 <-- Diconnect and connect to the same network
80805E08 009B0000 04000700 00009340 <-- Diconnect and connect to the same network
64640000 00450002 0400114D 00009363 <-- Disconnect and connect to another network
80805E08 009B0000 04040511 005B93E8 <-- Diconnect and connect to the same network 
58580000 00450002 04000904 3D4293A1 <-- Connect to another network (i. e. switch)
80805E08 009B0000 04040100 10919316 <-- Connect to another network (i. e. switch)

有用的链接

将不胜感激任何帮助!

通过官方示例连接时,更新 1 通知顺序相同:

HandleAcmNotification(type = ConnectionStart)
HandleMsmNotification(type = Associating)
HandleMsmNotification(type = Associated)
HandleMsmNotification(type = Authenticating)
HandleMsmNotification(type = Code59)
HandleMsmNotification(type = SignalQualityChange)
HandleMsmNotification(type = Connected)
HandleAcmNotification(type = ConnectionComplete)

更新 2 为此,我在 GitHub 上创建了一个最小的测试项目 - https://github.com/alexbereznikov/wlanapi-notification-code59-test

二进制 x64 版本位于此处 - https://github.com/alexbereznikov/wlanapi-notification-code59-test/releases

成功连接到无线网络后,我得到以下输出: 使用代码 59 测试应用程序输出

4

1 回答 1

2

这是设计使然。

0n59 通知代码是一个私有通知代码,当无线网络可能正在发生网络速度变化时,由操作系统处理。

对于最终开发人员,最终开发人员应忽略这一点,因为它没有记录在案并且将来可能会更改,因为它是由底层操作系统处理的私人通知。

注意:当禁用和重新启用无线网络时,这只会在较新的操作系统(Windows 10)上发送。此通知不会针对较旧的操作系统(例如,Windows 7、Windows 8.1)发送

于 2020-10-21T02:21:07.470 回答