Partager via


CTokenPrivileges::Add

Adds one or more privileges to the CTokenPrivileges access token object.

bool Add(
   LPCTSTR pszPrivilege,
   bool bEnable 
) throw(...);
void Add(
   const TOKEN_PRIVILEGES & rPrivileges 
) throw(...);

Parameters

  • pszPrivilege
    Pointer to a null-terminated string that specifies the name of the privilege, as defined in the WINNT.H header file.

  • bEnable
    If true, the privilege is enabled. If false, the privilege is disabled.

  • rPrivileges
    Reference to a TOKEN_PRIVILEGES structure. The privileges and attributes are copied from this structure and added to the CTokenPrivileges object.

Return Value

The first form of this method returns true if the privileges are successfully added, false otherwise.

Requirements

Header: atlsecurity.h

See Also

Reference

CTokenPrivileges Class

CTokenPrivileges::Delete

CTokenPrivileges::DeleteAll

Other Resources

CTokenPrivileges Members