static string AccessMaskToString(NtType type, uint granted_access)
        {
            if (type.HasFullPermission(granted_access))
            {
                return "Full Permission";
            }

            return NtObject.AccessRightsToString(GetTypeAccessRights(type), type.MapGenericRights(granted_access));
        }
Esempio n. 2
0
 private AccessMask MapGeneric(SpecificAccessType specific_type, AccessMask access_mask)
 {
     if (!MapGenericRights)
     {
         return access_mask;
     }
     NtType type = GetTypeObject(specific_type);
     System.Diagnostics.Debug.Assert(type != null);
     return type.MapGenericRights(access_mask);
 }
Esempio n. 3
0
        /// <summary>
        /// Convert an enumerable access rights to a string
        /// </summary>
        /// <typeparam name="T">The enum type for the access rights</typeparam>
        /// <param name="access">The access rights</param>
        /// <param name="typeinfo">NtType to map generic access masks to specific access masks</param>
        /// <returns>The string format of the access rights</returns>
        public static string AccessRightsToString <T>(T access, NtType typeinfo) where T : struct, IConvertible
        {
            CheckEnumType(typeof(T));
            uint mapped_access = typeinfo.MapGenericRights(access.ToUInt32(null));

            if ((mapped_access & typeinfo.GenericMapping.GenericAll) == typeinfo.GenericMapping.GenericAll)
            {
                return("Full Access");
            }
            return(AccessRightsToString(typeof(T), mapped_access));
        }
Esempio n. 4
0
        private AccessMask MapGeneric(string typename, AccessMask access_mask)
        {
            if (!MapGenericRights)
            {
                return(access_mask);
            }
            NtType type = NtType.GetTypeByName(typename, false);

            System.Diagnostics.Debug.Assert(type != null);
            return(type.MapGenericRights(access_mask));
        }