Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
CompoundAce.cs
Go to the documentation of this file.
3
5
6public sealed class CompoundAce : KnownAce
7{
9
11 {
12 get
13 {
14 return _compoundAceType;
15 }
16 set
17 {
19 }
20 }
21
22 public override int BinaryLength => 12 + base.SecurityIdentifier.BinaryLength;
23
24 public CompoundAce(AceFlags flags, int accessMask, CompoundAceType compoundAceType, SecurityIdentifier sid)
25 : base(AceType.AccessAllowedCompound, flags, accessMask, sid)
26 {
27 _compoundAceType = compoundAceType;
28 }
29
30 internal static bool ParseBinaryForm(byte[] binaryForm, int offset, out int accessMask, out CompoundAceType compoundAceType, [NotNullWhen(true)] out SecurityIdentifier sid)
31 {
32 GenericAce.VerifyHeader(binaryForm, offset);
33 if (binaryForm.Length - offset >= 12 + System.Security.Principal.SecurityIdentifier.MinBinaryLength)
34 {
35 int num = offset + 4;
36 int num2 = 0;
37 accessMask = binaryForm[num] + (binaryForm[num + 1] << 8) + (binaryForm[num + 2] << 16) + (binaryForm[num + 3] << 24);
38 num2 += 4;
39 compoundAceType = (CompoundAceType)(binaryForm[num + num2] + (binaryForm[num + num2 + 1] << 8));
40 num2 += 4;
41 sid = new SecurityIdentifier(binaryForm, num + num2);
42 return true;
43 }
44 accessMask = 0;
45 compoundAceType = (CompoundAceType)0;
46 sid = null;
47 return false;
48 }
49
50 public override void GetBinaryForm(byte[] binaryForm, int offset)
51 {
52 MarshalHeader(binaryForm, offset);
53 int num = offset + 4;
54 int num2 = 0;
55 binaryForm[num] = (byte)base.AccessMask;
56 binaryForm[num + 1] = (byte)(base.AccessMask >> 8);
57 binaryForm[num + 2] = (byte)(base.AccessMask >> 16);
58 binaryForm[num + 3] = (byte)(base.AccessMask >> 24);
59 num2 += 4;
60 binaryForm[num + num2] = (byte)(ushort)CompoundAceType;
61 binaryForm[num + num2 + 1] = (byte)((ushort)CompoundAceType >> 8);
62 binaryForm[num + num2 + 2] = 0;
63 binaryForm[num + num2 + 3] = 0;
64 num2 += 4;
65 base.SecurityIdentifier.GetBinaryForm(binaryForm, num + num2);
66 }
67}
static bool ParseBinaryForm(byte[] binaryForm, int offset, out int accessMask, out CompoundAceType compoundAceType, [NotNullWhen(true)] out SecurityIdentifier sid)
CompoundAce(AceFlags flags, int accessMask, CompoundAceType compoundAceType, SecurityIdentifier sid)
override void GetBinaryForm(byte[] binaryForm, int offset)
static void VerifyHeader(byte[] binaryForm, int offset)
void MarshalHeader(byte[] binaryForm, int offset)
Definition GenericAce.cs:82
SecurityIdentifier SecurityIdentifier
Definition KnownAce.cs:25