MprAdminInterfaceGetCredentials function (mprapi.h)
Use the MprAdminInterfaceGetCredentials function to retrieve the domain, user name, and password for dialing out on the specified demand-dial interface.
Syntax
DWORD MprAdminInterfaceGetCredentials(
[in] LPWSTR lpwsServer,
[in] LPWSTR lpwsInterfaceName,
[out] LPWSTR lpwsUserName,
[out] LPWSTR lpwsPassword,
[out] LPWSTR lpwsDomainName
);
Parameters
[in] lpwsServer
Pointer to a null-terminated Unicode string that specifies the name of the router on which to execute this call.
This parameter is optional. If the calling application specifies NULL for this parameter, the call is executed on the local machine.
[in] lpwsInterfaceName
Pointer to a null-terminated Unicode string that specifies the name of the demand-dial interface. Use MprAdminInterfaceGetInfo to obtain the interface name.
[out] lpwsUserName
Pointer to a Unicode string that receives the name of the user. This string should be UNLEN+1 long.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not return the user name.
[out] lpwsPassword
Pointer to a Unicode string that receives the password. This string should be PWLEN+1 long.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not return the password.
[out] lpwsDomainName
Pointer to a Unicode string that receives the domain name. This string should be DNLEN+1 long.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not return the domain name.
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 |
---|---|
|
The specified interface does not have any demand-dial parameters associated with it. |
|
The lpwsInterfaceName parameter is NULL. |
|
The lpwsUserName, lpwsPassword, and lpwsDomainName parameters are all NULL. |
|
Use FormatMessage to retrieve the system error message that corresponds to the error code returned. |
Remarks
The lpwsUserName, lpwsPassword, and lpwsDomainName parameters are optional. If the calling application specifies NULL for all three parameters, MprAdminInterfaceGetCredentials returns NO_ERROR and the domain, user name, and password are not returned.
The constants UNLEN, PWLEN, and DNLEN are the maximum lengths for the user name, password, and domain name. These constants are defined in lmcons.h.
Note that the order of the parameters in MprAdminInterfaceGetCredentials is different from MprAdminInterfaceSetCredentials.
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
MprAdminInterfaceSetCredentials