10 public override int BinaryLength => 8 + base.SecurityIdentifier.BinaryLength + base.OpaqueLength;
12 internal override int MaxOpaqueLengthInternal =>
MaxOpaqueLength(base.IsCallback);
23 : base(TypeFromQualifier(isCallback, qualifier), flags, accessMask, sid, opaque)
36 return AceType.AccessAllowedCallback;
42 return AceType.AccessDeniedCallback;
48 return AceType.SystemAuditCallback;
54 return AceType.SystemAlarmCallback;
56 throw new ArgumentOutOfRangeException(
"qualifier", Environment.GetResourceString(
"ArgumentOutOfRange_Enum"));
60 internal static bool ParseBinaryForm(
byte[] binaryForm,
int offset, out
AceQualifier qualifier, out
int accessMask, out
SecurityIdentifier sid, out
bool isCallback, out
byte[] opaque)
62 GenericAce.VerifyHeader(binaryForm, offset);
66 if (aceType ==
AceType.AccessAllowed || aceType ==
AceType.AccessDenied || aceType ==
AceType.SystemAudit || aceType ==
AceType.SystemAlarm)
72 if (aceType !=
AceType.AccessAllowedCallback && aceType !=
AceType.AccessDeniedCallback && aceType !=
AceType.SystemAuditCallback && aceType !=
AceType.SystemAlarmCallback)
78 if (aceType ==
AceType.AccessAllowed || aceType ==
AceType.AccessAllowedCallback)
82 else if (aceType ==
AceType.AccessDenied || aceType ==
AceType.AccessDeniedCallback)
86 else if (aceType ==
AceType.SystemAudit || aceType ==
AceType.SystemAuditCallback)
92 if (aceType !=
AceType.SystemAlarm && aceType !=
AceType.SystemAlarmCallback)
100 accessMask = binaryForm[num + 0] + (binaryForm[num + 1] << 8) + (binaryForm[num + 2] << 16) + (binaryForm[num + 3] << 24);
104 int num3 = (binaryForm[offset + 3] << 8) + binaryForm[offset + 2];
107 int num4 = num3 - 4 - 4 - (byte)sid.BinaryLength;
110 opaque =
new byte[num4];
111 for (
int i = 0; i < num4; i++)
113 opaque[i] = binaryForm[offset + num3 - num4 + i];
145 MarshalHeader(binaryForm, offset);
146 int num = offset + 4;
148 binaryForm[num + 0] = (byte)base.AccessMask;
149 binaryForm[num + 1] = (
byte)(base.AccessMask >> 8);
150 binaryForm[num + 2] = (byte)(base.AccessMask >> 16);
151 binaryForm[num + 3] = (byte)(base.AccessMask >> 24);
153 base.SecurityIdentifier.GetBinaryForm(binaryForm, num + num2);
154 num2 += base.SecurityIdentifier.BinaryLength;
157 if (base.OpaqueLength > MaxOpaqueLengthInternal)
161 GetOpaque().CopyTo(binaryForm, num + num2);
AceType AceType
Gets the type of this Access Control Entry (ACE).
AceQualifier AceQualifier
Gets a value that specifies whether the ACE allows access, denies access, causes system audits,...
Serves as the base class for system exceptions namespace.
CommonAce(AceFlags flags, AceQualifier qualifier, int accessMask, SecurityIdentifier sid, bool isCallback, byte[] opaque)
Initializes a new instance of the T:System.Security.AccessControl.CommonAce class.
static int MaxOpaqueLength(bool isCallback)
Gets the maximum allowed length of an opaque data BLOB for callback access control entries (ACEs).
AceType
Defines the available access control entry (ACE) types.
override int BinaryLength
Gets the length, in bytes, of the binary representation of the current T:System.Security....
SecurityIdentifier SecurityIdentifier
Gets or sets the T:System.Security.Principal.SecurityIdentifier object associated with this T:System....
byte [] GetOpaque()
Returns the opaque callback data associated with this T:System.Security.AccessControl....
override void GetBinaryForm(byte[] binaryForm, int offset)
Marshals the contents of the T:System.Security.AccessControl.CommonAce object into the specified byte...
static readonly int MaxBinaryLength
Returns the maximum size, in bytes, of the binary representation of the security identifier.
Represents an Access Control Entry (ACE) that contains a qualifier. The qualifier,...
Represents an access control entry (ACE).
AceFlags
Specifies the inheritance and auditing behavior of an access control entry (ACE).
AceQualifier
Specifies the function of an access control entry (ACE).
Represents a security identifier (SID) and provides marshaling and comparison operations for SIDs.
static readonly int MinBinaryLength
Returns the minimum size, in bytes, of the binary representation of the security identifier.