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

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.

See Also

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

Show:
© 2015 Microsoft