RasSetCustomAuthDataA function (ras.h)

Use the RasSetCustomAuthData function to set connection-specific authentication information. This information should not be specific to a particular user.


DWORD RasSetCustomAuthDataA(
  [in] LPCSTR pszPhonebook,
  [in] LPCSTR pszEntry,
  [in] BYTE   *pbCustomAuthData,
  [in] DWORD  dwSizeofCustomAuthData


[in] pszPhonebook

Pointer to a null-terminated string that specifies the full path of the phone-book (PBK) file. If this parameter is NULL, the function uses the system phone book.

[in] pszEntry

Pointer to a null-terminated string that specifies an existing entry name.

[in] pbCustomAuthData

Pointer to a buffer that specifies the new authentication data.

[in] dwSizeofCustomAuthData

Specifies the size of the data pointed to by the pbCustomAuthData parameter.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes or a value from Routing and Remote Access Error Codes or Winerror.h.

Value Meaning
The dwSizeofCustomAuthData parameter is zero, or the pbCustomAuthData parameter is NULL.

RasSetEapUserData was unable to open the specified phone-book file.


RasSetEapUserData was unable to find the specified entry in the phone book.

Use FormatMessage to retrieve the system error message that corresponds to the error code returned.



The ras.h header defines RasSetCustomAuthData as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ras.h
Library Rasapi32.lib
DLL Rasapi32.dll

See also