Compartir a través de


CAccessToken::ImpersonateLoggedOnUser

Call this method to allow the calling thread to impersonate the security context of a logged-on user.

bool ImpersonateLoggedOnUser( ) const throw(...);

Return Value

Returns true on success, false on failure.

Remarks

Security Note:

If a call to an impersonation function fails for any reason, the client is not impersonated and the client request is made in the security context of the process from which the call was made. If the process is running as a highly privileged account, or as a member of an administrative group, the user might be able to perform actions he or she would otherwise be disallowed. Therefore, the return value for this function should always be confirmed.

Requirements

Header: atlsecurity.h

See Also

Concepts

CAccessToken Class

CAccessToken Members

CAccessToken::LoadUserProfile

CAccessToken::LogonUser