WindowsApi/Win32/Wlanapi/WlanapiBase.cs

(开头部分) 8KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace Utils.WindowsApi
{
    public partial class WlanapiBase
    {
        private const string Wlanapi = "Wlanapi.dll";

        public const uint WLAN_CLIENT_VERSION_XP_SP2 = 1;
        public const uint WLAN_CLIENT_VERSION_LONGHORN = 2;

        /// <summary>
		/// Defines the callback function which accepts WLAN notifications.
		/// </summary>
		public delegate void WlanNotificationCallbackDelegate(ref WlanNotificationData notificationData, IntPtr context);

        //https://learn.microsoft.com/zh-cn/windows/win32/api/wlanapi/nf-wlanapi-wlanopenhandle
        [DllImport(Wlanapi)]
        public static extern int WlanOpenHandle(
			uint dwClientVersion,
			IntPtr pReserved, 
			[Out] out uint pdwNegotiatedVersion, 
			[Out] out IntPtr ClientHandle);

		//https://learn.microsoft.com/zh-cn/previous-versions/windows/embedded/gg159537(v=winembedded.80)
		[DllImport(Wlanapi)]
		public static extern int WlanRegisterNotification(
			IntPtr hClientHandle,
			WlanNotificationSource dwNotifSource,
			bool bIgnoreDuplicate,
			WlanNotificationCallbackDelegate funcCallback,
			IntPtr pCallbackContext,
			IntPtr pReserved,
			[Out] out WlanNotificationSource pdwPrevNotifSource);

		//https://learn.microsoft.com/zh-cn/windows/win32/api/wlanapi/nf-wlanapi-wlanclosehandle
		[DllImport(Wlanapi)]
		public static extern int WlanCloseHandle(
			[In] IntPtr hClientHandle, 
			IntPtr pReserved);

		//https://learn.microsoft.com/zh-cn/windows/win32/api/wlanapi/nf-wlanapi-wlanqueryinterface
		[DllImport(Wlanapi)]
		public static extern int WlanQueryInterface(
			[In] IntPtr clientHandle,
			[In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid,
			[In] WlanIntfOpcode opCode, 
			[In, Out] IntPtr pReserved,
			[Out] out int dataSize,
			[Out] out IntPtr ppData,
			[Out] out WlanOpcodeValueType wlanOpcodeValueType);

		//https://learn.microsoft.com/zh-cn/windows/win32/api/wlanapi/nf-wlanapi-wlansetinterface
后面还有 156 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。