示例#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
        /// <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
        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);
 }
 /// <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
 /// <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);
 }