Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of System Security AccessControl v6.0.100
BepInEx/core/System.Security.AccessControl/netstandard2.0/System.Security.AccessControl.dll
Decompiled 2 years agousing System; using System.Collections; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Security.Principal; using FxResources.System.Security.AccessControl; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] [assembly: CLSCompliant(true)] [assembly: DefaultDllImportSearchPaths(DllImportSearchPath.System32 | DllImportSearchPath.AssemblyDirectory)] [assembly: SupportedOSPlatform("windows")] [assembly: AssemblyDefaultAlias("System.Security.AccessControl")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: AssemblyMetadata("NotSupported", "True")] [assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: AssemblyMetadata("PreferInbox", "True")] [assembly: AssemblyMetadata("IsTrimmable", "True")] [assembly: AssemblyCompany("Microsoft Corporation")] [assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] [assembly: AssemblyDescription("Provides base classes that enable managing access and audit control lists on securable objects.\r\n\r\nCommonly Used Types:\r\nSystem.Security.AccessControl.AccessRule\r\nSystem.Security.AccessControl.AuditRule\r\nSystem.Security.AccessControl.ObjectAccessRule\r\nSystem.Security.AccessControl.ObjectAuditRule\r\nSystem.Security.AccessControl.ObjectSecurity")] [assembly: AssemblyFileVersion("6.0.2924.17105")] [assembly: AssemblyInformationalVersion("6.0.29+189fbbd88d97dd6d65515ba2da05b62eab4e5039")] [assembly: AssemblyProduct("Microsoft® .NET")] [assembly: AssemblyTitle("System.Security.AccessControl")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/dotnet/runtime")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("6.0.0.0")] [module: UnverifiableCode] [module: System.Runtime.CompilerServices.NullablePublicOnly(false)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class NullablePublicOnlyAttribute : Attribute { public readonly bool IncludesInternals; public NullablePublicOnlyAttribute(bool P_0) { IncludesInternals = P_0; } } } namespace FxResources.System.Security.AccessControl { internal static class SR { } } namespace System { internal static class SR { private static readonly bool s_usingResourceKeys = AppContext.TryGetSwitch("System.Resources.UseSystemResourceKeys", out var isEnabled) && isEnabled; private static ResourceManager s_resourceManager; internal static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(typeof(SR))); internal static string AccessControl_AclTooLong => GetResourceString("AccessControl_AclTooLong"); internal static string AccessControl_InvalidAccessRuleType => GetResourceString("AccessControl_InvalidAccessRuleType"); internal static string AccessControl_InvalidAuditRuleType => GetResourceString("AccessControl_InvalidAuditRuleType"); internal static string AccessControl_InvalidOwner => GetResourceString("AccessControl_InvalidOwner"); internal static string AccessControl_InvalidGroup => GetResourceString("AccessControl_InvalidGroup"); internal static string AccessControl_InvalidHandle => GetResourceString("AccessControl_InvalidHandle"); internal static string AccessControl_InvalidSecurityDescriptorRevision => GetResourceString("AccessControl_InvalidSecurityDescriptorRevision"); internal static string AccessControl_InvalidSecurityDescriptorSelfRelativeForm => GetResourceString("AccessControl_InvalidSecurityDescriptorSelfRelativeForm"); internal static string AccessControl_InvalidSidInSDDLString => GetResourceString("AccessControl_InvalidSidInSDDLString"); internal static string AccessControl_MustSpecifyContainerAcl => GetResourceString("AccessControl_MustSpecifyContainerAcl"); internal static string AccessControl_MustSpecifyDirectoryObjectAcl => GetResourceString("AccessControl_MustSpecifyDirectoryObjectAcl"); internal static string AccessControl_MustSpecifyLeafObjectAcl => GetResourceString("AccessControl_MustSpecifyLeafObjectAcl"); internal static string AccessControl_MustSpecifyNonDirectoryObjectAcl => GetResourceString("AccessControl_MustSpecifyNonDirectoryObjectAcl"); internal static string AccessControl_NoAssociatedSecurity => GetResourceString("AccessControl_NoAssociatedSecurity"); internal static string AccessControl_UnexpectedError => GetResourceString("AccessControl_UnexpectedError"); internal static string Arg_EnumAtLeastOneFlag => GetResourceString("Arg_EnumAtLeastOneFlag"); internal static string Arg_EnumIllegalVal => GetResourceString("Arg_EnumIllegalVal"); internal static string Arg_InvalidOperationException => GetResourceString("Arg_InvalidOperationException"); internal static string Arg_MustBeIdentityReferenceType => GetResourceString("Arg_MustBeIdentityReferenceType"); internal static string Argument_ArgumentZero => GetResourceString("Argument_ArgumentZero"); internal static string Argument_InvalidAnyFlag => GetResourceString("Argument_InvalidAnyFlag"); internal static string Argument_InvalidEnumValue => GetResourceString("Argument_InvalidEnumValue"); internal static string Argument_InvalidName => GetResourceString("Argument_InvalidName"); internal static string Argument_InvalidPrivilegeName => GetResourceString("Argument_InvalidPrivilegeName"); internal static string Argument_InvalidSafeHandle => GetResourceString("Argument_InvalidSafeHandle"); internal static string ArgumentException_InvalidAceBinaryForm => GetResourceString("ArgumentException_InvalidAceBinaryForm"); internal static string ArgumentException_InvalidAclBinaryForm => GetResourceString("ArgumentException_InvalidAclBinaryForm"); internal static string ArgumentException_InvalidSDSddlForm => GetResourceString("ArgumentException_InvalidSDSddlForm"); internal static string ArgumentOutOfRange_ArrayLength => GetResourceString("ArgumentOutOfRange_ArrayLength"); internal static string ArgumentOutOfRange_ArrayLengthMultiple => GetResourceString("ArgumentOutOfRange_ArrayLengthMultiple"); internal static string ArgumentOutOfRange_ArrayTooSmall => GetResourceString("ArgumentOutOfRange_ArrayTooSmall"); internal static string ArgumentOutOfRange_Enum => GetResourceString("ArgumentOutOfRange_Enum"); internal static string ArgumentOutOfRange_InvalidUserDefinedAceType => GetResourceString("ArgumentOutOfRange_InvalidUserDefinedAceType"); internal static string ArgumentOutOfRange_NeedNonNegNum => GetResourceString("ArgumentOutOfRange_NeedNonNegNum"); internal static string InvalidOperation_ModificationOfNonCanonicalAcl => GetResourceString("InvalidOperation_ModificationOfNonCanonicalAcl"); internal static string InvalidOperation_MustBeSameThread => GetResourceString("InvalidOperation_MustBeSameThread"); internal static string InvalidOperation_MustLockForReadOrWrite => GetResourceString("InvalidOperation_MustLockForReadOrWrite"); internal static string InvalidOperation_MustLockForWrite => GetResourceString("InvalidOperation_MustLockForWrite"); internal static string InvalidOperation_MustRevertPrivilege => GetResourceString("InvalidOperation_MustRevertPrivilege"); internal static string InvalidOperation_NoSecurityDescriptor => GetResourceString("InvalidOperation_NoSecurityDescriptor"); internal static string InvalidOperation_OnlyValidForDS => GetResourceString("InvalidOperation_OnlyValidForDS"); internal static string InvalidOperation_DisconnectedPipe => GetResourceString("InvalidOperation_DisconnectedPipe"); internal static string NotSupported_SetMethod => GetResourceString("NotSupported_SetMethod"); internal static string PrivilegeNotHeld_Default => GetResourceString("PrivilegeNotHeld_Default"); internal static string PrivilegeNotHeld_Named => GetResourceString("PrivilegeNotHeld_Named"); internal static string Rank_MultiDimNotSupported => GetResourceString("Rank_MultiDimNotSupported"); internal static string PlatformNotSupported_AccessControl => GetResourceString("PlatformNotSupported_AccessControl"); private static bool UsingResourceKeys() { return s_usingResourceKeys; } internal static string GetResourceString(string resourceKey) { if (UsingResourceKeys()) { return resourceKey; } string result = null; try { result = ResourceManager.GetString(resourceKey); } catch (MissingManifestResourceException) { } return result; } internal static string GetResourceString(string resourceKey, string defaultString) { string resourceString = GetResourceString(resourceKey); if (!(resourceKey == resourceString) && resourceString != null) { return resourceString; } return defaultString; } internal static string Format(string resourceFormat, object p1) { if (UsingResourceKeys()) { return string.Join(", ", resourceFormat, p1); } return string.Format(resourceFormat, p1); } internal static string Format(string resourceFormat, object p1, object p2) { if (UsingResourceKeys()) { return string.Join(", ", resourceFormat, p1, p2); } return string.Format(resourceFormat, p1, p2); } internal static string Format(string resourceFormat, object p1, object p2, object p3) { if (UsingResourceKeys()) { return string.Join(", ", resourceFormat, p1, p2, p3); } return string.Format(resourceFormat, p1, p2, p3); } internal static string Format(string resourceFormat, params object[] args) { if (args != null) { if (UsingResourceKeys()) { return resourceFormat + ", " + string.Join(", ", args); } return string.Format(resourceFormat, args); } return resourceFormat; } internal static string Format(IFormatProvider provider, string resourceFormat, object p1) { if (UsingResourceKeys()) { return string.Join(", ", resourceFormat, p1); } return string.Format(provider, resourceFormat, p1); } internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2) { if (UsingResourceKeys()) { return string.Join(", ", resourceFormat, p1, p2); } return string.Format(provider, resourceFormat, p1, p2); } internal static string Format(IFormatProvider provider, string resourceFormat, object p1, object p2, object p3) { if (UsingResourceKeys()) { return string.Join(", ", resourceFormat, p1, p2, p3); } return string.Format(provider, resourceFormat, p1, p2, p3); } internal static string Format(IFormatProvider provider, string resourceFormat, params object[] args) { if (args != null) { if (UsingResourceKeys()) { return resourceFormat + ", " + string.Join(", ", args); } return string.Format(provider, resourceFormat, args); } return resourceFormat; } } } namespace System.Security.Policy { public sealed class Evidence : ICollection, IEnumerable { [Obsolete("Evidence should not be treated as an ICollection. Please use GetHostEnumerator and GetAssemblyEnumerator to iterate over the evidence to collect a count.")] public int Count { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsReadOnly { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsSynchronized { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool Locked { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public object SyncRoot { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public Evidence() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } [Obsolete("This constructor is obsolete. Please use the constructor which takes arrays of EvidenceBase instead.")] public Evidence(object[] hostEvidence, object[] assemblyEvidence) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public Evidence(Evidence evidence) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public Evidence(EvidenceBase[] hostEvidence, EvidenceBase[] assemblyEvidence) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } [Obsolete("This method is obsolete. Please use AddAssemblyEvidence instead.")] public void AddAssembly(object id) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddAssemblyEvidence<T>(T evidence) where T : EvidenceBase { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } [Obsolete("This method is obsolete. Please use AddHostEvidence instead.")] public void AddHost(object id) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddHostEvidence<T>(T evidence) where T : EvidenceBase { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void Clear() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public Evidence? Clone() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } [Obsolete("Evidence should not be treated as an ICollection. Please use the GetHostEnumerator and GetAssemblyEnumerator methods rather than using CopyTo.")] public void CopyTo(Array array, int index) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public IEnumerator GetAssemblyEnumerator() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public T? GetAssemblyEvidence<T>() where T : EvidenceBase { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } [Obsolete("GetEnumerator is obsolete. Please use GetAssemblyEnumerator and GetHostEnumerator instead.")] public IEnumerator GetEnumerator() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public IEnumerator GetHostEnumerator() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public T? GetHostEvidence<T>() where T : EvidenceBase { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void Merge(Evidence evidence) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveType(Type t) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class EvidenceBase { protected EvidenceBase() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual EvidenceBase? Clone() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } } namespace System.Security.AccessControl { [Flags] public enum AccessControlActions { None = 0, View = 1, Change = 2 } public enum AccessControlModification { Add, Set, Reset, Remove, RemoveAll, RemoveSpecific } [Flags] public enum AccessControlSections { None = 0, Audit = 1, Access = 2, Owner = 4, Group = 8, All = 0xF } public enum AccessControlType { Allow, Deny } public abstract class AccessRule : AuthorizationRule { public AccessControlType AccessControlType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected AccessRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public class AccessRule<T> : AccessRule where T : struct { public T Rights { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public AccessRule(IdentityReference identity, T rights, AccessControlType type) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public AccessRule(IdentityReference identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public AccessRule(string identity, T rights, AccessControlType type) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public AccessRule(string identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class AceEnumerator : IEnumerator { public GenericAce Current { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } object IEnumerator.Current { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } internal AceEnumerator() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public bool MoveNext() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void Reset() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } [Flags] public enum AceFlags : byte { None = 0, ObjectInherit = 1, ContainerInherit = 2, NoPropagateInherit = 4, InheritOnly = 8, InheritanceFlags = 0xF, Inherited = 0x10, SuccessfulAccess = 0x40, FailedAccess = 0x80, AuditFlags = 0xC0 } public enum AceQualifier { AccessAllowed, AccessDenied, SystemAudit, SystemAlarm } public enum AceType : byte { AccessAllowed = 0, AccessDenied = 1, SystemAudit = 2, SystemAlarm = 3, AccessAllowedCompound = 4, AccessAllowedObject = 5, AccessDeniedObject = 6, SystemAuditObject = 7, SystemAlarmObject = 8, AccessAllowedCallback = 9, AccessDeniedCallback = 10, AccessAllowedCallbackObject = 11, AccessDeniedCallbackObject = 12, SystemAuditCallback = 13, SystemAlarmCallback = 14, SystemAuditCallbackObject = 15, MaxDefinedAceType = 16, SystemAlarmCallbackObject = 16 } [Flags] public enum AuditFlags { None = 0, Success = 1, Failure = 2 } public abstract class AuditRule : AuthorizationRule { public AuditFlags AuditFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected AuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags auditFlags) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public class AuditRule<T> : AuditRule where T : struct { public T Rights { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public AuditRule(IdentityReference identity, T rights, AuditFlags flags) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AuditFlags.None) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public AuditRule(IdentityReference identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AuditFlags.None) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public AuditRule(string identity, T rights, AuditFlags flags) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AuditFlags.None) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public AuditRule(string identity, T rights, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AuditFlags.None) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class AuthorizationRule { protected internal int AccessMask { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public IdentityReference IdentityReference { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public InheritanceFlags InheritanceFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsInherited { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public PropagationFlags PropagationFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected internal AuthorizationRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class AuthorizationRuleCollection : ReadOnlyCollectionBase { public AuthorizationRule? this[int index] { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public AuthorizationRuleCollection() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddRule(AuthorizationRule? rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void CopyTo(AuthorizationRule[] rules, int index) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class CommonAce : QualifiedAce { public override int BinaryLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public CommonAce(AceFlags flags, AceQualifier qualifier, int accessMask, SecurityIdentifier sid, bool isCallback, byte[]? opaque) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public override void GetBinaryForm(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public static int MaxOpaqueLength(bool isCallback) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class CommonAcl : GenericAcl { public sealed override int BinaryLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed override int Count { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsCanonical { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsContainer { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsDS { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed override GenericAce this[int index] { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed override byte Revision { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } internal CommonAcl() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public sealed override void GetBinaryForm(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void Purge(SecurityIdentifier sid) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveInheritedAces() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class CommonObjectSecurity : ObjectSecurity { protected CommonObjectSecurity(bool isContainer) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void AddAccessRule(AccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void AddAuditRule(AuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public AuthorizationRuleCollection GetAccessRules(bool includeExplicit, bool includeInherited, Type targetType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public AuthorizationRuleCollection GetAuditRules(bool includeExplicit, bool includeInherited, Type targetType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected override bool ModifyAccess(AccessControlModification modification, AccessRule rule, out bool modified) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected override bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected bool RemoveAccessRule(AccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void RemoveAccessRuleAll(AccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void RemoveAccessRuleSpecific(AccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected bool RemoveAuditRule(AuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void RemoveAuditRuleAll(AuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void RemoveAuditRuleSpecific(AuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void ResetAccessRule(AccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void SetAccessRule(AccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void SetAuditRule(AuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class CommonSecurityDescriptor : GenericSecurityDescriptor { public override ControlFlags ControlFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public DiscretionaryAcl? DiscretionaryAcl { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override SecurityIdentifier? Group { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsContainer { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsDiscretionaryAclCanonical { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsDS { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsSystemAclCanonical { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override SecurityIdentifier? Owner { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public SystemAcl? SystemAcl { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public CommonSecurityDescriptor(bool isContainer, bool isDS, byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public CommonSecurityDescriptor(bool isContainer, bool isDS, ControlFlags flags, SecurityIdentifier? owner, SecurityIdentifier? group, SystemAcl? systemAcl, DiscretionaryAcl? discretionaryAcl) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public CommonSecurityDescriptor(bool isContainer, bool isDS, RawSecurityDescriptor rawSecurityDescriptor) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public CommonSecurityDescriptor(bool isContainer, bool isDS, string sddlForm) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddDiscretionaryAcl(byte revision, int trusted) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddSystemAcl(byte revision, int trusted) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void PurgeAccessControl(SecurityIdentifier sid) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void PurgeAudit(SecurityIdentifier sid) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetDiscretionaryAclProtection(bool isProtected, bool preserveInheritance) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetSystemAclProtection(bool isProtected, bool preserveInheritance) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class CompoundAce : KnownAce { public override int BinaryLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public CompoundAceType CompoundAceType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public CompoundAce(AceFlags flags, int accessMask, CompoundAceType compoundAceType, SecurityIdentifier sid) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public override void GetBinaryForm(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public enum CompoundAceType { Impersonation = 1 } [Flags] public enum ControlFlags { None = 0, OwnerDefaulted = 1, GroupDefaulted = 2, DiscretionaryAclPresent = 4, DiscretionaryAclDefaulted = 8, SystemAclPresent = 0x10, SystemAclDefaulted = 0x20, DiscretionaryAclUntrusted = 0x40, ServerSecurity = 0x80, DiscretionaryAclAutoInheritRequired = 0x100, SystemAclAutoInheritRequired = 0x200, DiscretionaryAclAutoInherited = 0x400, SystemAclAutoInherited = 0x800, DiscretionaryAclProtected = 0x1000, SystemAclProtected = 0x2000, RMControlValid = 0x4000, SelfRelative = 0x8000 } public sealed class CustomAce : GenericAce { public static readonly int MaxOpaqueLength; public override int BinaryLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public int OpaqueLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public CustomAce(AceType type, AceFlags flags, byte[]? opaque) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public override void GetBinaryForm(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public byte[]? GetOpaque() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetOpaque(byte[]? opaque) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class DiscretionaryAcl : CommonAcl { public DiscretionaryAcl(bool isContainer, bool isDS, byte revision, int capacity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public DiscretionaryAcl(bool isContainer, bool isDS, int capacity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public DiscretionaryAcl(bool isContainer, bool isDS, RawAcl? rawAcl) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddAccess(AccessControlType accessType, SecurityIdentifier sid, ObjectAccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public bool RemoveAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public bool RemoveAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public bool RemoveAccess(AccessControlType accessType, SecurityIdentifier sid, ObjectAccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveAccessSpecific(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveAccessSpecific(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveAccessSpecific(AccessControlType accessType, SecurityIdentifier sid, ObjectAccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetAccess(AccessControlType accessType, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetAccess(AccessControlType accessType, SecurityIdentifier sid, ObjectAccessRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class GenericAce { public AceFlags AceFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public AceType AceType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public AuditFlags AuditFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract int BinaryLength { get; } public InheritanceFlags InheritanceFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsInherited { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public PropagationFlags PropagationFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } internal GenericAce() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public GenericAce Copy() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public static GenericAce CreateFromBinaryForm(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public sealed override bool Equals([NotNullWhen(true)] object? o) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public abstract void GetBinaryForm(byte[] binaryForm, int offset); public sealed override int GetHashCode() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public static bool operator ==(GenericAce? left, GenericAce? right) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public static bool operator !=(GenericAce? left, GenericAce? right) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class GenericAcl : ICollection, IEnumerable { public static readonly byte AclRevision; public static readonly byte AclRevisionDS; public static readonly int MaxBinaryLength; public abstract int BinaryLength { get; } public abstract int Count { get; } public bool IsSynchronized { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract GenericAce this[int index] { get; set; } public abstract byte Revision { get; } public virtual object SyncRoot { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected GenericAcl() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void CopyTo(GenericAce[] array, int index) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public abstract void GetBinaryForm(byte[] binaryForm, int offset); public AceEnumerator GetEnumerator() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } void ICollection.CopyTo(Array array, int index) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } IEnumerator IEnumerable.GetEnumerator() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class GenericSecurityDescriptor { public int BinaryLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract ControlFlags ControlFlags { get; } public abstract SecurityIdentifier? Group { get; set; } public abstract SecurityIdentifier? Owner { get; set; } public static byte Revision { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } internal GenericSecurityDescriptor() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void GetBinaryForm(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public string GetSddlForm(AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public static bool IsSddlConversionSupported() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } [Flags] public enum InheritanceFlags { None = 0, ContainerInherit = 1, ObjectInherit = 2 } public abstract class KnownAce : GenericAce { public int AccessMask { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public SecurityIdentifier SecurityIdentifier { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } internal KnownAce() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class NativeObjectSecurity : CommonObjectSecurity { protected internal delegate Exception? ExceptionFromErrorCode(int errorCode, string? name, SafeHandle? handle, object? context); protected NativeObjectSecurity(bool isContainer, ResourceType resourceType) : base(isContainer: false) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected NativeObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle? handle, AccessControlSections includeSections) : base(isContainer: false) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected NativeObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle? handle, AccessControlSections includeSections, ExceptionFromErrorCode? exceptionFromErrorCode, object? exceptionContext) : base(isContainer: false) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected NativeObjectSecurity(bool isContainer, ResourceType resourceType, ExceptionFromErrorCode? exceptionFromErrorCode, object? exceptionContext) : base(isContainer: false) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected NativeObjectSecurity(bool isContainer, ResourceType resourceType, string? name, AccessControlSections includeSections) : base(isContainer: false) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected NativeObjectSecurity(bool isContainer, ResourceType resourceType, string? name, AccessControlSections includeSections, ExceptionFromErrorCode? exceptionFromErrorCode, object? exceptionContext) : base(isContainer: false) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected sealed override void Persist(SafeHandle handle, AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void Persist(SafeHandle handle, AccessControlSections includeSections, object? exceptionContext) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected sealed override void Persist(string name, AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void Persist(string name, AccessControlSections includeSections, object? exceptionContext) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class ObjectAccessRule : AccessRule { public Guid InheritedObjectType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public ObjectAceFlags ObjectFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public Guid ObjectType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected ObjectAccessRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AccessControlType type) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AccessControlType.Allow) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class ObjectAce : QualifiedAce { public override int BinaryLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public Guid InheritedObjectAceType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public ObjectAceFlags ObjectAceFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public Guid ObjectAceType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public ObjectAce(AceFlags aceFlags, AceQualifier qualifier, int accessMask, SecurityIdentifier sid, ObjectAceFlags flags, Guid type, Guid inheritedType, bool isCallback, byte[]? opaque) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public override void GetBinaryForm(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public static int MaxOpaqueLength(bool isCallback) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } [Flags] public enum ObjectAceFlags { None = 0, ObjectAceTypePresent = 1, InheritedObjectAceTypePresent = 2 } public abstract class ObjectAuditRule : AuditRule { public Guid InheritedObjectType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public ObjectAceFlags ObjectFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public Guid ObjectType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected ObjectAuditRule(IdentityReference identity, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, Guid objectType, Guid inheritedObjectType, AuditFlags auditFlags) : base(null, 0, isInherited: false, InheritanceFlags.None, PropagationFlags.None, AuditFlags.None) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class ObjectSecurity { public abstract Type AccessRightType { get; } protected bool AccessRulesModified { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract Type AccessRuleType { get; } public bool AreAccessRulesCanonical { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool AreAccessRulesProtected { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool AreAuditRulesCanonical { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool AreAuditRulesProtected { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected bool AuditRulesModified { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract Type AuditRuleType { get; } protected bool GroupModified { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected bool IsContainer { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected bool IsDS { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected bool OwnerModified { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected CommonSecurityDescriptor SecurityDescriptor { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected ObjectSecurity() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected ObjectSecurity(bool isContainer, bool isDS) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected ObjectSecurity(CommonSecurityDescriptor securityDescriptor) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public abstract AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type); public abstract AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags); public IdentityReference? GetGroup(Type targetType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public IdentityReference? GetOwner(Type targetType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public byte[] GetSecurityDescriptorBinaryForm() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public string GetSecurityDescriptorSddlForm(AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public static bool IsSddlConversionSupported() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected abstract bool ModifyAccess(AccessControlModification modification, AccessRule rule, out bool modified); public virtual bool ModifyAccessRule(AccessControlModification modification, AccessRule rule, out bool modified) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected abstract bool ModifyAudit(AccessControlModification modification, AuditRule rule, out bool modified); public virtual bool ModifyAuditRule(AccessControlModification modification, AuditRule rule, out bool modified) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected virtual void Persist(bool enableOwnershipPrivilege, string name, AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected virtual void Persist(SafeHandle handle, AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected virtual void Persist(string name, AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void PurgeAccessRules(IdentityReference identity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void PurgeAuditRules(IdentityReference identity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void ReadLock() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void ReadUnlock() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetAccessRuleProtection(bool isProtected, bool preserveInheritance) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetAuditRuleProtection(bool isProtected, bool preserveInheritance) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetGroup(IdentityReference identity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetOwner(IdentityReference identity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetSecurityDescriptorBinaryForm(byte[] binaryForm) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetSecurityDescriptorBinaryForm(byte[] binaryForm, AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetSecurityDescriptorSddlForm(string sddlForm) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetSecurityDescriptorSddlForm(string sddlForm, AccessControlSections includeSections) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void WriteLock() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected void WriteUnlock() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public abstract class ObjectSecurity<T> : NativeObjectSecurity where T : struct { public override Type AccessRightType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override Type AccessRuleType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override Type AuditRuleType { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } protected ObjectSecurity(bool isContainer, ResourceType resourceType) : base(isContainer: false, ResourceType.Unknown) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected ObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle? safeHandle, AccessControlSections includeSections) : base(isContainer: false, ResourceType.Unknown) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected ObjectSecurity(bool isContainer, ResourceType resourceType, SafeHandle? safeHandle, AccessControlSections includeSections, ExceptionFromErrorCode? exceptionFromErrorCode, object? exceptionContext) : base(isContainer: false, ResourceType.Unknown) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected ObjectSecurity(bool isContainer, ResourceType resourceType, string? name, AccessControlSections includeSections) : base(isContainer: false, ResourceType.Unknown) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected ObjectSecurity(bool isContainer, ResourceType resourceType, string? name, AccessControlSections includeSections, ExceptionFromErrorCode? exceptionFromErrorCode, object? exceptionContext) : base(isContainer: false, ResourceType.Unknown) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public override AccessRule AccessRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AccessControlType type) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void AddAccessRule(AccessRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void AddAuditRule(AuditRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public override AuditRule AuditRuleFactory(IdentityReference identityReference, int accessMask, bool isInherited, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, AuditFlags flags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected internal void Persist(SafeHandle handle) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } protected internal void Persist(string name) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual bool RemoveAccessRule(AccessRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void RemoveAccessRuleAll(AccessRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void RemoveAccessRuleSpecific(AccessRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual bool RemoveAuditRule(AuditRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void RemoveAuditRuleAll(AuditRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void RemoveAuditRuleSpecific(AuditRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void ResetAccessRule(AccessRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void SetAccessRule(AccessRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public virtual void SetAuditRule(AuditRule<T> rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class PrivilegeNotHeldException : UnauthorizedAccessException, ISerializable { public string? PrivilegeName { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public PrivilegeNotHeldException() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public PrivilegeNotHeldException(string? privilege) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public PrivilegeNotHeldException(string? privilege, Exception? inner) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public override void GetObjectData(SerializationInfo info, StreamingContext context) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } [Flags] public enum PropagationFlags { None = 0, NoPropagateInherit = 1, InheritOnly = 2 } public abstract class QualifiedAce : KnownAce { public AceQualifier AceQualifier { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public bool IsCallback { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public int OpaqueLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } internal QualifiedAce() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public byte[]? GetOpaque() { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetOpaque(byte[]? opaque) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class RawAcl : GenericAcl { public override int BinaryLength { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override int Count { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override GenericAce this[int index] { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override byte Revision { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public RawAcl(byte revision, int capacity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public RawAcl(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public override void GetBinaryForm(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void InsertAce(int index, GenericAce ace) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveAce(int index) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public sealed class RawSecurityDescriptor : GenericSecurityDescriptor { public override ControlFlags ControlFlags { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public RawAcl? DiscretionaryAcl { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override SecurityIdentifier? Group { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public override SecurityIdentifier? Owner { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public byte ResourceManagerControl { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public RawAcl? SystemAcl { get { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } set { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public RawSecurityDescriptor(byte[] binaryForm, int offset) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public RawSecurityDescriptor(ControlFlags flags, SecurityIdentifier? owner, SecurityIdentifier? group, RawAcl? systemAcl, RawAcl? discretionaryAcl) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public RawSecurityDescriptor(string sddlForm) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetFlags(ControlFlags flags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } public enum ResourceType { Unknown, FileObject, Service, Printer, RegistryKey, LMShare, KernelObject, WindowObject, DSObject, DSObjectAll, ProviderDefined, WmiGuidObject, RegistryWow6432Key } [Flags] public enum SecurityInfos { Owner = 1, Group = 2, DiscretionaryAcl = 4, SystemAcl = 8 } public sealed class SystemAcl : CommonAcl { public SystemAcl(bool isContainer, bool isDS, byte revision, int capacity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public SystemAcl(bool isContainer, bool isDS, int capacity) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public SystemAcl(bool isContainer, bool isDS, RawAcl rawAcl) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void AddAudit(SecurityIdentifier sid, ObjectAuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public bool RemoveAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public bool RemoveAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public bool RemoveAudit(SecurityIdentifier sid, ObjectAuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveAuditSpecific(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveAuditSpecific(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void RemoveAuditSpecific(SecurityIdentifier sid, ObjectAuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetAudit(AuditFlags auditFlags, SecurityIdentifier sid, int accessMask, InheritanceFlags inheritanceFlags, PropagationFlags propagationFlags, ObjectAceFlags objectFlags, Guid objectType, Guid inheritedObjectType) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } public void SetAudit(SecurityIdentifier sid, ObjectAuditRule rule) { throw new PlatformNotSupportedException(System.SR.PlatformNotSupported_AccessControl); } } } namespace System.Runtime.Versioning { internal abstract class OSPlatformAttribute : Attribute { public string PlatformName { get; } private protected OSPlatformAttribute(string platformName) { PlatformName = platformName; } } [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false, Inherited = false)] internal sealed class TargetPlatformAttribute : OSPlatformAttribute { public TargetPlatformAttribute(string platformName) : base(platformName) { } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)] internal sealed class SupportedOSPlatformAttribute : OSPlatformAttribute { public SupportedOSPlatformAttribute(string platformName) : base(platformName) { } } [AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Module | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Constructor | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface, AllowMultiple = true, Inherited = false)] internal sealed class UnsupportedOSPlatformAttribute : OSPlatformAttribute { public UnsupportedOSPlatformAttribute(string platformName) : base(platformName) { } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)] internal sealed class SupportedOSPlatformGuardAttribute : OSPlatformAttribute { public SupportedOSPlatformGuardAttribute(string platformName) : base(platformName) { } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = true, Inherited = false)] internal sealed class UnsupportedOSPlatformGuardAttribute : OSPlatformAttribute { public UnsupportedOSPlatformGuardAttribute(string platformName) : base(platformName) { } } } namespace System.Diagnostics.CodeAnalysis { [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] internal sealed class AllowNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)] internal sealed class DisallowNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)] internal sealed class MaybeNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)] internal sealed class NotNullAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class MaybeNullWhenAttribute : Attribute { public bool ReturnValue { get; } public MaybeNullWhenAttribute(bool returnValue) { ReturnValue = returnValue; } } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class NotNullWhenAttribute : Attribute { public bool ReturnValue { get; } public NotNullWhenAttribute(bool returnValue) { ReturnValue = returnValue; } } [AttributeUsage(AttributeTargets.Property | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)] internal sealed class NotNullIfNotNullAttribute : Attribute { public string ParameterName { get; } public NotNullIfNotNullAttribute(string parameterName) { ParameterName = parameterName; } } [AttributeUsage(AttributeTargets.Method, Inherited = false)] internal sealed class DoesNotReturnAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, Inherited = false)] internal sealed class DoesNotReturnIfAttribute : Attribute { public bool ParameterValue { get; } public DoesNotReturnIfAttribute(bool parameterValue) { ParameterValue = parameterValue; } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] internal sealed class MemberNotNullAttribute : Attribute { public string[] Members { get; } public MemberNotNullAttribute(string member) { Members = new string[1] { member }; } public MemberNotNullAttribute(params string[] members) { Members = members; } } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)] internal sealed class MemberNotNullWhenAttribute : Attribute { public bool ReturnValue { get; } public string[] Members { get; } public MemberNotNullWhenAttribute(bool returnValue, string member) { ReturnValue = returnValue; Members = new string[1] { member }; } public MemberNotNullWhenAttribute(bool returnValue, params string[] members) { ReturnValue = returnValue; Members = members; } } }