WlanSetProfileCustomUserData function (wlanapi.h)

The WlanSetProfileCustomUserData function sets the custom user data associated with a profile.

Syntax

DWORD WlanSetProfileCustomUserData(
  [in] HANDLE      hClientHandle,
  [in] const GUID  *pInterfaceGuid,
  [in] LPCWSTR     strProfileName,
  [in] DWORD       dwDataSize,
  [in] const PBYTE pData,
       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 associated with the custom user data. Profile names are case-sensitive. This string must be NULL-terminated.

[in] dwDataSize

The size of pData, in bytes.

[in] pData

A pointer to the user data to be set.

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
ERROR_INVALID_PARAMETER
One of the following conditions occurred:
  • hClientHandle is NULL or invalid.
  • pInterfaceGuid is NULL.
  • strProfileName is NULL.
  • pReserved is not NULL.
  • dwDataSize is not 0 and pData 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. 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.
RPC_STATUS
Various error codes.

Remarks

For every wireless WLAN profile used by the Native Wifi AutoConfig service, Windows maintains the concept of custom user data. This custom user data is initially non-existent, but can be set by calling the WlanSetProfileCustomUserData function. The custom user data gets reset to empty any time the profile is modified by calling the WlanSetProfile function.

Once custom user data has been set, this data can be accessed using the WlanGetProfileCustomUserData function.

All wireless LAN functions require an interface GUID for the wireless interface when performing profile operations. When a wireless interface is removed, its state is cleared from Wireless LAN Service (WLANSVC) and no profile operations are possible.

The WlanSetProfileCustomUserData function can fail with ERROR_INVALID_PARAMETER if the wireless interface specified in the pInterfaceGuid parameter has been removed from the system (a USB wireless adapter that has been removed, for example).

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

See also

WLAN_profile Schema

WlanGetProfile

WlanGetProfileCustomUserData

WlanGetProfileList

WlanSetProfile

WlanSetProfileEapUserData

WlanSetProfileEapXmlUserData