Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GetCurrentThreadToken function

Retrieves a pseudo-handle that you can use as a shorthand way to refer to the impersonation token that was assigned to the current thread.

Syntax


FORCEINLINE HANDLE GetCurrentThreadToken(void);

Parameters

This function has no parameters.

Return value

A pseudo-handle that you can use as a shorthand way to refer to the impersonation token that was assigned to the current thread.

Remarks

A pseudo-handle is a special constant that can function as the impersonation token for the current thread. The calling thread can use a pseudo-handle to specify the impersonation token for that thread whenever a token handle is required. Child processes do not inherit pseudo-handles.

Starting in Windows 8, this pseudo-handle has only TOKEN_QUERY and TOKEN_QUERY_SOURCE access rights.

A thread can create a standard handle that is valid in the context of other processes and can be inherited by other processes. To create this standard handle, call the DuplicateHandle function and specify the pseudo-handle as the source handle.

You do not need to close the pseudo-handle when you no longer need it. If you call the CloseHandle function with a pseudo-handle, the function has no effect. If you call DuplicateHandle to duplicate the pseudo-handle, however, you must close the duplicate handle .

Requirements

Header

Processthreadsapi.h

See also

SetThreadToken
OpenThreadToken
Access Rights for Access-Token Objects

 

 

Show:
© 2017 Microsoft