Partager via


CAccessToken Class

This class is a wrapper for an access token.

Important

This class and its members cannot be used in applications that execute in the Windows Runtime.

class CAccessToken

Members

Public Constructors

Name

Description

CAccessToken::~CAccessToken

The destructor.

Public Methods

Name

Description

CAccessToken::Attach

Call this method to take ownership of the given access token handle.

CAccessToken::CheckTokenMembership

Call this method to determine if a specified SID is enabled in the CAccessToken object.

CAccessToken::CreateImpersonationToken

Call this method to create a new impersonation access token.

CAccessToken::CreatePrimaryToken

Call this method to create a new primary token.

CAccessToken::CreateProcessAsUser

Call this method to create a new process running in the security context of the user represented by the CAccessToken object.

CAccessToken::CreateRestrictedToken

Call this method to create a new, restricted CAccessToken object.

CAccessToken::Detach

Call this method to revoke ownership of the access token.

CAccessToken::DisablePrivilege

Call this method to disable a privilege in the CAccessToken object.

CAccessToken::DisablePrivileges

Call this method to disable one or more privileges in the CAccessToken object.

CAccessToken::EnablePrivilege

Call this method to enable a privilege in the CAccessToken object.

CAccessToken::EnablePrivileges

Call this method to enable one or more privileges in the CAccessToken object.

CAccessToken::GetDefaultDacl

Call this method to return the CAccessToken object's default DACL.

CAccessToken::GetEffectiveToken

Call this method to get the CAccessToken object equal to the access token in effect for the current thread.

CAccessToken::GetGroups

Call this method to return the CAccessToken object's token groups.

CAccessToken::GetHandle

Call this method to retrieve a handle to the access token.

CAccessToken::GetImpersonationLevel

Call this method to get the impersonation level from the access token.

CAccessToken::GetLogonSessionId

Call this method to get the Logon Session ID associated with the CAccessToken object.

CAccessToken::GetLogonSid

Call this method to get the Logon SID associated with the CAccessToken object.

CAccessToken::GetOwner

Call this method to get the owner associated with the CAccessToken object.

CAccessToken::GetPrimaryGroup

Call this method to get the primary group associated with the CAccessToken object.

CAccessToken::GetPrivileges

Call this method to get the privileges associated with the CAccessToken object.

CAccessToken::GetProcessToken

Call this method to initialize the CAccessToken with the access token from the given process.

CAccessToken::GetProfile

Call this method to get the handle pointing to the user profile associated with the CAccessToken object.

CAccessToken::GetSource

Call this method to get the source of the CAccessToken object.

CAccessToken::GetStatistics

Call this method to get information associated with the CAccessToken object.

CAccessToken::GetTerminalServicesSessionId

Call this method to get the Terminal Services Session ID associated with the CAccessToken object.

CAccessToken::GetThreadToken

Call this method to initialize the CAccessToken with the token from the given thread.

CAccessToken::GetTokenId

Call this method to get the Token ID associated with the CAccessToken object.

CAccessToken::GetType

Call this method to get the token type of the CAccessToken object.

CAccessToken::GetUser

Call this method to identify the user associated with the CAccessToken object.

CAccessToken::HKeyCurrentUser

Call this method to get the handle pointing to the user profile associated with the CAccessToken object.

CAccessToken::Impersonate

Call this method to assign an impersonation CAccessToken to a thread.

CAccessToken::ImpersonateLoggedOnUser

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

CAccessToken::IsTokenRestricted

Call this method to test if the CAccessToken object contains a list of restricted SIDs.

CAccessToken::LoadUserProfile

Call this method to load the user profile associated with the CAccessToken object.

CAccessToken::LogonUser

Call this method to create a logon session for the user associated with the given credentials.

CAccessToken::OpenCOMClientToken

Call this method from within a COM server handling a call from a client to initialize the CAccessToken with the access token from the COM client.

CAccessToken::OpenNamedPipeClientToken

Call this method from within a server taking requests over a named pipe to initialize the CAccessToken with the access token from the client.

CAccessToken::OpenRPCClientToken

Call this method from within a server handling a call from an RPC client to initialize the CAccessToken with the access token from the client.

CAccessToken::OpenThreadToken

Call this method to set the impersonation level and then initialize the CAccessToken with the token from the given thread.

CAccessToken::PrivilegeCheck

Call this method to determine whether a specified set of privileges are enabled in the CAccessToken object.

CAccessToken::Revert

Call this method to stop a thread that is using an impersonation token.

CAccessToken::SetDefaultDacl

Call this method to set the default DACL of the CAccessToken object.

CAccessToken::SetOwner

Call this method to set the owner of the CAccessToken object.

CAccessToken::SetPrimaryGroup

Call this method to set the primary group of the CAccessToken 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.

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