diff --git a/sdk-api-src/content/processthreadsapi/nf-processthreadsapi-openprocesstoken.md b/sdk-api-src/content/processthreadsapi/nf-processthreadsapi-openprocesstoken.md index 6cf11dd3733c..d937d856307c 100644 --- a/sdk-api-src/content/processthreadsapi/nf-processthreadsapi-openprocesstoken.md +++ b/sdk-api-src/content/processthreadsapi/nf-processthreadsapi-openprocesstoken.md @@ -6,7 +6,7 @@ helpviewer_keywords: ["OpenProcessToken","OpenProcessToken function [Security]", old-location: security\openprocesstoken.htm tech.root: security ms.assetid: 1e760ad8-7e46-4748-8c45-36ad8efe936a -ms.date: 12/05/2018 +ms.date: 08/12/2022 ms.keywords: OpenProcessToken, OpenProcessToken function [Security], _win32_openprocesstoken, processthreadsapi/OpenProcessToken, security.openprocesstoken req.header: processthreadsapi.h req.include-header: Windows.h @@ -60,13 +60,13 @@ api_name: ## -description -The OpenProcessToken function opens the access token associated with a process. +The **OpenProcessToken** function opens the access token associated with a process. ## -parameters ### -param ProcessHandle [in] -A handle to the process whose access token is opened. The process must have the PROCESS_QUERY_INFORMATION access permission. +A handle to the process whose access token is opened. The process must have the PROCESS_QUERY_LIMITED_INFORMATION access permission. See [Process Security and Access Rights](/windows/win32/procthread/process-security-and-access-rights) for more info. ### -param DesiredAccess [in] @@ -91,53 +91,34 @@ If the function fails, the return value is zero. To get extended error informati ## -remarks -Close the access token handle returned through the TokenHandle parameter by calling -CloseHandle. +To get a handle to an elevated process from within a non-elevated process, both processes must be started from the same account. + +If the process being checked was started by a different account, the checking process needs to have the SE_DEBUG_NAME privilege enabled. See [Privilege Constants (Authorization)](/windows/win32/secauthz/privilege-constants) for more info. + +To close the access token handle returned through the TokenHandle parameter, call CloseHandle. ## -see-also Access Control - +Basic Access Control Functions AccessCheck - - AdjustTokenGroups - - AdjustTokenPrivileges - - -Basic Access Control Functions - - - CloseHandle - - GetCurrentProcessToken - - GetCurrentThreadEffectiveToken - - GetCurrentThreadToken - - GetTokenInformation - - OpenThreadToken - - -SetTokenInformation \ No newline at end of file +SetTokenInformation