set_thread_token


bool set_thread_token(handle* thread,
                      handle token)

This function assigns a token to the thread.

Parameters

handle* thread

A pointer to the handle of the thread to which the impersonation token is being assigned. If null is specified, the token is assigned to the current thread.

handle token

The handle of the token to be assigned to the thread. If null is specified, the thread ceases to use any token for access.

Return

bool

true The function succeeded.
false The call failed.

Notes

The token must be opened with access token_access::impersonate.