Exemple #1
0
 internal void OnWlanNotification(Wlan.WlanNotificationData notifyData)
 {
     if (WlanNotification != null)
     {
         WlanNotification(notifyData);
     }
 }
 internal void OnWlanNotification(Wlan.WlanNotificationData notifyData)
 {
     // ISSUE: reference to a compiler-generated field
     if (this.WlanNotification == null)
     {
         return;
     }
     // ISSUE: reference to a compiler-generated field
     this.WlanNotification(notifyData);
 }
Exemple #3
0
 internal void OnWlanReason(Wlan.WlanNotificationData notifyData, Wlan.WlanReasonCode reasonCode)
 {
     if (WlanReasonNotification != null)
     {
         WlanReasonNotification(notifyData, reasonCode);
     }
     if (queueEvents)
     {
         WlanReasonNotificationData queuedEvent = new WlanReasonNotificationData();
         queuedEvent.notifyData = notifyData;
         queuedEvent.reasonCode = reasonCode;
         EnqueueEvent(queuedEvent);
     }
 }
Exemple #4
0
            internal void OnWlanConnection(Wlan.WlanNotificationData notifyData, Wlan.WlanConnectionNotificationData connNotifyData)
            {
                if (WlanConnectionNotification != null)
                {
                    WlanConnectionNotification(notifyData, connNotifyData);
                }

                if (queueEvents)
                {
                    WlanConnectionNotificationEventData queuedEvent = new WlanConnectionNotificationEventData();
                    queuedEvent.notifyData     = notifyData;
                    queuedEvent.connNotifyData = connNotifyData;
                    EnqueueEvent(queuedEvent);
                }
            }
 internal void OnWlanReason(Wlan.WlanNotificationData notifyData, Wlan.WlanReasonCode reasonCode)
 {
     // ISSUE: reference to a compiler-generated field
     if (this.WlanReasonNotification != null)
     {
         // ISSUE: reference to a compiler-generated field
         this.WlanReasonNotification(notifyData, reasonCode);
     }
     if (!this.queueEvents)
     {
         return;
     }
     this.EnqueueEvent((object)new WlanClient.WlanInterface.WlanReasonNotificationData()
     {
         notifyData = notifyData,
         reasonCode = reasonCode
     });
 }
Exemple #6
0
        private void OnWlanNotification(ref Wlan.WlanNotificationData notifyData, IntPtr context)
        {
            WlanInterface wlanIface;

            ifaces.TryGetValue(notifyData.interfaceGuid, out wlanIface);

            switch (notifyData.notificationSource)
            {
            case Wlan.WlanNotificationSource.ACM:
                switch ((Wlan.WlanNotificationCodeAcm)notifyData.notificationCode)
                {
                case Wlan.WlanNotificationCodeAcm.ConnectionStart:
                case Wlan.WlanNotificationCodeAcm.ConnectionComplete:
                case Wlan.WlanNotificationCodeAcm.ConnectionAttemptFail:
                case Wlan.WlanNotificationCodeAcm.Disconnecting:
                case Wlan.WlanNotificationCodeAcm.Disconnected:
                    Wlan.WlanConnectionNotificationData?connNotifyData = ParseWlanConnectionNotification(ref notifyData);
                    if (connNotifyData.HasValue)
                    {
                        if (wlanIface != null)
                        {
                            wlanIface.OnWlanConnection(notifyData, connNotifyData.Value);
                        }
                    }
                    break;

                case Wlan.WlanNotificationCodeAcm.ScanFail:
                {
                    int expectedSize = Marshal.SizeOf(typeof(int));
                    if (notifyData.dataSize >= expectedSize)
                    {
                        Wlan.WlanReasonCode reasonCode = (Wlan.WlanReasonCode)Marshal.ReadInt32(notifyData.dataPtr);
                        if (wlanIface != null)
                        {
                            wlanIface.OnWlanReason(notifyData, reasonCode);
                        }
                    }
                }
                break;
                }
                break;

            case Wlan.WlanNotificationSource.MSM:
                switch ((Wlan.WlanNotificationCodeMsm)notifyData.notificationCode)
                {
                case Wlan.WlanNotificationCodeMsm.Associating:
                case Wlan.WlanNotificationCodeMsm.Associated:
                case Wlan.WlanNotificationCodeMsm.Authenticating:
                case Wlan.WlanNotificationCodeMsm.Connected:
                case Wlan.WlanNotificationCodeMsm.RoamingStart:
                case Wlan.WlanNotificationCodeMsm.RoamingEnd:
                case Wlan.WlanNotificationCodeMsm.Disassociating:
                case Wlan.WlanNotificationCodeMsm.Disconnected:
                case Wlan.WlanNotificationCodeMsm.PeerJoin:
                case Wlan.WlanNotificationCodeMsm.PeerLeave:
                case Wlan.WlanNotificationCodeMsm.AdapterRemoval:
                    Wlan.WlanConnectionNotificationData?connNotifyData = ParseWlanConnectionNotification(ref notifyData);
                    if (connNotifyData.HasValue)
                    {
                        if (wlanIface != null)
                        {
                            wlanIface.OnWlanConnection(notifyData, connNotifyData.Value);
                        }
                    }
                    break;
                }
                break;
            }

            if (wlanIface != null)
            {
                wlanIface.OnWlanNotification(notifyData);
            }
        }
Exemple #7
0
        private static Wlan.WlanConnectionNotificationData?ParseWlanConnectionNotification(ref Wlan.WlanNotificationData notifyData)
        {
            int expectedSize = Marshal.SizeOf(typeof(Wlan.WlanConnectionNotificationData));

            if (notifyData.dataSize < expectedSize)
            {
                return(null);
            }

            Wlan.WlanConnectionNotificationData connNotifyData =
                (Wlan.WlanConnectionNotificationData)
                Marshal.PtrToStructure(notifyData.dataPtr, typeof(Wlan.WlanConnectionNotificationData));
            if (connNotifyData.wlanReasonCode == Wlan.WlanReasonCode.Success)
            {
                IntPtr profileXmlPtr = new IntPtr(
                    notifyData.dataPtr.ToInt64() +
                    Marshal.OffsetOf(typeof(Wlan.WlanConnectionNotificationData), "profileXml").ToInt64());
                connNotifyData.profileXml = Marshal.PtrToStringUni(profileXmlPtr);
            }

            return(connNotifyData);
        }
        private void OnWlanNotification(ref Wlan.WlanNotificationData notifyData, IntPtr context)
        {
            WlanClient.WlanInterface wlanInterface;
            this.ifaces.TryGetValue(notifyData.interfaceGuid, out wlanInterface);
            switch (notifyData.notificationSource)
            {
            case Wlan.WlanNotificationSource.ACM:
                switch ((Wlan.WlanNotificationCodeAcm)notifyData.notificationCode)
                {
                case Wlan.WlanNotificationCodeAcm.ScanFail:
                    int num = Marshal.SizeOf(typeof(int));
                    if (notifyData.dataSize >= num)
                    {
                        Wlan.WlanReasonCode reasonCode = (Wlan.WlanReasonCode)Marshal.ReadInt32(notifyData.dataPtr);
                        if (wlanInterface != null)
                        {
                            wlanInterface.OnWlanReason(notifyData, reasonCode);
                            break;
                        }
                        break;
                    }
                    break;

                case Wlan.WlanNotificationCodeAcm.ConnectionStart:
                case Wlan.WlanNotificationCodeAcm.ConnectionComplete:
                case Wlan.WlanNotificationCodeAcm.ConnectionAttemptFail:
                case Wlan.WlanNotificationCodeAcm.Disconnecting:
                case Wlan.WlanNotificationCodeAcm.Disconnected:
                    Wlan.WlanConnectionNotificationData?connectionNotification1 = WlanClient.ParseWlanConnectionNotification(ref notifyData);
                    if (connectionNotification1.HasValue && wlanInterface != null)
                    {
                        wlanInterface.OnWlanConnection(notifyData, connectionNotification1.Value);
                        break;
                    }
                    break;
                }
                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?connectionNotification2 = WlanClient.ParseWlanConnectionNotification(ref notifyData);
                    if (connectionNotification2.HasValue && wlanInterface != null)
                    {
                        wlanInterface.OnWlanConnection(notifyData, connectionNotification2.Value);
                        break;
                    }
                    break;
                }
                break;
            }
            if (wlanInterface == null)
            {
                return;
            }
            wlanInterface.OnWlanNotification(notifyData);
        }
        private static Wlan.WlanConnectionNotificationData?ParseWlanConnectionNotification(ref Wlan.WlanNotificationData notifyData)
        {
            int num = Marshal.SizeOf(typeof(Wlan.WlanConnectionNotificationData));

            if (notifyData.dataSize < num)
            {
                return(new Wlan.WlanConnectionNotificationData?());
            }
            Wlan.WlanConnectionNotificationData structure = (Wlan.WlanConnectionNotificationData)Marshal.PtrToStructure(notifyData.dataPtr, typeof(Wlan.WlanConnectionNotificationData));
            if (structure.wlanReasonCode == Wlan.WlanReasonCode.Success)
            {
                IntPtr ptr = new IntPtr(notifyData.dataPtr.ToInt64() + Marshal.OffsetOf(typeof(Wlan.WlanConnectionNotificationData), "profileXml").ToInt64());
                structure.profileXml = Marshal.PtrToStringUni(ptr);
            }
            return(new Wlan.WlanConnectionNotificationData?(structure));
        }