Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

Search Results for "DuplicateToken" in [All]

userenv

.

in Token for the user, which is returned by the LogonUser, CreateRestrictedToken, DuplicateToken, OpenProcessToken, or OpenThreadToken function. The token must have TOKEN_QUERY and TOKEN_IMPERSONATE and TOKEN_DUPLICATE access. For more information, see Access Rights for Access-Token Objects.

advapi32

.

    If Not DuplicateToken(Token, SECURITY_IMPERSONATION, ImpersonatedToken) Then

.
Summary
The DuplicateTokenEx function creates a new access token that duplicates an existing token. This function can create either a primary token or an impersonation token.
.

public extern static bool DuplicateTokenEx(

.

    Declare Auto Function DuplicateTokenEx Lib "advapi32.dll" ( _

.

    ByRef DuplicateTokenHandle As System.IntPtr) As Boolean

.

    ret = DuplicateTokenEx(Token, UInt32.Parse(GRANTED_ALL, System.Globalization.NumberStyles.HexNumber), sa, SecurityImpersonation, TokenType, DupedToken)

.
Documentation
[DuplicateTokenEx] on MSDN
.
Summary
The DuplicateTokenEx function creates a new access token that duplicates an existing token. This function can create either a primary token or an impersonation token.
.

public extern static bool DuplicateTokenEx(

.

    Declare Auto Function DuplicateTokenEx Lib "advapi32.dll" ( _

.

    ByRef DuplicateTokenHandle As System.IntPtr) As Boolean

.

    ret = DuplicateTokenEx(Token, UInt32.Parse(GRANTED_ALL, System.Globalization.NumberStyles.HexNumber), sa, SecurityImpersonation, TokenType, DupedToken)

.
Documentation
[DuplicateTokenEx] on MSDN

 
Access PInvoke.net directly from VS: