mscorlib(4.0.0.0) API with additions
CompoundAce.cs
2 
4 {
6  public sealed class CompoundAce : KnownAce
7  {
8  private CompoundAceType _compoundAceType;
9 
10  private const int AceTypeLength = 4;
11 
15  {
16  get
17  {
18  return _compoundAceType;
19  }
20  set
21  {
22  _compoundAceType = value;
23  }
24  }
25 
28  public override int BinaryLength => 12 + base.SecurityIdentifier.BinaryLength;
29 
35  public CompoundAce(AceFlags flags, int accessMask, CompoundAceType compoundAceType, SecurityIdentifier sid)
36  : base(AceType.AccessAllowedCompound, flags, accessMask, sid)
37  {
38  _compoundAceType = compoundAceType;
39  }
40 
41  internal static bool ParseBinaryForm(byte[] binaryForm, int offset, out int accessMask, out CompoundAceType compoundAceType, out SecurityIdentifier sid)
42  {
43  GenericAce.VerifyHeader(binaryForm, offset);
44  if (binaryForm.Length - offset >= 12 + SecurityIdentifier.MinBinaryLength)
45  {
46  int num = offset + 4;
47  int num2 = 0;
48  accessMask = binaryForm[num + 0] + (binaryForm[num + 1] << 8) + (binaryForm[num + 2] << 16) + (binaryForm[num + 3] << 24);
49  num2 += 4;
50  compoundAceType = (CompoundAceType)(binaryForm[num + num2 + 0] + (binaryForm[num + num2 + 1] << 8));
51  num2 += 4;
52  sid = new SecurityIdentifier(binaryForm, num + num2);
53  return true;
54  }
55  accessMask = 0;
56  compoundAceType = (CompoundAceType)0;
57  sid = null;
58  return false;
59  }
60 
66  public override void GetBinaryForm(byte[] binaryForm, int offset)
67  {
68  MarshalHeader(binaryForm, offset);
69  int num = offset + 4;
70  int num2 = 0;
71  binaryForm[num + 0] = (byte)base.AccessMask;
72  binaryForm[num + 1] = (byte)(base.AccessMask >> 8);
73  binaryForm[num + 2] = (byte)(base.AccessMask >> 16);
74  binaryForm[num + 3] = (byte)(base.AccessMask >> 24);
75  num2 += 4;
76  binaryForm[num + num2 + 0] = (byte)(ushort)CompoundAceType;
77  binaryForm[num + num2 + 1] = (byte)((ushort)CompoundAceType >> 8);
78  binaryForm[num + num2 + 2] = 0;
79  binaryForm[num + num2 + 3] = 0;
80  num2 += 4;
81  base.SecurityIdentifier.GetBinaryForm(binaryForm, num + num2);
82  }
83  }
84 }
Represents a compound Access Control Entry (ACE).
Definition: CompoundAce.cs:6
Definition: __Canon.cs:3
AceType
Defines the available access control entry (ACE) types.
Definition: AceType.cs:4
Represents an Access Control Entry (ACE), and is the base class for all other ACE classes.
Definition: GenericAce.cs:6
SecurityIdentifier SecurityIdentifier
Gets or sets the T:System.Security.Principal.SecurityIdentifier object associated with this T:System....
Definition: KnownAce.cs:31
CompoundAce(AceFlags flags, int accessMask, CompoundAceType compoundAceType, SecurityIdentifier sid)
Initializes a new instance of the T:System.Security.AccessControl.CompoundAce class.
Definition: CompoundAce.cs:35
CompoundAceType CompoundAceType
Gets or sets the type of this T:System.Security.AccessControl.CompoundAce object.
Definition: CompoundAce.cs:15
AceFlags
Specifies the inheritance and auditing behavior of an access control entry (ACE).
Definition: AceFlags.cs:5
Encapsulates all Access Control Entry (ACE) types currently defined by Microsoft Corporation....
Definition: KnownAce.cs:6
override int BinaryLength
Gets the length, in bytes, of the binary representation of the current T:System.Security....
Definition: CompoundAce.cs:28
Represents a security identifier (SID) and provides marshaling and comparison operations for SIDs.
Defined but never used. Included here for completeness.
CompoundAceType
Specifies the type of a T:System.Security.AccessControl.CompoundAce object.
override void GetBinaryForm(byte[] binaryForm, int offset)
Marshals the contents of the T:System.Security.AccessControl.CompoundAce object into the specified by...
Definition: CompoundAce.cs:66
static readonly int MinBinaryLength
Returns the minimum size, in bytes, of the binary representation of the security identifier.