RtlRemovePrivileges - NtDoc

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

// private
NTSYSAPI
NTSTATUS
NTAPI
RtlRemovePrivileges(
    _In_ HANDLE TokenHandle,
    _In_ PULONG PrivilegesToKeep,
    _In_ ULONG PrivilegeCount
    );

#endif
#endif

View code on GitHub

Removes all privileges from the token except for the specified ones.

Parameters

Notable return values

Remarks

Note that this function does not support token pseudo-handles such as NtCurrentProcessToken. If you want to adjust the current process/thread token, you need to open it first.

Implementation details

This function enumerates available privileges via NtQueryInformationToken with TokenPrivileges and then modifies them via NtAdjustPrivilegesToken.

See also