Click or drag to resize
Xcalibur Systems LLC Logo

ProcessHelperOpenProcessToken Method

The OpenProcessToken function opens the access token associated with a process.

OpenProcessToken function


Namespace: Xcalibur.NativeMethods.V2.Processes
Assembly: Xcalibur.NativeMethods.V2 (in Xcalibur.NativeMethods.V2.dll) Version: 1.0.1.0
Syntax
[DllImportAttribute("advapi32", SetLastError = true)]
public static bool OpenProcessToken(
	IntPtr handle,
	TokenAccess access,
	out IntPtr tokenHandle
)

Parameters

handle  IntPtr
A handle to the process whose access token is opened. The process must have the access permission.
access  TokenAccess
Specifies an access mask that specifies the requested types of access to the access token. These requested access types are compared with the discretionary access control list (DACL) of the token to determine which accesses are granted or denied.
tokenHandle  IntPtr
A pointer to a handle that identifies the newly opened access token when the function returns.

Return Value

Boolean
If the function fails, the return value is zero. To get extended error information, call .
See Also