internal void OnWlanNotification(Wlan.WlanNotificationData notifyData)
 {
     if (WlanNotification != null)
     {
         WlanNotification(notifyData);
     }
 }
Exemple #2
0
        private Wlan.WlanConnectionNotificationData?ParseWlanConnectionNotification(ref Wlan.WlanNotificationData notifyData)
        {
            int num = Marshal.SizeOf(typeof(Wlan.WlanConnectionNotificationData));

            if (notifyData.dataSize < num)
            {
                return(null);
            }
            Wlan.WlanConnectionNotificationData data = (Wlan.WlanConnectionNotificationData)Marshal.PtrToStructure(notifyData.dataPtr, typeof(Wlan.WlanConnectionNotificationData));
            if (data.wlanReasonCode == Wlan.WlanReasonCode.Success)
            {
                IntPtr ptr = new IntPtr(notifyData.dataPtr.ToInt64() + Marshal.OffsetOf(typeof(Wlan.WlanConnectionNotificationData), "profileXml").ToInt64());
                data.profileXml = Marshal.PtrToStringUni(ptr);
            }
            return(data);
        }
 internal void OnWlanReason(Wlan.WlanNotificationData notifyData, Wlan.WlanReasonCode reasonCode)
 {
     if (WlanReasonNotification != null)
     {
         WlanReasonNotification(notifyData, reasonCode);
     }
     if (_queueEvents)
     {
         WlanReasonNotificationData data2 = new WlanReasonNotificationData
         {
             NotifyData = notifyData,
             ReasonCode = reasonCode
         };
         WlanReasonNotificationData queuedEvent = data2;
         EnqueueEvent(queuedEvent);
     }
 }
 internal void OnWlanConnection(Wlan.WlanNotificationData notifyData, Wlan.WlanConnectionNotificationData connNotifyData)
 {
     if (WlanConnectionNotification != null)
     {
         WlanConnectionNotification(notifyData, connNotifyData);
     }
     if (_queueEvents)
     {
         WlanConnectionNotificationEventData data2 = new WlanConnectionNotificationEventData
         {
             NotifyData     = notifyData,
             ConnNotifyData = connNotifyData
         };
         WlanConnectionNotificationEventData queuedEvent = data2;
         EnqueueEvent(queuedEvent);
     }
 }
Exemple #5
0
        private void OnWlanNotification(ref Wlan.WlanNotificationData notifyData, IntPtr context)
        {
            WlanInterface interface2 = _ifaces.ContainsKey(notifyData.interfaceGuid) ? _ifaces[notifyData.interfaceGuid] : null;

            switch (notifyData.notificationSource)
            {
            case Wlan.WlanNotificationSource.Acm:
                switch (notifyData.notificationCode)
                {
                case 8:
                    if (notifyData.dataSize >= Marshal.SizeOf(0))
                    {
                        Wlan.WlanReasonCode reasonCode = (Wlan.WlanReasonCode)Marshal.ReadInt32(notifyData.dataPtr);
                        if (interface2 != null)
                        {
                            interface2.OnWlanReason(notifyData, reasonCode);
                        }
                    }
                    goto Label_0194;

                case 9:
                case 10:
                case 11:
                case 20:
                case 0x15:
                {
                    Wlan.WlanConnectionNotificationData?nullable = ParseWlanConnectionNotification(ref notifyData);
                    if (nullable.HasValue && (interface2 != null))
                    {
                        interface2.OnWlanConnection(notifyData, nullable.Value);
                    }
                    goto Label_0194;
                }

                case 12:
                case 15:
                case 0x10:
                case 0x11:
                case 0x12:
                case 0x13:
                    goto Label_0194;

                case 13:
                    InterfaceArrivedEvent.Raise(this, new InterfaceNotificationEventsArgs(notifyData.interfaceGuid));
                    goto Label_0194;

                case 14:
                    InterfaceRemovedEvent.Raise(this, new InterfaceNotificationEventsArgs(notifyData.interfaceGuid));
                    goto Label_0194;
                }
                break;

            case Wlan.WlanNotificationSource.Msm:
                switch (notifyData.notificationCode)
                {
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 9:
                case 10:
                case 11:
                case 12:
                case 13:
                {
                    Wlan.WlanConnectionNotificationData?nullable2 = ParseWlanConnectionNotification(ref notifyData);
                    if (nullable2.HasValue && (interface2 != null))
                    {
                        interface2.OnWlanConnection(notifyData, nullable2.Value);
                    }
                    goto Label_0194;
                }

                case 7:
                case 8:
                    goto Label_0194;
                }
                goto Label_0194;
            }
Label_0194:
            if (interface2 != null)
            {
                interface2.OnWlanNotification(notifyData);
            }
        }