Example #1
0
        public WlanHostedNetwork()
        {
            uint version;

            NativeMethods.WlanOpenHandle((uint)WlanAPIClientVersion.VISTA, IntPtr.Zero, out version, ref _clientHandle);

            NativeMethods.WlanHostedNetworkInitSettings(_clientHandle, out _reason, IntPtr.Zero);

            if (_reason == WlanHostedNetworkReason.Success)
            {
                SetWlanHostedNetworkInfo();

                _wlanNotificationEventHandler = new WlanNotificationEventHandler(HandleNotificationEvent);
                WlanNotificationSource notificationSource;
                NativeMethods.WlanRegisterNotification(_clientHandle, WlanNotificationSource.All, true, _wlanNotificationEventHandler, IntPtr.Zero, IntPtr.Zero, out notificationSource);
            }
            else
            {
                NativeMethods.WlanCloseHandle(_clientHandle, IntPtr.Zero);
            }
        }
Example #2
0
 internal static extern uint WlanRegisterNotification(IntPtr hClientHandle, WlanNotificationSource dwNotifSource, bool bIgnoreDuplicate, WlanNotificationEventHandler funcCallback, IntPtr pCallbackContext, IntPtr pReserved, [Out] out WlanNotificationSource pdwPrevNotifSource);
Example #3
0
        public WlanHostedNetwork()
        {
            uint version;
            NativeMethods.WlanOpenHandle((uint)WlanAPIClientVersion.VISTA, IntPtr.Zero, out version, ref _clientHandle);

            NativeMethods.WlanHostedNetworkInitSettings(_clientHandle, out _reason, IntPtr.Zero);

            if (_reason == WlanHostedNetworkReason.Success)
            {
                SetWlanHostedNetworkInfo();

                _wlanNotificationEventHandler = new WlanNotificationEventHandler(HandleNotificationEvent);
                WlanNotificationSource notificationSource;
                NativeMethods.WlanRegisterNotification(_clientHandle, WlanNotificationSource.All, true, _wlanNotificationEventHandler, IntPtr.Zero, IntPtr.Zero, out notificationSource);
            }
            else
            {
                NativeMethods.WlanCloseHandle(_clientHandle, IntPtr.Zero);
            }
        }
Example #4
0
 internal static extern uint WlanRegisterNotification(IntPtr hClientHandle, WlanNotificationSource dwNotifSource, bool bIgnoreDuplicate, WlanNotificationEventHandler funcCallback, IntPtr pCallbackContext, IntPtr pReserved, [Out] out WlanNotificationSource pdwPrevNotifSource);