Share via


WlanSaveTemporaryProfile (Compact 7)

3/12/2014

This function saves a temporary profile to the profile store.

Syntax

DWORD WlanSaveTemporaryProfile(
  __in        HANDLE hClientHandle,
  __in        CONST GUID* pInterfaceGuid,
  __in        LPCWSTR strProfileName,
  __in_opt    LPCWSTR strAllUserProfileSecurity,
  __in        DWORD dwFlags,
  __in        BOOL bOverWrite,
  __reserved  PVOID pReserved
);

Parameters

  • hClientHandle
    [in] Handle to the session on the client. To obtain a handle, call the WlanOpenHandle function.
  • pInterfaceGuid
    [in] GUID of the interface.
  • strProfileName
    [in] Name of the profile to be saved. Profile names are case sensitive and the string must be NULL terminated.
  • strAllUserProfileSecurity
    [in, optional] 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.

    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.

  • dwFlags
    [in] Designates the flags to set on the profile. The flags can be combined.

    Value Meaning

    0

    The profile is an all-user profile.

    WLAN_PROFILE_USER

    0x00000002

    The profile is a per-user profile.

    WLAN_PROFILE_CONNECTION_MODE_SET_BY_CLIENT

    0x00010000

    The profile was created by the client.

    WLAN_PROFILE_CONNECTION_MODE_AUTO

    0x00020000

    The profile was created by the automatic configuration module.

  • bOverWrite
    [in] Specifies whether this profile is overwriting an existing profile. If this parameter is FALSE and the profile already exists, it does not overwrite the existing profile and it returns an error.
  • pReserved
    Reserved; set to NULL.

Return Values

Value Description

ERROR_SUCCESS

The function succeeds.

ERROR_ACCESS_DENIED

You included Connection Manager in your OS.

ERROR_INVALID_PARAMETER

One of the following conditions occurred:

  • hClientHandle is NULL or invalid.
  • pInterfaceGuid is NULL.
  • pReserved is not NULL.
  • dwFlags is not set to a combination of one or more of the values specified in the previous table.
  • dwFlags is set to WLAN_PROFILE_CONNECTION_MODE_AUTO and strProfileName is NULL.

ERROR_INVALID_HANDLE

The handle hClientHandle was not found in the handle table.

ERROR_NOT_SUPPORTED

This function was called from an unsupported platform.

RPC_STATUS

Can be any remote procedure call (RPC) error code. The RPC call may be unsuccessful due to Wlan RPC server issues, such as when the RPC server is not started. Refer to RPC for more information.

ERROR_INVALID_STATE

The interface is currently not connected using a temporary profile.

Remarks

If you include Connection Manager in your OS design:

A temporary profile is one that is passed to WlanConnect or generated by the discovery engine. You can establish a network connection by using a temporary profile. Using this API saves the temporary profile and associated user data to the profile store.

See Also

Reference

Native Wi-Fi Functions
WlanOpenHandle
WlanConnect
Native Wi-Fi Reference