次の方法で共有


SetPasswordStatus (Compact 2013)

3/26/2014

This function activates the current system password.

Note   The default Local Authentication Plugin (LAP) blocks the usage of the SetPasswordActive and the CheckPassword functions. Applications should not use these functions for authenticating the user. Use the VerifyUser and the CreateEnrollmentConfigDialog functions instead.

Syntax

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 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, the startup screen is 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 Value

TRUE indicates that the password has been successfully activated or deactivated. FALSE indicates failure.

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

Header

pwinbase.h

Library

coredll.lib

See Also

Reference

File System Password Functions
CheckPassword
GetPasswordActive
SetPassword
GetPasswordStatus