From 2f6748f0369e3ae619392675cf6c85a8a44712ca Mon Sep 17 00:00:00 2001 From: Christian Heimlich Date: Wed, 10 Aug 2022 16:14:19 -0400 Subject: [PATCH 1/2] Update nf-processthreadsapi-openprocesstoken.md This page incorrectly states that the `OpenProcessToken` function requires the provided HANDLE argument (ProcessHandle) to have the `PROCESS_QUERY_INFORMATION` access permission, when it actually only needs the `PROCESS_QUERY_LIMITED_INFORMATION` access permission. This change corrects the statement. --- .../processthreadsapi/nf-processthreadsapi-openprocesstoken.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk-api-src/content/processthreadsapi/nf-processthreadsapi-openprocesstoken.md b/sdk-api-src/content/processthreadsapi/nf-processthreadsapi-openprocesstoken.md index 6cf11dd3733c..199ac635543d 100644 --- a/sdk-api-src/content/processthreadsapi/nf-processthreadsapi-openprocesstoken.md +++ b/sdk-api-src/content/processthreadsapi/nf-processthreadsapi-openprocesstoken.md @@ -66,7 +66,7 @@ The OpenProcessToken function opens 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_LIMITED_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