TOKEN_PRIVILEGES structure (winnt.h)

The TOKEN_PRIVILEGES structure contains information about a set of privileges for an access token.

Syntax

typedef struct _TOKEN_PRIVILEGES {
  DWORD               PrivilegeCount;
  LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY];
} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES;

Members

PrivilegeCount

This must be set to the number of entries in the Privileges array.

Privileges[ANYSIZE_ARRAY]

Specifies an array of LUID_AND_ATTRIBUTES structures. Each structure contains the LUID and attributes of a privilege. To get the name of the privilege associated with a LUID, call the LookupPrivilegeName function, passing the address of the LUID as the value of the lpLuid parameter.

Important  The constant ANYSIZE_ARRAY is defined as 1 in the public header Winnt.h. To create this array with more than one element, you must allocate sufficient memory for the structure to take into account additional elements.
 
The attributes of a privilege can be a combination of the following values.
Value Meaning
SE_PRIVILEGE_ENABLED
The privilege is enabled.
SE_PRIVILEGE_ENABLED_BY_DEFAULT
The privilege is enabled by default.
SE_PRIVILEGE_REMOVED
Used to remove a privilege. For details, see AdjustTokenPrivileges.
SE_PRIVILEGE_USED_FOR_ACCESS
The privilege was used to gain access to an object or service. This flag is used to identify the relevant privileges in a set passed by a client application that may contain unnecessary privileges.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header winnt.h (include Windows.h)

See also

AdjustTokenPrivileges

GetTokenInformation

LUID

LUID_AND_ATTRIBUTES

LookupPrivilegeName

PRIVILEGE_SET

PrivilegeCheck

PrivilegedServiceAuditAlarm

SetTokenInformation

TOKEN_CONTROL

TOKEN_DEFAULT_DACL

TOKEN_GROUPS

TOKEN_INFORMATION_CLASS

TOKEN_OWNER

TOKEN_PRIMARY_GROUP

TOKEN_SOURCE

TOKEN_STATISTICS

TOKEN_TYPE

TOKEN_USER