---
name: "AdjustTokenPrivileges"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/AdjustTokenPrivileges"
---

# AdjustTokenPrivileges(3w)

## NAME

**AdjustTokenPrivileges** (ADVAPI32.@)

## SYNOPSIS

BOOL AdjustTokenPrivileges\
  (\
   HANDLE            *TokenHandle*,\
   BOOL              *DisableAllPrivileges*,\
   PTOKEN\_PRIVILEGES *NewState*,\
   DWORD             *BufferLength*,\
   PTOKEN\_PRIVILEGES *PreviousState*,\
   PDWORD            *ReturnLength*\
  )

## DESCRIPTION

Adjust the privileges of an open token handle.

## PARAMS

*TokenHandle* **\[In\]**  Handle from **[OpenProcessToken(3w)](/OpenProcessToken/3w.md)** or **[OpenThreadToken(3w)](/OpenThreadToken/3w.md)**.

*DisableAllPrivileges* **\[In\]**  **TRUE**=Remove all privileges, **FALSE**=Use *NewState*.

*NewState* **\[In\]**  Desired new privileges of the token.

*BufferLength* **\[In\]**  Length of *NewState*.

*PreviousState* **\[Out\]**  Destination for the previous state.

*ReturnLength* **\[In/Out\]**  Size of *PreviousState*.

## RETURNS

**Success:** **TRUE**. Privileges are set to *NewState* and *PreviousState* is updated.

**Failure:** **FALSE**.

## NOTES

See **NtAdjustPrivilegesToken(3w)**.

## IMPLEMENTATION

Declared in **"winbase.h"**.

Implemented in **"dlls/advapi32/security.c"**.

Debug channel **"advapi"**.
