private static extern Boolean AdjustTokenPrivileges(SafeTokenHandle TokenHandle, Boolean DisableAllPrivileges, [In] ref TOKEN_PRIVILEGE NewState, UInt32 BufferLength, [In, Out] ref TOKEN_PRIVILEGE PreviousState, [In, Out] ref uint ReturnLength);
internal static extern Boolean DuplicateTokenEx(SafeTokenHandle ExistingToken, TokenAccessLevels DesiredAccess, IntPtr TokenAttributes, SecurityImpersonationLevel ImpersonationLevel, TokenType TokenType, [In, Out] ref SafeTokenHandle NewToken);
internal static extern Boolean SetThreadToken(IntPtr Thread, SafeTokenHandle Token);
internal static extern Boolean OpenThreadToken(IntPtr ThreadToken, TokenAccessLevels DesiredAccess, Boolean OpenAsSelf, [In, Out] ref SafeTokenHandle TokenHandle);
internal static extern Boolean OpenProcessToken(IntPtr ProcessToken, TokenAccessLevels DesiredAccess, [In, Out] ref SafeTokenHandle TokenHandle);