コード例 #1
0
        /// <summary>
        /// Enable a single privilege on the process.
        /// </summary>
        /// <param name="privilege"></param>
        /// <exception cref="">Throws an exception if the privilege is not present
        ///  in the privilege list of the process</exception>
        public void EnablePrivilege(TokenPrivilege privilege)
        {
            TokenPrivileges privs = new TokenPrivileges();

            privs.Add(privilege);
            EnableDisablePrivileges(privs);
        }
コード例 #2
0
ファイル: AccessToken.cs プロジェクト: jailbird777/wim_hacker
        /// <summary>
        /// Enable a single privilege on the process.
        /// </summary>
        /// <param name="privilege"></param>
        /// <exception cref="">Throws an exception if the privilege is not present
        ///  in the privilege list of the process</exception>
        public void EnablePrivilege(TokenPrivilege privilege)
        {
            TokenPrivileges privs = new TokenPrivileges {
                privilege
            };

            EnableDisablePrivileges(privs);
        }
コード例 #3
0
 internal TokenPrivileges(UnmanagedHeapAlloc ptr)
 {
     MemoryMarshaler m = new MemoryMarshaler(ptr.Ptr);
     TOKEN_PRIVILEGES privs = (TOKEN_PRIVILEGES)m.ParseStruct(typeof(TOKEN_PRIVILEGES));
     for(int i = 0 ; i < privs.PrivilegeCount; i++)
     {
         TokenPrivilege priv = new TokenPrivilege(m);
         base.InnerList.Add(priv);
     }
 }
コード例 #4
0
ファイル: TokenPrivileges.cs プロジェクト: Maxiaozhe/CodeBank
        internal TokenPrivileges(UnmanagedHeapAlloc ptr)
        {
            MemoryMarshaler  m     = new MemoryMarshaler(ptr.Ptr);
            TOKEN_PRIVILEGES privs = (TOKEN_PRIVILEGES)m.ParseStruct(typeof(TOKEN_PRIVILEGES));

            for (int i = 0; i < privs.PrivilegeCount; i++)
            {
                TokenPrivilege priv = new TokenPrivilege(m);
                base.InnerList.Add(priv);
            }
        }
コード例 #5
0
 public void Add(TokenPrivilege privilege)
 {
     base.InnerList.Add(privilege);
 }
コード例 #6
0
 /// <summary>
 /// Enable a single privilege on the process.
 /// </summary>
 /// <param name="privilege"></param>
 /// <exception cref="">Throws an exception if the privilege is not present
 ///  in the privilege list of the process</exception>
 public void EnablePrivilege(TokenPrivilege privilege)
 {
     var privs = new TokenPrivileges {privilege};
     EnableDisablePrivileges(privs);
 }
コード例 #7
0
 public void Add(TokenPrivilege privilege)
 {
     base.InnerList.Add(privilege);
 }
コード例 #8
0
ファイル: AccessToken.cs プロジェクト: nuxleus/flexwikicore
 /// <summary>
 /// Enable a single privilege on the process.
 /// </summary>
 /// <param name="privilege"></param>
 /// <exception cref="">Throws an exception if the privilege is not present
 ///  in the privilege list of the process</exception>
 public void EnablePrivilege(TokenPrivilege privilege)
 {
     TokenPrivileges privs = new TokenPrivileges();
     privs.Add(privilege);
     EnableDisablePrivileges(privs);
 }