MprAdminInterfaceSetCredentials function (mprapi.h)
Use MprAdminInterfaceSetCredentials function to set the domain, user name, and password that will be used for dialing out on the specified demand-dial interface.
Syntax
DWORD MprAdminInterfaceSetCredentials(
[in] LPWSTR lpwsServer,
[in] LPWSTR lpwsInterfaceName,
[in] LPWSTR lpwsUserName,
[in] LPWSTR lpwsDomainName,
[in] LPWSTR lpwsPassword
);
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.
[in] lpwsUserName
Pointer to a null-terminated Unicode string that specifies the user name.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not change the user name associated with this interface.
[in] lpwsDomainName
Pointer to a null-terminated Unicode string that specifies the domain name.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not change the domain name associated with this interface.
[in] lpwsPassword
Pointer to a null-terminated Unicode string that specifies the password.
This parameter is optional. If the calling application specifies NULL for this parameter, the function does not change the password associated with this interface.
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 |
---|---|
|
At least one of the following is true:
|
|
Insufficient memory to create a new data structure to contain the credentials. |
|
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, 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.
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
MprAdminInterfaceGetCredentials