WlanSaveTemporaryProfile function (wlanapi.h)
The WlanSaveTemporaryProfile function saves a temporary profile to the profile store.
Syntax
DWORD WlanSaveTemporaryProfile(
[in] HANDLE hClientHandle,
[in] const GUID *pInterfaceGuid,
[in] LPCWSTR strProfileName,
[in, optional] LPCWSTR strAllUserProfileSecurity,
[in] DWORD dwFlags,
[in] BOOL bOverWrite,
PVOID pReserved
);
Parameters
[in] hClientHandle
The client's session handle, obtained by a previous call to the WlanOpenHandle function.
[in] pInterfaceGuid
The GUID of the interface.
[in] strProfileName
The name of the profile to be saved. Profile names are case-sensitive. This string must be NULL-terminated.
[in, optional] strAllUserProfileSecurity
Sets the security descriptor string on the all-user profile. By default, for a new all-user profile, all users have write access on the profile. For more information about profile permissions, see the Remarks section.
If dwFlags is set to WLAN_PROFILE_USER, this parameter is ignored.
If this parameter is set to NULL for an all-user profile, the default permissions are used.
If this parameter is not NULL for an all-user profile, the security descriptor string associated with the profile is created or modified after the security descriptor object is created and parsed as a string.
[in] dwFlags
Specifies the flags to set on the profile. The flags can be combined.
[in] bOverWrite
Specifies whether this profile is overwriting an existing profile. If this parameter is FALSE and the profile already exists, the existing profile will not be overwritten and an error will be returned.
pReserved
Reserved for future use. Must be set to NULL.
Return value
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value may be one of the following return codes.
Return code | Description |
---|---|
|
One of the following conditions occurred:
|
|
The handle hClientHandle was not found in the handle table. |
|
This function was called from an unsupported platform. This value will be returned if this function was called from a Windows XP with SP3 or Wireless LAN API for Windows XP with SP2 client. |
|
Various error codes. |
|
The interface is not currently connected using a temporary profile. |
Remarks
A temporary profile is the one passed to WlanConnect or generated by the discovery engine. A network connection can be established using a temporary profile. Using this API saves the temporary profile and associated user data to the profile store.
A new profile is added at the top of the list after the group policy profiles. A profile's position in the list is not changed if an existing profile is overwritten.
All-user profiles have three associated permissions: read, write, and execute. If a user has read access, the user can view profile permissions. If a user has execute access, the user has read access and the user can also connect to and disconnect from a network using the profile. If a user has write access, the user has execute access and the user can also modify and delete permissions associated with a profile.
The following describes the procedure for creating a security descriptor object and parsing it as a string.
- Call InitializeSecurityDescriptor to create a security descriptor in memory.
- Call SetSecurityDescriptorOwner.
- Call InitializeAcl to create a discretionary access control list (DACL) in memory.
- Call AddAccessAllowedAce or AddAccessDeniedAce to add access control entries (ACEs) to the DACL. Set the AccessMask parameter to one of the following bitwise OR combinations as appropriate:
- WLAN_READ_ACCESS
- WLAN_READ_ACCESS | WLAN_EXECUTE_ACCESS
- WLAN_READ_ACCESS | WLAN_EXECUTE_ACCESS | WLAN_WRITE_ACCESS
- Call SetSecurityDescriptorDacl to add the DACL to the security descriptor.
- Call ConvertSecurityDescriptorToStringSecurityDescriptor to convert the descriptor to string.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | wlanapi.h (include Wlanapi.h) |
Library | Wlanapi.lib |
DLL | Wlanapi.dll |