Example #1
0
		internal void Reload(WlanInternSsidEntry ssidEntry, bool isConnectedOne)
		{
			Name = ssidEntry.Dot11Ssid.GetSsid();
			DefaultAuthAlgorithm = ssidEntry.dot11DefaultAuthAlgorithm;
			DefaultCipherAlgorithm = ssidEntry.dot11DefaultCipherAlgorithm;
			SecurityEnabled = ssidEntry.securityEnabled;
			SignalQuality = ssidEntry.wlanSignalQuality;
			IsConnected = isConnectedOne;
		}
Example #2
0
		private static WlanInternSsidEntry[] GetSsidList(Nic nic, out int errorCode)
		{
			IntPtr availNetListPtr;
			if ((errorCode = WlanInterop.GetSsidEntryList(_handle, nic.Hardware.Id, 0, IntPtr.Zero, out availNetListPtr)) != 0)
				return new WlanInternSsidEntry[0];
			try
			{
				var availNetListHeader = (WlanInternSsidEntryListHeader) Marshal.PtrToStructure(availNetListPtr, typeof (WlanInternSsidEntryListHeader));
				long availNetListIt = availNetListPtr.ToInt64() + Marshal.SizeOf(typeof (WlanInternSsidEntryListHeader));
				var ssidEntries = new WlanInternSsidEntry[availNetListHeader.numberOfItems];
				for (int i = 0; i < availNetListHeader.numberOfItems; ++i)
				{
					ssidEntries[i] = (WlanInternSsidEntry) Marshal.PtrToStructure(new IntPtr(availNetListIt), typeof (WlanInternSsidEntry));
					availNetListIt += Marshal.SizeOf(typeof (WlanInternSsidEntry));
				}
				return ssidEntries;
			}
			finally
			{
				WlanInterop.FreeMemory(availNetListPtr);
			}
		}
Example #3
0
		internal Ssid(Nic owner, WlanInternSsidEntry ssidEntry, bool isConnectedOne)
		{
			_owner = owner;
			Reload(ssidEntry, isConnectedOne);
		}