Use MprAdminInterfaceSetCredentials function to set the domain, user name, and password that will be used for dialing out on the specified demand-dial interface.
DWORD MprAdminInterfaceSetCredentials( LPWSTR lpwsServer, // string containing name // of router LPWSTR lpwsInterfaceName, // string containing name // of interface LPWSTR lpwsUserName, // string containing user name LPWSTR lpwsDomainName, // string containing domain name LPWSTR lpwsPassword // string containing password );
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 will not change the user name associated with this interface.
This parameter is optional. If the calling application specifies NULL for this parameter, the function will not change the domain name associated with this interface.
This parameter is optional. If the calling application specifies NULL for this parameter, the function will not change the password associated with this interface.
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_INVALID_PARAMETER | At least one of the following is true:
|
ERROR_NOT_ENOUGH_MEMORY | Insufficient memory to create a new data structure to contain the credentials. |
Other | Use FormatMessage to retrieve the system error message that corresponds to the error code returned. |
The lpwsUserName, lpwsPassword, and lpwsDomainName parameters are optional. If the calling application specifies NULL for all three parameters, MprAdminInterfaceSetCredentials removes all credential information for this interface.
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 MprAdminInterfaceSetCredentials is different from MprAdminInterfaceGetCredentials.
Windows NT/2000: Requires Windows 2000.
Header: Declared in Mprapi.h.
Library: Use Mprapi.lib.
Router Management Reference, Router Administration Functions, FormatMessage, MprAdminInterfaceGetCredentials, MprAdminInterfaceGetInfo