internal static extern uint WlanRegisterNotification( [In] WlanHandle clientHandle, [In] WlanNotificationSource notificationSource, [In] bool ignoreDuplicate, [In] WlanNotificationCallback notificationCallback, [In] IntPtr callbackContext, IntPtr reserved, [Out] out WlanNotificationSource previousNotificationSource);
private bool StartListening() { try { var result = WlanApi.WlanOpenHandle(2, IntPtr.Zero, out uint currentVersion, out clientHandle); if (result != 0) { return(false); } wlanNotifyDelegate = new WlanNotificationCallback(WlanNotifyHook); return(WlanRegisterNotification(clientHandle, WlanApi.WlanNotificationSource.MSM, true, wlanNotifyDelegate, IntPtr.Zero, IntPtr.Zero, out WlanApi.WlanNotificationSource prevSource) == 0); } catch (System.DllNotFoundException e) { ErrorHandling.ErrorHandler.Handle(e, ErrorHandling.LogLevel.Error); } return(false); }
public static extern uint WlanRegisterNotification(IntPtr hClientHandle, WlanApi.WlanNotificationSource dwNotifSource, bool bIgnoreDuplicate, WlanNotificationCallback funcCallback, IntPtr pCallbackContext, IntPtr pReserved, [Out] out WlanApi.WlanNotificationSource pdwPrevNotifSource);