![Xcalibur Systems LLC Logo](../icons/logo.png) |
ProcessHelperOpenProcessToken Method |
Namespace: Xcalibur.NativeMethods.V2.ProcessesAssembly: 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
)
<DllImportAttribute("advapi32", SetLastError := true>]
Public Shared Function OpenProcessToken (
handle As IntPtr,
access As TokenAccess,
<OutAttribute> ByRef tokenHandle As IntPtr
) As Boolean
public:
[DllImportAttribute(L"advapi32", SetLastError = true)]
static bool OpenProcessToken(
IntPtr handle,
TokenAccess access,
[OutAttribute] IntPtr% tokenHandle
)
[<DllImportAttribute("advapi32", SetLastError = true)>]
static member OpenProcessToken :
handle : IntPtr *
access : TokenAccess *
tokenHandle : IntPtr byref -> bool
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
BooleanIf the function fails, the return value is zero. To get extended error
information, call .
See Also