internal static extern uint WlanHostedNetworkSetProperty( [In] WlanHandle clientHandle, [In] WlanHostedNetworkOpcode opCode, uint dataSize, IntPtr data, [Out] out WlanHostedNetworkReason failReason, IntPtr reserved);
internal static extern uint WlanHostedNetworkQuerySecondaryKey( [In] WlanHandle clientHandle, [Out] out uint keyLength, [Out] out IntPtr keyData, [Out] out bool isPassPhrase, [Out] out bool isPersistent, [Out] out WlanHostedNetworkReason failReason, IntPtr reserved);
internal static extern int WlanHostedNetworkSetSecondaryKey( [In] IntPtr hClientHandle, [In] uint pdwKeyLength, [In] IntPtr ppucKeyData, [In] bool pbIsPassPhrase, [In] bool pbPersistent, [Out, Optional] out WlanHostedNetworkReason pFailReason, [In, Out] IntPtr pvReserved );
internal static extern int WlanHostedNetworkStopUsing( [In] IntPtr hClientHandle, [Out, Optional] out WlanHostedNetworkReason pFailReason, [In, Out] IntPtr pvReserved );
private static void WriteReason(WlanHostedNetworkReason reason) { Console.WriteLine(WlanManager.ToString(reason)); }
internal static extern uint WlanHostedNetworkForceStop(IntPtr hClientHandle, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
internal static extern uint WlanHostedNetworkStartUsing(IntPtr hClientHandle, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
internal static extern uint WlanHostedNetworkSetSecondaryKey(IntPtr hClientHandle, uint dwKeyLength, [In, MarshalAs(UnmanagedType.LPStr)] string pucKeyData, bool bIsPassPhrase, bool bPersistent, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
internal static extern uint WlanHostedNetworkQuerySecondaryKey(IntPtr hClientHandle, [Out] out uint pKeyLength, [Out, MarshalAs(UnmanagedType.LPStr)] out string ppucKeyData, [Out] out bool pbIsPassPhrase, [Out] out bool pbPersistent, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
internal static extern uint WlanHostedNetworkForceStop( [In] WlanHandle clientHandle, [Out] out WlanHostedNetworkReason failReason, IntPtr reserved);
internal static extern uint WlanHostedNetworkInitSettings(IntPtr hClientHandle, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
public static extern int WlanHostedNetworkSetSecondaryKey(IntPtr hClientHandle, uint dwKeyLength, byte[] pucKeyData, bool bIsPassPhrase, bool bPersistent, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
public static extern int WlanHostedNetworkRefreshSecuritySettings(IntPtr hClientHandle, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
public static extern int WlanHostedNetworkForceStart(IntPtr hClientHandle, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
internal static extern uint WlanHostedNetworkInitSettings( [In] WlanHandle clientHandle, [Out] out WlanHostedNetworkReason failReason, IntPtr reserved);
internal static extern int WlanHostedNetworkRefreshSecuritySettings( [In] IntPtr hClientHandle, [Out, Optional] out WlanHostedNetworkReason pFailReason, [In, Out] IntPtr pvReserved );
internal static extern uint WlanHostedNetworkSetProperty(IntPtr hClientHandle, WlanHostedNetworkOpCode pOpCode, uint dwDataSize, IntPtr pvData, [Out] out WlanHostedNetworkReason pFailReason, IntPtr pReserved);
public static string ToString(WlanHostedNetworkReason reason) { switch (reason) { case WlanHostedNetworkReason.Success: return("操作成功。"); case WlanHostedNetworkReason.Unspecified: return("未知错误。"); case WlanHostedNetworkReason.BadParameters: return("参数错误。"); case WlanHostedNetworkReason.ServiceShuttingDown: return("服务正在关闭。"); case WlanHostedNetworkReason.InsufficientResources: return("服务资源不足。"); case WlanHostedNetworkReason.ElevationRequired: return("当前操作需要提升权限。"); case WlanHostedNetworkReason.ReadOnly: return("尝试修改只读数据。"); case WlanHostedNetworkReason.PersistenceFailed: return("数据持久化失败。"); case WlanHostedNetworkReason.CryptError: return("加密时出现错误。"); case WlanHostedNetworkReason.Impersonation: return("用户模拟失败。"); case WlanHostedNetworkReason.StopBeforeStart: return("函数调用顺序错误。"); case WlanHostedNetworkReason.InterfaceAvailable: return("无线接口可用。"); case WlanHostedNetworkReason.InterfaceUnavailable: return("无线接口不可用。"); case WlanHostedNetworkReason.MiniportStopped: return("无线微型端口驱动程序终止了托管网络。"); case WlanHostedNetworkReason.MiniportStarted: return("无线微型端口驱动程序状态已改变。"); case WlanHostedNetworkReason.IncompatibleConnectionStarted: return("开始了一个不兼容的连接。"); case WlanHostedNetworkReason.IncompatibleConnectionStopped: return("一个不兼容的连接已停止。"); case WlanHostedNetworkReason.UserAction: return("由于用户操作,状态已改变。"); case WlanHostedNetworkReason.ClientAbort: return("由于客户端终止,状态已改变。"); case WlanHostedNetworkReason.ApStartFailed: return("无线托管网络驱动启动失败。"); case WlanHostedNetworkReason.PeerArrived: return("一个客户端已连接到无线托管网络。"); case WlanHostedNetworkReason.PeerDeparted: return("一个客户端已从无线托管网络断开连接。"); case WlanHostedNetworkReason.PeerTimeout: return("一个客户端连接超时。"); case WlanHostedNetworkReason.GpDenied: return("操作被组策略禁止。"); case WlanHostedNetworkReason.ServiceUnavailable: return("无线局域网服务未运行。"); case WlanHostedNetworkReason.DeviceChange: return("无线托管网络所使用的无线适配器已改变。"); case WlanHostedNetworkReason.PropertiesChange: return("无线托管网络所使用的属性已改变。"); case WlanHostedNetworkReason.VirtualStationBlockingUse: return("一个活动的虚拟站阻止了操作。"); case WlanHostedNetworkReason.ServiceAvailableOnVirtualStation: return("在虚拟站上一个相同的服务已可用。"); default: return("未知的 WLAN_HOSTED_NETWORK_REASON。"); } }