PwdChangePassword

This function is used to change the user's Windows password or a password provider's password. The MPR displays a dialog box for this purpose. If the Windows password is changed, the MPR re-encrypts the user's password cache with the new password. Password providers are notified through the PPChangePassword SPI.


DWORD PwdChangePassword(
    LPCTSTR lpProvider,
    HWND hwndOwner,
    DWORD dwFlags
    );

lpProvider

Specifies the provider to change the password for. If lpProvider is NULL, the logon password is changed. Changing the logon password can also result in other password providers being notified to change their passwords, if the user has selected to synchronize a provider's password with the logon password.

hwndOwner

A handle to a window which should be the owner for the dialog box displayed by the MPR.

dwFlags

Can be 0, or a combination of the following:

CHANGEPWD_OLDPWDONLY

Displays a dialog that prompts only for the previous password. The current logon password is given to the password provider as the new password to use. This flag is ignored if PwdChangePassword is called to change the logon password (lpProvider is NULL). This flag is intended primarily for use by the system, it is not recommended that applications set this flag.


WN_CANCEL

The user canceled the operation.