MprAdminConnectionGetInfo function (mprapi.h)

The MprAdminConnectionGetInfo function retrieves data about a specific connection.

Syntax

DWORD MprAdminConnectionGetInfo(
  [in]  RAS_SERVER_HANDLE hRasServer,
  [in]  DWORD             dwLevel,
  [in]  HANDLE            hRasConnection,
  [out] LPBYTE            *lplpbBuffer
);

Parameters

[in] hRasServer

A handle to the computer from which the connection information is retrieved. To obtain this handle, call MprAdminServerConnect.

[in] dwLevel

A DWORD value that describes the format in which the information is returned in the lplpbBuffer parameter. Acceptable values for dwLevel include 0, 1, 2, and 3, as listed in the following table.

Windows NT 4.0:  This parameter must be zero.

Value Structure Format
0 RAS_CONNECTION_0
1 Windows 2000 or later: RAS_CONNECTION_1
2 Windows 2000 or later: RAS_CONNECTION_2
3 Windows Server 2008 or later: RAS_CONNECTION_3

[in] hRasConnection

A handle to the connection to retrieve data about. To obtain this handle, call MprAdminConnectionEnum.

[out] lplpbBuffer

On successful completion, a pointer to an array of structures that describe the connection. These structures are of type RAS_CONNECTION_0, RAS_CONNECTION_1, RAS_CONNECTION_2, or RAS_CONNECTION_3, depending on the value of the dwLevel parameter.

To free this memory, call MprAdminBufferFree.

Return value

If the function succeeds, the return value is NO_ERROR.

If the function fails, the return value is one of the error codes listed in the following table.

Return code Description
ERROR_INVALID_PARAMETER
The handle to the RAS server or the handle to the RAS connection is invalid.
ERROR_INVALID_LEVEL
The value passed for dwLevel is not zero, one, two, or three. Levels one and two are supported only on Windows 2000 or later. Level three is supported only on Windows Server 2008 or later.
ERROR_INTERFACE_NOT_CONNECTED
The hConnection handle is invalid.
RPC_S_INVALID_BINDING
The hRasServer handle is invalid.
Other
An error from MprError.h, RasError.h, or WinError.h.

Remarks

This function is available on Windows NT 4.0 if the RRAS redistributable is installed. However, the version of Mprapi.dll included in the RRAS redistributable exports the function as RasAdminConnectionGetInfo rather than MprAdminConnectionGetInfo. Therefore, when using the RRAS redistributable, use LoadLibrary and GetProcAddress to access this function.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header mprapi.h
Library Mprapi.lib
DLL Mprapi.dll

See also

MprAdminBufferFree

MprAdminConnectionEnum

MprAdminServerConnect

RAS Administration Functions

RAS_CONNECTION_0

RAS_CONNECTION_1

RAS_CONNECTION_2

RAS_CONNECTION_3

Remote Access Service Administration Reference