diff options
Diffstat (limited to 'mcs/class/referencesource/System.Core/System')
176 files changed, 2545 insertions, 402 deletions
diff --git a/mcs/class/referencesource/System.Core/System/Collections/Generic/HashSet.cs b/mcs/class/referencesource/System.Core/System/Collections/Generic/HashSet.cs index 889b638df36..95d4834c071 100644 --- a/mcs/class/referencesource/System.Core/System/Collections/Generic/HashSet.cs +++ b/mcs/class/referencesource/System.Core/System/Collections/Generic/HashSet.cs @@ -56,11 +56,11 @@ namespace System.Collections.Generic { [DebuggerDisplay("Count = {Count}")] [SuppressMessage("Microsoft.Naming","CA1710:IdentifiersShouldHaveCorrectSuffix", Justification="By design")] #if SILVERLIGHT - public class HashSet<T> : ICollection<T>, ISet<T> + public class HashSet<T> : ICollection<T>, ISet<T>, IReadOnlyCollection<T> #else [Serializable()] [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] - public class HashSet<T> : ICollection<T>, ISerializable, IDeserializationCallback, ISet<T> + public class HashSet<T> : ICollection<T>, ISerializable, IDeserializationCallback, ISet<T>, IReadOnlyCollection<T> #endif { @@ -303,7 +303,7 @@ namespace System.Collections.Generic { // need to serialize version to avoid problems with serializing while enumerating info.AddValue(VersionName, m_version); -#if FEATURE_RANDOMIZED_STRING_HASHING +#if FEATURE_RANDOMIZED_STRING_HASHING && !FEATURE_NETCORE info.AddValue(ComparerName, HashHelpers.GetEqualityComparerForSerialization(m_comparer), typeof(IEqualityComparer<T>)); #else info.AddValue(ComparerName, m_comparer, typeof(IEqualityComparer<T>)); @@ -962,14 +962,14 @@ namespace System.Collections.Generic { int hashCode = InternalGetHashCode(value); int bucket = hashCode % m_buckets.Length; -#if FEATURE_RANDOMIZED_STRING_HASHING +#if FEATURE_RANDOMIZED_STRING_HASHING && !FEATURE_NETCORE int collisionCount = 0; #endif for (int i = m_buckets[hashCode % m_buckets.Length] - 1; i >= 0; i = m_slots[i].next) { if (m_slots[i].hashCode == hashCode && m_comparer.Equals(m_slots[i].value, value)) { return false; } -#if FEATURE_RANDOMIZED_STRING_HASHING +#if FEATURE_RANDOMIZED_STRING_HASHING && !FEATURE_NETCORE collisionCount++; #endif } @@ -995,7 +995,7 @@ namespace System.Collections.Generic { m_count++; m_version++; -#if FEATURE_RANDOMIZED_STRING_HASHING +#if FEATURE_RANDOMIZED_STRING_HASHING && !FEATURE_NETCORE if(collisionCount > HashHelpers.HashCollisionThreshold && HashHelpers.IsWellKnownEqualityComparer(m_comparer)) { m_comparer = (IEqualityComparer<T>) HashHelpers.GetRandomizedEqualityComparer(m_comparer); SetCapacity(m_buckets.Length, true); diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs index 767fdd4cd85..cfe9bd24a40 100644 --- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs +++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventDescriptor.cs @@ -28,7 +28,7 @@ namespace System.Diagnostics.Eventing [FieldOffset(8)] private long m_keywords; - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")] public EventDescriptor( int id, byte version, @@ -98,7 +98,7 @@ namespace System.Diagnostics.Eventing } } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")] public byte Opcode { get diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventProvider.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventProvider.cs index fe72df70702..4ec838987c6 100644 --- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventProvider.cs +++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/EventProvider.cs @@ -753,7 +753,7 @@ namespace System.Diagnostics.Eventing{ { // If relatedActivityId is Guid.Empty, this is not a real transfer: just call EventWrite(). // For pre-Win7 platforms we cannot set the activityId from CorrelationManager - // because we cannot set relatedActivityId to null (Win7 bug 116784) + // because we cannot set relatedActivityId to null (Win7 status = UnsafeNativeMethods.EventWrite (m_regHandle, ref eventDescriptor, (uint)argCount, diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs index 6515e3d87aa..408bce798c0 100644 --- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs +++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventLogSession.cs @@ -52,7 +52,7 @@ namespace System.Diagnostics.Eventing.Reader { internal EventLogHandle renderContextHandleSystem = EventLogHandle.Zero; internal EventLogHandle renderContextHandleUser = EventLogHandle.Zero; - //the dummy [....] object for the two contextes. + //the dummy sync object for the two contextes. private object syncObject = null; private string server; diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs index 4aa1910d960..ce3f4c8d049 100644 --- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs +++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventMetadata.cs @@ -86,7 +86,7 @@ namespace System.Diagnostics.Eventing.Reader { } } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")] public EventOpcode Opcode { get { return new EventOpcode(this.opcode, this.pmReference); diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs index c597a47c226..f930037c34e 100644 --- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs +++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventOpcode.cs @@ -20,7 +20,7 @@ using System.Diagnostics.CodeAnalysis; namespace System.Diagnostics.Eventing.Reader { [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")] public sealed class EventOpcode { private int value; private string name; diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs index e50e1f0e493..c81eb96bfa0 100644 --- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs +++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/EventRecord.cs @@ -30,7 +30,7 @@ namespace System.Diagnostics.Eventing.Reader { public abstract byte? Level { get; } public abstract int? Task { get; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")] public abstract short? Opcode { get; } public abstract long? Keywords { get; } @@ -55,7 +55,7 @@ namespace System.Diagnostics.Eventing.Reader { public abstract string LevelDisplayName { get; } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcode", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")] public abstract string OpcodeDisplayName { get; } public abstract string TaskDisplayName { get; } public abstract IEnumerable<string> KeywordsDisplayNames { get; } diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs index fc82c705836..b1cf7fc07cb 100644 --- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs +++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/ProviderMetadata.cs @@ -440,7 +440,7 @@ namespace System.Diagnostics.Eventing.Reader { } } - [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcodes", Justification = "[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming", "CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId = "Opcodes", Justification = "Microsoft: Shipped public in 3.5, breaking change to fix now.")] public IList<EventOpcode> Opcodes { get { List<EventOpcode> eo; diff --git a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/Winmeta.cs b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/Winmeta.cs index 883eea188ee..e8d96dcb3b4 100644 --- a/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/Winmeta.cs +++ b/mcs/class/referencesource/System.Core/System/Diagnostics/Eventing/Reader/Winmeta.cs @@ -57,7 +57,7 @@ namespace System.Diagnostics.Eventing.Reader { /// <summary> /// EventOpcode /// </summary> - [SuppressMessage("Microsoft.Naming","CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId="Opcode", Justification="[....]: Shipped public in 3.5, breaking change to fix now.")] + [SuppressMessage("Microsoft.Naming","CA1702:CompoundWordsShouldBeCasedCorrectly", MessageId="Opcode", Justification="matell: Shipped public in 3.5, breaking change to fix now.")] public enum StandardEventOpcode { /// <summary> /// An informational event @@ -152,4 +152,4 @@ namespace System.Diagnostics.Eventing.Reader { /// </summary> EventLogClassic = 0x80000000000000 } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/FuncAndAction.cs b/mcs/class/referencesource/System.Core/System/FuncAndAction.cs index ab43cd2d683..eaeca8fc9c9 100644 --- a/mcs/class/referencesource/System.Core/System/FuncAndAction.cs +++ b/mcs/class/referencesource/System.Core/System/FuncAndAction.cs @@ -17,4 +17,4 @@ // Action and Func types exist in mscorlib (up to 8 generic argument paremeters) // and in System.Core.dll (See Microsoft\Scripting\Utils\[Action.cs | Function.cs]) -// for 9-16 generic argument parameter versions. +// for 9-16 generic argument parameter versions.
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs b/mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs index d958460110f..ba1e49453bd 100644 --- a/mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs +++ b/mcs/class/referencesource/System.Core/System/IO/BufferedStream2.cs @@ -265,7 +265,7 @@ internal abstract class BufferedStream2 : Stream // (either synchronously or asynchronously) before the first one // returns. This would involve some sort of complex buffer locking // that we probably don't want to get into, at least not in V1. - // If we did a [....] read to fill the buffer, we could avoid the + // If we did a sync read to fill the buffer, we could avoid the // problem, and any async read less than 64K gets turned into a // synchronous read by NT anyways... -- @@ -508,7 +508,7 @@ internal abstract class BufferedStream2 : Stream // Reading is done by blocks from the file, but someone could read // 1 byte from the buffer then write. At that point, the OS's file - // pointer is out of [....] with the stream's position. All write + // pointer is out of sync with the stream's position. All write // functions should call this function to preserve the position in the file. [MethodImplAttribute(MethodImplOptions.Synchronized)] protected void FlushRead() { diff --git a/mcs/class/referencesource/System.Core/System/IO/Enums.cs b/mcs/class/referencesource/System.Core/System/IO/Enums.cs index c53835134c8..bed84594e7a 100644 --- a/mcs/class/referencesource/System.Core/System/IO/Enums.cs +++ b/mcs/class/referencesource/System.Core/System/IO/Enums.cs @@ -18,7 +18,9 @@ using System.Text; namespace System.IO { +#if !FEATURE_CORESYSTEM [Serializable] +#endif public enum HandleInheritability { None = 0, Inheritable = 1, diff --git a/mcs/class/referencesource/System.Core/System/IO/LogStream.cs b/mcs/class/referencesource/System.Core/System/IO/LogStream.cs index 69179635a8e..37b0623d37d 100644 --- a/mcs/class/referencesource/System.Core/System/IO/LogStream.cs +++ b/mcs/class/referencesource/System.Core/System/IO/LogStream.cs @@ -278,7 +278,7 @@ internal class LogStream : BufferedStream2 } if (r == 0) { - // We should never silently ---- an error here without some + // We should never silently swallow an error here without some // extra work. We must make sure that BeginWriteCore won't return an // IAsyncResult that will cause EndWrite to block, since the OS won't // call AsyncFSCallback for us. diff --git a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedFile.cs b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedFile.cs index e1e2d1d2d7e..274d98ad107 100644 --- a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedFile.cs +++ b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedFile.cs @@ -181,6 +181,12 @@ namespace System.IO.MemoryMappedFiles { return new MemoryMappedFile(handle, fileStream, false); } + public static MemoryMappedFile CreateFromFile(FileStream fileStream, String mapName, Int64 capacity, + MemoryMappedFileAccess access, + HandleInheritability inheritability, bool leaveOpen) { + return CreateFromFile(fileStream, mapName, capacity, access, null, inheritability, leaveOpen); + } + [System.Security.SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public static MemoryMappedFile CreateFromFile(FileStream fileStream, String mapName, Int64 capacity, @@ -250,6 +256,12 @@ namespace System.IO.MemoryMappedFiles { HandleInheritability.None); } + public static MemoryMappedFile CreateNew(String mapName, Int64 capacity, MemoryMappedFileAccess access, + MemoryMappedFileOptions options, + HandleInheritability inheritability) { + return CreateNew(mapName, capacity, access, options, null, inheritability); + } + [System.Security.SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public static MemoryMappedFile CreateNew(String mapName, Int64 capacity, MemoryMappedFileAccess access, @@ -305,6 +317,12 @@ namespace System.IO.MemoryMappedFiles { return CreateOrOpen(mapName, capacity, access, MemoryMappedFileOptions.None, null, HandleInheritability.None); } + public static MemoryMappedFile CreateOrOpen(String mapName, Int64 capacity, + MemoryMappedFileAccess access, MemoryMappedFileOptions options, + HandleInheritability inheritability) { + return CreateOrOpen(mapName, capacity, access, options, null, inheritability); + } + [System.Security.SecurityCritical] [SecurityPermissionAttribute(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)] public static MemoryMappedFile CreateOrOpen(String mapName, Int64 capacity, diff --git a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs index 19bfac4949c..a88b941d0c7 100644 --- a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs +++ b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedView.cs @@ -102,7 +102,7 @@ namespace System.IO.MemoryMappedFiles { // if request is >= than total virtual, then MapViewOfFile will fail with meaningless error message // "the parameter is incorrect"; this provides better error message in advance UnsafeNativeMethods.MEMORYSTATUSEX memStatus = new UnsafeNativeMethods.MEMORYSTATUSEX(); - bool result = UnsafeNativeMethods.GlobalMemoryStatusEx(memStatus); + bool result = UnsafeNativeMethods.GlobalMemoryStatusEx(ref memStatus); ulong totalVirtual = memStatus.ullTotalVirtual; if (nativeSize >= totalVirtual) { throw new IOException(SR.GetString(SR.IO_NotEnoughMemory)); @@ -125,14 +125,32 @@ namespace System.IO.MemoryMappedFiles { ulong viewSize = (ulong)viewInfo.RegionSize; - // allocate the pages if we were using the MemoryMappedFileOptions.DelayAllocatePages option - if ((viewInfo.State & UnsafeNativeMethods.MEM_RESERVE) != 0) { - IntPtr tempHandle = UnsafeNativeMethods.VirtualAlloc(viewHandle, (UIntPtr)viewSize, UnsafeNativeMethods.MEM_COMMIT, + // Allocate the pages if we were using the MemoryMappedFileOptions.DelayAllocatePages option + // OR check if the allocated view size is smaller than the expected native size + // If multiple overlapping views are created over the file mapping object, the pages in a given region + // could have different attributes(MEM_RESERVE OR MEM_COMMIT) as MapViewOfFile preserves coherence between + // views created on a mapping object backed by same file. + // In which case, the viewSize will be smaller than nativeSize required and viewState could be MEM_COMMIT + // but more pages may need to be committed in the region. + // This is because, VirtualQuery function(that internally invokes VirtualQueryEx function) returns the attributes + // and size of the region of pages with matching attributes starting from base address. + // VirtualQueryEx: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366907(v=vs.85).aspx + if (((viewInfo.State & UnsafeNativeMethods.MEM_RESERVE) != 0) || (viewSize < nativeSize)) { + ulong allocSize = (nativeSize == 0) ? viewSize : nativeSize; + IntPtr tempHandle = UnsafeNativeMethods.VirtualAlloc(viewHandle, (UIntPtr)allocSize, UnsafeNativeMethods.MEM_COMMIT, MemoryMappedFile.GetPageAccess(access)); int lastError = Marshal.GetLastWin32Error(); - if (viewHandle.IsInvalid) { - __Error.WinIOError(lastError, String.Empty); - } + // The following is commented out for backward compatibility. + // Previously releases failed to check for this error so introducing this check + // could cause new/different exceptions in existing code paths. + // if (tempHandle == IntPtr.Zero) { + // __Error.WinIOError(lastError, String.Empty); + // } + + // again query the view for its new size + viewInfo = new UnsafeNativeMethods.MEMORY_BASIC_INFORMATION(); + UnsafeNativeMethods.VirtualQuery(viewHandle, ref viewInfo, (IntPtr)Marshal.SizeOf(viewInfo)); + viewSize = (ulong)viewInfo.RegionSize; } // if the user specified DefaultSize as the size, we need to get the actual size @@ -149,7 +167,7 @@ namespace System.IO.MemoryMappedFiles { } - // Flushes the changes such that they are in [....] with the FileStream bits (ones obtained + // Flushes the changes such that they are in sync with the FileStream bits (ones obtained // with the win32 ReadFile and WriteFile functions). Need to call FileStream's Flush to // flush to the disk. // NOTE: This will flush all bytes before and after the view up until an offset that is a multiple diff --git a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs index 3df123c5509..c79b81dfe1a 100644 --- a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs +++ b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewAccessor.cs @@ -76,7 +76,7 @@ namespace System.IO.MemoryMappedFiles { } } - // Flushes the changes such that they are in [....] with the FileStream bits (ones obtained + // Flushes the changes such that they are in sync with the FileStream bits (ones obtained // with the win32 ReadFile and WriteFile functions). Need to call FileStream's Flush to // flush to the disk. // NOTE: This will flush all bytes before and after the view up until an offset that is a diff --git a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs index 283048b069c..c531a45d5ca 100644 --- a/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs +++ b/mcs/class/referencesource/System.Core/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs @@ -78,7 +78,7 @@ namespace System.IO.MemoryMappedFiles { } } - // Flushes the changes such that they are in [....] with the FileStream bits (ones obtained + // Flushes the changes such that they are in sync with the FileStream bits (ones obtained // with the win32 ReadFile and WriteFile functions). Need to call FileStream's Flush to // flush to the disk. // NOTE: This will flush all bytes before and after the view up until an offset that is a diff --git a/mcs/class/referencesource/System.Core/System/IO/Pipes/IOCancellationHelper.cs b/mcs/class/referencesource/System.Core/System/IO/Pipes/IOCancellationHelper.cs new file mode 100644 index 00000000000..3c6d42bdc27 --- /dev/null +++ b/mcs/class/referencesource/System.Core/System/IO/Pipes/IOCancellationHelper.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// <copyright company="Microsoft"> +// Copyright (c) Microsoft Corporation. All rights reserved. +// </copyright> +//------------------------------------------------------------------------------ +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Runtime.InteropServices; +using System.Security; +using System.Threading; +using UnsafeNativeMethods = Microsoft.Win32.UnsafeNativeMethods; + +namespace System.IO.Pipes { + internal unsafe class IOCancellationHelper { + private CancellationToken _cancellationToken; + private CancellationTokenRegistration _cancellationRegistration; + [SecurityCritical] + private SafeHandle _handle; + [SecurityCritical] + private NativeOverlapped* _overlapped; + + public IOCancellationHelper(CancellationToken cancellationToken) { + this._cancellationToken = cancellationToken; + } + + /// <summary> + /// Marking that from this moment on + /// user can cancel operation using cancellationToken + /// </summary> + [SecurityCritical] + public void AllowCancellation(SafeHandle handle, NativeOverlapped* overlapped) { + Contract.Assert(handle != null, "Handle cannot be null"); + Contract.Assert(!handle.IsInvalid, "Handle cannot be invalid"); + Contract.Assert(overlapped != null, "Overlapped cannot be null"); + Contract.Assert(this._handle == null && this._overlapped == null, "Cancellation is already allowed."); + + if (!_cancellationToken.CanBeCanceled) { + return; + } + + this._handle = handle; + this._overlapped = overlapped; + if (this._cancellationToken.IsCancellationRequested) { + this.Cancel(); + } + else { + this._cancellationRegistration = this._cancellationToken.Register(Cancel); + } + } + + /// <summary> + /// Marking that operation is completed and + /// from this moment cancellation is no longer possible. + /// This MUST happen before Overlapped is freed and Handle is disposed. + /// </summary> + [SecurityCritical] + public void SetOperationCompleted() { + if (this._overlapped != null) { + this._cancellationRegistration.Dispose(); + this._handle = null; + this._overlapped = null; + } + } + + public void ThrowIOOperationAborted() { + this._cancellationToken.ThrowIfCancellationRequested(); + + // If we didn't throw that means that this is unexpected abortion + __Error.OperationAborted(); + } + + /// <summary> + /// Cancellation is not guaranteed to succeed. + /// We ignore all errors here because operation could + /// succeed just before it was called or someone already + /// cancelled this operation without using token which should + /// be manually detected - when operation finishes we should + /// compare error code to ERROR_OPERATION_ABORTED and if cancellation + /// token was not used to cancel we will throw. + /// </summary> + [SecurityCritical] + private void Cancel() { + // Storing to locals to avoid data ----s + SafeHandle handle = this._handle; + NativeOverlapped* overlapped = this._overlapped; + if (handle != null && !handle.IsInvalid && overlapped != null) { + if (!UnsafeNativeMethods.CancelIoEx(handle, overlapped)) + { + // This case should not have any consequences although + // it will be easier to debug if there exists any special case + // we are not aware of. + int errorCode = Marshal.GetLastWin32Error(); + Debug.WriteLine("CancelIoEx finished with error code {0}.", errorCode); + } + SetOperationCompleted(); + } + } + } +} diff --git a/mcs/class/referencesource/System.Core/System/IO/Pipes/Pipe.cs b/mcs/class/referencesource/System.Core/System/IO/Pipes/Pipe.cs index 7e7df0033eb..7880ffd20f6 100644 --- a/mcs/class/referencesource/System.Core/System/IO/Pipes/Pipe.cs +++ b/mcs/class/referencesource/System.Core/System/IO/Pipes/Pipe.cs @@ -28,6 +28,7 @@ using System.Security.Permissions; using System.Security.Principal; using System.Text; using System.Threading; +using System.Threading.Tasks; using Microsoft.Win32; using Microsoft.Win32.SafeHandles; @@ -623,6 +624,24 @@ namespace System.IO.Pipes { } } + public Task WaitForConnectionAsync(CancellationToken cancellationToken) { + if (cancellationToken.IsCancellationRequested) { + return Task.FromCancellation(cancellationToken); + } + + if (!IsAsync) { + return Task.Factory.StartNew(WaitForConnection, cancellationToken); + } + + // Avoiding allocation if the task cannot be cancelled + IOCancellationHelper cancellationHelper = cancellationToken.CanBeCanceled ? new IOCancellationHelper(cancellationToken) : null; + return Task.Factory.FromAsync(BeginWaitForConnection, EndWaitForConnection, cancellationHelper); + } + + public Task WaitForConnectionAsync() { + return WaitForConnectionAsync(CancellationToken.None); + } + // Async version of WaitForConnection. See the comments above for more info. [System.Security.SecurityCritical] [HostProtection(ExternalThreading = true)] @@ -640,6 +659,8 @@ namespace System.IO.Pipes { asyncResult._userCallback = callback; asyncResult._userStateObject = state; + IOCancellationHelper cancellationHelper = state as IOCancellationHelper; + // Create wait handle and store in async result ManualResetEvent waitHandle = new ManualResetEvent(false); asyncResult._waitHandle = waitHandle; @@ -655,8 +676,12 @@ namespace System.IO.Pipes { if (!UnsafeNativeMethods.ConnectNamedPipe(InternalHandle, intOverlapped)) { int errorCode = Marshal.GetLastWin32Error(); - if (errorCode == UnsafeNativeMethods.ERROR_IO_PENDING) + if (errorCode == UnsafeNativeMethods.ERROR_IO_PENDING) { + if (cancellationHelper != null) { + cancellationHelper.AllowCancellation(InternalHandle, intOverlapped); + } return asyncResult; + } // WaitForConnectionCallback will not be called becasue we completed synchronously. // Either the pipe is already connected, or there was an error. Unpin and free the overlapped again. @@ -676,6 +701,9 @@ namespace System.IO.Pipes { __Error.WinIOError(errorCode, String.Empty); } // will set state to Connected when EndWait is called + if (cancellationHelper != null) { + cancellationHelper.AllowCancellation(InternalHandle, intOverlapped); + } return asyncResult; } @@ -704,6 +732,11 @@ namespace System.IO.Pipes { __Error.EndWaitForConnectionCalledTwice(); } + IOCancellationHelper cancellationHelper = afsar.AsyncState as IOCancellationHelper; + if (cancellationHelper != null) { + cancellationHelper.SetOperationCompleted(); + } + // Obtain the WaitHandle, but don't use public property in case we // delay initialize the manual reset event in the future. WaitHandle wh = afsar._waitHandle; @@ -728,6 +761,11 @@ namespace System.IO.Pipes { // Now check for any error during the read. if (afsar._errorCode != 0) { + if (afsar._errorCode == UnsafeNativeMethods.ERROR_OPERATION_ABORTED) { + if (cancellationHelper != null) { + cancellationHelper.ThrowIOOperationAborted(); + } + } __Error.WinIOError(afsar._errorCode, String.Empty); } @@ -939,6 +977,9 @@ namespace System.IO.Pipes { [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public sealed class NamedPipeClientStream : PipeStream { + // Maximum interval in miliseconds between which cancellation is checked. + // Used by ConnectInternal. 50ms is fairly responsive time but really long time for processor. + private const int CancellationCheckIntervalInMilliseconds = 50; private string m_normalizedPipePath; private TokenImpersonationLevel m_impersonationLevel; private PipeOptions m_pipeOptions; @@ -1193,6 +1234,127 @@ namespace System.IO.Pipes { throw new TimeoutException(); } + public Task ConnectAsync() { + // We cannot avoid creating lambda here by using Connect method + // unless we don't care about start time to be measured before the thread is started + return ConnectAsync(Timeout.Infinite, CancellationToken.None); + } + + public Task ConnectAsync(int timeout) { + return ConnectAsync(timeout, CancellationToken.None); + } + + public Task ConnectAsync(CancellationToken cancellationToken) { + return ConnectAsync(Timeout.Infinite, cancellationToken); + } + + public Task ConnectAsync(int timeout, CancellationToken cancellationToken) { + CheckConnectOperationsClient(); + + if (timeout < 0 && timeout != Timeout.Infinite) { + throw new ArgumentOutOfRangeException("timeout", SR.GetString(SR.ArgumentOutOfRange_InvalidTimeout)); + } + + if (cancellationToken.IsCancellationRequested) { + return Task.FromCancellation(cancellationToken); + } + + // We need to measure time here, not in the lambda + int startTime = Environment.TickCount; + return Task.Factory.StartNew(() => ConnectInternal(timeout, cancellationToken, startTime), cancellationToken); + } + + // Waits for a pipe instance to become available. This method may return before WaitForConnection is called + // on the server end, but WaitForConnection will not return until we have returned. Any data writen to the + // pipe by us after we have connected but before the server has called WaitForConnection will be available + // to the server after it calls WaitForConnection. + [System.Security.SecuritySafeCritical] + private void ConnectInternal(int timeout, CancellationToken cancellationToken, int startTime) { + UnsafeNativeMethods.SECURITY_ATTRIBUTES secAttrs = PipeStream.GetSecAttrs(m_inheritability); + + int _pipeFlags = (int)m_pipeOptions; + if (m_impersonationLevel != TokenImpersonationLevel.None) { + _pipeFlags |= UnsafeNativeMethods.SECURITY_SQOS_PRESENT; + _pipeFlags |= (((int)m_impersonationLevel - 1) << 16); + } + + // This is the main connection loop. It will loop until the timeout expires. Most of the + // time, we will be waiting in the WaitNamedPipe win32 blocking function; however, there are + // cases when we will need to loop: 1) The server is not created (WaitNamedPipe returns + // straight away in such cases), and 2) when another client connects to our server in between + // our WaitNamedPipe and CreateFile calls. + int elapsed = 0; + do { + // We want any other exception and and success to have priority over cancellation. + cancellationToken.ThrowIfCancellationRequested(); + + // Wait for pipe to become free (this will block unless the pipe does not exist). + int timeLeft = timeout - elapsed; + int waitTime; + if (cancellationToken.CanBeCanceled) { + waitTime = Math.Min(CancellationCheckIntervalInMilliseconds, timeLeft); + } + else { + waitTime = timeLeft; + } + + if (!UnsafeNativeMethods.WaitNamedPipe(m_normalizedPipePath, waitTime)) { + int errorCode = Marshal.GetLastWin32Error(); + + // Server is not yet created so let's keep looping. + if (errorCode == UnsafeNativeMethods.ERROR_FILE_NOT_FOUND) { + continue; + } + + // The timeout has expired. + if (errorCode == UnsafeNativeMethods.ERROR_SUCCESS) { + if (cancellationToken.CanBeCanceled) { + // It may not be real timeout and only checking for cancellation + // let the while condition check it and decide + continue; + } + else { + break; + } + } + + __Error.WinIOError(errorCode, String.Empty); + } + + // Pipe server should be free. Let's try to connect to it. + SafePipeHandle handle = UnsafeNativeMethods.CreateNamedPipeClient(m_normalizedPipePath, + m_access, // read and write access + 0, // sharing: none + secAttrs, // security attributes + FileMode.Open, // open existing + _pipeFlags, // impersonation flags + UnsafeNativeMethods.NULL); // template file: null + + if (handle.IsInvalid) { + int errorCode = Marshal.GetLastWin32Error(); + + // Handle the possible race condition of someone else connecting to the server + // between our calls to WaitNamedPipe & CreateFile. + if (errorCode == UnsafeNativeMethods.ERROR_PIPE_BUSY) { + continue; + } + + __Error.WinIOError(errorCode, String.Empty); + } + + // Success! + InitializeHandle(handle, false, (m_pipeOptions & PipeOptions.Asynchronous) != 0); + State = PipeState.Connected; + + return; + } + while (timeout == Timeout.Infinite || (elapsed = unchecked(Environment.TickCount - startTime)) < timeout); + // BUGBUG: SerialPort does not use unchecked arithmetic when calculating elapsed times. This is needed + // because Environment.TickCount can overflow (though only every 49.7 days). + + throw new TimeoutException(); + } + public int NumberOfServerInstances { [System.Security.SecurityCritical] [SuppressMessage("Microsoft.Security","CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification="Security model of pipes: demand at creation but no subsequent demands")] diff --git a/mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs b/mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs index d3b913c00ac..02018024c39 100644 --- a/mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs +++ b/mcs/class/referencesource/System.Core/System/IO/Pipes/PipeStream.cs @@ -256,7 +256,7 @@ namespace System.IO.Pipes { CheckReadOperations(); if (!m_isAsync) { - // special case when this is called for [....] broken pipes because otherwise Stream's + // special case when this is called for sync broken pipes because otherwise Stream's // Begin/EndRead hang. Reads return 0 bytes in this case so we can call the user's // callback immediately if (m_state == PipeState.Broken) { @@ -645,7 +645,7 @@ namespace System.IO.Pipes { } if (r == 0) { - // We should never silently ---- an error here without some + // We should never silently swallow an error here without some // extra work. We must make sure that BeginReadCore won't return an // IAsyncResult that will cause EndRead to block, since the OS won't // call AsyncPSCallback for us. @@ -695,7 +695,7 @@ namespace System.IO.Pipes { } if (r == 0) { - // We should never silently ---- an error here without some + // We should never silently swallow an error here without some // extra work. We must make sure that BeginWriteCore won't return an // IAsyncResult that will cause EndWrite to block, since the OS won't // call AsyncPSCallback for us. diff --git a/mcs/class/referencesource/System.Core/System/IO/__Error.cs b/mcs/class/referencesource/System.Core/System/IO/__Error.cs index 02960e8466f..596a0e973d1 100644 --- a/mcs/class/referencesource/System.Core/System/IO/__Error.cs +++ b/mcs/class/referencesource/System.Core/System/IO/__Error.cs @@ -217,5 +217,8 @@ namespace System.IO { throw new NotSupportedException(SR.GetString(SR.NotSupported_UnwritableStream)); } + internal static void OperationAborted() { + throw new IOException(SR.GetString(SR.IO_OperationAborted)); + } } } diff --git a/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs index d718d487e99..66e864ef023 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Enumerable.cs @@ -2016,16 +2016,14 @@ namespace System.Linq } } + + // + // We have added some optimization in SZArrayHelper class to cache the enumerator of zero length arrays so + // the enumerator will be created once per type. + // internal class EmptyEnumerable<TElement> { - static volatile TElement[] instance; - - public static IEnumerable<TElement> Instance { - get { - if (instance == null) instance = new TElement[0]; - return instance; - } - } + public static readonly TElement[] Instance = new TElement[0]; } internal class IdentityFunction<TElement> @@ -2130,7 +2128,7 @@ namespace System.Linq internal int InternalGetHashCode(TKey key) { - //[....] DevDivBugs 171937. work around comparer implementations that throw when passed null + //Microsoft DevDivBugs 171937. work around comparer implementations that throw when passed null return (key == null) ? 0 : comparer.GetHashCode(key) & 0x7FFFFFFF; } @@ -2348,7 +2346,7 @@ namespace System.Linq internal int InternalGetHashCode(TElement value) { - //[....] DevDivBugs 171937. work around comparer implementations that throw when passed null + //Microsoft DevDivBugs 171937. work around comparer implementations that throw when passed null return (value == null) ? 0 : comparer.GetHashCode(value) & 0x7FFFFFFF; } diff --git a/mcs/class/referencesource/System.Core/System/Linq/IQueryable.cs b/mcs/class/referencesource/System.Core/System/Linq/IQueryable.cs index 6b059022376..fa32bb39d76 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/IQueryable.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/IQueryable.cs @@ -40,6 +40,34 @@ namespace System.Linq { public static class Queryable { +#region Helper methods to obtain MethodInfo in a safe way + + private static MethodInfo GetMethodInfo<T1, T2>(Func<T1, T2> f, T1 unused1) { + return f.Method; + } + + private static MethodInfo GetMethodInfo<T1, T2, T3>(Func<T1, T2, T3> f, T1 unused1, T2 unused2) { + return f.Method; + } + + private static MethodInfo GetMethodInfo<T1, T2, T3, T4>(Func<T1, T2, T3, T4> f, T1 unused1, T2 unused2, T3 unused3) { + return f.Method; + } + + private static MethodInfo GetMethodInfo<T1, T2, T3, T4, T5>(Func<T1, T2, T3, T4, T5> f, T1 unused1, T2 unused2, T3 unused3, T4 unused4) { + return f.Method; + } + + private static MethodInfo GetMethodInfo<T1, T2, T3, T4, T5, T6>(Func<T1, T2, T3, T4, T5, T6> f, T1 unused1, T2 unused2, T3 unused3, T4 unused4, T5 unused5) { + return f.Method; + } + + private static MethodInfo GetMethodInfo<T1, T2, T3, T4, T5, T6, T7>(Func<T1, T2, T3, T4, T5, T6, T7> f, T1 unused1, T2 unused2, T3 unused3, T4 unused4, T5 unused5, T6 unused6) { + return f.Method; + } + +#endregion + public static IQueryable<TElement> AsQueryable<TElement>(this IEnumerable<TElement> source) { if (source == null) throw Error.ArgumentNull("source"); @@ -67,7 +95,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Where, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -79,8 +107,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.CreateQuery<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Where, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -91,7 +119,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), + GetMethodInfo(Queryable.OfType<TResult>, source), new Expression[] { source.Expression } )); } @@ -101,8 +129,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.CreateQuery<TResult>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)), + null, + GetMethodInfo(Queryable.Cast<TResult>, source), new Expression[] { source.Expression } )); } @@ -115,7 +143,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + GetMethodInfo(Queryable.Select, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -128,7 +156,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + GetMethodInfo(Queryable.Select, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -141,7 +169,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + GetMethodInfo(Queryable.SelectMany, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -154,7 +182,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + GetMethodInfo(Queryable.SelectMany, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -169,7 +197,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), + GetMethodInfo(Queryable.SelectMany, source, collectionSelector, resultSelector), new Expression[] { source.Expression, Expression.Quote(collectionSelector), Expression.Quote(resultSelector) } )); } @@ -184,7 +212,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TCollection), typeof(TResult)), + GetMethodInfo(Queryable.SelectMany, source, collectionSelector, resultSelector), new Expression[] { source.Expression, Expression.Quote(collectionSelector), Expression.Quote(resultSelector) } )); } @@ -209,7 +237,7 @@ namespace System.Linq { return outer.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.Join, outer, inner, outerKeySelector, innerKeySelector, resultSelector), new Expression[] { outer.Expression, GetSourceExpression(inner), @@ -234,7 +262,7 @@ namespace System.Linq { return outer.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.Join, outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer), new Expression[] { outer.Expression, GetSourceExpression(inner), @@ -260,7 +288,7 @@ namespace System.Linq { return outer.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.GroupJoin, outer, inner, outerKeySelector, innerKeySelector, resultSelector), new Expression[] { outer.Expression, GetSourceExpression(inner), @@ -284,7 +312,7 @@ namespace System.Linq { return outer.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TOuter), typeof(TInner), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.GroupJoin, outer, inner, outerKeySelector, innerKeySelector, resultSelector, comparer), new Expression[] { outer.Expression, GetSourceExpression(inner), @@ -304,7 +332,7 @@ namespace System.Linq { return (IOrderedQueryable<TSource>) source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.OrderBy, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -317,7 +345,7 @@ namespace System.Linq { return (IOrderedQueryable<TSource>) source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.OrderBy, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>)) } )); } @@ -327,10 +355,10 @@ namespace System.Linq { throw Error.ArgumentNull("source"); if (keySelector == null) throw Error.ArgumentNull("keySelector"); - return (IOrderedQueryable<TSource>) source.Provider.CreateQuery<TSource>( + return (IOrderedQueryable<TSource>)source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.OrderByDescending, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -343,7 +371,7 @@ namespace System.Linq { return (IOrderedQueryable<TSource>) source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.OrderByDescending, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>)) } )); } @@ -356,7 +384,7 @@ namespace System.Linq { return (IOrderedQueryable<TSource>) source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.ThenBy, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -369,7 +397,7 @@ namespace System.Linq { return (IOrderedQueryable<TSource>) source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.ThenBy, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>)) } )); } @@ -382,7 +410,7 @@ namespace System.Linq { return (IOrderedQueryable<TSource>) source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.ThenByDescending, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -395,7 +423,7 @@ namespace System.Linq { return (IOrderedQueryable<TSource>) source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.ThenByDescending, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IComparer<TKey>)) } )); } @@ -406,7 +434,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Take, source, count), new Expression[] { source.Expression, Expression.Constant(count) } )); } @@ -419,7 +447,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.TakeWhile, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -432,7 +460,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.TakeWhile, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -443,7 +471,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Skip, source, count), new Expression[] { source.Expression, Expression.Constant(count) } )); } @@ -456,7 +484,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SkipWhile, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -469,7 +497,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SkipWhile, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -482,7 +510,7 @@ namespace System.Linq { return source.Provider.CreateQuery<IGrouping<TKey,TSource>>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.GroupBy, source, keySelector), new Expression[] { source.Expression, Expression.Quote(keySelector) } )); } @@ -497,7 +525,7 @@ namespace System.Linq { return source.Provider.CreateQuery<IGrouping<TKey,TElement>>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, elementSelector), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector) } )); } @@ -510,7 +538,7 @@ namespace System.Linq { return source.Provider.CreateQuery<IGrouping<TKey,TSource>>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)) } )); } @@ -525,7 +553,7 @@ namespace System.Linq { return source.Provider.CreateQuery<IGrouping<TKey,TElement>>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, elementSelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)) } )); } @@ -543,7 +571,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, elementSelector, resultSelector), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Quote(resultSelector) } )); } @@ -559,7 +587,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, resultSelector), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(resultSelector) } )); } @@ -575,7 +603,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TResult)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, resultSelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)) } )); } @@ -593,7 +621,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TKey), typeof(TElement), typeof(TResult)), + GetMethodInfo(Queryable.GroupBy, source, keySelector, elementSelector, resultSelector, comparer), new Expression[] { source.Expression, Expression.Quote(keySelector), Expression.Quote(elementSelector), Expression.Quote(resultSelector), Expression.Constant(comparer, typeof(IEqualityComparer<TKey>)) } )); } @@ -604,7 +632,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Distinct, source), new Expression[] { source.Expression } )); } @@ -615,7 +643,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Distinct, source, comparer), new Expression[] { source.Expression, Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)) } )); } @@ -627,8 +655,8 @@ namespace System.Linq { throw Error.ArgumentNull("source2"); return source1.Provider.CreateQuery<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Concat, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -643,7 +671,7 @@ namespace System.Linq { return source1.Provider.CreateQuery<TResult>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TFirst), typeof(TSecond), typeof(TResult)), + GetMethodInfo(Queryable.Zip, source1, source2, resultSelector), new Expression[] { source1.Expression, GetSourceExpression(source2), Expression.Quote(resultSelector) } )); } @@ -655,8 +683,8 @@ namespace System.Linq { throw Error.ArgumentNull("source2"); return source1.Provider.CreateQuery<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Union, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -669,7 +697,7 @@ namespace System.Linq { return source1.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Union, source1, source2, comparer), new Expression[] { source1.Expression, GetSourceExpression(source2), @@ -686,7 +714,7 @@ namespace System.Linq { return source1.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Intersect, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -699,7 +727,7 @@ namespace System.Linq { return source1.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Intersect, source1, source2, comparer), new Expression[] { source1.Expression, GetSourceExpression(source2), @@ -716,7 +744,7 @@ namespace System.Linq { return source1.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Except, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -729,7 +757,7 @@ namespace System.Linq { return source1.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Except, source1, source2, comparer), new Expression[] { source1.Expression, GetSourceExpression(source2), @@ -743,8 +771,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.First, source), new Expression[] { source.Expression } )); } @@ -756,8 +784,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.First, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -768,7 +796,7 @@ namespace System.Linq { return source.Provider.Execute<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.FirstOrDefault, source), new Expression[] { source.Expression } )); } @@ -780,8 +808,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.FirstOrDefault, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -791,8 +819,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Last, source), new Expression[] { source.Expression } )); } @@ -804,8 +832,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Last, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -816,7 +844,7 @@ namespace System.Linq { return source.Provider.Execute<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.LastOrDefault, source), new Expression[] { source.Expression } )); } @@ -828,8 +856,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.LastOrDefault, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -840,7 +868,7 @@ namespace System.Linq { return source.Provider.Execute<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Single, source), new Expression[] { source.Expression } )); } @@ -852,8 +880,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Single, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -864,7 +892,7 @@ namespace System.Linq { return source.Provider.Execute<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SingleOrDefault, source), new Expression[] { source.Expression } )); } @@ -876,8 +904,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.SingleOrDefault, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -889,8 +917,8 @@ namespace System.Linq { throw Error.ArgumentOutOfRange("index"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.ElementAt, source, index), new Expression[] { source.Expression, Expression.Constant(index) } )); } @@ -900,8 +928,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.ElementAtOrDefault, source, index), new Expression[] { source.Expression, Expression.Constant(index) } )); } @@ -912,7 +940,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.DefaultIfEmpty, source), new Expression[] { source.Expression } )); } @@ -922,8 +950,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.CreateQuery<TSource>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.DefaultIfEmpty, source, defaultValue), new Expression[] { source.Expression, Expression.Constant(defaultValue, typeof(TSource)) } )); } @@ -933,8 +961,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<bool>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Contains, source, item), new Expression[] { source.Expression, Expression.Constant(item, typeof(TSource)) } )); } @@ -945,7 +973,7 @@ namespace System.Linq { return source.Provider.Execute<bool>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Contains, source, item, comparer), new Expression[] { source.Expression, Expression.Constant(item, typeof(TSource)), Expression.Constant(comparer, typeof(IEqualityComparer<TSource>)) } )); } @@ -956,7 +984,7 @@ namespace System.Linq { return source.Provider.CreateQuery<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Reverse, source), new Expression[] { source.Expression } )); } @@ -969,7 +997,7 @@ namespace System.Linq { return source1.Provider.Execute<bool>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SequenceEqual, source1, source2), new Expression[] { source1.Expression, GetSourceExpression(source2) } )); } @@ -982,7 +1010,7 @@ namespace System.Linq { return source1.Provider.Execute<bool>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.SequenceEqual, source1, source2, comparer), new Expression[] { source1.Expression, GetSourceExpression(source2), @@ -997,7 +1025,7 @@ namespace System.Linq { return source.Provider.Execute<bool>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Any, source), new Expression[] { source.Expression } )); } @@ -1009,8 +1037,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute<bool>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Any, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -1022,8 +1050,8 @@ namespace System.Linq { throw Error.ArgumentNull("predicate"); return source.Provider.Execute<bool>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.All, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -1034,7 +1062,7 @@ namespace System.Linq { return source.Provider.Execute<int>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Count, source), new Expression[] { source.Expression } )); } @@ -1047,7 +1075,7 @@ namespace System.Linq { return source.Provider.Execute<int>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Count, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -1058,7 +1086,7 @@ namespace System.Linq { return source.Provider.Execute<long>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.LongCount, source), new Expression[] { source.Expression } )); } @@ -1071,7 +1099,7 @@ namespace System.Linq { return source.Provider.Execute<long>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.LongCount, source, predicate), new Expression[] { source.Expression, Expression.Quote(predicate) } )); } @@ -1082,7 +1110,7 @@ namespace System.Linq { return source.Provider.Execute<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Min, source), new Expression[] { source.Expression } )); } @@ -1094,8 +1122,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<TResult>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + null, + GetMethodInfo(Queryable.Min, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1106,7 +1134,7 @@ namespace System.Linq { return source.Provider.Execute<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Max, source), new Expression[] { source.Expression } )); } @@ -1118,8 +1146,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<TResult>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)), + null, + GetMethodInfo(Queryable.Max, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1130,7 +1158,7 @@ namespace System.Linq { return source.Provider.Execute<int>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1140,8 +1168,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<int?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1151,8 +1179,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<long>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1162,8 +1190,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<long?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1173,8 +1201,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<float>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1184,8 +1212,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<float?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1195,8 +1223,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<double>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1206,8 +1234,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<double?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1217,8 +1245,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<decimal>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1228,8 +1256,8 @@ namespace System.Linq { throw Error.ArgumentNull("source"); return source.Provider.Execute<decimal?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + null, + GetMethodInfo(Queryable.Sum, source), new Expression[] { source.Expression } )); } @@ -1241,8 +1269,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<int>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1254,8 +1282,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<int?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1267,8 +1295,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<long>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1280,8 +1308,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<long?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1293,8 +1321,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<float>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1306,8 +1334,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<float?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1319,8 +1347,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<double>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1332,8 +1360,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<double?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1345,8 +1373,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<decimal>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1358,8 +1386,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<decimal?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Sum, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1370,7 +1398,7 @@ namespace System.Linq { return source.Provider.Execute<double>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1381,7 +1409,7 @@ namespace System.Linq { return source.Provider.Execute<double?>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1392,7 +1420,7 @@ namespace System.Linq { return source.Provider.Execute<double>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1403,7 +1431,7 @@ namespace System.Linq { return source.Provider.Execute<double?>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1415,7 +1443,7 @@ namespace System.Linq { return source.Provider.Execute<float>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1427,7 +1455,7 @@ namespace System.Linq { return source.Provider.Execute<float?>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1438,7 +1466,7 @@ namespace System.Linq { return source.Provider.Execute<double>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1449,7 +1477,7 @@ namespace System.Linq { return source.Provider.Execute<double?>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1460,7 +1488,7 @@ namespace System.Linq { return source.Provider.Execute<decimal>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1471,7 +1499,7 @@ namespace System.Linq { return source.Provider.Execute<decimal?>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()), + GetMethodInfo(Queryable.Average, source), new Expression[] { source.Expression } )); } @@ -1483,8 +1511,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<double>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1496,8 +1524,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<double?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1511,7 +1539,7 @@ namespace System.Linq { return source.Provider.Execute<float>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1525,7 +1553,7 @@ namespace System.Linq { return source.Provider.Execute<float?>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1537,8 +1565,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<double>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1550,8 +1578,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<double?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1563,8 +1591,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<double>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1576,8 +1604,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<double?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1589,8 +1617,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<decimal>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1602,8 +1630,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<decimal?>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + null, + GetMethodInfo(Queryable.Average, source, selector), new Expression[] { source.Expression, Expression.Quote(selector) } )); } @@ -1616,7 +1644,7 @@ namespace System.Linq { return source.Provider.Execute<TSource>( Expression.Call( null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)), + GetMethodInfo(Queryable.Aggregate, source, func), new Expression[] { source.Expression, Expression.Quote(func) } )); } @@ -1628,8 +1656,8 @@ namespace System.Linq { throw Error.ArgumentNull("func"); return source.Provider.Execute<TAccumulate>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate)), + null, + GetMethodInfo(Queryable.Aggregate, source, seed, func), new Expression[] { source.Expression, Expression.Constant(seed), Expression.Quote(func) } )); } @@ -1643,8 +1671,8 @@ namespace System.Linq { throw Error.ArgumentNull("selector"); return source.Provider.Execute<TResult>( Expression.Call( - null, - ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TAccumulate), typeof(TResult)), + null, + GetMethodInfo(Queryable.Aggregate, source, seed, func, selector), new Expression[] { source.Expression, Expression.Constant(seed), Expression.Quote(func), Expression.Quote(selector) } )); } diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs index d249e8749f3..0024bf3c90c 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/AsynchronousChannel.cs @@ -7,7 +7,7 @@ // // AsynchronousOneToOneChannel.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs index ac27781a039..79cdc7a9b01 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Channels/SynchronousChannel.cs @@ -7,7 +7,7 @@ // // SynchronousChannel.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs index af69de8aa37..3d560db8ca9 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/AggregationMinMaxHelpers.cs @@ -7,7 +7,7 @@ // // AggregationMinMaxHelpers.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs index 56c3c621c83..0d3335d7d3e 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EmptyEnumerable.cs @@ -7,7 +7,7 @@ // // EmptyEnumerable.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs index 95dbb1e0e65..6d7ec46c713 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/EnumerableWrapperWeakToStrong.cs @@ -7,7 +7,7 @@ // // EnumerableWrapperWeakToStrong.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs index 1aa7a436532..abf57edfe9a 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/IParallelPartitionable.cs @@ -7,7 +7,7 @@ // // IParallelPartitionable.cs // -// <OWNER>[....]</OWNER> +// <OWNER>igoro</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -23,4 +23,4 @@ namespace System.Linq.Parallel { QueryOperatorEnumerator<T, int>[] GetPartitions(int partitionCount); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs index 07e4c2a1f5a..70167618e2d 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/OrderedParallelQuery.cs @@ -7,7 +7,7 @@ // // OrderedParallelQuery.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs index 8c5fb1912a8..31d072f3b07 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelEnumerableWrapper.cs @@ -7,7 +7,7 @@ // // ParallelEnumerableWrapper.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs index 9503c3043f0..b9a9477a706 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/ParallelQuery.cs @@ -7,7 +7,7 @@ // // ParallelQuery.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // ParallelQuery is an abstract class that represents a PLINQ query. // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs index 2a73072bdf8..7775a87ab4f 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/QueryAggregationOptions.cs @@ -7,7 +7,7 @@ // // QueryAggregationOptions.cs // -// <OWNER>[....]</OWNER> +// <OWNER>igoro</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -27,4 +27,4 @@ namespace System.Linq.Parallel Commutative = 2, AssociativeCommutative = (Associative | Commutative) // For convenience. } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs index 1bb58a81f1f..8c580844613 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RangeEnumerable.cs @@ -7,7 +7,7 @@ // // RangeEnumerable.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs index 1998eabb085..6951c939b73 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Enumerables/RepeatEnumerable.cs @@ -7,7 +7,7 @@ // // RepeatEnumerable.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs index 97559c5fd41..feebc57bf3f 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/ArrayMergeHelper.cs @@ -7,7 +7,7 @@ // // ArrayMergeHelper.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs index 599f13ae481..b76d1e42705 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/AsynchronousChannelMergeEnumerator.cs @@ -7,7 +7,7 @@ // // AsynchronousChannelMergeEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs index d1115094aa8..b288fffec16 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/DefaultMergeHelper.cs @@ -7,7 +7,7 @@ // // DefaultMergeHelper.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -32,7 +32,7 @@ namespace System.Linq.Parallel private QueryTaskGroupState m_taskGroupState; // State shared among tasks. private PartitionedStream<TInputOutput, TIgnoreKey> m_partitions; // Source partitions. private AsynchronousChannel<TInputOutput>[] m_asyncChannels; // Destination channels (async). - private SynchronousChannel<TInputOutput>[] m_syncChannels; // Destination channels ([....]). + private SynchronousChannel<TInputOutput>[] m_syncChannels; // Destination channels (sync). private IEnumerator<TInputOutput> m_channelEnumerator; // Output enumerator. private TaskScheduler m_taskScheduler; // The task manager to execute the query. private bool m_ignoreOutput; // Whether we're enumerating "for effect". diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs index 862b053f9f9..fc9b5642417 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/IMergeHelper.cs @@ -7,7 +7,7 @@ // // ImergeHelper.cs // -// <OWNER>[....]</OWNER> +// <OWNER>igoro</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -32,4 +32,4 @@ namespace System.Linq.Parallel // Returns the merged output as an array. TInputOutput[] GetResultsAsArray(); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs index 8fac0d62c9e..da0298ce180 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeEnumerator.cs @@ -7,7 +7,7 @@ // // MergeEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs index f3136f12e33..2e0d8d90167 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/MergeExecutor.cs @@ -7,7 +7,7 @@ // // MergeExecutor.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs index d456534525d..b7015a48d73 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingMergeHelper.cs @@ -7,7 +7,7 @@ // // OrderPreservingMergeHelper.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs index f9fc2bc4907..5da2671db26 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/OrderPreservingPipeliningMergeHelper.cs @@ -7,7 +7,7 @@ // // OrderPreservingPipeliningMergeHelper.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs index ba302d41696..0bdc6ea7c4c 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Merging/SynchronousChannelMergeEnumerator.cs @@ -7,7 +7,7 @@ // // SynchronousChannelMergeEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs index 5f8cd482ee8..001eb1b3153 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionEnumerator.cs @@ -7,7 +7,7 @@ // // HashRepartitionEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs index 96aaf2d4cee..949e4f41974 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/HashRepartitionStream.cs @@ -7,7 +7,7 @@ // // HashPartitionedStream.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs index 748d853a731..d2f6a35cd47 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/IPartitionedStreamRecipient.cs @@ -7,7 +7,7 @@ // // IPartitionedStreamRecipient.cs // -// <OWNER>[....]</OWNER> +// <OWNER>igoro</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -22,4 +22,4 @@ namespace System.Linq.Parallel { void Receive<TKey>(PartitionedStream<TElement, TKey> partitionedStream); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs index 39ca3fb0320..35865feb936 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionEnumerator.cs @@ -7,7 +7,7 @@ // // OrderedHashRepartitionEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs index f12862e8fe8..dfd79fd6891 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/OrderedHashRepartitionStream.cs @@ -7,7 +7,7 @@ // // OrderedHashRepartitionStream.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs index e9f639c79d2..2f661a9e36f 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedDataSource.cs @@ -7,7 +7,7 @@ // // PartitionedDataSource.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs index dd6c687fea9..fc7477fe3b3 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/PartitionedStream.cs @@ -7,7 +7,7 @@ // // PartitionedStream.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs index b8d1e6be923..7edc4d07da8 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Partitioning/UnorderedHashRepartitionStream.cs @@ -7,7 +7,7 @@ // // UnorderedHashRepartitionStream.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs index 6df8e3e6c08..add046683ad 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/AssociativeAggregationOperator.cs @@ -7,7 +7,7 @@ // // AssociativeAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs index d84be6b56c2..c8a8d2206ab 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ExceptQueryOperator.cs @@ -7,7 +7,7 @@ // // ExceptQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs index a56fe2f6710..60b6befd6a5 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/GroupJoinQueryOperator.cs @@ -7,7 +7,7 @@ // // GroupJoinQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs index 88196b52650..e09d4d92b33 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/HashJoinQueryOperatorEnumerator.cs @@ -7,7 +7,7 @@ // // HashJoinQueryOperatorEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs index 86979515448..3ce35c451c4 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/IntersectQueryOperator.cs @@ -7,7 +7,7 @@ // // IntersectQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs index a80990550f2..9dbd672ec47 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/JoinQueryOperator.cs @@ -7,7 +7,7 @@ // // JoinQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs index c2d07020d58..8251ef54946 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/UnionQueryOperator.cs @@ -7,7 +7,7 @@ // // UnionQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs index 3b2d74cfdcb..3465f80d43d 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Binary/ZipQueryOperator.cs @@ -7,7 +7,7 @@ // // ZipQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs index f159f1c2575..3beed03e1ec 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/BinaryQueryOperator.cs @@ -7,7 +7,7 @@ // // BinaryQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs index 84ae158c3c8..95b660b22f5 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/CountAggregationOperator.cs @@ -7,7 +7,7 @@ // // CountAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs index f7e86aaa2fe..d321018d7c0 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // DecimalAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs index 55e2f78e885..eaa22795ffd 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // DecimalMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs index 17d0658b9cd..30560fecc3a 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DecimalSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // DecimalSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs index 5d6aa8e41a8..dba1e102131 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // DoubleAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs index 85c2e84cc23..a7cd5df6580 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // DoubleMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs index c464be0957f..b2477cfd7d0 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/DoubleSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // DoubleSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs index 8d310b488b4..d2d294f1f0b 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // FloatAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs index 1cc5d0d25b9..10be7b55eff 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // FloatMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs index 03949d7aa0e..ecf0656a9d2 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/FloatSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // FloatSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs index 31ba533d8cc..865ccaac7bd 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperator.cs @@ -7,7 +7,7 @@ // // InlinedAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs index 416844cfbec..b53d200df55 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/InlinedAggregationOperatorEnumerator.cs @@ -7,7 +7,7 @@ // // InlinedAggregationOperatorEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs index 9733071e8c3..88a779aeb6c 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // IntAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs index 5bd686ab5d1..469a9034603 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // IntMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs index f57f4ec529c..28b5048b0c3 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/IntSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // IntSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs index 61478be33bc..3de0feed309 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // LongAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs index 4332cee8375..1c1ecc3a3ad 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongCountAggregationOperator.cs @@ -7,7 +7,7 @@ // // CountAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs index 0c7bdfbd861..bb45b5b837d 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // LongMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs index df856cc34bf..bc29d47ba62 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/LongSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // LongSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs index 246aa40dcd3..cdaf0301e96 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableDecimalAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs index 8d78b129de1..abbacb4e2fc 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableDecimalMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs index 2602c9eb2eb..5c32e0cc871 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDecimalSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableDecimalSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs index 69b52aaa373..44eb13ad651 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableDoubleAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs index 7b44277649e..a2a7fcb3e4a 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableDoubleMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs index 9f92f75d1ea..f1ced299faa 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableDoubleSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableDoubleSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs index 2b7c0d4524a..b33baf58aa3 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableFloatAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs index b1b8064e067..8180ef53427 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableFloatMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs index d2ea8a423d3..d4aa289c0f7 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableFloatSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableFloatSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs index 4604a595f5b..ea9bcd10da3 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableIntAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs index 5c57d26b0b0..6ff77bd7ed9 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableIntMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs index c00fdb01d69..14389d8fc1b 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableIntSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableIntSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs index ddf75c89fee..bacb98750b6 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongAverageAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableLongAverageAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs index 7d4e369d90c..824bb98a49e 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongMinMaxAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableLongMinMaxAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs index 97e53a64eaa..313e7c18255 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Inlined/NullableLongSumAggregationOperator.cs @@ -7,7 +7,7 @@ // // NullableLongSumAggregationOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs index 55069c3b3cf..e55d313c01d 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ListQueryResults.cs @@ -7,7 +7,7 @@ // // ListQueryResults.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs index 33baf3f8056..27f7bf886b4 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/OrderingQueryOperator.cs @@ -7,7 +7,7 @@ // // OrderingQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs index 1bef24bedac..8ddc796458a 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Options/QueryExecutionOption.cs @@ -7,7 +7,7 @@ // // QueryExecutionOption.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs index 62660a567c0..c928a13d31c 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/OrdinalIndexState.cs @@ -7,7 +7,7 @@ // // OrdinalIndexState.cs // -// <OWNER>[....]</OWNER> +// <OWNER>igoro</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -23,4 +23,4 @@ namespace System.Linq.Parallel Increasing = 2, // Indices of elements are increasing. Within each partition, elements are in the correct order. Shuffled = 3, // Indices are of arbitrary type. Elements appear in an arbitrary order in each partition. } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs index 282c6cd90c2..77682f6954e 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionedStreamMerger.cs @@ -7,7 +7,7 @@ // // PartitionedStreamMerger.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs index c239cb7e4f4..62ed43dba2c 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/PartitionerQueryOperator.cs @@ -7,7 +7,7 @@ // // PartitionerQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs index 570b9e4ab05..c268cf512f8 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOpeningEnumerator.cs @@ -7,7 +7,7 @@ // // QueryOpeningEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -110,7 +110,7 @@ namespace System.Linq.Parallel { // To keep the MoveNext method body small, the code that executes first time only is in a separate method. // It appears that if the method becomes too large, we observe a performance regression. This may have - // to do with method inlining. See bug 706485. + // to do with method inlining. See OpenQuery(); } diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs index c83015bb314..60d656c1e02 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperator.cs @@ -7,7 +7,7 @@ // // QueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs index db776f87878..6f78b8177a5 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryOperatorEnumerator.cs @@ -7,7 +7,7 @@ // // QueryOperatorEnumerator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs index cee66591f77..d062a698ec3 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QueryResults.cs @@ -7,7 +7,7 @@ // // QueryResults.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs index 08f410f9821..8782d8fd0e0 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/QuerySettings.cs @@ -7,7 +7,7 @@ // // QuerySettings.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -149,8 +149,8 @@ namespace System.Linq.Parallel //Initialize a new QuerySettings structure and copy in the current settings. //Note: this has the very important effect of newing a fresh CancellationSettings, // and _not_ copying in the current internalCancellationSource or topLevelDisposedFlag which should not be - // propogated to internal query executions. (This affects SelectMany execution and specifically fixes bug:535510) - // The fresh toplevel parameters are used instead. + // propogated to internal query executions. (This affects SelectMany execution and specifically fixes + QuerySettings settings = new QuerySettings(TaskScheduler, DegreeOfParallelism, CancellationState.ExternalCancellationToken, ExecutionMode, MergeOptions); Contract.Assert(topLevelCancellationTokenSource != null, "There should always be a top-level cancellation signal specified."); diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs index e70b13e18a9..1310302c208 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/ScanQueryOperator.cs @@ -7,7 +7,7 @@ // // ScanQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs index fd4b201e7c5..2dc5b284f3c 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/AnyAllSearchOperator.cs @@ -7,7 +7,7 @@ // // AnyAllSearchOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs index d55436affb5..4f07a9f2ebc 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ConcatQueryOperator.cs @@ -7,7 +7,7 @@ // // ConcatQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs index 78de1005198..b417480520b 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ContainsSearchOperator.cs @@ -7,7 +7,7 @@ // // ContainsSearchOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs index 9a03469950e..6611cc28063 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DefaultIfEmptyQueryOperator.cs @@ -7,7 +7,7 @@ // // DefaultIfEmptyQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs index 4de47cea4e9..fc5ecd5f7eb 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/DistinctQueryOperator.cs @@ -7,7 +7,7 @@ // // DistinctQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs index 0560b753f52..70660e9fc8f 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ElementAtQueryOperator.cs @@ -7,7 +7,7 @@ // // ElementAtQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs index 38c143c5f13..8181237ca9f 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/FirstQueryOperator.cs @@ -7,7 +7,7 @@ // // FirstQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs index 86761040257..825d755f494 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ForAllOperator.cs @@ -7,7 +7,7 @@ // // ForAllQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs index ed3b2f44066..ab4d272540d 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/GroupByQueryOperator.cs @@ -7,7 +7,7 @@ // // GroupByQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs index f1d0e5ef3e5..1a304e4598b 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedSelectQueryOperator.cs @@ -7,7 +7,7 @@ // // IndexedSelectQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs index a4d65f3cfb6..fddb9926020 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/IndexedWhereQueryOperator.cs @@ -7,7 +7,7 @@ // // IndexedWhereQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs index 8b354de110a..f4a74d0c71a 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/LastQueryOperator.cs @@ -7,7 +7,7 @@ // // LastQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs index d66add1195f..9f4a4eece69 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/ReverseQueryOperator.cs @@ -7,7 +7,7 @@ // // ReverseQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs index 741bb24cd86..8a4c0f3e7d1 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectManyQueryOperator.cs @@ -7,7 +7,7 @@ // // SelectManyQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs index 2301c1d0646..7eaa46765f1 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SelectQueryOperator.cs @@ -7,7 +7,7 @@ // // SelectQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs index d5539ceaf8d..c2cb9d451fa 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SingleQueryOperator.cs @@ -7,7 +7,7 @@ // // SingleQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs index b73b8bd0829..af64f227ae7 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/SortQueryOperator.cs @@ -7,7 +7,7 @@ // // SortQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs index c0c708a7c38..67a70ce8f18 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipQueryOperator.cs @@ -7,7 +7,7 @@ // // TakeOrSkipQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs index a04bf2bfb9c..64f089adc01 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/TakeOrSkipWhileQueryOperator.cs @@ -7,7 +7,7 @@ // // TakeOrSkipWhileQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs index 3ec343a9f0f..d447915d871 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/Unary/WhereQueryOperator.cs @@ -7,7 +7,7 @@ // // WhereQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs index b66aa49f721..0baa5ad628d 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/QueryOperators/UnaryQueryOperator.cs @@ -7,7 +7,7 @@ // // UnaryQueryOperator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs index c084abb4b73..e84bced8117 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/CancellationState.cs @@ -7,7 +7,7 @@ // // CancellationState.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // A bag of cancellation-related items that are passed around as a group. // diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs index f1e99baedb4..a402e317e92 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingPipeliningSpoolingTask.cs @@ -7,7 +7,7 @@ // // OrderPreservingPipeliningSpoolingTask.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs index 478533db208..20c75157119 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/OrderPreservingSpoolingTask.cs @@ -7,7 +7,7 @@ // // OrderPreservingSpoolingTask.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs index 92ead1bfb7f..3f0e70731b5 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryLifecycle.cs @@ -7,7 +7,7 @@ // // QueryLifecycle.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // A convenient place to put things associated with entire queries and their lifecycle events. // diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs index 97dc14d53cc..7ca188a354f 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTask.cs @@ -7,7 +7,7 @@ // // QueryTask.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -88,7 +88,7 @@ namespace System.Linq.Parallel } //----------------------------------------------------------------------------------- - // Common function called regardless of [....] or async execution. Just wraps some + // Common function called regardless of sync or async execution. Just wraps some // amount of tracing around the call to the real work API. // diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs index f3666afb068..9dbc359a725 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/QueryTaskGroupState.cs @@ -7,7 +7,7 @@ // // QueryTaskGroupState.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -98,9 +98,9 @@ namespace System.Linq.Parallel // There are four cases: // Case #1: Wait produced an exception that is not OCE(ct), or an AggregateException which is not full of OCE(ct) ==> We rethrow. // Case #2: External cancellation has been requested ==> we'll manually throw OCE(externalToken). - // Case #3a: We are servicing a call to Dispose() (and possibly also external cancellation has been requested).. simply return. See bug 695173 - // Case #3b: The enumerator has already been disposed (and possibly also external cancellation was requested). Throw an ODE. - // Case #4: No exceptions or explicit call to Dispose() by this caller ==> we just return. + // Case #3a: We are servicing a call to Dispose() (and possibly also external cancellation has been requested).. simply return. See + + // See also "InlinedAggregationOperator" which duplicates some of this logic for the aggregators. // See also "QueryOpeningEnumerator" which duplicates some of this logic. @@ -153,7 +153,7 @@ namespace System.Linq.Parallel // 2. tokenCancellationRequested is backed by a volatile field, hence the reads below // won't get reordered about the read of token.IsCancellationRequested. - // If the query has already been disposed, we don't want to throw an OCE (this is a fix for bug 695173.) + // If the query has already been disposed, we don't want to throw an OCE (this is a fix for if (!m_cancellationState.TopLevelDisposedFlag.Value) { CancellationState.ThrowWithStandardMessageIfCanceled(m_cancellationState.ExternalCancellationToken); // Case #2 diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs index f43d3fdd52f..306b5411b33 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/Scheduling.cs @@ -7,7 +7,7 @@ // // Scheduling.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // Infrastructure for setting up concurrent work, marshaling exceptions, determining // the recommended degree-of-parallelism, and so forth. diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs index ab614a04733..a8016015088 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTask.cs @@ -7,7 +7,7 @@ // // SpoolingTask.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs index fdbe37adf1e..26d878fe0bc 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Scheduling/SpoolingTaskBase.cs @@ -7,7 +7,7 @@ // // SpoolingTaskBase.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs index fc3855ea7be..8eb45c4ba21 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/CancellableEnumerable.cs @@ -7,7 +7,7 @@ // // CancellableEnumerable.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs index 7423b7edab9..1a9b354fea2 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExceptionAggregator.cs @@ -7,7 +7,7 @@ // // ExceptionAggregator.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs index 7df87b5a4cf..c52cec2fabf 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ExchangeUtilities.cs @@ -7,7 +7,7 @@ // // ExchangeUtilities.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs index 74f4f6fb636..43547483f5b 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/FixedMaxHeap.cs @@ -7,7 +7,7 @@ // // FixedMaxHeap.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs index 7e431a8d215..ccb3d1f97a2 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/GrowingArray.cs @@ -7,7 +7,7 @@ // // GrowingArray.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs index 5cbd0bb5e60..8251e6c6bea 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/HashLookup.cs @@ -7,7 +7,7 @@ // // HashLookup.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs index 2b0b099c6d9..8ae36104498 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ListChunk.cs @@ -7,7 +7,7 @@ // // ListChunk.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs index e3b1561f616..4b7a65c5cff 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Lookup.cs @@ -7,7 +7,7 @@ // // Lookup.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs index 294a86d542b..bbfec3cd6e7 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PLINQETWProvider.cs @@ -7,7 +7,7 @@ // // PlinqEtwProvider.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // EventSource for PLINQ. // diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs index 57ed99389bd..0c8ed3672e0 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Pair.cs @@ -7,7 +7,7 @@ // // Pair.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs index 99cf8fd1d65..ea0cc96ad13 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/PairComparer.cs @@ -7,7 +7,7 @@ // // PairComparer.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs index b9ad3cced19..e8e81bd325a 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/ReverseComparer.cs @@ -7,7 +7,7 @@ // // ReverseComparer.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs index ebe1953110b..28da58a616d 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Shared.cs @@ -7,7 +7,7 @@ // // Shared.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs index fb355997295..dba1de364e8 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Sorting.cs @@ -7,7 +7,7 @@ // // Sorting.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // Support for sorting. // diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs index 5c1ad9f452d..00202eb30bc 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/TraceHelpers.cs @@ -7,7 +7,7 @@ // // TraceHelpers.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // Common routines used to trace information about execution, the state of things, etc. // diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs index b877250e9b4..7ccdf8f5e4a 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Util.cs @@ -7,7 +7,7 @@ // // Util.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -33,12 +33,12 @@ namespace System.Linq.Parallel } //----------------------------------------------------------------------------------- - // This is a temporary workaround for a VSWhidbey bug 601998 in the X64 JIT compiler. - // Unlike the X86 JIT, null checks on value types aren't optimized away in Whidbey. - // That means using the GenericComparer<K> infrastructure results in boxing value - // types. This kills performance all over the place. This bug has been fixed in - // Orcas (2.0 SP1), so once we're on the SP1 runtime, this can be removed. - // + // This is a temporary workaround for a VSWhidbey + + + + + internal static Comparer<TKey> GetDefaultComparer<TKey>() { diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs index c96085b02b3..4878dedf2b7 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/Wrapper.cs @@ -7,7 +7,7 @@ // // Wrapper.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs index c2cb403cec4..38fa75ba4bc 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/Parallel/Utils/WrapperEqualityComparer.cs @@ -7,7 +7,7 @@ // // WrapperEqualityComparer.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs b/mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs index 89dd8d7697b..daa567abe08 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/ParallelEnumerable.cs @@ -7,7 +7,7 @@ // // ParallelEnumerable.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // The standard IEnumerable-based LINQ-to-Objects query provider. This class basically // mirrors the System.Linq.Enumerable class, but (1) takes as input a special "parallel diff --git a/mcs/class/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs b/mcs/class/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs index 1447b87013d..fe09a4a7e99 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/ParallelExecutionMode.cs @@ -7,7 +7,7 @@ // // ParallelQueryExecutionMode.cs // -// <OWNER>[....]</OWNER> +// <OWNER>igoro</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- diff --git a/mcs/class/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs b/mcs/class/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs index ea6b174f759..5eeb15854c0 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/ParallelMergeOptions.cs @@ -7,7 +7,7 @@ // // ParallelMergeOptions.cs // -// <OWNER>[....]</OWNER> +// <OWNER>igoro</OWNER> // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -60,4 +60,4 @@ namespace System.Linq /// </summary> FullyBuffered = 3 } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs b/mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs index c26925aae8d..ebcd614d332 100644 --- a/mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs +++ b/mcs/class/referencesource/System.Core/System/Linq/SequenceQuery.cs @@ -96,7 +96,7 @@ namespace System.Linq { // critical (which was the original annotation when porting to silverlight) would violate // fxcop security rules if the interface isn't also critical. However, transparent code // can't access this anyway for Mix since we're not exposing AsQueryable(). - // [....]: the above assertion no longer holds. Now making AsQueryable() public again + // Microsoft: the above assertion no longer holds. Now making AsQueryable() public again // the security fallout of which will need to be re-examined. object IQueryProvider.Execute(Expression expression){ if (expression == null) diff --git a/mcs/class/referencesource/System.Core/System/Runtime/InteropServices/ComAwareEventInfo.cs b/mcs/class/referencesource/System.Core/System/Runtime/InteropServices/ComAwareEventInfo.cs index 6b61bbdd4d4..86ac682095c 100644 --- a/mcs/class/referencesource/System.Core/System/Runtime/InteropServices/ComAwareEventInfo.cs +++ b/mcs/class/referencesource/System.Core/System/Runtime/InteropServices/ComAwareEventInfo.cs @@ -18,6 +18,9 @@ namespace System.Runtime.InteropServices { #endregion #region protected overrides +#if FEATURE_NETCORE + [System.Security.SecuritySafeCritical] +#endif//FEATURE_NETCORE public override void AddEventHandler(object target, Delegate handler) { if (Marshal.IsComObject(target)) { // retrieve sourceIid and dispid @@ -25,9 +28,11 @@ namespace System.Runtime.InteropServices { int dispid; GetDataForComInvocation(_innerEventInfo, out sourceIid, out dispid); +#if FEATURE_CAS_POLICY // now validate the caller can call into native and redirect to ComEventHelpers.Combine SecurityPermission perm = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode); perm.Demand(); +#endif//FEATURE_CAS_POLICY System.Runtime.InteropServices.ComEventsHelper.Combine(target, sourceIid, dispid, handler); } else { // we are dealing with a managed object - just add the delegate through reflection @@ -35,6 +40,9 @@ namespace System.Runtime.InteropServices { } } +#if FEATURE_NETCORE + [System.Security.SecuritySafeCritical] +#endif//FEATURE_NETCORE public override void RemoveEventHandler(object target, Delegate handler) { if (Marshal.IsComObject(target)) { // retrieve sourceIid and dispid @@ -42,9 +50,11 @@ namespace System.Runtime.InteropServices { int dispid; GetDataForComInvocation(_innerEventInfo, out sourceIid, out dispid); +#if FEATURE_CAS_POLICY // now validate the caller can call into native and redirect to ComEventHelpers.Combine SecurityPermission perm = new SecurityPermission(SecurityPermissionFlag.UnmanagedCode); perm.Demand(); +#endif//FEATURE_CAS_POLICY System.Runtime.InteropServices.ComEventsHelper.Remove(target, sourceIid, dispid, handler); } else { // we are dealing with a managed object - just add the delegate through relection diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/Aes.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/Aes.cs index 981e08887cf..913e423fd39 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/Aes.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/Aes.cs @@ -5,4 +5,4 @@ // ==--== // moved to mscorlib.dll -[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Aes))] +[assembly:System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Security.Cryptography.Aes))]
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs index 284990875ac..bea786468a9 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/AesCryptoServiceProvider.cs @@ -6,6 +6,9 @@ using System; using System.Collections.Generic; +#if FEATURE_CORESYSTEM +using System.Core; +#endif using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; @@ -67,7 +70,7 @@ namespace System.Security.Cryptography { /// Value of the symmetric key used for encryption / decryption /// </summary> public override byte[] Key { - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] get { Contract.Ensures(m_key != null && !m_key.IsInvalid && !m_key.IsClosed); @@ -84,7 +87,7 @@ namespace System.Security.Cryptography { return keyValue; } - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] set { Contract.Ensures(m_key != null && !m_key.IsInvalid && !m_key.IsClosed); @@ -120,7 +123,7 @@ namespace System.Security.Cryptography { public override int KeySize { get { return base.KeySize; } - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] set { base.KeySize = value; @@ -136,7 +139,7 @@ namespace System.Security.Cryptography { /// Create an object to perform AES decryption with the current key and IV /// </summary> /// <returns></returns> - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] public override ICryptoTransform CreateDecryptor() { Contract.Ensures(Contract.Result<ICryptoTransform>() != null); @@ -151,7 +154,7 @@ namespace System.Security.Cryptography { /// <summary> /// Create an object to perform AES decryption with the given key and IV /// </summary> - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] public override ICryptoTransform CreateDecryptor(byte[] key, byte[] iv) { Contract.Ensures(Contract.Result<ICryptoTransform>() != null); @@ -197,7 +200,7 @@ namespace System.Security.Cryptography { /// <summary> /// Create an object to do AES encryption with the current key and IV /// </summary> - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] public override ICryptoTransform CreateEncryptor() { Contract.Ensures(Contract.Result<ICryptoTransform>() != null); @@ -217,7 +220,7 @@ namespace System.Security.Cryptography { /// <summary> /// Create an object to do AES encryption with the given key and IV /// </summary> - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] public override ICryptoTransform CreateEncryptor(byte[] key, byte[] iv) { Contract.Ensures(Contract.Result<ICryptoTransform>() != null); @@ -263,7 +266,7 @@ namespace System.Security.Cryptography { /// <summary> /// Release any CAPI handles we're holding onto /// </summary> - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] protected override void Dispose(bool disposing) { Contract.Ensures(!disposing || m_key == null || m_key.IsClosed); Contract.Ensures(!disposing || m_cspHandle == null || m_cspHandle.IsClosed); @@ -360,7 +363,7 @@ namespace System.Security.Cryptography { /// <summary> /// Generate a new random key /// </summary> - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] public override void GenerateKey() { Contract.Ensures(m_key != null && !m_key.IsInvalid & !m_key.IsClosed); @@ -393,7 +396,7 @@ namespace System.Security.Cryptography { /// <summary> /// Generate a random initialization vector /// </summary> - [System.Security.SecurityCritical] + [System.Security.SecuritySafeCritical] [SuppressMessage("Microsoft.Security", "CA2122:DoNotIndirectlyExposeMethodsWithLinkDemands", Justification = "Reviewed")] public override void GenerateIV() { Contract.Ensures(IVValue != null && IVValue.Length == BlockSizeValue / 8); diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs index 7272e139ab3..b4cc86876f3 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/BCryptNative.cs @@ -15,6 +15,28 @@ using Microsoft.Win32; using Microsoft.Win32.SafeHandles; namespace System.Security.Cryptography { + + internal enum AsymmetricPaddingMode { + /// <summary> + /// No padding + /// </summary> + None = 1, // BCRYPT_PAD_NONE + + /// <summary> + /// PKCS #1 padding + /// </summary> + Pkcs1 = 2, // BCRYPT_PAD_PKCS1 + + /// <summary> + /// Optimal Asymmetric Encryption Padding + /// </summary> + Oaep = 4, // BCRYPT_PAD_OAEP + + /// <summary> + /// Probabilistic Signature Scheme padding + /// </summary> + Pss = 8 // BCRYPT_PAD_PSS + } /// <summary> /// Native interop with CNG's BCrypt layer. Native definitions can be found in bcrypt.h /// </summary> @@ -34,6 +56,29 @@ namespace System.Security.Cryptography { public const string Sha256 = "SHA256"; // BCRYPT_SHA256_ALGORITHM public const string Sha384 = "SHA384"; // BCRYPT_SHA384_ALGORITHM public const string Sha512 = "SHA512"; // BCRYPT_SHA512_ALGORITHM + internal const string Rsa = "RSA"; // BCRYPT_RSA_ALGORITHM + } + + /// <summary> + /// Well known key blob tyes + /// </summary> + internal static class KeyBlobType { + //During Win8 Windows introduced BCRYPT_PUBLIC_KEY_BLOB L"PUBLICBLOB" + //and #define BCRYPT_PRIVATE_KEY_BLOB L"PRIVATEBLOB". We should use the + //same on ProjectN and ProjectK + internal const string RsaFullPrivateBlob = "RSAFULLPRIVATEBLOB"; // BCRYPT_RSAFULLPRIVATE_BLOB + internal const string RsaPrivateBlob = "RSAPRIVATEBLOB"; // BCRYPT_RSAPRIVATE_BLOB + internal const string RsaPublicBlob = "RSAPUBLICBLOB"; // BCRYPT_PUBLIC_KEY_BLOB + } + + [StructLayout(LayoutKind.Sequential)] + internal struct BCRYPT_RSAKEY_BLOB { + internal KeyBlobMagicNumber Magic; + internal int BitLength; + internal int cbPublicExp; + internal int cbModulus; + internal int cbPrime1; + internal int cbPrime2; } /// <summary> @@ -61,7 +106,35 @@ namespace System.Security.Cryptography { ECDHPublicP521 = 0x354B4345, // BCRYPT_ECDH_PUBLIC_P521_MAGIC ECDsaPublicP256 = 0x31534345, // BCRYPT_ECDSA_PUBLIC_P256_MAGIC ECDsaPublicP384 = 0x33534345, // BCRYPT_ECDSA_PUBLIC_P384_MAGIC - ECDsaPublicP521 = 0x35534345 // BCRYPT_ECDSA_PUBLIC_P521_MAGIC + ECDsaPublicP521 = 0x35534345, // BCRYPT_ECDSA_PUBLIC_P521_MAGIC + RsaPublic = 0x31415352, // BCRYPT_RSAPUBLIC_MAGIC + RsaPrivate = 0x32415352, // BCRYPT_RSAPRIVATE_MAGIC + RsaFullPrivateMagic = 0x33415352, //BCRYPT_RSAFULLPRIVATE_MAGIC + KeyDataBlob = 0x4d42444b // BCRYPT_KEY_DATA_BLOB_MAGIC + } + + [StructLayout(LayoutKind.Sequential)] + internal struct BCRYPT_OAEP_PADDING_INFO { + [MarshalAs(UnmanagedType.LPWStr)] + internal string pszAlgId; + + internal IntPtr pbLabel; + + internal int cbLabel; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct BCRYPT_PKCS1_PADDING_INFO { + [MarshalAs(UnmanagedType.LPWStr)] + internal string pszAlgId; + } + + [StructLayout(LayoutKind.Sequential)] + internal struct BCRYPT_PSS_PADDING_INFO { + [MarshalAs(UnmanagedType.LPWStr)] + internal string pszAlgId; + + internal int cbSalt; } /// <summary> diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CapiNative.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CapiNative.cs index eaf838ec1ee..b9f7080affc 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CapiNative.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CapiNative.cs @@ -5,14 +5,19 @@ // ==--== using System; +#if FEATURE_CORESYSTEM +using System.Core; +#endif using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Diagnostics.Contracts; using System.Globalization; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using System.Security; -using System.Diagnostics.Contracts; +using System.Text; using Microsoft.Win32.SafeHandles; namespace System.Security.Cryptography { @@ -171,15 +176,62 @@ namespace System.Security.Cryptography { public fixed byte szName[20]; } + internal const uint ALG_CLASS_SIGNATURE = (1 << 13); + internal const uint ALG_TYPE_RSA = (2 << 9); + internal const uint ALG_SID_RSA_ANY = 0; + internal const uint ALG_SID_DSS_ANY = 0; + internal const uint ALG_TYPE_DSS = (1 << 9); + internal const uint ALG_CLASS_KEY_EXCHANGE = (5 << 13); + + internal const uint CALG_RSA_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_RSA | ALG_SID_RSA_ANY); + internal const uint CALG_DSS_SIGN = (ALG_CLASS_SIGNATURE | ALG_TYPE_DSS | ALG_SID_DSS_ANY); + internal const uint CALG_RSA_KEYX = (ALG_CLASS_KEY_EXCHANGE | ALG_TYPE_RSA | ALG_SID_RSA_ANY); + internal const uint CNG_RSA_PUBLIC_KEY_BLOB = 72; + + internal const uint X509_ASN_ENCODING = 0x00000001; + internal const uint PKCS_7_ASN_ENCODING = 0x00010000; + + internal const uint CRYPT_OID_INFO_OID_KEY = 1; + + internal const uint LMEM_FIXED = 0x0000; + internal const uint LMEM_ZEROINIT = 0x0040; + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] + internal struct CRYPT_OID_INFO { + internal CRYPT_OID_INFO(int size) { + cbSize = (uint)size; + pszOID = null; + pwszName = null; + dwGroupId = 0; + Algid = 0; + ExtraInfo = new CRYPTOAPI_BLOB(); + } + internal uint cbSize; + [MarshalAs(UnmanagedType.LPStr)] + internal string pszOID; + internal string pwszName; + internal uint dwGroupId; + internal uint Algid; + internal CRYPTOAPI_BLOB ExtraInfo; + } + + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#else #pragma warning disable 618 // Have not migrated to v4 transparency yet [SecurityCritical(SecurityCriticalScope.Everything)] #pragma warning restore 618 +#endif [SuppressUnmanagedCodeSecurity] internal static class UnsafeNativeMethods { /// <summary> /// Calculate the public key token for a given public key /// </summary> [DllImport("clr")] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern int _AxlPublicKeyBlobToPublicKeyToken(ref CRYPTOAPI_BLOB pCspPublicKeyBlob, [Out] out SafeAxlBufferHandle ppwszPublicKeyToken); @@ -189,6 +241,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true, CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptAcquireContext([Out] out SafeCspHandle phProv, string pszContainer, string pszProvider, @@ -200,6 +255,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptCreateHash(SafeCspHandle hProv, AlgorithmId Algid, SafeCapiKeyHandle hKey, @@ -211,6 +269,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptDecrypt(SafeCapiKeyHandle hKey, SafeCapiHashHandle hHash, [MarshalAs(UnmanagedType.Bool)] bool Final, @@ -222,9 +283,14 @@ namespace System.Security.Cryptography { /// Duplicate a key handle /// </summary> [DllImport("advapi32")] +#if !FEATURE_CORESYSTEM [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] +#endif [SuppressUnmanagedCodeSecurity] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptDuplicateKey(SafeCapiKeyHandle hKey, IntPtr pdwReserved, int dwFlags, @@ -235,6 +301,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptEncrypt(SafeCapiKeyHandle hKey, SafeCapiHashHandle hHash, [MarshalAs(UnmanagedType.Bool)] bool Final, @@ -248,6 +317,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptExportKey(SafeCapiKeyHandle hKey, SafeCapiKeyHandle hExpKey, int dwBlobType, // (int)KeyBlobType @@ -259,6 +331,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptGenKey(SafeCspHandle hProv, AlgorithmId Algid, KeyFlags dwFlags, @@ -269,6 +344,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptGenRandom(SafeCspHandle hProv, int dwLen, [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbBuffer); @@ -278,6 +356,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptGetHashParam(SafeCapiHashHandle hHash, HashParameter dwParam, [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbData, @@ -289,6 +370,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptGetProvParam(SafeCspHandle hProv, ProviderParameter dwParam, IntPtr pbData, @@ -300,6 +384,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptHashData(SafeCapiHashHandle hHash, [MarshalAs(UnmanagedType.LPArray)] byte[] pbData, int dwDataLen, @@ -310,6 +397,9 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptImportKey(SafeCspHandle hProv, [MarshalAs(UnmanagedType.LPArray)] byte[] pbData, int dwDataLen, @@ -322,10 +412,76 @@ namespace System.Security.Cryptography { /// </summary> [DllImport("advapi32", SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif public static extern bool CryptSetKeyParam(SafeCapiKeyHandle hKey, KeyParameter dwParam, [MarshalAs(UnmanagedType.LPArray)] byte[] pbData, int dwFlags); + + //Added for X509Certificate extension support +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("CRYPT32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal extern static + IntPtr CryptFindOIDInfo( + [In] uint dwKeyType, + [In] IntPtr pvKey, + [In] OidGroup dwGroupId); + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("CRYPT32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal extern static + IntPtr CryptFindOIDInfo( + [In] uint dwKeyType, + [In] SafeLocalAllocHandle pvKey, + [In] OidGroup dwGroupId); + + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal static extern + bool CryptDecodeObject( + [In] uint dwCertEncodingType, + [In] IntPtr lpszStructType, + [In] IntPtr pbEncoded, + [In] uint cbEncoded, + [In] uint dwFlags, + [In, Out] SafeLocalAllocHandle pvStructInfo, + [In, Out] IntPtr pcbStructInfo); + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("Crypt32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal static extern + bool CryptDecodeObject( + [In] uint dwCertEncodingType, + [In] IntPtr lpszStructType, + [In] byte[] pbEncoded, + [In] uint cbEncoded, + [In] uint dwFlags, + [In, Out] SafeLocalAllocHandle pvStructInfo, + [In, Out] IntPtr pcbStructInfo); +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [DllImport("KERNEL32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [ResourceExposure(ResourceScope.None)] + internal static extern + SafeLocalAllocHandle LocalAlloc( + [In] uint uFlags, + [In] IntPtr sizetdwBytes); } // @@ -627,5 +783,239 @@ namespace System.Security.Cryptography { throw new CryptographicException(Marshal.GetLastWin32Error()); } } + + //Wrapper methods for certificate extensions + + /// <summary> + /// Local alloc wrapper. + /// </summary> + /// <param name="uFlags"></param> + /// <param name="sizetdwBytes"></param> + /// <returns></returns> + [SecuritySafeCritical] + internal static SafeLocalAllocHandle LocalAlloc(uint uFlags, IntPtr sizetdwBytes) { + SafeLocalAllocHandle safeLocalAllocHandle = UnsafeNativeMethods.LocalAlloc(uFlags, sizetdwBytes); + if (safeLocalAllocHandle == null || safeLocalAllocHandle.IsInvalid) { + throw new OutOfMemoryException(); + } + return safeLocalAllocHandle; + } + + /// <summary> + /// + /// </summary> + /// <param name="pszStructType"></param> + /// <param name="pbEncoded"></param> + /// <param name="cbEncoded"></param> + /// <param name="decodedValue"></param> + /// <param name="cbDecodedValue"></param> + /// <returns></returns> + [SecuritySafeCritical] + internal static unsafe bool DecodeObject(IntPtr pszStructType, + IntPtr pbEncoded, + uint cbEncoded, + out SafeLocalAllocHandle decodedValue, + out uint cbDecodedValue) + { + // Initialize out parameters + decodedValue = SafeLocalAllocHandle.InvalidHandle; + cbDecodedValue = 0; + + // Decode + uint cbDecoded = 0; + SafeLocalAllocHandle ptr = SafeLocalAllocHandle.InvalidHandle; + if (!UnsafeNativeMethods.CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + pszStructType, + pbEncoded, + cbEncoded, + 0, + ptr, + new IntPtr(&cbDecoded))) { + return false; + } + ptr = LocalAlloc(LMEM_FIXED, new IntPtr(cbDecoded)); + + if (!UnsafeNativeMethods.CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + pszStructType, + pbEncoded, + cbEncoded, + 0, + ptr, + new IntPtr(&cbDecoded))) { + return false; + } + // Return decoded values + decodedValue = ptr; + cbDecodedValue = cbDecoded; + + return true; + } + + /// <summary> + /// + /// </summary> + /// <param name="pszStructType"></param> + /// <param name="pbEncoded"></param> + /// <param name="decodedValue"></param> + /// <param name="cbDecodedValue"></param> + /// <returns></returns> + [SecuritySafeCritical] + internal static unsafe bool DecodeObject(IntPtr pszStructType, + byte[] pbEncoded, + out SafeLocalAllocHandle decodedValue, + out uint cbDecodedValue) + { + // Initialize out parameters + decodedValue = SafeLocalAllocHandle.InvalidHandle; + cbDecodedValue = 0; + + // Decode + uint cbDecoded = 0; + SafeLocalAllocHandle pbDecoded = SafeLocalAllocHandle.InvalidHandle; + + if (!UnsafeNativeMethods.CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + pszStructType, + pbEncoded, + (uint)pbEncoded.Length, + 0, + pbDecoded, + new IntPtr(&cbDecoded))) { + return false; + } + pbDecoded = LocalAlloc(LMEM_FIXED, new IntPtr(cbDecoded)); + if (!UnsafeNativeMethods.CryptDecodeObject(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, + pszStructType, + pbEncoded, + (uint)pbEncoded.Length, + 0, + pbDecoded, + new IntPtr(&cbDecoded))) { + return false; + } + // Return decoded values + decodedValue = pbDecoded; + cbDecodedValue = cbDecoded; + + return true; + } + + /// <summary> + /// + /// </summary> + /// <param name="dwKeyType"></param> + /// <param name="pvKey"></param> + /// <param name="dwGroupId"></param> + /// <returns></returns> + [SecuritySafeCritical] + internal static CRYPT_OID_INFO CryptFindOIDInfo( + [In] uint dwKeyType, + [In] IntPtr pvKey, + [In] OidGroup dwGroupId) { + + if (pvKey == IntPtr.Zero) { + throw new ArgumentNullException("pvKey"); + } + CRYPT_OID_INFO pOIDInfo = new CRYPT_OID_INFO(Marshal.SizeOf(typeof(CRYPT_OID_INFO))); + IntPtr pv = UnsafeNativeMethods.CryptFindOIDInfo(dwKeyType, + pvKey, + dwGroupId); + + if (pv != IntPtr.Zero) { + pOIDInfo = (CRYPT_OID_INFO)Marshal.PtrToStructure(pv, typeof(CRYPT_OID_INFO)); + } + return pOIDInfo; + } + + /// <summary> + /// + /// </summary> + /// <param name="dwKeyType"></param> + /// <param name="pvKey"></param> + /// <param name="dwGroupId"></param> + /// <returns></returns> + [SecuritySafeCritical] + internal static CRYPT_OID_INFO CryptFindOIDInfo( + [In] uint dwKeyType, + [In] SafeLocalAllocHandle pvKey, + [In] OidGroup dwGroupId) { + + if (pvKey == null) { + throw new ArgumentNullException("pvKey"); + } + if (pvKey.IsInvalid) { + throw new CryptographicException("SR.GetString(SR.Cryptography_InvalidHandle)", "pvKey"); + } + CRYPT_OID_INFO pOIDInfo = new CRYPT_OID_INFO(Marshal.SizeOf(typeof(CRYPT_OID_INFO))); + IntPtr pv = UnsafeNativeMethods.CryptFindOIDInfo(dwKeyType, + pvKey, + dwGroupId); + + if (pv != IntPtr.Zero) { + pOIDInfo = (CRYPT_OID_INFO)Marshal.PtrToStructure(pv, typeof(CRYPT_OID_INFO)); + } + return pOIDInfo; + } + } + + /// <summary> + /// Safe local handle class + /// </summary> + internal sealed class SafeLocalAllocHandle : SafeHandleZeroOrMinusOneIsInvalid { + [SecuritySafeCritical] + private SafeLocalAllocHandle() + : base(true) { + } + + [DllImport("kernel32.dll")] + private static extern IntPtr LocalFree(IntPtr hMem); + + [SecuritySafeCritical] + internal T Read<T>(int offset) where T : struct { + bool addedRef = false; + RuntimeHelpers.PrepareConstrainedRegions(); + try { + DangerousAddRef(ref addedRef); + unsafe { + IntPtr pBase = new IntPtr((byte*)handle.ToPointer() + offset); + return (T)Marshal.PtrToStructure(pBase, typeof(T)); + } + } + finally { + if (addedRef) { + DangerousRelease(); + } + } + } + + [SecuritySafeCritical] + protected override bool ReleaseHandle() { + return LocalFree(handle) == IntPtr.Zero; + } + + [SecuritySafeCritical] + internal SafeLocalAllocHandle(IntPtr handle) + : base(true) { + SetHandle(handle); + } + + internal static SafeLocalAllocHandle InvalidHandle { + [SecuritySafeCritical] + get { return new SafeLocalAllocHandle(IntPtr.Zero); } + } + } + + /// <summary> + /// + /// </summary> + internal class X509Utils { + + [SecuritySafeCritical] + internal static SafeLocalAllocHandle StringToAnsiPtr(string s) { + byte[] arr = new byte[s.Length + 1]; + Encoding.ASCII.GetBytes(s, 0, s.Length, arr, 0); + SafeLocalAllocHandle pb = CapiNative.LocalAlloc(CapiNative.LMEM_FIXED, new IntPtr(arr.Length)); + Marshal.Copy(arr, 0, pb.DangerousGetHandle(), arr.Length); + return pb; + } } } diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CapiSymmetricAlgorithm.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CapiSymmetricAlgorithm.cs index 7f153167019..490e61651f2 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CapiSymmetricAlgorithm.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CapiSymmetricAlgorithm.cs @@ -5,6 +5,9 @@ // ==--== using System; +#if FEATURE_CORESYSTEM +using System.Core; +#endif using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs index 45c8bcd3493..bb161cb53f2 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngAlgorithm.cs @@ -28,7 +28,8 @@ namespace System.Security.Cryptography { private static volatile CngAlgorithm s_sha256; private static volatile CngAlgorithm s_sha384; private static volatile CngAlgorithm s_sha512; - + private static volatile CngAlgorithm s_rsa; + private string m_algorithm; public CngAlgorithm(string algorithm) { @@ -99,6 +100,16 @@ namespace System.Security.Cryptography { // Well known algorithms // + public static CngAlgorithm Rsa { + get { + Contract.Ensures(Contract.Result<CngAlgorithm>() != null); + if (s_rsa == null) { + s_rsa = new CngAlgorithm(BCryptNative.AlgorithmName.Rsa); + } + return s_rsa; + } + } + public static CngAlgorithm ECDiffieHellmanP256 { get { Contract.Ensures(Contract.Result<CngAlgorithm>() != null); diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs index 5c850ed0b8c..13ea41c2fb2 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/CngKey.cs @@ -126,10 +126,19 @@ namespace System.Security.Cryptography { Contract.Assert(m_keyHandle != null); bool foundProperty; - byte[] ephemeralProperty = NCryptNative.GetProperty(m_keyHandle, - NCryptNative.KeyPropertyName.ClrIsEphemeral, - CngPropertyOptions.CustomProperty, - out foundProperty); + byte[] ephemeralProperty = null; + try { + ephemeralProperty = NCryptNative.GetProperty(m_keyHandle, + NCryptNative.KeyPropertyName.ClrIsEphemeral, + CngPropertyOptions.CustomProperty, + out foundProperty); + } + catch (CryptographicException) { + // Third party Key providers, and Windows PCP KSP won't recognize this property; + // and Win32 layer does not enforce error return contract. + // Therefore, they can return whatever error code they think appropriate. + return false; + } return foundProperty && ephemeralProperty != null && diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs index ce1c1740597..d8cfcb4b52f 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/ECKeyXmlFormat.cs @@ -16,4 +16,4 @@ namespace System.Security.Cryptography { /// </summary> Rfc4050 } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs index 47586cf5ecb..162e0bb883e 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/NCryptNative.cs @@ -129,7 +129,8 @@ namespace System.Security.Cryptography { BadSignature = unchecked((int)0x80090006), // NTE_BAD_SIGNATURE NotFound = unchecked((int)0x80090011), // NTE_NOT_FOUND KeyDoesNotExist = unchecked((int)0x80090016), // NTE_BAD_KEYSET - BufferTooSmall = unchecked((int)0x80090028) // NTE_BUFFER_TOO_SMALL + BufferTooSmall = unchecked((int)0x80090028), // NTE_BUFFER_TOO_SMALL + NoMoreItems = unchecked((int)0x8009002a) // NTE_NO_MORE_ITEMS } /// <summary> @@ -380,8 +381,137 @@ namespace System.Security.Cryptography { [MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, int cbSignature, int dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, + [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pPaddingInfo, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbHashValue, + int cbHashValue, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, + int cbSignature, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptSignHash(SafeNCryptKeyHandle hKey, + [In] ref BCryptNative.BCRYPT_PSS_PADDING_INFO pPaddingInfo, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbHashValue, + int cbHashValue, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, + int cbSignature, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, + [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pPaddingInfo, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbHashValue, + int cbHashValue, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, + int cbSignature, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptVerifySignature(SafeNCryptKeyHandle hKey, + [In] ref BCryptNative.BCRYPT_PSS_PADDING_INFO pPaddingInfo, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbHashValue, + int cbHashValue, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbSignature, + int cbSignature, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput, + int cbInput, + [In] ref BCryptNative.BCRYPT_OAEP_PADDING_INFO pvPadding, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + int cbOutput, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptDecrypt(SafeNCryptKeyHandle hKey, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput, + int cbInput, + [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pvPadding, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + int cbOutput, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput, + int cbInput, + [In] ref BCryptNative.BCRYPT_OAEP_PADDING_INFO pvPadding, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + int cbOutput, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); + + [DllImport("ncrypt.dll")] + internal static extern ErrorCode NCryptEncrypt(SafeNCryptKeyHandle hKey, + [In, MarshalAs(UnmanagedType.LPArray)] byte[] pbInput, + int cbInput, + [In] ref BCryptNative.BCRYPT_PKCS1_PADDING_INFO pvPadding, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pbOutput, + int cbOutput, + [Out] out int pcbResult, + AsymmetricPaddingMode dwFlags); } + + /// <summary> + /// Adapter to wrap specific NCryptDecrypt P/Invokes with specific padding info + /// </summary> + [SecuritySafeCritical] + private delegate ErrorCode NCryptDecryptor<T>(SafeNCryptKeyHandle hKey, + byte[] pbInput, + int cbInput, + ref T pvPadding, + byte[] pbOutput, + int cbOutput, + out int pcbResult, + AsymmetricPaddingMode dwFlags); + + /// <summary> + /// Adapter to wrap specific NCryptEncrypt P/Invokes with specific padding info + /// </summary> + [SecuritySafeCritical] + private delegate ErrorCode NCryptEncryptor<T>(SafeNCryptKeyHandle hKey, + byte[] pbInput, + int cbInput, + ref T pvPadding, + byte[] pbOutput, + int cbOutput, + out int pcbResult, + AsymmetricPaddingMode dwFlags); + + /// <summary> + /// Adapter to wrap specific NCryptSignHash P/Invokes with a specific padding info + /// </summary> + [SecuritySafeCritical] + private delegate ErrorCode NCryptHashSigner<T>(SafeNCryptKeyHandle hKey, + ref T pvPaddingInfo, + byte[] pbHashValue, + int cbHashValue, + byte[] pbSignature, + int cbSignature, + out int pcbResult, + AsymmetricPaddingMode dwFlags); + + /// <summary> + /// Adapter to wrap specific NCryptVerifySignature P/Invokes with a specific padding info + /// </summary> + [SecuritySafeCritical] + private delegate ErrorCode NCryptSignatureVerifier<T>(SafeNCryptKeyHandle hKey, + ref T pvPaddingInfo, + byte[] pbHashValue, + int cbHashValue, + byte[] pbSignature, + int cbSignature, + AsymmetricPaddingMode dwFlags) where T : struct; + // // Utility and wrapper functions // @@ -389,6 +519,335 @@ namespace System.Security.Cryptography { private static volatile bool s_haveNcryptSupported; private static volatile bool s_ncryptSupported; + + /// <summary> + /// Generic decryption method, wrapped by decryption calls for specific padding modes + /// </summary> + [SecuritySafeCritical] + private static byte[] DecryptData<T>(SafeNCryptKeyHandle key, + byte[] data, + ref T paddingInfo, + AsymmetricPaddingMode paddingMode, + NCryptDecryptor<T> decryptor) where T : struct { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(data != null, "data != null"); + Debug.Assert(decryptor != null, "decryptor != null"); + + // Figure out how big of a buffer is needed to store the decrypted data + int decryptedSize = 0; + ErrorCode error = decryptor(key, + data, + data.Length, + ref paddingInfo, + null, + 0, + out decryptedSize, + paddingMode); + if (error != ErrorCode.Success && error != ErrorCode.BufferTooSmall) { + throw new CryptographicException((int)error); + } + + // Do the decryption + byte[] decrypted = new byte[decryptedSize]; + error = decryptor(key, + data, + data.Length, + ref paddingInfo, + decrypted, + decrypted.Length, + out decryptedSize, + paddingMode); + if (error != ErrorCode.Success) { + throw new CryptographicException((int)error); + } + return decrypted; + } + + /// <summary> + /// Decrypt data using PKCS1 padding + /// </summary> + [SecuritySafeCritical] + internal static byte[] DecryptDataPkcs1(SafeNCryptKeyHandle key, byte[] data) { + BCryptNative.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new BCryptNative.BCRYPT_PKCS1_PADDING_INFO(); + + return DecryptData(key, + data, + ref pkcs1Info, + AsymmetricPaddingMode.Pkcs1, + UnsafeNativeMethods.NCryptDecrypt); + } + + /// <summary> + /// Decrypt data using OAEP padding + /// </summary> + [SecuritySafeCritical] + internal static byte[] DecryptDataOaep(SafeNCryptKeyHandle key, + byte[] data, + string hashAlgorithm) { + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + + BCryptNative.BCRYPT_OAEP_PADDING_INFO oaepInfo = new BCryptNative.BCRYPT_OAEP_PADDING_INFO(); + oaepInfo.pszAlgId = hashAlgorithm; + + return DecryptData(key, + data, + ref oaepInfo, + AsymmetricPaddingMode.Oaep, + UnsafeNativeMethods.NCryptDecrypt); + } + + /// <summary> + /// Generic encryption method, wrapped by decryption calls for specific padding modes + /// </summary> + [SecuritySafeCritical] + private static byte[] EncryptData<T>(SafeNCryptKeyHandle key, + byte[] data, + ref T paddingInfo, + AsymmetricPaddingMode paddingMode, + NCryptEncryptor<T> encryptor) where T : struct { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(data != null, "data != null"); + Debug.Assert(encryptor != null, "encryptor != null"); + + // Figure out how big of a buffer is to encrypt the data + int encryptedSize = 0; + ErrorCode error = encryptor(key, + data, + data.Length, + ref paddingInfo, + null, + 0, + out encryptedSize, + paddingMode); + if (error != ErrorCode.Success && error != ErrorCode.BufferTooSmall) { + throw new CryptographicException((int)error); + } + + // Do the encryption + byte[] encrypted = new byte[encryptedSize]; + error = encryptor(key, + data, + data.Length, + ref paddingInfo, + encrypted, + encrypted.Length, + out encryptedSize, + paddingMode); + if (error != ErrorCode.Success) { + throw new CryptographicException((int)error); + } + + return encrypted; + } + + /// <summary> + /// Encrypt data using OAEP padding + /// </summary> + [SecuritySafeCritical] + internal static byte[] EncryptDataOaep(SafeNCryptKeyHandle key, + byte[] data, + string hashAlgorithm) { + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + + BCryptNative.BCRYPT_OAEP_PADDING_INFO oaepInfo = new BCryptNative.BCRYPT_OAEP_PADDING_INFO(); + oaepInfo.pszAlgId = hashAlgorithm; + + return EncryptData(key, + data, + ref oaepInfo, + AsymmetricPaddingMode.Oaep, + UnsafeNativeMethods.NCryptEncrypt); + } + + /// <summary> + /// Encrypt data using PKCS1 padding + /// </summary> + [SecuritySafeCritical] + internal static byte[] EncryptDataPkcs1(SafeNCryptKeyHandle key, byte[] data) { + BCryptNative.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new BCryptNative.BCRYPT_PKCS1_PADDING_INFO(); + + return EncryptData(key, + data, + ref pkcs1Info, + AsymmetricPaddingMode.Pkcs1, + UnsafeNativeMethods.NCryptEncrypt); + } + + /// <summary> + /// Generic signature method, wrapped by signature calls for specific padding modes + /// </summary> + [SecuritySafeCritical] + private static byte[] SignHash<T>(SafeNCryptKeyHandle key, + byte[] hash, + ref T paddingInfo, + AsymmetricPaddingMode paddingMode, + NCryptHashSigner<T> signer) where T : struct { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsInvalid && !key.IsClosed, "!key.IsInvalid && !key.IsClosed"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(signer != null, "signer != null"); + + // Figure out how big the signature is + int signatureSize = 0; + ErrorCode error = signer(key, + ref paddingInfo, + hash, + hash.Length, + null, + 0, + out signatureSize, + paddingMode); + if (error != ErrorCode.Success && error != ErrorCode.BufferTooSmall) { + throw new CryptographicException((int)error); + } + + // Sign the hash + byte[] signature = new byte[signatureSize]; + error = signer(key, + ref paddingInfo, + hash, + hash.Length, + signature, + signature.Length, + out signatureSize, + paddingMode); + if (error != ErrorCode.Success) { + throw new CryptographicException((int)error); + } + return signature; + } + + /// <summary> + /// Sign a hash, using PKCS1 padding + /// </summary> + [SecuritySafeCritical] + internal static byte[] SignHashPkcs1(SafeNCryptKeyHandle key, + byte[] hash, + string hashAlgorithm) { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + + BCryptNative.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new BCryptNative.BCRYPT_PKCS1_PADDING_INFO(); + pkcs1Info.pszAlgId = hashAlgorithm; + + return SignHash(key, + hash, + ref pkcs1Info, + AsymmetricPaddingMode.Pkcs1, + UnsafeNativeMethods.NCryptSignHash); + } + + /// <summary> + /// Sign a hash, using PSS padding + /// </summary> + [SecuritySafeCritical] + internal static byte[] SignHashPss(SafeNCryptKeyHandle key, + byte[] hash, + string hashAlgorithm, + int saltBytes) { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + Debug.Assert(saltBytes >= 0, "saltBytes >= 0"); + + BCryptNative.BCRYPT_PSS_PADDING_INFO pssInfo = new BCryptNative.BCRYPT_PSS_PADDING_INFO(); + pssInfo.pszAlgId = hashAlgorithm; + pssInfo.cbSalt = saltBytes; + + return SignHash(key, + hash, + ref pssInfo, + AsymmetricPaddingMode.Pss, + UnsafeNativeMethods.NCryptSignHash); + } + + /// <summary> + /// Generic signature verification method, wrapped by verification calls for specific padding modes + /// </summary> + [SecuritySafeCritical] + private static bool VerifySignature<T>(SafeNCryptKeyHandle key, + byte[] hash, + byte[] signature, + ref T paddingInfo, + AsymmetricPaddingMode paddingMode, + NCryptSignatureVerifier<T> verifier) where T : struct { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(signature != null, "signature != null"); + Debug.Assert(verifier != null, "verifier != null"); + + ErrorCode error = verifier(key, + ref paddingInfo, + hash, + hash.Length, + signature, + signature.Length, + paddingMode); + if (error != ErrorCode.Success && error != ErrorCode.BadSignature) { + throw new CryptographicException((int)error); + } + + return error == ErrorCode.Success; + } + + /// <summary> + /// Verify the signature of a hash using PKCS #1 padding + /// </summary> + [SecuritySafeCritical] + internal static bool VerifySignaturePkcs1(SafeNCryptKeyHandle key, + byte[] hash, + string hashAlgorithm, + byte[] signature) { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + Debug.Assert(signature != null, "signature != null"); + + BCryptNative.BCRYPT_PKCS1_PADDING_INFO pkcs1Info = new BCryptNative.BCRYPT_PKCS1_PADDING_INFO(); + pkcs1Info.pszAlgId = hashAlgorithm; + + return VerifySignature(key, + hash, + signature, + ref pkcs1Info, + AsymmetricPaddingMode.Pkcs1, + UnsafeNativeMethods.NCryptVerifySignature); + } + + /// <summary> + /// Verify the signature of a hash using PSS padding + /// </summary> + [SecuritySafeCritical] + internal static bool VerifySignaturePss(SafeNCryptKeyHandle key, + byte[] hash, + string hashAlgorithm, + int saltBytes, + byte[] signature) { + Debug.Assert(key != null, "key != null"); + Debug.Assert(!key.IsClosed && !key.IsInvalid, "!key.IsClosed && !key.IsInvalid"); + Debug.Assert(hash != null, "hash != null"); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm), "!String.IsNullOrEmpty(hashAlgorithm)"); + Debug.Assert(signature != null, "signature != null"); + + BCryptNative.BCRYPT_PSS_PADDING_INFO pssInfo = new BCryptNative.BCRYPT_PSS_PADDING_INFO(); + pssInfo.pszAlgId = hashAlgorithm; + pssInfo.cbSalt = saltBytes; + + return VerifySignature(key, + hash, + signature, + ref pssInfo, + AsymmetricPaddingMode.Pss, + UnsafeNativeMethods.NCryptVerifySignature); + } + /// <summary> /// Determine if NCrypt is supported on the current machine /// </summary> @@ -484,9 +943,7 @@ namespace System.Security.Cryptography { if (error != ErrorCode.Success) { throw new CryptographicException((int)error); } - - // Key handles are no longer valid after deleting - key.Dispose(); + key.SetHandleAsInvalid(); } /// <summary> diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs new file mode 100644 index 00000000000..3085b90e249 --- /dev/null +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/RsaCng.cs @@ -0,0 +1,508 @@ +using System; +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.IO; +using System.Runtime.InteropServices; +using System.Security.Permissions; +using Microsoft.Win32.SafeHandles; + +namespace System.Security.Cryptography +{ + public sealed class RSACng : RSA + { + // See https://msdn.microsoft.com/en-us/library/windows/desktop/bb931354(v=vs.85).aspx + private static KeySizes[] s_legalKeySizes = new KeySizes[] { new KeySizes(512, 16384, 64) }; + + // CngKeyBlob formats for RSA key blobs + private static CngKeyBlobFormat s_rsaFullPrivateBlob = new CngKeyBlobFormat(BCryptNative.KeyBlobType.RsaFullPrivateBlob); + private static CngKeyBlobFormat s_rsaPrivateBlob = new CngKeyBlobFormat(BCryptNative.KeyBlobType.RsaPrivateBlob); + private static CngKeyBlobFormat s_rsaPublicBlob = new CngKeyBlobFormat(BCryptNative.KeyBlobType.RsaPublicBlob); + + // Key handle + private CngKey _key; + + /// <summary> + /// Create an RSACng algorithm with a random 2048 bit key pair. + /// </summary> + public RSACng() : this(2048) { } + + /// <summary> + /// Creates a new RSACng object that will use a randomly generated key of the specified size. + /// Valid key sizes range from 384 to 16384 bits, in increments of 8. It's suggested that a + /// minimum size of 2048 bits be used for all keys. + /// </summary> + /// <param name="keySize">Size of the key to generate, in bits.</param> + /// <exception cref="CryptographicException">if <paramref name="keySize" /> is not valid</exception> + public RSACng(int keySize) + { + LegalKeySizesValue = s_legalKeySizes; + KeySize = keySize; + } + + /// <summary> + /// Creates a new RSACng object that will use the specified key. The key's + /// <see cref="CngKey.AlgorithmGroup" /> must be Rsa. + /// CngKey.Open creates a copy of the key. Even if someone disposes the key passed + /// copy of this key object in RSA stays alive. + /// </summary> + /// <param name="key">Key to use for RSA operations</param> + /// <exception cref="ArgumentException">if <paramref name="key" /> is not an RSA key</exception> + /// <exception cref="ArgumentNullException">if <paramref name="key" /> is null.</exception> + [SecuritySafeCritical] + public RSACng(CngKey key) + { + if (key == null) + { + throw new ArgumentNullException("key"); + } + if (key.AlgorithmGroup != CngAlgorithmGroup.Rsa) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_ArgRSAaRequiresRSAKey), "key"); + } + LegalKeySizesValue = s_legalKeySizes; + Key = CngKey.Open(key.Handle, key.IsEphemeral ? CngKeyHandleOpenOptions.EphemeralKey : CngKeyHandleOpenOptions.None); + } + + /// <summary> + /// Gets the key that will be used by the RSA object for any cryptographic operation that it uses. + /// This key object will be disposed if the key is reset, for instance by changing the KeySize + /// property, using ImportParamers to create a new key, or by Disposing of the parent RSA object. + /// Therefore, you should make sure that the key object is no longer used in these scenarios. This + /// object will not be the same object as the CngKey passed to the RSACng constructor if that + /// constructor was used, however it will point at the same CNG key. + /// </summary> + /// <permission cref="SecurityPermission"> + /// SecurityPermission/UnmanagedCode is required to read this property. + /// </permission> + public CngKey Key + { + [SecuritySafeCritical] + get + { + // If our key size was changed from the key we're using, we need to generate a new key + if (_key != null && _key.KeySize != KeySize) + { + _key.Dispose(); + _key = null; + } + + // If we don't have a key yet, we need to generate a random one now + if (_key == null) + { + CngKeyCreationParameters creationParameters = new CngKeyCreationParameters(); + CngProperty keySizeProperty = new CngProperty(NCryptNative.KeyPropertyName.Length, + BitConverter.GetBytes(KeySize), + CngPropertyOptions.None); + creationParameters.Parameters.Add(keySizeProperty); + _key = CngKey.Create(CngAlgorithm.Rsa, null, creationParameters); + } + + return _key; + } + + private set + { + Debug.Assert(value != null, "value != null"); + if (value.AlgorithmGroup != CngAlgorithmGroup.Rsa) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_ArgRSAaRequiresRSAKey), "value"); + } + // If we already have a key, clear it out + if (_key != null) + { + _key.Dispose(); + } + + _key = value; + KeySize = _key.KeySize; + } + } + + /// <summary> + /// Helper property to get the NCrypt key handle + /// </summary> + private SafeNCryptKeyHandle KeyHandle + { + [SecuritySafeCritical] + get { return Key.Handle; } + } + + protected override void Dispose(bool disposing) + { + if (disposing && _key != null) + { + _key.Dispose(); + } + } + + protected override byte[] HashData(byte[] data, int offset, int count, HashAlgorithmName hashAlgorithm) + { + // we're sealed and the base should have checked this already + Debug.Assert(data != null); + Debug.Assert(offset >= 0 && offset <= data.Length); + Debug.Assert(count >= 0 && count <= data.Length); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); + + using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name), BCryptNative.ProviderName.MicrosoftPrimitiveProvider)) + { + hasher.HashCore(data, offset, count); + return hasher.HashFinal(); + } + } + + protected override byte[] HashData(Stream data, HashAlgorithmName hashAlgorithm) + { + // We're sealed and the base should have checked these alread. + Debug.Assert(data != null); + Debug.Assert(!String.IsNullOrEmpty(hashAlgorithm.Name)); + + using (BCryptHashAlgorithm hasher = new BCryptHashAlgorithm(new CngAlgorithm(hashAlgorithm.Name), BCryptNative.ProviderName.MicrosoftPrimitiveProvider)) + { + hasher.HashStream(data); + return hasher.HashFinal(); + } + } + + + /// <summary> + /// This function checks the magic value in the key blob header + /// </summary> + /// <param name="includePrivateParameters">Private blob if true else public key blob</param> + private void CheckMagicValueOfKey(int magic, bool includePrivateParameters) + { + if (false == includePrivateParameters) + { + if (magic != (int)BCryptNative.KeyBlobMagicNumber.RsaPublic) + { + //Check for Private key magic as public key can be derived from private key blob + if (magic != (int)BCryptNative.KeyBlobMagicNumber.RsaPrivate && magic != (int)BCryptNative.KeyBlobMagicNumber.RsaFullPrivateMagic) + { + throw new CryptographicException(SR.GetString(SR.Cryptography_NotValidPublicOrPrivateKey)); + } + } + } + //If includePrivateParameters is true then certainly check for the private key magic + else + { + if (magic != (int)BCryptNative.KeyBlobMagicNumber.RsaPrivate && magic != (int)BCryptNative.KeyBlobMagicNumber.RsaFullPrivateMagic) + { + throw new CryptographicException(SR.GetString(SR.Cryptography_NotValidPrivateKey)); + } + } + } + + // + // Key import and export + // + + /// <summary> + /// Exports the key used by the RSA object into an RSAParameters object. + /// </summary> + [SecuritySafeCritical] + public override RSAParameters ExportParameters(bool includePrivateParameters) + { + byte[] rsaBlob = Key.Export(includePrivateParameters ? s_rsaFullPrivateBlob : s_rsaPublicBlob); + RSAParameters rsaParams = new RSAParameters(); + + // + // We now have a buffer laid out as follows: + // BCRYPT_RSAKEY_BLOB header + // byte[cbPublicExp] publicExponent - Exponent + // byte[cbModulus] modulus - Modulus + // -- Private only -- + // byte[cbPrime1] prime1 - P + // byte[cbPrime2] prime2 - Q + // byte[cbPrime1] exponent1 - DP + // byte[cbPrime2] exponent2 - DQ + // byte[cbPrime1] coefficient - InverseQ + // byte[cbModulus] privateExponent - D + // + byte[] tempMagic = new byte[4]; + tempMagic[0] = rsaBlob[0]; tempMagic[1] = rsaBlob[1]; tempMagic[2] = rsaBlob[2]; tempMagic[3] = rsaBlob[3]; + int magic = BitConverter.ToInt32(tempMagic, 0); + //Check the magic value in key blob header. If blob does not have required magic + // then it trhows Cryptographic exception + CheckMagicValueOfKey(magic, includePrivateParameters); + + unsafe + { + fixed (byte* pRsaBlob = rsaBlob) + { + BCryptNative.BCRYPT_RSAKEY_BLOB* pBcryptBlob = (BCryptNative.BCRYPT_RSAKEY_BLOB*)pRsaBlob; + + int offset = Marshal.SizeOf(typeof(BCryptNative.BCRYPT_RSAKEY_BLOB)); + + // Read out the exponent + rsaParams.Exponent = new byte[pBcryptBlob->cbPublicExp]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.Exponent, 0, rsaParams.Exponent.Length); + offset += pBcryptBlob->cbPublicExp; + + // Read out the modulus + rsaParams.Modulus = new byte[pBcryptBlob->cbModulus]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.Modulus, 0, rsaParams.Modulus.Length); + offset += pBcryptBlob->cbModulus; + + if (includePrivateParameters) + { + // Read out P + rsaParams.P = new byte[pBcryptBlob->cbPrime1]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.P, 0, rsaParams.P.Length); + offset += pBcryptBlob->cbPrime1; + + // Read out Q + rsaParams.Q = new byte[pBcryptBlob->cbPrime2]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.Q, 0, rsaParams.Q.Length); + offset += pBcryptBlob->cbPrime2; + + // Read out DP + rsaParams.DP = new byte[pBcryptBlob->cbPrime1]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.DP, 0, rsaParams.DP.Length); + offset += pBcryptBlob->cbPrime1; + + // Read out DQ + rsaParams.DQ = new byte[pBcryptBlob->cbPrime2]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.DQ, 0, rsaParams.DQ.Length); + offset += pBcryptBlob->cbPrime2; + + // Read out InverseQ + rsaParams.InverseQ = new byte[pBcryptBlob->cbPrime1]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.InverseQ, 0, rsaParams.InverseQ.Length); + offset += pBcryptBlob->cbPrime1; + + // Read out D + rsaParams.D = new byte[pBcryptBlob->cbModulus]; + Buffer.BlockCopy(rsaBlob, offset, rsaParams.D, 0, rsaParams.D.Length); + offset += pBcryptBlob->cbModulus; + } + } + } + + return rsaParams; + } + + /// <summary> + /// <para> + /// ImportParameters will replace the existing key that RSACng is working with by creating a + /// new CngKey for the parameters structure. If the parameters structure contains only an + /// exponent and modulus, then only a public key will be imported. If the parameters also + /// contain P and Q values, then a full key pair will be imported. + /// </para> + /// </summary> + /// <exception cref="ArgumentException"> + /// if <paramref name="parameters" /> contains neither an exponent nor a modulus. + /// </exception> + /// <exception cref="CryptographicException"> + /// if <paramref name="parameters" /> is not a valid RSA key or if <paramref name="parameters" + /// /> is a full key pair and the default KSP is used. + /// </exception> + [SecuritySafeCritical] + public override void ImportParameters(RSAParameters parameters) + { + if (parameters.Exponent == null || parameters.Modulus == null) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_InvalidRsaParameters)); + } + bool publicOnly = parameters.P == null || parameters.Q == null; + + // + // We need to build a key blob structured as follows: + // BCRYPT_RSAKEY_BLOB header + // byte[cbPublicExp] publicExponent - Exponent + // byte[cbModulus] modulus - Modulus + // -- Private only -- + // byte[cbPrime1] prime1 - P + // byte[cbPrime2] prime2 - Q + // + + int blobSize = Marshal.SizeOf(typeof(BCryptNative.BCRYPT_RSAKEY_BLOB)) + + parameters.Exponent.Length + + parameters.Modulus.Length; + if (!publicOnly) + { + blobSize += parameters.P.Length + + parameters.Q.Length; + } + + byte[] rsaBlob = new byte[blobSize]; + unsafe + { + fixed (byte* pRsaBlob = rsaBlob) + { + // Build the header + BCryptNative.BCRYPT_RSAKEY_BLOB* pBcryptBlob = (BCryptNative.BCRYPT_RSAKEY_BLOB*)pRsaBlob; + pBcryptBlob->Magic = publicOnly ? BCryptNative.KeyBlobMagicNumber.RsaPublic : + BCryptNative.KeyBlobMagicNumber.RsaPrivate; + + pBcryptBlob->BitLength = parameters.Modulus.Length * 8; + + pBcryptBlob->cbPublicExp = parameters.Exponent.Length; + pBcryptBlob->cbModulus = parameters.Modulus.Length; + + if (!publicOnly) + { + pBcryptBlob->cbPrime1 = parameters.P.Length; + pBcryptBlob->cbPrime2 = parameters.Q.Length; + } + + int offset = Marshal.SizeOf(typeof(BCryptNative.BCRYPT_RSAKEY_BLOB)); + + // Copy the exponent + Buffer.BlockCopy(parameters.Exponent, 0, rsaBlob, offset, parameters.Exponent.Length); + offset += parameters.Exponent.Length; + + // Copy the modulus + Buffer.BlockCopy(parameters.Modulus, 0, rsaBlob, offset, parameters.Modulus.Length); + offset += parameters.Modulus.Length; + + if (!publicOnly) + { + // Copy P + Buffer.BlockCopy(parameters.P, 0, rsaBlob, offset, parameters.P.Length); + offset += parameters.P.Length; + + // Copy Q + Buffer.BlockCopy(parameters.Q, 0, rsaBlob, offset, parameters.Q.Length); + offset += parameters.Q.Length; + } + } + } + Key = CngKey.Import(rsaBlob, publicOnly ? s_rsaPublicBlob : s_rsaPrivateBlob); + } + + // + // Encryption and decryption + // + [SecuritySafeCritical] + public override byte[] Decrypt(byte[] data, RSAEncryptionPadding padding) + { + if (data == null) + { + throw new ArgumentNullException("data"); + } + + if (padding == null) + { + throw new ArgumentNullException("padding"); + } + + SafeNCryptKeyHandle keyHandle = Key.Handle; + + if (padding == RSAEncryptionPadding.Pkcs1) + { + return NCryptNative.DecryptDataPkcs1(keyHandle, data); + } + else if (padding.Mode == RSAEncryptionPaddingMode.Oaep) + { + return NCryptNative.DecryptDataOaep(keyHandle, data, padding.OaepHashAlgorithm.Name); + } + else + { + // no other padding possibilities at present, but we might version independently from more being added. + throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode)); + } + } + + [SecuritySafeCritical] + public override byte[] Encrypt(byte[] data, RSAEncryptionPadding padding) + { + if (data == null) + { + throw new ArgumentNullException("data"); + } + if (padding == null) + { + throw new ArgumentNullException("padding"); + } + + if (padding == RSAEncryptionPadding.Pkcs1) + { + return NCryptNative.EncryptDataPkcs1(KeyHandle, data); + } + else if (padding.Mode == RSAEncryptionPaddingMode.Oaep) + { + return NCryptNative.EncryptDataOaep(KeyHandle, data, padding.OaepHashAlgorithm.Name); + } + else + { + // no other padding possibilities at present, but we might version independently from more being added. + throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode)); + }; + } + + + // + // Signature APIs + // + + [SecuritySafeCritical] + public override byte[] SignHash(byte[] hash, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) + { + if (hash == null) + { + throw new ArgumentNullException("hash"); + } + if (String.IsNullOrEmpty(hashAlgorithm.Name)) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_HashAlgorithmNameNullOrEmpty), "hashAlgorithm"); + } + if (padding == null) + { + throw new ArgumentNullException("padding"); + } + + // Keep a local copy of the key. + CngKey key = Key; + SafeNCryptKeyHandle keyHandle = key.Handle; + + if (padding == RSASignaturePadding.Pkcs1) + { + return NCryptNative.SignHashPkcs1(keyHandle, hash, hashAlgorithm.Name); + } + else if (padding == RSASignaturePadding.Pss) + { + return NCryptNative.SignHashPss(keyHandle, hash, hashAlgorithm.Name, hash.Length); + } + else + { + // no other padding possibilities at present, but we might version independently from more being added. + throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode)); + + } + } + + [SecuritySafeCritical] + public override bool VerifyHash(byte[] hash, byte[] signature, HashAlgorithmName hashAlgorithm, RSASignaturePadding padding) + { + if (hash == null) + { + throw new ArgumentNullException("hash"); + } + if (signature == null) + { + throw new ArgumentNullException("signature"); + } + if (String.IsNullOrEmpty(hashAlgorithm.Name)) + { + throw new ArgumentException(SR.GetString(SR.Cryptography_HashAlgorithmNameNullOrEmpty), "hashAlgorithm"); + } + if (padding == null) + { + throw new ArgumentNullException("padding"); + } + + if (padding == RSASignaturePadding.Pkcs1) + { + return NCryptNative.VerifySignaturePkcs1(KeyHandle, hash, hashAlgorithm.Name, signature); + } + else if (padding == RSASignaturePadding.Pss) + { + return NCryptNative.VerifySignaturePss(KeyHandle, hash, hashAlgorithm.Name, hash.Length, signature); + } + else + { + // no other padding possibilities at present, but we might version independently from more being added. + throw new CryptographicException(SR.GetString(SR.Cryptography_UnsupportedPaddingMode)); + } + } + } +} diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/SignatureVerificationResult.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/SignatureVerificationResult.cs index e9314e90862..82482e92375 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/SignatureVerificationResult.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/SignatureVerificationResult.cs @@ -31,7 +31,7 @@ namespace System.Security.Cryptography { InvalidTimePeriodNesting = unchecked((int)0x800b0102), // CERT_E_VALIDITYPERIODNESTING InvalidCertificateRole = unchecked((int)0x800b0103), // CERT_E_ROLE PathLengthConstraintViolated = unchecked((int)0x800b0104), // CERT_E_PATHLENCONST - UnknownCriticalExtension = unchecked((int)0x800b0105), // CERT_E_ + UnknownCriticalExtension = unchecked((int)0x800b0105), // CERT_E_CRITICAL CertificateUsageNotAllowed = unchecked((int)0x800b0106), // CERT_E_PURPOSE IssuerChainingError = unchecked((int)0x800b0107), // CERT_E_ISSUERCHAINING CertificateMalformed = unchecked((int)0x800b0108), // CERT_E_MALFORMED @@ -47,4 +47,4 @@ namespace System.Security.Cryptography { InvalidCertificatePolicy = unchecked((int)0x800b0113), // CERT_E_INVALID_POLICY InvalidCertificateName = unchecked((int)0x800b0114) // CERT_E_INVALID_NAME } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/X509Certificates/RSACertificateExtensions.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/X509Certificates/RSACertificateExtensions.cs new file mode 100644 index 00000000000..c6379b50e1c --- /dev/null +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/X509Certificates/RSACertificateExtensions.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. + +using System.Runtime.InteropServices; +using Microsoft.Win32.SafeHandles; + +namespace System.Security.Cryptography.X509Certificates +{ + /// <summary> + /// Provides extension methods for retrieving <see cref="RSA" /> implementations for the + /// public and private keys of a <see cref="X509Certificate2" />. + /// </summary> + public static class RSACertificateExtensions + { + /// <summary> + /// Gets the <see cref="RSA" /> public key from the certificate or null if the certificate does not have an RSA public key. + /// </summary> + [SecuritySafeCritical] + public static RSA GetRSAPublicKey(this X509Certificate2 certificate) + { + if (certificate == null) + { + throw new ArgumentNullException("certificate"); + } + + if (!IsRSA(certificate)) + { + return null; + } + + PublicKey publicKey = certificate.PublicKey; + AsnEncodedData asn = publicKey.EncodedKeyValue; + IntPtr structType = new IntPtr(CapiNative.CNG_RSA_PUBLIC_KEY_BLOB); + + SafeLocalAllocHandle cngBlobHandle; + uint cngBlobLength; + bool result = CapiNative.DecodeObject(structType, asn.RawData, out cngBlobHandle, out cngBlobLength); + + if (!result) + { + throw new CryptographicException(Marshal.GetLastWin32Error()); + } + + byte[] cngBlob = new byte[cngBlobLength]; + using (cngBlobHandle) + { + Marshal.Copy(cngBlobHandle.DangerousGetHandle(), cngBlob, 0, cngBlob.Length); + } + + CngKey key = CngKey.Import(cngBlob, CngKeyBlobFormat.GenericPublicBlob); + return new RSACng(key); + } + + /// <summary> + /// Gets the <see cref="RSA" /> private key from the certificate or null if the certificate does not have an RSA private key. + /// </summary> + [SecuritySafeCritical] + public static RSA GetRSAPrivateKey(this X509Certificate2 certificate) + { + if (certificate == null) + { + throw new ArgumentNullException("certificate"); + } + + if (!certificate.HasPrivateKey || !IsRSA(certificate)) + { + return null; + } + + using (SafeCertContextHandle certificateContext = GetCertificateContext(certificate)) + using (SafeNCryptKeyHandle privateKeyHandle = X509Native.TryAcquireCngPrivateKey(certificateContext)) + { + if (privateKeyHandle == null) + { + // fall back to CAPI if we cannot acquire the key using CNG. + return (RSA)certificate.PrivateKey; + } + + CngKey key = CngKey.Open(privateKeyHandle, CngKeyHandleOpenOptions.None); + return new RSACng(key); + } + } + + private static bool IsRSA(X509Certificate2 certificate) + { + uint algorithmId = OidToAlgorithmId(certificate.PublicKey.Oid); + + switch (algorithmId) + { + case CapiNative.CALG_RSA_SIGN: + case CapiNative.CALG_RSA_KEYX: + return true; + default: + return false; + } + } + + private static uint OidToAlgorithmId(Oid oid) + { + using (SafeLocalAllocHandle oidHandle = X509Utils.StringToAnsiPtr(oid.Value)) + { + CapiNative.CRYPT_OID_INFO oidInfo = CapiNative.CryptFindOIDInfo(CapiNative.CRYPT_OID_INFO_OID_KEY, oidHandle, 0); + return oidInfo.Algid; + } + } + + // Gets a SafeHandle for the X509 certificate. The caller + // owns the returned handle and should dispose of it. It + // can be used independently of the lifetime of the original + // X509Certificate. + [SecuritySafeCritical] + private static SafeCertContextHandle GetCertificateContext(X509Certificate certificate) + { + SafeCertContextHandle certificateContext = X509Native.DuplicateCertContext(certificate.Handle); + + // Make sure to keep the X509Certificate object alive until after its certificate context is + // duplicated, otherwise it could end up being closed out from underneath us before we get a + // chance to duplicate the handle. + GC.KeepAlive(certificate); + + return certificateContext; + } + } +} diff --git a/mcs/class/referencesource/System.Core/System/Security/Cryptography/X509Certificates/X509Native.cs b/mcs/class/referencesource/System.Core/System/Security/Cryptography/X509Certificates/X509Native.cs index 3ff5fb4662f..13af6e370f8 100644 --- a/mcs/class/referencesource/System.Core/System/Security/Cryptography/X509Certificates/X509Native.cs +++ b/mcs/class/referencesource/System.Core/System/Security/Cryptography/X509Certificates/X509Native.cs @@ -5,18 +5,149 @@ // ==--== using System; +using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; +using System.Runtime.Versioning; using Microsoft.Win32.SafeHandles; +using System.Diagnostics; using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; namespace System.Security.Cryptography.X509Certificates { + + internal static partial class X509Native { + + /// <summary> + /// Determine if a certificate has a specific property + /// </summary> + [SecuritySafeCritical] + internal static bool HasCertificateProperty(SafeCertContextHandle certificateContext, + CertificateProperty property) { + Debug.Assert(certificateContext != null, "certificateContext != null"); + Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, + "!certificateContext.IsClosed && !certificateContext.IsInvalid"); + + byte[] buffer = null; + int bufferSize = 0; + bool gotProperty = UnsafeNativeMethods.CertGetCertificateContextProperty(certificateContext, + property, + buffer, + ref bufferSize); + return gotProperty || + (ErrorCode)Marshal.GetLastWin32Error() == ErrorCode.MoreData; + } + + /// <summary> + /// Get the NCrypt handle to the private key of a certificate + /// or null if the private key cannot be acquired by NCrypt. + /// </summary> + [SecuritySafeCritical] + internal static SafeNCryptKeyHandle TryAcquireCngPrivateKey(SafeCertContextHandle certificateContext) { + Debug.Assert(certificateContext != null, "certificateContext != null"); + Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, + "!certificateContext.IsClosed && !certificateContext.IsInvalid"); + + bool freeKey = true; + SafeNCryptKeyHandle privateKey = null; + RuntimeHelpers.PrepareConstrainedRegions(); + try { + int keySpec = 0; + if (!UnsafeNativeMethods.CryptAcquireCertificatePrivateKey(certificateContext, + AcquireCertificateKeyOptions.AcquireOnlyNCryptKeys, + IntPtr.Zero, + out privateKey, + out keySpec, + out freeKey)) { + return null; + } + + return privateKey; + } + finally { + // If we're not supposed to release they key handle, then we need to bump the reference count + // on the safe handle to correspond to the reference that Windows is holding on to. This will + // prevent the CLR from freeing the object handle. + // + // This is certainly not the ideal way to solve this problem - it would be better for + // SafeNCryptKeyHandle to maintain an internal bool field that we could toggle here and + // have that suppress the release when the CLR calls the ReleaseHandle override. However, that + // field does not currently exist, so we'll use this hack instead. + if (privateKey != null && !freeKey) { + bool addedRef = false; + privateKey.DangerousAddRef(ref addedRef); + } + } + } + + /// <summary> + /// Get an arbitrary property of a certificate + /// </summary> + [SecuritySafeCritical] + internal static byte[] GetCertificateProperty(SafeCertContextHandle certificateContext, + CertificateProperty property) { + Debug.Assert(certificateContext != null, "certificateContext != null"); + Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, + "!certificateContext.IsClosed && !certificateContext.IsInvalid"); + + byte[] buffer = null; + int bufferSize = 0; + if (!UnsafeNativeMethods.CertGetCertificateContextProperty(certificateContext, + property, + buffer, + ref bufferSize)) { + ErrorCode errorCode = (ErrorCode)Marshal.GetLastWin32Error(); + if (errorCode != ErrorCode.MoreData) { + throw new CryptographicException((int)errorCode); + } + } + + buffer = new byte[bufferSize]; + if (!UnsafeNativeMethods.CertGetCertificateContextProperty(certificateContext, + property, + buffer, + ref bufferSize)) { + throw new CryptographicException(Marshal.GetLastWin32Error()); + } + + return buffer; + } + + /// <summary> + /// Get a property of a certificate formatted as a structure + /// </summary> + [SecurityCritical] + internal static T GetCertificateProperty<T>(SafeCertContextHandle certificateContext, + CertificateProperty property) where T : struct { + Debug.Assert(certificateContext != null, "certificateContext != null"); + Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid, + "!certificateContext.IsClosed && !certificateContext.IsInvalid"); + + byte[] rawProperty = GetCertificateProperty(certificateContext, property); + Debug.Assert(rawProperty.Length >= Marshal.SizeOf(typeof(T)), "Property did not return expected structure"); + + unsafe { + fixed (byte* pRawProperty = &rawProperty[0]) { + return (T)Marshal.PtrToStructure(new IntPtr(pRawProperty), typeof(T)); + } + } + } + + /// <summary> + /// Duplicate the certificate context into a safe handle + /// </summary> + [SecuritySafeCritical] + internal static SafeCertContextHandle DuplicateCertContext(IntPtr context) { + Debug.Assert(context != IntPtr.Zero); + + return UnsafeNativeMethods.CertDuplicateCertificateContext(context); + } + } /// <summary> /// Native interop layer for X509 certificate and Authenticode functions. Native definitions can be /// found in wincrypt.h or msaxlapi.h /// </summary> - internal static class X509Native { + internal static partial class X509Native { /// <summary> /// Flags for CertVerifyAuthenticodeLicense /// </summary> @@ -31,6 +162,49 @@ namespace System.Security.Cryptography.X509Certificates { TrustMicrosoftRootOnly = 0x00000020 // AXL_TRUST_MICROSOFT_ROOT_ONLY } + /// <summary> + /// Flags for the CryptAcquireCertificatePrivateKey API + /// </summary> + internal enum AcquireCertificateKeyOptions { + None = 0x00000000, + AcquireOnlyNCryptKeys = 0x00040000, // CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG + } + + /// <summary> + /// Well known certificate property IDs + /// </summary> + internal enum CertificateProperty { + KeyProviderInfo = 2, // CERT_KEY_PROV_INFO_PROP_ID + KeyContext = 5, // CERT_KEY_CONTEXT_PROP_ID + } + + /// <summary> + /// Error codes returned from X509 APIs + /// </summary> + internal enum ErrorCode { + Success = 0x00000000, // ERROR_SUCCESS + MoreData = 0x000000ea, // ERROR_MORE_DATA + } + + [StructLayout(LayoutKind.Sequential)] + internal struct CRYPT_KEY_PROV_INFO { + [MarshalAs(UnmanagedType.LPWStr)] + internal string pwszContainerName; + + [MarshalAs(UnmanagedType.LPWStr)] + internal string pwszProvName; + + internal int dwProvType; + + internal int dwFlags; + + internal int cProvParam; + + internal IntPtr rgProvParam; // PCRYPT_KEY_PROV_PARAM + + internal int dwKeySpec; + } + [StructLayout(LayoutKind.Sequential)] [System.Security.Permissions.HostProtection(MayLeakOnAbort = true)] public struct AXL_AUTHENTICODE_SIGNER_INFO { @@ -96,6 +270,60 @@ namespace System.Security.Cryptography.X509Certificates { AxlVerificationFlags dwFlags, [In, Out] ref AXL_AUTHENTICODE_SIGNER_INFO pSignerInfo, [In, Out] ref AXL_AUTHENTICODE_TIMESTAMPER_INFO pTimestamperInfo); + + [DllImport("crypt32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool CertGetCertificateContextProperty(SafeCertContextHandle pCertContext, + CertificateProperty dwPropId, + [Out, MarshalAs(UnmanagedType.LPArray)] byte[] pvData, + [In, Out] ref int pcbData); + [DllImport("crypt32.dll")] + internal static extern SafeCertContextHandle CertDuplicateCertificateContext(IntPtr certContext); // CERT_CONTEXT * + + [DllImport("crypt32.dll", SetLastError = true)] + [return: MarshalAs(UnmanagedType.Bool)] + internal static extern bool CryptAcquireCertificatePrivateKey(SafeCertContextHandle pCert, + AcquireCertificateKeyOptions dwFlags, + IntPtr pvReserved, // void * + [Out] out SafeNCryptKeyHandle phCryptProvOrNCryptKey, + [Out] out int dwKeySpec, + [Out, MarshalAs(UnmanagedType.Bool)] out bool pfCallerFreeProvOrNCryptKey); + } + } + + internal sealed class SafeCertContextHandle : SafeHandleZeroOrMinusOneIsInvalid + { + [SecuritySafeCritical] + private SafeCertContextHandle() : base(true) { } + + // 0 is an Invalid Handle + [SecuritySafeCritical] + internal SafeCertContextHandle(IntPtr handle) + : base(true) + { + SetHandle(handle); + } + + internal static SafeCertContextHandle InvalidHandle + { + [SecuritySafeCritical] + get { return new SafeCertContextHandle(IntPtr.Zero); } + } + + [DllImport("Crypt32.dll", SetLastError = true), + ResourceExposure(ResourceScope.None)] + //#if !FEATURE_CORESYSTEM + // [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] + //#endif + private static extern bool CertFreeCertificateContext(IntPtr pCertContext); + +#if FEATURE_CORESYSTEM + [SecurityCritical] +#endif + [SecuritySafeCritical] + override protected bool ReleaseHandle() + { + return CertFreeCertificateContext(handle); } } } diff --git a/mcs/class/referencesource/System.Core/System/Security/ManifestKinds.cs b/mcs/class/referencesource/System.Core/System/Security/ManifestKinds.cs index 704367afa46..6dbd4ef65ea 100644 --- a/mcs/class/referencesource/System.Core/System/Security/ManifestKinds.cs +++ b/mcs/class/referencesource/System.Core/System/Security/ManifestKinds.cs @@ -14,4 +14,4 @@ namespace System.Security { Application = 0x00000002, ApplicationAndDeployment = Deployment | Application } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs b/mcs/class/referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs index fdca26ddea8..2e845069614 100644 --- a/mcs/class/referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs +++ b/mcs/class/referencesource/System.Core/System/threading/ReaderWriterLockSlim/LockRecursionException.cs @@ -13,7 +13,7 @@ // acquire a lock, because the particular lock kind doesn't // support it in its current state. // -// <OWNER>[....]</OWNER> +// <OWNER>emadali</OWNER> // ============================================================*/ diff --git a/mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs b/mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs index 2853b837a17..11c673bf587 100644 --- a/mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs +++ b/mcs/class/referencesource/System.Core/System/threading/Tasks/TaskExtensions.cs @@ -7,7 +7,7 @@ // // TaskExtensions.cs // -// <OWNER>[....]</OWNER> +// <OWNER>Microsoft</OWNER> // // Extensions to Task/Task<TResult> classes // |