Telemetry/Helpers/Win32Uac.cs
/// <summary>
/// The function creates a new access token that duplicates one 
/// already in existence.
/// </summary>
/// <param name="ExistingTokenHandle">
/// A handle to an access token opened with TOKEN_DUPLICATE access.
/// </param>
/// <param name="ImpersonationLevel">
/// Specifies a SECURITY_IMPERSONATION_LEVEL enumerated type that 
/// supplies the impersonation level of the new token.
/// </param>
/// <param name="DuplicateTokenHandle">
/// Outputs a handle to the duplicate token. 
/// </param>
/// <returns></returns>
The function creates a new access token that duplicates one
already in existence.
The function creates a new access token that duplicates one already in existence .
[DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)]
        public static extern bool DuplicateToken(
            SafeTokenHandle ExistingTokenHandle, 
            SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
            out SafeTokenHandle DuplicateTokenHandle);
[ DllImport ( " " , CharSet = CharSet . Auto , SetLastError = true ) ] public static extern bool DuplicateToken ( SafeTokenHandle ExistingTokenHandle , SECURITY_IMPERSONATION_LEVEL ImpersonationLevel , out SafeTokenHandle DuplicateTokenHandle ) ;
The function creates a new access token that duplicates one
already in existence.
The function creates a new access token that duplicates one already in existence .
None
ExistingTokenHandle
SafeTokenHandle
A handle to an access token opened with TOKEN_DUPLICATE access.
A handle to an access token opened with TOKEN_DUPLICATE access .
ImpersonationLevel
SECURITY_IMPERSONATION_LEVEL
Specifies a SECURITY_IMPERSONATION_LEVEL enumerated type that
supplies the impersonation level of the new token.
Specifies a SECURITY_IMPERSONATION_LEVEL enumerated type that supplies the impersonation level of the new token .
SafeTokenHandle
out
DuplicateTokenHandle
Outputs a handle to the duplicate token.
Outputs a handle to the duplicate token .