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

# SetThreadToken(3w)

## NAME

**SetThreadToken** (ADVAPI32.@)

## SYNOPSIS

BOOL SetThreadToken\
  (\
   PHANDLE *thread*,\
   HANDLE  *token*\
  )

## DESCRIPTION

Assigns an 'impersonation token' to a *thread* so it can assume the security privileges of another *thread* or process. Can also remove a previously assigned *token*.

## PARAMS

*thread* **\[Out\]**  Handle to *thread* to set the *token* for.

*token* **\[In\]**  Token to set.

## RETURNS

**Success:** **TRUE**. The threads access *token* is set to *token*

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

## NOTES

Only supported on **NT** or higher. On Win9X this function does nothing. See **[SetTokenInformation(3w)](/SetTokenInformation/3w.md)**.

## IMPLEMENTATION

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

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

Debug channel **"advapi"**.
