Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetBinaryForm()

void System.Security.AccessControl.GenericSecurityDescriptor.GetBinaryForm ( byte[] binaryForm,
int offset )
inlineinherited

Definition at line 112 of file GenericSecurityDescriptor.cs.

113 {
114 if (binaryForm == null)
115 {
116 throw new ArgumentNullException("binaryForm");
117 }
118 if (offset < 0)
119 {
120 throw new ArgumentOutOfRangeException("offset", System.SR.ArgumentOutOfRange_NeedNonNegNum);
121 }
122 if (binaryForm.Length - offset < BinaryLength)
123 {
124 throw new ArgumentOutOfRangeException("binaryForm", System.SR.ArgumentOutOfRange_ArrayTooSmall);
125 }
126 int num = offset;
127 byte b = (byte)((this is RawSecurityDescriptor rawSecurityDescriptor && (ControlFlags & ControlFlags.RMControlValid) != 0) ? rawSecurityDescriptor.ResourceManagerControl : 0);
128 int num2 = (int)ControlFlags;
130 {
131 num2 &= -5;
132 }
133 binaryForm[offset] = Revision;
134 binaryForm[offset + 1] = b;
135 binaryForm[offset + 2] = (byte)num2;
136 binaryForm[offset + 3] = (byte)(num2 >> 8);
137 int offset2 = offset + 4;
138 int offset3 = offset + 8;
139 int offset4 = offset + 12;
140 int offset5 = offset + 16;
141 offset += 20;
142 if (Owner != null)
143 {
144 MarshalInt(binaryForm, offset2, offset - num);
145 Owner.GetBinaryForm(binaryForm, offset);
147 }
148 else
149 {
150 MarshalInt(binaryForm, offset2, 0);
151 }
152 if (Group != null)
153 {
154 MarshalInt(binaryForm, offset3, offset - num);
155 Group.GetBinaryForm(binaryForm, offset);
157 }
158 else
159 {
160 MarshalInt(binaryForm, offset3, 0);
161 }
162 if ((ControlFlags & ControlFlags.SystemAclPresent) != 0 && GenericSacl != null)
163 {
164 MarshalInt(binaryForm, offset4, offset - num);
165 GenericSacl.GetBinaryForm(binaryForm, offset);
167 }
168 else
169 {
170 MarshalInt(binaryForm, offset4, 0);
171 }
172 if ((ControlFlags & ControlFlags.DiscretionaryAclPresent) != 0 && GenericDacl != null && !IsCraftedAefaDacl)
173 {
174 MarshalInt(binaryForm, offset5, offset - num);
175 GenericDacl.GetBinaryForm(binaryForm, offset);
177 }
178 else
179 {
180 MarshalInt(binaryForm, offset5, 0);
181 }
182 }
static string ArgumentOutOfRange_ArrayTooSmall
Definition SR.cs:74
static string ArgumentOutOfRange_NeedNonNegNum
Definition SR.cs:32
Definition SR.cs:7
void GetBinaryForm(byte[] binaryForm, int offset)
static void MarshalInt(byte[] binaryForm, int offset, int number)
void GetBinaryForm(byte[] binaryForm, int offset)

References System.SR.ArgumentOutOfRange_ArrayTooSmall, System.SR.ArgumentOutOfRange_NeedNonNegNum, System.Security.AccessControl.GenericAcl.BinaryLength, System.Security.AccessControl.GenericSecurityDescriptor.BinaryLength, System.Security.Principal.SecurityIdentifier.BinaryLength, System.Security.AccessControl.GenericSecurityDescriptor.GenericDacl, System.Security.AccessControl.GenericSecurityDescriptor.GenericSacl, System.Security.AccessControl.GenericAcl.GetBinaryForm(), System.Security.Principal.SecurityIdentifier.GetBinaryForm(), System.Security.AccessControl.GenericSecurityDescriptor.Group, System.Security.AccessControl.GenericSecurityDescriptor.IsCraftedAefaDacl, System.Security.AccessControl.GenericSecurityDescriptor.MarshalInt(), System.offset, System.Security.AccessControl.GenericSecurityDescriptor.Owner, and System.Security.AccessControl.GenericSecurityDescriptor.Revision.

Referenced by System.Security.AccessControl.GenericSecurityDescriptor.GetSddlForm(), and System.Security.AccessControl.ObjectSecurity< T >.GetSecurityDescriptorBinaryForm().