Share via


User Management (Windows Embedded CE 6.0)

1/6/2010

User profiles enable several users to access a device, keeping their individual preferences and settings separate. Only one user can be logged on at a time.

To log a new user on, use the SetCurrentUser function. SetCurrentUser logs the previous user, if any, off and logs the new user on. SetCurrentUser simply switches the user registry. It does not communicate a user logon to system processes, drivers, or services. It also does not shut down non-system applications. There is currently no mechanism to reset system processes with a new user's settings. So, in most cases, a device reset is required to boot with the new user's settings.

Additionally, since the OEM's startup user interface (UI), which requests the user's name and password, is started after some system drivers and services that read a user's preferences, such as the screen input panel keyboard, those drivers and services require a user to be logged on at startup. If those drivers and services are in use, the OEM must specify a default user to be logged on during startup. The device starts with that user's settings. When the startup UI calls SetCurrentUser, the user is authenticated and fully logged on.

SetCurrentUser also authenticates the user by passing a buffer of opaque user data, such as a password, to the security subsystem. That buffer is used internally by functions such as CryptProtectData to protect a user's password. To change the user's opaque data buffer, for instance to change their password, use the SetUserData function.

To find out which user is currently logged on, call the GetUserNameEx function with the NameWindowsCeLocal name format. This function returns the user name that was passed to SetCurrentUser.

Each user is given a separate user profile directory into which applications can put user-specific files and data. To retrieve the location of the current user's profile directory, call the GetUserDirectory, SHGetSpecialFolderLocation, or SHGetSpecialFolderPath function with the CSIDL_PROFILE identifier.

There may be other passwords in the system. Do not confuse the current user's password with the system password, which is controlled by the SetPassword, CheckPassword, SetPasswordStatus, and GetPasswordStatus functions. The system password applies to the entire system and is independent of the current user. Network passwords are another example of passwords that are independent of the current user.

See Also

Reference

GetUserDirectory
GetUserNameEx

Concepts

User Profiles in the Registry
User Profile Setup
User Profile Storage