This function serves to change a user’s service password.
At a Glance
Header file: | Smtp.h |
Windows CE versions: | 2.0 and later |
Syntax
BOOL TransportSetPassword(HANDLE * InPtr, LPWSTR pszPassword, BOOL fRemember);
Parameters
InPtr
[in] Handle to the SERVICE structure.
lszPassword
[in] Null-terminated string to hold the user’s password. Transport should make a copy of it.
fRemember
Boolean that is set to TRUE to save the new password for use in the future. Otherwise, it is only to be used for the current session.
Return Values
TRUE indicates that the password is saved, depending on the value of fRemember, in memory for the current session or in the registry for future sessions. FALSE indicates failure.
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 version 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 version 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 version 2.0 do not expose the TransportSetPassword function, they can prompt for and save the password themselves as they would in Windows CE version 1.01.