TwclWiFiProfilesManager.GetProfile(TGUID,string,TwclWiFiProfileFlags,string) Method

The method retrieves all information about a specified wireless profile.

Namespace: wclWiFi
public
 function GetProfile(const IfaceId: TGUID; const ProfileName: string;
 var Flags: TwclWiFiProfileFlags; out ProfileXml: string): Integer;

Parameters

IfaceId
Type: TGUID

The ID of the wireless interface.

ProfileName
Type: string

The name of the profile. Profile names are case-sensitive. The maximum length of the profile name is 255 characters. This means that the maximum length of this string is 255 characters.

Flags
Type: TwclWiFiProfileFlags

On input is used to provide additional information about the request. If this parameter is an empty set on input, then no information on profile flags will be returned.

On output is used to receive profile flags.

ProfileXml
Type: string

A string that is the XML representation of the queried profile. There is no predefined maximum string length.

Return Value

Type: Integer

If the function succeeds, the return value is wclErrors.WCL_E_SUCCESS. If the function fails, the return value may be one of the WCL return codes.

If the GetProfile function succeeds, the wireless profile is returned in the ProfileXml parameter. This is a string that is the XML representation of the queried profile. For a description of the XML representation of the wireless profile, see WLAN_profile Schema.

The keyMaterial element returned in the profile schema pointed to by the ProfileXml may be requested as plaintext if the GetProfile function is called with the pfGetPlaintextKey flag set in the value of the Flags parameter on input.

For a WEP key, both 5 ASCII characters or 10 hexadecimal characters can be used to set the plaintext key when the profile is created or updated. However, a WEP profile will be saved with 10 hexadecimal characters in the key no matter what the original input was used to create the profile. So in the profile returned by the GetProfile method, the plaintext WEP key is always returned as 10 hexadecimal characters.

By default, the keyMaterial element returned in the profile in the ProfileXml is encrypted. If your process runs in the context of the LocalSystem account on the same computer, then you can unencrypt key material by calling the CryptUnprotectData function.