MprAdminInterfaceGetCredentials

[This is preliminary documentation and subject to change.]

Use the MprAdminInterfaceGetCredentials function to retrieve the domain, username, 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 username
    LPWSTR    lpwsPassword,         // string to receive password
    LPWSTR    lpwsDomainName        // string to receive domain name
);

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 to receive the name of the user. This string should be UNLEN+1 long.

This parameter is optional. If the caller specifies NULL for this parameter, the function will not return the user name.

lpwsPassword
Pointer to a Unicode string to receive the password. This string should be PWLEN+1 long.

This parameter is optional. If the caller specifies NULL for this parameter, the function will not return the password.

lpwsDomainName
Pointer to a Unicode string to receive the domain name. This string should be DNLEN+1 long.

This parameter is optional. If the caller specifies NULL for this parameter, the function will not return the domain name.

Return Values

NO_ERROR
The credentials were retrieved successfully.
ERROR_CANNOT_FIND_PHONEBOOK_ENTRY
The specified interface doesn't have any demand dial parameters associated with it.
ERROR_INVALID_PARAMETER
At least, one of the following is true:

The lpwsInterfaceName parameter is NULL.

All three of the lpwsUserName, lpwsPassword, and lpwsDomainName parameters are NULL.

Other
Use FormatMessage to retrieve the system error message corresponding to the error code returned.

Remarks

The lpwsUserName, lpwsPassword, and lpwsDomainName parameters are optional. However, if the caller specifies NULL for all three parameters, MprAdminInterfaceGetCredentials will return ERROR_INVALID_PARAMETER.

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 MprAdminInterfaceGetCredentials is different from MprAdminInterfaceSetCredentials.

See Also

FormatMessage, MprAdminInterfaceSetCredentials