TransportSetPassword

The TransportSetPassword function serves to change a user's service password.

Syntax

BOOL TransportSetPassword(HANDLE * InPtr, LPWSTR pszPassword, BOOL fRemember);

At a Glance

Header file: Smtp.h
Platforms: H/PC
Windows CE versions: 2.0 and later

Parameters

InPtr
Handle to the SERVICE structure.
lszPassword
String to hold the user's password. The Transport should make a copy of it.
fRemember
If TRUE, the new password is to be saved for use in the future. Otherwise, it is only to be used for the current session.

Return Values

Returns TRUE if the password is saved, depending on the value of fRemember, in memory for the current session or in the registry for future sessions. Otherwise it returns FALSE.

Remarks

Transport DLLs can expose this function. This practice is encouraged, but not required. A mail client, such as Inbox, calls the function when the user changes her service password through the client.

In Windows CE 2.0, the POP3 transport encrypts the user's password before saving it in the registry. Inbox is refrained from touching the transport's registry entries. Before connecting the transport, the client application calls the TransportSetPassword function whenever the user supplies a password. This makes the transport the sole partner responsible for password encryption. The client application does not need to have any knowledge of the encryption.

The transports in Windows CE 1.01 do not expose this function. The Inbox application updates the transport section of the registry with the unencrypted password as entered by the user in the Password dialog.

When transport DLLs in Windows CE 2.0 do not expose the TransportSetPassword function, they can prompt for and save the password themselves as they would in Windows CE 1.01.