Export (0) Print
Expand All
Expand Minimize

WlanSetProfileCustomUserData function

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

Syntax


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

Parameters

hClientHandle [in]

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

pInterfaceGuid [in]

The GUID of the interface.

strProfileName [in]

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

dwDataSize [in]

The size of pData, in bytes.

pData [in]

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 codeDescription
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]

Header

Wlanapi.h (include Wlanapi.h)

Library

Wlanapi.lib

DLL

Wlanapi.dll

See also

WLAN_profile Schema
WlanGetProfile
WlanGetProfileCustomUserData
WlanGetProfileList
WlanSetProfile
WlanSetProfileEapUserData
WlanSetProfileEapXmlUserData

 

 

Community Additions

ADD
Show:
© 2014 Microsoft