system\array.cs (123)
54Contract.Ensures(Contract.ValueAtReturn(out array).Length == newSize);
63if (larray.Length != newSize) {
65Array.Copy(larray, 0, newArray, 0, larray.Length > newSize? newSize : larray.Length);
79Contract.Ensures(Contract.Result<Array>().Length == length);
144if (lengths.Length == 0)
147Contract.Ensures(Contract.Result<Array>().Rank == lengths.Length);
158for (int i=0;i<lengths.Length;i++)
163return InternalCreate((void*)t.TypeHandle.Value,lengths.Length,pLengths,null);
171if (lengths.Length == 0)
174Contract.Ensures(Contract.Result<Array>().Rank == lengths.Length);
177int[] intLengths = new int[lengths.Length];
179for (int i = 0; i < lengths.Length; ++i)
200if (lengths.Length != lowerBounds.Length)
202if (lengths.Length == 0)
205Contract.Ensures(Contract.Result<Array>().Rank == lengths.Length);
216for (int i=0;i<lengths.Length;i++)
222return InternalCreate((void*)t.TypeHandle.Value,lengths.Length,pLengths,pLowerBounds);
357if (Rank != indices.Length)
363InternalGetReference(&elemref, indices.Length, pIndices);
453if (Rank != indices.Length)
457int[] intIndices = new int[indices.Length];
459for (int i = 0; i < indices.Length; ++i)
521if (Rank != indices.Length)
527InternalGetReference(&elemref, indices.Length, pIndices);
572if (Rank != indices.Length)
576int[] intIndices = new int[indices.Length];
578for (int i = 0; i < indices.Length; ++i)
681{ get { return Length; } }
722Array.Clear(this, this.GetLowerBound(0), this.Length);
759if (o == null || this.Length != o.Length) {
766while (i < o.Length && c == 0) {
789if (o == null || o.Length != this.Length) {
794while (i < o.Length) {
819for (int i = (this.Length >= 8 ? this.Length - 8 : 0); i < this.Length; i++) {
847return BinarySearch(array, lb, array.Length, value, null);
890return BinarySearch(array, lb, array.Length, value, comparer);
918if (array.Length - (index - lb) < length)
991return BinarySearch<T>(array, 0, array.Length, value, null);
1000return BinarySearch<T>(array, 0, array.Length, value, comparer);
1016if (array.Length - index < length)
1040Contract.Ensures(Contract.Result<TOutput[]>().Length == array.Length);
1043TOutput[] newArray = new TOutput[array.Length];
1044for( int i = 0; i< array.Length; i++) {
1064Array.Copy(this, GetLowerBound(0), array, index, Length);
1083Contract.Ensures(Contract.Result<T[]>().Length == 0);
1103for(int i = 0 ; i < array.Length; i++) {
1122for(int i = 0 ; i < array.Length; i++) {
1134Contract.Ensures(Contract.Result<int>() < array.Length);
1137return FindIndex(array, 0, array.Length, match);
1144Contract.Ensures(Contract.Result<int>() < array.Length);
1147return FindIndex(array, startIndex, array.Length - startIndex, match);
1155if( startIndex < 0 || startIndex > array.Length ) {
1159if (count < 0 || startIndex > array.Length - count) {
1166Contract.Ensures(Contract.Result<int>() < array.Length);
1186for(int i = array.Length - 1 ; i >= 0; i--) {
1200return FindLastIndex(array, array.Length - 1, array.Length, match);
1222if(array.Length == 0) {
1230if ( startIndex < 0 || startIndex >= array.Length) {
1259for(int i = 0 ; i < array.Length; i++) {
1274return new ArrayEnumerator(this, lowerBound, Length);
1285Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length);
1288return IndexOf(array, value, lb, array.Length);
1301Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length);
1304return IndexOf(array, value, startIndex, array.Length - startIndex + lb);
1320Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length);
1324if (startIndex < lb || startIndex > array.Length + lb)
1326if (count < 0 || count > array.Length - startIndex + lb)
1375(Contract.Result<int>() >= 0 && Contract.Result<int>() < array.Length && EqualityComparer<T>.Default.Equals(value, array[Contract.Result<int>()])));
1378return IndexOf(array, value, 0, array.Length);
1385Contract.Ensures(Contract.Result<int>() < array.Length);
1388return IndexOf(array, value, startIndex, array.Length - startIndex);
1396if (startIndex < 0 || startIndex > array.Length ) {
1400if (count < 0 || count > array.Length - startIndex) {
1403Contract.Ensures(Contract.Result<int>() < array.Length);
1425Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length);
1428return LastIndexOf(array, value, array.Length - 1 + lb, array.Length);
1440Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length);
1457Contract.Ensures(Contract.Result<int>() < array.GetLowerBound(0) + array.Length);
1460if (array.Length == 0) {
1464if (startIndex < lb || startIndex >= array.Length + lb)
1513Contract.Ensures(Contract.Result<int>() < array.Length);
1516return LastIndexOf(array, value, array.Length - 1, array.Length);
1523Contract.Ensures(Contract.Result<int>() < array.Length);
1526return LastIndexOf(array, value, startIndex, (array.Length == 0)? 0 : (startIndex + 1));
1533Contract.Ensures(Contract.Result<int>() < array.Length);
1536if(array.Length == 0) {
1553if ( startIndex < 0 || startIndex >= array.Length) {
1583Reverse(array, array.GetLowerBound(0), array.Length);
1599if (array.Length - (index - array.GetLowerBound(0)) < length)
1647Sort(array, null, array.GetLowerBound(0), array.Length, null);
1661Sort(keys, items, keys.GetLowerBound(0), keys.Length, null);
1695Sort(array, null, array.GetLowerBound(0), array.Length, comparer);
1711Sort(keys, items, keys.GetLowerBound(0), keys.Length, comparer);
1744if (keys.Length - (index - keys.GetLowerBound(0)) < length || (items != null && (index - items.GetLowerBound(0)) > items.Length - length))
1783Sort<T>(array, array.GetLowerBound(0), array.Length, null);
1791Sort<TKey, TValue>(keys, items, 0, keys.Length, null);
1809Sort<T>(array, 0, array.Length, comparer);
1817Sort<TKey, TValue>(keys, items, 0, keys.Length, comparer);
1827if (array.Length - index < length)
1860if (keys.Length - index < length || (items != null && index > items.Length - length))
1913for(int i = 0 ; i < array.Length; i++) {
2106IntroSort(left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
2423IntroSort(left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
2581_endIndex = array.Length;
2631_indices[_indices.Length-1]--;
2692_indices[_indices.Length-1]--;
2749int length = _this.Length;
2766Array.Copy(_this, 0, array, index, _this.Length);
2774return _this.Length;
2785if ((uint)index >= (uint)_this.Length) {
2797if ((uint)index >= (uint)_this.Length) {
system\Collections\Concurrent\ConcurrentDictionary.cs (51)
294m_budget = m_tables.m_buckets.Length / m_tables.m_locks.Length;
342for (int i = 0; i < locks.Length; i++)
347int[] countPerLock = new int[locks.Length];
352m_budget = buckets.Length / locks.Length;
434GetBucketAndLockNo(comparer.GetHashCode(key), out bucketNo, out lockNo, tables.m_buckets.Length, tables.m_locks.Length);
507GetBucketAndLockNo(comparer.GetHashCode(key), out bucketNo, out lockNoUnused, tables.m_buckets.Length, tables.m_locks.Length);
559GetBucketAndLockNo(hashcode, out bucketNo, out lockNo, tables.m_buckets.Length, tables.m_locks.Length);
622Tables newTables = new Tables(new Node[DEFAULT_CAPACITY], m_tables.m_locks, new int[m_tables.m_countPerLock.Length], m_tables.m_comparer);
624m_budget = Math.Max(1, newTables.m_buckets.Length / newTables.m_locks.Length);
666for (int i = 0; i < m_tables.m_locks.Length && count >= 0; i++)
671if (array.Length - count < index || count < 0) //"count" itself or "count + index" can overflow
700for (int i = 0; i < m_tables.m_locks.Length; i++)
730for (int i = 0; i < buckets.Length; i++)
748for (int i = 0; i < buckets.Length; i++)
766for (int i = 0; i < buckets.Length; i++)
789for (int i = 0; i < buckets.Length; i++)
818GetBucketAndLockNo(hashcode, out bucketNo, out lockNo, tables.m_buckets.Length, tables.m_locks.Length);
1036for (int i = 0; i < m_tables.m_countPerLock.Length; i++)
1285for (int i = 0; i < m_tables.m_countPerLock.Length; i++)
1689for (int i = 0; i < tables.m_locks.Length && count >= 0; i++)
1694if (array.Length - count < index || count < 0) //"count" itself or "count + index" can overflow
1801for (int i = 0; i < tables.m_countPerLock.Length; i++)
1809if (approxCount < tables.m_buckets.Length / 4)
1829newLength = tables.m_buckets.Length * 2 + 1;
1864AcquireLocks(1, tables.m_locks.Length, ref locksAcquired);
1869if (m_growLockArray && tables.m_locks.Length < MAX_LOCK_NUMBER)
1871newLocks = new object[tables.m_locks.Length * 2];
1872Array.Copy(tables.m_locks, newLocks, tables.m_locks.Length);
1874for (int i = tables.m_locks.Length; i < newLocks.Length; i++)
1881int[] newCountPerLock = new int[newLocks.Length];
1884for (int i = 0; i < tables.m_buckets.Length; i++)
1899GetBucketAndLockNo(nodeHashCode, out newBucketNo, out newLockNo, newBuckets.Length, newLocks.Length);
1924m_budget = Math.Max(1, newBuckets.Length / newLocks.Length);
1968CDSCollectionETWBCLProvider.Log.ConcurrentDictionary_AcquiringAllLocks(m_tables.m_buckets.Length);
1977AcquireLocks(1, m_tables.m_locks.Length, ref locksAcquired);
1978Assert(locksAcquired == m_tables.m_locks.Length);
2042for (int i = 0; i < m_tables.m_buckets.Length; i++)
2076for (int i = 0; i < m_tables.m_buckets.Length; i++)
2200m_serializationConcurrencyLevel = tables.m_locks.Length;
2201m_serializationCapacity = tables.m_buckets.Length;
2217for (int i = 0; i < locks.Length; i++)
system\collections\generic\arraysorthelper.cs (48)
131Contract.Assert( index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
191Contract.Requires(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
299Contract.Requires(length <= keys.Length);
300Contract.Requires(length + left <= keys.Length);
305IntroSort(keys, left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length), comparer);
313Contract.Requires(hi < keys.Length);
361Contract.Requires(hi < keys.Length);
398Contract.Requires(hi < keys.Length);
417Contract.Requires(lo < keys.Length);
441Contract.Requires(hi <= keys.Length);
471Contract.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
536Contract.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!");
598Contract.Requires(0 <= a && a < keys.Length);
599Contract.Requires(0 <= b && b < keys.Length);
625Contract.Requires(0 <= left && left < keys.Length);
626Contract.Requires(0 <= right && right < keys.Length);
699Contract.Requires(length <= keys.Length);
700Contract.Requires(length + left <= keys.Length);
705IntroSort(keys, left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
712Contract.Requires(hi < keys.Length);
759Contract.Requires(hi < keys.Length);
803Contract.Requires(hi < keys.Length);
821Contract.Requires(lo < keys.Length);
845Contract.Requires(hi <= keys.Length);
907Contract.Assert(index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
948Contract.Requires(values == null || values.Length >= keys.Length);
950Contract.Requires(0 <= a && a < keys.Length);
951Contract.Requires(0 <= b && b < keys.Length);
1055Contract.Requires(length <= keys.Length);
1056Contract.Requires(length + left <= keys.Length);
1057Contract.Requires(length + left <= values.Length);
1062IntroSort(keys, values, left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length), comparer);
1071Contract.Requires(hi < keys.Length);
1120Contract.Requires(hi < keys.Length);
1158Contract.Requires(hi < keys.Length);
1177Contract.Requires(lo < keys.Length);
1208Contract.Requires(hi <= keys.Length);
1239Contract.Assert( index >= 0 && length >= 0 && (keys.Length - index >= length), "Check the arguments in the caller!");
1411Contract.Requires(length <= keys.Length);
1412Contract.Requires(length + left <= keys.Length);
1413Contract.Requires(length + left <= values.Length);
1418IntroSort(keys, values, left, length + left - 1, 2 * IntrospectiveSortUtilities.FloorLog2(keys.Length));
1426Contract.Requires(hi < keys.Length);
1474Contract.Requires(hi < keys.Length);
1519Contract.Requires(hi < keys.Length);
1537Contract.Requires(lo < keys.Length);
1567Contract.Requires(hi <= keys.Length);
system\collections\hashtable.cs (44)
456for (int i = 0; i < buckets.Length; i++){
482int bucket = lbuckets.Length;
512uint hashcode = InitHash(key, lbuckets.Length, out seed, out incr);
516int bucketNumber = (int) (seed % (uint)lbuckets.Length);
525bucketNumber = (int) (((long)bucketNumber + incr)% (uint)lbuckets.Length);
526} while (b.hash_coll < 0 && ++ntry < lbuckets.Length);
541for (int i = buckets.Length; --i >= 0;) {
547for (int i = buckets.Length; --i >= 0;) {
563for (int i = lbuckets.Length; --i >= 0;) {
579for (int i = lbuckets.Length; --i >= 0;) {
598if (array.Length - arrayIndex < Count)
613for (int i = lbuckets.Length; --i >= 0;) {
632for (int i = lbuckets.Length; --i >= 0;) {
656uint hashcode = InitHash(key, lbuckets.Length, out seed, out incr);
660int bucketNumber = (int) (seed % (uint)lbuckets.Length);
701bucketNumber = (int) (((long)bucketNumber + incr)% (uint)lbuckets.Length);
702} while (b.hash_coll < 0 && ++ntry < lbuckets.Length);
719int rawsize = HashHelpers.ExpandPrime(buckets.Length);
725rehash( buckets.Length, false );
750for (nb = 0; nb < buckets.Length; nb++){
892uint hashcode = InitHash(key, buckets.Length, out seed, out incr);
896int bucketNumber = (int) (seed % (uint)buckets.Length);
944rehash(buckets.Length, true);
981rehash(buckets.Length, true);
999bucketNumber = (int) (((long)bucketNumber + incr)% (uint)buckets.Length);
1000} while (++ntry < buckets.Length);
1023if(buckets.Length > HashHelpers.HashCollisionThreshold && HashHelpers.IsWellKnownEqualityComparer(_keycomparer))
1030rehash(buckets.Length, true);
1050uint incr = (uint)(1 + ((seed * HashPrime) % ((uint)newBuckets.Length - 1)));
1051int bucketNumber = (int) (seed % (uint)newBuckets.Length);
1065bucketNumber = (int) (((long)bucketNumber + incr)% (uint)newBuckets.Length);
1084uint hashcode = InitHash(key, buckets.Length, out seed, out incr);
1088int bn = (int) (seed % (uint)buckets.Length); // bucketNumber
1114bn = (int) (((long)bn + incr)% (uint)buckets.Length);
1115} while (b.hash_coll < 0 && ++ntry < buckets.Length);
1192info.AddValue(HashSizeName, buckets.Length); //This is the length of the bucket array.
1280if (serKeys.Length!=serValues.Length) {
1283for (int i=0; i<serKeys.Length; i++) {
1315if (array.Length - arrayIndex < _hashtable.count)
1356if (array.Length - arrayIndex < _hashtable.count)
1561bucket = hashtable.buckets.Length;
1625bucket = hashtable.buckets.Length;
1723for (int i = 0; i < primes.Length; i++)
system\collections\queue.cs (20)
95int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy;
99Array.Copy(_array, 0, q._array, _array.Length - _head, numToCopy);
123Array.Clear(_array, _head, _array.Length - _head);
145int arrayLen = array.Length;
152int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy;
156Array.Copy(_array, 0, array, index+_array.Length - _head, numToCopy);
162if (_size == _array.Length) {
163int newcapacity = (int)((long)_array.Length * (long)_growFactor / 100);
164if (newcapacity < _array.Length + _MinimumGrow) {
165newcapacity = _array.Length + _MinimumGrow;
171_tail = (_tail + 1) % _array.Length;
193_head = (_head + 1) % _array.Length;
238index = (index + 1) % _array.Length;
246return _array[(_head + i) % _array.Length];
262Array.Copy(_array, _head, arr, 0, _array.Length - _head);
263Array.Copy(_array, 0, arr, _array.Length - _head, _tail);
278Array.Copy(_array, _head, newarray, 0, _array.Length - _head);
279Array.Copy(_array, 0, newarray, _array.Length - _head, _tail);
system\defaultbinder.cs (103)
42if (match == null || match.Length == 0)
59int[][] paramOrder = new int[candidates.Length][];
61for (i = 0; i < candidates.Length; i++)
66paramOrder[i] = new int[(par.Length > args.Length) ? par.Length : args.Length];
71for (j = 0; j < args.Length; j++)
84Type[] paramArrayTypes = new Type[candidates.Length];
86Type[] argTypes = new Type[args.Length];
91for (i = 0; i < args.Length; i++)
108for (i = 0; i < candidates.Length; i++)
120if (par.Length == 0)
123if (args.Length != 0)
136else if (par.Length > args.Length)
141for (j = args.Length; j < par.Length - 1; j++)
147if (j != par.Length - 1)
162else if (par.Length < args.Length)
166int lastArgPos = par.Length - 1;
183int lastArgPos = par.Length - 1;
197int argsToCheck = (paramArrayType != null) ? par.Length - 1 : args.Length;
251if (paramArrayType != null && j == par.Length - 1)
254for (; j < args.Length; j++)
282if (j == args.Length)
302state = new BinderState((int[])paramOrder[0].Clone(), args.Length, paramArrayTypes[0] != null);
310if (parms.Length == args.Length)
314Object[] objs = new Object[parms.Length];
315int lastPos = parms.Length - 1;
322else if (parms.Length > args.Length)
324Object[] objs = new Object[parms.Length];
326for (i=0;i<args.Length;i++)
329for (;i<parms.Length - 1;i++)
344Object[] objs = new Object[parms.Length];
345int paramArrayPos = parms.Length - 1;
347objs[paramArrayPos] = Array.UnsafeCreateInstance(paramArrayTypes[0], args.Length - paramArrayPos);
348Array.Copy(args, paramArrayPos, (System.Array)objs[paramArrayPos], 0, args.Length - paramArrayPos);
382state = new BinderState((int[])paramOrder[currentMin].Clone(), args.Length, paramArrayTypes[currentMin] != null);
389if (parameters.Length == args.Length)
393Object[] objs = new Object[parameters.Length];
394int lastPos = parameters.Length - 1;
401else if (parameters.Length > args.Length)
403Object[] objs = new Object[parameters.Length];
405for (i=0;i<args.Length;i++)
408for (;i<parameters.Length - 1;i++)
426Object[] objs = new Object[parameters.Length];
427int paramArrayPos = parameters.Length - 1;
429objs[paramArrayPos] = Array.UnsafeCreateInstance(paramArrayTypes[currentMin], args.Length - paramArrayPos);
430Array.Copy(args, paramArrayPos, (System.Array)objs[paramArrayPos], 0, args.Length - paramArrayPos);
460for (i=0;i<candidates.Length;i++) {
524Type[] realTypes = new Type[types.Length];
525for (i=0;i<types.Length;i++) {
533if (match == null || match.Length == 0)
541for (i=0;i<candidates.Length;i++) {
543if (par.Length != types.Length)
545for (j=0;j<types.Length;j++) {
561if (j == types.Length)
572int[] paramOrder = new int[types.Length];
573for (i=0;i<types.Length;i++)
609if (match == null || match.Length == 0)
619int indexesLength = (indexes != null) ? indexes.Length : 0;
620for (i=0;i<candidates.Length;i++) {
625if (par.Length != indexesLength)
716int paramArrayPos = args.Length - 1;
717if (args.Length == binderState.m_originalSize)
721Object[] newArgs = new Object[args.Length];
723for (int i = paramArrayPos, j = 0; i < newArgs.Length; i++, j++) {
730if (args.Length > binderState.m_originalSize) {
745MethodBase[] aExactMatches = new MethodBase[match.Length];
748for (int i=0;i<match.Length;i++) {
750if (par.Length == 0) {
754for (j=0;j<types.Length;j++) {
761if (j < types.Length)
787int typesLength = (types != null) ? types.Length : 0;
788for (int i=0;i<match.Length;i++) {
824for (int i = 0; i < types.Length; i++)
841if (paramArrayType1 != null && paramOrder1[i] >= p1.Length - 1)
846if (paramArrayType2 != null && paramOrder2[i] >= p2.Length - 1)
869if (p1.Length > p2.Length)
873else if (p2.Length > p1.Length)
1037if (params1.Length != params2.Length)
1040int numParams = params1.Length;
1112object[] varsCopy = new object[vars.Length];
1113for (int i = 0; i < vars.Length; i ++)
1116for (int i = 0; i < vars.Length; i ++)
1127bool[] used = new bool[pars.Length];
1130for (int i=0;i<pars.Length;i++)
1133for (int i=0;i<names.Length;i++) {
1135for (j=0;j<pars.Length;j++) {
1144if (j == pars.Length)
1150for (int i=0;i<pars.Length;i++) {
1152for (;pos<pars.Length;pos++) {
system\diagnostics\eventing\eventsource.cs (52)
466return (manifestBytes == null) ? null : Encoding.UTF8.GetString(manifestBytes, 0, manifestBytes.Length);
670for (int i = 0; i < m_traits.Length - 1; i += 2)
1036int blobSize = arg1.Length;
1056int blobSize = arg2.Length;
1479if (m_traits != null && m_traits.Length % 2 != 0)
1530this.providerMetadata.Length);
1666int end = output.Length < 20 ? output.Length : 20;
2073var eventData = new object[eventTypes.typeInfos.Length];
2074for (int i = 0; i < eventTypes.typeInfos.Length; i++)
2091bool typesMatch = args.Length == infos.Length;
2094while (typesMatch && i < args.Length)
2143int paramCount = m_eventData[eventId].Parameters.Length;
2289for (int evtId = 0; evtId < dispatcher.m_EventEnabled.Length; ++evtId)
2403if (eventChannel != EventChannel.None && this.m_channelData != null && this.m_channelData.Length > (int)eventChannel)
2632for (int i = 0; i < m_eventData.Length; i++)
2783for (int i = 0; i < m_eventData.Length; i++)
2982if (eventId >= m_eventData.Length)
2991if (eventId >= dispatcher.m_EventEnabled.Length)
3005for (int i = 0; i < m_eventData.Length; i++)
3041dispatcher.m_EventEnabled = new bool[m_eventData.Length];
3079int dataLeft = rawManifest.Length;
3295eventData = new EventMetadata[methods.Length + 1];
3357for (int i = 0; i < methods.Length; i++)
3459if (eventData != null && startEventId < eventData.Length)
3487for (int fieldIdx = 0; fieldIdx < args.Length; fieldIdx++)
3537|| manifest.GetChannelData().Length > 0
3583if (args.Length > 0 && args[0].ParameterType == typeof(Guid) &&
3586var newargs = new ParameterInfo[args.Length - 1];
3587Array.Copy(args, 1, newargs, 0, args.Length - 1);
3640if (eventData == null || eventData.Length <= eventAttribute.EventId)
3642EventMetadata[] newValues = new EventMetadata[Math.Max(eventData.Length + 16, eventAttribute.EventId + 1)];
3643Array.Copy(eventData, newValues, eventData.Length);
3672int idx = eventData.Length;
3679if (eventData.Length - idx > 2) // allow one wasted slot.
3682Array.Copy(eventData, newValues, newValues.Length);
3695enabledArray = new bool[m_eventData.Length];
3715if (evtId < eventData.Length && eventData[evtId].Descriptor.EventId != 0)
3722for (int idx = 0; idx < eventData.Length; ++idx)
3807for (int idx = 0; idx < instrs.Length; )
3861for (int search = idx + 1; search < instrs.Length; search++)
3897if (idx >= instrs.Length || instrs[idx] >= 6)
4612for (int i = 0; i < eventSourcesSnapshot.Length; i++)
5277if (cur.m_eventId >= 0 && cur.m_eventId < source.m_eventData.Length)
5299if (filterList.m_eventId >= 0 && filterList.m_eventId < source.m_eventData.Length)
5345for (int i = 0; i < activityFilterStrings.Length; ++i)
5370for (int j = 0; j < source.m_eventData.Length; j++)
5381if (eventId < 0 || eventId >= source.m_eventData.Length)
5688if (0 <= eventId && eventId < source.m_eventData.Length)
5709for (int i = 0; i < keyValues.Length / 2; i++)
6520ArraySortHelper<string>.IntrospectiveSort(sortedStrings, 0, sortedStrings.Length, Comparer<string>.Default);
System\Diagnostics\Eventing\TraceLogging\TraceLoggingDataCollector.cs (16)
219DataCollector.ThreadInstance.AddBinary(value, value == null ? 0 : value.Length);
230DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(bool));
242DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(sbyte));
253DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(short));
265DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(ushort));
276DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(int));
288DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(uint));
299DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(long));
311DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(ulong));
322DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, IntPtr.Size);
334DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, UIntPtr.Size);
345DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(float));
356DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(double));
367DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(char));
378DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, 16);
389DataCollector.ThreadInstance.AddArray(value, value == null ? 0 : value.Length, sizeof(byte));
System\Diagnostics\Eventing\TraceLogging\TraceLoggingEventSource.cs (14)
440descriptors[0].SetMetadata(pMetadata0, this.providerMetadata.Length, 2);
441descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1);
442descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1);
457for (int i = 0; i < eventTypes.typeInfos.Length; i++)
527var descriptors = stackalloc EventData[eventTypes.dataCount + eventTypes.typeInfos.Length * 2 + 3];
534descriptors[0].SetMetadata(pMetadata0, this.providerMetadata.Length, 2);
535descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1);
536descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1);
539for (int i = 0; i < eventTypes.typeInfos.Length; i++)
610descriptors[0].SetMetadata(pMetadata0, this.providerMetadata.Length, 2);
611descriptors[1].SetMetadata(pMetadata1, nameInfo.nameMetadata.Length, 1);
612descriptors[2].SetMetadata(pMetadata2, eventTypes.typeMetadata.Length, 1);
740for (int i = 0; i < m_traits.Length - 1; i += 2)
764int startPos = providerMetadata.Length-traitMetaData.Count;
system\globalization\datetimeformatinfo.cs (62)
253Contract.Assert(this.abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week");
276Contract.Assert(this.m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.internalGetSuperShortDayNames] Expected 7 day names in a week");
293Contract.Assert(this.dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week");
310Contract.Assert(this.abbreviatedMonthNames.Length == 12 || this.abbreviatedMonthNames.Length == 13,
329Contract.Assert(this.monthNames.Length == 12 || this.monthNames.Length == 13,
378Contract.Assert(this.allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns");
381Contract.Assert(this.allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns");
384Contract.Assert(this.allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns");
387Contract.Assert(this.allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns");
390Contract.Assert(this.allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns");
632for (int i = 0; i < this.OptionalCalendars.Length; i++)
752for (int i = 0; i < EraNames.Length; i++) {
760for (int i = 0; i < AbbreviatedEraNames.Length; i++) {
766for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++) {
806if ((--era) < EraNames.Length && (era >= 0)) {
826if (AbbreviatedEraNames.Length == 0) {
834if ((--era) < m_abbrevEraNames.Length && (era >= 0)) {
1380Contract.Requires(values.Length >= length);
1404if (value.Length != 7) {
1408CheckNullValue(value, value.Length);
1432if (value.Length != 7)
1437CheckNullValue(value, value.Length);
1457if (value.Length != 7)
1462CheckNullValue(value, value.Length);
1482if (value.Length != 13)
1487CheckNullValue(value, value.Length - 1);
1508if (value.Length != 13)
1513CheckNullValue(value, value.Length - 1);
1567if ((month < 1) || (month > monthNamesArray.Length)) {
15701, monthNamesArray.Length));
1588Contract.Assert(this.m_genitiveAbbreviatedMonthNames.Length == 13,
1597Contract.Assert(this.genitiveMonthNames.Length == 13,
1615Contract.Assert(this.leapYearMonthNames.Length == 13,
1664String[] result = new String[patterns1.Length * patterns2.Length];
1668for (int i = 0; i < patterns1.Length; i++)
1670for (int j = 0; j < patterns2.Length; j++)
1686for (int i = 0; i < DateTimeFormat.allStandardFormats.Length; i++)
1689for (int j = 0; j < strings.Length; j++)
1808Contract.Assert(patterns != null && patterns.Length > 0,
1821for (i = 0; i < patterns.Length; i++)
1832if (i < patterns.Length)
1844newPatterns = new String[patterns.Length + 1];
1847Array.Copy(patterns, 0, newPatterns, 1, patterns.Length);
1909Contract.Assert(this.allYearMonthPatterns.Length > 0,
1928Contract.Assert(this.allShortDatePatterns.Length > 0,
1946Contract.Assert(this.allLongDatePatterns.Length > 0,
1963Contract.Assert(this.allShortTimePatterns.Length > 0,
1980Contract.Assert(this.allLongTimePatterns.Length > 0,
2055if (patterns.Length == 0)
2061for (int i=0; i<patterns.Length; i++)
2125if (value.Length != 13)
2130CheckNullValue(value, value.Length - 1);
2153if (value.Length != 13)
2158CheckNullValue(value, value.Length - 1);
2511for (int i = 0; i < dateWords.Length; i++)
2585for (int i = 1; i <= eras.Length; i++) {
2601for (int i = 1; i <= jaDtfi.Calendar.Eras.Length; i++) {
2612for (int i = 1; i <= twDtfi.Calendar.Eras.Length; i++) {
2644for (int i = 0; i < AbbreviatedEnglishEraNames.Length; i++) {
system\io\binarywriter.cs (8)
173OutStream.Write(buffer, 0, buffer.Length);
199numBytes = _encoder.GetBytes(&ch, 1, pBytes, _buffer.Length, true);
215byte[] bytes = _encoding.GetBytes(chars, 0, chars.Length);
216OutStream.Write(bytes, 0, bytes.Length);
227OutStream.Write(bytes, 0, bytes.Length);
366_maxChars = _largeByteBuffer.Length / _encoding.GetMaxByteCount(1);
369if (len <= _largeByteBuffer.Length) {
396byteLen = _encoder.GetBytes(pChars + charStart, charCount, pBytes, _largeByteBuffer.Length, charCount == numLeft);
system\io\streamreader.cs (28)
256_checkPreamble = (_preamble.Length > 0);
390if (buffer.Length - index < count)
451if (buffer.Length - index < count)
525_maxCharsPerBuffer = encoding.GetMaxCharCount(byteBuffer.Length);
540Contract.Assert(bytePos <= _preamble.Length, "_compressPreamble was called with the current bytePos greater than the preamble buffer length. Are two threads using this StreamReader at the same time?");
541int len = (byteLen >= (_preamble.Length))? (_preamble.Length - bytePos) : (byteLen - bytePos);
551Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
554if (bytePos == _preamble.Length) {
556CompressBuffer(_preamble.Length);
574Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
575int len = stream.Read(byteBuffer, bytePos, byteBuffer.Length - bytePos);
595byteLen = stream.Read(byteBuffer, 0, byteBuffer.Length);
605_isBlocked = (byteLen < byteBuffer.Length);
659Contract.Assert(bytePos <= _preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
660int len = stream.Read(byteBuffer, bytePos, byteBuffer.Length - bytePos);
685byteLen = stream.Read(byteBuffer, 0, byteBuffer.Length);
696_isBlocked = (byteLen < byteBuffer.Length);
910if (buffer.Length - index < count)
970Contract.Assert(BytePos_Prop <= Preamble_Prop.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
972int len = await tmpStream.ReadAsync(tmpByteBuffer, tmpBytePos, tmpByteBuffer.Length - tmpBytePos).ConfigureAwait(false);
1008ByteLen_Prop = await tmpStream.ReadAsync(tmpByteBuffer, 0, tmpByteBuffer.Length).ConfigureAwait(false);
1022IsBlocked_Prop = (ByteLen_Prop < tmpByteBuffer.Length);
1098if (buffer.Length - index < count)
1196Contract.Assert(BytePos_Prop <= Preamble_Prop.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
1198int len = await tmpStream.ReadAsync(tmpByteBuffer, tmpBytePos, tmpByteBuffer.Length - tmpBytePos).ConfigureAwait(false);
1218ByteLen_Prop = await tmpStream.ReadAsync(tmpByteBuffer, 0, tmpByteBuffer.Length).ConfigureAwait(false);
1228IsBlocked_Prop = (ByteLen_Prop < tmpByteBuffer.Length);
system\reflection\customattribute.cs (44)
312CustomAttributeData[] customAttributes = new CustomAttributeData[records.Length];
313for (int i = 0; i < records.Length; i++)
331for (int i = 0; i < records.Length; i++)
376m_ctorParams = new CustomAttributeCtorParameter[parameters.Length];
377for (int i = 0; i < parameters.Length; i++)
382m_namedParams = new CustomAttributeNamedParameter[properties.Length + fields.Length];
383for (int i = 0; i < fields.Length; i++)
386for (int i = 0; i < properties.Length; i++)
387m_namedParams[i + fields.Length] = new CustomAttributeNamedParameter(
390m_members = new MemberInfo[fields.Length + properties.Length];
392properties.CopyTo(m_members, fields.Length);
537CustomAttributeTypedArgument[] typedCtorArgs = new CustomAttributeTypedArgument[m_ctorParams.Length];
539for (int i = 0; i < typedCtorArgs.Length; i++)
563for (int i = 0; i < m_namedParams.Length; i++)
571for (int i = 0, j = 0; i < m_namedParams.Length; i++)
895CustomAttributeTypedArgument[] arrayValue = new CustomAttributeTypedArgument[encodedArg.ArrayValue.Length];
896for (int i = 0; i < arrayValue.Length; i++)
1038if (customAttributeCtorParameters.Length != 0 || customAttributeNamedParameters.Length != 0)
1349if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1365for (int i = 0; i < attributes.Length; i++)
1450if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1466for (int i = 0; i < attributes.Length; i++)
1486if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1505if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1523if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1536if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1549if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1564if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1578if (pcaCount > 0) Array.Copy(pca, 0, attributes, attributes.Length - pcaCount, pcaCount);
1618for (int i = 0; i < car.Length; i++)
1633for (int i = 0; i < car.Length; i++)
1667if (attributeFilterType == null && car.Length == 0)
1670object[] attributes = CreateAttributeArrayHelper(arrayType, car.Length);
1687for (int i = 0; i < car.Length; i++)
1838if (cAttributes == car.Length && pcaCount == 0)
2020for (int i = 0; i < car.Length; i++)
2146s_pcasCount = pcas.Length;
2245if (GetCustomAttributes(type, caType, true, out count).Length != 0)
2310if (GetCustomAttributes(method, caType, true, out count).Length != 0)
2421return GetCustomAttributes(assembly, caType, true, out count).Length > 0;
2531if (GetCustomAttributes(ctor, caType, true, out count).Length != 0)
system\reflection\emit\ilgenerator.cs (33)
37Contract.Ensures(Contract.Result<int[]>().Length > incoming.Length);
38int[] temp = new int [incoming.Length*2];
39Array.Copy(incoming, temp, incoming.Length);
45byte [] temp = new byte [incoming.Length*2];
46Array.Copy(incoming, temp, incoming.Length);
53Array.Copy(incoming, temp, incoming.Length);
59__FixupData [] temp = new __FixupData[incoming.Length*2];
61Array.Copy(incoming, temp, incoming.Length);
67__ExceptionInfo[] temp = new __ExceptionInfo[incoming.Length*2];
68Array.Copy(incoming, temp, incoming.Length);
173else if (m_RelocFixupList.Length <= m_RelocFixupCount)
326if (m_length + size >= m_ILStream.Length)
328if (m_length + size >= 2 * m_ILStream.Length)
380else if (m_fixupData.Length <= m_fixupCount)
405int length = exceptions.Length;
546stackchange -= parameterTypes.Length;
549stackchange -= optionalParameterTypes.Length;
572cParams = parameterTypes.Length;
629stackchange -= parameters.Length;
637stackchange -= optionalParameterTypes.Length;
715stackchange -= parameters.Length;
827int count = labels.Length;
974if (m_exceptionCount>=m_exceptions.Length) {
978if (m_currExcStackCount>=m_currExcStack.Length) {
1132if (m_labelCount>=m_labelList.Length) {
1147if (labelIndex<0 || labelIndex>=m_labelList.Length) {
1456Type[] temp = new Type[incoming.Length * 2];
1457Array.Copy(incoming, temp, incoming.Length);
1467if (m_currentCatch>=m_catchAddr.Length) {
1752else if (m_iCount == m_iOffsets.Length)
1874else if (m_DocumentCount == m_Documents.Length)
1950else if (m_iLineNumberCount == m_iOffsets.Length)
system\reflection\emit\typebuilder.cs (23)
239localAttr = new byte[attr.Length];
240Array.Copy(attr, localAttr, attr.Length);
244localAttr, (localAttr != null) ? localAttr.Length : 0, toDisk, updateCompilerFlags);
652for(i = 0; i < interfaces.Length; i++)
660interfaceTokens = new int[interfaces.Length + 1];
661for(i = 0; i < interfaces.Length; i++)
1338for(int i = 0; i < interfaces.Length; i++)
1577if (names.Length == 0)
1581for (int i = 0; i < names.Length; i ++)
1588m_inst = new GenericTypeParameterBuilder[names.Length];
1589for(int i = 0; i < names.Length; i ++)
1713if (parameterTypeOptionalCustomModifiers != null && parameterTypeOptionalCustomModifiers.Length != parameterTypes.Length)
1716if (parameterTypeRequiredCustomModifiers != null && parameterTypeRequiredCustomModifiers.Length != parameterTypes.Length)
2100return DefineDataHelper(name, data, data.Length, attributes);
2317constraints[constraints.Length - 2] = tkParent;
2412else if (body == null || body.Length == 0)
2423if ((body == null || body.Length == 0) && !meth.m_canBeRuntimeImpl)
2434body, (body != null) ? body.Length : 0,
2436exceptions, (exceptions != null) ? exceptions.Length : 0,
2437tokenFixups, (tokenFixups != null) ? tokenFixups.Length : 0);
2570length = blob.Length;
system\rttype.cs (100)
508int memberCount = m_allMembers.Length;
552int cachedCount = cachedMembers.Length;
555for (int i = 0; i < list.Length; i++)
580if (freeSlotIndex >= cachedMembers.Length)
597newSize = cachedMembers.Length + 1;
601newSize = Math.Max(Math.Max(4, 2 * cachedMembers.Length), list.Length);
879for (int i = 0; i < interfaces.Length; i++)
892for (int i = 0; i < interfaces.Length; i++)
1073for (int j = 0; j < iFaces.Length; j++)
1097for (int i = 0; i < ifaces.Length; i++)
1135for (int i = 0; i < constraints.Length; i++)
1142for (int j = 0; j < temp.Length; j++)
1159for (int i = 0; i < interfaces.Length; i++)
1384(!declaringType.IsInterface && usedSlots != null && usedSlots.Length >= numVirtuals));
2041for (int i = 0; i < methodBases.Length; i++)
2189for (int i = 0; i < candidates.Length; i++)
2214for(int i = 0; i < genericArguments.Length; i++)
2222if (genericArguments.Length != genericParamters.Length)
2224Environment.GetResourceString("Argument_NotEnoughGenArguments", genericArguments.Length, genericParamters.Length));
2253for (int i = 0; i < genericArguments.Length; i++)
2545if (argumentTypes.Length != parameterInfos.Length)
2555bool excessSuppliedArguments = argumentTypes.Length > parameterInfos.Length;
2586if (!parameterInfos[argumentTypes.Length].IsOptional)
2595if (parameterInfos.Length == 0)
2599bool shortByMoreThanOneSuppliedArgument = argumentTypes.Length < parameterInfos.Length - 1;
2604ParameterInfo lastParameter = parameterInfos[parameterInfos.Length - 1];
2628for(int i = 0; i < parameterInfos.Length; i ++)
2813ListBuilder<MethodInfo> candidates = new ListBuilder<MethodInfo>(cache.Length);
2814for (int i = 0; i < cache.Length; i++)
2837ListBuilder<ConstructorInfo> candidates = new ListBuilder<ConstructorInfo>(cache.Length);
2838for (int i = 0; i < cache.Length; i++)
2869ListBuilder<PropertyInfo> candidates = new ListBuilder<PropertyInfo>(cache.Length);
2870for (int i = 0; i < cache.Length; i++)
2875(types == null || (propertyInfo.GetIndexParameters().Length == types.Length)))
2978ListBuilder<EventInfo> candidates = new ListBuilder<EventInfo>(cache.Length);
2979for (int i = 0; i < cache.Length; i++)
3002ListBuilder<FieldInfo> candidates = new ListBuilder<FieldInfo>(cache.Length);
3003for (int i = 0; i < cache.Length; i++)
3027ListBuilder<Type> candidates = new ListBuilder<Type>(cache.Length);
3028for (int i = 0; i < cache.Length; i++)
3080ArraySortHelper<ConstructorInfo>.IntrospectiveSort(constructors, 0, constructors.Length, ConstructorInfoComparer.SortByMetadataToken);
3106Type[] interfaces = new Type[candidates.Length];
3107for (int i = 0; i < candidates.Length; i++)
3143Contract.Assert(i == members.Length);
3219if (types == null || types.Length == 0)
3259if (types.Length == 0 && candidates.Count == 1)
3264if (parameters == null || parameters.Length == 0)
3291if (types == null || types.Length == 0)
3335for (int i = 0; i < cache.Length; i++)
3365for (int i = 0; i < cache.Length; i++)
3411for (int i = 0; i < cache.Length; i++)
3442for (int i = 0; i < cache.Length; i++)
3535Contract.Assert(i == compressMembers.Length);
3741for (int i = 0; i < constraints.Length; i++)
3789for (int i = 0; i < constraints.Length; i++)
4068String[] retVal = new String[ret.Length];
4070Array.Copy(ret, retVal, ret.Length);
4086Array ret = Array.UnsafeCreateInstance(this, values.Length);
4088for (int i = 0; i < values.Length; i++)
4207RuntimeType[] instantiationRuntimeType = new RuntimeType[instantiation.Length];
4213if (GetGenericArguments().Length != instantiation.Length)
4216for (int i = 0; i < instantiation.Length; i ++)
4226Type[] instantiationCopy = new Type[instantiation.Length];
4227for (int iCopy = 0; iCopy < instantiation.Length; iCopy++)
4539if (namedParams.Length > providedArgs.Length)
4545if (namedParams.Length != 0)
4610int argCnt = (providedArgs != null) ? providedArgs.Length : 0;
4690if (flds.Length == 1)
4694else if (flds.Length > 0)
4839for(int i = 0; i < semiFinalists.Length; i ++)
4855results = new List<MethodInfo>(semiFinalists.Length);
4882for(int i = 0; i < semiFinalists.Length; i ++)
4909results = new List<MethodInfo>(semiFinalists.Length);
4932finalist.GetParametersNoCopy().Length == 0 &&
5204int argCnt = args.Length;
5220List<MethodBase> matches = new List<MethodBase>(candidates.Length);
5232for(int i = 0; i < candidates.Length; i ++)
5240if (cons != null && cons.Length == 0)
5309if (invokeMethod.GetParametersNoCopy().Length == 0)
5311if (args.Length != 0)
5620int cArgs = aArgs.Length;
5691int cArgs = aArgs.Length;
5728int numElems = oldArray.Length;
5996int index = hashcode % keys.Length;
6020if (index >= keys.Length)
6021index -= keys.Length;
6057for (int i = 0; i < keys.Length; i++)
6081if (requiredSize >= table.m_keys.Length)
6102int index = hashcode % keys.Length;
6115if (index >= keys.Length)
6116index -= keys.Length;
system\runtime\remoting\message.cs (75)
310if (index < pi.Length)
316return "VarArg" + (index - pi.Length);
476Type[] methodSig = new Type[paramArray.Length];
477for(int i = 0; i < paramArray.Length; i++)
518if (pi.Length != args.Length)
525args.Length, pi.Length));
528for (int i=0; i < pi.Length; i++)
1977for (int i = 0 ; i < _keys.Length; i++)
1989for (int i=0; i<_keys.Length; i++)
1996_dict.CopyTo(array, index+_keys.Length);
2007for (int i=0; i<_keys.Length; i++)
2112int len = _keys.Length;
2120for (int i = 0; i<_keys.Length; i++)
2138int len = _keys.Length;
2147for (int i = 0; i<_keys.Length; i++)
2166return _dict.Count+_keys.Length;
2170return _keys.Length;
2216if (i < _md._keys.Length)
2243if (i < _md._keys.Length)
2270if (i < _md._keys.Length)
2642return _outArgs.Length;
2660if ((argNum<0) || (argNum>=_outArgs.Length))
2682if ((index < 0) || (index>=_outArgs.Length))
2991for (int i=0; i<h.Length; i++)
3142int arity = instArgs == null ? 0 : instArgs.Length;
3177for (int i = 0; i < methods.Length; i++)
3185int miArity = mi.IsGenericMethod ? mi.GetGenericArguments().Length : 0;
3250if (instArgs != null && instArgs.Length > 0)
3296int canidatesCount = canidates.Length;
3307int argCount = args.Length;
3314if (canidate.GetParameters().Length == argCount)
3333int canidatesCount = canidates.Length;
3353if (parameters.Length == argValues.Count)
3356for (int j = 0; j < parameters.Length; j++)
3459args = new Object[pinfos.Length];
3479for (int j=0; j<pinfos.Length; j++)
3498if (position >= args.Length)
3555return(args == null) ? 0 : args.Length;
3785for (co = 0; co < h.Length; co++)
3804for (i=0; i<h.Length; i++)
3877if (h != null && h.Length > 0 && h[0].Name == "__methodName")
3880if (h.Length > 1)
3882newHeaders = new Header[h.Length -1];
3883Array.Copy(h, 1, newHeaders, 0, h.Length-1);
4150argCount = _methodCache.Parameters.Length;
4180argCount = _methodCache.Parameters.Length;
4202argCount = _methodCache.Parameters.Length;
4242if (h != null && h.Length > 0 && h[0].Name == "__methodName")
4244if (h.Length > 1)
4246newHeaders = new Header[h.Length -1];
4247Array.Copy(h, 1, newHeaders, 0, h.Length-1);
4265int outParamsCount = _methodCache.MarshalResponseArgMap.Length;
4454for (int j=0; j<pinfos.Length; j++)
4585return outArgs.Length;
4599if (index < 0 || index >= paramInfo.Length)
4715for (co = 0; co < h.Length; co++)
4733for (int i=0; i<h.Length; i++)
5272return _map.Length;
5281if (_map == null || argNum < 0 || argNum >= _map.Length)
5296if (_map == null || argNum < 0 || argNum >= _map.Length)
5319Object[] ret = new Object[_map.Length];
5320for(int i=0; i<_map.Length; i++)
5337ret = new Type[_map.Length];
5338for (int i=0; i<_map.Length; i++)
5355ret = new String[_map.Length];
5356for (int i=0; i<_map.Length; i++)
5387int[] tempMarshalRequestMap = new int[parameters.Length];
5388int[] tempMarshalResponseMap = new int[parameters.Length];
5465for (co = 0; co < parameters.Length; co++)
5514Object[] args = new Object[syncMethod.Parameters.Length];
5518for (int co = 0; co < outRefArgMap.Length; co++)
5823return _args.Length;
6053return _args.Length;
system\runtime\serialization\formatters\binary\binaryutilclasses.cs (25)
292if (top == (objects.Length -1))
313int size = objects.Length * 2;
315Array.Copy(objects, 0, newItems, 0, objects.Length);
388objects = new Object[sizedArray.objects.Length];
390negObjects = new Object[sizedArray.negObjects.Length];
405if (-index > negObjects.Length - 1)
411if (index > objects.Length - 1)
420if (-index > negObjects.Length-1 )
429if (index > objects.Length-1 )
448int size = Math.Max(negObjects.Length * 2, (-index)+1);
450Array.Copy(negObjects, 0, newItems, 0, negObjects.Length);
455int size = Math.Max(objects.Length * 2, index+1);
457Array.Copy(objects, 0, newItems, 0, objects.Length);
481objects = new int[sizedArray.objects.Length];
483negObjects = new int[sizedArray.negObjects.Length];
499if (-index > negObjects.Length-1 )
505if (index > objects.Length-1 )
514if (-index > negObjects.Length-1 )
523if (index > objects.Length-1 )
538int size = Math.Max(negObjects.Length * 2, (-index)+1);
540Array.Copy(negObjects, 0, newItems, 0, negObjects.Length);
545int size = Math.Max(objects.Length * 2, index+1);
547Array.Copy(objects, 0, newItems, 0, objects.Length);
702if (valueInfos.Length != 1)
703throw new SerializationException(Environment.GetResourceString("Serialization_HeaderReflection",valueInfos.Length));
system\runtime\serialization\objectmanager.cs (21)
130if (index>=m_objects.Length) {
171BCLDebug.Trace("SER", "[AddObjectHolder]Adding ObjectHolder with id: ", holder.m_id, " Current Bins: ", m_objects.Length);
178if (holder.m_id>=m_objects.Length && m_objects.Length != MaxArraySize) {
182newSize = (m_objects.Length * 2);
198Array.Copy(m_objects, temp, m_objects.Length);
373if ((currentFieldIndex + 1)>=fieldsTemp.Length) {
374FieldInfo[] temp = new FieldInfo[fieldsTemp.Length * 2];
375Array.Copy(fieldsTemp, temp, fieldsTemp.Length);
477for(int i=0;i<intermediateFields.Length;i++){
960BCLDebug.Trace("SER", "[ObjectManager.DoFixups]Remaining object length is: ", m_objects.Length);
961for (int i=0; i<m_objects.Length; i++) {
1602if (m_count==m_values.Length) {
1610if (m_count==m_values.Length) {
1617int newLength = m_values.Length*2;
1657if (m_totalItems==m_values.Length) {
1705BCLDebug.Trace("SER", "[LongList.EnlargeArray]Enlarging array of size ", m_values.Length);
1706int newLength = m_values.Length*2;
1738if (m_count==m_values.Length) {
1750BCLDebug.Trace("SER", "[ObjectHolderList.EnlargeArray]Enlarging array of size ", m_values.Length);
1751int newLength = m_values.Length*2;
system\security\cryptography\base64transforms.cs (16)
52if (inputCount < 0 || (inputCount > inputBuffer.Length)) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidValue"));
53if ((inputBuffer.Length - inputCount) < inputOffset) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
60if (tempBytes.Length != 4) throw new CryptographicException(Environment.GetResourceString( "Cryptography_SSE_InvalidDataSize" ));
61Buffer.BlockCopy(tempBytes, 0, outputBuffer, outputOffset, tempBytes.Length);
62return(tempBytes.Length);
69if (inputCount < 0 || (inputCount > inputBuffer.Length)) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidValue"));
70if ((inputBuffer.Length - inputCount) < inputOffset) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
147if (inputCount < 0 || (inputCount > inputBuffer.Length)) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidValue"));
148if ((inputBuffer.Length - inputCount) < inputOffset) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
160effectiveCount = temp.Length;
183Buffer.BlockCopy(tempBytes, 0, outputBuffer, outputOffset, tempBytes.Length);
184return(tempBytes.Length);
191if (inputCount < 0 || (inputCount > inputBuffer.Length)) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidValue"));
192if ((inputBuffer.Length - inputCount) < inputOffset) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
204effectiveCount = temp.Length;
264Array.Clear(_inputBuffer, 0, _inputBuffer.Length);
system\security\cryptography\capinative.cs (14)
322Contract.Assert(buffer != null && buffer.Length > 0, "buffer != null && buffer.Length > 0");
324if (!UnsafeNativeMethods.CryptGenRandom(cspHandle, buffer.Length, buffer)) {
336Contract.Assert(buffer != null && buffer.Length > 0, "buffer != null && buffer.Length > 0");
338Contract.Assert(buffer.Length >= offset + count, "buffer.Length >= offset + count");
355Contract.Assert(rawProperty.Length == sizeof(int) || rawProperty.Length == 0, "Unexpected property size");
356return rawProperty.Length == sizeof(int) ? BitConverter.ToInt32(rawProperty, 0) : 0;
392Contract.Assert(rawProperty.Length == sizeof(int) || rawProperty.Length == 0, "Unexpected property size");
393return rawProperty.Length == sizeof(int) ? BitConverter.ToInt32(rawProperty, 0) : 0;
456byte[] signatureValue = new byte[signature.Length];
457Array.Copy(signature, signatureValue, signatureValue.Length);
462if (hashValue.Length != GetHashPropertyInt32(hashHandle, HashProperty.HashSize)) {
472signatureValue.Length,
system\security\cryptography\cryptoapitransform.cs (21)
60int[] _rgArgIds = new int[rgArgIds.Length];
61Array.Copy(rgArgIds, _rgArgIds, rgArgIds.Length);
62_rgbKey = new byte[rgbKey.Length];
63Array.Copy(rgbKey, _rgbKey, rgbKey.Length);
64Object[] _rgArgValues = new Object[rgArgValues.Length];
66for (int j = 0; j < rgArgValues.Length; j++) {
69byte[] rgbNew = new byte[rgbOrig.Length];
70Array.Copy(rgbOrig, rgbNew, rgbOrig.Length);
96Utils.SetKeyParamRgb(_safeKeyHandle, _rgArgIds[i], rgbValue, rgbValue.Length);
135Array.Clear(_rgbKey,0,_rgbKey.Length);
139Array.Clear(IVValue,0,IVValue.Length);
143Array.Clear(_depadBuffer, 0, _depadBuffer.Length);
205if ((inputCount <= 0) || (inputCount % InputBlockSize != 0) || (inputCount > inputBuffer.Length)) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidValue"));
206if ((inputBuffer.Length - inputCount) < inputOffset) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
230int r = Utils._DecryptData(_safeKeyHandle, _depadBuffer, 0, _depadBuffer.Length, ref outputBuffer, outputOffset, PaddingValue, false);
245if ((inputCount < 0) || (inputCount > inputBuffer.Length)) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidValue"));
246if ((inputBuffer.Length - inputCount) < inputOffset) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
265byte[] temp = new byte[_depadBuffer.Length + inputCount];
266Buffer.InternalBlockCopy(_depadBuffer, 0, temp, 0, _depadBuffer.Length);
267Buffer.InternalBlockCopy(inputBuffer, inputOffset, temp, _depadBuffer.Length, inputCount);
269Utils._DecryptData(_safeKeyHandle, temp, 0, temp.Length, ref transformedBytes, 0, PaddingValue, true);
system\security\cryptography\cryptoconfig.cs (16)
551string[] algorithmNames = new string[names.Length];
552Array.Copy(names, algorithmNames, algorithmNames.Length);
642for (int i = 0; i < cons.Length; i ++) {
644if (con.GetParameters().Length == args.Length) {
696string[] oidNames = new string[names.Length];
697Array.Copy(names, oidNames, oidNames.Length);
759uint[] oidNums = new uint[oidString.Length];
760for (int i = 0; i < oidString.Length; i++) {
765byte[] encodedOidNums = new byte[oidNums.Length * 5]; // this is guaranteed to be longer than necessary
768if (oidNums.Length < 2) {
773Array.Copy(retval, 0, encodedOidNums, encodedOidNumsIndex, retval.Length);
774encodedOidNumsIndex += retval.Length;
775for (int i = 2; i < oidNums.Length; i++) {
777Buffer.InternalBlockCopy(retval, 0, encodedOidNums, encodedOidNumsIndex, retval.Length);
778encodedOidNumsIndex += retval.Length;
system\security\cryptography\cryptostream.cs (17)
132_stream.Write(finalBytes, 0, finalBytes.Length);
145Array.Clear(_InputBuffer, 0, _InputBuffer.Length);
147Array.Clear(_OutputBuffer, 0, _OutputBuffer.Length);
187if (buffer.Length - offset < count)
251Array.Clear(tempInputBuffer, 0, tempInputBuffer.Length);
252Array.Clear(tempOutputBuffer, 0, tempOutputBuffer.Length);
288_OutputBufferIndex = finalBytes.Length;
315if (buffer.Length - offset < count)
348Contract.Requires(buffer.Length - offset >= count);
427Array.Clear(tempInputBuffer, 0, tempInputBuffer.Length);
428Array.Clear(tempOutputBuffer, 0, tempOutputBuffer.Length);
469_OutputBufferIndex = finalBytes.Length;
499if (buffer.Length - offset < count)
579if (buffer.Length - offset < count)
603Contract.Requires(buffer.Length - offset >= count);
719Array.Clear(_InputBuffer, 0, _InputBuffer.Length);
721Array.Clear(_OutputBuffer, 0, _OutputBuffer.Length);
system\security\cryptography\hmac.cs (8)
67for (i=0; i < KeyValue.Length; i++) {
80if (key.Length > BlockSizeValue) {
136m_hash1.TransformBlock(m_inner, 0, m_inner.Length, m_inner, 0);
144m_hash1.TransformBlock(m_inner, 0, m_inner.Length, m_inner, 0);
151m_hash2.TransformBlock(m_outer, 0, m_outer.Length, m_outer, 0);
153m_hash2.TransformBlock(hashValue1, 0, hashValue1.Length, hashValue1, 0);
170Array.Clear(m_inner, 0, m_inner.Length);
172Array.Clear(m_outer, 0, m_outer.Length);
system\security\cryptography\passwordderivebytes.cs (12)
148ib = _extra.Length - _extraCount;
172if (rgb.Length + ib > cb) {
195Array.Clear(_baseValue, 0, _baseValue.Length);
198Array.Clear(_extra, 0, _extra.Length);
201Array.Clear(_password, 0, _password.Length);
204Array.Clear(_salt, 0, _salt.Length);
228_password, _password.Length, keySize << 16, rgbIV, rgbIV.Length,
246_hash.TransformBlock(_password, 0, _password.Length, _password, 0);
248_hash.TransformBlock(_salt, 0, _salt.Length, _salt, 0);
272cs.Write(_baseValue, 0, _baseValue.Length);
283cs.Write(_baseValue, 0, _baseValue.Length);
system\security\cryptography\pkcs1maskgenerationmethod.cs (7)
48for (int ib=0; ib<rgbT.Length; ) {
51hash.TransformBlock(rgbSeed, 0, rgbSeed.Length, rgbSeed, 0);
55if (rgbT.Length - ib > _hash.Length) {
56Buffer.BlockCopy(_hash, 0, rgbT, ib, _hash.Length);
58Buffer.BlockCopy(_hash, 0, rgbT, ib, rgbT.Length - ib);
60ib += hash.Hash.Length;
system\security\cryptography\rfc2898derivebytes.cs (9)
140if (value.Length < 8)
207Array.Clear(m_buffer, 0, m_buffer.Length);
210Array.Clear(m_salt, 0, m_salt.Length);
217Array.Clear(m_buffer, 0, m_buffer.Length);
229m_hmac.TransformBlock(m_salt, 0, m_salt.Length, null, 0);
230m_hmac.TransformBlock(INT_block, 0, INT_block.Length, null, 0);
237m_hmac.TransformBlock(temp, 0, temp.Length, null, 0);
271m_password, m_password.Length, keySize << 16, rgbIV, rgbIV.Length,
system\security\cryptography\rijndaelmanagedtransform.cs (34)
70m_Nk = rgbKey.Length / 4;
125if (rgbIV.Length / 4 != m_Nb)
177Array.Clear(m_IV, 0, m_IV.Length);
181Array.Clear(m_lastBlockBuffer, 0, m_lastBlockBuffer.Length);
185Array.Clear(m_encryptKeyExpansion, 0, m_encryptKeyExpansion.Length);
189Array.Clear(m_decryptKeyExpansion, 0, m_decryptKeyExpansion.Length);
193Array.Clear(m_depadBuffer, 0, m_depadBuffer.Length);
197Array.Clear(m_shiftRegister, 0, m_shiftRegister.Length);
245if (inputCount <= 0 || (inputCount % InputBlockSize != 0) || (inputCount > inputBuffer.Length)) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidValue"));
246if ((inputBuffer.Length - inputCount) < inputOffset) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
2870, m_depadBuffer.Length,
313if (inputCount < 0 || (inputCount > inputBuffer.Length)) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidValue"));
314if ((inputBuffer.Length - inputCount) < inputOffset) throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen"));
346byte[] temp = new byte[m_depadBuffer.Length + inputCount];
347Buffer.InternalBlockCopy(m_depadBuffer, 0, temp, 0, m_depadBuffer.Length);
348Buffer.InternalBlockCopy(inputBuffer, inputOffset, temp, m_depadBuffer.Length, inputCount);
352temp.Length,
392if (inputBuffer.Length < inputOffset + inputCount)
461if ((outputBuffer.Length - outputOffset) < (inputCount + padSize))
562Contract.Assert(m_blockSizeBytes <= m_lastBlockBuffer.Length * sizeof(int), "m_blockSizeBytes <= m_lastBlockBuffer.Length * sizeof(int)");
593if (inputBuffer.Length < inputOffset + inputCount)
600if ((outputBuffer.Length - outputOffset) < inputCount)
716if (padSize > outputBuffer.Length || padSize > InputBlockSize || padSize <= 0)
721outputBuffer1 = new byte[outputBuffer.Length - padSize];
722Buffer.InternalBlockCopy(outputBuffer, 0, outputBuffer1, 0, outputBuffer.Length - padSize);
729if (padSize > outputBuffer.Length || padSize > InputBlockSize || padSize <= 0)
735outputBuffer1 = new byte[outputBuffer.Length - padSize];
736Buffer.InternalBlockCopy(outputBuffer, 0, outputBuffer1, 0, outputBuffer.Length - padSize);
742if (padSize > outputBuffer.Length || padSize > InputBlockSize || padSize <= 0)
745outputBuffer1 = new byte[outputBuffer.Length - padSize];
746Buffer.InternalBlockCopy(outputBuffer, 0, outputBuffer1, 0, outputBuffer.Length - padSize);
751return outputBuffer1.Length;
854switch (m_blockSizeBits > rgbKey.Length * 8 ? m_blockSizeBits : rgbKey.Length * 8) {
system\security\cryptography\rsacryptoserviceprovider.cs (6)
407EncryptKey(_safeKeyHandle, rgb, rgb.Length, fOAEP, JitHelpers.GetObjectHandleOnStack(ref encryptedKey));
426if (rgb.Length > (KeySize / 8))
439DecryptKey(_safeKeyHandle, rgb, rgb.Length, fOAEP, JitHelpers.GetObjectHandleOnStack(ref decryptedKey));
523Contract.Assert(offset >= 0 && offset <= data.Length);
524Contract.Assert(count >= 0 && count <= data.Length);
544bytesRead = data.Read(buffer, 0, buffer.Length);
system\security\cryptography\utils.cs (54)
268if (error == Win32Native.ERROR_SUCCESS && (rawSecurityDescriptor == null || rawSecurityDescriptor.Length == 0))
315if (sd != null && sd.Length > 0)
646for (int i = 0; i < input.Length; i++) {
686Array.Clear(counter, 0, counter.Length);
698byte[] oddParityKey = new byte[key.Length];
699for (int index=0; index < key.Length; index++) {
811if ((data.Length + 2 + 2*cbHash) > cb)
823DB[DB.Length - data.Length - 1] = 1;
824Buffer.InternalBlockCopy(data, 0, DB, DB.Length-data.Length, data.Length);
831byte[] mask = mgf.GenerateMask(seed, DB.Length);
834for (int i=0; i < DB.Length; i++) {
842for (int i=0; i < seed.Length; i++) {
848Buffer.InternalBlockCopy(seed, 0, pad, 0, seed.Length);
849Buffer.InternalBlockCopy(DB, 0, pad, seed.Length, DB.Length);
875int zeros = cb - data.Length;
880Buffer.InternalBlockCopy(data, 0, seed, zeros, seed.Length - zeros);
882byte[] DB = new byte[data.Length - seed.Length + zeros];
883Buffer.InternalBlockCopy(data, seed.Length - zeros, DB, 0, DB.Length);
886byte[] mask = mgf.GenerateMask(DB, seed.Length);
890for (i=0; i < seed.Length; i++) {
895mask = mgf.GenerateMask(seed, DB.Length);
898for (i=0; i < DB.Length; i++) {
915for (; i<DB.Length; i++) {
922if (i == DB.Length)
928byte[] output = new byte[DB.Length - i];
929Buffer.InternalBlockCopy(DB, i, output, 0, output.Length);
954byte[] data = new byte[oid.Length + 8 + hash.Length];
956int tmp = data.Length - 2;
959tmp = oid.Length + 2;
961Buffer.InternalBlockCopy(oid, 0, data, 4, oid.Length);
962data[4 + oid.Length] = 0x05;
963data[4 + oid.Length + 1] = 0x00;
964data[4 + oid.Length + 2] = 0x04; // an octet string follows
965data[4 + oid.Length + 3] = (byte) hash.Length;
966Buffer.InternalBlockCopy(hash, 0, data, oid.Length + 8, hash.Length);
969int cb1 = cb - data.Length;
979Buffer.InternalBlockCopy(data, 0, pad, cb1, data.Length);
989while (i < lhs.Length && lhs[i] == 0) i++;
990while (j < rhs.Length && rhs[j] == 0) j++;
992int count = (lhs.Length - i);
993if ((rhs.Length - j) != count)
1106HashData(hHash, data, data.Length, ibStart, cbSize);
1149SignValue(hKey, keyNumber, calgKey, calgHash, hash, hash.Length, JitHelpers.GetObjectHandleOnStack(ref signature));
1161return VerifySign(hKey, calgKey, calgHash, hash, hash.Length, signature, signature.Length);
system\security\policy\hash.cs (10)
125byte[] hashClone = new byte[hashValue.Length];
126Array.Copy(hashValue, hashClone, hashClone.Length);
241byte[] returnHash = new byte[sha1.Length];
242Array.Copy(sha1, returnHash, returnHash.Length);
260byte[] returnHash = new byte[sha256.Length];
261Array.Copy(sha256, returnHash, returnHash.Length);
279byte[] returnHash = new byte[md5.Length];
280Array.Copy(md5, returnHash, returnHash.Length);
297byte[] returnHash = new byte[hashValue.Length];
298Array.Copy(hashValue, returnHash, returnHash.Length);
system\text\encoding.cs (8)
369return Convert(srcEncoding, dstEncoding, bytes, 0, bytes.Length);
958return GetByteCount(chars, 0, chars.Length);
969return GetByteCount(chars, 0, chars.Length);
1031return GetBytes(chars, 0, chars.Length);
1169return GetCharCount(bytes, 0, bytes.Length);
1225return GetChars(bytes, 0, bytes.Length);
1490return GetString(bytes, 0, bytes.Length);
2072bytes -= byteBuffer.Length; // Didn't use how many ever bytes we're falling back
system\text\stringbuilder.cs (27)
261BCLDebug.Correctness((uint)(m_ChunkOffset + m_ChunkChars.Length) >= m_ChunkOffset, "Integer Overflow");
270Contract.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length, "Out of range length");
287get { return m_ChunkChars.Length + m_ChunkOffset; }
353if ((uint)(chunkLength + chunkOffset) <= ret.Length && (uint)chunkLength <= (uint)sourceArray.Length)
428if ((uint)(chunkCount + curDestIndex) <= length && (uint)(chunkCount + chunkStartIndex) <= (uint)sourceArray.Length)
500Contract.Assert(newLen > chunk.m_ChunkChars.Length, "the new chunk should be larger than the one it is replacing");
567if (idx < m_ChunkChars.Length)
617if (charCount > value.Length - startIndex) {
644if (newCurrentIndex < chunkChars.Length) // Use strictly < to avoid issue if count == 0, newIndex == length
770if (destinationIndex > destination.Length - count) {
929if (m_ChunkLength < m_ChunkChars.Length)
1017if (null != value && value.Length > 0)
1021Append(valueChars, value.Length);
1122Insert(index, value, 0, value.Length);
1157if (startIndex > value.Length - charCount) {
1578else if (replacementsCount >= replacements.Length)
1580int[] newArray = new int[replacements.Length * 3 / 2 + 4]; // grow by 1.5X but more in the begining
1581Array.Copy(replacements, newArray, replacements.Length);
1674if (newIndex <= m_ChunkChars.Length)
1682int firstLength = m_ChunkChars.Length - m_ChunkLength;
1686m_ChunkLength = m_ChunkChars.Length;
1758Contract.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen");
1853if ((uint)destinationIndex <= (uint)destination.Length && (destinationIndex + count) <= destination.Length)
1869if ((uint)sourceIndex <= (uint)source.Length && (sourceIndex + count) <= source.Length)
2044if (!doneMoveFollowingChars && chunk.m_ChunkLength <= DefaultCapacity * 2 && chunk.m_ChunkChars.Length - chunk.m_ChunkLength >= count)
system\threading\asynclocal.cs (12)
355Contract.Assert(index < _keyValues.Length);
362for (int i = 0; i < _keyValues.Length; i++)
371var multi = new MultiElementAsyncLocalValueMap(_keyValues.Length);
372Array.Copy(_keyValues, 0, multi._keyValues, 0, _keyValues.Length);
376else if (_keyValues.Length == 4)
390var multi = new MultiElementAsyncLocalValueMap(_keyValues.Length - 1);
392if (i != _keyValues.Length - 1) Array.Copy(_keyValues, i + 1, multi._keyValues, i, _keyValues.Length - i - 1);
408if (_keyValues.Length < MaxMultiElements)
410var multi = new MultiElementAsyncLocalValueMap(_keyValues.Length + 1);
411Array.Copy(_keyValues, 0, multi._keyValues, 0, _keyValues.Length);
412multi._keyValues[_keyValues.Length] = new KeyValuePair<IAsyncLocal, object>(key, value);
Core\CSharp\MS\Internal\IO\Packaging\NetStream.cs (4)
162if (offset + count > buffer.Length)
359while (Read(buf, 0, buf.Length) > 0)
515_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this);
1077_responseStream.BeginRead(_readBuf, 0, _readBuf.Length, new AsyncCallback(ReadCallBack), this);
Core\CSharp\System\Windows\DataObject.cs (34)
1556for (int i=0; i<formats.Length; i++)
1578for (int i=0; i<ALLOWED_TYMEDS.Length; i++)
1692if (buffer != null && buffer.Length != 0)
1694hEnhancedMetafile = NativeMethods.SetEnhMetaFileBits((uint)buffer.Length, buffer);
2133if (files == null || files.Length < 1)
2154for (int i = 0; i < files.Length; i++)
2179Marshal.Copy(structData, 0, currentPtr, structData.Length);
2188for (int i = 0; i < files.Length; i++)
2253UnsafeNativeMethods.CopyMemoryW(ptr, chars, chars.Length * 2);
2260Marshal.Copy(new char[] { '\0' }, 0, (IntPtr)((ulong)ptr + (ulong)chars.Length * 2), 1);
2288Win32WideCharToMultiByte(str, str.Length, strBytes, strBytes.Length);
2626_formats = new FORMATETC[formats == null ? 0 : formats.Length];
2630for (int i = 0; i < formats.Length; i++)
2686for (int i = 0; i < celt && _current < _formats.Length; i++)
2707return (_current < _formats.Length) ? NativeMethods.S_OK : NativeMethods.S_FALSE;
2868for (int i=0; i<mappedFormats.Length; i++)
2881for (int formatetcIndex = 0; formatetcIndex < formatetc.Length; formatetcIndex++)
2984for (int i = 0; i < mappedFormats.Length; i++)
3038for (int i = 0; i < mappedFormats.Length; i++)
3398if (size > _serializedObjectID.Length)
3401for(int i = 0; i < _serializedObjectID.Length; i++)
3414index = _serializedObjectID.Length;
3422return new MemoryStream(bytes, index, bytes.Length - index);
3641for (int i=0; i<ALLOWED_TYMEDS.Length; i++)
3845for (int baseFormatIndex = 0; baseFormatIndex < baseVar.Length; baseFormatIndex++)
3853for (int dataStoreIndex = 0; dataStoreIndex < entries.Length; dataStoreIndex++)
3867for (int mappedFormatIndex = 0; mappedFormatIndex < cur.Length; mappedFormatIndex++)
3873dataStoreIndex < entries.Length;
3903dataStoreIndex < entries.Length;
4000for (int i = 0; i < mappedFormats.Length; i++)
4055for (int i = 0; i < entries.Length; i++)
4089for (int i = 0; i < formats.Length; i++)
4116newlist = (DataStoreEntry[])Array.CreateInstance(typeof(DataStoreEntry), datalist.Length + 1);
4138for (int i = 0; i < dataStoreEntries.Length; i++)
src\Framework\System\Windows\Controls\Grid.cs (66)
458Array.Clear(_definitionIndices, 0, _definitionIndices.Length);
466Array.Clear(_roundingErrors, 0, _roundingErrors.Length);
486Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0);
655bool canResolveStarsU = extData.CellGroup2 > PrivateCells.Length;
746Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0);
757for (int currentCell = 0; currentCell < PrivateCells.Length; ++currentCell)
845value = definitions[(columnIndex + 1) % definitions.Length].FinalOffset;
867value = definitions[(rowIndex + 1) % definitions.Length].FinalOffset;
963for (int i = PrivateCells.Length - 1; i >= 0; --i)
980cell.ColumnIndex = Math.Min(GetColumn(child), DefinitionsU.Length - 1);
983cell.RowIndex = Math.Min(GetRow(child), DefinitionsV.Length - 1);
988cell.ColumnSpan = Math.Min(GetColumnSpan(child), DefinitionsU.Length - cell.ColumnIndex);
992cell.RowSpan = Math.Min(GetRowSpan(child), DefinitionsV.Length - cell.RowIndex);
994Debug.Assert(0 <= cell.ColumnIndex && cell.ColumnIndex < DefinitionsU.Length);
995Debug.Assert(0 <= cell.RowIndex && cell.RowIndex < DefinitionsV.Length);
1093Debug.Assert(ExtData.DefinitionsU != null && ExtData.DefinitionsU.Length > 0);
1140Debug.Assert(ExtData.DefinitionsV != null && ExtData.DefinitionsV.Length > 0);
1155for (int i = 0; i < definitions.Length; ++i)
1199double[] minSizes = isRows ? new double[DefinitionsV.Length] : new double[DefinitionsU.Length];
1201for (int j=0; j<minSizes.Length; j++)
1220} while (i < PrivateCells.Length);
1227for (int i=0; i<minSizes.Length; i++)
1272if (cellsHead >= PrivateCells.Length)
1325} while (i < PrivateCells.Length);
1454Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length);
1481Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length);
1509Debug.Assert(1 < count && 0 <= start && (start + count) <= definitions.Length);
1711for (int i = 0; i < definitions.Length; ++i)
1807int defCount = definitions.Length;
2105for (int i = 0; i < definitions.Length; ++i)
2141int nonStarIndex = definitions.Length; // traverses from the last entry down
2157for (int i = 0; i < definitions.Length; ++i)
2287Array.Sort(definitionIndices, 0, definitions.Length, distributionOrderIndexComparer);
2290for (int i = 0; i < definitions.Length; ++i)
2293double final = definitions[definitionIndex].SizeCache + (sizeToDistribute / (definitions.Length - i));
2318for (int i = 0; i < definitions.Length; ++i)
2326Array.Sort(definitionIndices, 0, definitions.Length, roundingErrorIndexComparer);
2332int i = definitions.Length - 1;
2349while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length)
2366for (int i = 0; i < definitions.Length; ++i)
2368definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache;
2389int defCount = definitions.Length;
2725for (int i = 0; i < definitions.Length; ++i)
2779for (int i = 0; i < definitions.Length; ++i)
2786Array.Sort(definitionIndices, 0, definitions.Length, roundingErrorIndexComparer);
2792int i = definitions.Length - 1;
2809while ((adjustedSize < finalSize && !_AreClose(adjustedSize, finalSize)) && i < definitions.Length)
2827for (int i = 0; i < definitions.Length; ++i)
2829definitions[(i + 1) % definitions.Length].FinalOffset = definitions[i].FinalOffset + definitions[i].SizeCache;
2936Array.Clear(extData.TempDefinitions, 0, Math.Max(DefinitionsU.Length, DefinitionsV.Length));
3141int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length) * 2;
3144|| extData.TempDefinitions.Length < requiredLength )
3156|| extData.TempDefinitions.Length < requiredLength )
3174int requiredLength = Math.Max(Math.Max(DefinitionsU.Length, DefinitionsV.Length), 1) * 2;
3176if (_definitionIndices == null || _definitionIndices.Length < requiredLength)
3192int requiredLength = Math.Max(DefinitionsU.Length, DefinitionsV.Length);
3198else if (_roundingErrors == null || _roundingErrors.Length < requiredLength)
4232for (int i = 1; i < grid.DefinitionsU.Length; ++i)
4240for (int i = 1; i < grid.DefinitionsV.Length; ++i)
src\Framework\System\Windows\Documents\TextSchema.cs (22)
58_inheritableTextElementProperties = new DependencyProperty[textElementPropertyList.Length + Typography.TypographyPropertiesList.Length];
59Array.Copy(textElementPropertyList, 0, _inheritableTextElementProperties, 0, textElementPropertyList.Length);
60Array.Copy(Typography.TypographyPropertiesList, 0, _inheritableTextElementProperties, textElementPropertyList.Length, Typography.TypographyPropertiesList.Length);
70_inheritableBlockProperties = new DependencyProperty[blockPropertyList.Length + _inheritableTextElementProperties.Length];
71Array.Copy(blockPropertyList, 0, _inheritableBlockProperties, 0, blockPropertyList.Length);
72Array.Copy(_inheritableTextElementProperties, 0, _inheritableBlockProperties, blockPropertyList.Length, _inheritableTextElementProperties.Length);
81_inheritableTableCellProperties = new DependencyProperty[tableCellPropertyList.Length + _inheritableTextElementProperties.Length];
82Array.Copy(tableCellPropertyList, _inheritableTableCellProperties, tableCellPropertyList.Length);
83Array.Copy(_inheritableTextElementProperties, 0, _inheritableTableCellProperties, tableCellPropertyList.Length, _inheritableTextElementProperties.Length);
664for (int i = 0; i < _inheritableBlockProperties.Length; i++)
673for (int i = 0; i < _paragraphProperties.Length; i++)
689for (int i = 0; i < _inheritableTextElementProperties.Length; i++)
698for (int i = 0; i < _inlineProperties.Length; i++)
713for (int i = 0; i < _nonFormattingCharacterProperties.Length; i++)
744for (i = 0; i < _structuralCharacterProperties.Length; i++)
750return (i < _structuralCharacterProperties.Length);
compmod\system\collections\generic\queue.cs (23)
115Array.Clear(_array, _head, _array.Length - _head);
135if (arrayIndex < 0 || arrayIndex > array.Length) {
139int arrayLen = array.Length;
147int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy;
151Array.Copy(_array, 0, array, arrayIndex+_array.Length - _head, numToCopy);
169int arrayLen = array.Length;
182int firstPart = (_array.Length - _head < numToCopy) ? _array.Length - _head : numToCopy;
187Array.Copy(_array, 0, array, index+_array.Length - _head, numToCopy);
199if (_size == _array.Length) {
200int newcapacity = (int)((long)_array.Length * (long)_GrowFactor / 100);
201if (newcapacity < _array.Length + _MinimumGrow) {
202newcapacity = _array.Length + _MinimumGrow;
208_tail = (_tail + 1) % _array.Length;
243_head = (_head + 1) % _array.Length;
278index = (index + 1) % _array.Length;
286return _array[(_head + i) % _array.Length];
303Array.Copy(_array, _head, arr, 0, _array.Length - _head);
304Array.Copy(_array, 0, arr, _array.Length - _head, _tail);
319Array.Copy(_array, _head, newarray, 0, _array.Length - _head);
320Array.Copy(_array, 0, newarray, _array.Length - _head, _tail);
331int threshold = (int)(((double)_array.Length) * 0.9);
compmod\system\componentmodel\ReflectTypeDescriptionProvider.cs (40)
204argTypes = new Type[args.Length];
205for(int idx = 0; idx < args.Length; idx++) {
487if (extenders.Length == 0)
513for (int idx = 0; idx < extenders.Length; idx++)
519propertyList = new ArrayList(propertyArray.Length * extenders.Length);
522for (int propIdx = 0; propIdx < propertyArray.Length; propIdx++)
638for (curIdx = 0; curIdx < currentExtenders.Length; curIdx++)
646if (!newExtenders && (idx >= existingExtenders.Length || currentExtenders[curIdx] != existingExtenders[idx++]))
663if (!newExtenders && (idx >= existingExtenders.Length || prov != existingExtenders[idx++]))
671if (existingExtenders != null && extenderCount != existingExtenders.Length)
679if (currentExtenders == null || extenderCount != currentExtenders.Length)
688while(curIdx < currentExtenders.Length)
946attrs = new Attribute[typeAttrs.Length];
987attrs = new Attribute[memberAttrs.Length];
1035events = new EventDescriptor[eventInfos.Length];
1038for (int idx = 0; idx < eventInfos.Length; idx++)
1059if (eventCount != events.Length)
1177properties = new PropertyDescriptor[extendedProperties.Length];
1178for (int idx = 0; idx < extendedProperties.Length; idx++)
1240properties = new PropertyDescriptor[propertyInfos.Length];
1244for (int idx = 0; idx < propertyInfos.Length; idx++)
1250if (propertyInfo.GetIndexParameters().Length > 0) {
1276if (propertyCount != properties.Length)
1516Attribute[] temp = new Attribute[attrArray.Length + baseArray.Length];
1517Array.Copy(attrArray, 0, temp, 0, attrArray.Length);
1518Array.Copy(baseArray, 0, temp, attrArray.Length, baseArray.Length);
1526int ifaceStartIdx = attrArray.Length;
1528TypeDescriptor.Trace("Attributes : Walking {0} interfaces", interfaces.Length);
1529for(int idx = 0; idx < interfaces.Length; idx++)
1540Attribute[] temp = new Attribute[attrArray.Length + ifaceAttrs.Count];
1541Array.Copy(attrArray, 0, temp, 0, attrArray.Length);
1542ifaceAttrs.CopyTo(temp, attrArray.Length);
1550OrderedDictionary attrDictionary = new OrderedDictionary(attrArray.Length);
1552for (int idx = 0; idx < attrArray.Length; idx++)
1556for (int ifaceSkipIdx = 0; ifaceSkipIdx < _skipInterfaceAttributeList.Length; ifaceSkipIdx++)
1828if (_editorTypes == null || _editorTypes.Length == _editorCount)
1830int newLength = (_editorTypes == null ? 4 : _editorTypes.Length * 2);
net\System\IriHelper.cs (13)
170Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
172Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
174Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
181Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
235char[] unescapedChars = new char[bytes.Length];
253Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
263Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
280Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
282Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
293Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
307Debug.Assert(dest.Length > destOffset, "Buffer overrun detected");
322newBufferLength = dest.Length + bufferCapacityIncrease;
371Debug.Assert(destOffset <= dest.Length, "Buffer overrun detected");
net\System\Net\_CommandStream.cs (9)
215while (m_Index < m_Commands.Length)
236BeginWrite(sendBuffer, 0, sendBuffer.Length, m_WriteCallbackDelegate, this);
238Write(sendBuffer, 0, sendBuffer.Length);
304if (index < 0 || index >= commands.Length ||
314if (m_Index >= m_Commands.Length)
529BeginRead(state.Buffer, 0, state.Buffer.Length, m_ReadCallbackDelegate, state);
532bytesRead = Read(state.Buffer, 0, state.Buffer.Length);
633BeginRead(state.Buffer, 0, state.Buffer.Length, m_ReadCallbackDelegate, state);
636bytesRead = Read(state.Buffer, 0, state.Buffer.Length);
net\System\Net\_ConnectStream.cs (20)
645m_Connection.Write(NclConstants.ChunkTerminator, 0, NclConstants.ChunkTerminator.Length);
651BufferOffsetSize[] buffers = new BufferOffsetSize[dataBuffers.Length + 3];
652buffers[0] = new BufferOffsetSize(chunkHeaderBuffer, chunkHeaderOffset, chunkHeaderBuffer.Length - chunkHeaderOffset, false);
657buffers[++index] = new BufferOffsetSize(NclConstants.CRLF, 0, NclConstants.CRLF.Length, false);
658buffers[++index] = new BufferOffsetSize(NclConstants.ChunkTerminator, 0, NclConstants.ChunkTerminator.Length, false);
815if (offset<0 || offset>buffer.Length) {
818if (size<0 || size>buffer.Length-offset) {
876if (offset<0 || offset>buffer.Length) {
879if (size<0 || size>buffer.Length-offset) {
980buffers[0] = new BufferOffsetSize(NclConstants.ChunkTerminator, 0, NclConstants.ChunkTerminator.Length, false);
984buffers[0] = new BufferOffsetSize(chunkHeaderBuffer, chunkHeaderOffset, chunkHeaderBuffer.Length - chunkHeaderOffset, false);
986buffers[2] = new BufferOffsetSize(NclConstants.CRLF, 0, NclConstants.CRLF.Length, false);
1380if (offset<0 || offset>buffer.Length) {
1383if (size<0 || size>buffer.Length-offset) {
1642if (offset<0 || offset>buffer.Length) {
1645if (size<0 || size>buffer.Length-offset) {
2445m_Connection.Write(NclConstants.ChunkTerminator, 0, NclConstants.ChunkTerminator.Length);
2449m_Connection.BeginWrite(NclConstants.ChunkTerminator, 0, NclConstants.ChunkTerminator.Length, new AsyncCallback(ResumeClose_Part2_Wrapper), userResult);
2620m_Connection.Write(NclConstants.ChunkTerminator, 0, NclConstants.ChunkTerminator.Length);
2921bytesRead = ReadWithoutValidation(s_DrainingBuffer, 0, s_DrainingBuffer.Length, false);
net\System\Net\_SSPIWrapper.cs (16)
63for (int i = 0; i < supportedSecurityPackages.Length; i++) {
253if (Logging.On) Logging.PrintInfo(Logging.Web, SR.GetString(SR.net_log_sspi_security_context_input_buffers, "InitializeSecurityContext", (inputBuffers == null ? 0 : inputBuffers.Length), outputBuffer.size, (SecurityStatus) errorCode));
284if (Logging.On) Logging.PrintInfo(Logging.Web, SR.GetString(SR.net_log_sspi_security_context_input_buffers, "AcceptSecurityContext", (inputBuffers == null ? 0 : inputBuffers.Length), outputBuffer.size, (SecurityStatus) errorCode));
381SecurityBufferDescriptor sdcInOut = new SecurityBufferDescriptor(input.Length);
382SecurityBufferStruct[] unmanagedBuffer = new SecurityBufferStruct[input.Length];
387GCHandle[] pinnedBuffers = new GCHandle[input.Length];
388byte[][] buffers = new byte[input.Length][];
391for (int i = 0; i < input.Length; i++)
396if (iBuffer.token == null || iBuffer.token.Length == 0)
432for (int i = 0; i < input.Length; i++)
447for (j = 0; j < input.Length; j++)
456(byte*) unmanagedBuffer[i].token + iBuffer.size <= bufferAddress + buffers[j].Length)
464if (j >= input.Length)
474GlobalLog.Assert(iBuffer.offset >= 0 && iBuffer.offset <= (iBuffer.token == null ? 0 : iBuffer.token.Length), "SSPIWrapper::EncryptDecryptHelper|'offset' out of range. [{0}]", iBuffer.offset);
475GlobalLog.Assert(iBuffer.size >= 0 && iBuffer.size <= (iBuffer.token == null ? 0 : iBuffer.token.Length - iBuffer.offset), "SSPIWrapper::EncryptDecryptHelper|'size' out of range. [{0}]", iBuffer.size);
489for (int i = 0; i < pinnedBuffers.Length; ++i) {
net\System\Net\_StreamFramer.cs (22)
150while (offset < buffer.Length) {
151bytesRead = Transport.Read(buffer, offset, buffer.Length - offset);
176while (offset < buffer.Length) {
177bytesRead = Transport.Read(buffer, offset, buffer.Length - offset);
196m_ReadHeaderBuffer.Length);
198IAsyncResult result = Transport.BeginRead(m_ReadHeaderBuffer, 0, m_ReadHeaderBuffer.Length,
295workerResult.End = frame.Length;
356m_WriteHeader.PayloadSize = message.Length;
359if (m_NetworkStream != null && message.Length != 0) {
361buffers[0] = new BufferOffsetSize(m_WriteHeaderBuffer, 0, m_WriteHeaderBuffer.Length, false);
362buffers[1] = new BufferOffsetSize(message, 0, message.Length, false);
366Transport.Write(m_WriteHeaderBuffer, 0, m_WriteHeaderBuffer.Length);
367if (message.Length==0) {
370Transport.Write(message, 0, message.Length);
383m_WriteHeader.PayloadSize = message.Length;
386if (m_NetworkStream != null && message.Length != 0) {
388buffers[0] = new BufferOffsetSize(m_WriteHeaderBuffer, 0, m_WriteHeaderBuffer.Length, false);
389buffers[1] = new BufferOffsetSize(message, 0, message.Length, false);
393if (message.Length == 0) {
394return Transport.BeginWrite(m_WriteHeaderBuffer, 0, m_WriteHeaderBuffer.Length,
400message, 0, message.Length);
402IAsyncResult result = Transport.BeginWrite(m_WriteHeaderBuffer, 0, m_WriteHeaderBuffer.Length,
net\System\Net\HttpListenerRequest.cs (4)
143Marshal.Copy((IntPtr)pClientCertInfo->pCertEncoded, certEncoded, 0, certEncoded.Length);
958Marshal.Copy((IntPtr)pClientCertInfo->pCertEncoded, certEncoded, 0, certEncoded.Length);
1154Marshal.Copy((IntPtr)(pThisResultData->identifierData), retVal, 0, retVal.Length);
1187Marshal.Copy((IntPtr)(&pThisResultData->identifierData->hashAlgorithm), retVal, 0, retVal.Length);
net\System\Net\HttpListenerResponse.cs (14)
213for (int i = 0; i < s_NoResponseBody.Length; i++) {
360ContentLength64 = responseEntity.Length;
365m_ResponseStream.Write(responseEntity, 0, responseEntity.Length);
379m_ResponseStream.BeginWrite(responseEntity, 0, responseEntity.Length, new AsyncCallback(NonBlockingCloseCallback), null);
526m_NativeResponse.ReasonLength = (ushort)statusDescriptionBytes.Length;
527WebHeaderCollection.HeaderEncoding.GetBytes(StatusDescription, 0, statusDescriptionBytes.Length, statusDescriptionBytes, 0);
781numUnknownHeaders += headerValues.Length;
816for(int headerValueIndex = 0; headerValueIndex < headerValues.Length; headerValueIndex++)
820unknownHeaders[headers.UnknownHeaderCount].NameLength = (ushort)bytes.Length;
821WebHeaderCollection.HeaderEncoding.GetBytes(headerName, 0, bytes.Length, bytes, 0);
829unknownHeaders[headers.UnknownHeaderCount].RawValueLength = (ushort)bytes.Length;
830WebHeaderCollection.HeaderEncoding.GetBytes(headerValue, 0, bytes.Length, bytes, 0);
843pKnownHeaders[lookup].RawValueLength = (ushort)bytes.Length;
844WebHeaderCollection.HeaderEncoding.GetBytes(headerValue, 0, bytes.Length, bytes, 0);
net\System\Net\NetworkInformation\ping.cs (10)
311if (buffer.Length > MaxBufferSize ) {
407if (buffer.Length > MaxBufferSize ) {
443if (buffer.Length > MaxBufferSize ) {
629sendSize = buffer.Length;
675error = (int)UnsafeNetInfoNativeMethods.IcmpSendEcho2 (handlePingV4, pingEvent.SafeWaitHandle, IntPtr.Zero, IntPtr.Zero, (uint)address.m_Address, requestBuffer, (ushort)buffer.Length, ref ipOptions, replyBuffer, MaxUdpPacket, (uint)timeout);
678error = (int)UnsafeNetInfoNativeMethods.IcmpSendEcho2 (handlePingV4, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, (uint)address.m_Address, requestBuffer, (ushort)buffer.Length, ref ipOptions, replyBuffer, MaxUdpPacket, (uint)timeout);
686error = (int)UnsafeNetInfoNativeMethods.Icmp6SendEcho2 (handlePingV6, pingEvent.SafeWaitHandle, IntPtr.Zero, IntPtr.Zero, sourceAddr, remoteAddr.m_Buffer, requestBuffer, (ushort)buffer.Length, ref ipOptions, replyBuffer, MaxUdpPacket, (uint)timeout);
689error = (int)UnsafeNetInfoNativeMethods.Icmp6SendEcho2 (handlePingV6, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, sourceAddr, remoteAddr.m_Buffer, requestBuffer, (ushort)buffer.Length, ref ipOptions, replyBuffer, MaxUdpPacket, (uint)timeout);
755requestBuffer = SafeLocalFree.LocalAlloc(buffer.Length);
757for (int i = 0; i < buffer.Length; ++i)
net\System\Net\SecureProtocols\_SslState.cs (7)
665StartSendBlob(buffer, (buffer == null? 0: buffer.Length), asyncRequest);
765_Framing = DetectFraming(message.Payload, message.Payload.Length);
840ProcessReceivedBlob(buffer, buffer.Length, asyncRequest);
1336return InnerStream.BeginWrite(message.Payload, 0, message.Payload.Length, asyncCallback, asyncState);
1441if (buffer == null || buffer.Length < size) {
1554GlobalLog.Assert((bytes != null && bytes.Length > 0), "SslState::DetectFraming()|Header buffer is not allocated will boom shortly.");
1697ProcessReceivedBlob(asyncRequest.Buffer, asyncRequest.Buffer == null? 0: asyncRequest.Buffer.Length, asyncRequest);
net\System\Net\Sockets\_AcceptOverlappedAsyncResult.cs (3)
70m_Buffer.Length - (m_AddressBufferLength * 2),
143Logging.Dump(Logging.Sockets, m_ListenSocket, "PostCompletion", pinnedBuffer, (int)Math.Min(size, (long)m_Buffer.Length));
146Logging.Dump(Logging.Sockets, m_ListenSocket, "PostCompletion", pinnedBuffer, (int)m_Buffer.Length);
net\System\Net\Sockets\Socket.cs (82)
177if(socketInformation.ProtocolInformation == null || socketInformation.ProtocolInformation.Length < protocolInformationSize){
1094if (addresses.Length == 0) {
1275return Send(buffer, 0, buffer!=null ? buffer.Length : 0, socketFlags);
1281return Send(buffer, 0, buffer!=null ? buffer.Length : 0, SocketFlags.None);
1366for (int i = 0; i < objectsToPin.Length; ++i)
1530if (offset<0 || offset>buffer.Length) {
1533if (size<0 || size>buffer.Length-offset) {
1545if (buffer.Length == 0)
1612if (offset<0 || offset>buffer.Length) {
1615if (size<0 || size>buffer.Length-offset) {
1630if (buffer.Length == 0)
1704return SendTo(buffer, 0, buffer!=null ? buffer.Length : 0, socketFlags, remoteEP);
1710return SendTo(buffer, 0, buffer!=null ? buffer.Length : 0, SocketFlags.None, remoteEP);
1724return Receive(buffer, 0, buffer!=null ? buffer.Length : 0, socketFlags);
1730return Receive(buffer, 0, buffer!=null ? buffer.Length : 0, SocketFlags.None);
1760if (offset<0 || offset>buffer.Length) {
1763if (size<0 || size>buffer.Length-offset) {
1775if (buffer.Length == 0)
1901for (int i = 0; i < objectsToPin.Length; ++i)
1970if (offset<0 || offset>buffer.Length) {
1973if (size<0 || size>buffer.Length-offset) {
2077if (offset<0 || offset>buffer.Length) {
2080if (size<0 || size>buffer.Length-offset) {
2101if (buffer.Length == 0)
2171return ReceiveFrom(buffer, 0, buffer!=null ? buffer.Length : 0, socketFlags, ref remoteEP);
2177return ReceiveFrom(buffer, 0, buffer!=null ? buffer.Length : 0, SocketFlags.None, ref remoteEP);
2201optionInValue!=null ? optionInValue.Length : 0,
2203optionOutValue!=null ? optionOutValue.Length : 0,
2328optionValue != null ? optionValue.Length : 0);
2467int optionLength = optionValue!=null ? optionValue.Length : 0;
3154if (addresses.Length == 0) {
3451if (offset < 0 || offset > buffer.Length)
3455if (size < 0 || size > buffer.Length - offset)
3760asyncResult.m_WSABuffers.Length,
3982if (offset<0 || offset>buffer.Length) {
3985if (size<0 || size>buffer.Length-offset) {
4206if (offset<0 || offset>buffer.Length) {
4209if (size<0 || size>buffer.Length-offset) {
4388asyncResult.m_WSABuffers.Length,
4548if (offset<0 || offset>buffer.Length) {
4551if (size<0 || size>buffer.Length-offset) {
4787if (offset<0 || offset>buffer.Length) {
4790if (size<0 || size>buffer.Length-offset) {
6988GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::MultipleSend() buffers.Length:" + buffers.Length.ToString());
6990WSABuffer[] WSABuffers = new WSABuffer[buffers.Length];
6996objectsToPin = new GCHandle[buffers.Length];
6997for (int i = 0; i < buffers.Length; ++i)
7008WSABuffers.Length,
7014GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::MultipleSend() UnsafeNclNativeMethods.OSSOCK.WSASend returns:" + errorCode.ToString() + " size:" + buffers.Length.ToString());
7019for (int i = 0; i < objectsToPin.Length; ++i)
7083if (addresses != null && index > 0 && index < addresses.Length) {
7178if (++context.index >= context.addresses.Length)
7222GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::DoBeginMultipleSend() buffers.Length:" + buffers.Length.ToString());
7238asyncResult.m_WSABuffers.Length,
7247GlobalLog.Print("Socket#" + ValidationHelper.HashString(this) + "::BeginMultipleSend() UnsafeNclNativeMethods.OSSOCK.WSASend returns:" + errorCode.ToString() + " size:" + buffers.Length.ToString() + " returning AsyncResult:" + ValidationHelper.HashString(asyncResult));
8007e.m_WSABufferArray.Length,
8097e.m_WSABufferArray.Length,
8249e.m_WSABufferArray.Length,
8309if (e.m_SendPacketsDescriptor.Length > 0) {
8314e.m_SendPacketsDescriptor.Length,
8401e.m_WSABufferArray.Length,
8507this(buffer, 0, (buffer != null ? buffer.Length : 0), false) { }
8516if (offset < 0 || offset > buffer.Length) {
8519if (count < 0 || count > (buffer.Length - offset)) {
8892if (offset < 0 || offset > buffer.Length) {
8895if (count < 0 || count > (buffer.Length - offset)) {
9082if(m_AcceptBuffer == null || m_AcceptBuffer.Length < m_AcceptAddressBufferCount) {
9195if(ipv4 && (m_ControlBuffer == null || m_ControlBuffer.Length != s_ControlDataSize)) {
9200} else if(ipv6 && (m_ControlBuffer == null || m_ControlBuffer.Length != s_ControlDataIPv6Size)) {
9235pMessage->count = (uint)m_WSABufferArray.Length;
9239pMessage->controlBuffer.Length = m_ControlBuffer.Length;
9569if (m_ObjectsToPin == null || (m_ObjectsToPin.Length != tempList.Length)) {
9570m_ObjectsToPin = new object[tempList.Length];
9575if (m_WSABufferArray == null || m_WSABufferArray.Length != tempList.Length) {
9580for (int i = 0; i < (tempList.Length); i++) {
9590m_WSABufferArray = new WSABuffer[tempList.Length];
9600for(int i = 0; i < tempList.Length; i++) {
9623if(m_ObjectsToPin == null || (m_ObjectsToPin.Length != m_SendPacketsElementsBufferCount + 1)) {
9951if(m_ControlBuffer.Length == s_ControlDataSize) {
9959else if(m_ControlBuffer.Length == s_ControlDataIPv6Size) {
net\System\Net\webclient.cs (25)
568m_ContentLength = data.Length;
643m_ContentLength = fs.Length + formHeaderBytes.Length + boundaryBytes.Length;
763m_ContentLength = buffer.Length;
1182for (int i=0; i<bufferArray.Length; i++)
1393Progress.BytesSent += bytesToWrite.Length;
1394WriteStream.BeginWrite(bytesToWrite, 0, bytesToWrite.Length, new AsyncCallback(UploadBitsWriteCallback), this);
1397WriteStream.Write(bytesToWrite, 0, bytesToWrite.Length);
1413bytesRead = ReadStream.Read(InnerBuffer, 0, (int)InnerBuffer.Length);
1423bytesToWriteLength = Footer.Length;
1436if (m_BufferWritePosition >= InnerBuffer.Length) { // This is the last chunk
1437bytesToWriteLength = InnerBuffer.Length - bufferOffset;
1442bytesToWriteLength = InnerBuffer.Length;
1559if (prefix == null || byteArray == null || prefix.Length > byteArray.Length)
1561for (int i = 0; i < prefix.Length; i++)
1626for (int i = 0; i < encodings.Length; i++)
1632bomLengthInData = preamble.Length;
1647bomLengthInData = preamble.Length;
1654return enc.GetString(data, bomLengthInData, data.Length - bomLengthInData);
1687return UrlEncodeBytesToBytesInternal(bytes, 0, bytes.Length, false);
2214m_ContentLength = requestData.Length;
2305m_ContentLength = data.Length;
2313chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, data.Length);
2512chunkSize = (int)Math.Min((long)DefaultCopyBufferLength, buffer.Length);
regex\system\text\regularexpressions\RegexRunner.cs (19)
187runtrackpos = runtrack.Length;
188runstackpos = runstack.Length;
189runcrawlpos = runcrawl.Length;
313runtrackpos = runtrack.Length;
314runstackpos = runstack.Length;
315runcrawlpos = runcrawl.Length;
399newtrack = new int [runtrack.Length * 2];
401System.Array.Copy(runtrack, 0, newtrack, runtrack.Length, runtrack.Length);
402runtrackpos += runtrack.Length;
413newstack = new int [runstack.Length * 2];
415System.Array.Copy(runstack, 0, newstack, runstack.Length, runstack.Length);
416runstackpos += runstack.Length;
426newcrawl = new int [runcrawl.Length * 2];
428System.Array.Copy(runcrawl, 0, newcrawl, runcrawl.Length, runcrawl.Length);
429runcrawlpos += runcrawl.Length;
454return runcrawl.Length - runcrawlpos;
security\system\security\cryptography\x509\x509certificate2.cs (12)
173Marshal.Copy(decodedKeyValue.DangerousGetHandle(), decodedData, 0, decodedData.Length);
232Marshal.Copy(pDssParameters.p.pbData, p, 0, p.Length);
241Marshal.Copy(pDssParameters.q.pbData, q, 0, q.Length);
252Marshal.Copy(pDssParameters.g.pbData, g, 0, g.Length);
263Marshal.Copy(pDssPubKey.pbData, y, 0, y.Length);
846if (array1 == null || array2 == null || array1.Length != array2.Length || array1.Length <= s_publicKeyOffset)
848for (int index = s_publicKeyOffset; index < array1.Length; index++) {
976for (int i = 0; i < pAltName.Length; i++) {
980Marshal.Copy(extension.Value.pbData, rawData, 0, rawData.Length);
1154if (rawData == null || rawData.Length == 0)
security\system\security\cryptography\x509\x509certificate2collection.cs (16)
82for (; i<certificates.Length; i++) {
142for (; i<certificates.Length; i++) {
310Marshal.Copy(pCertContext.pbCertEncoded, pbBlob, 0, pbBlob.Length);
331Marshal.Copy(pbEncoded.DangerousGetHandle(), pbBlob, 0, pbBlob.Length);
351Marshal.Copy(DataBlob.pbData, pbBlob, 0, pbBlob.Length);
381Marshal.Copy(DataBlob.pbData, pbBlob, 0, pbBlob.Length);
425HashBlob.cbData = (uint) hex.Length;
561for (uint index = 0; index < KeyUsages.Length; index++) {
745Marshal.Copy(pCertInfo.SerialNumber.pbData, hex, 0, hex.Length);
749if (serialNumber.Length != size)
752for (int index = 0; index < serialNumber.Length; index++) {
841Marshal.Copy(extension.Value.pbData, rawData, 0, rawData.Length);
861Marshal.Copy(extension.Value.pbData, rawData, 0, rawData.Length);
944Marshal.Copy(extension.Value.pbData, rawData, 0, rawData.Length);
1041if (subjectKeyIdentifier.Length != cbData)
1045Marshal.Copy(ptr.DangerousGetHandle(), hex, 0, hex.Length);
security\system\security\cryptography\x509\x509extension.cs (19)
33Marshal.Copy(extension.Value.pbData, rawData, 0, rawData.Length);
457if (subjectKeyIdentifier.Length == 0)
464pSubjectKeyIdentifier.cbData = (uint) subjectKeyIdentifier.Length;
486X509Utils.AlignedLength((uint) encodedParameters.Length) +
487encodedKeyValue.Length);
493IntPtr pbPublicKey = new IntPtr((long) pbParameters + X509Utils.AlignedLength((uint) encodedParameters.Length));
498Marshal.Copy(szObjId, 0, pszObjId, szObjId.Length);
499if (encodedParameters.Length > 0) {
500pPublicKeyInfo->Algorithm.Parameters.cbData = (uint) encodedParameters.Length;
502Marshal.Copy(encodedParameters, 0, pbParameters, encodedParameters.Length);
504pPublicKeyInfo->PublicKey.cbData = (uint) encodedKeyValue.Length;
506Marshal.Copy(encodedKeyValue, 0, pbPublicKey, encodedKeyValue.Length);
525uint cbData = (uint)buffer.Length;
571Array.Copy(buffer, buffer.Length - 8, identifier, 0, identifier.Length);
577if (buffer.Length > (int)cbData) {
579Array.Copy(buffer, 0, identifier, 0, identifier.Length);
676if (index < 0 || index >= array.Length)
678if (index + this.Count > array.Length)
security\system\security\cryptography\x509\x509utils.cs (10)
178return EncodeHexString(sArray, 0, (uint) sArray.Length);
259int index = hex.Length;
271SafeLocalAllocHandle pb = CAPI.LocalAlloc(CAPI.LMEM_FIXED, new IntPtr(managed.Length));
272Marshal.Copy(managed, 0, pb.DangerousGetHandle(), managed.Length);
296Marshal.Copy(unmanaged, array, 0, array.Length);
318SafeLocalAllocHandle pb = CAPI.LocalAlloc(CAPI.LMEM_FIXED, new IntPtr(arr.Length));
319Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length);
329SafeLocalAllocHandle pb = CAPI.LocalAlloc(CAPI.LMEM_FIXED, new IntPtr(arr.Length));
330Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length);
513Marshal.Copy(ansiOid, 0, pOid, ansiOid.Length);
services\monitoring\system\diagnosticts\EventLogInternal.cs (22)
894while (idx < entries.Length) {
897oldestEntry+idx, buf, buf.Length, out bytesRead, out minBytesNeeded);
916else if (minBytesNeeded > buf.Length) {
917Debug.WriteLineIf(CompModSwitches.EventLog.TraceVerbose, "Increasing buffer size from " + buf.Length.ToString(CultureInfo.InvariantCulture) + " to " + minBytesNeeded.ToString(CultureInfo.InvariantCulture) + " bytes");
921oldestEntry+idx, buf, buf.Length, out bytesRead, out minBytesNeeded);
936while (sum < bytesRead && idx < entries.Length) {
942if (idx != entries.Length) {
1090cache, cache.Length, out bytesRead, out minBytesNeeded);
1109if (minBytesNeeded > cache.Length) {
1114cache, cache.Length, out bytesRead, out minBytesNeeded);
1444Debug.WriteLineIf(CompModSwitches.EventLog.TraceVerbose, "EventLog::StaticCompletionCallback: notifying " + interestedComponents.Length + " components.");
1446for (int i = 0; i < interestedComponents.Length; i++) {
1665strings = new string[values.Length];
1666for (int i=0; i<values.Length; i++) {
1685if (strings.Length >= 256)
1688for (int i = 0; i < strings.Length; i++) {
1707IntPtr[] stringRoots = new IntPtr[strings.Length];
1708GCHandle[] stringHandles = new GCHandle[strings.Length];
1711for (int strIndex = 0; strIndex < strings.Length; strIndex++) {
1719sid, (short) strings.Length, rawData.Length, new HandleRef(this, stringsRootHandle.AddrOfPinnedObject()), rawData);
1727for (int i = 0; i < strings.Length; i++) {
services\monitoring\system\diagnosticts\ProcessManager.cs (21)
153if (processInfos.Length == 1) {
230for (int i = 0; i < processIds.Length; i++)
340int[] ids = new int[infos.Length];
341for (int i = 0; i < infos.Length; i++) {
523int[] ids = new int[infos.Length];
524for (int i = 0; i < infos.Length; i++)
535if (!NativeMethods.EnumProcesses(processIds, processIds.Length * 4, out size))
537if (size == processIds.Length * 4) {
538processIds = new int[processIds.Length * 2];
544Array.Copy(processIds, ids, ids.Length);
558if( moduleInfos.Length == 0) {
569Contract.Ensures(Contract.Result<ModuleInfo[]>().Length >= 1);
588enumResult = NativeMethods.EnumProcessModules(processHandle, moduleHandlesArrayHandle.AddrOfPinnedObject(), moduleHandles.Length * IntPtr.Size, ref moduleCount);
640enumResult = NativeMethods.EnumProcessModules(processHandle, moduleHandlesArrayHandle.AddrOfPinnedObject(), moduleHandles.Length * IntPtr.Size, ref moduleCount);
657if (moduleCount <= moduleHandles.Length) break;
658moduleHandles = new IntPtr[moduleHandles.Length * 2];
771while (processInfos.Length == 0 && retryCount != 0) {
783if (processInfos.Length == 0)
891for (int i = 0; i < counters.Length; i++) {
950for (int i = 0; i < counters.Length; i++) {
1088bufferSize = buffer.Length * sizeof(long);
sys\System\IO\compression\DeflateStream.cs (6)
331int bytes = _stream.Read(buffer, 0, buffer.Length);
353if (array.Length - offset < count)
414_stream.BeginRead(buffer, 0, buffer.Length, m_CallBack, userResult);
453_stream.BeginRead(buffer, 0, buffer.Length, m_CallBack, outerResult);
549_stream.Write(b, 0, b.Length);
597_stream.Write(b, 0, b.Length);
sys\system\io\ports\SerialPort.cs (27)
687portNames = new String[deviceNames.Length];
689for (int i=0; i<deviceNames.Length; i++)
863if (buffer.Length - offset < count)
999if (buffer.Length - offset < count)
1011Debug.Assert(buffer.Length - offset >= count, "invalid offset/count!");
1138Debug.Assert((buffer.Length - offset - totalCharsFound) >= currentCharsFound, "internal buffer to read one full unicode char sequence is not sufficient!");
1188internalSerialStream.Read(bytesReceived, CachedBytesToRead, bytesReceived.Length - (CachedBytesToRead)); // get everything
1196int numCharsReceived = localDecoder.GetCharCount(bytesReceived, 0, bytesReceived.Length);
1197int lastFullCharIndex = bytesReceived.Length;
1201Buffer.BlockCopy(bytesReceived, 0, inBuffer, 0, bytesReceived.Length); // put it all back!
1204readLen = bytesReceived.Length;
1215readLen = bytesReceived.Length - (lastFullCharIndex + 1);
1217Buffer.BlockCopy(bytesReceived, lastFullCharIndex + 1, inBuffer, 0, bytesReceived.Length - (lastFullCharIndex + 1));
1310if (readBuffer.Length > 0) {
1320MaybeResizeBuffer(readBuffer.Length + bytesToSave);
1322Buffer.BlockCopy(readBuffer, 0, inBuffer, readLen, readBuffer.Length);
1323readLen += readBuffer.Length;
1347internalSerialStream.Write(bytesToWrite, 0, bytesToWrite.Length, writeTimeout);
1361if (buffer.Length - offset < count)
1364if (buffer.Length == 0) return;
1367Write(byteArray, 0, byteArray.Length);
1382if (buffer.Length - offset < count)
1384if (buffer.Length == 0) return;
1468if (additionalByteLength + readLen <= inBuffer.Length)
1472if (CachedBytesToRead + additionalByteLength <= inBuffer.Length / 2)
1476int newLength = Math.Max(CachedBytesToRead + additionalByteLength, inBuffer.Length * 2);
1478Debug.Assert(inBuffer.Length >= readLen, "ResizeBuffer - readLen > inBuffer.Length");
System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\FromExpression\Framework\ValueEditors\ValueToIconConverter.cs (1)
33if (values.Length == 2)
Microsoft\Scripting\Utils\CollectionExtensions.cs (6)
157T[] result = new T[array.Length - 1];
158Array.Copy(array, 1, result, 0, result.Length);
163T[] result = new T[array.Length - 1];
164Array.Copy(array, 0, result, 0, result.Length);
198T[] copy = new T[array.Length];
199Array.Copy(array, copy, array.Length);
System\Diagnostics\Eventing\Reader\NativeWrapper.cs (4)
1108UnsafeNativeMethods.EvtStringVariant [] stringVariants = new UnsafeNativeMethods.EvtStringVariant[values.Length];
1109for (int i = 0; i < values.Length; i++) {
1115bool status = UnsafeNativeMethods.EvtFormatMessage(handle, eventHandle, 0xffffffff, values.Length, stringVariants, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent, 0, sb, out bufferNeeded);
1139status = UnsafeNativeMethods.EvtFormatMessage(handle, eventHandle, 0xffffffff, values.Length, stringVariants, UnsafeNativeMethods.EvtFormatMessageFlags.EvtFormatMessageEvent, bufferNeeded, sb, out bufferNeeded);
System\Security\Cryptography\CapiNative.cs (13)
543Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length > 0);
583Debug.Assert(keyBlob.Length > keyDataOffset, "Key blob is in an unexpected format.");
587Debug.Assert(keyBlob.Length >= keyDataOffset + keyLength, "Key blob is in an unexpected format.");
590Buffer.BlockCopy(keyBlob, keyDataOffset, keyData, 0, keyData.Length);
628if (parameterSize != parameterValue.Length) {
732int blobSize = Marshal.SizeOf(typeof(BLOBHEADER)) + Marshal.SizeOf(typeof(int)) + key.Length;
744*pSize = key.Length;
748Buffer.BlockCopy(key, 0, keyBlob, Marshal.SizeOf(typeof(BLOBHEADER)) + Marshal.SizeOf(typeof(int)), key.Length);
757keyBlob.Length,
889(uint)pbEncoded.Length,
899(uint)pbEncoded.Length,
1027SafeLocalAllocHandle pb = CapiNative.LocalAlloc(CapiNative.LMEM_FIXED, new IntPtr(arr.Length));
1028Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length);
System\Security\Cryptography\CapiSymmetricAlgorithm.cs (39)
99Array.Clear(m_depadBuffer, 0, m_depadBuffer.Length);
108Contract.Requires(inputBuffer != null && inputCount <= inputBuffer.Length - inputOffset);
111Contract.Requires(outputBuffer != null && inputCount <= outputBuffer.Length - outputOffset);
131int depadDecryptLength = RawDecryptBlocks(m_depadBuffer, 0, m_depadBuffer.Length);
133Array.Clear(m_depadBuffer, 0, m_depadBuffer.Length);
142Debug.Assert(inputCount >= m_depadBuffer.Length, "inputCount >= m_depadBuffer.Length");
144inputOffset + inputCount - m_depadBuffer.Length,
147m_depadBuffer.Length);
148inputCount -= m_depadBuffer.Length;
166Contract.Requires(block != null && count >= block.Length - offset);
169Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length <= block.Length);
234Buffer.BlockCopy(block, offset, depadded, 0, depadded.Length);
244Contract.Requires(buffer != null && count <= buffer.Length - offset);
264buffer.Length - offset)) {
279Contract.Requires(block != null && count <= block.Length - offset);
282Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length % InputBlockSize == 0);
295result[result.Length - 1] = (byte)padBytes;
305CapiNative.UnsafeNativeMethods.CryptGenRandom(m_provider, result.Length - 1, result);
307result[result.Length - 1] = (byte)padBytes;
317Buffer.BlockCopy(block, offset, result, 0, result.Length);
328for (int i = count; i < result.Length; i++) {
366(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length == blockSize / 8));
371if (blockSize / 8 <= iv.Length) {
373Buffer.BlockCopy(iv, 0, realIV, 0, realIV.Length);
394Contract.Requires(buffer != null && count <= buffer.Length - offset);
447buffer.Length);
451resetSize = buffer.Length;
465Array.Clear(m_depadBuffer, 0, m_depadBuffer.Length);
489if (inputCount > inputBuffer.Length - inputOffset) {
495if (inputCount > outputBuffer.Length - outputOffset) {
526if (inputCount > inputBuffer.Length - inputOffset) {
535if (outputData.Length > 0) {
536EncryptBlocks(outputData, 0, outputData.Length);
557ciphertext = new byte[m_depadBuffer.Length + inputCount];
558Buffer.BlockCopy(m_depadBuffer, 0, ciphertext, 0, m_depadBuffer.Length);
559Buffer.BlockCopy(inputBuffer, inputOffset, ciphertext, m_depadBuffer.Length, inputCount);
563if (ciphertext.Length > 0) {
564int decryptedBytes = RawDecryptBlocks(ciphertext, 0, ciphertext.Length);
System\Security\Cryptography\NCryptNative.cs (53)
553data.Length,
567data.Length,
570decrypted.Length,
584if (decrypted.Length != decryptedSize)
588Array.Clear(clear, 0, clear.Length);
666data.Length,
680data.Length,
683encrypted.Length,
765hash.Length,
779hash.Length,
781signature.Length,
856hash.Length,
858signature.Length,
962byte[] blob = new byte[2 * sizeof(int) + xBytes.Length + yBytes.Length];
964Buffer.BlockCopy(BitConverter.GetBytes(xBytes.Length), 0, blob, sizeof(int), sizeof(int));
965Buffer.BlockCopy(xBytes, 0, blob, 2 * sizeof(int), xBytes.Length);
966Buffer.BlockCopy(yBytes, 0, blob, 2 * sizeof(int) + xBytes.Length, yBytes.Length);
1063hmacKeyBuffer.cbBuffer = hmacKey.Length;
1071secretPrependBuffer.cbBuffer = secretPrepend.Length;
1079secretAppendBuffer.cbBuffer = secretAppend.Length;
1116parameterDesc.cBuffers = parameters.Length;
1138keyMaterial.Length,
1213labelBuffer.cbBuffer = label.Length;
1219seedBuffer.cbBuffer = seed.Length;
1289keyBlob.Length,
1306Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length >= keySize / 8);
1309if (key.Length == bytesRequired) {
1322Buffer.BlockCopy(key, 0, fullKey, 0, Math.Min(key.Length, fullKey.Length));
1377value.Length,
1487else if (valueBytes.Length == 0) {
1546keyBlob.Length,
1575keyBlob.Length,
1633Contract.Ensures(Contract.Result<byte[]>() != null && Contract.Result<byte[]>().Length == buffer.Length);
1634return ReverseBytes(buffer, 0, buffer.Length, false);
1646Contract.Requires(offset >= 0 && offset < buffer.Length);
1647Contract.Requires(count >= 0 && buffer.Length - count >= offset);
1649Contract.Ensures(Contract.Result<byte[]>().Length == (padWithZeroByte ? count + 1 : count));
1758value != null ? value.Length : 0,
1780hash.Length,
1797hash.Length,
1799signature.Length,
1830hash.Length,
1832signature.Length,
1843hash.Length,
1845signature.Length,
1866Contract.Requires(blob != null && blob.Length > 2 * sizeof(int));
1876Debug.Assert(blob.Length >= 2 * sizeof(int) + 2 * parameterSize, "blob.Length >= 2 * sizeof(int) + 2 * parameterSize");
1896hash.Length,
1898signature.Length,
System\Security\Cryptography\RsaCng.cs (29)
164Debug.Assert(offset >= 0 && offset <= data.Length);
165Debug.Assert(count >= 0 && count <= data.Length);
259Buffer.BlockCopy(rsaBlob, offset, rsaParams.Exponent, 0, rsaParams.Exponent.Length);
264Buffer.BlockCopy(rsaBlob, offset, rsaParams.Modulus, 0, rsaParams.Modulus.Length);
271Buffer.BlockCopy(rsaBlob, offset, rsaParams.P, 0, rsaParams.P.Length);
276Buffer.BlockCopy(rsaBlob, offset, rsaParams.Q, 0, rsaParams.Q.Length);
281Buffer.BlockCopy(rsaBlob, offset, rsaParams.DP, 0, rsaParams.DP.Length);
286Buffer.BlockCopy(rsaBlob, offset, rsaParams.DQ, 0, rsaParams.DQ.Length);
291Buffer.BlockCopy(rsaBlob, offset, rsaParams.InverseQ, 0, rsaParams.InverseQ.Length);
296Buffer.BlockCopy(rsaBlob, offset, rsaParams.D, 0, rsaParams.D.Length);
340parameters.Exponent.Length +
341parameters.Modulus.Length;
344blobSize += parameters.P.Length +
345parameters.Q.Length;
358pBcryptBlob->BitLength = parameters.Modulus.Length * 8;
360pBcryptBlob->cbPublicExp = parameters.Exponent.Length;
361pBcryptBlob->cbModulus = parameters.Modulus.Length;
365pBcryptBlob->cbPrime1 = parameters.P.Length;
366pBcryptBlob->cbPrime2 = parameters.Q.Length;
372Buffer.BlockCopy(parameters.Exponent, 0, rsaBlob, offset, parameters.Exponent.Length);
373offset += parameters.Exponent.Length;
376Buffer.BlockCopy(parameters.Modulus, 0, rsaBlob, offset, parameters.Modulus.Length);
377offset += parameters.Modulus.Length;
382Buffer.BlockCopy(parameters.P, 0, rsaBlob, offset, parameters.P.Length);
383offset += parameters.P.Length;
386Buffer.BlockCopy(parameters.Q, 0, rsaBlob, offset, parameters.Q.Length);
387offset += parameters.Q.Length;
488return NCryptNative.SignHashPss(keyHandle, hash, hashAlgorithm.Name, hash.Length);
524return NCryptNative.VerifySignaturePss(KeyHandle, hash, hashAlgorithm.Name, hash.Length, signature);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\FromExpression\Framework\ValueEditors\ValueToIconConverter.cs (1)
33if (values.Length == 2)
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Base\Core\Internal\PropertyEditing\Selection\CategoryContainerSelectionPathInterpreter.cs (1)
70bool isAdvanced = pathValues.Length == 2;
fx\src\data\Microsoft\SqlServer\Server\ValueUtilsSmi.cs (21)
106fieldOffset, buffer.Length, bufferOffset, length );
134CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, 0, fieldOffset, buffer.Length, bufferOffset, length );
146fieldOffset, buffer.Length, bufferOffset, length );
149length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, actualLength, fieldOffset, buffer.Length, bufferOffset, length );
168length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, actualLength, fieldOffset, buffer.Length, bufferOffset, length );
184fieldOffset, buffer.Length, bufferOffset, length );
1129Debug.Assert(index >= 0 && index < __dbTypeToStorageType.Length, string.Format(CultureInfo.InvariantCulture, "Unexpected dbType value: {0}", dbType));
1354length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, NoLengthLimit /* actual */, fieldOffset, buffer.Length, bufferOffset, length );
1389length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, NoLengthLimit /* actual */, fieldOffset, buffer.Length, bufferOffset, length );
1722for ( int i = 0; i < metaData.Length; i++ ) {
2040for (int i = 0; i < metaData.Length; ++i) {
2157for (int i = 0; i < metaData.Length; ++i)
2474int length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, NoLengthLimit /* actual */, 0, buffer.Length, offset, buffer.Length - offset );
2480int length = CheckXetParameters( metaData.SqlDbType, metaData.MaxLength, NoLengthLimit /* actual */, 0, buffer.Length, offset, buffer.Length - offset );
3031Debug.Assert(bufferOffset >= 0 && length >= 0 && bufferOffset + length <= buffer.Length, string.Format("Bad offset or length. bufferOffset: {0}, length: {1}, buffer.Length{2}", bufferOffset, length, buffer.Length));
3067Debug.Assert(bufferOffset >= 0 && length >= 0 && bufferOffset + length <= buffer.Length, string.Format("Bad offset or length. bufferOffset: {0}, length: {1}, buffer.Length{2}", bufferOffset, length, buffer.Length));
3749if (record.FieldCount != mdFields.Length) {
fx\src\data\System\Data\Common\DbConnectionStringCommon.cs (11)
156Array.Copy(_items, 0, array, arrayIndex, _items.Length);
160Array.Copy(_items, 0, array, arrayIndex, _items.Length);
201get { return _items.Length; }
218return (++_index < _items.Length);
333Debug.Assert(Enum.GetNames(typeof(PoolBlockingPeriod)).Length == 3, "PoolBlockingPeriod enum has changed, update needed");
360Debug.Assert(Enum.GetNames(typeof(PoolBlockingPeriod)).Length == 3, "PoolBlockingPeriod enum has changed, update needed");
468Debug.Assert(Enum.GetNames(typeof(ApplicationIntent)).Length == 2, "ApplicationIntent enum has changed, update needed");
490Debug.Assert(Enum.GetNames(typeof(ApplicationIntent)).Length == 2, "ApplicationIntent enum has changed, update needed");
594Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 5, "SqlAuthenticationMethod enum has changed, update needed");
660Debug.Assert(Enum.GetNames(typeof(SqlConnectionColumnEncryptionSetting)).Length == 2, "SqlConnectionColumnEncryptionSetting enum has changed, update needed");
684Debug.Assert(Enum.GetNames(typeof(SqlAuthenticationMethod)).Length == 5, "SqlAuthenticationMethod enum has changed, update needed");
fx\src\data\System\Data\DataTableReader.cs (23)
50if (dataTables.Length == 0)
54tables = new DataTable[dataTables.Length];
55for (int i = 0; i < dataTables.Length ; i++) {
141if ((tableCounter == tables.Length -1))
335return tempBuffer.Length;
338int byteCount = Math.Min(tempBuffer.Length - srcIndex, length);
340throw ADP.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, "dataIndex");
342else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length)) {
343throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
384return tempBuffer.Length;
388int charCount = Math.Min(tempBuffer.Length - srcIndex, length);
390throw ADP.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, "dataIndex");
392else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length)) {
393throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
579Array.Copy(currentDataRow.ItemArray, values, currentDataRow.ItemArray.Length > values.Length ? values.Length : currentDataRow.ItemArray.Length);
580return (currentDataRow.ItemArray.Length > values.Length ? values.Length : currentDataRow.ItemArray.Length);
704for (int j = 0; j < dependency.Length; j++) {
fx\src\data\System\Data\Odbc\OdbcConnectionHandle.cs (6)
224ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetConnectAttrW(this, attribute, buffer, buffer.Length, out cbActual);
225Bid.Trace("<odbc.SQLGetConnectAttr|ODBC> SQLRETURN=%d, Attribute=%d, BufferLength=%d, StringLength=%d\n", (int)retcode, (int)attribute, buffer.Length, (int)cbActual);
236ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), out cbActual);
237Bid.Trace("<odbc.SQLGetInfo|ODBC> SQLRETURN=%d, InfoType=%d, BufferLength=%d, StringLength=%d\n", (int)retcode, (int)info, buffer.Length, (int)cbActual);
242ODBC32.RetCode retcode = UnsafeNativeMethods.SQLGetInfoW(this, info, buffer, checked((short)buffer.Length), ADP.PtrZero);
243Bid.Trace("<odbc.SQLGetInfo|ODBC> SQLRETURN=%d, InfoType=%d, BufferLength=%d\n", (int)retcode, (int)info, buffer.Length);
fx\src\data\System\Data\OleDb\OleDbDataReader.cs (53)
153return ((null != metadata) ? metadata.Length : 0);
249if ((null != metadata) && (0 < metadata.Length)) {
250if ((0 < metadata.Length) && _useIColumnsRowset && (null != _connection)) {
278if (null != _metadata && 0 < _metadata.Length) {
287if (null != _metadata && 0 < _metadata.Length) {
304schemaTable.MinimumCapacity = metadata.Length;
352if (_visibleFieldCount < metadata.Length) {
361for (int i = 0; i < metadata.Length; ++i) {
388if (_visibleFieldCount < metadata.Length) {
704for (int i = 0; i < bindings.Length; ++i) {
794return value.Length;
797int byteCount = Math.Min(value.Length - srcIndex, length);
799throw ADP.InvalidSourceBufferIndex(value.Length, srcIndex, "dataIndex");
801else if ((bufferIndex < 0) || (bufferIndex >= buffer.Length)) { // MDAC 71013
802throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
831else if ((bufferIndex < 0) || (bufferIndex >= buffer.Length)) { // MDAC 71013
832throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
1042int count = Math.Min(values.Length, _visibleFieldCount);
1043for (int i = 0; (i < _metadata.Length) && (i < count); ++i) {
1284return (0 < _metadata.Length);
1291Debug.Assert(0 <= _metadata.Length, "incorrect state for fieldCount");
1303Debug.Assert(0 <= _metadata.Length, "incorrect state for fieldCount");
1321for (int i = 0; (i < bindings.Length) && (i < _nextAccessorForRetrieval); ++i) {
1337Debug.Assert(null != _metadata && 0 < _metadata.Length, "no columns");
1342for (int i = 0; i < dbBindings.Length; ++i) {
1377int[] indexToBinding = new int[metadata.Length];
1378int[] indexWithinBinding = new int[metadata.Length];
1383for (int i = 0; i < indexToBinding.Length; ++i) {
1409for (int i = 0; i < indexToBinding.Length; ++i) {
1413bindingCount = metadata.Length;
1417for (int i = 0; i < indexToBinding.Length; ++i) {
1429for (int index = 0; index < metadata.Length; ++index) {
1430Debug.Assert(indexToBinding[index] < dbbindings.Length, "bad indexToAccessor");
1434for (int i = index; (i < metadata.Length) && (bindingCount == indexWithinBinding[i]); ++i) {
1515for (int i = 0; i < dbbindings.Length; ++i) {
1519for (int k = 0; k < columnBindings.Length; ++k) {
1683bool[] mustRelease = new bool[columnBindings.Length];
1684StringMemHandle[] sptr = new StringMemHandle[columnBindings.Length];
1688for (int i = 0; i < columnBindings.Length; ++i) {
1713hr = irow.GetColumns((IntPtr)access.Length, access);
1720for (int i = 0; i < mustRelease.Length; i++) {
1746if (_metadata.Length <= 0) {
1751for (int i = 0; i < _metadata.Length; ++i) {
1762for (int i = 0; i < _metadata.Length; ++i) {
1807Hashtable baseColumnNames = new Hashtable(_metadata.Length * 2); // MDAC 67385
1809for (int i = _metadata.Length-1; 0 <= i; --i) {
1815for (int i = 0; i < _metadata.Length; ++i) {
1885for (int i = 0; i < _metadata.Length; ++i) {
1924bool[] keys = new bool[_metadata.Length];
1925bool[] uniq = new bool[_metadata.Length];
1984for (int i = 0; i < _metadata.Length; ++i) {
1996for (int i = 0; i < _metadata.Length; ++i) {
2249if ((null != metadata) && (0 < metadata.Length)) {
fx\src\data\System\Data\ProviderBase\SchemaMapping.cs (28)
181bool[] readOnly = new bool[mapped.Length];
182for (int i = 0; i < readOnly.Length; ++i) {
189for (int i = 0; i < readOnly.Length; ++i) {
195for(int i = 0; i < mapped.Length; ++i) {
203for (int i = 0; i < readOnly.Length; ++i) {
243Debug.Assert(_mappedLength == _indexMap.Length, "incorrect precomputed length");
255Debug.Assert(_mappedLength == Math.Min(_readerDataValues.Length, _mappedDataValues.Length), "incorrect precomputed length");
265for(int i = 0; i < _xmlMap.Length; ++i) {
334for (int i = 0; i < _readerDataValues.Length; ++i) {
374for(int i = 0; i < _chapterMap.Length; ++i) {
388int rowLength = _chapterMap.Length;
433for(int i = 0; i < fieldNames.Length; ++i) {
442Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray");
551for(int x = 0; x < _xmlMap.Length; ++x) {
644Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount");
646if (0 == schemaRows.Length) {
653bool addPrimaryKeys = (((0 == _dataTable.PrimaryKey.Length) && ((4 <= (int)_loadOption) || (0 == _dataTable.Rows.Count)))
675for(int sortedIndex = 0; sortedIndex < schemaRows.Length; ++sortedIndex) {
692chapterIndexMap = new bool[schemaRows.Length];
699_xmlMap = new int[schemaRows.Length];
706_xmlMap = new int[schemaRows.Length];
719columnIndexMap = CreateIndexMap(schemaRows.Length, unsortedIndex);
750for(int x = 0; x < _xmlMap.Length; ++x) {
855keys = new DataColumn[schemaRows.Length];
879columnIndexMap = CreateIndexMap(schemaRows.Length, unsortedIndex);
912if (keyCount < keys.Length) {
956dataValues = SetupMapping(schemaRows.Length, columnCollection, chapterColumn, chapterValue);
fx\src\data\System\Data\Sql\SqlMetaData.cs (16)
907Array.Copy(rgbValue, rgbNewValue, rgbValue.Length);
908Array.Clear(rgbNewValue, rgbValue.Length, rgbNewValue.Length - rgbValue.Length);
1000Array.Clear(rgbTemp, oldLength, rgbTemp.Length - oldLength);
1168long maxLen = ((System.Byte[])value).Length;
1178long maxLen = ((System.Char[])value).Length;
1331if (value.Length < MaxLength)
1334Array.Copy(value, rgbNewValue, value.Length);
1335Array.Clear(rgbNewValue, value.Length, (int) rgbNewValue.Length - value.Length);
1351if (value.Length > MaxLength && Max != MaxLength)
1386long oldLength = value.Length;
1393for(long i=oldLength; i<rgchNew.Length; i++)
1411if (value.Length > MaxLength && Max != MaxLength)
fx\src\data\System\Data\Sql\sqlnorm.cs (20)
87m_fieldsToNormalize = new FieldInfoEx[fields.Length];
148s.Read(m_PadBuffer, 0, m_PadBuffer.Length);
176s.Write(m_PadBuffer, 0, m_PadBuffer.Length);
270for (int i = 0; i < b.Length; i++)
354s.Write(b, 0, b.Length);
359s.Read(b, 0, b.Length);
376s.Write(b, 0, b.Length);
381s.Read(b, 0, b.Length);
400s.Write(b, 0, b.Length);
405s.Read(b, 0, b.Length);
422s.Write(b, 0, b.Length);
427s.Read(b, 0, b.Length);
444s.Write(b, 0, b.Length);
449s.Read(b, 0, b.Length);
468s.Write(b, 0, b.Length);
473s.Read(b, 0, b.Length);
504s.Write(b, 0, b.Length);
509s.Read(b, 0, b.Length);
551s.Write(b, 0, b.Length);
556s.Read(b, 0, b.Length);
fx\src\data\System\Data\SqlClient\SqlAeadAes256CbcHmac256Algorithm.cs (25)
164int numBlocks = plainText.Length / _BlockSizeInBytes + 1;
173int outputBufSize = sizeof(byte) + authenticationTagLen + iv.Length + (numBlocks*_BlockSizeInBytes);
178Buffer.BlockCopy(iv, 0, outBuffer, ivStartIndex, iv.Length);
216byte[] buffTmp = encryptor.TransformFinalBlock(plainText, count, plainText.Length - count); // done encrypting
217Buffer.BlockCopy(buffTmp, 0, outBuffer, cipherIndex, buffTmp.Length);
218cipherIndex += buffTmp.Length;
224hmac.TransformBlock(_version, 0, _version.Length, _version, 0);
225hmac.TransformBlock(iv, 0, iv.Length, iv, 0);
229hmac.TransformFinalBlock(_versionSize, 0, _versionSize.Length);
231Debug.Assert(hash.Length >= authenticationTagLen, "Unexpected hash size");
271if (cipherText.Length < minimumCipherTextLength) {
272throw SQL.InvalidCipherTextSize(cipherText.Length, minimumCipherTextLength);
292Buffer.BlockCopy(cipherText, startIndex, iv, 0, iv.Length);
293startIndex += iv.Length;
297int cipherTextCount = cipherText.Length - startIndex;
302if (!SqlSecurityUtility.CompareBytes(authenticationTag, cipherText, authenticationTagOffset, authenticationTag.Length)) {
321Debug.Assert ((count+offset) <= cipherText.Length);
391retVal = hmac.TransformBlock(_version, 0, _version.Length, _version, 0);
392Debug.Assert(retVal == _version.Length);
393retVal = hmac.TransformBlock(iv, 0, iv.Length, iv, 0);
394Debug.Assert(retVal == iv.Length);
397hmac.TransformFinalBlock(_versionSize, 0, _versionSize.Length);
401Debug.Assert (computedHash.Length >= authenticationTag.Length);
402Buffer.BlockCopy (computedHash, 0, authenticationTag, 0, authenticationTag.Length);
fx\src\data\System\Data\SqlClient\SqlColumnEncryptionCertificateStoreProvider.cs (45)
86else if (0 == encryptedColumnEncryptionKey.Length)
115int currentIndex = _version.Length;
135int signatureLength = encryptedColumnEncryptionKey.Length - currentIndex - cipherTextLength;
143Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, cipherText, 0, cipherText.Length);
148Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, signature, 0, signature.Length);
154sha256.TransformFinalBlock(encryptedColumnEncryptionKey, 0, encryptedColumnEncryptionKey.Length - signature.Length);
186else if (0 == columnEncryptionKey.Length)
210byte[] keyPathLength = BitConverter.GetBytes((Int16)masterKeyPathBytes.Length);
214byte[] cipherTextLength = BitConverter.GetBytes((Int16)cipherText.Length);
215Debug.Assert(cipherText.Length == keySizeInBytes, @"cipherText length does not match the RSA key size");
222sha256.TransformBlock(version, 0, version.Length, version, 0);
223sha256.TransformBlock(keyPathLength, 0, keyPathLength.Length, keyPathLength, 0);
224sha256.TransformBlock(cipherTextLength, 0, cipherTextLength.Length, cipherTextLength, 0);
225sha256.TransformBlock(masterKeyPathBytes, 0, masterKeyPathBytes.Length, masterKeyPathBytes, 0);
226sha256.TransformFinalBlock(cipherText, 0, cipherText.Length);
232Debug.Assert(signedHash.Length == keySizeInBytes, @"signed hash length does not match the RSA key size");
237int encryptedColumnEncryptionKeyLength = version.Length + cipherTextLength.Length + keyPathLength.Length + cipherText.Length + masterKeyPathBytes.Length + signedHash.Length;
242Buffer.BlockCopy(version, 0, encryptedColumnEncryptionKey, currentIndex, version.Length);
243currentIndex += version.Length;
246Buffer.BlockCopy(keyPathLength, 0, encryptedColumnEncryptionKey, currentIndex, keyPathLength.Length);
247currentIndex += keyPathLength.Length;
250Buffer.BlockCopy(cipherTextLength, 0, encryptedColumnEncryptionKey, currentIndex, cipherTextLength.Length);
251currentIndex += cipherTextLength.Length;
254Buffer.BlockCopy(masterKeyPathBytes, 0, encryptedColumnEncryptionKey, currentIndex, masterKeyPathBytes.Length);
255currentIndex += masterKeyPathBytes.Length;
258Buffer.BlockCopy(cipherText, 0, encryptedColumnEncryptionKey, currentIndex, cipherText.Length);
259currentIndex += cipherText.Length;
262Buffer.BlockCopy(signedHash, 0, encryptedColumnEncryptionKey, currentIndex, signedHash.Length);
321sha256.TransformFinalBlock(masterkeyMetadataBytes, 0, masterkeyMetadataBytes.Length);
403if (certParts.Length > 3)
409if (certParts.Length > 2)
427if (certParts.Length > 1)
429if (string.Equals(certParts[certParts.Length - 2], _myCertificateStore, StringComparison.OrdinalIgnoreCase) == true)
436throw SQL.InvalidCertificateStore(certParts[certParts.Length - 2], keyPath, _myCertificateStore, isSystemOp);
441string thumbprint = certParts[certParts.Length - 1];
526Debug.Assert((cipherText != null) && (cipherText.Length != 0));
542Debug.Assert((dataToSign != null) && (dataToSign.Length != 0));
568Debug.Assert((dataToVerify != null) && (dataToVerify.Length != 0));
569Debug.Assert((signature != null) && (signature.Length != 0));
fx\src\data\System\Data\SqlClient\SqlColumnEncryptionCngProvider.cs (38)
67if (0 == encryptedColumnEncryptionKey.Length)
95int currentIndex = _version.Length;
115int signatureLength = encryptedColumnEncryptionKey.Length - currentIndex - cipherTextLength;
123Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, cipherText, 0, cipherText.Length);
128Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, signature, 0, signature.Length);
134sha256.TransformFinalBlock(encryptedColumnEncryptionKey, 0, encryptedColumnEncryptionKey.Length - signature.Length);
167else if (0 == columnEncryptionKey.Length)
190byte[] keyPathLength = BitConverter.GetBytes((Int16)masterKeyPathBytes.Length);
194byte[] cipherTextLength = BitConverter.GetBytes((Int16)cipherText.Length);
195Debug.Assert(cipherText.Length == keySizeInBytes, @"cipherText length does not match the RSA key size");
202sha256.TransformBlock(version, 0, version.Length, version, 0);
203sha256.TransformBlock(keyPathLength, 0, keyPathLength.Length, keyPathLength, 0);
204sha256.TransformBlock(cipherTextLength, 0, cipherTextLength.Length, cipherTextLength, 0);
205sha256.TransformBlock(masterKeyPathBytes, 0, masterKeyPathBytes.Length, masterKeyPathBytes, 0);
206sha256.TransformFinalBlock(cipherText, 0, cipherText.Length);
212Debug.Assert(signedHash.Length == keySizeInBytes, @"signed hash length does not match the RSA key size");
217int encryptedColumnEncryptionKeyLength = version.Length + cipherTextLength.Length + keyPathLength.Length + cipherText.Length + masterKeyPathBytes.Length + signedHash.Length;
222Buffer.BlockCopy(version, 0, encryptedColumnEncryptionKey, currentIndex, version.Length);
223currentIndex += version.Length;
226Buffer.BlockCopy(keyPathLength, 0, encryptedColumnEncryptionKey, currentIndex, keyPathLength.Length);
227currentIndex += keyPathLength.Length;
230Buffer.BlockCopy(cipherTextLength, 0, encryptedColumnEncryptionKey, currentIndex, cipherTextLength.Length);
231currentIndex += cipherTextLength.Length;
234Buffer.BlockCopy(masterKeyPathBytes, 0, encryptedColumnEncryptionKey, currentIndex, masterKeyPathBytes.Length);
235currentIndex += masterKeyPathBytes.Length;
238Buffer.BlockCopy(cipherText, 0, encryptedColumnEncryptionKey, currentIndex, cipherText.Length);
239currentIndex += cipherText.Length;
242Buffer.BlockCopy(signedHash, 0, encryptedColumnEncryptionKey, currentIndex, signedHash.Length);
332Debug.Assert((encryptedColumnEncryptionKey != null) && (encryptedColumnEncryptionKey.Length != 0));
346Debug.Assert((dataToSign != null) && (dataToSign.Length != 0));
361Debug.Assert((dataToVerify != null) && (dataToVerify.Length != 0));
362Debug.Assert((signature != null) && (signature.Length != 0));
fx\src\data\System\Data\SqlClient\SqlColumnEncryptionCspProvider.cs (38)
73if (0 == encryptedColumnEncryptionKey.Length)
101int currentIndex = _version.Length;
121int signatureLength = encryptedColumnEncryptionKey.Length - currentIndex - cipherTextLength;
129Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, cipherText, 0, cipherText.Length);
134Buffer.BlockCopy(encryptedColumnEncryptionKey, currentIndex, signature, 0, signature.Length);
140sha256.TransformFinalBlock(encryptedColumnEncryptionKey, 0, encryptedColumnEncryptionKey.Length - signature.Length);
173else if (0 == columnEncryptionKey.Length)
196byte[] keyPathLength = BitConverter.GetBytes((Int16)masterKeyPathBytes.Length);
200byte[] cipherTextLength = BitConverter.GetBytes((Int16)cipherText.Length);
201Debug.Assert(cipherText.Length == keySizeInBytes, @"cipherText length does not match the RSA key size");
208sha256.TransformBlock(version, 0, version.Length, version, 0);
209sha256.TransformBlock(keyPathLength, 0, keyPathLength.Length, keyPathLength, 0);
210sha256.TransformBlock(cipherTextLength, 0, cipherTextLength.Length, cipherTextLength, 0);
211sha256.TransformBlock(masterKeyPathBytes, 0, masterKeyPathBytes.Length, masterKeyPathBytes, 0);
212sha256.TransformFinalBlock(cipherText, 0, cipherText.Length);
218Debug.Assert(signedHash.Length == keySizeInBytes, @"signed hash length does not match the RSA key size");
223int encryptedColumnEncryptionKeyLength = version.Length + cipherTextLength.Length + keyPathLength.Length + cipherText.Length + masterKeyPathBytes.Length + signedHash.Length;
228Buffer.BlockCopy(version, 0, encryptedColumnEncryptionKey, currentIndex, version.Length);
229currentIndex += version.Length;
232Buffer.BlockCopy(keyPathLength, 0, encryptedColumnEncryptionKey, currentIndex, keyPathLength.Length);
233currentIndex += keyPathLength.Length;
236Buffer.BlockCopy(cipherTextLength, 0, encryptedColumnEncryptionKey, currentIndex, cipherTextLength.Length);
237currentIndex += cipherTextLength.Length;
240Buffer.BlockCopy(masterKeyPathBytes, 0, encryptedColumnEncryptionKey, currentIndex, masterKeyPathBytes.Length);
241currentIndex += masterKeyPathBytes.Length;
244Buffer.BlockCopy(cipherText, 0, encryptedColumnEncryptionKey, currentIndex, cipherText.Length);
245currentIndex += cipherText.Length;
248Buffer.BlockCopy(signedHash, 0, encryptedColumnEncryptionKey, currentIndex, signedHash.Length);
341Debug.Assert((encryptedColumnEncryptionKey != null) && (encryptedColumnEncryptionKey.Length != 0));
355Debug.Assert((dataToSign != null) && (dataToSign.Length != 0));
370Debug.Assert((dataToVerify != null) && (dataToVerify.Length != 0));
371Debug.Assert((signature != null) && (signature.Length != 0));
fx\src\data\System\Data\SqlClient\SqlCommand.cs (22)
345Bid.Trace("<sc.SqlCommand.CommandEventSink.ParametersAvailable|ADV> %d# metaData.Length=%d.\n", _command.ObjectID, (null!=metaData)?metaData.Length:-1);
348for (int i=0; i < metaData.Length; i++) {
1927bool isXmlCapable = (null != md && md.Length == 1 && (md[0].SqlDbType == SqlDbType.NText
2735Debug.Assert(parsedSProc.Length == 4, "Invalid array length result from SqlCommandBuilder.ParseProcedureName");
3598for (int i = 0; i < _SqlRPCBatchArray.Length; i++) {
3601if (_SqlRPCBatchArray[i].parameters.Length > 1) {
3631Debug.Assert(_sqlRPCParameterEncryptionReqArray.Length > 0, "There should be at-least 1 describe parameter encryption rpc request.");
3632Debug.Assert(_sqlRPCParameterEncryptionReqArray.Length <= _SqlRPCBatchArray.Length,
3724Debug.Assert(originalRpcRequest.parameters != null && originalRpcRequest.parameters.Length > 0,
3749if (originalRpcRequest.parameters.Length > 1) {
3797Size = attestationParameters.Length,
3834if (resultSetSequenceNumber >= _sqlRPCParameterEncryptionReqArray.Length) {
3872ds.GetBytes((int)DescribeParameterEncryptionResultSet1.KeyMdVersion, 0, keyMdVersion, 0, keyMdVersion.Length);
3985for (paramIdx = parameterStartIndex; paramIdx < rpc.parameters.Length && rpc.parameters[paramIdx] != null; paramIdx++) {
4029for (paramIdx = parameterStartIndex; paramIdx < rpc.parameters.Length && rpc.parameters[paramIdx] != null; paramIdx++) {
4082for (int i = 0; i < _SqlRPCBatchArray.Length; i++) {
5277for(int index=0; index < paramMetaData.Length; index++) {
5401if(rpc.parameters == null || rpc.parameters.Length < paramCount) {
5404else if (rpc.parameters.Length > paramCount) {
5407if(rpc.paramoptions == null || (rpc.paramoptions.Length < paramCount)) {
5883for (int i = 0; i < strings.Length; i++ ) {
fx\src\data\System\Data\SqlClient\SqlConnection.cs (5)
2020p = new SqlParameter(null, SqlDbType.VarBinary, (null != data) ? data.Length : 0);
2157sdc.machineName = cp.GetString(memMap.rgbMachineName, 0, memMap.rgbMachineName.Length);
2158sdc.sdiDllName = cp.GetString(memMap.rgbDllName, 0, memMap.rgbDllName.Length);
2515Marshal.Copy(rgbMachineName, 0, ADP.IntPtrOffset(pMemMap, offset), rgbMachineName.Length);
2517Marshal.Copy(rgbSDIDLLName, 0, ADP.IntPtrOffset(pMemMap, offset), rgbSDIDLLName.Length);
fx\src\data\System\Data\SqlClient\SqlDataReader.cs (24)
1148for (int i = 0; i < indexMap.Length; ++i) {
1217Debug.Assert(i < _data.Length, "Reading beyond data length?");
1616if (bufferIndex < 0 || bufferIndex >= buffer.Length)
1617throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
1620if (length + bufferIndex > buffer.Length)
1683cbytes = data.Length;
1711cbytes = data.Length;
1717if (bufferIndex < 0 || bufferIndex >= buffer.Length)
1718throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
1721if (cbytes + bufferIndex > buffer.Length)
1793Debug.Assert(index + length <= buffer.Length, "Buffer too small");
1978if ((bufferIndex < 0) || (buffer != null && bufferIndex >= buffer.Length)) {
1979throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
1983if (buffer != null && (length + bufferIndex > buffer.Length)) {
2026int cchars = _columnDataChars.Length;
2060cchars = _columnDataChars.Length;
2066if (bufferIndex < 0 || bufferIndex >= buffer.Length)
2067throw ADP.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
2070if (cchars + bufferIndex > buffer.Length)
2480int copyLen = (values.Length < _metaData.visibleColumns) ? values.Length : _metaData.visibleColumns;
2685int copyLen = (values.Length < _metaData.visibleColumns) ? values.Length : _metaData.visibleColumns;
3738if (_data == null || _data.Length<metaDataSet.Length) {
fx\src\data\System\Data\SqlClient\SqlSequentialTextReader.cs (14)
172if ((byteBufferUsed < byteBuffer.Length) || (byteBuffer.Length == 0))
178Task<int> getBytesTask = reader.GetBytesAsync(_columnIndex, byteBuffer, byteBufferUsed, byteBuffer.Length - byteBufferUsed, Timeout.Infinite, _disposalTokenSource.Token, out bytesRead);
310Debug.Assert((index >= 0) && (count >= 0) && (index + count <= buffer.Length), string.Format("Bad count: {0} or index: {1}", count, index));
317byteBufferUsed += _reader.GetBytesInternalSequential(_columnIndex, byteBuffer, byteBufferUsed, byteBuffer.Length - byteBufferUsed);
358if (_leftOverBytes.Length > byteBufferSize)
361byteBufferUsed = byteBuffer.Length;
367Array.Copy(_leftOverBytes, byteBuffer, _leftOverBytes.Length);
368byteBufferUsed = _leftOverBytes.Length;
393Debug.Assert((inBufferCount > 0) && (inBufferCount <= inBuffer.Length), string.Format("Bad inBufferCount: {0}", inBufferCount));
395Debug.Assert((outBufferOffset >= 0) && (outBufferCount > 0) && (outBufferOffset + outBufferCount <= outBuffer.Length), string.Format("Bad outBufferCount: {0} or outBufferOffset: {1}", outBufferCount, outBufferOffset));
406Array.Copy(inBuffer, bytesUsed, _leftOverBytes, 0, _leftOverBytes.Length);
468if (checked(index + count) > buffer.Length)
518Convert(bytes, byteIndex, byteCount, chars, charIndex, chars.Length - charIndex, true, out bytesUsed, out charsUsed, out completed);
fx\src\data\System\Data\SqlClient\TdsParser.cs (102)
826Debug.Assert(GUID_SIZE == connectionIdBytes.Length);
899result = _physicalStateObj.TryReadByteArray(payload, 0, payload.Length);
1092if (offset < payload.Length) {
1521Debug.Assert(2 == stateObj._bShortBytes.Length);
1534if ((stateObj._outBytesUsed + 2) > stateObj._outBuff.Length) {
1570Debug.Assert (4 == stateObj._bIntBytes.Length);
1585if ((stateObj._outBytesUsed + 4) > stateObj._outBuff.Length) {
1616stateObj.WriteByteArray(bytes, bytes.Length, 0);
1629Debug.Assert (8 == bytes.Length, "Cached buffer has wrong size");
1646if ((stateObj._outBytesUsed + 8) > stateObj._outBuff.Length) {
1689if ((stateObj._outBytesUsed + length) > stateObj._outBuff.Length) {
1725stateObj.WriteByteArray(bytes, bytes.Length, 0);
2074for (int ii = 0; ii < env.Length; ii++) {
2367if (nvalues >= envarray.Length) {
2369SqlEnvChange[] newenvarray = new SqlEnvChange[envarray.Length + 3];
2371for (int ii = 0; ii < envarray.Length; ii++)
2987if (buffer.Length < stateLen) {
3027if (!stateObj.TryReadByteArray(b, 0, b.Length)) {
4469MultiPartTableName[] newTables = new MultiPartTableName[tables.Length + 1];
4470Array.Copy(tables, 0, newTables, 0, tables.Length);
4471newTables[tables.Length] = mpt;
4609Debug.Assert(reader.TableNames.Length >= col.tableNum, "invalid tableNames array!");
5045int length = unencryptedBytes.Length;
5065if (unencryptedBytes.Length != 8) {
5099if (unencryptedBytes.Length != 4) {
5109if (unencryptedBytes.Length != 8) {
5125if (unencryptedBytes.Length != 8) {
5147if (unencryptedBytes.Length != 4) {
5159if (unencryptedBytes.Length != 8) {
5187Buffer.BlockCopy(unencryptedBytes, 0, bytes, 0, unencryptedBytes.Length);
5908Debug.Assert((length == b.Length) && (length == 16), "Invalid length for guid type in com+ object");
6040length = b.Length;
6063length = b.Length;
6316length = bytesPart.Length + 2;
6363for (i = 0; i < bits.Length; i++)
6566if(cBytes < (stateObj._outBuff.Length - stateObj._outBytesUsed)) {
6572if (stateObj._bTmp == null || stateObj._bTmp.Length < cBytes) {
6593if(cBytes < (stateObj._outBuff.Length - stateObj._outBytesUsed)) {
6599if (stateObj._bTmp == null || stateObj._bTmp.Length < cBytes) {
6617if (checked(sourceOffset + charLength) > source.Length || sourceOffset < 0) {
6624if (checked(destOffset + byteLength) > dest.Length || destOffset < 0) {
6654if (checked(destOffset + byteLength) > dest.Length || destOffset < 0) {
6684byteData = new byte[encoding.GetByteCount(charData, 0, charData.Length)];
6685encoding.GetBytes(charData, 0, charData.Length, byteData, 0);
6702int bytesLeft = stateObj._outBuff.Length - stateObj._outBytesUsed;
6703if ((numChars <= bytesLeft) && (encoding.GetMaxByteCount(charData.Length) <= bytesLeft)) {
6704int bytesWritten = encoding.GetBytes(charData, 0, charData.Length, stateObj._outBuff, stateObj._outBytesUsed);
6711return stateObj.WriteByteArray(byteData, byteData.Length, 0, canAccumulate);
6907initialLength += 1 /* StateId*/ + StateValueLength(reconnectData._initialState[i].Length);
6919if (reconnectData._initialState[i] != null && reconnectData._initialState[i].Length == reconnectData._delta[i]._dataLength) {
6942if (reconnectData._initialState[i].Length < 0xFF) {
6943_physicalStateObj.WriteByte((byte)reconnectData._initialState[i].Length);
6947WriteInt(reconnectData._initialState[i].Length, _physicalStateObj);
6949_physicalStateObj.WriteByteArray(reconnectData._initialState[i], reconnectData._initialState[i].Length, 0);
6990dataLen = 1 + sizeof(int) + fedAuthFeatureData.accessToken.Length; // length of feature data = 1 byte for library and echo, security token length and sizeof(int) for token lengh itself
7050WriteInt(fedAuthFeatureData.accessToken.Length, _physicalStateObj);
7051_physicalStateObj.WriteByteArray(fedAuthFeatureData.accessToken, fedAuthFeatureData.accessToken.Length, 0);
7095WriteInt(s_FeatureExtDataAzureSQLSupportFeatureRequest.Length, _physicalStateObj);
7097_physicalStateObj.WriteByteArray(s_FeatureExtDataAzureSQLSupportFeatureRequest, s_FeatureExtDataAzureSQLSupportFeatureRequest.Length, 0);
7152encryptedPasswordLengthInBytes = encryptedPassword.Length; // password in clear text is already encrypted and its length is in byte
7160encryptedChangePasswordLengthInBytes = encryptedChangePassword.Length;
7389_physicalStateObj.WriteByteArray(s_nicAddress, s_nicAddress.Length, 0);
7513WriteUnsignedInt((uint)accessToken.Length + sizeof(uint), _physicalStateObj);
7516WriteUnsignedInt((uint)accessToken.Length, _physicalStateObj);
7519_physicalStateObj.WriteByteArray(accessToken, accessToken.Length, 0);
7764WriteShort(buffer.Length, stateObj);
7765stateObj.WriteByteArray(buffer, buffer.Length, 0);
8101for (int ii = startRpc; ii < rpcArray.Length; ii++) {
8128for (int i = (ii == startRpc) ? startParam : 0; i < parameters.Length; i++) {
8277Debug.Assert(encryptedValue != null && encryptedValue.Length > 0,
8289actualSize = (encryptedValue == null) ? 0 : encryptedValue.Length;
8383size = udtVal.Length;
8402if (!ADP.IsEmpty(names[1]) && TdsEnums.MAX_SERVERNAME < names[names.Length - 2].Length) {
8413WriteUnsignedLong((ulong)udtVal.Length, stateObj); // PLP length
8414if (udtVal.Length > 0) { // Only write chunk length if its value is greater than 0
8415WriteInt(udtVal.Length, stateObj); // Chunk length
8416stateObj.WriteByteArray(udtVal, udtVal.Length, 0); // Value
8569if (ii < (rpcArray.Length - 1)) {
8639WriteShort((short) enclavePackage.Length, stateObj);
8640stateObj.WriteByteArray(enclavePackage, enclavePackage.Length, 0);
9180Debug.Assert (8 == cekTable[i].CekMdVersion.Length);
9338stateObj.WriteByteArray(s_xmlMetadataSubstituteSequence, s_xmlMetadataSubstituteSequence.Length, 0);
9416actualLengthInBytes = (isSqlType) ? ((SqlBinary)value).Length : ((byte[])value).Length;
9537ccb = (isSqlType) ? ((SqlBinary)value).Length : ((byte[])value).Length;
9594stateObj.WriteByteArray(s_longDataHeader, s_longDataHeader.Length, 0);
9988Debug.Assert((actualLength == b.Length) && (actualLength == 16), "Invalid length for guid type in com+ object");
10157if (_preambleToStrip != null && count >= _preambleToStrip.Length) {
10159for (int idx = 0; idx < _preambleToStrip.Length; idx++) {
10166offset += _preambleToStrip.Length;
10167count -= _preambleToStrip.Length;
10244if (checked(offset + count) > buffer.Length) {
10348if (checked(offset + count) > buffer.Length) {
10553Debug.Assert((actualLength == b.Length) && (actualLength == 16), "Invalid length for guid type in com+ object");
10740columnEncryptionParameterInfo.SerializedWireFormat.Length,
10779Debug.Assert((actualLength == b.Length) && (actualLength == 16), "Invalid length for guid type in com+ object");
10952Debug.Assert((actualLength == b.Length) && (actualLength == 16), "Invalid length for guid type in com+ object");
11121Debug.Assert((buff == null && len == 0) || (buff.Length >= offst + len), "Invalid length sent to ReadPlpUnicodeChars()!");
11172Debug.Assert((buff == null && offst == 0) || (buff.Length >= offst + len), "Invalid length sent to ReadPlpUnicodeChars()!");
11196if ((buff == null) || (buff.Length < (offst + charsRead))) {
11263Debug.Assert((buff == null && offst == 0) || (buff.Length >= offst + len), "Invalid length sent to ReadPlpAnsiChars()!");
11291if ((stateObj._bTmp == null) || (stateObj._bTmp.Length < bytesRead)) {
11443null == _sniSpnBuffer ? "(null)" : _sniSpnBuffer.Length.ToString((IFormatProvider)null),
fx\src\data\System\Data\SqlClient\TdsParserStateObject.cs (31)
292Debug.Assert(_parser._physicalStateObj._outBuff.Length ==
293_parser._physicalStateObj._inBuff.Length, "Unexpected unequal buffers.");
296SetPacketSize(_parser._physicalStateObj._outBuff.Length);
504if (_nullBitmap == null || _nullBitmap.Length != bitmapArrayLength) {
509if (!stateObj.TryReadByteArray(_nullBitmap, 0, _nullBitmap.Length)) {
515Bid.TraceBin("<sc.TdsParserStateObject.NullBitmap.Initialize|INFO|ADV> NBCROW bitmap data: ", _nullBitmap, (UInt16)_nullBitmap.Length);
734Debug.Assert(_outBuff.Length == _inBuff.Length, "Unexpected unequal buffers.");
736myInfo.defaultBufferSize = _outBuff.Length; // Obtain packet size from outBuff size.
1113(_outBuff.Length == _inBuff.Length),
1127if (_inBuff == null || _inBuff.Length != size) { // We only check _inBuff, since two buffers should be consistent.
1134else if (size != _inBuff.Length) {
1144if ((temp.Length < _inBytesUsed + remainingData) || (_inBuff.Length < remainingData)) {
1145string errormessage = Res.GetString(Res.SQL_InvalidInternalPacketSize) + ' ' + temp.Length + ", " + _inBytesUsed + ", " + remainingData + ", " + _inBuff.Length;
1222Debug.Assert(buff == null || buff.Length >= len, "Invalid length sent to ReadByteArray()!");
1573if (_bTmp == null || _bTmp.Length < cBytes) {
1638if (_bTmp == null || _bTmp.Length < length) {
1769Debug.Assert((buff == null && offst == 0) || (buff.Length >= offst + len), "Invalid length sent to ReadPlpBytes()!");
1796if (buff.Length < (offst + bytesToRead)) {
1908_inBuff = new byte[_inBuff.Length];
2412if (_inBuff.Length < dataSize) {
2654Debug.Assert((_outBytesUsed + lengthInBytes) < _outBuff.Length, "Passwords cannot be splited into two different packet or the last item which fully fill up _outBuff!!!");
2661for (int i = 0; i < _securePasswords.Length; ++i) {
2712Debug.Assert(_outBytesUsed <= _outBuff.Length, "ERROR - TDSParser: _outBytesUsed > _outBuff.Length");
2715if (_outBytesUsed == _outBuff.Length) {
2741Debug.Assert(b.Length >= len, "Invalid length sent to WriteByteArray()!");
2745if ((_outBytesUsed + len) > _outBuff.Length) {
2750int remainder = _outBuff.Length - _outBytesUsed;
fx\src\data\System\Data\SqlClient\TdsValueSetter.cs (10)
238SetBytesNoOffsetHandling(fieldOffset, bytes, 0, bytes.Length);
326SetBytes(0, bytes, 0, bytes.Length);
327SetBytesLength(bytes.Length);
345_stateObj.Parser.WriteSqlVariantHeader(9 + bytes.Length, TdsEnums.SQLBIGVARCHAR, 7, _stateObj);
348_stateObj.Parser.WriteShort(bytes.Length, _stateObj); // propbyte: varlen
349_stateObj.WriteByteArray(bytes, bytes.Length, 0);
532Debug.Assert(SmiMetaData.DefaultUniqueIdentifier.MaxLength == bytes.Length, "Invalid length for guid bytes: " + bytes.Length);
538Debug.Assert(_metaData.MaxLength == bytes.Length, "Unexpected uniqueid metadata length: " + _metaData.MaxLength);
542_stateObj.WriteByteArray(bytes, bytes.Length, 0);
fx\src\data\System\Data\SQLTypes\SQLString.cs (5)
162: this(lcid, compareOptions, data, 0, data.Length, fUnicode) {
180 : this(lcid, compareOptions, data, 0, data.Length, true) {
804int cbX = rgDataX.Length;
805int cbY = rgDataY.Length;
994return SqlBinary.HashByteArray(rgbSortKey, rgbSortKey.Length);
System\Data\Objects\ObjectStateEntryBaseUpdatableDataRecord.cs (12)
116return tempBuffer.Length;
119int byteCount = Math.Min(tempBuffer.Length - srcIndex, length);
122throw EntityUtil.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, "dataIndex");
124else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length))
126throw EntityUtil.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
170return tempBuffer.Length;
174int charCount = Math.Min(tempBuffer.Length - srcIndex, length);
177throw EntityUtil.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, "dataIndex");
179else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length))
181throw EntityUtil.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
364int minValue = Math.Min(values.Length, FieldCount);
513int minValue = Math.Min(values.Length, FieldCount);
System\Data\Objects\ObjectStateEntryDbDataRecord.cs (11)
100return tempBuffer.Length;
103int byteCount = Math.Min(tempBuffer.Length - srcIndex, length);
106throw EntityUtil.InvalidSourceBufferIndex(tempBuffer.Length, srcIndex, "dataIndex");
108else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length))
110throw EntityUtil.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
138return tempBuffer.Length;
142int charCount = Math.Min(tempBuffer.Length - srcIndex, length);
145throw EntityUtil.InvalidSourceBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
147else if ((bufferIndex < 0) || (bufferIndex > 0 && bufferIndex >= buffer.Length))
149throw EntityUtil.InvalidDestinationBufferIndex(buffer.Length, bufferIndex, "bufferIndex");
244int minValue = Math.Min(values.Length, FieldCount);
System\IdentityModel\CanonicalFormWriter.cs (8)
18if ((data.Length / 3) * 4 + 4 > base64WorkBuffer.Length)
24int encodedLength = Convert.ToBase64CharArray(data, 0, data.Length, base64WorkBuffer, 0, Base64FormattingOptions.None);
30if (s.Length > workBuffer.Length)
55EncodeAndWrite(stream, workBuffer, chars, chars.Length);
60if (count > workBuffer.Length)
86stream.Write(buffer, 0, buffer.Length);
92stream.Write(buffer, 0, buffer.Length);
System\IdentityModel\CipherDataElement.cs (7)
21byte[] buffer = new byte[_iv.Length + _cipherText.Length];
22Buffer.BlockCopy( _iv, 0, buffer, 0, _iv.Length );
23Buffer.BlockCopy( _cipherText, 0, buffer, _iv.Length, _cipherText.Length );
76writer.WriteBase64( _iv, 0, _iv.Length );
78writer.WriteBase64( _cipherText, 0, _cipherText.Length );
System\IdentityModel\CryptoHelper.cs (17)
113byte[] b = new byte[kha.HashSize / 8 + a.Length]; // Buffer for A(i) + seed
127issuerEntropy.CopyTo( b, a.Length );
131for ( int j = 0; j < result.Length; j++ )
146Array.Clear( key, 0, key.Length );
153Array.Clear( result, 0, result.Length );
156Array.Clear( b, 0, b.Length );
302if (secret.Length == 0)
1093if (count < 0 || count > buffer.Length)
1095throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", SR.GetString(SR.ValueMustBeInRange, 0, buffer.Length)));
1097if (offset < 0 || offset > buffer.Length - count)
1099throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", SR.GetString(SR.ValueMustBeInRange, 0, buffer.Length - count)));
1118if (a == null || b == null || a.Length != b.Length)
1123for (int i = 0; i < a.Length; i++)
1151else if (a.Length != b.Length)
1157var length = a.Length;
System\IdentityModel\EncryptedDataElement.cs (8)
57return ExtractIVAndDecrypt( algorithm, cipherText, 0, cipherText.Length );
75if ( cipherText.Length - offset < iv.Length )
77throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new InvalidOperationException( SR.GetString( SR.ID6019, cipherText.Length - offset, iv.Length ) ) );
80Buffer.BlockCopy( cipherText, offset, iv, 0, iv.Length );
91plainText = decrTransform.TransformFinalBlock( cipherText, offset + iv.Length, count - iv.Length );
System\IdentityModel\PreDigestedSignedInfo.cs (13)
72if (this.count == this.references.Length)
74ReferenceEntry[] newReferences = new ReferenceEntry[this.references.Length * 2];
187writer.WriteBase64(digest, 0, digest.Length);
303stream.Write(this.fragment1, 0, this.fragment1.Length);
305stream.Write(signatureMethodBytes, 0, signatureMethodBytes.Length);
306stream.Write(this.fragment2, 0, this.fragment2.Length);
311stream.Write(this.fragment3, 0, this.fragment3.Length);
315stream.Write(this.fragment4StrTransform, 0, this.fragment4StrTransform.Length);
319stream.Write(this.fragment4, 0, this.fragment4.Length);
322stream.Write(digestMethodBytes, 0, digestMethodBytes.Length);
323stream.Write(this.fragment5, 0, this.fragment5.Length);
325stream.Write(this.fragment6, 0, this.fragment6.Length);
328stream.Write(this.fragment7, 0, this.fragment7.Length);
System\IdentityModel\RijndaelCryptoServiceProvider.cs (26)
66if (rgbKey.Length != 16 && rgbKey.Length != 24 && rgbKey.Length != 32)
67throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.AESKeyLengthNotSupported, rgbKey.Length * 8)));
68if (rgbIV.Length != 16)
69throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.AESIVLengthNotSupported, rgbIV.Length * 8)));
86int cbData = PLAINTEXTKEYBLOBHEADER.SizeOf + rgbKey.Length;
88Buffer.BlockCopy(rgbKey, 0, pbData, PLAINTEXTKEYBLOBHEADER.SizeOf, rgbKey.Length);
95if (rgbKey.Length == 16)
97else if (rgbKey.Length == 24)
101pbhdr->keyLength = rgbKey.Length;
178if ((inputBuffer.Length - inputCount) < inputOffset)
179throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("inputOffset", SR.GetString(SR.ValueMustBeInRange, 0, inputBuffer.Length - inputCount - 1)));
180if (outputBuffer.Length < outputOffset)
181throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("outputOffset", SR.GetString(SR.ValueMustBeInRange, 0, outputBuffer.Length - 1)));
208int dwCount = DecryptData(this.depadBuffer, 0, this.depadBuffer.Length, outputBuffer, outputOffset, false);
226if ((inputBuffer.Length - inputCount) < inputOffset)
227throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("inputOffset", SR.GetString(SR.ValueMustBeInRange, 0, inputBuffer.Length - inputCount - 1)));
260byte[] outputBuffer = new byte[this.depadBuffer.Length + inputCount];
262int dwCount = DecryptData(this.depadBuffer, 0, this.depadBuffer.Length, outputBuffer, 0, false);
272if ((outputBuffer.Length - outputOffset) < inputCount)
273throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("outputBuffer", SR.GetString(SR.AESInsufficientOutputBuffer, outputBuffer.Length - outputOffset, inputCount)));
289ThrowIfFalse(SR.AESCryptEncryptFailed, NativeMethods.CryptEncrypt(keyHandle, IntPtr.Zero, final, 0, tempBufferPtr, ref dwCount, tempBuffer.Length - tempOffset));
344if (tempBuffer.Length >= (tempOffset + requiredSize))
362if (len == buffer.Length)
369Array.Clear(buffer, 0, buffer.Length);
System\IdentityModel\RsaEncryptionCookieTransform.cs (22)
148if (0 == encoded.Length)
180if (encryptedKeyAndIVSize > encoded.Length)
194if (encryptedDataSize > encoded.Length)
231if (decryptedKeyAndIV.Length < decryptionKey.Length)
233throw DiagnosticUtility.ThrowHelperInvalidOperation(SR.GetString(SR.ID6047, decryptedKeyAndIV.Length, decryptionKey.Length));
236byte[] decryptionIV = new byte[decryptedKeyAndIV.Length - decryptionKey.Length];
242Array.Copy(decryptedKeyAndIV, decryptionKey, decryptionKey.Length);
243Array.Copy(decryptedKeyAndIV, decryptionKey.Length, decryptionIV, 0, decryptionIV.Length);
247return decryptor.TransformFinalBlock(encryptedData, 0, encryptedData.Length);
268if (0 == value.Length)
296encryptedData = encryptor.TransformFinalBlock(value, 0, value.Length);
309byte[] keyAndIV = new byte[encryptionAlgorithm.Key.Length + encryptionAlgorithm.IV.Length];
310Array.Copy(encryptionAlgorithm.Key, keyAndIV, encryptionAlgorithm.Key.Length);
311Array.Copy(encryptionAlgorithm.IV, 0, keyAndIV, encryptionAlgorithm.Key.Length, encryptionAlgorithm.IV.Length);
321bw.Write(encryptedKeyAndIV.Length);
323bw.Write(encryptedData.Length);
System\IdentityModel\RsaSignatureCookieTransform.cs (17)
144if (0 == encoded.Length)
160if (encoded.Length < sizeof(Int32))
171if (signatureLength >= encoded.Length - sizeof(Int32))
179Array.Copy(encoded, currentIndex, signature, 0, signature.Length);
180currentIndex += signature.Length;
183byte[] cookieValue = new byte[encoded.Length - currentIndex];
184Array.Copy(encoded, currentIndex, cookieValue, 0, cookieValue.Length);
239if (0 == value.Length)
287byte[] signatureLength = BitConverter.GetBytes(signature.Length);
291byte[] message = new byte[signatureLength.Length + signature.Length + value.Length];
294Array.Copy(signatureLength, 0, message, currentIndex, signatureLength.Length);
295currentIndex += signatureLength.Length;
298Array.Copy(signature, 0, message, currentIndex, signature.Length);
299currentIndex += signature.Length;
302Array.Copy(value, 0, message, currentIndex, value.Length);
System\IdentityModel\SecurityUtils.cs (13)
81return CloneBuffer(buffer, 0, buffer.Length);
88DiagnosticUtility.DebugAssert(buffer.Length - offset >= len, "Invalid parameters to CloneBuffer.");
137if (src == null || srcOffset >= src.Length)
139if (dst == null || dstOffset >= dst.Length)
141if ((src.Length - srcOffset) != (dst.Length - dstOffset))
144for (int i = srcOffset, j = dstOffset; i < src.Length; i++, j++)
477while (read < buffer.Length)
479int actual = reader.ReadContentAsBase64(buffer, read, buffer.Length - read);
487if (read < buffer.Length)
495Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length);
496offset += buffers[i].Length;
525certificate = (rawData == null || rawData.Length == 0) ? null : new X509Certificate2(rawData);
System\IdentityModel\Selectors\X509SecurityTokenAuthenticator.cs (11)
145pSourceName = SafeHGlobalHandle.AllocHGlobal(NativeMethods.LsaSourceName.Length + 1);
146Marshal.Copy(NativeMethods.LsaSourceName, 0, pSourceName.DangerousGetHandle(), NativeMethods.LsaSourceName.Length);
147UNICODE_INTPTR_STRING sourceName = new UNICODE_INTPTR_STRING(NativeMethods.LsaSourceName.Length, NativeMethods.LsaSourceName.Length + 1, pSourceName.DangerousGetHandle());
201pPackageName = SafeHGlobalHandle.AllocHGlobal(NativeMethods.LsaKerberosName.Length + 1);
202Marshal.Copy(NativeMethods.LsaKerberosName, 0, pPackageName.DangerousGetHandle(), NativeMethods.LsaKerberosName.Length);
203UNICODE_INTPTR_STRING packageName = new UNICODE_INTPTR_STRING(NativeMethods.LsaKerberosName.Length, NativeMethods.LsaKerberosName.Length + 1, pPackageName.DangerousGetHandle());
226int logonInfoSize = KERB_CERTIFICATE_S4U_LOGON.Size + certRawData.Length;
235pInfo->CertificateLength = (uint)certRawData.Length;
237Marshal.Copy(certRawData, 0, pInfo->Certificate, certRawData.Length);
System\IdentityModel\Tokens\DEREncoding.cs (19)
66if (length > arrayOne.Length - offsetOne)
71if (length > arrayTwo.Length - offsetTwo)
134WriteLength(buffer, ref offset, ref len, 1 + LengthSize(mech.Length) + mech.Length + type.Length + bodySize);
139WriteLength(buffer, ref offset, ref len, mech.Length);
141System.Buffer.BlockCopy(mech, 0, buffer, offset, mech.Length);
142offset += mech.Length;
143len -= mech.Length;
145System.Buffer.BlockCopy(type, 0, buffer, offset, type.Length);
146offset += type.Length;
147len -= type.Length;
212bodySize += 2 + mech.Length + LengthSize(mech.Length) + 1;
260if ((oidLength & 0x7fffffff) != mech.Length)
272if (!BufferIsEqual(mech, 0, buffer, offset, mech.Length))
280if ((len -= type.Length) < 0)
286if (!BufferIsEqual(type, 0, buffer, offset, type.Length))
292offset += type.Length;
System\IdentityModel\Tokens\SessionSecurityToken.cs (8)
341if (null == cookie || 0 == cookie.Length)
351using (XmlDictionaryReader reader = XmlDictionaryReader.CreateBinaryReader(cookie, 0, cookie.Length, dictionary, XmlDictionaryReaderQuotas.Max, null, null))
739dicWriter.WriteBase64(key, 0, key.Length);
1367dictionaryWriter.WriteBase64(bootstrapArray, 0, bootstrapArray.Length);
1540writer.WriteBase64(rawData, 0, rawData.Length);
1549writer.WriteBase64(thumbprint, 0, thumbprint.Length);
1595writer.WriteBase64(hash, 0, hash.Length);
1757writer.WriteBase64(sidBytes, 0, sidBytes.Length);
System\IdentityModel\Tokens\WSSecurityJan2004.cs (6)
391writer.WriteBase64(keyIdentifier, 0, keyIdentifier.Length);
395writer.WriteBinHex(keyIdentifier, 0, keyIdentifier.Length);
399writer.WriteString(new UTF8Encoding().GetString(keyIdentifier, 0, keyIdentifier.Length));
440writer.WriteBase64(keyIdentifier, 0, keyIdentifier.Length);
444writer.WriteBinHex(keyIdentifier, 0, keyIdentifier.Length);
448writer.WriteString(new UTF8Encoding().GetString(keyIdentifier, 0, keyIdentifier.Length));
System\ServiceModel\Activation\Utility.cs (4)
93if (!ListenerUnsafeNativeMethods.GetTokenInformation(token, tic, tokenInformation, tokenInformation.Length, out lengthNeeded))
218success = ListenerUnsafeNativeMethods.AdjustTokenPrivileges(token, false, pTP, tokenInformation.Length, IntPtr.Zero, IntPtr.Zero);
253success = ListenerUnsafeNativeMethods.GetKernelObjectSecurity(kernelObject, ListenerUnsafeNativeMethods.DACL_SECURITY_INFORMATION, pSecurityDescriptor, pSecurityDescriptor.Length, out lpnLengthNeeded);
423success = ListenerUnsafeNativeMethods.QueryServiceStatusEx(service, ListenerUnsafeNativeMethods.SC_STATUS_PROCESS_INFO, serviceStatusProcess, serviceStatusProcess.Length, out lpnLengthNeeded);
System\ServiceModel\Channels\FramingChannels.cs (16)
67Connection.Write(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length, true, timeout);
96return this.Connection.BeginWrite(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length,
208int startSize = ClientDuplexEncoder.ModeBytes.Length + SessionEncoder.CalcStartSize(encodedVia, encodedContentType);
213startSize += ClientDuplexEncoder.PreambleEndBytes.Length;
217Buffer.BlockCopy(ClientDuplexEncoder.ModeBytes, 0, startBytes, 0, ClientDuplexEncoder.ModeBytes.Length);
218SessionEncoder.EncodeStart(startBytes, ClientDuplexEncoder.ModeBytes.Length, encodedVia, encodedContentType);
221Buffer.BlockCopy(ClientDuplexEncoder.PreambleEndBytes, 0, startBytes, preambleEndOffset, ClientDuplexEncoder.PreambleEndBytes.Length);
281ClientDuplexEncoder.PreambleEndBytes.Length, true, timeoutHelper.RemainingTime());
285int ackBytesRead = connection.Read(ackBuffer, 0, ackBuffer.Length, timeoutHelper.RemainingTime());
585ClientDuplexEncoder.PreambleEndBytes, 0, ClientDuplexEncoder.PreambleEndBytes.Length, true,
958int size = connection.Read(faultBuffer, offset, faultBuffer.Length, timeoutHelper.RemainingTime());
981size = connection.Read(faultBuffer, offset, faultBuffer.Length, timeoutHelper.RemainingTime());
1012connection.Write(encodedUpgrade.EncodedBytes, 0, encodedUpgrade.EncodedBytes.Length, true, timeoutHelper.RemainingTime());
1016int size = connection.Read(buffer, 0, buffer.Length, timeoutHelper.RemainingTime());
1237encodedUpgrade.EncodedBytes, 0, encodedUpgrade.EncodedBytes.Length, true, timeoutHelper.RemainingTime(),
1259if (connection.BeginRead(0, ServerSessionEncoder.UpgradeResponseBytes.Length, timeoutHelper.RemainingTime(),
System\ServiceModel\Channels\FramingEncoders.cs (20)
79(encodedBytes[encodedBytes.Length / 2] << 8) |
80encodedBytes[encodedBytes.Length - 1];
97if (this.encodedBytes.Length != otherBytes.Length)
100for (int i = 0; i < encodedBytes.Length; i++)
208return via.EncodedBytes.Length + contentType.EncodedBytes.Length;
213Buffer.BlockCopy(via.EncodedBytes, 0, buffer, offset, via.EncodedBytes.Length);
214Buffer.BlockCopy(contentType.EncodedBytes, 0, buffer, offset + via.EncodedBytes.Length, contentType.EncodedBytes.Length);
342return via.EncodedBytes.Length + contentType.EncodedBytes.Length;
347Buffer.BlockCopy(via.EncodedBytes, 0, buffer, offset, via.EncodedBytes.Length);
348Buffer.BlockCopy(contentType.EncodedBytes, 0, buffer, offset + via.EncodedBytes.Length, contentType.EncodedBytes.Length);
378return via.EncodedBytes.Length + contentType.EncodedBytes.Length;
383Buffer.BlockCopy(via.EncodedBytes, 0, buffer, offset, via.EncodedBytes.Length);
384Buffer.BlockCopy(contentType.EncodedBytes, 0, buffer, offset + via.EncodedBytes.Length, contentType.EncodedBytes.Length);
System\ServiceModel\Channels\MsmqOutputChannel.cs (8)
28this.preamble = DiagnosticUtility.Utility.AllocateByteArray(modeBytes.Length + ClientSingletonSizedEncoder.CalcStartSize(encodedVia, encodedContentType));
30Buffer.BlockCopy(modeBytes, 0, this.preamble, 0, modeBytes.Length);
31ClientSingletonSizedEncoder.EncodeStart(this.preamble, modeBytes.Length, encodedVia, encodedContentType);
144message, int.MaxValue, this.factory.BufferManager, preamble.Length);
145Buffer.BlockCopy(preamble, 0, messageData.Array, messageData.Offset - preamble.Length, preamble.Length);
148int offset = messageData.Offset - preamble.Length;
149int size = messageData.Count + preamble.Length;
System\ServiceModel\Channels\MsmqOutputSessionChannel.cs (7)
230int startSize = ClientSimplexEncoder.ModeBytes.Length
232+ ClientSimplexEncoder.PreambleEndBytes.Length;
234Buffer.BlockCopy(ClientSimplexEncoder.ModeBytes, 0, startBytes, 0, ClientSimplexEncoder.ModeBytes.Length);
235SessionEncoder.EncodeStart(startBytes, ClientSimplexEncoder.ModeBytes.Length, encodedVia, encodedContentType);
236Buffer.BlockCopy(ClientSimplexEncoder.PreambleEndBytes, 0, startBytes, startSize - ClientSimplexEncoder.PreambleEndBytes.Length, ClientSimplexEncoder.PreambleEndBytes.Length);
243return new ArraySegment<byte>(SessionEncoder.EndBytes, 0, SessionEncoder.EndBytes.Length);
System\ServiceModel\Channels\SequenceRangeCollection.cs (19)
36if (sortedRanges.Length == 0)
40else if (sortedRanges.Length == 1)
52if (sortedRanges.Length == 0)
59if (sortedRanges.Length == 1)
89if (lowerBound == sortedRanges.Length)
91SequenceRange[] returnedRanges = new SequenceRange[sortedRanges.Length + 1];
92Array.Copy(sortedRanges, returnedRanges, sortedRanges.Length);
93returnedRanges[sortedRanges.Length] = range;
100if (sortedRanges.Length == 1)
127if ((upperBound == sortedRanges.Length) || (sortedRanges[upperBound].Lower != range.Upper + 1))
134SequenceRange[] returnedRanges = new SequenceRange[sortedRanges.Length + 1];
135Array.Copy(sortedRanges, 0, returnedRanges, 1, sortedRanges.Length);
145int rangesRemaining = sortedRanges.Length - rangesRemoved + 1;
155Array.Copy(sortedRanges, upperBound + 1, returnedRanges, lowerBound + 1, sortedRanges.Length - upperBound - 1);
224if (index < 0 || index >= ranges.Length)
226SR.GetString(SR.ValueMustBeInRange, 0, ranges.Length - 1)));
235return this.ranges.Length;
241if (this.ranges.Length == 0)
245else if (this.ranges.Length == 1)
System\ServiceModel\Channels\SessionConnectionReader.cs (12)
158if (Connection.BeginRead(0, connectionBuffer.Length, GetRemainingTimeout(), readCallback, this)
429size = Connection.Read(connectionBuffer, 0, connectionBuffer.Length, timeoutHelper.RemainingTime());
445Connection.Write(ServerSessionEncoder.UpgradeResponseBytes, 0, ServerSessionEncoder.UpgradeResponseBytes.Length, true, timeoutHelper.RemainingTime());
481ServerSessionEncoder.AckResponseBytes.Length, true, timeoutHelper.RemainingTime());
721if (channel.Connection.BeginRead(0, channel.connectionBuffer.Length, timeoutHelper.RemainingTime(),
745ServerSessionEncoder.UpgradeResponseBytes, 0, ServerSessionEncoder.UpgradeResponseBytes.Length,
770ServerSessionEncoder.AckResponseBytes.Length, true, timeoutHelper.RemainingTime(),
1251connection.BeginRead(0, buffer.Length, readTimeoutHelper.RemainingTime(), onAsyncReadComplete, null);
1323(EnvelopeSize - EnvelopeOffset) >= buffer.Length)
1325bytesRead = connection.Read(EnvelopeBuffer, EnvelopeOffset, buffer.Length, timeoutHelper.RemainingTime());
1330bytesRead = connection.Read(buffer, 0, buffer.Length, timeoutHelper.RemainingTime());
1461if (connection.BeginRead(0, buffer.Length, this.readTimeoutHelper.RemainingTime(),
System\ServiceModel\Channels\SingletonConnectionReader.cs (23)
129if (Connection.BeginRead(0, connectionBuffer.Length, GetRemainingTimeout(),
418return this.currentConnection.BeginRead(0, this.ConnectionBuffer.Length, timeoutHelper.RemainingTime(), onReadCompleted, this) == AsyncCompletionResult.Completed;
489if (this.currentConnection.BeginWrite(ServerSingletonEncoder.UpgradeResponseBytes, 0, ServerSingletonEncoder.UpgradeResponseBytes.Length,
561if (this.currentConnection.BeginWrite(ServerSessionEncoder.AckResponseBytes, 0, ServerSessionEncoder.AckResponseBytes.Length,
1011this.Connection.Write(SingletonEncoder.EndBytes, 0, SingletonEncoder.EndBytes.Length, true, timeoutHelper.RemainingTime());
1134int bytesRead = this.inputStream.Read(dummy, 0, dummy.Length);
1214size = connection.Read(buffer, 0, buffer.Length, timeoutHelper.RemainingTime());
1433Fx.Assert(size <= this.chunkBuffer.Length, "");
1545this.chunkBufferSize = ReadCore(this.chunkBuffer, 0, this.chunkBuffer.Length);
1633connection.Write(envelopeStartBytes, 0, envelopeStartBytes.Length, false, timeoutHelper.RemainingTime());
1641int.MaxValue, settings.BufferManager, envelopeStartBytes.Length + IntEncoder.MaxEncodedSize);
1643Buffer.BlockCopy(envelopeStartBytes, 0, messageData.Array, messageData.Offset - envelopeStartBytes.Length,
1644envelopeStartBytes.Length);
1645connection.Write(messageData.Array, messageData.Offset - envelopeStartBytes.Length,
1646messageData.Count + envelopeStartBytes.Length, true, timeoutHelper.RemainingTime(), settings.BufferManager);
1656connection.Write(endBytes, 0, endBytes.Length,
1773AsyncCompletionResult writeStartBytesResult = connection.BeginWrite(envelopeStartBytes, 0, envelopeStartBytes.Length, true,
1788int.MaxValue, this.bufferManager, envelopeStartBytes.Length + IntEncoder.MaxEncodedSize);
1791Buffer.BlockCopy(envelopeStartBytes, 0, messageData.Array, messageData.Offset - envelopeStartBytes.Length,
1792envelopeStartBytes.Length);
1799connection.BeginWrite(messageData.Array, messageData.Offset - envelopeStartBytes.Length,
1800messageData.Count + envelopeStartBytes.Length, true, timeoutHelper.RemainingTime(),
1862endBytes.Length, true, timeoutHelper.RemainingTime(), onWriteEndBytes, this);
System\ServiceModel\Channels\StreamedFramingRequestChannel.cs (10)
59int startSize = ClientSingletonEncoder.ModeBytes.Length + ClientSingletonEncoder.CalcStartSize(encodedVia, encodedContentType);
64startSize += ClientDuplexEncoder.PreambleEndBytes.Length;
67Buffer.BlockCopy(ClientSingletonEncoder.ModeBytes, 0, startBytes, 0, ClientSingletonEncoder.ModeBytes.Length);
68ClientSingletonEncoder.EncodeStart(this.startBytes, ClientSingletonEncoder.ModeBytes.Length, encodedVia, encodedContentType);
71Buffer.BlockCopy(ClientSingletonEncoder.PreambleEndBytes, 0, startBytes, preambleEndOffset, ClientSingletonEncoder.PreambleEndBytes.Length);
91connection.Write(Preamble, 0, Preamble.Length, true, timeoutHelper.RemainingTime());
113ClientSingletonEncoder.PreambleEndBytes.Length, true, timeoutHelper.RemainingTime());
122int ackBytesRead = connection.Read(ackBuffer, 0, ackBuffer.Length, timeoutHelper.RemainingTime());
223AsyncCompletionResult writePreambleResult = connection.BeginWrite(channel.Preamble, 0, channel.Preamble.Length,
290ClientSingletonEncoder.PreambleEndBytes, 0, ClientSingletonEncoder.PreambleEndBytes.Length, true,
System\ServiceModel\Dispatcher\PrimitiveOperationFormatter.cs (18)
561if (parts.Length != parameters.Length)
563new ArgumentException(SR.GetString(SR.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters"));
568for (int i = nextPartIndex; i < parts.Length; i++)
627if (parts.Length != parameters.Length)
629new ArgumentException(SR.GetString(SR.SFxParameterCountMismatch, "parts", parts.Length, "parameters", parameters.Length), "parameters"));
632for (int i = 0; i < parts.Length; i++)
856writer.WriteBase64(arrayValue, 0, arrayValue.Length);
862writer.WriteArray(null, itemName, itemNamespace, arrayValue, 0, arrayValue.Length);
868writer.WriteArray(null, itemName, itemNamespace, arrayValue, 0, arrayValue.Length);
874writer.WriteArray(null, itemName, itemNamespace, arrayValue, 0, arrayValue.Length);
880writer.WriteArray(null, itemName, itemNamespace, arrayValue, 0, arrayValue.Length);
886writer.WriteArray(null, itemName, itemNamespace, arrayValue, 0, arrayValue.Length);
892writer.WriteArray(null, itemName, itemNamespace, arrayValue, 0, arrayValue.Length);
898writer.WriteArray(null, itemName, itemNamespace, arrayValue, 0, arrayValue.Length);
System\ServiceModel\Security\CryptoHelper.cs (19)
140if (count < 0 || count > cipherText.Length)
142throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", SR.GetString(SR.ValueMustBeInRange, 0, cipherText.Length)));
145if (offset < 0 || offset > cipherText.Length - count)
147throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", SR.GetString(SR.ValueMustBeInRange, 0, cipherText.Length - count)));
152Buffer.BlockCopy(cipherText, offset, iv, 0, iv.Length);
159return decrTransform.TransformFinalBlock(cipherText, offset + iv.Length, count - iv.Length);
234byte[] output = DiagnosticUtility.Utility.AllocateByteArray(checked(iv.Length + cipherText.Length));
235Buffer.BlockCopy(iv, 0, output, 0, iv.Length);
236Buffer.BlockCopy(cipherText, 0, output, iv.Length, cipherText.Length);
255if (a == null || b == null || a.Length != b.Length)
260for (int i = 0; i < a.Length; i++)
335if (count < 0 || count > buffer.Length)
337throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("count", SR.GetString(SR.ValueMustBeInRange, 0, buffer.Length)));
339if (offset < 0 || offset > buffer.Length - count)
341throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentOutOfRangeException("offset", SR.GetString(SR.ValueMustBeInRange, 0, buffer.Length - count)));
System\ServiceModel\Security\DataProtectionSecurityStateEncoder.cs (5)
34this.entropy = DiagnosticUtility.Utility.AllocateByteArray(entropy.Length);
35Buffer.BlockCopy(entropy, 0, this.entropy, 0, entropy.Length);
52result = DiagnosticUtility.Utility.AllocateByteArray(this.entropy.Length);
53Buffer.BlockCopy(this.entropy, 0, result, 0, this.entropy.Length);
63result.AppendFormat("{0} Entropy Length={1}", Environment.NewLine, (this.entropy == null) ? 0 : this.entropy.Length);
System\ServiceModel\Security\SctClaimSerializer.cs (5)
28writer.WriteBase64(sidBytes, 0, sidBytes.Length);
86writer.WriteBase64(rawData, 0, rawData.Length);
95writer.WriteBase64(thumbprint, 0, thumbprint.Length);
141writer.WriteBase64(hash, 0, hash.Length);
183writer.WriteBase64(rawData, 0, rawData.Length);
System\ServiceModel\Security\SecurityUtils.cs (13)
198for (int i = 0; i < TokenImpersonationLevelOrder.Length; i++)
691while (read < buffer.Length)
693int actual = reader.ReadContentAsBase64(buffer, read, buffer.Length - read);
701if (read < buffer.Length)
709Buffer.BlockCopy(buffers[i], 0, buffer, offset, buffers[i].Length);
710offset += buffers[i].Length;
1458if (partsWithSlashDelimiter.Length == 2 && partsWithAtDelimiter.Length == 1)
1465else if (partsWithSlashDelimiter.Length == 1 && partsWithAtDelimiter.Length == 2)
2134byte[] copy = DiagnosticUtility.Utility.AllocateByteArray(buffer.Length);
2135Buffer.BlockCopy(buffer, 0, copy, 0, buffer.Length);
2365certificate = (rawData == null || rawData.Length == 0) ? null : new X509Certificate2(rawData);
System\ServiceModel\Security\TlsSspiNegotiation.cs (10)
334byte[] dataBuffer = DiagnosticUtility.Utility.AllocateByteArray(encryptedContent.Length);
336Buffer.BlockCopy(encryptedContent, 0, dataBuffer, 0, encryptedContent.Length);
356byte[] buffer = DiagnosticUtility.Utility.AllocateByteArray(checked(input.Length + StreamSizes.header + StreamSizes.trailer));
358Buffer.BlockCopy(input, 0, buffer, StreamSizes.header, input.Length);
362this.EncryptInPlace(buffer, 0, input.Length, out encryptedSize);
363if (encryptedSize == buffer.Length)
477securityBuffer[0] = new SecurityBuffer(encryptedContent, 0, encryptedContent.Length, BufferType.Data);
488for (int i = 0; i < securityBuffer.Length; ++i)
507if (bufferStartOffset + dataLen + StreamSizes.header + StreamSizes.trailer > buffer.Length)
528for (int i = 0; i < securityBuffer.Length; ++i)
System\ServiceModel\Security\WindowsSspiNegotiation.cs (11)
257securityBuffer[0] = new SecurityBuffer(encryptedContent, 0, encryptedContent.Length, BufferType.Stream);
265for (int i = 0; i < securityBuffer.Length; ++i)
290securityBuffer[0] = new SecurityBuffer(tokenBuffer, 0, tokenBuffer.Length, BufferType.Token);
291byte[] dataBuffer = DiagnosticUtility.Utility.AllocateByteArray(input.Length);
292Buffer.BlockCopy(input, 0, dataBuffer, 0, input.Length);
293securityBuffer[1] = new SecurityBuffer(dataBuffer, 0, dataBuffer.Length, BufferType.Data);
295securityBuffer[2] = new SecurityBuffer(paddingBuffer, 0, paddingBuffer.Length, BufferType.Padding);
305for (int i = 0; i < securityBuffer.Length; ++i)
312byte[] encryptedData = DiagnosticUtility.Utility.AllocateByteArray(checked(tokenLen + dataBuffer.Length + paddingLen));
315Buffer.BlockCopy(dataBuffer, 0, encryptedData, tokenLen, dataBuffer.Length);
316Buffer.BlockCopy(paddingBuffer, 0, encryptedData, tokenLen + dataBuffer.Length, paddingLen);
System\ServiceModel\Security\WSUtilitySpecificationVersion.cs (6)
138writer.WriteChars(creationTime, 0, creationTime.Length);
143writer.WriteChars(expiryTime, 0, expiryTime.Length);
194stream.Write(this.fragment1, 0, this.fragment1.Length);
196stream.Write(this.fragment2, 0, this.fragment2.Length);
198stream.Write(this.fragment3, 0, this.fragment3.Length);
200stream.Write(this.fragment4, 0, this.fragment4.Length);
System\ServiceModel\Transactions\WsatProxy.cs (6)
382byte[] tokenCopy = new byte[fixedPropagationToken.Length];
383Array.Copy(fixedPropagationToken, tokenCopy, fixedPropagationToken.Length);
418Array.Copy(transactionIdBytes, 0, token, offsetof_guidTx, transactionIdBytes.Length);
422Array.Copy(isoLevelBytes, 0, token, offsetof_isoLevel, isoLevelBytes.Length);
426Array.Copy(isoFlagsBytes, 0, token, offsetof_isoFlags, isoFlagsBytes.Length);
432int copyDescriptionBytes = Math.Min(descriptionBytes.Length, MaxDescriptionLength);
Configuration\MachineKeySection.cs (69)
515if (start != 0 || length != buf.Length) {
535length = buf.Length;
569cs.Write(iv, 0, iv.Length);
575cs.Write(modifier, 0, modifier.Length);
597int bDataLength = paddedData.Length - ivLength;
614if (!fEncrypt && modifier != null && modifier.Length > 0)
617if (!CryptoUtil.BuffersAreEqual(bData, bData.Length - modifier.Length, modifier.Length, modifier, 0, modifier.Length)) {
621byte[] bData2 = new byte[bData.Length - modifier.Length];
622Buffer.BlockCopy(bData, 0, bData2, 0, bData2.Length);
631byte[] hmac = HashData(bData, null, 0, bData.Length);
632byte[] bData2 = new byte[bData.Length + hmac.Length];
634Buffer.BlockCopy(bData, 0, bData2, 0, bData.Length);
635Buffer.BlockCopy(hmac, 0, bData2, bData.Length, hmac.Length);
666int hr = UnsafeNativeMethods.GetSHA1Hash(hash, hash.Length, newHash, newHash.Length);
691if (validationKey.Length > _AutoGenValidationKeySize)
694int hr = UnsafeNativeMethods.GetSHA1Hash(validationKey, validationKey.Length, key, key.Length);
708for (i=0; i < validationKey.Length; i++) {
715if (start < 0 || start > buf.Length)
717if (length < 0 || buf == null || (start + length) > buf.Length)
721modifier, (modifier == null) ? 0 : modifier.Length,
722s_inner, s_inner.Length, s_outer, s_outer.Length,
723hash, hash.Length);
738hash = HashData(ab, null, 0, ab.Length);
746if (buf == null || buf.Length < 1)
748for (int iter = 0; iter < buf.Length; iter++)
798if (buf.Length - start - length >= bHash.Length)
801Buffer.BlockCopy(bHash, 0, buf, start + length, bHash.Length);
806returnBuffer = new byte[length + bHash.Length];
808Buffer.BlockCopy(bHash, 0, returnBuffer, length, bHash.Length);
811length += bHash.Length;
815length = returnBuffer.Length;
830if (buf == null || buf.Length < _HashSize)
832length = buf.Length;
839for (int iter = 0; iter < bHash.Length; iter++)
894if (dKey.Length == 8) {
908if (dKey.Length == 8) {
937if (dKey.Length > 8 && symAlgo is DESCryptoServiceProvider) {
946symAlgo.IV = new byte[symAlgo.IV.Length];
981for (int i = ahexval.Length; --i >= 0; )
1002int n = result.Length;
1127_AutoGenValidationKeySize = ((KeyedHashAlgorithm) alg).Key.Length;
1142_HashSize = bHash.Length;
1146_AutoGenValidationKeySize = ((KeyedHashAlgorithm) alg).Key.Length;
1214int totalLength = length + validationKey.Length + ((modifier != null) ? modifier.Length : 0);
1219Buffer.BlockCopy(modifier, 0, bAll, length, modifier.Length);
1221Buffer.BlockCopy(validationKey, 0, bAll, length, validationKey.Length);
1226int hr = UnsafeNativeMethods.GetSHA1Hash(bAll, bAll.Length, newHash, newHash.Length);
1237int totalLength = length + ((modifier != null) ? modifier.Length : 0);
1242Buffer.BlockCopy(modifier, 0, bAll, length, modifier.Length);
1256byte[] buf2 = new byte[bufHashed.Length - _HashSize];
1257Buffer.BlockCopy(bufHashed, 0, buf2, 0, buf2.Length);
1270if (bufHashed.Length <= _HashSize)
1273byte[] bMac = HashData(bufHashed, null, 0, bufHashed.Length - _HashSize);
1277if (bMac == null || bMac.Length != _HashSize)
1279int lastPos = bufHashed.Length - _HashSize;
1300if (dKey.Length <= 24)
1303Buffer.BlockCopy(dKey, 0, buf, 0, buf.Length);
FileChangesMonitor.cs (9)
107int result = a.Length - b.Length;
108for (int i = 0; result == 0 && i < a.Length ; i++) {
164int fOK = UnsafeNativeMethods.GetFileSecurity(filename, DACL_INFORMATION, dacl, dacl.Length, ref lengthNeeded);
187fOK = UnsafeNativeMethods.GetFileSecurity(filename, DACL_INFORMATION, dacl, dacl.Length, ref lengthNeeded);
203Debug.Trace("GetDacl", "Interning new dacl, length " + dacl.Length);
210Debug.Trace("GetDacl", "Returning dacl, length " + dacl.Length);
946for (int i = 0; i < FileChangesMonitor.s_dirsToMonitor.Length; i++) {
1936for (int i=0; i<s_dirsToMonitor.Length; i++) {
Hosting\ISAPIWorkerRequest.cs (47)
55if (array != null && array.Length == ARRAY_SIZE)
60if (array != null && array.Length == ARRAY_SIZE)
98_size = _charBuffer.Length;
249int l = _byteBuffer.Length;
268int l = _byteBuffer.Length;
292len = _charBuffer.Length;
573return _charBuffer.Length;
692int r = GetBasicsCore(buf.Buffer, buf.Buffer.Length, contentInfo);
696r = GetBasicsCore(buf.Buffer, buf.Buffer.Length, contentInfo);
1024if (basicStrings == null || basicStrings.Length != 6)
1220if (buffer.Length - offset < size) {
1264int n = _unknownRequestHeaders.Length;
1571if (pInts[1] < buf.Length && pInts[1] > 0) {
1575if (pInts[2] + pInts[1] < buf.Length && pInts[2] > 0) {
1580if (pInts[2] + pInts[1] + pInts[3] < buf.Length && pInts[3] > 0) {
1758return UnsafeNativeMethods.EcbGetClientCertificate(_ecb, buffer, buffer.Length, pInts, pDates);
1844int retVal = UnsafeNativeMethods.EcbGetServerVariable(_ecb, name, buf.Buffer, buf.Buffer.Length);
1848retVal = UnsafeNativeMethods.EcbGetServerVariable(_ecb, name, buf.Buffer, buf.Buffer.Length);
1871for(int i = 0; i < _additionalServerVars.Length; i++) {
1876int retVal = UnsafeNativeMethods.EcbGetServerVariableByIndex(_ecb, nameIndex, buf.Buffer, buf.Buffer.Length);
1880retVal = UnsafeNativeMethods.EcbGetServerVariableByIndex(_ecb, nameIndex, buf.Buffer, buf.Buffer.Length);
2008return UnsafeNativeMethods.EcbCallISAPI(_ecb, iFunction, bufIn, bufIn.Length, bufOut, bufOut.Length);
2168serverVarLengths, serverVarLengths.Length, 0, ref r);
2173serverVarLengths, serverVarLengths.Length, 0, ref r);
2180for(int i = 0; i < _basicServerVars.Length; i++) {
2214serverVarLengths, serverVarLengths.Length, NUM_BASIC_SERVER_VARIABLES, ref r);
2218serverVarLengths, serverVarLengths.Length, NUM_BASIC_SERVER_VARIABLES, ref r);
2224for(int i = 0; i < _additionalServerVars.Length; i++) {
2603if (buffer.Length - offset < count)
2702if (entity != null && entity.Length > 0) {
2703int ret = UnsafeNativeMethods.EcbGetExecUrlEntityInfo(entity.Length, entity, out _entity);
2838int r = UnsafeNativeMethods.PMGetAllServerVariables(_ecb, buf.Buffer, buf.Buffer.Length);
2842r = UnsafeNativeMethods.PMGetAllServerVariables(_ecb, buf.Buffer, buf.Buffer.Length);
2929byte[] buffer = new byte[4 + offsetBytes.Length + lengthBytes.Length + nameBytes.Length + 2];
2939Buffer.BlockCopy(offsetBytes, 0, buffer, 4, offsetBytes.Length);
2941Buffer.BlockCopy(lengthBytes, 0, buffer, 4 + offsetBytes.Length, lengthBytes.Length);
2943Buffer.BlockCopy(nameBytes, 0, buffer, 4 + offsetBytes.Length + lengthBytes.Length, nameBytes.Length);
2945return new MemoryBytes(buffer, buffer.Length, true, length);
3062return UnsafeNativeMethods.PMGetClientCertificate(_ecb, buffer, buffer.Length, pInts, pDates);
3080return UnsafeNativeMethods.PMCallISAPI(_ecb, iFunction, bufIn, bufIn.Length, bufOut, bufOut.Length);
HttpRuntime.cs (9)
1353byte[] bKeysRandom = new byte[s_autogenKeys.Length];
1354byte[] bKeysStored = new byte[s_autogenKeys.Length];
1364bKeysRandom, bKeysRandom.Length, bKeysStored, bKeysStored.Length) == 1);
1368Buffer.BlockCopy(bKeysStored, 0, s_autogenKeys, 0, s_autogenKeys.Length);
1370Buffer.BlockCopy(bKeysRandom, 0, s_autogenKeys, 0, s_autogenKeys.Length);
1631wr.SendResponseFromMemory(body, body.Length);
1654wr.SendResponseFromMemory(body, body.Length);
1741response.OutputStream.Write(appOfflineMessage, 0, appOfflineMessage.Length);
httpserverutility.cs (4)
1391return HttpEncoder.Current.UrlEncode(bytes, 0, bytes.Length, false /* alwaysCreateNewReturnValue */);
1401return UrlEncodeToBytes(bytes, 0, bytes.Length);
1457return UrlDecode(bytes, 0, bytes.Length, e);
1495return UrlDecodeToBytes(bytes, 0, (bytes != null) ? bytes.Length : 0);
Security\ADMembershipProvider.cs (6)
3405byte[] bAll = new byte[bSalt.Length + bIn.Length];
3406Buffer.BlockCopy(bSalt, 0, bAll, 0, bSalt.Length);
3407Buffer.BlockCopy(bIn, 0, bAll, bSalt.Length, bIn.Length);
3421return Encoding.Unicode.GetString(bAll, AD_SALT_SIZE_IN_BYTES, bAll.Length - AD_SALT_SIZE_IN_BYTES);
Security\CookieProtection.cs (10)
32int count = buf.Length;
39if (buf.Length >= count + bMac.Length)
41Buffer.BlockCopy (bMac, 0, buf, count, bMac.Length);
46buf = new byte[count + bMac.Length];
48Buffer.BlockCopy (bMac, 0, buf, count, bMac.Length);
50count += bMac.Length;
56count = buf.Length;
58if (count < buf.Length)
84buf = MachineKeySection.EncryptOrDecryptData (false, buf, null, 0, buf.Length);
Security\Cryptography\NetFXCryptoService.cs (6)
70memStream.Write(iv, 0, iv.Length);
78cryptoStream.Write(clearData, 0, clearData.Length);
97memStream.Write(signature, 0, signature.Length);
137int encryptedPayloadByteCount = protectedData.Length - ivByteCount - signatureByteCount;
151buffer2: computedSignature, buffer2Offset: 0, buffer2Count: computedSignature.Length)) {
162Buffer.BlockCopy(protectedData, 0, iv, 0, iv.Length);
Security\FormsAuthentication.cs (12)
148if (bBlob == null || bBlob.Length < 1)
157ticketLength = unprotectedData.Length;
167bBlob = MachineKeySection.EncryptOrDecryptData(false, bBlob, null, 0, bBlob.Length, false, false, IVType.Random);
172ticketLength = bBlob.Length;
267byte[] bMac = MachineKeySection.HashData(bBlob, null, 0, bBlob.Length);
270byte[] bAll = new byte[bMac.Length + bBlob.Length];
271Buffer.BlockCopy(bBlob, 0, bAll, 0, bBlob.Length);
272Buffer.BlockCopy(bMac, 0, bAll, bBlob.Length, bMac.Length);
281bBlob = MachineKeySection.EncryptOrDecryptData(true, bBlob, null, 0, bBlob.Length, false, false, IVType.Random);
852bData, bData.Length,
Security\MachineKey.cs (16)
41byte[] bHash = MachineKeySection.HashData(data, null, 0, data.Length);
42byte[] bAll = new byte[bHash.Length + data.Length];
43Buffer.BlockCopy(data, 0, bAll, 0, data.Length);
44Buffer.BlockCopy(bHash, 0, bAll, data.Length, bHash.Length);
51data = MachineKeySection.EncryptOrDecryptData(true, data, null, 0, data.Length, false, false, IVType.Random, !AppSettings.UseLegacyMachineKeyEncryption);
79if (data == null || data.Length < 1)
85data = MachineKeySection.EncryptOrDecryptData(false, data, null, 0, data.Length, false, false, IVType.Random, !AppSettings.UseLegacyMachineKeyEncryption);
93if (data.Length < MachineKeySection.HashSize)
96data = new byte[originalData.Length - MachineKeySection.HashSize];
97Buffer.BlockCopy(originalData, 0, data, 0, data.Length);
101byte[] bHash = MachineKeySection.HashData(data, null, 0, data.Length);
102if (bHash == null || bHash.Length != MachineKeySection.HashSize)
104for (int iter = 0; iter < bHash.Length; iter++) {
105if (bHash[iter] != originalData[data.Length + iter])
Security\SQLMembershipProvider.cs (21)
1914if (kha.Key.Length == bSalt.Length) {
1916} else if (kha.Key.Length < bSalt.Length) {
1917byte[] bKey = new byte[kha.Key.Length];
1918Buffer.BlockCopy(bSalt, 0, bKey, 0, bKey.Length);
1921byte[] bKey = new byte[kha.Key.Length];
1922for (int iter = 0; iter < bKey.Length; ) {
1923int len = Math.Min(bSalt.Length, bKey.Length - iter);
1932byte[] bAll = new byte[bSalt.Length + bIn.Length];
1933Buffer.BlockCopy(bSalt, 0, bAll, 0, bSalt.Length);
1934Buffer.BlockCopy(bIn, 0, bAll, bSalt.Length, bIn.Length);
1938byte[] bAll = new byte[bSalt.Length + bIn.Length];
1939Buffer.BlockCopy(bSalt, 0, bAll, 0, bSalt.Length);
1940Buffer.BlockCopy(bIn, 0, bAll, bSalt.Length, bIn.Length);
1962return Encoding.Unicode.GetString(bRet, SALT_SIZE, bRet.Length - SALT_SIZE);
UI\Page.cs (4)
1856clearData = MachineKeySection.EncryptOrDecryptData(fEncrypt: false, buf: protectedData, modifier: null, start: 0, length: protectedData.Length, useValidationSymAlgo: false, useLegacyMode: false, ivType: IVType.Hash);
1890if ((queryString == null) || (queryString.Length < 28)) {
1955int numNull = nullValues.Length;
2021protectedData = MachineKeySection.EncryptOrDecryptData(fEncrypt: true, buf: clearData, modifier: null, start: 0, length: clearData.Length, useValidationSymAlgo: false, useLegacyMode: false, ivType: IVType.Hash);
System\Xml\Core\XmlEncodedRawTextWriter.cs (12)
166bufBytes = new byte[ bufChars.Length ];
184if ( bom.Length != 0 ) {
185this.stream.Write( bom, 0, bom.Length );
614Debug.Assert( count >= 0 && index + count <= buffer.Length );
635Debug.Assert( count >= 0 && index + count <= buffer.Length );
783encoder.Convert( bufChars, startOffset, endOffset - startOffset, bufBytes, bufBytesUsed, bufBytes.Length - bufBytesUsed, false, out chEnc, out bEnc, out completed );
786if ( bufBytesUsed >= ( bufBytes.Length - 16 ) ) {
804encoder.Convert( bufChars, 1, 0, bufBytes, 0, bufBytes.Length, true, out chEnc, out bEnc, out completed );
1434if ( lastMarkPos + 1 == textContentMarks.Length ) {
1441Debug.Assert( lastMarkPos + 1 == textContentMarks.Length );
1442int[] newTextContentMarks = new int[ textContentMarks.Length * 2 ];
1443Array.Copy( textContentMarks, newTextContentMarks, textContentMarks.Length );
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (5)
434Debug.Assert( count >= 0 && index + count <= buffer.Length );
454Debug.Assert( count >= 0 && index + count <= buffer.Length );
555encoder.Convert( bufChars, startOffset, endOffset - startOffset, bufBytes, bufBytesUsed, bufBytes.Length - bufBytesUsed, false, out chEnc, out bEnc, out completed );
558if ( bufBytesUsed >= ( bufBytes.Length - 16 ) ) {
576encoder.Convert( bufChars, 1, 0, bufBytes, 0, bufBytes.Length, true, out chEnc, out bEnc, out completed );
System\Xml\Core\XmlTextReaderImpl.cs (39)
1526if ( buffer.Length - index < count ) {
1574if ( buffer.Length - index < count ) {
1621if ( buffer.Length - index < count ) {
1669if ( buffer.Length - index < count ) {
1727if ( buffer.Length - index < count ) {
2615bufferSize = ps.bytes.Length;
2629if ( ps.bytes == null || ps.bytes.Length < bufferSize ) {
2635if ( ps.chars == null || ps.chars.Length < bufferSize + 1 ) {
2641while ( ps.bytesUsed < 4 && ps.bytes.Length - ps.bytesUsed > 0 ) {
2642int read = stream.Read( ps.bytes, ps.bytesUsed, ps.bytes.Length - ps.bytesUsed );
2658int preambleLen = preamble.Length;
3084if ( ps.charsUsed == ps.chars.Length - 1 ) {
3090char[] newChars = new char[ ps.chars.Length * 2 ];
3091BlockCopyChars( ps.chars, 0, newChars, 0, ps.chars.Length );
3098if ( ps.bytes.Length - ps.bytesUsed < MaxByteSequenceLen ) {
3099byte[] newBytes = new byte[ ps.bytes.Length * 2 ];
3106charsRead = ps.chars.Length - ps.charsUsed - 1;
3112int charsLen = ps.chars.Length;
3130char[] newChars = new char[ ps.chars.Length * 2 ];
3131BlockCopyChars( ps.chars, 0, newChars, 0, ps.chars.Length );
3150charsRead = ps.chars.Length - ps.charsUsed - 1;
3156if ( ps.bytePos == ps.bytesUsed && ps.bytes.Length - ps.bytesUsed > 0 ) {
3157int read = ps.stream.Read( ps.bytes, ps.bytesUsed, ps.bytes.Length - ps.bytesUsed );
3176charsRead = ps.textReader.Read( ps.chars, ps.charsUsed, ps.chars.Length - ps.charsUsed - 1 );
3186Debug.Assert ( ps.charsUsed < ps.chars.Length );
3196Debug.Assert( maxCharsCount <= ps.chars.Length - ps.charsUsed - 1 );
4578if ( attrDuplSortingArray == null || attrDuplSortingArray.Length < attrCount ) {
6882Debug.Assert( nodeIndex < nodes.Length );
6883Debug.Assert( nodes[nodes.Length - 1] == null );
6894Debug.Assert( nodeIndex < nodes.Length );
6895if ( nodeIndex >= nodes.Length - 1 ) {
6896NodeData[] newNodes = new NodeData[nodes.Length * 2];
6897Array.Copy( nodes, 0, newNodes, 0, nodes.Length );
6900Debug.Assert( nodeIndex < nodes.Length );
7287else if ( parsingStatesStackTop + 1 == parsingStatesStack.Length ) {
7288ParsingState[] newParsingStateStack = new ParsingState[ parsingStatesStack.Length * 2 ];
7289Array.Copy( parsingStatesStack, 0, newParsingStateStack, 0, parsingStatesStack.Length );
7329if ( array.Length - index < count ) {
8526Debug.Assert(endPos < chars.Length);
System\Xml\Core\XmlTextReaderImplAsync.cs (25)
373if ( buffer.Length - index < count ) {
428if ( buffer.Length - index < count ) {
491if ( buffer.Length - index < count ) {
546if ( buffer.Length - index < count ) {
599if ( buffer.Length - index < count ) {
841bufferSize = ps.bytes.Length;
853if ( ps.bytes == null || ps.bytes.Length < bufferSize ) {
859if ( ps.chars == null || ps.chars.Length < bufferSize + 1 ) {
865while ( ps.bytesUsed < 4 && ps.bytes.Length - ps.bytesUsed > 0 ) {
866int read = await stream.ReadAsync( ps.bytes, ps.bytesUsed, ps.bytes.Length - ps.bytesUsed ).ConfigureAwait(false);
882int preambleLen = preamble.Length;
994if ( ps.charsUsed == ps.chars.Length - 1 ) {
1000char[] newChars = new char[ ps.chars.Length * 2 ];
1001BlockCopyChars( ps.chars, 0, newChars, 0, ps.chars.Length );
1008if ( ps.bytes.Length - ps.bytesUsed < MaxByteSequenceLen ) {
1009byte[] newBytes = new byte[ ps.bytes.Length * 2 ];
1016charsRead = ps.chars.Length - ps.charsUsed - 1;
1022int charsLen = ps.chars.Length;
1040char[] newChars = new char[ ps.chars.Length * 2 ];
1041BlockCopyChars( ps.chars, 0, newChars, 0, ps.chars.Length );
1060charsRead = ps.chars.Length - ps.charsUsed - 1;
1066if ( ps.bytePos == ps.bytesUsed && ps.bytes.Length - ps.bytesUsed > 0 ) {
1067int read = await ps.stream.ReadAsync( ps.bytes, ps.bytesUsed, ps.bytes.Length - ps.bytesUsed ).ConfigureAwait(false);
1086charsRead = await ps.textReader.ReadAsync( ps.chars, ps.charsUsed, ps.chars.Length - ps.charsUsed - 1 ).ConfigureAwait(false);
1096Debug.Assert ( ps.charsUsed < ps.chars.Length );
System\Xml\Core\XsdCachingReader.cs (8)
560Debug.Assert(attIndex <= attributeEvents.Length);
566if (attIndex >= attributeEvents.Length -1 ) { //reached capacity of array, Need to increase capacity to twice the initial
567ValidatingReaderNodeData[] newAttributeEvents = new ValidatingReaderNodeData[attributeEvents.Length * 2];
568Array.Copy(attributeEvents, 0, newAttributeEvents, 0, attributeEvents.Length);
580Debug.Assert(contentIndex <= contentEvents.Length);
587if (contentIndex >= contentEvents.Length -1 ) { //reached capacity of array, Need to increase capacity to twice the initial
588ValidatingReaderNodeData[] newContentEvents = new ValidatingReaderNodeData[contentEvents.Length * 2];
589Array.Copy(contentEvents, 0, newContentEvents, 0, contentEvents.Length);
System\Xml\Serialization\XmlSerializationWriter.cs (41)
325for (int i=0;i<xmlNodes.Length;i++){
351XmlCustomFormatter.WriteArrayBase64(w, (byte[])o, 0,((byte[])o).Length);
881XmlCustomFormatter.WriteArrayBase64(w, value, 0, value.Length);
897XmlCustomFormatter.WriteArrayBase64(w, value, 0, value.Length);
916XmlCustomFormatter.WriteArrayBase64(w, value, 0, value.Length);
1000XmlCustomFormatter.WriteArrayBase64(w, value, 0, value.Length);
1121int arrayLength = a.Length;
1493for (int i = 0; i < values.Length; i++) {
1644for (int i = 0; i < mapping.Members.Length; i++) {
1654for (int j = 0; j < mapping.Members.Length; j++) {
1690for (int i = 0; i < mapping.Members.Length; i++) {
1702for (int j = 0; j < mapping.Members.Length; j++) {
1728for (int j = 0; j < mapping.Members.Length; j++) {
1745if (isRpc && member.IsReturnValue && member.Elements.Length > 0) {
1772Writer.Write(mapping.Members.Length.ToString(CultureInfo.InvariantCulture));
1776WriteExtraMembers(mapping.Members.Length.ToString(CultureInfo.InvariantCulture), "pLength");
1853if (constants.Length > 0) {
1860for (int i = 0; i < constants.Length; i++) {
1877for (int i = 0; i < constants.Length; i++) {
1887for (int i = 0; i < constants.Length; i++) {
2120for (int i = 0; i < members.Length; i++) {
2153for (int i = 0; i < members.Length; i++) {
2158bool checkShouldPersist = m.CheckShouldPersist && (m.Elements.Length > 0 || m.Text != null);
2375!(elements.Length == 1 && elements[0].Mapping is ArrayMapping))
2383if (elements.Length == 0 && text == null) return;
2487int count = elements.Length + (text == null ? 0 : 1);
2510if (elements.Length == 0 && text == null) return;
2511if (elements.Length == 1 && text == null) {
2531for (int i = 0; i < elements.Length; i++) {
2589if (elements.Length - anyCount > 0) Writer.Write("else ");
2677if (elements.Length > 0) {
2697if (elements.Length > 0) {
3144for (int i = 0; i < members.Length; i++) {
3192for (int i = 0; i < choiceMapping.Constants.Length; i++) {
3269for (int i = 0; i < parameterTypes.Length; i++)
3432for (int i = 0; i < structMapping.Members.Length; i++) {
3451for (int i = 0; i < enumFields.Length; i++) {
3492for (int i = 0; i < memberInfos.Length; i++) {
3535for(int i=0;i<paramTypes.Length;i++){
3537if(i < (paramTypes.Length-1))
3593for(int i=0;i<args.Length;i++){
Base\MS\Internal\IO\Zip\ZipIOBlockManager.cs (19)
371int subBlockSize = (int)Math.Min((long)tempBuffer.Length, moveBlockSize - bytesMoved);
565Debug.Assert(checked(buffer.Length-offset) >= sizeof(Int16));
568Array.Copy(tempBuffer, 0, buffer, offset, tempBuffer.Length);
570return offset + tempBuffer.Length;
575Debug.Assert(checked(buffer.Length-offset) >= sizeof(Int32));
578Array.Copy(tempBuffer, 0, buffer, offset, tempBuffer.Length);
580return offset + tempBuffer.Length;
585Debug.Assert(checked(buffer.Length-offset) >= sizeof(Int64));
588Array.Copy(tempBuffer, 0, buffer, offset, tempBuffer.Length);
590return offset + tempBuffer.Length;
595Debug.Assert(checked(buffer.Length-offset) >= sizeof(UInt16));
598Array.Copy(tempBuffer, 0, buffer, offset, tempBuffer.Length);
600return offset + tempBuffer.Length;
605Debug.Assert(checked(buffer.Length-offset) >= sizeof(UInt32));
608Array.Copy(tempBuffer, 0, buffer, offset, tempBuffer.Length);
610return offset + tempBuffer.Length;
615Debug.Assert(checked(buffer.Length-offset) >= sizeof(UInt64));
618Array.Copy(tempBuffer, 0, buffer, offset, tempBuffer.Length);
620return offset + tempBuffer.Length;
Shared\MS\Utility\FrugalMap.cs (12)
1152if (_entries.Length > _count)
1158Entry[] destEntries = new Entry[_entries.Length + GROWTH];
1161Array.Copy(_entries, 0, destEntries, 0, _entries.Length);
1260for (int index = 0; index < _entries.Length; ++index)
1366if (_entries.Length > _count)
1372Entry[] destEntries = new Entry[_entries.Length + GROWTH];
1375Array.Copy(_entries, 0, destEntries, 0, _entries.Length);
1496for (int index = 0; index < _entries.Length; ++index)
1852if (_entries.Length > _count)
1858int size = _entries.Length;
1862Array.Copy(_entries, 0, destEntries, 0, _entries.Length);
1977for (int index = 0; index < _entries.Length; ++index)
Shared\MS\Win32\NativeMethodsCLR.cs (17)
6179get { return buffer.Length; }
6184IntPtr result = Marshal.AllocCoTaskMem(buffer.Length);
6185Marshal.Copy(buffer, 0, result, buffer.Length);
6193while (i < buffer.Length && buffer[i] != 0)
6198if (i < buffer.Length)
6208Marshal.Copy(ptr, buffer, 0, buffer.Length);
6215int count = Math.Min(bytes.Length, buffer.Length - offset);
6220if (offset < buffer.Length)
6243get { return buffer.Length; }
6248IntPtr result = Marshal.AllocCoTaskMem(buffer.Length * 2);
6249Marshal.Copy(buffer, 0, result, buffer.Length);
6257while (i < buffer.Length && buffer[i] != 0)
6262if (i < buffer.Length)
6271Marshal.Copy(ptr, buffer, 0, buffer.Length);
6277int count = Math.Min(s.Length, buffer.Length - offset);
6282if (offset < buffer.Length)