Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All


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


Pointer to a null-terminated string that specifies the name of the privilege, as defined in the WINNT.H header file.
If true, the privilege is enabled. If false, the privilege is disabled.
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.

See Also

CTokenPrivileges Overview | Class Members | CTokenPrivileges::Delete | CTokenPrivileges::DeleteAll

© 2015 Microsoft