10 private Guid _objectAceType;
12 private Guid _inheritedObjectAceType;
14 private const int ObjectFlagsLength = 4;
16 private const int GuidLength = 16;
18 internal static readonly
int AccessMaskWithObjectType = 315;
40 return _objectAceType;
44 _objectAceType = value;
54 return _inheritedObjectAceType;
58 _inheritedObjectAceType = value;
68 int num = (((_objectFlags &
ObjectAceFlags.ObjectAceTypePresent) != 0) ? 16 : 0) + (((_objectFlags &
ObjectAceFlags.InheritedObjectAceTypePresent) != 0) ? 16 : 0);
69 return 12 + num + base.SecurityIdentifier.BinaryLength + base.OpaqueLength;
73 internal override int MaxOpaqueLengthInternal =>
MaxOpaqueLength(base.IsCallback);
88 : base(TypeFromQualifier(isCallback, qualifier), aceFlags, accessMask, sid, opaque)
91 _objectAceType = type;
92 _inheritedObjectAceType = inheritedType;
102 return AceType.AccessAllowedObject;
104 return AceType.AccessAllowedCallbackObject;
108 return AceType.AccessDeniedObject;
110 return AceType.AccessDeniedCallbackObject;
114 return AceType.SystemAuditObject;
116 return AceType.SystemAuditCallbackObject;
120 return AceType.SystemAlarmObject;
122 return AceType.SystemAlarmCallbackObject;
124 throw new ArgumentOutOfRangeException(
"qualifier", Environment.GetResourceString(
"ArgumentOutOfRange_Enum"));
128 internal bool ObjectTypesMatch(
ObjectAceFlags objectFlags, Guid objectType)
141 internal bool InheritedObjectTypesMatch(
ObjectAceFlags objectFlags, Guid inheritedObjectType)
154 internal static bool ParseBinaryForm(
byte[] binaryForm,
int offset, out
AceQualifier qualifier, out
int accessMask, out
SecurityIdentifier sid, out
ObjectAceFlags objectFlags, out Guid objectAceType, out Guid inheritedObjectAceType, out
bool isCallback, out
byte[] opaque)
156 byte[] array =
new byte[16];
157 GenericAce.VerifyHeader(binaryForm, offset);
161 if (aceType ==
AceType.AccessAllowedObject || aceType ==
AceType.AccessDeniedObject || aceType ==
AceType.SystemAuditObject || aceType ==
AceType.SystemAlarmObject)
167 if (aceType !=
AceType.AccessAllowedCallbackObject && aceType !=
AceType.AccessDeniedCallbackObject && aceType !=
AceType.SystemAuditCallbackObject && aceType !=
AceType.SystemAlarmCallbackObject)
173 if (aceType ==
AceType.AccessAllowedObject || aceType ==
AceType.AccessAllowedCallbackObject)
177 else if (aceType ==
AceType.AccessDeniedObject || aceType ==
AceType.AccessDeniedCallbackObject)
181 else if (aceType ==
AceType.SystemAuditObject || aceType ==
AceType.SystemAuditCallbackObject)
187 if (aceType !=
AceType.SystemAlarmObject && aceType !=
AceType.SystemAlarmCallbackObject)
193 int num = offset + 4;
195 accessMask = binaryForm[num + 0] + (binaryForm[num + 1] << 8) + (binaryForm[num + 2] << 16) + (binaryForm[num + 3] << 24);
197 objectFlags = (
ObjectAceFlags)(binaryForm[num + num2 + 0] + (binaryForm[num + num2 + 1] << 8) + (binaryForm[num + num2 + 2] << 16) + (binaryForm[num + num2 + 3] << 24));
201 for (
int i = 0; i < 16; i++)
203 array[i] = binaryForm[num + num2 + i];
209 for (
int j = 0; j < 16; j++)
214 objectAceType =
new Guid(array);
215 if ((objectFlags &
ObjectAceFlags.InheritedObjectAceTypePresent) != 0)
217 for (
int k = 0; k < 16; k++)
219 array[k] = binaryForm[num + num2 + k];
225 for (
int l = 0; l < 16; l++)
230 inheritedObjectAceType =
new Guid(array);
233 int num3 = (binaryForm[offset + 3] << 8) + binaryForm[offset + 2];
236 int num4 = num3 - 4 - 4 - 4 - (byte)sid.BinaryLength;
241 if ((objectFlags &
ObjectAceFlags.InheritedObjectAceTypePresent) != 0)
247 opaque =
new byte[num4];
248 for (
int m = 0; m < num4; m++)
250 opaque[m] = binaryForm[offset + num3 - num4 + m];
262 objectAceType = Guid.NewGuid();
263 inheritedObjectAceType = Guid.NewGuid();
284 MarshalHeader(binaryForm, offset);
285 int num = offset + 4;
287 binaryForm[num + 0] = (byte)base.AccessMask;
288 binaryForm[num + 1] = (
byte)(base.AccessMask >> 8);
289 binaryForm[num + 2] = (byte)(base.AccessMask >> 16);
290 binaryForm[num + 3] = (byte)(base.AccessMask >> 24);
307 base.SecurityIdentifier.GetBinaryForm(binaryForm, num + num2);
308 num2 += base.SecurityIdentifier.BinaryLength;
311 if (base.OpaqueLength > MaxOpaqueLengthInternal)
315 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,...
override void GetBinaryForm(byte[] binaryForm, int offset)
Marshals the contents of the T:System.Security.AccessControl.ObjectAce object into the specified byte...
Guid InheritedObjectAceType
Gets or sets the GUID of the object type that can inherit the Access Control Entry (ACE) that this T:...
Serves as the base class for system exceptions namespace.
ObjectAceFlags ObjectAceFlags
Gets or sets flags that specify whether the P:System.Security.AccessControl.ObjectAce....
ObjectAce(AceFlags aceFlags, AceQualifier qualifier, int accessMask, SecurityIdentifier sid, ObjectAceFlags flags, Guid type, Guid inheritedType, bool isCallback, byte[] opaque)
Initiates a new instance of the T:System.Security.AccessControl.ObjectAce class.
AceType
Defines the available access control entry (ACE) types.
SecurityIdentifier SecurityIdentifier
Gets or sets the T:System.Security.Principal.SecurityIdentifier object associated with this T:System....
byte [] ToByteArray()
Returns a 16-element byte array that contains the value of this instance.
byte [] GetOpaque()
Returns the opaque callback data associated with this T:System.Security.AccessControl....
Represents a globally unique identifier (GUID).To browse the .NET Framework source code for this type...
override int?? BinaryLength
Gets the length, in bytes, of the binary representation of the current T:System.Security....
static readonly int MaxBinaryLength
Returns the maximum size, in bytes, of the binary representation of the security identifier.
static int MaxOpaqueLength(bool isCallback)
Returns the maximum allowed length, in bytes, of an opaque data BLOB for callback Access Control Entr...
Guid ObjectAceType
Gets or sets the GUID of the object type associated with this T:System.Security.AccessControl....
override bool Equals(object o)
Returns a value that indicates whether this instance is equal to a specified object.
Represents an Access Control Entry (ACE) that contains a qualifier. The qualifier,...
Controls access to Directory Services objects. This class represents an Access Control Entry (ACE) as...
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.
ObjectAceFlags
Specifies the presence of object types for Access Control Entries (ACEs).
static readonly int MinBinaryLength
Returns the minimum size, in bytes, of the binary representation of the security identifier.