Opens the access token associated with a process
#include <WinAPIProc.au3>
_WinAPI_OpenProcessToken ( $iAccess [, $hProcess = 0] )
$iAccess | Access mask that specifies the requested types of access to the access token. This parameter can be one or more of the following values. $TOKEN_ALL_ACCESS $TOKEN_ADJUST_DEFAULT $TOKEN_ADJUST_GROUPS $TOKEN_ADJUST_PRIVILEGES $TOKEN_ADJUST_SESSIONID $TOKEN_ASSIGN_PRIMARY $TOKEN_DUPLICATE $TOKEN_EXECUTE $TOKEN_IMPERSONATE $TOKEN_QUERY $TOKEN_QUERY_SOURCE $TOKEN_READ $TOKEN_WRITE |
$hProcess | [optional] Handle to the process whose access token is opened. The process must have the $PROCESS_QUERY_INFORMATION access permission. If this parameter is 0 (Default), will use the current process. |
Success: | Handle that identifies the newly opened access token. |
Failure: | 0, call _WinAPI_GetLastError() to get extended error information. |
Close the access token handle returned through this function by calling _WinAPI_CloseHandle().
Search OpenProcessToken in MSDN Library.