Compartir a través de


CAutoRevertImpersonation Class

This class reverts CAccessToken objects to a nonimpersonating state when it goes out of scope.

class CAutoRevertImpersonation

Members

Public Constructors

Name

Description

CAutoRevertImpersonation::CAutoRevertImpersonation

Constructs an CAutoRevertImpersonation object

CAutoRevertImpersonation::~CAutoRevertImpersonation

Destroys the object and reverts access token impersonation.

Public Methods

Name

Description

CAutoRevertImpersonation::Attach

Automates the impersonation reversion of an access token.

CAutoRevertImpersonation::Detach

Cancels the automatic impersonation reversion.

CAutoRevertImpersonation::GetAccessToken

Retrieves the access token current associated with this object.

Remarks

An access token is an object that describes the security context of a process or thread and is allocated to each user logged onto a Windows NT or Windows 2000 system. These access tokens can be represented with the CAccessToken class.

It is sometimes necessary to impersonate access tokens. This class is provided as a convenience, but it does not perform the impersonation of access tokens; it only performs the automatic reversion to a nonimpersonated state. This is because token access impersonation can be performed several different ways.

For an introduction to the access control model in Windows, see Access Control in the Windows SDK.

Requirements

Header: atlsecurity.h

See Also

Reference

Access Tokens

Concepts

ATLSecurity Sample

Other Resources

ATL Class Overview