IUserIdentityManager::Logon method

[IUserIdentityManager::Logon is not supported and may be altered or unavailable in the future. Instead, use User Accounts with Fast User Switching and Remote Desktop.]

Displays a UI to the user, allowing the user to choose a user identity. If successful, the user identity will be logged on and retrieved.

Syntax

HRESULT Logon(
  [in]  HWND          hwndParent,
  [in]  DWORD         dwFlags,
  [out] IUserIdentity **ppIdentity
);

Parameters

hwndParent [in]

Type: HWND

An HWND value that identifies a window that will be brought to the foreground after the logon UI is dismissed.

dwFlags [in]

Type: DWORD

Optional flags to define how the UI will behave. Set to UIL_FORCE_UI to force the UI to display, even if an identity has already been chosen.

ppIdentity [out]

Type: IUserIdentity**

The address of the pointer that receives the chosen user identity.

Return value

Type: HRESULT

Result of the logon operation. If successful, it returns S_OK. Otherwise it will return one of the following error codes.

Return code Description
E_USER_CANCELLED
The user canceled the logon operation from the UI.
E_OUTOFMEMORY
The user identity could not be created.
E_UNEXPECTED
The operation failed unexpectedly.
E_IDENTITIES_DISABLED
Identity management is disabled on the system.
S_IDENTITIES_DISABLED
Identity management is disabled on the system.
E_IDENTITY_CHANGING
The system is currently switching identities, and cannot complete the operation.

 

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
End of client support
Windows 2000 Professional
End of server support
Windows 2000 Server
Header
Msident.h
IDL
Msident.idl
DLL
Msident.dll

See also

IUserIdentityManager

IUserIdentityManager::Logoff

IUserIdentityManager::ManageIdentities