Skip to content

Latest commit

 

History

History
77 lines (59 loc) · 2.86 KB

nf-processthreadsapi-getcurrentprocesstoken.md

File metadata and controls

77 lines (59 loc) · 2.86 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:processthreadsapi.GetCurrentProcessToken
GetCurrentProcessToken function (processthreadsapi.h)
Retrieves a pseudo-handle that you can use as a shorthand way to refer to the access token associated with a process.
GetCurrentProcessToken
GetCurrentProcessToken function [Security]
processthreadsapi/GetCurrentProcessToken
security.getcurrentprocesstoken
security\getcurrentprocesstoken.htm
processthreadsapi
9DD1781A-4C77-4E22-9FCF-579FC90F3028
12/05/2018
GetCurrentProcessToken, GetCurrentProcessToken function [Security], processthreadsapi/GetCurrentProcessToken, security.getcurrentprocesstoken
processthreadsapi.h
Windows
Windows 8 [desktop apps | UWP apps]
Windows Server 2012 [desktop apps | UWP apps]
Windows
19H1
GetCurrentProcessToken
processthreadsapi/GetCurrentProcessToken
c++
APIRef
kbSyntax
HeaderDef
processthreadsapi.h
GetCurrentProcessToken

GetCurrentProcessToken function

-description

Retrieves a pseudo-handle that you can use as a shorthand way to refer to the access token associated with a process.

-returns

A pseudo-handle that you can use as a shorthand way to refer to the access token associated with a process.

-remarks

A pseudo-handle is a special constant that can function as the access token for the current process. The calling process can use a pseudo-handle to specify the access token for that process 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.

The pseudo-handle cannot be duplicated by the DuplicateHandle function or the DuplicateToken function.

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.

-see-also

Access Rights for Access-Token Objects

OpenProcessToken