示例#1
0
文件: PS.cs 项目: radtek/TokenManage
        /// <summary>
        /// Return access token information regarding current thread.
        /// </summary>
        /// <returns></returns>
        public static String WhoisThread()
        {
            var hThread = TMThreadHandle.GetCurrentThreadHandle();
            var hToken  = AccessTokenHandle.FromThreadHandle(hThread);

            return(new AccessTokenInformation(hToken).ToOutputString());
        }
示例#2
0
文件: PS.cs 项目: radtek/TokenManage
        public static void SetThreadPrivilege(string privilege, bool enabled)
        {
            var hThread = TMThreadHandle.GetCurrentThreadHandle();
            var hToken  = AccessTokenHandle.FromThreadHandle(hThread);

            SetPrivilege(hToken, privilege, enabled);
        }
示例#3
0
文件: PS.cs 项目: radtek/TokenManage
        public static void DisableAllThreadPrivileges()
        {
            var hThread = TMThreadHandle.GetCurrentThreadHandle();
            var hToken  = AccessTokenHandle.FromThreadHandle(hThread);

            SetAllPrivileges(hToken, false);
        }