MprAdminServerSetInfo function

The MprAdminServerSetInfo function is used to set the number of ports for L2TP, PPTP, and SSTP devices when the RRAS service is running.

Syntax


DWORD MprAdminServerSetInfo(
  _In_ MPR_SERVER_HANDLE hMprServer,
  _In_ DWORD             dwLevel,
  _In_ LPBYTE            lpbBuffer
);

Parameters

hMprServer [in]

Handle to the router to query. Obtain this handle by calling MprAdminServerConnect.

dwLevel [in]

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.

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

 

lpbBuffer [in]

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.

ValueMeaning
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_DDM_NOT_RUNNING

RRAS service is not running on this server.

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

This function is used to set the port count for L2TP, PPTP, and SSTP ports and enable or disable RRAS when the service is running. These values are persistent, meaning that you do not have to follow this call with a call to MprConfigServerSetInfo. Note that this function is asynchronous, so you might not see the affect of the changes immediately.

Examples

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

Requirements

Minimum supported client

None supported

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Mprapi.h

Library

Mprapi.lib

DLL

Mprapi.dll

See also

MPR_SERVER_1
MPR_SERVER_2
MprAdminBufferFree
MprAdminServerConnect
MprAdminServerGetInfo
Router Administration Functions
Router Management Reference

 

 

Community Additions

ADD
Show: