RtlAdjustPrivilege - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTRTL_H

/**
 * The RtlAdjustPrivilege routine enables or disables a privilege in the token of the current thread or process.
 *
 * \param Privilege The identifier of the privilege to adjust.
 * \param Enable If `TRUE`, the privilege is enabled; if `FALSE`, it is disabled.
 * \param Client If `TRUE`, the privilege is adjusted in the current thread's impersonation token; otherwise in the process token.
 * \param WasEnabled A pointer to a variable that receives the previous enabled state of the privilege.
 * \return NTSTATUS Successful or errant status.
 */
NTSYSAPI
NTSTATUS
NTAPI
RtlAdjustPrivilege(
    _In_ ULONG Privilege,
    _In_ BOOLEAN Enable,
    _In_ BOOLEAN Client,
    _Out_ PBOOLEAN WasEnabled
    );

#endif

View code on GitHub

NtDoc

Enables or disables a single privilege in the current process or thread token.

Parameters

Notable return values

Remarks

Disabled privileges are not taken into account during access checks. Some privileges cannot be enabled when token integrity level is too low.

Implementation details

This function is a wrapper over NtAdjustPrivilegesToken.

See also