Поделиться через


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(...);

Параметры

  • 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.

Возвращаемое значение

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

Требования

Header: atlsecurity.h

См. также

Основные понятия

CTokenPrivileges Class

CTokenPrivileges Members

CTokenPrivileges::Delete

CTokenPrivileges::DeleteAll