1

I'm writing a kind of wrapper over wlanapi. When receiving notifications via WlanRegisterNotification I'm getting unexpected media-specific module (MSM) notification with code 59 (which is 0x3B in hex). WLAN_NOTIFICATION_MSM MSDN page does not contain any helpful information. My wlanapi.h does not contain such value as well, in fact this enumeration is zero-based and contain only 18 values - from 0 to 17.

Does anybody knows the meaning of such notification, and why it is not documented at all?

Here is what I have so far.

Looks like this notification is a part of regular connection process. That is, I'm getting it when connecting to a wireless network - regardless of previous connection state. Here is the notification sequence which happens each time when I connect to a network:

wlan_notification_msm_associating
wlan_notification_msm_associated
wlan_notification_msm_authenticating
59 (0x3B)
wlan_notification_msm_signal_quality_change

wlan_notification_msm_associated and wlan_notification_msm_authenticating fires in the same moment of time, and then immediately (in 10-20 milliseconds) fires notification with code 59 (0x3F).

This notification has 16-bytes payload. Data structure does not look familiar to me, posting this in case if it looks familiar to someone (10 events):

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)

Useful links

Will appreciate any help!

Update 1 Notifications sequence is the same when connecting via official sample:

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

Update 2 I've created a minimal test project on GitHub for this purpose - https://github.com/alexbereznikov/wlanapi-notification-code59-test.

Binary x64 release is located here - https://github.com/alexbereznikov/wlanapi-notification-code59-test/releases.

I'm getting the following output after successful connection to a wireless network: Test application output with code 59

n0ne
  • 103
  • 4
  • 17
  • 1
    Can you try [this official sample](https://github.com/microsoft/Windows-classic-samples/tree/1d363ff4bd17d8e20415b92e2ee989d615cc0d91/Samples/Win7Samples/netds/wlan/autoconfig) to connect to a wireless network to see if it reproduces the same issue? – Rita Han Sep 16 '20 at 09:52
  • @RitaHan-MSFT Thank you, I've tried to connect using the provided sample (nice tool btw.) - but the notifications sequence is the same (i. e. code `59` is still present). – n0ne Sep 16 '20 at 10:07
  • Thanks for trying. What issue does this non-defined notification code (`59`) cause? Any other event is missing or connection is failing etc? – Rita Han Sep 17 '20 at 07:28
  • @RitaHan-MSFT There is no single issue - everything works as it should (at least I think so). I'm wrapping these notifications and just curious what this notification code means - because it looks like a part of the regular connection process. Typical connection notification sequence I'm getting is shown in `Update 1` section. – n0ne Sep 17 '20 at 08:15
  • 1
    Thanks for confirmation. Good to know it is not sticking you. I‘ll consult the related engineer to see if it is excepted or not. – Rita Han Sep 17 '20 at 08:21
  • 1
    You can ignore this non-defined code and just handle those defined functional notifications. If you can reproduce this issue with different WIFI devices and WLAN environments feel free let me know. – Rita Han Sep 21 '20 at 06:18
  • @RitaHan-MSFT, That's exactly what I'm doing right now. I'll try to build minimalistic reproducer project and test with different environments later, thank you! – n0ne Sep 21 '20 at 09:22
  • @RitaHan-MSFT I've created a minimal test project, it is located here - https://github.com/alexbereznikov/wlanapi-notification-code59-test . Release file could be downloaded here - https://github.com/alexbereznikov/wlanapi-notification-code59-test/releases . Unfortunately I have no other environments except my home network and mobile AP, issue reproduces for both. – n0ne Oct 09 '20 at 04:38

1 Answers1

2

This is by design.

The 0n59 notification code is a private notification code that is processed by the OS when the wireless network may be undergoing a network speed change.

For the end developer, this should be ignored by the end developer as it is not documented and subject to change in the future since it is a private notification handled by underlying OS.

Note:This will only be sent on newer OS now (Windows 10) when disabling and re-enabling the wireless network. This notification is not sent for older OS (example, Windows 7, Windows 8.1)

Fei Xue
  • 14,369
  • 1
  • 19
  • 27