win32security.SetThreadToken

SetThreadToken(Thread, Token)

Assigns an impersonation token to a thread. The function can also cause a thread to stop using an impersonation token.

Parameters

Thread : PyHANDLE

Handle to a thread. Use None to indicate calling thread.

Token : PyHANDLE

Handle to an impersonation token. Use None to end impersonation.