SecurityWin32Util.DuplicateTokenEx Method
Win32 CloseHandleDllImport method. For more information, see StreamingContext Structure and Using the DllImport Attribute.
Namespace: Microsoft.Office.Excel.Server.Addins.ComputeCluster.Security
Assembly: Microsoft.Office.Excel.Server.Addins.ComputeCluster (in Microsoft.Office.Excel.Server.Addins.ComputeCluster.dll)
Syntax
'Declaration
Public Shared Function DuplicateTokenEx ( _
ExistingTokenHandle As IntPtr, _
DesiredAccess As Integer, _
lpTokenAttributes As SECURITY_ATTRIBUTES, _
SECURITY_IMPERSONATION_LEVEL As Integer, _
NewTokenType As TokenType, _
ByRef DuplicateTokenHandle As IntPtr _
) As Boolean
'Usage
Dim ExistingTokenHandle As IntPtr
Dim DesiredAccess As Integer
Dim lpTokenAttributes As SECURITY_ATTRIBUTES
Dim SECURITY_IMPERSONATION_LEVEL As Integer
Dim NewTokenType As TokenType
Dim DuplicateTokenHandle As IntPtr
Dim returnValue As Boolean
returnValue = SecurityWin32Util.DuplicateTokenEx(ExistingTokenHandle, _
DesiredAccess, lpTokenAttributes, _
SECURITY_IMPERSONATION_LEVEL, NewTokenType, _
DuplicateTokenHandle)
public static bool DuplicateTokenEx(
IntPtr ExistingTokenHandle,
int DesiredAccess,
SECURITY_ATTRIBUTES lpTokenAttributes,
int SECURITY_IMPERSONATION_LEVEL,
TokenType NewTokenType,
ref IntPtr DuplicateTokenHandle
)
Parameters
- ExistingTokenHandle
Type: System.IntPtr
- DesiredAccess
Type: System.Int32
- lpTokenAttributes
Type: SECURITY_ATTRIBUTES
- SECURITY_IMPERSONATION_LEVEL
Type: System.Int32
- NewTokenType
Type: Microsoft.Office.Excel.Server.Addins.ComputeCluster.Security.TokenType
- DuplicateTokenHandle
Type: System.IntPtr
Return Value
Type: System.Boolean
See Also
Reference
Microsoft.Office.Excel.Server.Addins.ComputeCluster.Security Namespace