RasGetEapUserDataA function (ras.h)

Use the RasGetEapUserData function to retrieve user-specific Extensible Authentication Protocol (EAP) information for the specified phone-book entry.


DWORD RasGetEapUserDataA(
  [in]      HANDLE hToken,
  [in]      LPCSTR pszPhonebook,
  [in]      LPCSTR pszEntry,
  [out]     BYTE   *pbEapData,
  [in, out] DWORD  *pdwSizeofEapData


[in] hToken

Handle to a primary or impersonation access token that represents the user for which to retrieve data. This parameter can be NULL if the function is called from a process already running in the user's context.

[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.

[out] pbEapData

Pointer to a buffer that receives the retrieved EAP data for the user. The caller should allocate the memory for this buffer. If the buffer is not large enough, RasGetEapUserData returns ERROR_BUFFER_TOO_SMALL, and the pdwSizeofEapData parameter contains the required size.

[in, out] pdwSizeofEapData

Pointer to a DWORD variable that, on input, specifies the size of the buffer pointed to by the pbEapData parameter.

If the buffer specified by the pbEapData parameter is not large enough, pdwSizeofEapData receives, on output, the required size.

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 pdwSizeofEapData parameter is NULL.
The buffer pointed to by pbEapData is too small to receive the data. The pdwSizeofEapData contains the required size.

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


RasGetEapUserData 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 RasGetEapUserData 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



Remote Access Service (RAS) Overview

Remote Access Service Functions