Share via


SetPassword (Windows Embedded CE 6.0)

1/6/2010

This function sets the 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. For more information, see Local Authentication Plugin (LAP).

Syntax

BOOL SetPassword(
  LPWSTR lpszOldPassword, 
  LPWSTR lpszNewPassword 
);

Parameters

  • lpszOldPassword
    Pointer to a null-terminated string containing the old password.
  • lpszNewPassword
    Pointer to a null-terminated string containing the new password.

Return Value

If lpszNewPasswordis set to NULL, the active password is disabled. If lpszNewPassword is not set to NULL, it is used as the new password. TRUE is returned in both cases.

If lpszOldPassword is set to NULL and an active password exists or if lpszOldPassword is not set to NULL and is not the active password, FALSE is returned.

Remarks

If lpszOldPassword is set to NULL and no active password exists, lpszNewPassword is used as the new 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 windbase.h
Windows Embedded CE Windows CE 2.10 and later

See Also

Reference

File System Password Functions
CheckPassword
GetPasswordActive
SetPasswordActive