/// <summary>
 /// Abstract method to get the NT type for the access check.
 /// </summary>
 /// <returns>The NT type.</returns>
 protected override NtType GetNtType()
 {
     if (Type == SeObjectType.Printer)
     {
         return(PrintSpoolerUtils.GetTypeForPath(Name));
     }
     return(Win32Security.GetNativeType(Type));
 }
        private GenericMapping GetGenericMapping()
        {
            if (GenericMapping.HasValue)
            {
                return(GenericMapping.Value);
            }

            return(Win32Security.GetNativeType(Type)?.GenericMapping
                   ?? throw new ArgumentException("Must specify a Generic Mapping for the type"));
        }