Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
     }
 }
Exemplo n.º 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);
            }
        }
Exemplo n.º 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);
 }
Exemplo n.º 7
0
 public void Add(TokenPrivilege privilege)
 {
     base.InnerList.Add(privilege);
 }
Exemplo n.º 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);
 }