The RasEnumDevices function returns the name and type of all available RAS-capable devices.
DWORD RasEnumDevices(
LPRASDEVINFO lpRasDevInfo, // buffer to receive information about
// RAS devices
LPDWORD lpcb, // size, in bytes, of the buffer
LPDWORD lpcDevices // receives the number of entries
// written to the buffer
);
sizeof(RASDEVINFO)
to identify the version of the structure. To determine the required buffer size, call RasEnumDevices with the lpRasDevInfo parameter set to NULL and the variable pointed to by lpcb set to zero. The function returns the required buffer size in the variable pointed to by lpcb.
If the function succeeds, the return value is zero.
If the function fails, the return value is a nonzero RAS error value or one of following error codes.
Value | Meaning |
ERROR_BUFFER_TOO_SMALL | The lpRasDevInfo buffer is not large enough. The function returns the required buffer size in the variable pointed to by lpcb. |
ERROR_NOT_ENOUGH_MEMORY | Indicates insufficient memory. |
ERROR_INVALID_PARAMETER | Indicates an invalid parameter value. |
ERROR_INVALID_USER_BUFFER | The address or buffer specified by lpRasDevInfo is invalid. |
Windows NT: Requires version 4.0 or later.
Windows: Requires Windows 95 OSR2 or later.
Windows CE: Unsupported.
Header: Declared in ras.h.
Import Library: Use rasapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Remote Access Service Overview, RAS Server Administration Functions, RASDEVINFO