MprAdminServerGetCredentials function (mprapi.h)

The MprAdminServerGetCredentials function retrieves the pre-shared key for the specified server.

Syntax

DWORD MprAdminServerGetCredentials(
  [in]  MPR_SERVER_HANDLE hMprServer,
  [in]  DWORD             dwLevel,
  [out] LPBYTE            *lplpbBuffer
);

Parameters

[in] hMprServer

Handle to a Windows server. Obtain this handle by calling MprAdminMIBServerConnect.

[in] dwLevel

A DWORD value that describes the format in which the information is returned in the lplpbBuffer parameter. Must be zero.

[out] lplpbBuffer

On successful completion, a pointer to an MPR_CREDENTIALSEX_1 structure that contains the pre-shared key for the server. Free the memory occupied by this structure with MprAdminBufferFree.

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_INVALID_PARAMETER
The lplpbBuffer parameter is NULL.
ERROR_NOT_SUPPORTED
The dwLevel parameter is not zero.
Other
Use FormatMessage to retrieve the system error message that corresponds to the error code returned.

Remarks

The server maintains a single pre-shared key for all users.

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

MPR_CREDENTIALSEX_1

MprAdminServerSetCredentials

Router Administration Functions

Router Management Reference