WlanSetProfileCustomUserData function

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

Syntax

DWORD WlanSetProfileCustomUserData(
  HANDLE      hClientHandle,
  const GUID  *pInterfaceGuid,
  LPCWSTR     strProfileName,
  DWORD       dwDataSize,
  const PBYTE pData,
  PVOID       pReserved
);

Parameters

hClientHandle

The client's session handle, obtained by a previous call to the WlanOpenHandle function.

pInterfaceGuid

The GUID of the interface.

strProfileName

The name of the profile associated with the custom user data. Profile names are case-sensitive. This string must be NULL-terminated.

dwDataSize

The size of pData, in bytes.

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

   
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