internal static extern int WlanGetSecuritySettings( [In] IntPtr hClientHandle, [In] WlanSecurableObject SecurableObject, [Out, Optional] out WlanOpcodeValueType pValueType, [Out] out IntPtr strCurrentSDDL, [Out] out WlanAccess pdwGrantedAccess );
public static extern int WlanGetProfile( [In] IntPtr clientHandle, [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, [In, MarshalAs(UnmanagedType.LPWStr)] string profileName, [In] IntPtr pReserved, [Out] out IntPtr profileXml, [Out, Optional] out WlanProfileFlags flags, [Out, Optional] out WlanAccess grantedAccess);
internal static extern int WlanGetProfile( [In] IntPtr hClientHandle, [In, MarshalAs(UnmanagedType.LPStruct)] Guid interfaceGuid, [In, MarshalAs(UnmanagedType.LPWStr)] string strProfileName, [In, Out] IntPtr pReserved, [Out] out IntPtr strProfileXml, [Out, Optional] out WlanProfileFlags dwFlags, [Out, Optional] out WlanAccess pdwGrantedAccess );
/// <summary> /// Gets the profile's XML specification. Request Key unencrypted in plaintext. /// </summary> /// <param name="profileName">The name of the profile.</param> /// <returns>The XML document.</returns> public string GetProfileXmlUnencrypted(string profileName) { IntPtr profileXmlPtr; WlanProfileFlags flags = WlanProfileFlags.GetPlaintextKey; // | WlanProfileFlags.User; WlanAccess access = WlanAccess.ReadAccess; WlanInterop.ThrowIfError(WlanInterop.WlanGetProfile(client.clientHandle, info.interfaceGuid, profileName, IntPtr.Zero, out profileXmlPtr, out flags, out access)); try { return(Marshal.PtrToStringUni(profileXmlPtr)); } finally { WlanInterop.WlanFreeMemory(profileXmlPtr); } }