Exemple #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);
        }
        /// <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);
        }
 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);
     }
 }
        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);
            }
        }
 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);
 }
Exemple #7
0
 public void Add(TokenPrivilege privilege)
 {
     base.InnerList.Add(privilege);
 }
Exemple #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);
 }