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

◆ EnsureCapacity()

void System.Security.SecureString.EnsureCapacity ( int capacity)
inlineprivate

Definition at line 129 of file SecureString.cs.

130 {
131 if (capacity > 65536)
132 {
133 throw new ArgumentOutOfRangeException("capacity", SR.ArgumentOutOfRange_Capacity);
134 }
135 if ((uint)(capacity * 2) > _buffer.ByteLength)
136 {
138 UnmanagedBuffer unmanagedBuffer = UnmanagedBuffer.Allocate(GetAlignedByteSize(capacity));
139 UnmanagedBuffer.Copy(buffer, unmanagedBuffer, (uint)(_decryptedLength * 2));
140 _buffer = unmanagedBuffer;
141 buffer.Dispose();
142 }
143 }
static int GetAlignedByteSize(int length)

References System.Security.SecureString._buffer, System.Security.SecureString._decryptedLength, System.Security.SecureString.UnmanagedBuffer.Allocate(), System.SR.ArgumentOutOfRange_Capacity, System.buffer, System.Runtime.InteropServices.SafeBuffer.ByteLength, System.capacity, System.Security.SecureString.UnmanagedBuffer.Copy(), System.Runtime.InteropServices.SafeHandle.Dispose(), and System.Security.SecureString.GetAlignedByteSize().

Referenced by System.Security.SecureString.AppendChar(), and System.Security.SecureString.InsertAt().