MprConfigServerSetInfo function (mprapi.h)

The MprConfigServerSetInfo function is used to set the port count for L2TP, PPTP, and SSTP ports and enable or disable RRAS on them in the registry when the RRAS service is not running so that it is picked up next time the system restarts.

Syntax

DWORD MprConfigServerSetInfo(
  [in] MPR_SERVER_HANDLE hMprServer,
  [in] DWORD             dwLevel,
  [in] LPBYTE            lpbBuffer
);

Parameters

[in] hMprServer

Handle to the router configuration. Obtain this handle by calling MprConfigServerConnect.

[in] dwLevel

A DWORD value that describes the format in which the information is structured in the lpbBuffer parameter. Acceptable values for dwLevel include 1 and 2 as listed in the following table.

Value Structure Format
1 Windows Server 2003 or later: MPR_SERVER_1
2 Windows Server 2008 or later: MPR_SERVER_2

[in] lpbBuffer

A pointer to a MPR_SERVER_1
or MPR_SERVER_2 structure. The dwLevel parameter indicates the type of structure.

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 privileges.
ERROR_SUCCESS_REBOOT_REQUIRED
A system reboot is required for such a change to take affect. Change the port count using the MprConfigServerSetInfo call and reboot.
ERROR_INVALID_PARAMETER
If you try to set the number of ports to more than the system supported limits as defined on the MPR_SERVER_1 and MPR_SERVER_2 topics.

Returns this error if you try to set the number of PPTP ports to 0.

Returns this error if the flags are not valid or if lpbBuffer or hMprServer is NULL.

ERROR_NOT_SUPPORTED
The value of dwLevel is not valid.
ERROR_INVALID_HANDLE
hMprServer handle is invalid.
Other
Use FormatMessage to retrieve the system error message that corresponds to the error code returned.

Remarks

These changes to a server configuration are persistent, but have no effect on a RRAS server until it is restarted.

Examples

The topic Setting L2TP and PPTP ports of a local RRAS service shows this function in use.

Requirements

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

See also

FormatMessage

MPR_SERVER_0

MPR_SERVER_1

MPR_SERVER_2

MprConfigBufferFree

MprConfigServerConnect

MprConfigServerGetInfo

Router Configuration Functions

Router Management Reference