The PrivilegeCheck function tests the security context represented by a specific access token to discover whether it contains the specified privileges. This function is typically called by a server application to check the privileges of a client’s access token.
BOOL PrivilegeCheck(
HANDLE ClientToken, |
// handle of client’s access token |
PPRIVILEGE_SET RequiredPrivileges, |
// address of privileges |
LPBOOL pfResult |
// address of flag for result |
); |
The specified access token is checked to see which of the specified privileges
are present. When a privilege specified in the PRIVILEGE_SET structure
is found in the access token, the function sets the
SE_PRIVILEGE_USED_FOR_ACCESS attribute for that privilege in the corresponding
LUID_AND_ATTRIBUTES structure.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
AccessCheck, AccessCheckAndAuditAlarm, AreAllAccessesGranted, AreAnyAccessesGranted, LookupPrivilegeDisplayName, LookupPrivilegeName, LookupPrivilegeValue, LUID_AND_ATTRIBUTES, ObjectPrivilegeAuditAlarm, PRIVILEGE_SET, PrivilegedServiceAuditAlarm