Freigeben über


CTokenPrivileges Class

This class is a wrapper for the TOKEN_PRIVILEGES structure.

Important

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

class CTokenPrivileges

Members

Public Constructors

Name

Description

CTokenPrivileges::CTokenPrivileges

The constructor.

CTokenPrivileges::~CTokenPrivileges

The destructor.

Public Methods

Name

Description

CTokenPrivileges::Add

Adds one or more privileges to the CTokenPrivileges object.

CTokenPrivileges::Delete

Deletes a privilege from the CTokenPrivileges object.

CTokenPrivileges::DeleteAll

Deletes all privileges from the CTokenPrivileges object.

CTokenPrivileges::GetCount

Returns the number of privilege entries in the CTokenPrivileges object.

CTokenPrivileges::GetDisplayNames

Retrieves display names for the privileges contained in the CTokenPrivileges object.

CTokenPrivileges::GetLength

Returns the buffer size in bytes required to hold the TOKEN_PRIVILEGES structure represented by the CTokenPrivileges object.

CTokenPrivileges::GetLuidsAndAttributes

Retrieves the locally unique identifiers (LUIDs) and attribute flags from the CTokenPrivileges object.

CTokenPrivileges::GetNamesAndAttributes

Retrieves the privilege names and attribute flags from the CTokenPrivileges object.

CTokenPrivileges::GetPTOKEN_PRIVILEGES

Returns a pointer to the TOKEN_PRIVILEGES structure.

CTokenPrivileges::LookupPrivilege

Retrieves the attribute associated with a given privilege name.

Public Operators

Name

Description

CTokenPrivileges::operator const TOKEN_PRIVILEGES *

Casts a value to a pointer to the TOKEN_PRIVILEGES structure.

CTokenPrivileges::operator =

Assignment operator.

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.

The access token is used to describe the various security privileges granted to each user. A privilege consists of a 64-bit number called a locally unique identifier (LUID) and a descriptor string.

The CTokenPrivileges class is a wrapper for the TOKEN_PRIVILEGES structure and contains 0 or more privileges. Privileges can be added, deleted, or queried using the supplied class methods.

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

Requirements

Header: atlsecurity.h

See Also

Reference

TOKEN_PRIVILEGES

LUID

LUID_AND_ATTRIBUTES

Concepts

Security Sample

Other Resources

ATL Class Overview

Security Global Functions