Use the MprAdminInterfaceGetCredentials function to retrieve the domain, user name, and password for dialing out on the specified demand-dial interface.
DWORD MprAdminInterfaceGetCredentials( LPWSTR lpwsServer, // string containing name // of router LPWSTR lpwsInterfaceName, // string containing name // of interface LPWSTR lpwsUserName, // string to receive user name LPWSTR lpwsPassword, // string to receive password LPWSTR lpwsDomainName // string to receive domain name );
This parameter is optional. If the calling application specifies NULL for this parameter, the call is executed on the local machine.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not return the user name.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not return the password.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not return the domain name.
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_CANNOT_FIND_PHONEBOOK_ENTRY | The specified interface does not have any demand-dial parameters associated with it. |
ERROR_INVALID_PARAMETER | At least one of the following is true:
|
Other | Use FormatMessage to retrieve the system error message that corresponds to the error code returned. |
The lpwsUserName, lpwsPassword, and lpwsDomainName parameters are optional. However, if the calling application specifies NULL for all three parameters, MprAdminInterfaceGetCredentials returns ERROR_INVALID_PARAMETER.
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.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Mprapi.h.
Library: Use Mprapi.lib.
Router Management Reference, Router Administration Functions, FormatMessage, MprAdminInterfaceSetCredentials