SetPasswordStatus

This function activates or deactivates the current password.

BOOL SetPasswordStatus(
  DWORD dwStatus,
  LPWSTR lpszPassword
);

Parameters

  • dwStatus
    Specifies the state of the password. The system password can be active for the logon process and the password can be active for a screen saver. The following table shows the possible values.
    Value Description
    PASSWORD_STATUS_ACTIVE Makes the system password active. If this bit is not set, the password is disabled.
    PASSWORD_STATUS_SCREENSAVERPROTECT Makes the password active for a screen saver. When this is set it causes the startup screen to be displayed when a screen saver is deactivated by the user. If this bit is not set, no startup screen is displayed when the screen saver is deactivated by a user. The PASSWORD_STATUS_ACTIVE flag must also be set to set this flag.
  • lpszPassword
    Pointer to a null-terminated string containing the password.

Return Values

TRUE indicates that the password has been successfully activated or deactivated; otherwise, FALSE is returned.

Remarks

This function can activate or deactivate the password without requiring the password to be stored each time, thereby allowing the device to remember the password unless a cold-boot occurs. To activate or deactivate the password, lpszPassword must match the current password.

To use this function, you must include the Password component, Fspass, in your Cesysgen.bat file.

For a sample implementation of this function, see %_WINCEROOT%\Public\Wceshellfe\Oak\Ctlpnl\Cplmain\Passwd.cpp.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Pwinbase.h.
Link Library: Coredll.lib.

See Also

CheckPassword | GetPasswordActive | SetPassword | GetPasswordStatus

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.