MprAdminServerConnect function (mprapi.h)

The MprAdminServerConnect function establishes a connection to a router for the purpose of administering that router. Call this function before making any other calls to the server. Use the handle returned in subsequent calls to administer interfaces on the server.

Syntax

DWORD MprAdminServerConnect(
  [in, optional] LPWSTR            lpwsServerName,
  [out]          MPR_SERVER_HANDLE *phMprServer
);

Parameters

[in, optional] lpwsServerName

A pointer to a null-terminated Unicode string that specifies the name of the remote server. If this parameter is NULL, the function returns a handle to the local machine.

[out] phMprServer

A pointer to a HANDLE variable that receives a handle to the server. Use this handle in subsequent calls to administer the server.

Return value

If the function succeeds, the return value is NO_ERROR.

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

Value Meaning
ERROR_ACCESS_DENIED
The calling application does not have sufficient privilege.
RPC_S_INVALID_BINDING
This function was called with phMprServer parameter equal to NULL.
RPC_S_UNKNOWN_IF
The specified computer is not running the Routing and RAS service.

Remarks

MprAdminIsServiceRunning must be used to determine the status of the RRAS service on the remote server. MprAdminServerConnect does not query the RRAS service when establishing a connection.

Requirements

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

See also

MprAdminServerDisconnect

Router Administration Functions

Router Management Reference