WlanRegisterNotification

WlanRegisterNotificationは、WiFiスキャンの結果などの通知を受け取るコールバックを登録する。

WlanRegisterNotification function (wlanapi.h) - Win32 apps | Microsoft Docs
Native Wifiを使ってみた その1 - GraveDollの備忘録ブログ

インターフェースごとに登録する形になる。0が返ってくれば、登録成功。

WlanNotificationCallbackがコールバック関数でこれを指定する。
最後にWlanRegisterNotificationでNULLを指定して、コールバックの解除もしている。

C:\Project\Cloud\github.com\Sample\winapi\WlanRegisterNotification\WlanRegisterNotification\src\WlanRegisterNotification\release>WlanRegisterNotification.exe
pwiiList->InterfaceInfo[0].strInterfaceDescription = Marvell AVASTAR Wireless-AC Network Controller
dwResult = 0, dwPrevNotifSource = 0
dwResult = 0, dwPrevNotifSource = 8

C:\Project\Cloud\github.com\Sample\winapi\WlanRegisterNotification\WlanRegisterNotification\src\WlanRegisterNotification\release>

登録する時は、以前の通知元はないので、dwPrevNotifSourceが0。
解除する時は、直前の通知元があるので、その値8。
ただ、登録しただけでは通知は来ない。

Sample/winapi/WlanRegisterNotification/WlanRegisterNotification/src/WlanRegisterNotification at master · bg1bgst333/Sample · GitHub