MprAdminInterfaceSetCredentials

[This is preliminary documentation and subject to change.]

Use MprAdminInterfaceSetCredentials function to set the domain, username, and password that will be used for dialing out on the specified demand-dial interface.

MprAdminInterfaceSetCredentials ( 
    LPWSTR    lpwsServer,           // string containing name
                                    // of router
    LPWSTR    lpwsInterfaceName,    // string containing name
                                    // of interface
    LPWSTR    lpwsUserName,         // string containing username
    LPWSTR    lpwsDomainName,       // string containing domain name
    LPWSTR    lpwsPassword          // string containing password
);

Parameters

lpwsServer
Pointer to a Unicode string containing the name of the Windows NT router on which to execute this call.

This parameter is optional. If the caller specifies NULL for this parameter, the call is executed on the local machine.

lpwsInterfaceName
Pointer to a Unicode string containing the name of the demand-dial interface.
LpwsUserName
Pointer to a Unicode string containing the username.

This parameter is optional. If the caller specifies NULL for this parameter, the function will not change the username associated with this interface.

LpwsPassword
Pointer to a Unicode string containing the password.

This parameter is optional. If the caller specifies NULL for this parameter, the function will not change the password associated with this interface.

LpwsDomainName
Pointer to a Unicode string containing the domain name.

This parameter is optional. If the caller specifies NULL for this parameter, the function will not change the domain name associated with this interface.

Return Values

NO_ERROR
The credentials were set successfully.
ERROR_INVALID_PARAMETER
At least, one of the following is true:

The lpwsInterfaceName parameter is NULL, or it is longer than MAX_INTERFACE_NAME_LEN.

At least one of the lpwsUserName, lpwsPassword, and lpwsDomainName parameters too long, and therefore invalid. See Remarks section for more information.

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 corresponding to the error code returned.

Remarks

The lpwsUserName, lpwsPassword, and lpwsDomainName parameters are optional. If the caller specifies NULL for all three parameters, MprAdminInterfaceSetCredentials will remove all credential information for this interface.

The constants UNLEN, PWLEN, and DNLEN are the maximum lengths for the username, password, and domain name. These constants are defined in lmcons.h.

Note that the order of the parameters in MprAdminInterfaceSetCredentials is different from MprAdminInterfaceGetCredentials.

See Also

FormatMessage, MprAdminInterfaceGetCredentials, MprAdminInterfaceGetInfo