예제 #1
0
        internal void OnWlanConnection(WlanNotificationData notifyData, WlanConnectionNotificationData connNotifyData)
        {
            if (WlanConnectionNotification != null)
            {
                WlanConnectionNotification(notifyData, connNotifyData);
            }

            if (queueEvents)
            {
                WlanConnectionNotificationEventData queuedEvent = new WlanConnectionNotificationEventData();
                queuedEvent.notifyData     = notifyData;
                queuedEvent.connNotifyData = connNotifyData;
                EnqueueEvent(queuedEvent);
            }
        }
예제 #2
0
        internal static WlanConnectionNotificationData?ParseWlanConnectionNotification(ref WlanNotificationData notifyData)
        {
            int expectedSize = Marshal.SizeOf(typeof(WlanConnectionNotificationData));

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

            WlanConnectionNotificationData connNotifyData = (WlanConnectionNotificationData)Marshal.PtrToStructure(notifyData.dataPtr, typeof(WlanConnectionNotificationData));

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

            return(connNotifyData);
        }
예제 #3
0
 private void _wlanInterface_WlanConnectionNotification(WlanNotificationData notifyData, WlanConnectionNotificationData connNotifyData)
 {
     System.Diagnostics.Debug.WriteLine(notifyData.NotificationCode);
 }