diff options
Diffstat (limited to 'mcs/class/referencesource/System.ServiceModel/System/ServiceModel')
223 files changed, 1615 insertions, 912 deletions
diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs index 5688f5591ea..19c842d4e17 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Configuration/ServiceModelActivationSectionGroup.cs @@ -19,7 +19,7 @@ namespace System.ServiceModel.Activation.Configuration { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("config"); } -#pragma warning suppress 56506 // [....], Configuration.SectionGroups cannot be null +#pragma warning suppress 56506 // Microsoft, Configuration.SectionGroups cannot be null return (ServiceModelActivationSectionGroup)config.SectionGroups[ConfigurationStrings.SectionGroupName]; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs index 6e8d0191482..2b4bdc9f186 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/ListenerUnsafeNativeMethods.cs @@ -257,7 +257,7 @@ namespace System.ServiceModel.Activation protected override bool ReleaseHandle() { - // PreSharp Bug: Call 'Marshal.GetLastWin32Error' or 'Marshal.GetHRForLastWin32Error' before any other interop call. + // PreSharp #pragma warning suppress 56523 // We are not interested to throw an exception here. We can ignore the Last Error code. return CloseHandle(handle); } @@ -279,7 +279,7 @@ namespace System.ServiceModel.Activation override protected bool ReleaseHandle() { -#pragma warning suppress 56523 // [....], should only fail if there is a bug (invalid handle); MDA will be raised +#pragma warning suppress 56523 // Microsoft, should only fail if there is a return ListenerUnsafeNativeMethods.CloseServiceHandle(handle); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs index 32b1ecdc92b..9a011db9633 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Activation/Utility.cs @@ -33,7 +33,7 @@ namespace System.ServiceModel.Activation static SafeCloseHandle OpenCurrentProcessForWrite() { int processId = Process.GetCurrentProcess().Id; -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() SafeCloseHandle process = ListenerUnsafeNativeMethods.OpenProcess(ListenerUnsafeNativeMethods.PROCESS_QUERY_INFORMATION | ListenerUnsafeNativeMethods.WRITE_DAC | ListenerUnsafeNativeMethods.READ_CONTROL, false, processId); if (process.IsInvalid) { @@ -46,7 +46,7 @@ namespace System.ServiceModel.Activation static SafeCloseHandle OpenProcessForQuery(int pid) { -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() SafeCloseHandle process = ListenerUnsafeNativeMethods.OpenProcess(ListenerUnsafeNativeMethods.PROCESS_QUERY_INFORMATION, false, pid); if (process.IsInvalid) { @@ -99,7 +99,7 @@ namespace System.ServiceModel.Activation static SafeServiceHandle OpenSCManager() { -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() SafeServiceHandle scManager = ListenerUnsafeNativeMethods.OpenSCManager(null, null, ListenerUnsafeNativeMethods.SC_MANAGER_CONNECT); if (scManager.IsInvalid) { @@ -112,7 +112,7 @@ namespace System.ServiceModel.Activation static SafeServiceHandle OpenService(SafeServiceHandle scManager, string serviceName, int purpose) { -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() SafeServiceHandle service = ListenerUnsafeNativeMethods.OpenService(scManager, serviceName, purpose); if (service.IsInvalid) { @@ -249,7 +249,7 @@ namespace System.ServiceModel.Activation } } byte[] pSecurityDescriptor = new byte[lpnLengthNeeded]; -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() success = ListenerUnsafeNativeMethods.GetKernelObjectSecurity(kernelObject, ListenerUnsafeNativeMethods.DACL_SECURITY_INFORMATION, pSecurityDescriptor, pSecurityDescriptor.Length, out lpnLengthNeeded); if (!success) { @@ -273,7 +273,7 @@ namespace System.ServiceModel.Activation pSecurityDescriptor = new byte[lpnLengthNeeded]; securityDescriptor.GetBinaryForm(pSecurityDescriptor, 0); // set the SECURITY_DESCRIPTOR on the kernelObject -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() success = ListenerUnsafeNativeMethods.SetKernelObjectSecurity(kernelObject, ListenerUnsafeNativeMethods.DACL_SECURITY_INFORMATION, pSecurityDescriptor); if (!success) { @@ -419,7 +419,7 @@ namespace System.ServiceModel.Activation } } byte[] serviceStatusProcess = new byte[lpnLengthNeeded]; -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() success = ListenerUnsafeNativeMethods.QueryServiceStatusEx(service, ListenerUnsafeNativeMethods.SC_STATUS_PROCESS_INFO, serviceStatusProcess, serviceStatusProcess.Length, out lpnLengthNeeded); if (!success) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/EndpointInstanceProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/EndpointInstanceProvider.cs index 755291d6c77..25dbbdf242d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/EndpointInstanceProvider.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/EndpointInstanceProvider.cs @@ -120,7 +120,7 @@ namespace System.ServiceModel.Administration { Fx.Assert(null != endpoint, ""); Fx.Assert(null != instance, ""); - instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? EndpointPerformanceCounters.CreateFriendlyInstanceName(endpoint.ServiceName, endpoint.Contract.Name, endpoint.Address.AbsoluteUri.ToUpperInvariant()) : String.Empty); + instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? EndpointPerformanceCounters.GetFriendlyInstanceName(endpoint.ServiceName, endpoint.Contract.Name, endpoint.Address.AbsoluteUri.ToUpperInvariant()) : String.Empty); instance.SetProperty(AdministrationStrings.Name, endpoint.Name); instance.SetProperty(AdministrationStrings.ContractName, endpoint.Contract.Name); FillAddressInfo(endpoint, instance); @@ -668,7 +668,7 @@ namespace System.ServiceModel.Administration if (PerformanceCounters.PerformanceCountersEnabled && null != endpointInfo) { - result = OperationPerformanceCounters.CreateFriendlyInstanceName(endpointInfo.ServiceName, endpointInfo.Contract.Name, operationName, endpointInfo.Address.AbsoluteUri.ToUpperInvariant()); + result = OperationPerformanceCounters.GetFriendlyInstanceName(endpointInfo.ServiceName, endpointInfo.Contract.Name, operationName, endpointInfo.Address.AbsoluteUri.ToUpperInvariant()); } return result; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs index 2c22592f0a2..f5c43f0cad3 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ProviderBase.cs @@ -14,7 +14,7 @@ namespace System.ServiceModel.Administration Fx.Assert(null != info, ""); Fx.Assert(null != instance, ""); //warning 56507 : Prefer 'string.IsNullOrEmpty(action)' over checks for null and/or emptiness. -#pragma warning suppress 56507 //[....]; Asserting non-null object for marshalling reasons. Empty string may be valid input. +#pragma warning suppress 56507 //Microsoft; Asserting non-null object for marshalling reasons. Empty string may be valid input. Fx.Assert(null != propertyName, ""); string[] data = new string[info.Count]; @@ -31,7 +31,7 @@ namespace System.ServiceModel.Administration Fx.Assert(null != info, ""); Fx.Assert(null != instance, ""); //warning 56507 : Prefer 'string.IsNullOrEmpty(action)' over checks for null and/or emptiness. -#pragma warning suppress 56507 //[....]; Asserting non-null object for marshalling reasons. Empty string may be valid input. +#pragma warning suppress 56507 //Microsoft; Asserting non-null object for marshalling reasons. Empty string may be valid input. Fx.Assert(null != propertyName, ""); int i = 0; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ServiceInstanceProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ServiceInstanceProvider.cs index 4fced34d3b6..23593fd0acc 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ServiceInstanceProvider.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/ServiceInstanceProvider.cs @@ -132,7 +132,7 @@ namespace System.ServiceModel.Administration Fx.Assert(null != instance, ""); Fx.Assert(null != info, ""); ProviderBase.FillCollectionInfo(info.Service.BaseAddresses, instance, AdministrationStrings.BaseAddresses); - instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? ServicePerformanceCounters.CreateFriendlyInstanceName(info.Service) : String.Empty); + instance.SetProperty(AdministrationStrings.CounterInstanceName, PerformanceCounters.PerformanceCountersEnabled ? ServicePerformanceCounters.GetFriendlyInstanceName(info.Service) : String.Empty); instance.SetProperty(AdministrationStrings.ConfigurationName, info.ConfigurationName); instance.SetProperty(AdministrationStrings.DistinguishedName, info.DistinguishedName); instance.SetProperty(AdministrationStrings.Name, info.Name); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/WbemProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/WbemProvider.cs index 94a7b1eb68f..aa8e4a77b3c 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/WbemProvider.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Administration/WbemProvider.cs @@ -968,7 +968,7 @@ namespace System.ServiceModel.Administration int hResult = this.wbemObject.Put(name, 0, ref val, (int)type); if ((int)WbemNative.WbemStatus.WBEM_E_TYPE_MISMATCH == hResult || (int)WbemNative.WbemStatus.WBEM_E_NOT_FOUND == hResult) { - //This would be most likely a product bug (somebody changed type without updating MOF), improper installation or tampering with MOF + //This would be most likely a product System.Runtime.Diagnostics.EventLogEventId eventId; if ((int)WbemNative.WbemStatus.WBEM_E_TYPE_MISMATCH == hResult) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs new file mode 100644 index 00000000000..5f591137e39 --- /dev/null +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/AppContextDefaultValues.Default.cs @@ -0,0 +1,35 @@ +// <copyright> +// Copyright (c) Microsoft Corporation. All rights reserved. +// </copyright> +namespace System +{ + using System; + using System.ServiceModel; + + internal static partial class AppContextDefaultValues + { + static partial void PopulateDefaultValuesPartial(string platformIdentifier, string profile, int version) + { + // When defining a new switch you should add it to the last known version. + // For instance, if you are adding a switch in .NET 4.6 (the release after 4.5.2) you should defined your switch + // like this: + // if (version <= 40502) ... + // This ensures that all previous versions of that platform (up-to 4.5.2) will get the old behavior by default + // NOTE: When adding a default value for a switch please make sure that the default value is added to ALL of the existing platforms! + // NOTE: When adding a new if statement for the version please ensure that ALL previous switches are enabled (ie. don't use else if) + switch (platformIdentifier) + { + case ".NETCore": + case ".NETFramework": + { + if (version <= 40502) + { + LocalAppContextSwitches.SetDefaultsLessOrEqual_452(); + } + + break; + } + } + } + } +} diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/CacheSetting.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/CacheSetting.cs index 3c83ed6c904..7b8aa168f1b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/CacheSetting.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/CacheSetting.cs @@ -10,4 +10,4 @@ namespace System.ServiceModel AlwaysOn, AlwaysOff } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs index b866cfd27ca..e9aca788ae8 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeader.cs @@ -293,7 +293,7 @@ namespace System.ServiceModel.Channels } } - // [....], This will be kept internal for now. If the optimization needs to be public, we'll re-evaluate it. + // Microsoft, This will be kept internal for now. If the optimization needs to be public, we'll re-evaluate it. class DictionaryAddressHeader : XmlObjectSerializerAddressHeader { XmlDictionaryString name; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs index 0225acd4ea6..a249d56a9a9 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/AddressHeaderCollection.cs @@ -70,7 +70,7 @@ namespace System.ServiceModel.Channels for (int i = 0; i < InternalCount; i++) { -#pragma warning suppress 56506 // [....], Message.Headers can never be null +#pragma warning suppress 56506 // Microsoft, Message.Headers can never be null message.Headers.Add(this[i].ToMessageHeader()); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs index 0aea9ac3133..61b59eaa709 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BinaryMessageEncoder.cs @@ -1667,7 +1667,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateMessageDisposedException()); @@ -1681,7 +1681,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateMessageDisposedException()); @@ -1696,7 +1696,7 @@ namespace System.ServiceModel.Channels { if (IsDisposed) { -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateMessageDisposedException()); } return headers.MessageVersion; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs index 8beb939caa2..aef29ec12b5 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/BufferedOutputAsyncStream.cs @@ -27,8 +27,8 @@ namespace System.ServiceModel.Channels /// /// Currently BufferedOutputAsyncStream only used to wrap the System.Net.HttpResponseStream, which satisfy both requirements. /// - /// BufferedOutputAsyncStream can also be used when doing asynchronous operations. [....] operations are not allowed when an async - /// operation is in-flight. If a [....] operation is in progress (i.e., data exists in our CurrentBuffer) and we issue an async operation, + /// BufferedOutputAsyncStream can also be used when doing asynchronous operations. Sync operations are not allowed when an async + /// operation is in-flight. If a sync operation is in progress (i.e., data exists in our CurrentBuffer) and we issue an async operation, /// we flush everything in the buffers (and block while doing so) before the async operation is allowed to proceed. /// /// </summary> @@ -78,7 +78,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], required by the Stream.Length contract +#pragma warning suppress 56503 // Microsoft, required by the Stream.Length contract throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.ReadNotSupported))); } } @@ -87,7 +87,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], required by the Stream.Position contract +#pragma warning suppress 56503 // Microsoft, required by the Stream.Position contract throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupported))); } set @@ -326,7 +326,7 @@ namespace System.ServiceModel.Channels void DequeueAndFlush(ByteBuffer currentBuffer, AsyncEventArgsCallback callback) { // Dequeue does a checkout of the buffer from its slot. - // the callback for the [....] path only enqueues the buffer. + // the callback for the sync path only enqueues the buffer. // The WriteAsync callback needs to enqueue and also complete. this.currentByteBuffer = null; ByteBuffer dequeued = this.buffers.Dequeue(); @@ -747,7 +747,7 @@ namespace System.ServiceModel.Channels buffer.stream.EndWrite(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ClientWebSocketFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ClientWebSocketFactory.cs index 48fe8d3c73c..d096477625d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ClientWebSocketFactory.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ClientWebSocketFactory.cs @@ -26,4 +26,4 @@ namespace System.ServiceModel.Channels // we estimate that implementors of a custom web socket factory will find it enough too. public abstract WebSocket CreateWebSocket(Stream connection, WebSocketTransportSettings settings); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs index f038eb55394..1dcac849612 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/CompositeDuplexBindingElement.cs @@ -86,7 +86,7 @@ namespace System.ServiceModel.Channels else { // -#pragma warning suppress 56506 // [....], context.Binding will never be null. +#pragma warning suppress 56506 // Microsoft, context.Binding will never be null. context.ListenUriRelativeAddress = String.Empty; context.ListenUriMode = ListenUriMode.Unique; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs index 9934d41ffdb..c795e66a15e 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Connection.cs @@ -338,7 +338,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], required by the Stream.Length contract +#pragma warning suppress 56503 // Microsoft, required by the Stream.Length contract throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupported))); } } @@ -347,7 +347,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], required by the Stream.Position contract +#pragma warning suppress 56503 // Microsoft, required by the Stream.Position contract throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotSupportedException(SR.GetString(SR.SeekNotSupported))); } set @@ -470,7 +470,7 @@ namespace System.ServiceModel.Channels { thisPtr.HandleIO(thisPtr.connection); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs index 0a74ee019dd..9f50f397fe8 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionDemuxer.cs @@ -554,7 +554,7 @@ namespace System.ServiceModel.Channels IConnection upgradedConnection = this.serverSingletonPreambleReader.EndCompletePreamble(result); ServerSingletonConnectionReader singletonReader = new ServerSingletonConnectionReader(serverSingletonPreambleReader, upgradedConnection, this.demuxer); - //singletonReader doesn't have async version of ReceiveRequest, so just call the [....] method for now. + //singletonReader doesn't have async version of ReceiveRequest, so just call the sync method for now. RequestContext requestContext = singletonReader.ReceiveRequest(this.timeoutHelper.RemainingTime()); singletonChannelListener.ReceiveRequest(requestContext, serverSingletonPreambleReader.ConnectionDequeuedCallback, true); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs index de091c4ea88..57a54e084e5 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionModeReader.cs @@ -134,7 +134,7 @@ namespace System.ServiceModel.Channels completeSelf = reader.ContinueReading(); } } -#pragma warning suppress 56500 // [....], transferring exception to caller +#pragma warning suppress 56500 // Microsoft, transferring exception to caller catch (Exception e) { if (Fx.IsFatal(e)) @@ -201,7 +201,7 @@ namespace System.ServiceModel.Channels { completeSelf = ContinueReading(); } -#pragma warning suppress 56500 // [....], transferring exception to caller +#pragma warning suppress 56500 // Microsoft, transferring exception to caller catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs index a76041897de..fcab3692d0b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ConnectionPool.cs @@ -1213,7 +1213,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleConnect(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1292,7 +1292,7 @@ namespace System.ServiceModel.Channels thisPtr.SnapshotConnection(); } } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs index a2413853a8d..0173e2b62ea 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ContentOnlyMessage.cs @@ -28,7 +28,7 @@ namespace System.ServiceModel.Channels { if (IsDisposed) { -#pragma warning suppress 56503 // [....], required by base class contract +#pragma warning suppress 56503 // Microsoft, required by base class contract throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); } @@ -42,7 +42,7 @@ namespace System.ServiceModel.Channels { if (IsDisposed) { -#pragma warning suppress 56503 // [....], required by base class contract +#pragma warning suppress 56503 // Microsoft, required by base class contract throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs index f232b0f7d44..41c0e1f3786 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingChannels.cs @@ -641,7 +641,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleWritePreamble(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -669,7 +669,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandlePreambleAck(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -702,7 +702,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleInitiatorOpen(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -735,7 +735,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleUpgrade(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -768,7 +768,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleInitiatorClose(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -796,7 +796,7 @@ namespace System.ServiceModel.Channels thisPtr.connection.EndWrite(); completeSelf = thisPtr.ReadAck(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -826,7 +826,7 @@ namespace System.ServiceModel.Channels { ConnectionUpgradeHelper.EndDecodeFramingFault(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -913,7 +913,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleEstablishConnection(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1172,7 +1172,7 @@ namespace System.ServiceModel.Channels { thisPtr.CompleteReadFaultData(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1335,7 +1335,7 @@ namespace System.ServiceModel.Channels completeSelf = thisPtr.Begin(); } } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1366,7 +1366,7 @@ namespace System.ServiceModel.Channels { ConnectionUpgradeHelper.EndDecodeFramingFault(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1392,7 +1392,7 @@ namespace System.ServiceModel.Channels completeSelf = thisPtr.Begin(); } } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1423,7 +1423,7 @@ namespace System.ServiceModel.Channels thisPtr.CompleteUpgrade(result); completeSelf = thisPtr.Begin(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs index 8c5b4e61483..dbd6ca609d0 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/FramingDecoders.cs @@ -32,7 +32,7 @@ namespace System.ServiceModel.Channels get { if (!isValueDecoded) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return value; } @@ -108,7 +108,7 @@ namespace System.ServiceModel.Channels get { if (currentState != State.Done) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return value; } @@ -236,7 +236,7 @@ namespace System.ServiceModel.Channels get { if (!IsValueDecoded) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return via; } @@ -544,7 +544,7 @@ namespace System.ServiceModel.Channels get { if (currentState != State.Done) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return mode; } @@ -555,7 +555,7 @@ namespace System.ServiceModel.Channels get { if (currentState != State.Done) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return majorVersion; } @@ -566,7 +566,7 @@ namespace System.ServiceModel.Channels get { if (currentState != State.Done) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return minorVersion; } @@ -624,7 +624,7 @@ namespace System.ServiceModel.Channels get { if (currentState < State.PreUpgradeStart) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return contentType; } @@ -635,7 +635,7 @@ namespace System.ServiceModel.Channels get { if (currentState < State.ReadingContentTypeRecord) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return viaDecoder.ValueAsUri; } @@ -652,7 +652,7 @@ namespace System.ServiceModel.Channels get { if (currentState != State.UpgradeRequest) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return upgrade; } @@ -663,7 +663,7 @@ namespace System.ServiceModel.Channels get { if (currentState < State.EnvelopeStart) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return envelopeSize; } @@ -880,7 +880,7 @@ namespace System.ServiceModel.Channels { if (currentState < State.ChunkStart) { -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); } @@ -1009,7 +1009,7 @@ namespace System.ServiceModel.Channels get { if (currentState < State.ReadingContentTypeRecord) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return viaDecoder.ValueAsUri; } @@ -1020,7 +1020,7 @@ namespace System.ServiceModel.Channels get { if (currentState < State.PreUpgradeStart) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return contentType; } @@ -1031,7 +1031,7 @@ namespace System.ServiceModel.Channels get { if (currentState != State.UpgradeRequest) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return upgrade; } @@ -1280,7 +1280,7 @@ namespace System.ServiceModel.Channels get { if (currentState < State.ReadingContentTypeRecord) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return viaDecoder.ValueAsUri; } @@ -1291,7 +1291,7 @@ namespace System.ServiceModel.Channels get { if (currentState < State.Start) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return contentType; } @@ -1386,7 +1386,7 @@ namespace System.ServiceModel.Channels get { if (CurrentState < ClientFramingDecoderState.EnvelopeStart) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return envelopeSize; } @@ -1397,7 +1397,7 @@ namespace System.ServiceModel.Channels get { if (CurrentState < ClientFramingDecoderState.Fault) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return faultDecoder.Value; } @@ -1543,7 +1543,7 @@ namespace System.ServiceModel.Channels get { if (CurrentState < ClientFramingDecoderState.Fault) -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.FramingValueNotAvailable))); return faultDecoder.Value; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs index 6fcf11dd123..8dd38356431 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelFactory.cs @@ -35,6 +35,7 @@ namespace System.ServiceModel.Channels { static bool httpWebRequestWebPermissionDenied = false; static RequestCachePolicy requestCachePolicy = new RequestCachePolicy(RequestCacheLevel.BypassCache); + static long connectionGroupNamePrefix = 0; readonly ClientWebSocketFactory clientWebSocketFactory; @@ -65,6 +66,7 @@ namespace System.ServiceModel.Channels WebSocketTransportSettings webSocketSettings; ConnectionBufferPool bufferPool; Lazy<string> webSocketSoapContentType; + string uniqueConnectionGroupNamePrefix; internal HttpChannelFactory(HttpTransportBindingElement bindingElement, BindingContext context) : base(bindingElement, context, HttpTransportDefaults.GetDefaultMessageEncoderFactory()) @@ -183,6 +185,15 @@ namespace System.ServiceModel.Channels } this.webSocketSoapContentType = new Lazy<string>(() => { return this.MessageEncoderFactory.CreateSessionEncoder().ContentType; }, LazyThreadSafetyMode.ExecutionAndPublication); + + if (ServiceModelAppSettings.HttpTransportPerFactoryConnectionPool) + { + this.uniqueConnectionGroupNamePrefix = Interlocked.Increment(ref connectionGroupNamePrefix).ToString(); + } + else + { + this.uniqueConnectionGroupNamePrefix = string.Empty; + } } public bool AllowCookies @@ -665,7 +676,7 @@ namespace System.ServiceModel.Channels } string prefix = this.OnGetConnectionGroupPrefix(httpWebRequest, clientCertificateToken); - inputString = string.Concat(prefix, inputString); + inputString = string.Concat(this.uniqueConnectionGroupNamePrefix, prefix, inputString); string credentialHash = null; @@ -1170,6 +1181,7 @@ namespace System.ServiceModel.Channels ChannelBinding channelBinding; int webRequestCompleted; EventTraceActivity eventTraceActivity; + const string ConnectionGroupPrefixMessagePropertyName = "HttpTransportConnectionGroupNamePrefix"; public HttpChannelRequest(HttpRequestChannel channel, HttpChannelFactory<IRequestChannel> factory) { @@ -1179,11 +1191,27 @@ namespace System.ServiceModel.Channels this.factory = factory; } + private string GetConnectionGroupPrefix(Message message) + { + object property; + if (message.Properties.TryGetValue(ConnectionGroupPrefixMessagePropertyName, out property)) + { + string prefix = property as string; + if (prefix != null) + { + return prefix; + } + } + + return string.Empty; + } + public void SendRequest(Message message, TimeSpan timeout) { TimeoutHelper timeoutHelper = new TimeoutHelper(timeout); factory.ApplyManualAddressing(ref this.to, ref this.via, message); this.webRequest = channel.GetWebRequest(this.to, this.via, ref timeoutHelper); + this.webRequest.ConnectionGroupName = GetConnectionGroupPrefix(message) + this.webRequest.ConnectionGroupName; Message request = message; @@ -1277,7 +1305,7 @@ namespace System.ServiceModel.Channels } catch (NullReferenceException nullReferenceException) { - // workaround for Whidbey bug #558605 - only happens in streamed case. + // workaround for Whidbey if (TransferModeHelper.IsRequestStreamed(this.factory.transferMode)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( @@ -1468,7 +1496,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.OnGetWebRequestCompleted(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1582,7 +1610,7 @@ namespace System.ServiceModel.Channels } catch (NullReferenceException nullReferenceException) { - // workaround for Whidbey bug #558605 - only happens in streamed case. + // workaround for Whidbey if (TransferModeHelper.IsRequestStreamed(this.factory.transferMode)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( @@ -1639,7 +1667,7 @@ namespace System.ServiceModel.Channels } catch (NullReferenceException nullReferenceException) { - // workaround for Whidbey bug #558605 - only happens in streamed case. + // workaround for Whidbey if (TransferModeHelper.IsRequestStreamed(this.factory.transferMode)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( @@ -1782,7 +1810,7 @@ namespace System.ServiceModel.Channels { thisPtr.CompleteParseIncomingMessage(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1809,7 +1837,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.CompleteSend(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1854,7 +1882,7 @@ namespace System.ServiceModel.Channels completeSelf = true; completionException = new CommunicationException(webException.Message, webException); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2040,7 +2068,7 @@ namespace System.ServiceModel.Channels thisPtr.CompleteGetSspiCredential(result); thisPtr.CloseTokenProvidersIfRequired(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2068,7 +2096,7 @@ namespace System.ServiceModel.Channels thisPtr.CompleteGetUserNameCredential(result); thisPtr.CloseTokenProvidersIfRequired(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs index d2389c42a41..f346cfc9387 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpChannelHelpers.cs @@ -780,7 +780,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.ContinueReading(thisPtr.inputStream.EndRead(result)); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -979,7 +979,7 @@ namespace System.ServiceModel.Channels } catch (IOException ioException) { - throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(HttpChannelUtilities.CreateResponseIOException(ioException, TimeoutHelper.FromMilliseconds(this.ReadTimeout))); + throw this.CreateResponseIOException(ioException); } catch (ObjectDisposedException objectDisposedException) { @@ -999,7 +999,7 @@ namespace System.ServiceModel.Channels } catch (IOException ioException) { - throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(HttpChannelUtilities.CreateResponseIOException(ioException, TimeoutHelper.FromMilliseconds(this.ReadTimeout))); + throw this.CreateResponseIOException(ioException); } catch (ObjectDisposedException objectDisposedException) { @@ -1023,7 +1023,7 @@ namespace System.ServiceModel.Channels } catch (IOException ioException) { - throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(HttpChannelUtilities.CreateResponseIOException(ioException, TimeoutHelper.FromMilliseconds(this.ReadTimeout))); + throw this.CreateResponseIOException(ioException); } catch (WebException webException) { @@ -1044,13 +1044,21 @@ namespace System.ServiceModel.Channels } catch (IOException ioException) { - throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(HttpChannelUtilities.CreateResponseIOException(ioException, TimeoutHelper.FromMilliseconds(this.ReadTimeout))); + throw this.CreateResponseIOException(ioException); } catch (WebException webException) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(HttpChannelUtilities.CreateResponseWebException(webException, this.webResponse)); } } + + private Exception CreateResponseIOException(IOException ioException) + { + TimeSpan timeSpan = this.CanTimeout ? TimeoutHelper.FromMilliseconds(this.ReadTimeout) : TimeSpan.MaxValue; + + return DiagnosticUtility.ExceptionUtility.ThrowHelperError(HttpChannelUtilities.CreateResponseIOException(ioException, timeSpan)); + } + } } } @@ -2169,7 +2177,7 @@ namespace System.ServiceModel.Channels bool WriteStreamedMessage() { - // return a bool to determine if we are [....]. + // return a bool to determine if we are sync. if (onWriteStreamedMessage == null) { @@ -2265,7 +2273,7 @@ namespace System.ServiceModel.Channels completeSelf = true; } } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2291,7 +2299,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.WriteStreamedMessage(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2325,7 +2333,7 @@ namespace System.ServiceModel.Channels thisPtr.CompleteWriteBody(result); thisPtr.httpOutput.TraceSend(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2488,14 +2496,14 @@ namespace System.ServiceModel.Channels if (action != null) { - //This code is calling UrlPathEncode due to MessageBus bug 53362. - //After reviewing this decision, we - //feel that this was probably the wrong thing to do because UrlPathEncode - //doesn't escape some characters like '+', '%', etc. The real issue behind - //bug 53362 may have been as simple as being encoded multiple times on the client - //but being decoded one time on the server. Calling UrlEncode would correctly - //escape these characters, but since we don't want to break any customers and no - //customers have complained, we will leave this as is for now... + //This code is calling UrlPathEncode due to MessageBus + + + + + + + action = string.Format(CultureInfo.InvariantCulture, "\"{0}\"", UrlUtility.UrlPathEncode(action)); } @@ -2757,7 +2765,7 @@ namespace System.ServiceModel.Channels { thisPtr.CompleteGetRequestStream(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2980,6 +2988,18 @@ namespace System.ServiceModel.Channels this.SetContentType(value); } } + else if (string.Compare(name, "Connection", StringComparison.OrdinalIgnoreCase) == 0 && + value != null && + string.Compare(value.Trim(), "close", StringComparison.OrdinalIgnoreCase) == 0 && + !LocalAppContextSwitches.DisableExplicitConnectionCloseHeader) + { + // HttpListenerResponse will not serialize the Connection:close header + // if its KeepAlive is true. So in the case where a service has explicitly + // added Connection:close (not added by default) set KeepAlive to false. + // This will cause HttpListenerResponse to add its own Connection:close header + // and to serialize it properly. We do not add a redundant header here. + this.listenerResponse.KeepAlive = false; + } else { this.AddHeader(name, value); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs index ee321225b02..2b656359678 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpPipeline.cs @@ -444,7 +444,7 @@ namespace System.ServiceModel.Channels bool lockTaken = false; try { - // We need this lock only in [....] reply case. In this case, we hopped the thread in the request side, so it's possible to send the response here + // We need this lock only in sync reply case. In this case, we hopped the thread in the request side, so it's possible to send the response here // before the TransportIntegrationHandler is ready on another thread (thus a race condition). So we use the lock here. In the incoming path, we won't // release the lock until the TransportIntegrationHandler is ready. Once we get the lock on the outgoing path, we can then call Wait() on this handler safely. Monitor.TryEnter(this.ThisLock, TimeoutHelper.ToMilliseconds(helper.RemainingTime()), ref lockTaken); @@ -615,7 +615,7 @@ namespace System.ServiceModel.Channels this.cancellationTokenSource.Dispose(); this.wasProcessInboundRequestSuccessful = true; //// shortcut scenario - //// Currently we are always doing [....] send even async send is enabled. + //// Currently we are always doing sync send even async send is enabled. this.SendAndClose(t.Result); } else if (this.isAsyncReply) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpRequestContext.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpRequestContext.cs index e76fb3a434a..c2f0b9b702b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpRequestContext.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpRequestContext.cs @@ -829,7 +829,7 @@ namespace System.ServiceModel.Channels public override HttpOutput GetHttpOutput(Message message) { - // work around http.sys keep alive bug with chunked requests, see MB 49676, this is fixed in Vista + // work around http.sys keep alive if (listenerContext.Request.ContentLength64 == -1 && !OSEnvironmentHelper.IsVistaOrGreater) { listenerContext.Response.KeepAlive = false; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs index 479ca48628a..c173b43170b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpTransportBindingElement.cs @@ -528,7 +528,7 @@ namespace System.ServiceModel.Channels } else { -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null if (context.BindingParameters.Find<MessageEncodingBindingElement>() == null) { context.BindingParameters.Add(new TextMessageEncodingBindingElement()); @@ -578,7 +578,7 @@ namespace System.ServiceModel.Channels if (!this.CanBuildChannelFactory<TChannel>(context)) { -#pragma warning suppress 56506 // [....], context.Binding will never be null. +#pragma warning suppress 56506 // Microsoft, context.Binding will never be null. throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("TChannel", SR.GetString(SR.CouldnTCreateChannelForChannelType2, context.Binding.Name, typeof(TChannel))); } @@ -649,7 +649,7 @@ namespace System.ServiceModel.Channels if (!this.CanBuildChannelListener<TChannel>(context)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument( -#pragma warning suppress 56506 // [....], context.Binding will never be null. +#pragma warning suppress 56506 // Microsoft, context.Binding will never be null. "TChannel", SR.GetString(SR.CouldnTCreateChannelForChannelType2, context.Binding.Name, typeof(TChannel))); } @@ -672,7 +672,7 @@ namespace System.ServiceModel.Channels if (effectiveAutheSchemes == AuthenticationSchemes.None) { -#pragma warning suppress 56506 // [....], context.Binding will never be null. +#pragma warning suppress 56506 // Microsoft, context.Binding will never be null. string bindingName = context.Binding.Name; if (this.AuthenticationScheme == AuthenticationSchemes.None) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs index 6b2511b4c0f..6f0924176e2 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelFactory.cs @@ -488,7 +488,7 @@ namespace System.ServiceModel.Channels thisPtr.request = thisPtr.httpsChannel.EndBaseGetWebRequest(result); thisPtr.factory.AddServerCertMappingOrSetRemoteCertificateValidationCallback(thisPtr.request, thisPtr.to); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -514,7 +514,7 @@ namespace System.ServiceModel.Channels thisPtr.OnGetToken(result); completeSelf = thisPtr.GetWebRequest(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelListener.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelListener.cs index 95f6f9c5659..3f9f1727f7b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelListener.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/HttpsChannelListener.cs @@ -23,7 +23,7 @@ namespace System.ServiceModel.Channels where TChannel : class, IChannel { readonly bool useCustomClientCertificateVerification; - readonly bool shouldValidateClientCertificate; + bool shouldValidateClientCertificate; bool useHostedClientCertificateMapping; bool requireClientCertificate; SecurityTokenAuthenticator certificateAuthenticator; @@ -125,6 +125,12 @@ namespace System.ServiceModel.Channels { base.ApplyHostedContext(virtualPath, isMetadataListener); useHostedClientCertificateMapping = AspNetEnvironment.Current.ValidateHttpsSettings(virtualPath, ref this.requireClientCertificate); + + // We want to validate the certificate if IIS is set to require a client certificate + if (this.requireClientCertificate) + { + this.shouldValidateClientCertificate = true; + } } internal override ITransportManagerRegistration CreateTransportManagerRegistration(Uri listenUri) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelAcceptor.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelAcceptor.cs index 6a0e7fb98d9..a5b62241f41 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelAcceptor.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelAcceptor.cs @@ -14,4 +14,4 @@ namespace System.ServiceModel.Channels IAsyncResult BeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state); bool EndWaitForChannel(IAsyncResult result); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelBindingProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelBindingProvider.cs index 80d524ef8f6..d9c4d699462 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelBindingProvider.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IChannelBindingProvider.cs @@ -11,4 +11,4 @@ namespace System.ServiceModel.Channels void EnableChannelBindingSupport(); bool IsChannelBindingSupportEnabled { get; } } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IHttpCookieContainerManager.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IHttpCookieContainerManager.cs index 84d0fd0d93d..d684cbc9cfe 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IHttpCookieContainerManager.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IHttpCookieContainerManager.cs @@ -17,4 +17,4 @@ namespace System.ServiceModel.Channels /// </summary> CookieContainer CookieContainer { get; set; } } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IReliableFactorySettings.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IReliableFactorySettings.cs index 38df4d9ca89..a6f06de1e8a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IReliableFactorySettings.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IReliableFactorySettings.cs @@ -25,4 +25,4 @@ namespace System.ServiceModel.Channels TimeSpan SendTimeout { get; } } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IStreamUpgradeChannelBindingProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IStreamUpgradeChannelBindingProvider.cs index e98a53f6f90..ff8aeb3b70c 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IStreamUpgradeChannelBindingProvider.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IStreamUpgradeChannelBindingProvider.cs @@ -11,4 +11,4 @@ namespace System.ServiceModel.Channels ChannelBinding GetChannelBinding(StreamUpgradeInitiator upgradeInitiator, ChannelBindingKind kind); ChannelBinding GetChannelBinding(StreamUpgradeAcceptor upgradeAcceptor, ChannelBindingKind kind); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs index b2563cc48b4..e576d74b13c 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/IdlingCommunicationPool.cs @@ -37,7 +37,7 @@ namespace System.ServiceModel.Channels protected override void CloseItemAsync(TItem item, TimeSpan timeout) { - // Default behavior is [....]. Derived classes can override. + // Default behavior is sync. Derived classes can override. this.CloseItem(item, timeout); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs index 4bc768331a2..d9d1af921b2 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InitialServerConnectionReader.cs @@ -404,7 +404,7 @@ namespace System.ServiceModel.Channels { thisPtr.CompleteAcceptUpgrade(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs index 26f1e3aa35f..b4e5202fa55 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InputChannel.cs @@ -223,7 +223,7 @@ namespace System.ServiceModel.Channels { thisPtr.HandleReceiveComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs index dc126777c7b..5abee3c70ab 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexBindingElement.cs @@ -69,7 +69,7 @@ namespace System.ServiceModel.Channels } else { -#pragma warning suppress 56506 // [....], context.RemainingBindingElements will never be null +#pragma warning suppress 56506 // Microsoft, context.RemainingBindingElements will never be null context.RemainingBindingElements.Clear(); } LocalAddressProvider localAddressProvider = context.BindingParameters.Remove<LocalAddressProvider>(); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs index 2795232210d..9f3022762c8 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/InternalDuplexChannelListener.cs @@ -345,7 +345,7 @@ namespace System.ServiceModel.Channels { thisPtr.CompleteSend(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs index 5ea731f0809..2ae3bf5e350 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/Message.cs @@ -34,7 +34,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return false; @@ -46,7 +46,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return false; @@ -978,7 +978,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return bodyWriter.IsFault; } @@ -989,7 +989,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return bodyWriter.IsEmpty; } @@ -1000,7 +1000,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return headers; } @@ -1011,7 +1011,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); if (properties == null) properties = new MessageProperties(); @@ -1024,7 +1024,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return headers.MessageVersion; } @@ -1306,7 +1306,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return headers; } @@ -1522,7 +1522,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return headers; } @@ -1541,7 +1541,7 @@ namespace System.ServiceModel.Channels get { if (IsDisposed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); return properties; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs index 4a15880764e..383bf17b7af 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageBuffer.cs @@ -197,7 +197,7 @@ namespace System.ServiceModel.Channels lock (ThisLock) { if (closed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateBufferDisposedException()); return messageData.Buffer.Count; } @@ -224,7 +224,7 @@ namespace System.ServiceModel.Channels lock (ThisLock) { if (closed) -#pragma warning suppress 56503 // [....], Invalid State after dispose +#pragma warning suppress 56503 // Microsoft, Invalid State after dispose throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateBufferDisposedException()); return messageData.MessageEncoder.ContentType; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs index 1dcae5bf034..72af695436d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElement.cs @@ -38,7 +38,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters never be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters never be null context.BindingParameters.Add(this); return context.BuildInnerChannelFactory<TChannel>(); } @@ -50,7 +50,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters never be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters never be null context.BindingParameters.Add(this); return context.CanBuildInnerChannelFactory<TChannel>(); } @@ -63,7 +63,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters never be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters never be null context.BindingParameters.Add(this); return context.BuildInnerChannelListener<TChannel>(); } @@ -76,7 +76,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters never be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters never be null context.BindingParameters.Add(this); return context.CanBuildInnerChannelListener<TChannel>(); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs index 6b4de1fab49..3662da87dc2 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageEncodingBindingElementImporter.cs @@ -25,7 +25,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], these properties cannot be null in this context +#pragma warning suppress 56506 // Microsoft, these properties cannot be null in this context if (context.Endpoint.Binding == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding"); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs index 5803f1710c9..09e60dfffb8 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageFault.cs @@ -69,7 +69,7 @@ namespace System.ServiceModel.Channels { try { -#pragma warning suppress 56506 // [....], Message.Version can never be null +#pragma warning suppress 56506 // Microsoft, Message.Version can never be null EnvelopeVersion envelopeVersion = message.Version.Envelope; MessageFault fault; if (envelopeVersion == EnvelopeVersion.Soap12) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs index 504eb714827..5accd13b6ac 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MessageHeaders.cs @@ -490,7 +490,7 @@ namespace System.ServiceModel.Channels if (collection.version != version) { -#pragma warning suppress 56506 // [....], collection.version is never null +#pragma warning suppress 56506 // Microsoft, collection.version is never null throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentException(SR.GetString(SR.MessageHeaderVersionMismatch, collection.version.ToString(), version.ToString()), "collection")); } @@ -507,7 +507,7 @@ namespace System.ServiceModel.Channels switch (header.HeaderType) { case HeaderType.BufferedMessageHeader: - AddHeader(new Header(header.HeaderKind, CaptureBufferedHeader(collection.bufferedMessageData, + AddHeader(new Header(header.HeaderKind, collection.CaptureBufferedHeader(collection.bufferedMessageData, header.HeaderInfo, headerIndex), processing)); break; case HeaderType.ReadableHeader: diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MsmqDecodeHelper.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MsmqDecodeHelper.cs index 4fba9a57491..0fe664c4b07 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MsmqDecodeHelper.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/MsmqDecodeHelper.cs @@ -325,8 +325,8 @@ namespace System.ServiceModel.Channels throw listener.NormalizePoisonException(messageProperty.LookupId, MaxMessageSizeStream.CreateMaxReceivedMessageSizeExceededException(listener.MaxReceivedMessageSize)); } - // Fix for CSDMain bug 17842 - // size is derived from user data, check for corruption + // Fix for CSDMain + if ((size + offset) > buffer.Length) { listener.MsmqReceiveHelper.FinalDisposition(messageProperty); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs index f45463a3320..c37698a5e7b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelFactory.cs @@ -763,7 +763,7 @@ namespace System.ServiceModel.Channels thisPtr.CompleteOpen(result); completeSelf = thisPtr.SendMessage(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -796,7 +796,7 @@ namespace System.ServiceModel.Channels { thisPtr.innerChannel.EndSend(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs index ef8abafcf1f..afba9b018ca 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OneWayChannelListener.cs @@ -429,7 +429,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleReceiveRequestComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -461,7 +461,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleReplyComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -770,7 +770,7 @@ namespace System.ServiceModel.Channels return; } } -#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user +#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user catch (Exception e) { if (Fx.IsFatal(e)) @@ -809,7 +809,7 @@ namespace System.ServiceModel.Channels { DiagnosticUtility.TraceHandledException(e, TraceEventType.Information); } -#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user +#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user catch (Exception e) { if (Fx.IsFatal(e)) @@ -940,7 +940,7 @@ namespace System.ServiceModel.Channels } DiagnosticUtility.TraceHandledException(e, TraceEventType.Information); } -#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user +#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user catch (Exception e) { if (Fx.IsFatal(e)) @@ -1007,7 +1007,7 @@ namespace System.ServiceModel.Channels } DiagnosticUtility.TraceHandledException(e, TraceEventType.Information); } -#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user +#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user catch (Exception e) { if (Fx.IsFatal(e)) @@ -1274,7 +1274,7 @@ namespace System.ServiceModel.Channels { DiagnosticUtility.TraceHandledException(e, TraceEventType.Information); } -#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user +#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user catch (Exception e) { if (Fx.IsFatal(e)) @@ -1379,7 +1379,7 @@ namespace System.ServiceModel.Channels DiagnosticUtility.TraceHandledException(e, TraceEventType.Information); startLoop = (this.channel.State == CommunicationState.Opened); } -#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user +#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user catch (Exception e) { if (Fx.IsFatal(e)) @@ -1415,7 +1415,7 @@ namespace System.ServiceModel.Channels { DiagnosticUtility.TraceHandledException(e, TraceEventType.Information); } -#pragma warning suppress 56500 // [....], transferring exception to input queue to be pulled off by user +#pragma warning suppress 56500 // Microsoft, transferring exception to input queue to be pulled off by user catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs index 7af8609728f..f03b4079905 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/OverlappedContext.cs @@ -109,7 +109,7 @@ namespace System.ServiceModel.Channels } if (this.syncOperationPending) { - throw Fx.AssertAndThrow("OverlappedContext.Free called while [....] operation is pending."); + throw Fx.AssertAndThrow("OverlappedContext.Free called while sync operation is pending."); } if (this.nativeOverlapped == null) { @@ -172,7 +172,7 @@ namespace System.ServiceModel.Channels } if (this.syncOperationPending) { - throw Fx.AssertAndThrow("StartAsyncOperation called while a [....] operation was already pending."); + throw Fx.AssertAndThrow("StartAsyncOperation called while a sync operation was already pending."); } if (this.nativeOverlapped == null) { @@ -249,7 +249,7 @@ namespace System.ServiceModel.Channels this.overlapped.EventHandleIntPtr = EventHandle; - // [....] operations do NOT root this object. If it gets finalized, we need to know not to free the buffer. + // Sync operations do NOT root this object. If it gets finalized, we need to know not to free the buffer. // We do root the event. this.rootedHolder.EventHolder = this.completionEvent; this.syncOperationPending = true; @@ -292,7 +292,7 @@ namespace System.ServiceModel.Channels } Fx.Assert(this.bufferPtr == null || this.bufferPtr == (byte*)Marshal.UnsafeAddrOfPinnedArrayElement((byte[])holder, 0), - "The buffer moved during a [....] call!"); + "The buffer moved during a sync call!"); CancelSyncOperation(ref holder); return true; @@ -333,7 +333,7 @@ namespace System.ServiceModel.Channels byte* ptr = this.bufferPtr; if (ptr == null) { -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw Fx.AssertAndThrow("Pointer requested while no operation pending or no buffer provided."); } return ptr; @@ -348,7 +348,7 @@ namespace System.ServiceModel.Channels NativeOverlapped* ptr = this.nativeOverlapped; if (ptr == null) { -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw Fx.AssertAndThrow("NativeOverlapped pointer requested after it was freed."); } return ptr; @@ -446,14 +446,14 @@ namespace System.ServiceModel.Channels Fx.Assert(pThis.bufferPtr == null || pThis.bufferPtr == (byte*)Marshal.UnsafeAddrOfPinnedArrayElement((byte[])pThis.bufferHolder[0], 0), "Buffer moved during synchronous deferred cleanup!"); - Fx.Assert(pThis.syncOperationPending, "OverlappedContext.CleanupCallback called with no [....] operation pending."); + Fx.Assert(pThis.syncOperationPending, "OverlappedContext.CleanupCallback called with no sync operation pending."); pThis.pinnedTarget = null; pThis.rootedHolder.EventHolder.Close(); Overlapped.Free(pThis.nativeOverlapped); } // This class is always held onto (rooted) by the packed Overlapped. The OverlappedContext instance moves itself in and out of - // this object to root itself. It's also used to root the ManualResetEvent during [....] operations. + // this object to root itself. It's also used to root the ManualResetEvent during sync operations. // It needs to be an IAsyncResult since that's what Overlapped takes. class RootedHolder : IAsyncResult { @@ -493,7 +493,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw Fx.AssertAndThrow("RootedHolder.AsyncState called."); } } @@ -502,7 +502,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw Fx.AssertAndThrow("RootedHolder.AsyncWaitHandle called."); } } @@ -511,7 +511,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw Fx.AssertAndThrow("RootedHolder.CompletedSynchronously called."); } } @@ -520,7 +520,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], not a publicly accessible API +#pragma warning suppress 56503 // Microsoft, not a publicly accessible API throw Fx.AssertAndThrow("RootedHolder.IsCompleted called."); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs index a9e8a8ea0ef..00ba45b8759 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerCustomResolverBindingElement.cs @@ -52,7 +52,7 @@ namespace System.ServiceModel.Channels if (context == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); -#pragma warning suppress 56506 // [....], context.BindingParameters is never null +#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null credentials = context.BindingParameters.Find<ClientCredentials>(); } public override T GetProperty<T>(System.ServiceModel.Channels.BindingContext context) @@ -110,7 +110,7 @@ namespace System.ServiceModel.Channels if (context == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); -#pragma warning suppress 56506 // [....], context.BindingParameters is never null +#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null context.BindingParameters.Add(this); credentials = context.BindingParameters.Find<ClientCredentials>(); return context.BuildInnerChannelFactory<TChannel>(); @@ -120,7 +120,7 @@ namespace System.ServiceModel.Channels { if (context == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); -#pragma warning suppress 56506 // [....], context.BindingParameters is never null +#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null this.credentials = context.BindingParameters.Find<ClientCredentials>(); context.BindingParameters.Add(this); return context.CanBuildInnerChannelFactory<TChannel>(); @@ -131,7 +131,7 @@ namespace System.ServiceModel.Channels if (context == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); -#pragma warning suppress 56506 // [....], context.BindingParameters is never null +#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null context.BindingParameters.Add(this); this.credentials = context.BindingParameters.Find<ClientCredentials>(); return context.BuildInnerChannelListener<TChannel>(); @@ -141,7 +141,7 @@ namespace System.ServiceModel.Channels { if (context == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ArgumentNullException("context")); -#pragma warning suppress 56506 // [....], context.BindingParameters is never null +#pragma warning suppress 56506 // Microsoft, context.BindingParameters is never null this.credentials = context.BindingParameters.Find<ClientCredentials>(); context.BindingParameters.Add(this); return context.CanBuildInnerChannelListener<TChannel>(); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs index b3866971e7a..9559bfb66a9 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerFlooder.cs @@ -938,7 +938,7 @@ namespace System.ServiceModel.Channels //this is the callback routine for async completion on channel BeginSend() operations. - //if we are done, simply return. This can happen if user called [....] EndX. + //if we are done, simply return. This can happen if user called sync EndX. //if the flooder is still processing BeginSend(), then we probably cant complete. In this case, add the result to pending and return //main thread will flush the pending completions in MarkEnd(). //otherwise, call EndX on the result and remove it from results. diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs index 0ae8268e7fc..1698d27888b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PeerNeighborManager.cs @@ -1635,7 +1635,7 @@ namespace System.ServiceModel.Channels throw; } - // Indicate [....] completion to the caller + // Indicate sync completion to the caller if (result.CompletedSynchronously) base.Complete(true); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs index f50e3667174..70538c75bfc 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/PipeConnection.cs @@ -798,7 +798,7 @@ namespace System.ServiceModel.Channels ulong GetServerPid() { ulong id; -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() if (!UnsafeNativeMethods.GetNamedPipeServerProcessId(pipe, out id)) { Win32Exception e = new Win32Exception(); @@ -810,7 +810,7 @@ namespace System.ServiceModel.Channels ulong GetClientPid() { ulong id; -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() if (!UnsafeNativeMethods.GetNamedPipeServerProcessId(pipe, out id)) { Win32Exception e = new Win32Exception(); @@ -885,7 +885,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(ConvertPipeException(e, TransferOperation.Read)); } } -#pragma warning suppress 56500 // [....], transferring exception to caller +#pragma warning suppress 56500 // Microsoft, transferring exception to caller catch (Exception e) { if (Fx.IsFatal(e)) @@ -955,7 +955,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelper(ConvertPipeException(e, TransferOperation.Write), ExceptionEventType); } } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2293,7 +2293,7 @@ namespace System.ServiceModel.Channels } } } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs index 3f258f1641f..58c50c38a0f 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ReplyChannel.cs @@ -129,7 +129,7 @@ namespace System.ServiceModel.Channels { thisPtr.HandleReceiveRequestComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs index 687c24254c5..f6e2de5fec7 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestChannel.cs @@ -415,7 +415,7 @@ namespace System.ServiceModel.Channels } thisPtr.CleanupEvents(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs index f062f22e9a0..269367ec443 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/RequestContextBase.cs @@ -45,7 +45,7 @@ namespace System.ServiceModel.Channels { if (this.requestMessageException != null) { -#pragma warning suppress 56503 // [....], see outcome of DCR 50092 +#pragma warning suppress 56503 // Microsoft, see outcome of DCR 50092 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(this.requestMessageException); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SafeNativeMethods.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SafeNativeMethods.cs index f63d363b4ec..261d8c688ee 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SafeNativeMethods.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SafeNativeMethods.cs @@ -7,6 +7,7 @@ namespace System.ServiceModel.Channels using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; + using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME; [SuppressUnmanagedCodeSecurity] internal static class SafeNativeMethods @@ -20,10 +21,19 @@ namespace System.ServiceModel.Channels [Out] out uint increment, [Out] out uint adjustmentDisabled ); - + [DllImport(KERNEL32, SetLastError = true)] [ResourceExposure(ResourceScope.None)] - public static extern void GetSystemTimeAsFileTime(out long time); + private static extern void GetSystemTimeAsFileTime([Out] out FILETIME time); + + public static void GetSystemTimeAsFileTime(out long time) { + FILETIME fileTime; + GetSystemTimeAsFileTime(out fileTime); + time = 0; + time |= (uint)fileTime.dwHighDateTime; + time <<= sizeof(uint) * 8; + time |= (uint)fileTime.dwLowDateTime; + } [Fx.Tag.SecurityNote(Critical = "Calls critical method GetSystemTimeAdjustment.", Safe = "Method is a SafeNativeMethod.")] diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs index 4a140246430..340b136e949 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SecurityBindingElementImporter.cs @@ -349,7 +349,7 @@ namespace System.ServiceModel.Channels // normalize protection level settings at the operation scope if possible to help avoid typed message generation if (hasProtectionLevel && isProtectionLevelUniform) { - // ([....]) remove the foreach message here + // (Microsoft) remove the foreach message here // foreach (MessageDescription message in operation.Messages) this.ResetProtectionLevelForMessages(operation); @@ -665,7 +665,7 @@ namespace System.ServiceModel.Channels { // We already have found and imported the message security binding element above. Hence this could be the dual mode security. // Now let us see if there is HttpsTransportBinding assertion also below it .This is to avoid the - // warning messages while importing wsdl representing the message security over Https transport security scenario. See Bug:136416. + // warning messages while importing wsdl representing the message security over Https transport security scenario. See SecurityBindingElement tbe = null; this.TryImportTransportSecurityBindingElement(importer, policyContext, out tbe, true); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs index d2551e9e314..8469527bec0 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/ServiceChannelProxy.cs @@ -765,7 +765,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext +#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxDictionaryIsEmpty))); } } @@ -778,7 +778,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext +#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxDictionaryIsEmpty))); } } @@ -787,7 +787,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext +#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxDictionaryIsEmpty))); } } @@ -796,7 +796,7 @@ namespace System.ServiceModel.Channels { get { -#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext +#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SFxDictionaryIsEmpty))); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs index 71a06c030bf..62fff724ff7 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SessionConnectionReader.cs @@ -1465,7 +1465,7 @@ namespace System.ServiceModel.Channels } } } -#pragma warning suppress 56500 // [....], transferring exception to caller +#pragma warning suppress 56500 // Microsoft, transferring exception to caller catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs index 5660eb1b93b..4cb52f57980 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SingletonConnectionReader.cs @@ -595,7 +595,7 @@ namespace System.ServiceModel.Channels if (!upgradeAsyncResult.CompletedSynchronously) { - upgradeAsyncResult = null; //caller shouldn't use this out param unless completed [....]. + upgradeAsyncResult = null; //caller shouldn't use this out param unless completed sync. return false; } @@ -1295,7 +1295,7 @@ namespace System.ServiceModel.Channels { thisPtr.message = thisPtr.parent.Receive(thisPtr.timeout); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception exception) { if (Fx.IsFatal(exception)) @@ -1892,7 +1892,7 @@ namespace System.ServiceModel.Channels completeSelf = thisPtr.HandleWriteStartBytes(); throwing = false; } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1928,7 +1928,7 @@ namespace System.ServiceModel.Channels completeSelf = thisPtr.HandleWriteBufferedMessage(); throwing = false; } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1963,7 +1963,7 @@ namespace System.ServiceModel.Channels completeSelf = thisPtr.HandleWriteEndBytes(); success = true; } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs index 2a57b0bdbf5..6690af5b3da 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SocketConnection.cs @@ -941,7 +941,7 @@ namespace System.ServiceModel.Channels { this.asyncWriteException = ConvertSendException(socketException, TimeSpan.MaxValue); } -#pragma warning suppress 56500 // [....], transferring exception to caller +#pragma warning suppress 56500 // Microsoft, transferring exception to caller catch (Exception exception) { if (Fx.IsFatal(exception)) @@ -1274,7 +1274,7 @@ namespace System.ServiceModel.Channels { this.asyncReadException = ConvertObjectDisposedException(objectDisposedException, TransferOperation.Read); } -#pragma warning suppress 56500 // [....], transferring exception to caller +#pragma warning suppress 56500 // Microsoft, transferring exception to caller catch (Exception exception) { if (Fx.IsFatal(exception)) @@ -1306,7 +1306,7 @@ namespace System.ServiceModel.Channels { asyncReadException = ConvertReceiveException(socketException, TimeSpan.MaxValue); } -#pragma warning suppress 56500 // [....], transferring exception to caller +#pragma warning suppress 56500 // Microsoft, transferring exception to caller catch (Exception exception) { if (Fx.IsFatal(exception)) @@ -1927,7 +1927,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.StartConnect(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2234,7 +2234,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.StartAccept(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs index 4220d500c1b..957aefd915a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityBindingElement.cs @@ -3,6 +3,7 @@ //----------------------------------------------------------------------------- namespace System.ServiceModel.Channels { + using System.Security.Authentication; using System.ComponentModel; using System.Collections.Generic; using System.Net.Security; @@ -16,10 +17,12 @@ namespace System.ServiceModel.Channels { IdentityVerifier identityVerifier; bool requireClientCertificate; + SslProtocols sslProtocols; public SslStreamSecurityBindingElement() { this.requireClientCertificate = TransportDefaults.RequireClientCertificate; + this.sslProtocols = TransportDefaults.SslProtocols; } protected SslStreamSecurityBindingElement(SslStreamSecurityBindingElement elementToBeCloned) @@ -27,6 +30,7 @@ namespace System.ServiceModel.Channels { this.identityVerifier = elementToBeCloned.identityVerifier; this.requireClientCertificate = elementToBeCloned.requireClientCertificate; + this.sslProtocols = elementToBeCloned.sslProtocols; } public IdentityVerifier IdentityVerifier @@ -64,6 +68,20 @@ namespace System.ServiceModel.Channels } } + [DefaultValue(TransportDefaults.SslProtocols)] + public SslProtocols SslProtocols + { + get + { + return this.sslProtocols; + } + set + { + SslProtocolsHelper.Validate(value); + this.sslProtocols = value; + } + } + public override IChannelFactory<TChannel> BuildChannelFactory<TChannel>(BindingContext context) { if (context == null) @@ -71,7 +89,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null context.BindingParameters.Add(this); return context.BuildInnerChannelFactory<TChannel>(); } @@ -83,7 +101,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null context.BindingParameters.Add(this); return context.CanBuildInnerChannelFactory<TChannel>(); } @@ -95,7 +113,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null context.BindingParameters.Add(this); return context.BuildInnerChannelListener<TChannel>(); } @@ -107,7 +125,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null context.BindingParameters.Add(this); return context.CanBuildInnerChannelListener<TChannel>(); } @@ -218,7 +236,7 @@ namespace System.ServiceModel.Channels return false; } - return this.requireClientCertificate == ssl.requireClientCertificate; + return this.requireClientCertificate == ssl.requireClientCertificate && this.sslProtocols == ssl.sslProtocols; } [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs index 2def8e744e0..a9761c4dcab 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SslStreamSecurityUpgradeProvider.cs @@ -34,17 +34,19 @@ namespace System.ServiceModel.Channels bool requireClientCertificate; string scheme; bool enableChannelBinding; + SslProtocols sslProtocols; - SslStreamSecurityUpgradeProvider(IDefaultCommunicationTimeouts timeouts, SecurityTokenManager clientSecurityTokenManager, bool requireClientCertificate, string scheme, IdentityVerifier identityVerifier) + SslStreamSecurityUpgradeProvider(IDefaultCommunicationTimeouts timeouts, SecurityTokenManager clientSecurityTokenManager, bool requireClientCertificate, string scheme, IdentityVerifier identityVerifier, SslProtocols sslProtocols) : base(timeouts) { this.identityVerifier = identityVerifier; this.scheme = scheme; this.clientSecurityTokenManager = clientSecurityTokenManager; this.requireClientCertificate = requireClientCertificate; + this.sslProtocols = sslProtocols; } - SslStreamSecurityUpgradeProvider(IDefaultCommunicationTimeouts timeouts, SecurityTokenProvider serverTokenProvider, bool requireClientCertificate, SecurityTokenAuthenticator clientCertificateAuthenticator, string scheme, IdentityVerifier identityVerifier) + SslStreamSecurityUpgradeProvider(IDefaultCommunicationTimeouts timeouts, SecurityTokenProvider serverTokenProvider, bool requireClientCertificate, SecurityTokenAuthenticator clientCertificateAuthenticator, string scheme, IdentityVerifier identityVerifier, SslProtocols sslProtocols) : base(timeouts) { this.serverTokenProvider = serverTokenProvider; @@ -52,6 +54,7 @@ namespace System.ServiceModel.Channels this.clientCertificateAuthenticator = clientCertificateAuthenticator; this.identityVerifier = identityVerifier; this.scheme = scheme; + this.sslProtocols = sslProtocols; } public static SslStreamSecurityUpgradeProvider CreateClientProvider( @@ -65,7 +68,7 @@ namespace System.ServiceModel.Channels } SecurityTokenManager tokenManager = credentialProvider.CreateSecurityTokenManager(); - return new SslStreamSecurityUpgradeProvider(context.Binding, tokenManager, bindingElement.RequireClientCertificate, context.Binding.Scheme, bindingElement.IdentityVerifier); + return new SslStreamSecurityUpgradeProvider(context.Binding, tokenManager, bindingElement.RequireClientCertificate, context.Binding.Scheme, bindingElement.IdentityVerifier, bindingElement.SslProtocols); } public static SslStreamSecurityUpgradeProvider CreateServerProvider( @@ -99,7 +102,7 @@ namespace System.ServiceModel.Channels TransportSecurityHelpers.GetCertificateTokenAuthenticator(tokenManager, context.Binding.Scheme, listenUri); return new SslStreamSecurityUpgradeProvider(context.Binding, tokenProvider, bindingElement.RequireClientCertificate, - certificateAuthenticator, context.Binding.Scheme, bindingElement.IdentityVerifier); + certificateAuthenticator, context.Binding.Scheme, bindingElement.IdentityVerifier, bindingElement.SslProtocols); } public override EndpointIdentity Identity @@ -164,6 +167,11 @@ namespace System.ServiceModel.Channels get { return this.scheme; } } + public SslProtocols SslProtocols + { + get { return this.sslProtocols; } + } + public override T GetProperty<T>() { if (typeof(T) == typeof(IChannelBindingProvider) || typeof(T) == typeof(IStreamUpgradeChannelBindingProvider)) @@ -431,7 +439,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleOpenAuthenticatorComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -462,7 +470,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleOpenTokenProviderComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -493,7 +501,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleGetTokenComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -524,7 +532,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleCloseTokenProviderComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -589,7 +597,7 @@ namespace System.ServiceModel.Channels try { sslStream.AuthenticateAsServer(this.parent.ServerCertificate, this.parent.RequireClientCertificate, - SslProtocols.Default, false); + this.parent.SslProtocols, false); } catch (AuthenticationException exception) { @@ -703,7 +711,7 @@ namespace System.ServiceModel.Channels this.sslStream = new SslStream(stream, false, this.acceptor.ValidateRemoteCertificate); return this.sslStream.BeginAuthenticateAsServer(this.acceptor.parent.ServerCertificate, - this.acceptor.parent.RequireClientCertificate, SslProtocols.Default, false, callback, this); + this.acceptor.parent.RequireClientCertificate, this.acceptor.parent.SslProtocols, false, callback, this); } protected override Stream OnCompleteAuthenticateAsServer(IAsyncResult result) @@ -910,7 +918,7 @@ namespace System.ServiceModel.Channels SslStream sslStream = new SslStream(stream, false, this.ValidateRemoteCertificate, selectionCallback); try { - sslStream.AuthenticateAsClient(string.Empty, clientCertificates, SslProtocols.Default, false); + sslStream.AuthenticateAsClient(string.Empty, clientCertificates, this.parent.SslProtocols, false); } catch (SecurityTokenValidationException tokenValidationException) { @@ -995,7 +1003,7 @@ namespace System.ServiceModel.Channels try { return this.sslStream.BeginAuthenticateAsClient(string.Empty, this.clientCertificates, - SslProtocols.Default, false, callback, this); + this.initiator.parent.SslProtocols, false, callback, this); } catch (SecurityTokenValidationException tokenValidationException) { @@ -1134,7 +1142,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleBaseOpenComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1165,7 +1173,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleOpenTokenProviderComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1196,7 +1204,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleGetTokenComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1286,7 +1294,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleBaseCloseComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1316,7 +1324,7 @@ namespace System.ServiceModel.Channels { SecurityUtils.EndCloseTokenProviderIfRequired(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs index 55a2020f77e..364205eab36 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StandardBindingImporter.cs @@ -21,7 +21,7 @@ namespace System.ServiceModel.Channels if (endpointContext == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext"); -#pragma warning suppress 56506 // [....], endpointContext.Endpoint is never null +#pragma warning suppress 56506 // Microsoft, endpointContext.Endpoint is never null if (endpointContext.Endpoint.Binding == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("endpointContext.Binding"); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs index fb32637e265..f045513e285 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeAcceptorAsyncResult.cs @@ -90,7 +90,7 @@ namespace System.ServiceModel.Channels { acceptUpgradeAsyncResult.CompleteAuthenticateAsServer(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs index 5d18a8df17e..37d443c87cf 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamSecurityUpgradeInitiatorAsyncResult.cs @@ -93,7 +93,7 @@ namespace System.ServiceModel.Channels { thisPtr.CompleteAuthenticateAsClient(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs index fc5e285e288..ccfc53f4304 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/StreamedFramingRequestChannel.cs @@ -348,7 +348,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleWritePreamble(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -377,7 +377,7 @@ namespace System.ServiceModel.Channels thisPtr.connection.EndWrite(); completeSelf = thisPtr.ReadPreambleAck(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -405,7 +405,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandlePreambleAck(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -438,7 +438,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleUpgrade(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -470,7 +470,7 @@ namespace System.ServiceModel.Channels { ConnectionUpgradeHelper.EndDecodeFramingFault(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -763,7 +763,7 @@ namespace System.ServiceModel.Channels completeSelf = thisPtr.HandleEstablishConnection(result); throwing = false; } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -805,7 +805,7 @@ namespace System.ServiceModel.Channels completeSelf = thisPtr.HandleWriteMessage(result); throwing = false; } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -842,7 +842,7 @@ namespace System.ServiceModel.Channels completeSelf = thisPtr.CompleteReceiveReply(result); throwing = false; } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs index 99380758425..91df25a657b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/SynchronizedMessageSource.cs @@ -176,7 +176,7 @@ namespace System.ServiceModel.Channels thisPtr.exitLock = true; completeSelf = thisPtr.PerformOperation(thisPtr.timeoutHelper.RemainingTime()); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -225,7 +225,7 @@ namespace System.ServiceModel.Channels { thisPtr.SetReturnValue(thisPtr.Source.EndReceive()); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -270,7 +270,7 @@ namespace System.ServiceModel.Channels { thisPtr.SetReturnValue(thisPtr.Source.EndWaitForMessage()); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs index c1727702b66..799f5ba415c 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElement.cs @@ -117,7 +117,7 @@ namespace System.ServiceModel.Channels // to cover all our bases, let's iterate through the BindingParameters to make sure // we haven't missed a query (since we're the Transport and we're at the bottom) -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null Collection<BindingElement> bindingElements = context.BindingParameters.FindAll<BindingElement>(); T result = default(T); @@ -154,7 +154,7 @@ namespace System.ServiceModel.Channels internal ChannelProtectionRequirements GetProtectionRequirements(BindingContext context) { AddressingVersion addressingVersion = AddressingVersion.WSAddressing10; -#pragma warning suppress 56506 // [....], CustomBinding.Elements can never be null +#pragma warning suppress 56506 // Microsoft, CustomBinding.Elements can never be null MessageEncodingBindingElement messageEncoderBindingElement = context.Binding.Elements.Find<MessageEncodingBindingElement>(); if (messageEncoderBindingElement != null) { @@ -183,7 +183,7 @@ namespace System.ServiceModel.Channels } // Set SoapBinding Transport URI -#pragma warning suppress 56506 // [....], these properties cannot be null in this context +#pragma warning suppress 56506 // Microsoft, these properties cannot be null in this context BindingElementCollection bindingElements = endpointContext.Endpoint.Binding.CreateBindingElements(); if (wsdlTransportUri != null) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs index 3cd450b6d5c..9e6b90657f3 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportBindingElementImporter.cs @@ -36,20 +36,20 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], these properties cannot be null in this context +#pragma warning suppress 56506 // Microsoft, these properties cannot be null in this context if (context.Endpoint.Binding == null) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context.Endpoint.Binding"); } -#pragma warning suppress 56506 // [....], CustomBinding.Elements never be null +#pragma warning suppress 56506 // Microsoft, CustomBinding.Elements never be null TransportBindingElement transportBindingElement = GetBindingElements(context).Find<TransportBindingElement>(); bool transportHandledExternaly = (transportBindingElement != null) && !StateHelper.IsRegisteredTransportBindingElement(importer, context); if (transportHandledExternaly) return; -#pragma warning suppress 56506 // [....], these properties cannot be null in this context +#pragma warning suppress 56506 // Microsoft, these properties cannot be null in this context WsdlNS.SoapBinding soapBinding = (WsdlNS.SoapBinding)context.WsdlBinding.Extensions.Find(typeof(WsdlNS.SoapBinding)); if (soapBinding != null && transportBindingElement == null) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDefaults.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDefaults.cs index ce6834f178b..f689dc4a0de 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDefaults.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDefaults.cs @@ -8,6 +8,7 @@ namespace System.ServiceModel.Channels using System.Net.Security; using System.Net.WebSockets; using System.Runtime; + using System.Security.Authentication; using System.Security.Principal; using System.ServiceModel; using System.ServiceModel.Dispatcher; @@ -201,6 +202,7 @@ namespace System.ServiceModel.Channels internal const bool RequireClientCertificate = false; internal const int MaxFaultSize = MaxBufferSize; internal const int MaxSecurityFaultSize = 16384; + internal const SslProtocols SslProtocols = SslProtocols.Ssl3 | SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12; // Calling CreateFault on an incoming message can expose some DoS-related security // vulnerabilities when a service is in streaming mode. See MB 47592 for more details. diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs index ec077721918..d0a75974cbc 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportDuplexSessionChannel.cs @@ -739,7 +739,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleCloseOutputSession(result, false); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -771,7 +771,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.HandleCloseInputSession(result, false); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -937,7 +937,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.WriteEndBytes(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -965,7 +965,7 @@ namespace System.ServiceModel.Channels { thisPtr.HandleWriteEndBytesComplete(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1105,7 +1105,7 @@ namespace System.ServiceModel.Channels { completeSelf = thisPtr.WriteCore(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1133,7 +1133,7 @@ namespace System.ServiceModel.Channels { thisPtr.channel.FinishWritingMessage(); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1290,7 +1290,7 @@ namespace System.ServiceModel.Channels DiagnosticUtility.TraceHandledException(e, TraceEventType.Information); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs index aedfcbdd37c..5bf91cc0194 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportManager.cs @@ -345,7 +345,7 @@ namespace System.ServiceModel.Channels { this.OnScheduled(this.parent); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs index 3abbf4e36ed..84154efa76a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/TransportSecurityHelpers.cs @@ -606,7 +606,7 @@ namespace System.ServiceModel.Channels { thisPtr.CompleteGetToken(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -700,7 +700,7 @@ namespace System.ServiceModel.Channels { thisPtr.CompleteGetToken(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs index 647dce82c45..2634898e8f3 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UnsafeNativeMethods.cs @@ -1099,6 +1099,12 @@ namespace System.ServiceModel.Channels [MarshalAs(UnmanagedType.U1), Out] out bool pfEnabled ); + +#if !FEATURE_CORECLR + // On CoreCLR this is not the way to determine if a process is a tailored application (which means APPX). + // On CoreCLR AppX is determined by a flag past to the host which is exposed by AppDomain.IsAppXProcess in mscorlib. + // The reason for this if-def is to ensure nobody takes a dependency on this on CoreCLR. + // AppModel.h functions (Win8+) [DllImport(KERNEL32, CharSet = CharSet.None, EntryPoint = "GetCurrentPackageId")] [SecurityCritical] @@ -1128,6 +1134,7 @@ namespace System.ServiceModel.Channels /// Indicates weather the running application is an immersive (or modern) Windows 8 (or later) application. /// </summary> internal static Lazy<bool> IsTailoredApplication = new Lazy<bool>(() => _IsTailoredApplication()); +#endif //!FEATURE_CORECLR } [SuppressUnmanagedCodeSecurity] @@ -1145,7 +1152,7 @@ namespace System.ServiceModel.Channels internal int GetClientPid() { int pid; -#pragma warning suppress 56523 // [....], Win32Exception ctor calls Marshal.GetLastWin32Error() +#pragma warning suppress 56523 // Microsoft, Win32Exception ctor calls Marshal.GetLastWin32Error() bool success = UnsafeNativeMethods.GetNamedPipeClientProcessId(this, out pid); if (!success) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs index 71549cd703b..4795a09177b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/UriPrefixTable.cs @@ -56,7 +56,7 @@ namespace System.ServiceModel.Channels { // The UriPrefixTable instance itself is used as a // synchronization primitive in the TransportManagers and the - // TransportManagerContainers so we return 'this' to keep them in [....]. + // TransportManagerContainers so we return 'this' to keep them in sync. return this; } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs index 8f027c01ce9..e1f36707c02 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityBindingElement.cs @@ -57,7 +57,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null context.BindingParameters.Add(this); return context.BuildInnerChannelFactory<TChannel>(); } @@ -69,7 +69,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null context.BindingParameters.Add(this); return context.CanBuildInnerChannelFactory<TChannel>(); } @@ -81,7 +81,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null context.BindingParameters.Add(this); return context.BuildInnerChannelListener<TChannel>(); } @@ -93,7 +93,7 @@ namespace System.ServiceModel.Channels throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("context"); } -#pragma warning suppress 56506 // [....], BindingContext.BindingParameters cannot be null +#pragma warning suppress 56506 // Microsoft, BindingContext.BindingParameters cannot be null context.BindingParameters.Add(this); return context.CanBuildInnerChannelListener<TChannel>(); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs index feaf5f1b1cf..441c80b91f1 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Channels/WindowsStreamSecurityUpgradeProvider.cs @@ -614,7 +614,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleBaseOpenComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -645,7 +645,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleOpenTokenProviderComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -676,7 +676,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleGetSspiCredentialComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -758,7 +758,7 @@ namespace System.ServiceModel.Channels { completeSelf = this.HandleBaseCloseComplete(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -788,7 +788,7 @@ namespace System.ServiceModel.Channels { SecurityUtils.EndCloseTokenProviderIfRequired(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs index c969544ef04..9da24fb18bb 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ClientBase.cs @@ -376,7 +376,7 @@ namespace System.ServiceModel } else { -#pragma warning suppress 56503 // [....], We throw only for unknown exceptions. +#pragma warning suppress 56503 // Microsoft, We throw only for unknown exceptions. throw; } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IClassFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IClassFactory.cs index 66772f888a4..4d9c3b8699f 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IClassFactory.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IClassFactory.cs @@ -11,4 +11,4 @@ internal interface IClassFactory [return: MarshalAs(UnmanagedType.Interface)] object CreateInstance([In, MarshalAs(UnmanagedType.IUnknown)] object pUnkOuter, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid); void LockServer([In, MarshalAs(UnmanagedType.Bool)]bool fLock); -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IContextSecurityPerimeter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IContextSecurityPerimeter.cs index 06d679d8bc7..d21b9655918 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IContextSecurityPerimeter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IContextSecurityPerimeter.cs @@ -16,4 +16,4 @@ namespace System.ServiceModel.ComIntegration void SetPerimeterFlag([MarshalAs(UnmanagedType.Bool)] bool flag); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IServerSecurity.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IServerSecurity.cs index 7fb9461b3cb..a0d0fb6253c 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IServerSecurity.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ComIntegration/IServerSecurity.cs @@ -30,4 +30,4 @@ namespace System.ServiceModel.ComIntegration bool IsImpersonating(); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs index 05db2a82948..94912a949e8 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/BinaryMessageEncodingElement.cs @@ -63,7 +63,7 @@ namespace System.ServiceModel.Configuration binding.MaxSessionSize = this.MaxSessionSize; binding.MaxReadPoolSize = this.MaxReadPoolSize; binding.MaxWritePoolSize = this.MaxWritePoolSize; -#pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null +#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration() checks for 'binding' being null this.ReaderQuotas.ApplyConfiguration(binding.ReaderQuotas); binding.CompressionFormat = this.CompressionFormat; } @@ -73,7 +73,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); BinaryMessageEncodingElement source = (BinaryMessageEncodingElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.MaxSessionSize = source.MaxSessionSize; this.MaxReadPoolSize = source.MaxReadPoolSize; this.MaxWritePoolSize = source.MaxWritePoolSize; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs index e9ffa4980f0..68aaa719233 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackDebugElement.cs @@ -25,7 +25,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); CallbackDebugElement source = (CallbackDebugElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() check for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null this.IncludeExceptionDetailInFaults = source.IncludeExceptionDetailInFaults; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs index c12e897d24b..e998b23a0fa 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CallbackTimeoutsElement.cs @@ -29,7 +29,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); CallbackTimeoutsElement source = (CallbackTimeoutsElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.TransactionTimeout = source.TransactionTimeout; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs index ca6fdc46366..71c11065ab4 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientCredentialsElement.cs @@ -96,7 +96,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ClientCredentialsElement source = (ClientCredentialsElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.ClientCertificate.Copy(source.ClientCertificate); this.ServiceCertificate.Copy(source.ServiceCertificate); this.Windows.Copy(source.Windows); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs index 7c79bab3f26..33e4d36bd11 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ClientViaElement.cs @@ -25,7 +25,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ClientViaElement source = (ClientViaElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() check for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null this.ViaUri = source.ViaUri; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs index 6913327c252..d5220b39c01 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonEndpointBehaviorElement.cs @@ -23,7 +23,7 @@ namespace System.ServiceModel.Configuration { if (!typeof(System.ServiceModel.Description.IEndpointBehavior).IsAssignableFrom(element.BehaviorType)) { -#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration) +#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidCommonEndpointBehaviorType, element.ConfigurationElementName, typeof(System.ServiceModel.Description.IEndpointBehavior).FullName), @@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration { if (!typeof(System.ServiceModel.Description.IEndpointBehavior).IsAssignableFrom(element.BehaviorType)) { -#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration) +#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidCommonEndpointBehaviorType, element.ConfigurationElementName, typeof(System.ServiceModel.Description.IEndpointBehavior).FullName), diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs index 963969c6d22..ab4e50ac044 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CommonServiceBehaviorElement.cs @@ -23,7 +23,7 @@ namespace System.ServiceModel.Configuration { if (!typeof(System.ServiceModel.Description.IServiceBehavior).IsAssignableFrom(element.BehaviorType)) { -#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration) +#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidCommonServiceBehaviorType, element.ConfigurationElementName, typeof(System.ServiceModel.Description.IServiceBehavior).FullName), @@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration { if (!typeof(System.ServiceModel.Description.IServiceBehavior).IsAssignableFrom(element.BehaviorType)) { -#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration) +#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidCommonServiceBehaviorType, element.ConfigurationElementName, typeof(System.ServiceModel.Description.IServiceBehavior).FullName), diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs index 8367bce3605..960392bb704 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/CompositeDuplexElement.cs @@ -35,7 +35,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); CompositeDuplexElement source = (CompositeDuplexElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.ClientBaseAddress = source.ClientBaseAddress; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationHelpers.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationHelpers.cs index 74e3234cf9b..5271947453a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationHelpers.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationHelpers.cs @@ -37,7 +37,7 @@ namespace System.ServiceModel.Configuration new ConfigurationErrorsException(SR.GetString(SR.ConfigBindingExtensionNotFound, ConfigurationHelpers.GetBindingsSectionPath(bindingCollectionName)))); } - catch (NullReferenceException) // System.Configuration.ConfigurationElement bug + catch (NullReferenceException) // System.Configuration.ConfigurationElement { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new ConfigurationErrorsException(SR.GetString(SR.ConfigBindingExtensionNotFound, @@ -69,7 +69,7 @@ namespace System.ServiceModel.Configuration new ConfigurationErrorsException(SR.GetString(SR.ConfigBindingExtensionNotFound, ConfigurationHelpers.GetBindingsSectionPath(bindingCollectionName)))); } - catch (NullReferenceException) // System.Configuration.ConfigurationElement bug + catch (NullReferenceException) // System.Configuration.ConfigurationElement { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new ConfigurationErrorsException(SR.GetString(SR.ConfigBindingExtensionNotFound, @@ -99,7 +99,7 @@ namespace System.ServiceModel.Configuration new ConfigurationErrorsException(SR.GetString(SR.ConfigEndpointExtensionNotFound, ConfigurationHelpers.GetEndpointsSectionPath(endpointCollectionName)))); } - catch (NullReferenceException) // System.Configuration.ConfigurationElement bug + catch (NullReferenceException) // System.Configuration.ConfigurationElement { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new ConfigurationErrorsException(SR.GetString(SR.ConfigEndpointExtensionNotFound, @@ -131,7 +131,7 @@ namespace System.ServiceModel.Configuration new ConfigurationErrorsException(SR.GetString(SR.ConfigEndpointExtensionNotFound, ConfigurationHelpers.GetEndpointsSectionPath(endpointCollectionName)))); } - catch (NullReferenceException) // System.Configuration.ConfigurationElement bug + catch (NullReferenceException) // System.Configuration.ConfigurationElement { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError( new ConfigurationErrorsException(SR.GetString(SR.ConfigEndpointExtensionNotFound, diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationStrings.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationStrings.cs index 390b21cd4bd..6d3b0516ad9 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationStrings.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConfigurationStrings.cs @@ -401,6 +401,7 @@ namespace System.ServiceModel.Configuration internal const string Soap12WSAddressing10 = "Soap12WSAddressing10"; internal const string Soap12WSAddressingAugust2004 = "Soap12WSAddressingAugust2004"; internal const string SslCertificateAuthentication = "sslCertificateAuthentication"; + internal const string SslProtocols = "sslProtocols"; internal const string SslStreamSecuritySectionName = "sslStreamSecurity"; internal const string StandardEndpoint = "standardEndpoint"; internal const string StandardEndpointsSectionName = "standardEndpoints"; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs index 40411ccbc5e..d9f93eff49d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ConnectionOrientedTransportElement.cs @@ -111,7 +111,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ConnectionOrientedTransportElement source = (ConnectionOrientedTransportElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.ConnectionBufferSize = source.ConnectionBufferSize; this.HostNameComparisonMode = source.HostNameComparisonMode; this.ChannelInitializationTimeout = source.ChannelInitializationTimeout; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs index ac7dea53490..2997f320965 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/DataContractSerializerElement.cs @@ -38,7 +38,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); DataContractSerializerElement source = (DataContractSerializerElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.IgnoreExtensionDataObject = source.IgnoreExtensionDataObject; this.MaxItemsInObjectGraph = source.MaxItemsInObjectGraph; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs index 02733601e3c..4c079f993d6 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/EndpointBehaviorElement.cs @@ -37,7 +37,7 @@ namespace System.ServiceModel.Configuration } if (!typeof(System.ServiceModel.Description.IEndpointBehavior).IsAssignableFrom(element.BehaviorType)) { -#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration) +#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidEndpointBehaviorType, element.ConfigurationElementName, this.Name), @@ -62,7 +62,7 @@ namespace System.ServiceModel.Configuration } if (!typeof(System.ServiceModel.Description.IEndpointBehavior).IsAssignableFrom(element.BehaviorType)) { -#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration) +#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidEndpointBehaviorType, element.ConfigurationElementName, this.Name), diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ExtensionElementCollection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ExtensionElementCollection.cs index 066afddd96b..ba05d703ce2 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ExtensionElementCollection.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ExtensionElementCollection.cs @@ -87,7 +87,7 @@ namespace System.ServiceModel.Configuration else if (element.TypeName.Equals(extension.TypeName, StringComparison.Ordinal)) { // In order to avoid extra assemblies being loaded, we perform type comparison only if the type names - // are the same. See bug CSDMain 222573. + // are the same. See Type elementType = Type.GetType(element.Type, false); if (null != elementType && elementType.Equals(Type.GetType(extension.Type, false))) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs index e8e8d211ebd..b3df15d6f1a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpTransportElement.cs @@ -211,7 +211,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); HttpTransportElement source = (HttpTransportElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.AllowCookies = source.AllowCookies; this.RequestInitializationTimeout = source.RequestInitializationTimeout; this.AuthenticationScheme = source.AuthenticationScheme; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs index 38d9700d506..5e54dbf2fbd 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/HttpsTransportElement.cs @@ -30,7 +30,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); HttpsTransportElement source = (HttpsTransportElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.RequireClientCertificate = source.RequireClientCertificate; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs index 50ed2a79999..e7ec1f86419 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IdentityElement.cs @@ -111,7 +111,7 @@ namespace System.ServiceModel.Configuration else if (identity is X509CertificateEndpointIdentity) { X509Certificate2Collection certs = ((X509CertificateEndpointIdentity)identity).Certificates; -#pragma warning suppress 56506 //[....]; this.Certificate can never be null (underlying configuration system guarantees) +#pragma warning suppress 56506 //Microsoft; this.Certificate can never be null (underlying configuration system guarantees) this.Certificate.EncodedValue = Convert.ToBase64String(certs.Export(certs.Count == 1 ? X509ContentType.SerializedCert : X509ContentType.SerializedStore)); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs index c12c1022c0f..7c925c490ee 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenClientElement.cs @@ -94,17 +94,17 @@ namespace System.ServiceModel.Configuration this.MaxIssuedTokenCachingTime = from.MaxIssuedTokenCachingTime; this.IssuedTokenRenewalThresholdPercentage = from.IssuedTokenRenewalThresholdPercentage; -#pragma warning suppress 56506 //[....]; from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerIssuedTokenParameters] can never be null (underlying configuration system guarantees) +#pragma warning suppress 56506 //Microsoft; from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerIssuedTokenParameters] can never be null (underlying configuration system guarantees) if (PropertyValueOrigin.Default != from.ElementInformation.Properties[ConfigurationStrings.LocalIssuer].ValueOrigin) { this.LocalIssuer.Copy(from.LocalIssuer); } -#pragma warning suppress 56506 //[....]; from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerChannelBehaviors] can never be null (underlying configuration system guarantees) +#pragma warning suppress 56506 //Microsoft; from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerChannelBehaviors] can never be null (underlying configuration system guarantees) if (PropertyValueOrigin.Default != from.ElementInformation.Properties[ConfigurationStrings.LocalIssuerChannelBehaviors].ValueOrigin) { this.LocalIssuerChannelBehaviors = from.LocalIssuerChannelBehaviors; } -#pragma warning suppress 56506 //[....]; from.ElementInformation.Properties[ConfigurationStrings.IssuerChannelBehaviors] can never be null (underlying configuration system guarantees) +#pragma warning suppress 56506 //Microsoft; from.ElementInformation.Properties[ConfigurationStrings.IssuerChannelBehaviors] can never be null (underlying configuration system guarantees) if (PropertyValueOrigin.Default != from.ElementInformation.Properties[ConfigurationStrings.IssuerChannelBehaviors].ValueOrigin) { foreach (IssuedTokenClientBehaviorsElement element in from.IssuerChannelBehaviors) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs index 426a9ae19b9..5d7544aeba6 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/IssuedTokenServiceElement.cs @@ -114,7 +114,7 @@ namespace System.ServiceModel.Configuration throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("from"); } this.SamlSerializerType = from.SamlSerializerType; -#pragma warning suppress 56506 // [....]; ElementInformation is never null. +#pragma warning suppress 56506 // Microsoft; ElementInformation is never null. PropertyInformationCollection propertyInfo = from.ElementInformation.Properties; if (propertyInfo[ConfigurationStrings.KnownCertificates].ValueOrigin != PropertyValueOrigin.Default) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs index 8f40a13563e..6ad15c1e44d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/MtomMessageEncodingElement.cs @@ -24,7 +24,7 @@ namespace System.ServiceModel.Configuration binding.WriteEncoding = this.WriteEncoding; binding.MaxReadPoolSize = this.MaxReadPoolSize; binding.MaxWritePoolSize = this.MaxWritePoolSize; -#pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null +#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration() checks for 'binding' being null this.ReaderQuotas.ApplyConfiguration(binding.ReaderQuotas); binding.MaxBufferSize = this.MaxBufferSize; } @@ -39,7 +39,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); MtomMessageEncodingElement source = (MtomMessageEncodingElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.MessageVersion = source.MessageVersion; this.WriteEncoding = source.WriteEncoding; this.MaxReadPoolSize = source.MaxReadPoolSize; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs index 941b4601c4f..d5cfd75588b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/NamedPipeTransportElement.cs @@ -22,7 +22,7 @@ namespace System.ServiceModel.Configuration { base.ApplyConfiguration(bindingElement); NamedPipeTransportBindingElement binding = (NamedPipeTransportBindingElement)bindingElement; -#pragma warning suppress 56506 //[....]; base.ApplyConfiguration above checks for bindingElement being null +#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration above checks for bindingElement being null this.ConnectionPoolSettings.ApplyConfiguration(binding.ConnectionPoolSettings); this.PipeSettings.ApplyConfiguration(binding.PipeSettings); } @@ -30,7 +30,7 @@ namespace System.ServiceModel.Configuration protected internal override void InitializeFrom(BindingElement bindingElement) { base.InitializeFrom(bindingElement); -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument NamedPipeTransportBindingElement binding = (NamedPipeTransportBindingElement)bindingElement; this.ConnectionPoolSettings.InitializeFrom(binding.ConnectionPoolSettings); this.PipeSettings.InitializeFrom(binding.PipeSettings); @@ -40,7 +40,7 @@ namespace System.ServiceModel.Configuration { base.CopyFrom(from); NamedPipeTransportElement source = (NamedPipeTransportElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.ConnectionPoolSettings.CopyFrom(source.ConnectionPoolSettings); this.PipeSettings.CopyFrom(source.PipeSettings); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs index 0c90b056aa4..c3d3c369274 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/OneWayElement.cs @@ -47,7 +47,7 @@ namespace System.ServiceModel.Configuration PropertyInformationCollection propertyInfo = this.ElementInformation.Properties; if (propertyInfo[ConfigurationStrings.ChannelPoolSettings].ValueOrigin != PropertyValueOrigin.Default) { -#pragma warning suppress 56506 // [....], base.ApplyConfiguration() validates the argument +#pragma warning suppress 56506 // Microsoft, base.ApplyConfiguration() validates the argument this.ChannelPoolSettings.ApplyConfiguration(oneWayBindingElement.ChannelPoolSettings); } oneWayBindingElement.MaxAcceptedChannels = this.MaxAcceptedChannels; @@ -59,7 +59,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); OneWayElement source = (OneWayElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument PropertyInformationCollection propertyInfo = source.ElementInformation.Properties; if (propertyInfo[ConfigurationStrings.ChannelPoolSettings].ValueOrigin != PropertyValueOrigin.Default) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs index 5b8d687f39f..ddc638c7926 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PeerTransportElement.cs @@ -68,7 +68,7 @@ namespace System.ServiceModel.Configuration binding.Port = this.Port; binding.MaxBufferPoolSize = this.MaxBufferPoolSize; binding.MaxReceivedMessageSize = this.MaxReceivedMessageSize; -#pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null +#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration() checks for 'binding' being null this.Security.ApplyConfiguration(binding.Security); } @@ -77,7 +77,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); PeerTransportElement source = (PeerTransportElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.ListenIPAddress = source.ListenIPAddress; this.Port = source.Port; this.MaxBufferPoolSize = source.MaxBufferPoolSize; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs index c8e310db5dc..bdfdf19f58e 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/PrivacyNoticeElement.cs @@ -50,7 +50,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); PrivacyNoticeElement source = (PrivacyNoticeElement) from; - #pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument + #pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.Url = source.Url; this.Version = source.Version; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/Properties.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/Properties.cs index 0d026927dac..35c78297859 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/Properties.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/Properties.cs @@ -20,11 +20,11 @@ using System.Configuration; using System.Globalization; -// configType.Name: StandardBindingElement +// configType.Name: DiagnosticSection -namespace System.ServiceModel.Configuration +namespace System.ServiceModel.Activation.Configuration { - public partial class StandardBindingElement + public sealed partial class DiagnosticSection { ConfigurationPropertyCollection properties; @@ -35,11 +35,7 @@ namespace System.ServiceModel.Configuration if (this.properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("name", typeof(System.String), string.Empty, null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.IsKey)); - properties.Add(new ConfigurationProperty("closeTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:01:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("openTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:01:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("receiveTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:10:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("sendTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:01:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("performanceCountersEnabled", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -48,11 +44,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: NetTcpBindingElement +// configType.Name: NetPipeSection -namespace System.ServiceModel.Configuration +namespace System.ServiceModel.Activation.Configuration { - public partial class NetTcpBindingElement + public sealed partial class NetPipeSection { ConfigurationPropertyCollection properties; @@ -62,20 +58,11 @@ namespace System.ServiceModel.Configuration { if (this.properties == null) { - ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("transactionFlow", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("transferMode", typeof(System.ServiceModel.TransferMode), System.ServiceModel.TransferMode.Buffered, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.TransferModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("transactionProtocol", typeof(System.ServiceModel.TransactionProtocol), "OleTransactions", new System.ServiceModel.Configuration.TransactionProtocolConverter(), null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("hostNameComparisonMode", typeof(System.ServiceModel.HostNameComparisonMode), System.ServiceModel.HostNameComparisonMode.StrongWildcard, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.HostNameComparisonModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("listenBacklog", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxBufferPoolSize", typeof(System.Int64), (long)524288, null, new System.Configuration.LongValidator(0, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxBufferSize", typeof(System.Int32), 65536, null, new System.Configuration.IntegerValidator(1, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxConnections", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxReceivedMessageSize", typeof(System.Int64), (long)65536, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("portSharingEnabled", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("readerQuotas", typeof(System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("reliableSession", typeof(System.ServiceModel.Configuration.StandardBindingOptionalReliableSessionElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("security", typeof(System.ServiceModel.Configuration.NetTcpSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("allowAccounts", typeof(System.ServiceModel.Activation.Configuration.SecurityIdentifierElementCollection), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxPendingConnections", typeof(System.Int32), 100, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxPendingAccepts", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("receiveTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:00:30", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -84,11 +71,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: WSHttpBindingBaseElement +// configType.Name: NetTcpSection -namespace System.ServiceModel.Configuration +namespace System.ServiceModel.Activation.Configuration { - public partial class WSHttpBindingBaseElement + public sealed partial class NetTcpSection { ConfigurationPropertyCollection properties; @@ -98,18 +85,13 @@ namespace System.ServiceModel.Configuration { if (this.properties == null) { - ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("bypassProxyOnLocal", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("transactionFlow", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("hostNameComparisonMode", typeof(System.ServiceModel.HostNameComparisonMode), System.ServiceModel.HostNameComparisonMode.StrongWildcard, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.HostNameComparisonModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxBufferPoolSize", typeof(System.Int64), (long)524288, null, new System.Configuration.LongValidator(0, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxReceivedMessageSize", typeof(System.Int64), (long)65536, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("messageEncoding", typeof(System.ServiceModel.WSMessageEncoding), System.ServiceModel.WSMessageEncoding.Text, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.WSMessageEncodingHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("proxyAddress", typeof(System.Uri), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("readerQuotas", typeof(System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("reliableSession", typeof(System.ServiceModel.Configuration.StandardBindingOptionalReliableSessionElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("textEncoding", typeof(System.Text.Encoding), "utf-8", new System.ServiceModel.Configuration.EncodingConverter(), null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("useDefaultWebProxy", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("allowAccounts", typeof(System.ServiceModel.Activation.Configuration.SecurityIdentifierElementCollection), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("listenBacklog", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxPendingConnections", typeof(System.Int32), 100, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxPendingAccepts", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("receiveTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:00:30", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("teredoEnabled", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -118,11 +100,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: WSHttpBindingElement +// configType.Name: SecurityIdentifierElement -namespace System.ServiceModel.Configuration +namespace System.ServiceModel.Activation.Configuration { - public partial class WSHttpBindingElement + public sealed partial class SecurityIdentifierElement { ConfigurationPropertyCollection properties; @@ -132,9 +114,8 @@ namespace System.ServiceModel.Configuration { if (this.properties == null) { - ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("allowCookies", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("security", typeof(System.ServiceModel.Configuration.WSHttpSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("securityIdentifier", typeof(System.Security.Principal.SecurityIdentifier), null, new System.ServiceModel.Activation.Configuration.SecurityIdentifierConverter(), null, System.Configuration.ConfigurationPropertyOptions.IsKey)); this.properties = properties; } return this.properties; @@ -170,30 +151,6 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: StandardBindingCollectionElement`2 - -namespace System.ServiceModel.Configuration -{ - public partial class StandardBindingCollectionElement<TStandardBinding, TBindingConfiguration> - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("", typeof(System.ServiceModel.Configuration.StandardBindingElementCollection<TBindingConfiguration>), null, null, null, System.Configuration.ConfigurationPropertyOptions.IsDefaultCollection)); - this.properties = properties; - } - return this.properties; - } - } - } -} - // configType.Name: NetTcpContextBindingElement namespace System.ServiceModel.Configuration @@ -246,65 +203,6 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: HttpBindingBaseElement - -namespace System.ServiceModel.Configuration -{ - public partial class HttpBindingBaseElement - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("allowCookies", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("bypassProxyOnLocal", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("hostNameComparisonMode", typeof(System.ServiceModel.HostNameComparisonMode), System.ServiceModel.HostNameComparisonMode.StrongWildcard, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.HostNameComparisonModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxBufferPoolSize", typeof(System.Int64), (long)524288, null, new System.Configuration.LongValidator(0, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxBufferSize", typeof(System.Int32), 65536, null, new System.Configuration.IntegerValidator(1, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxReceivedMessageSize", typeof(System.Int64), (long)65536, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("proxyAddress", typeof(System.Uri), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("readerQuotas", typeof(System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("textEncoding", typeof(System.Text.Encoding), "utf-8", new System.ServiceModel.Configuration.EncodingConverter(), null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("transferMode", typeof(System.ServiceModel.TransferMode), System.ServiceModel.TransferMode.Buffered, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.TransferModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("useDefaultWebProxy", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - this.properties = properties; - } - return this.properties; - } - } - } -} - -// configType.Name: BasicHttpBindingElement - -namespace System.ServiceModel.Configuration -{ - public partial class BasicHttpBindingElement - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("messageEncoding", typeof(System.ServiceModel.WSMessageEncoding), System.ServiceModel.WSMessageEncoding.Text, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.WSMessageEncodingHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("security", typeof(System.ServiceModel.Configuration.BasicHttpSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - this.properties = properties; - } - return this.properties; - } - } - } -} - // configType.Name: BasicHttpContextBindingElement namespace System.ServiceModel.Configuration @@ -499,6 +397,31 @@ namespace System.ServiceModel.Configuration } } +// configType.Name: BasicHttpBindingElement + +namespace System.ServiceModel.Configuration +{ + public partial class BasicHttpBindingElement + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = base.Properties; + properties.Add(new ConfigurationProperty("messageEncoding", typeof(System.ServiceModel.WSMessageEncoding), System.ServiceModel.WSMessageEncoding.Text, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.WSMessageEncodingHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("security", typeof(System.ServiceModel.Configuration.BasicHttpSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + this.properties = properties; + } + return this.properties; + } + } + } +} + // configType.Name: BasicHttpMessageSecurityElement namespace System.ServiceModel.Configuration @@ -968,32 +891,6 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: TransportElement - -namespace System.ServiceModel.Configuration -{ - public partial class TransportElement - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("manualAddressing", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxBufferPoolSize", typeof(System.Int64), (long)524288, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxReceivedMessageSize", typeof(System.Int64), (long)65536, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); - this.properties = properties; - } - return this.properties; - } - } - } -} - // configType.Name: ConnectionOrientedTransportElement namespace System.ServiceModel.Configuration @@ -1337,6 +1234,40 @@ namespace System.ServiceModel.Configuration } } +// configType.Name: HttpBindingBaseElement + +namespace System.ServiceModel.Configuration +{ + public partial class HttpBindingBaseElement + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = base.Properties; + properties.Add(new ConfigurationProperty("allowCookies", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("bypassProxyOnLocal", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("hostNameComparisonMode", typeof(System.ServiceModel.HostNameComparisonMode), System.ServiceModel.HostNameComparisonMode.StrongWildcard, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.HostNameComparisonModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxBufferPoolSize", typeof(System.Int64), (long)524288, null, new System.Configuration.LongValidator(0, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxBufferSize", typeof(System.Int32), 65536, null, new System.Configuration.IntegerValidator(1, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxReceivedMessageSize", typeof(System.Int64), (long)65536, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("proxyAddress", typeof(System.Uri), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("readerQuotas", typeof(System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("textEncoding", typeof(System.Text.Encoding), "utf-8", new System.ServiceModel.Configuration.EncodingConverter(), null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("transferMode", typeof(System.ServiceModel.TransferMode), System.ServiceModel.TransferMode.Buffered, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.TransferModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("useDefaultWebProxy", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + this.properties = properties; + } + return this.properties; + } + } + } +} + // configType.Name: HttpDigestClientElement namespace System.ServiceModel.Configuration @@ -1386,11 +1317,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: HttpTransportElement +// configType.Name: HttpsTransportElement namespace System.ServiceModel.Configuration { - public partial class HttpTransportElement + public partial class HttpsTransportElement { ConfigurationPropertyCollection properties; @@ -1401,24 +1332,7 @@ namespace System.ServiceModel.Configuration if (this.properties == null) { ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("allowCookies", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("requestInitializationTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("authenticationScheme", typeof(System.Net.AuthenticationSchemes), System.Net.AuthenticationSchemes.Anonymous, null, new System.ServiceModel.Configuration.StandardRuntimeFlagEnumValidator<System.Net.AuthenticationSchemes>(), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("bypassProxyOnLocal", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("decompressionEnabled", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("hostNameComparisonMode", typeof(System.ServiceModel.HostNameComparisonMode), System.ServiceModel.HostNameComparisonMode.StrongWildcard, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.HostNameComparisonModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("keepAliveEnabled", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxBufferSize", typeof(System.Int32), 65536, null, new System.Configuration.IntegerValidator(1, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxPendingAccepts", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 100000, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("messageHandlerFactory", typeof(System.ServiceModel.Configuration.HttpMessageHandlerFactoryElement), null, null, new System.ServiceModel.Configuration.HttpMessageHandlerFactoryValidator(), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("proxyAddress", typeof(System.Uri), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("proxyAuthenticationScheme", typeof(System.Net.AuthenticationSchemes), System.Net.AuthenticationSchemes.Anonymous, null, new System.ServiceModel.Configuration.StandardRuntimeEnumValidator(typeof(System.Net.AuthenticationSchemes)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("realm", typeof(System.String), string.Empty, null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("transferMode", typeof(System.ServiceModel.TransferMode), System.ServiceModel.TransferMode.Buffered, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.TransferModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("unsafeConnectionNtlmAuthentication", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("useDefaultWebProxy", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("extendedProtectionPolicy", typeof(System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("webSocketSettings", typeof(System.ServiceModel.Configuration.WebSocketTransportSettingsElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("requireClientCertificate", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -1427,11 +1341,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: HttpsTransportElement +// configType.Name: HttpTransportElement namespace System.ServiceModel.Configuration { - public partial class HttpsTransportElement + public partial class HttpTransportElement { ConfigurationPropertyCollection properties; @@ -1442,7 +1356,24 @@ namespace System.ServiceModel.Configuration if (this.properties == null) { ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("requireClientCertificate", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("allowCookies", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("requestInitializationTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("authenticationScheme", typeof(System.Net.AuthenticationSchemes), System.Net.AuthenticationSchemes.Anonymous, null, new System.ServiceModel.Configuration.StandardRuntimeFlagEnumValidator<System.Net.AuthenticationSchemes>(), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("bypassProxyOnLocal", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("decompressionEnabled", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("hostNameComparisonMode", typeof(System.ServiceModel.HostNameComparisonMode), System.ServiceModel.HostNameComparisonMode.StrongWildcard, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.HostNameComparisonModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("keepAliveEnabled", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxBufferSize", typeof(System.Int32), 65536, null, new System.Configuration.IntegerValidator(1, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxPendingAccepts", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 100000, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("messageHandlerFactory", typeof(System.ServiceModel.Configuration.HttpMessageHandlerFactoryElement), null, null, new System.ServiceModel.Configuration.HttpMessageHandlerFactoryValidator(), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("proxyAddress", typeof(System.Uri), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("proxyAuthenticationScheme", typeof(System.Net.AuthenticationSchemes), System.Net.AuthenticationSchemes.Anonymous, null, new System.ServiceModel.Configuration.StandardRuntimeEnumValidator(typeof(System.Net.AuthenticationSchemes)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("realm", typeof(System.String), string.Empty, null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("transferMode", typeof(System.ServiceModel.TransferMode), System.ServiceModel.TransferMode.Buffered, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.TransferModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("unsafeConnectionNtlmAuthentication", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("useDefaultWebProxy", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("extendedProtectionPolicy", typeof(System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("webSocketSettings", typeof(System.ServiceModel.Configuration.WebSocketTransportSettingsElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -1916,11 +1847,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: MsmqElementBase +// configType.Name: MsmqIntegrationElement namespace System.ServiceModel.Configuration { - public partial class MsmqElementBase + public sealed partial class MsmqIntegrationElement { ConfigurationPropertyCollection properties; @@ -1931,20 +1862,7 @@ namespace System.ServiceModel.Configuration if (this.properties == null) { ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("customDeadLetterQueue", typeof(System.Uri), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("deadLetterQueue", typeof(System.ServiceModel.DeadLetterQueue), System.ServiceModel.DeadLetterQueue.System, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.DeadLetterQueueHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("durable", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("exactlyOnce", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxRetryCycles", typeof(System.Int32), 2, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("receiveContextEnabled", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("receiveErrorHandling", typeof(System.ServiceModel.ReceiveErrorHandling), System.ServiceModel.ReceiveErrorHandling.Fault, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.ReceiveErrorHandlingHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("receiveRetryCount", typeof(System.Int32), 5, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("retryCycleDelay", typeof(System.TimeSpan), System.TimeSpan.Parse("00:30:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("msmqTransportSecurity", typeof(System.ServiceModel.Configuration.MsmqTransportSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("timeToLive", typeof(System.TimeSpan), System.TimeSpan.Parse("1.00:00:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("useSourceJournal", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("useMsmqTracing", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("validityDuration", typeof(System.TimeSpan), System.TimeSpan.Parse("00:05:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("serializationFormat", typeof(System.ServiceModel.MsmqIntegration.MsmqMessageSerializationFormat), System.ServiceModel.MsmqIntegration.MsmqMessageSerializationFormat.Xml, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.MsmqIntegration.MsmqMessageSerializationFormatHelper)), System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -1953,11 +1871,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: MsmqIntegrationElement +// configType.Name: MsmqIntegrationSecurityElement namespace System.ServiceModel.Configuration { - public sealed partial class MsmqIntegrationElement + public sealed partial class MsmqIntegrationSecurityElement { ConfigurationPropertyCollection properties; @@ -1967,8 +1885,9 @@ namespace System.ServiceModel.Configuration { if (this.properties == null) { - ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty("serializationFormat", typeof(System.ServiceModel.MsmqIntegration.MsmqMessageSerializationFormat), System.ServiceModel.MsmqIntegration.MsmqMessageSerializationFormat.Xml, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.MsmqIntegration.MsmqMessageSerializationFormatHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("mode", typeof(System.ServiceModel.MsmqIntegration.MsmqIntegrationSecurityMode), System.ServiceModel.MsmqIntegration.MsmqIntegrationSecurityMode.Transport, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.MsmqIntegration.MsmqIntegrationSecurityModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("transport", typeof(System.ServiceModel.Configuration.MsmqTransportSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -1977,11 +1896,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: MsmqIntegrationSecurityElement +// configType.Name: MsmqElementBase namespace System.ServiceModel.Configuration { - public sealed partial class MsmqIntegrationSecurityElement + public partial class MsmqElementBase { ConfigurationPropertyCollection properties; @@ -1991,9 +1910,21 @@ namespace System.ServiceModel.Configuration { if (this.properties == null) { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("mode", typeof(System.ServiceModel.MsmqIntegration.MsmqIntegrationSecurityMode), System.ServiceModel.MsmqIntegration.MsmqIntegrationSecurityMode.Transport, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.MsmqIntegration.MsmqIntegrationSecurityModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("transport", typeof(System.ServiceModel.Configuration.MsmqTransportSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + ConfigurationPropertyCollection properties = base.Properties; + properties.Add(new ConfigurationProperty("customDeadLetterQueue", typeof(System.Uri), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("deadLetterQueue", typeof(System.ServiceModel.DeadLetterQueue), System.ServiceModel.DeadLetterQueue.System, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.DeadLetterQueueHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("durable", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("exactlyOnce", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxRetryCycles", typeof(System.Int32), 2, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("receiveContextEnabled", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("receiveErrorHandling", typeof(System.ServiceModel.ReceiveErrorHandling), System.ServiceModel.ReceiveErrorHandling.Fault, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.ReceiveErrorHandlingHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("receiveRetryCount", typeof(System.Int32), 5, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("retryCycleDelay", typeof(System.TimeSpan), System.TimeSpan.Parse("00:30:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("msmqTransportSecurity", typeof(System.ServiceModel.Configuration.MsmqTransportSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("timeToLive", typeof(System.TimeSpan), System.TimeSpan.Parse("1.00:00:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("useSourceJournal", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("useMsmqTracing", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("validityDuration", typeof(System.TimeSpan), System.TimeSpan.Parse("00:05:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -2261,11 +2192,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: WebSocketTransportSettingsElement +// configType.Name: NetHttpWebSocketTransportSettingsElement namespace System.ServiceModel.Configuration { - public partial class WebSocketTransportSettingsElement + public sealed partial class NetHttpWebSocketTransportSettingsElement { ConfigurationPropertyCollection properties; @@ -2275,13 +2206,11 @@ namespace System.ServiceModel.Configuration { if (this.properties == null) { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("transportUsage", typeof(System.ServiceModel.Channels.WebSocketTransportUsage), System.ServiceModel.Channels.WebSocketTransportUsage.Never, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.Channels.WebSocketTransportUsageHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("createNotificationOnConnection", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("keepAliveInterval", typeof(System.TimeSpan), System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("-00:00:00.0010000", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("subProtocol", typeof(System.String), string.Empty, null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("disablePayloadMasking", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxPendingConnections", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + ConfigurationPropertyCollection properties = base.Properties; + properties.Remove("transportUsage"); + properties.Add(new ConfigurationProperty("transportUsage", typeof(System.ServiceModel.Channels.WebSocketTransportUsage), System.ServiceModel.Channels.WebSocketTransportUsage.WhenDuplex, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.Channels.WebSocketTransportUsageHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Remove("subProtocol"); + properties.Add(new ConfigurationProperty("subProtocol", typeof(System.String), "soap", null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -2290,11 +2219,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: NetHttpWebSocketTransportSettingsElement +// configType.Name: WebSocketTransportSettingsElement namespace System.ServiceModel.Configuration { - public sealed partial class NetHttpWebSocketTransportSettingsElement + public partial class WebSocketTransportSettingsElement { ConfigurationPropertyCollection properties; @@ -2304,11 +2233,13 @@ namespace System.ServiceModel.Configuration { if (this.properties == null) { - ConfigurationPropertyCollection properties = base.Properties; - properties.Remove("transportUsage"); - properties.Add(new ConfigurationProperty("transportUsage", typeof(System.ServiceModel.Channels.WebSocketTransportUsage), System.ServiceModel.Channels.WebSocketTransportUsage.WhenDuplex, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.Channels.WebSocketTransportUsageHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Remove("subProtocol"); - properties.Add(new ConfigurationProperty("subProtocol", typeof(System.String), "soap", null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.None)); + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("transportUsage", typeof(System.ServiceModel.Channels.WebSocketTransportUsage), System.ServiceModel.Channels.WebSocketTransportUsage.Never, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.Channels.WebSocketTransportUsageHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("createNotificationOnConnection", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("keepAliveInterval", typeof(System.TimeSpan), System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("-00:00:00.0010000", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("subProtocol", typeof(System.String), string.Empty, null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("disablePayloadMasking", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxPendingConnections", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -2380,54 +2311,6 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: StandardEndpointElement - -namespace System.ServiceModel.Configuration -{ - public partial class StandardEndpointElement - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("name", typeof(System.String), string.Empty, null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.IsKey)); - this.properties = properties; - } - return this.properties; - } - } - } -} - -// configType.Name: StandardEndpointCollectionElement`2 - -namespace System.ServiceModel.Configuration -{ - public partial class StandardEndpointCollectionElement<TStandardEndpoint, TEndpointConfiguration> - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("", typeof(System.ServiceModel.Configuration.StandardEndpointElementCollection<TEndpointConfiguration>), null, null, null, System.Configuration.ConfigurationPropertyOptions.IsDefaultCollection)); - this.properties = properties; - } - return this.properties; - } - } - } -} - // configType.Name: NetNamedPipeSecurityElement namespace System.ServiceModel.Configuration @@ -2507,11 +2390,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: NetTcpSecurityElement +// configType.Name: NetTcpBindingElement namespace System.ServiceModel.Configuration { - public sealed partial class NetTcpSecurityElement + public partial class NetTcpBindingElement { ConfigurationPropertyCollection properties; @@ -2521,10 +2404,20 @@ namespace System.ServiceModel.Configuration { if (this.properties == null) { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("mode", typeof(System.ServiceModel.SecurityMode), System.ServiceModel.SecurityMode.Transport, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.SecurityModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("transport", typeof(System.ServiceModel.Configuration.TcpTransportSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("message", typeof(System.ServiceModel.Configuration.MessageSecurityOverTcpElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + ConfigurationPropertyCollection properties = base.Properties; + properties.Add(new ConfigurationProperty("transactionFlow", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("transferMode", typeof(System.ServiceModel.TransferMode), System.ServiceModel.TransferMode.Buffered, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.TransferModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("transactionProtocol", typeof(System.ServiceModel.TransactionProtocol), "OleTransactions", new System.ServiceModel.Configuration.TransactionProtocolConverter(), null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("hostNameComparisonMode", typeof(System.ServiceModel.HostNameComparisonMode), System.ServiceModel.HostNameComparisonMode.StrongWildcard, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.HostNameComparisonModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("listenBacklog", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxBufferPoolSize", typeof(System.Int64), (long)524288, null, new System.Configuration.LongValidator(0, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxBufferSize", typeof(System.Int32), 65536, null, new System.Configuration.IntegerValidator(1, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxConnections", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxReceivedMessageSize", typeof(System.Int64), (long)65536, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("portSharingEnabled", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("readerQuotas", typeof(System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("reliableSession", typeof(System.ServiceModel.Configuration.StandardBindingOptionalReliableSessionElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("security", typeof(System.ServiceModel.Configuration.NetTcpSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -2533,11 +2426,11 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: StandardBindingReliableSessionElement +// configType.Name: NetTcpSecurityElement namespace System.ServiceModel.Configuration { - public partial class StandardBindingReliableSessionElement + public sealed partial class NetTcpSecurityElement { ConfigurationPropertyCollection properties; @@ -2548,8 +2441,9 @@ namespace System.ServiceModel.Configuration if (this.properties == null) { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("ordered", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("inactivityTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:10:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00.0000001", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("mode", typeof(System.ServiceModel.SecurityMode), System.ServiceModel.SecurityMode.Transport, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.SecurityModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("transport", typeof(System.ServiceModel.Configuration.TcpTransportSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("message", typeof(System.ServiceModel.Configuration.MessageSecurityOverTcpElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -2789,6 +2683,216 @@ namespace System.ServiceModel.Configuration } } +// configType.Name: StandardBindingElement + +namespace System.ServiceModel.Configuration +{ + public partial class StandardBindingElement + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("name", typeof(System.String), string.Empty, null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.IsKey)); + properties.Add(new ConfigurationProperty("closeTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:01:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("openTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:01:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("receiveTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:10:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("sendTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:01:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + this.properties = properties; + } + return this.properties; + } + } + } +} + +// configType.Name: WSHttpBindingBaseElement + +namespace System.ServiceModel.Configuration +{ + public partial class WSHttpBindingBaseElement + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = base.Properties; + properties.Add(new ConfigurationProperty("bypassProxyOnLocal", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("transactionFlow", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("hostNameComparisonMode", typeof(System.ServiceModel.HostNameComparisonMode), System.ServiceModel.HostNameComparisonMode.StrongWildcard, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.HostNameComparisonModeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxBufferPoolSize", typeof(System.Int64), (long)524288, null, new System.Configuration.LongValidator(0, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxReceivedMessageSize", typeof(System.Int64), (long)65536, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("messageEncoding", typeof(System.ServiceModel.WSMessageEncoding), System.ServiceModel.WSMessageEncoding.Text, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.WSMessageEncodingHelper)), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("proxyAddress", typeof(System.Uri), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("readerQuotas", typeof(System.ServiceModel.Configuration.XmlDictionaryReaderQuotasElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("reliableSession", typeof(System.ServiceModel.Configuration.StandardBindingOptionalReliableSessionElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("textEncoding", typeof(System.Text.Encoding), "utf-8", new System.ServiceModel.Configuration.EncodingConverter(), null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("useDefaultWebProxy", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + this.properties = properties; + } + return this.properties; + } + } + } +} + +// configType.Name: WSHttpBindingElement + +namespace System.ServiceModel.Configuration +{ + public partial class WSHttpBindingElement + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = base.Properties; + properties.Add(new ConfigurationProperty("allowCookies", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("security", typeof(System.ServiceModel.Configuration.WSHttpSecurityElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + this.properties = properties; + } + return this.properties; + } + } + } +} + +// configType.Name: StandardBindingCollectionElement`2 + +namespace System.ServiceModel.Configuration +{ + public partial class StandardBindingCollectionElement<TStandardBinding, TBindingConfiguration> + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("", typeof(System.ServiceModel.Configuration.StandardBindingElementCollection<TBindingConfiguration>), null, null, null, System.Configuration.ConfigurationPropertyOptions.IsDefaultCollection)); + this.properties = properties; + } + return this.properties; + } + } + } +} + +// configType.Name: TransportElement + +namespace System.ServiceModel.Configuration +{ + public partial class TransportElement + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("manualAddressing", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxBufferPoolSize", typeof(System.Int64), (long)524288, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("maxReceivedMessageSize", typeof(System.Int64), (long)65536, null, new System.Configuration.LongValidator(1, 9223372036854775807, false), System.Configuration.ConfigurationPropertyOptions.None)); + this.properties = properties; + } + return this.properties; + } + } + } +} + +// configType.Name: StandardEndpointElement + +namespace System.ServiceModel.Configuration +{ + public partial class StandardEndpointElement + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("name", typeof(System.String), string.Empty, null, new System.Configuration.StringValidator(0, 2147483647, null), System.Configuration.ConfigurationPropertyOptions.IsKey)); + this.properties = properties; + } + return this.properties; + } + } + } +} + +// configType.Name: StandardEndpointCollectionElement`2 + +namespace System.ServiceModel.Configuration +{ + public partial class StandardEndpointCollectionElement<TStandardEndpoint, TEndpointConfiguration> + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("", typeof(System.ServiceModel.Configuration.StandardEndpointElementCollection<TEndpointConfiguration>), null, null, null, System.Configuration.ConfigurationPropertyOptions.IsDefaultCollection)); + this.properties = properties; + } + return this.properties; + } + } + } +} + +// configType.Name: StandardBindingReliableSessionElement + +namespace System.ServiceModel.Configuration +{ + public partial class StandardBindingReliableSessionElement + { + ConfigurationPropertyCollection properties; + + protected override ConfigurationPropertyCollection Properties + { + get + { + if (this.properties == null) + { + ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); + properties.Add(new ConfigurationProperty("ordered", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("inactivityTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:10:00", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00.0000001", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); + this.properties = properties; + } + return this.properties; + } + } + } +} + // configType.Name: RsaElement namespace System.ServiceModel.Configuration @@ -3368,6 +3472,7 @@ namespace System.ServiceModel.Configuration { ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); properties.Add(new ConfigurationProperty("requireClientCertificate", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("sslProtocols", typeof(System.Security.Authentication.SslProtocols), System.Security.Authentication.SslProtocols.Ssl3 | System.Security.Authentication.SslProtocols.Tls | System.Security.Authentication.SslProtocols.Default | System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls12, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.Security.SslProtocolsHelper)), System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -3422,6 +3527,7 @@ namespace System.ServiceModel.Configuration properties.Add(new ConfigurationProperty("clientCredentialType", typeof(System.ServiceModel.TcpClientCredentialType), System.ServiceModel.TcpClientCredentialType.Windows, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.TcpClientCredentialTypeHelper)), System.Configuration.ConfigurationPropertyOptions.None)); properties.Add(new ConfigurationProperty("protectionLevel", typeof(System.Net.Security.ProtectionLevel), System.Net.Security.ProtectionLevel.EncryptAndSign, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.Security.ProtectionLevelHelper)), System.Configuration.ConfigurationPropertyOptions.None)); properties.Add(new ConfigurationProperty("extendedProtectionPolicy", typeof(System.Security.Authentication.ExtendedProtection.Configuration.ExtendedProtectionPolicyElement), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); + properties.Add(new ConfigurationProperty("sslProtocols", typeof(System.Security.Authentication.SslProtocols), System.Security.Authentication.SslProtocols.Ssl3 | System.Security.Authentication.SslProtocols.Tls | System.Security.Authentication.SslProtocols.Default | System.Security.Authentication.SslProtocols.Tls11 | System.Security.Authentication.SslProtocols.Tls12, null, new System.ServiceModel.Configuration.ServiceModelEnumValidator(typeof(System.ServiceModel.Security.SslProtocolsHelper)), System.Configuration.ConfigurationPropertyOptions.None)); this.properties = properties; } return this.properties; @@ -4118,110 +4224,6 @@ namespace System.ServiceModel.Configuration } } -// configType.Name: DiagnosticSection - -namespace System.ServiceModel.Activation.Configuration -{ - public sealed partial class DiagnosticSection - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("performanceCountersEnabled", typeof(System.Boolean), true, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - this.properties = properties; - } - return this.properties; - } - } - } -} - -// configType.Name: NetPipeSection - -namespace System.ServiceModel.Activation.Configuration -{ - public sealed partial class NetPipeSection - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("allowAccounts", typeof(System.ServiceModel.Activation.Configuration.SecurityIdentifierElementCollection), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxPendingConnections", typeof(System.Int32), 100, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxPendingAccepts", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("receiveTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:00:30", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - this.properties = properties; - } - return this.properties; - } - } - } -} - -// configType.Name: NetTcpSection - -namespace System.ServiceModel.Activation.Configuration -{ - public sealed partial class NetTcpSection - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("allowAccounts", typeof(System.ServiceModel.Activation.Configuration.SecurityIdentifierElementCollection), null, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("listenBacklog", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxPendingConnections", typeof(System.Int32), 100, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("maxPendingAccepts", typeof(System.Int32), 0, null, new System.Configuration.IntegerValidator(0, 2147483647, false), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("receiveTimeout", typeof(System.TimeSpan), System.TimeSpan.Parse("00:00:30", CultureInfo.InvariantCulture), new System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter(), new System.ServiceModel.Configuration.TimeSpanOrInfiniteValidator(System.TimeSpan.Parse("00:00:00", CultureInfo.InvariantCulture), System.TimeSpan.Parse("24.20:31:23.6470000", CultureInfo.InvariantCulture)), System.Configuration.ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("teredoEnabled", typeof(System.Boolean), false, null, null, System.Configuration.ConfigurationPropertyOptions.None)); - this.properties = properties; - } - return this.properties; - } - } - } -} - -// configType.Name: SecurityIdentifierElement - -namespace System.ServiceModel.Activation.Configuration -{ - public sealed partial class SecurityIdentifierElement - { - ConfigurationPropertyCollection properties; - - protected override ConfigurationPropertyCollection Properties - { - get - { - if (this.properties == null) - { - ConfigurationPropertyCollection properties = new ConfigurationPropertyCollection(); - properties.Add(new ConfigurationProperty("securityIdentifier", typeof(System.Security.Principal.SecurityIdentifier), null, new System.ServiceModel.Activation.Configuration.SecurityIdentifierConverter(), null, System.Configuration.ConfigurationPropertyOptions.IsKey)); - this.properties = properties; - } - return this.properties; - } - } - } -} - // configType.Name: ComContractElement namespace System.ServiceModel.Configuration diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs index 5ea78eddac7..dff1f8fd22d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableMessagingVersionConverter.cs @@ -32,7 +32,7 @@ namespace System.ServiceModel.Configuration public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { string version = value as string; -#pragma warning suppress 56507 // [....], Really checking for null (meaning value was not a string) versus String.Empty +#pragma warning suppress 56507 // Microsoft, Really checking for null (meaning value was not a string) versus String.Empty if (version != null) { switch (version) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs index 5fa338c0cdf..78c194c1945 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ReliableSessionElement.cs @@ -104,7 +104,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ReliableSessionElement source = (ReliableSessionElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.AcknowledgementInterval = source.AcknowledgementInterval; this.FlowControlEnabled = source.FlowControlEnabled; this.InactivityTimeout = source.InactivityTimeout; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs index f7d061da296..04f10476125 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/RemoveBehaviorElement.cs @@ -23,7 +23,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); RemoveBehaviorElement source = (RemoveBehaviorElement) from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.Name = source.Name; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs index 70c98b01678..6866807d7b6 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElement.cs @@ -37,7 +37,7 @@ namespace System.ServiceModel.Configuration SecurityElement source = (SecurityElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null if (PropertyValueOrigin.Default != source.ElementInformation.Properties[ConfigurationStrings.SecureConversationBootstrap].ValueOrigin) this.SecureConversationBootstrap.CopyFrom(source.SecureConversationBootstrap); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs index 98c71d0c3bb..f27d8b8a471 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SecurityElementBase.cs @@ -173,7 +173,7 @@ namespace System.ServiceModel.Configuration SecurityBindingElement sbe = (SecurityBindingElement)bindingElement; -#pragma warning disable 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning disable 56506 //Microsoft; base.CopyFrom() checks for 'from' being null if (PropertyValueOrigin.Default != this.ElementInformation.Properties[ConfigurationStrings.DefaultAlgorithmSuite].ValueOrigin) sbe.DefaultAlgorithmSuite = this.DefaultAlgorithmSuite; if (PropertyValueOrigin.Default != this.ElementInformation.Properties[ConfigurationStrings.IncludeTimestamp].ValueOrigin) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs index 3871c52a5cb..bea61241b88 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceAuthorizationElement.cs @@ -84,7 +84,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ServiceAuthorizationElement source = (ServiceAuthorizationElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.PrincipalPermissionMode = source.PrincipalPermissionMode; this.RoleProviderName = source.RoleProviderName; this.ImpersonateCallerForAllOperations = source.ImpersonateCallerForAllOperations; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs index 28a42f4bf36..feac091740f 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceBehaviorElement.cs @@ -37,7 +37,7 @@ namespace System.ServiceModel.Configuration } if (!typeof(System.ServiceModel.Description.IServiceBehavior).IsAssignableFrom(element.BehaviorType)) { -#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration) +#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidServiceBehaviorType, element.ConfigurationElementName, this.Name), @@ -62,7 +62,7 @@ namespace System.ServiceModel.Configuration } if (!typeof(System.ServiceModel.Description.IServiceBehavior).IsAssignableFrom(element.BehaviorType)) { -#pragma warning disable 56506 //[....]; element.ElementInformation is guaranteed to be non-null(System.Configuration) +#pragma warning disable 56506 //Microsoft; element.ElementInformation is guaranteed to be non-null(System.Configuration) throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ConfigurationErrorsException(SR.GetString(SR.ConfigInvalidServiceBehaviorType, element.ConfigurationElementName, this.Name), diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs index 050bca034d1..ae57ebb3ffd 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceCredentialsElement.cs @@ -98,7 +98,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ServiceCredentialsElement source = (ServiceCredentialsElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.ClientCertificate.Copy(source.ClientCertificate); this.ServiceCertificate.Copy(source.ServiceCertificate); this.UserNameAuthentication.Copy(source.UserNameAuthentication); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs index 86a1000cbf8..c3e7c986f24 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceDebugElement.cs @@ -86,7 +86,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ServiceDebugElement source = (ServiceDebugElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() check for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null this.HttpHelpPageEnabled = source.HttpHelpPageEnabled; this.HttpHelpPageUrl = source.HttpHelpPageUrl; this.HttpsHelpPageEnabled = source.HttpsHelpPageEnabled; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataEndpointCollectionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataEndpointCollectionElement.cs index 63590402f6e..4cac2ac3099 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataEndpointCollectionElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataEndpointCollectionElement.cs @@ -12,4 +12,4 @@ namespace System.ServiceModel.Configuration public partial class ServiceMetadataEndpointCollectionElement : StandardEndpointCollectionElement<ServiceMetadataEndpoint, ServiceMetadataEndpointElement> { } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs index 236a9d88250..f23ce762124 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceMetadataPublishingElement.cs @@ -95,7 +95,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ServiceMetadataPublishingElement source = (ServiceMetadataPublishingElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() check for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() check for 'from' being null this.HttpGetEnabled = source.HttpGetEnabled; this.HttpGetUrl = source.HttpGetUrl; this.HttpsGetEnabled = source.HttpsGetEnabled; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs index 277cdad0330..576cff6c0b1 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelConfigurationElementCollection.cs @@ -239,7 +239,7 @@ namespace System.ServiceModel.Configuration } else { -#pragma warning disable 56506 //[....]; Variable 'key' checked for null previously +#pragma warning disable 56506 //Microsoft; Variable 'key' checked for null previously throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.ConfigKeysDoNotMatch, this.GetElementKey(value).ToString(), key.ToString())); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs index eba49b2e2ed..798ad08c8c9 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelExtensionCollectionElement.cs @@ -48,7 +48,7 @@ namespace System.ServiceModel.Configuration if (!this.CollectionElementBaseType.IsAssignableFrom(extensionType)) { -#pragma warning disable 56506 //[....]; Variable 'extensionType' checked for null previously +#pragma warning disable 56506 //Microsoft; Variable 'extensionType' checked for null previously throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("extensionType", SR.GetString(SR.ConfigInvalidExtensionType, extensionType.ToString(), @@ -326,8 +326,8 @@ namespace System.ServiceModel.Configuration } catch (ConfigurationErrorsException e) { - // Work-around for bug 219506@CSDMain: if the extension type cannot be loaded, we'll ignore - // the exception when running in win8 app container and reading from machine.config. + // Work-around for + if (System.ServiceModel.Channels.AppContainerInfo.IsRunningInAppContainer && evaluationContext.IsMachineLevel) { DiagnosticUtility.TraceHandledException(e, TraceEventType.Information); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs index c05708f7b3e..112d210c209 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceModelSectionGroup.cs @@ -74,7 +74,7 @@ namespace System.ServiceModel.Configuration throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("config"); } -#pragma warning suppress 56506 //[....]; config.SectionGroups can never be null (underlying configuration system guarantees) +#pragma warning suppress 56506 //Microsoft; config.SectionGroups can never be null (underlying configuration system guarantees) return (ServiceModelSectionGroup)config.SectionGroups[ConfigurationStrings.SectionGroupName]; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs index a26244ce56d..5cbdf80e1fb 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceSecurityAuditElement.cs @@ -52,7 +52,7 @@ namespace System.ServiceModel.Configuration { base.CopyFrom(from); ServiceSecurityAuditElement source = (ServiceSecurityAuditElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.AuditLogLocation = source.AuditLogLocation; this.SuppressAuditFailure = source.SuppressAuditFailure; this.ServiceAuthorizationAuditLevel = source.ServiceAuthorizationAuditLevel; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs index 11f81f42606..b6df0f71a16 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceThrottlingElement.cs @@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ServiceThrottlingElement source = (ServiceThrottlingElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.MaxConcurrentCalls = source.MaxConcurrentCalls; this.MaxConcurrentSessions = source.MaxConcurrentSessions; this.MaxConcurrentInstances = source.MaxConcurrentInstances; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs index 9bd23149f74..573b1d9a966 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/ServiceTimeoutsElement.cs @@ -29,7 +29,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); ServiceTimeoutsElement source = (ServiceTimeoutsElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.TransactionTimeout = source.TransactionTimeout; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs index fdcc8f9805a..247bd119d7a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/SslStreamSecurityElement.cs @@ -5,7 +5,9 @@ namespace System.ServiceModel.Configuration { using System.Configuration; + using System.Security.Authentication; using System.ServiceModel.Channels; + using System.ServiceModel.Security; public sealed partial class SslStreamSecurityElement : BindingElementExtensionElement { @@ -21,12 +23,22 @@ namespace System.ServiceModel.Configuration set { base[ConfigurationStrings.RequireClientCertificate] = value; } } + [ConfigurationProperty(ConfigurationStrings.SslProtocols, DefaultValue = TransportDefaults.SslProtocols)] + [ServiceModelEnumValidator(typeof(SslProtocolsHelper))] + public SslProtocols SslProtocols + { + get { return (SslProtocols)base[ConfigurationStrings.SslProtocols]; } + private set { base[ConfigurationStrings.SslProtocols] = value; } + } + + public override void ApplyConfiguration(BindingElement bindingElement) { base.ApplyConfiguration(bindingElement); SslStreamSecurityBindingElement sslBindingElement = (SslStreamSecurityBindingElement)bindingElement; sslBindingElement.RequireClientCertificate = this.RequireClientCertificate; + sslBindingElement.SslProtocols = this.SslProtocols; } protected internal override BindingElement CreateBindingElement() @@ -48,8 +60,9 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); SslStreamSecurityElement source = (SslStreamSecurityElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.RequireClientCertificate = source.RequireClientCertificate; + this.SslProtocols = source.SslProtocols; } protected internal override void InitializeFrom(BindingElement bindingElement) @@ -58,6 +71,7 @@ namespace System.ServiceModel.Configuration SslStreamSecurityBindingElement sslBindingElement = (SslStreamSecurityBindingElement)bindingElement; SetPropertyValueIfNotDefaultValue(ConfigurationStrings.RequireClientCertificate, sslBindingElement.RequireClientCertificate); + SetPropertyValueIfNotDefaultValue(ConfigurationStrings.SslProtocols, sslBindingElement.SslProtocols); } } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs index 64932814a80..ed2e5bb7e99 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardBindingCollectionElement.cs @@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration { // This line needed because of the IBindingSection implementation StandardBindingCollectionElement<TStandardBinding, TBindingConfiguration> me = (StandardBindingCollectionElement<TStandardBinding, TBindingConfiguration>)this; -#pragma warning suppress 56506 //[....]; me.Bindings can never be null (underlying configuration system guarantees) +#pragma warning suppress 56506 //Microsoft; me.Bindings can never be null (underlying configuration system guarantees) return me.Bindings.ContainsKey(name); } protected internal override Binding GetDefault() diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs index 51b14b08d3b..848b2d8991d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/StandardEndpointCollectionElement.cs @@ -44,7 +44,7 @@ namespace System.ServiceModel.Configuration public override bool ContainsKey(string name) { StandardEndpointCollectionElement<TStandardEndpoint, TEndpointConfiguration> me = (StandardEndpointCollectionElement<TStandardEndpoint, TEndpointConfiguration>)this; -#pragma warning suppress 56506 //[....]; me.Endpoints can never be null (underlying configuration system guarantees) +#pragma warning suppress 56506 //Microsoft; me.Endpoints can never be null (underlying configuration system guarantees) return me.Endpoints.ContainsKey(name); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs index e792c9cabc7..bed3878e51b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportElement.cs @@ -19,7 +19,7 @@ namespace System.ServiceModel.Configuration public override void ApplyConfiguration(BindingElement bindingElement) { base.ApplyConfiguration(bindingElement); -#pragma warning suppress 56506 // [....], base.ApplyConfiguration() validates the argument +#pragma warning suppress 56506 // Microsoft, base.ApplyConfiguration() validates the argument TcpTransportBindingElement binding = (TcpTransportBindingElement)bindingElement; PropertyInformationCollection propertyInfo = this.ElementInformation.Properties; if (this.ListenBacklog != TcpTransportDefaults.ListenBacklogConst) @@ -28,7 +28,7 @@ namespace System.ServiceModel.Configuration } binding.PortSharingEnabled = this.PortSharingEnabled; binding.TeredoEnabled = this.TeredoEnabled; -#pragma warning suppress 56506 // [....], base.ApplyConfiguration() validates the argument +#pragma warning suppress 56506 // Microsoft, base.ApplyConfiguration() validates the argument this.ConnectionPoolSettings.ApplyConfiguration(binding.ConnectionPoolSettings); binding.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy); } @@ -43,7 +43,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); TcpTransportElement source = (TcpTransportElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.ListenBacklog = source.ListenBacklog; this.PortSharingEnabled = source.PortSharingEnabled; this.TeredoEnabled = source.TeredoEnabled; @@ -59,7 +59,7 @@ namespace System.ServiceModel.Configuration protected internal override void InitializeFrom(BindingElement bindingElement) { base.InitializeFrom(bindingElement); -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument TcpTransportBindingElement binding = (TcpTransportBindingElement)bindingElement; if (binding.IsListenBacklogSet) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportSecurityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportSecurityElement.cs index 8dd7f7a821c..c07d01f40a7 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportSecurityElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TcpTransportSecurityElement.cs @@ -13,6 +13,7 @@ namespace System.ServiceModel.Configuration using System.ServiceModel; using System.ServiceModel.Security; using System.ComponentModel; + using System.Security.Authentication; public sealed partial class TcpTransportSecurityElement : ServiceModelConfigurationElement { @@ -39,6 +40,14 @@ namespace System.ServiceModel.Configuration private set { base[ConfigurationStrings.ExtendedProtectionPolicy] = value; } } + [ConfigurationProperty(ConfigurationStrings.SslProtocols, DefaultValue = TransportDefaults.SslProtocols)] + [ServiceModelEnumValidator(typeof(SslProtocolsHelper))] + public SslProtocols SslProtocols + { + get { return (SslProtocols)base[ConfigurationStrings.SslProtocols]; } + private set { base[ConfigurationStrings.SslProtocols] = value; } + } + internal void ApplyConfiguration(TcpTransportSecurity security) { if (security == null) @@ -48,6 +57,7 @@ namespace System.ServiceModel.Configuration security.ClientCredentialType = this.ClientCredentialType; security.ProtectionLevel = this.ProtectionLevel; security.ExtendedProtectionPolicy = ChannelBindingUtility.BuildPolicy(this.ExtendedProtectionPolicy); + security.SslProtocols = this.SslProtocols; } internal void InitializeFrom(TcpTransportSecurity security) @@ -59,6 +69,7 @@ namespace System.ServiceModel.Configuration SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ClientCredentialType, security.ClientCredentialType); SetPropertyValueIfNotDefaultValue(ConfigurationStrings.ProtectionLevel, security.ProtectionLevel); ChannelBindingUtility.InitializeFrom(security.ExtendedProtectionPolicy, this.ExtendedProtectionPolicy); + SetPropertyValueIfNotDefaultValue(ConfigurationStrings.SslProtocols, security.SslProtocols); } } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs index bf649723569..ec04b51b2cb 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TextMessageEncodingElement.cs @@ -24,7 +24,7 @@ namespace System.ServiceModel.Configuration binding.WriteEncoding = this.WriteEncoding; binding.MaxReadPoolSize = this.MaxReadPoolSize; binding.MaxWritePoolSize = this.MaxWritePoolSize; -#pragma warning suppress 56506 //[....]; base.ApplyConfiguration() checks for 'binding' being null +#pragma warning suppress 56506 //Microsoft; base.ApplyConfiguration() checks for 'binding' being null this.ReaderQuotas.ApplyConfiguration(binding.ReaderQuotas); } @@ -38,7 +38,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); TextMessageEncodingElement source = (TextMessageEncodingElement)from; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.MessageVersion = source.MessageVersion; this.WriteEncoding = source.WriteEncoding; this.MaxReadPoolSize = source.MaxReadPoolSize; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs index b74805626e1..176571cd0e2 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactedBatchingElement.cs @@ -22,7 +22,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); TransactedBatchingElement source = from as TransactedBatchingElement; -#pragma warning suppress 56506 //[....]; base.CopyFrom() checks for 'from' being null +#pragma warning suppress 56506 //Microsoft; base.CopyFrom() checks for 'from' being null this.MaxBatchSize = source.MaxBatchSize; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs index 652f729b0cc..de6601252f0 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionFlowElement.cs @@ -53,7 +53,7 @@ namespace System.ServiceModel.Configuration { base.CopyFrom(from); TransactionFlowElement source = (TransactionFlowElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.TransactionProtocol = source.TransactionProtocol; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs index 9bba5ca4cce..12c1308b56b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransactionProtocolConverter.cs @@ -32,7 +32,7 @@ namespace System.ServiceModel.Configuration public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) { string protocol = value as string; -#pragma warning suppress 56507 // [....], Really checking for null (meaning value was not a string) versus String.Empty +#pragma warning suppress 56507 // Microsoft, Really checking for null (meaning value was not a string) versus String.Empty if (protocol != null) { switch (protocol) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs index c4599271949..18d9aea87e4 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/TransportElement.cs @@ -27,7 +27,7 @@ using System.ServiceModel.Channels; base.CopyFrom(from); TransportElement source = (TransportElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.ManualAddressing = source.ManualAddressing; this.MaxBufferPoolSize = source.MaxBufferPoolSize; this.MaxReceivedMessageSize = source.MaxReceivedMessageSize; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs index f82b3f7c2d5..e31633cd846 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Configuration/WindowsStreamSecurityElement.cs @@ -52,7 +52,7 @@ namespace System.ServiceModel.Configuration base.CopyFrom(from); WindowsStreamSecurityElement source = (WindowsStreamSecurityElement)from; -#pragma warning suppress 56506 // [....], base.CopyFrom() validates the argument +#pragma warning suppress 56506 // Microsoft, base.CopyFrom() validates the argument this.ProtectionLevel = source.ProtectionLevel; } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs index c7362683b42..5712afbf7ba 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ClientClassGenerator.cs @@ -61,7 +61,7 @@ namespace System.ServiceModel.Description static string getDefaultValueForInitializationMethodName = "GetDefaultValueForInitialization"; // IMPORTANT: this table tracks the set of .ctors in ClientBase and DuplexClientBase. - // This table must be kept in [....] + // This table must be kept in sync // for DuplexClientBase, the initial InstanceContext param is assumed; ctor overloads must match between ClientBase and DuplexClientBase static Type[][] ClientCtorParamTypes = new Type[][] { @@ -107,7 +107,7 @@ namespace System.ServiceModel.Description #if DEBUG static BindingFlags ctorBindingFlags = BindingFlags.Instance | BindingFlags.NonPublic; - static string DebugCheckTable_errorString = "Client code generation table out of [....] with ClientBase and DuplexClientBase ctors. Please investigate."; + static string DebugCheckTable_errorString = "Client code generation table out of sync with ClientBase and DuplexClientBase ctors. Please investigate."; // check the table against what we would get from reflection static void DebugCheckTable() diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs index 2020a04443f..c111c900c36 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ConfigWriter.cs @@ -40,7 +40,7 @@ namespace System.ServiceModel.Description channelElement = new ChannelEndpointElement(endpoint.Address, typeName); - // [....]: review: Use decoded form to preserve the user-given friendly name, however, beacuse our Encoding algorithm + // Microsoft: review: Use decoded form to preserve the user-given friendly name, however, beacuse our Encoding algorithm // does not touch ASCII names, a name that looks like encoded name will not roundtrip(Example: "_x002C_" will turned into ",") channelElement.Name = NamingHelper.GetUniqueName(NamingHelper.CodeName(endpoint.Name), this.CheckIfChannelNameInUse, null); @@ -64,7 +64,7 @@ namespace System.ServiceModel.Description BindingDictionaryValue bindingDV; if (!bindingTable.TryGetValue(binding, out bindingDV)) { - // [....]: review: Use decoded form to preserve the user-given friendly name, however, beacuse our Encoding algorithm + // Microsoft: review: Use decoded form to preserve the user-given friendly name, however, beacuse our Encoding algorithm // does not touch ASCII names, a name that looks like encoded name will not roundtrip(Example: "_x002C_" will turned into ",") string bindingName = NamingHelper.GetUniqueName(NamingHelper.CodeName(binding.Name), this.CheckIfBindingNameInUse, null); string bindingSectionName; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/DispatcherBuilder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/DispatcherBuilder.cs index f3625150b0c..1106d1758c9 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/DispatcherBuilder.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/DispatcherBuilder.cs @@ -788,6 +788,12 @@ namespace System.ServiceModel.Description } } // end foreach "endpoint" + // Clear performance counter cache. + if ((PerformanceCounters.PerformanceCountersEnabled || PerformanceCounters.MinimalPerformanceCountersEnabled) && ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + System.Diagnostics.PerformanceCounter.CloseSharedResources(); + } + if (canReceiveInTransaction) { BindingElementCollection bindingElements = binding.CreateBindingElements(); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IPolicyImportExtension.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IPolicyImportExtension.cs index aef0d3ff6c5..66d83a9cdb3 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IPolicyImportExtension.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IPolicyImportExtension.cs @@ -8,4 +8,4 @@ namespace System.ServiceModel.Description { void ImportPolicy(MetadataImporter importer, PolicyConversionContext context); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlExportExtension.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlExportExtension.cs index 8f21363d287..263bff5c4b3 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlExportExtension.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlExportExtension.cs @@ -10,4 +10,4 @@ namespace System.ServiceModel.Description void ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext context); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlImportExtension.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlImportExtension.cs index 992b4d989ba..41668914157 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlImportExtension.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/IWsdlImportExtension.cs @@ -17,4 +17,4 @@ namespace System.ServiceModel.Description void ImportEndpoint(WsdlImporter importer, WsdlEndpointConversionContext context); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs index 5d9a366651e..711970a2a0c 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ImportedPolicyConversionContext.cs @@ -13,7 +13,7 @@ namespace System.ServiceModel.Description public abstract partial class MetadataImporter { - //Consider, [....]: make this public + //Consider, Microsoft: make this public internal static IEnumerable<PolicyConversionContext> GetPolicyConversionContextEnumerator(ServiceEndpoint endpoint, PolicyAlternatives policyAlternatives) { return ImportedPolicyConversionContext.GetPolicyConversionContextEnumerator(endpoint, policyAlternatives, MetadataImporterQuotas.Defaults); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs index dbef91c1275..2b126c76a44 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MessageContractExporter.cs @@ -511,7 +511,7 @@ namespace System.ServiceModel.Description string operationName = contractContext.GetOperation(operation).Name; string callbackString = operation.IsServerInitiated() ? "Callback" : string.Empty; - // [....]: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_' + // Microsoft: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_' if (messageDescription.Direction == MessageDirection.Input) messageNameBase = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}_{1}_Input{2}Message", portTypeName, operationName, callbackString); @@ -539,7 +539,7 @@ namespace System.ServiceModel.Description { string portTypeName = contractContext.WsdlPortType.Name; string operationName = contractContext.GetOperation(operation).Name; - // [....]: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_' + // Microsoft: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_' string faultNameBase = String.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}_{1}_{2}_FaultMessage", portTypeName, operationName, faultName); WsdlNS.ServiceDescription wsdl = contractContext.WsdlPortType.ServiceDescription; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs index 87e7f37dace..8c33e75db72 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/MetadataSection.cs @@ -92,7 +92,7 @@ namespace System.ServiceModel.Description if (!IsPolicyElement(policy)) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("policy", -#pragma warning suppress 56506 // [....], policy cannot be null at this point since it has been validated above. +#pragma warning suppress 56506 // Microsoft, policy cannot be null at this point since it has been validated above. SR.GetString(SR.SFxBadMetadataMustBePolicy, MetadataStrings.WSPolicy.NamespaceUri, MetadataStrings.WSPolicy.Elements.Policy, policy.NamespaceURI, policy.LocalName)); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs index 469c6d6be67..9b60b764319 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/PolicyReader.cs @@ -21,7 +21,7 @@ namespace System.ServiceModel.Description internal delegate void PolicyWarningHandler(XmlElement contextAssertion, string warningMessage); - // Consider, [....], make this public? + // Consider, Microsoft, make this public? internal event PolicyWarningHandler PolicyWarningOccured; internal IEnumerable<IEnumerable<XmlElement>> NormalizePolicy(IEnumerable<XmlElement> policyAssertions) @@ -92,7 +92,7 @@ namespace System.ServiceModel.Description string warningMsg = SR.GetString(SR.UnrecognizedPolicyElementInNamespace, node.Name, node.NamespaceURI); metadataImporter.PolicyWarningOccured.Invoke(contextAssertion, warningMsg); break; - //consider [....], add more error handling here. default? + //consider Microsoft, add more error handling here. default? } return nodes; } @@ -365,7 +365,7 @@ namespace System.ServiceModel.Description { get { -#pragma warning suppress 56503 // [....], IEnumerator guidelines, Current throws exception before calling MoveNext +#pragma warning suppress 56503 // Microsoft, IEnumerator guidelines, Current throws exception before calling MoveNext throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.NoValue0))); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs index cd369d24220..d8c3dca4e8b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/ServiceEndpoint.cs @@ -105,7 +105,7 @@ namespace System.ServiceModel.Description } else if (binding != null) { - // [....]: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_' + // Microsoft: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_' return String.Format(CultureInfo.InvariantCulture, "{0}_{1}", new XmlName(Binding.Name).EncodedName, Contract.Name); } else diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs index 61868f6c869..d18c4927e4d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/SoapHelper.cs @@ -186,7 +186,7 @@ namespace System.ServiceModel.Description static class SoapConverter { - // [....], this could be simplified if we used generics. + // Microsoft, this could be simplified if we used generics. internal static void ConvertExtensions(WsdlNS.ServiceDescriptionFormatExtensionCollection extensions, EnvelopeVersion version, ConvertExtension conversionMethod) { bool foundOne = false; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs index 70f61006515..2d1827ef8a1 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TaskOperationDescriptionValidator.cs @@ -15,7 +15,7 @@ namespace System.ServiceModel.Description { if (isForService) { - // no other method ([....], async) is allowed to co-exist with a task-based method on the server-side. + // no other method (sync, async) is allowed to co-exist with a task-based method on the server-side. EnsureNoSyncMethod(operationDescription); EnsureNoBeginEndMethod(operationDescription); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs index 105821f4e78..45d56cc0518 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/TypeLoader.cs @@ -771,13 +771,13 @@ namespace System.ServiceModel.Description return defaultFormatAttribute; } - //[....] and Async should follow the rules: + //Sync and Async should follow the rules: // 1. Parameter match // 2. Async cannot have behaviors (verification happens later in ProcessOpMethod - behaviors haven't yet been loaded here) // 3. Async cannot have known types // 4. Async cannot have known faults - // 5. [....] and Async have to match on OneWay status - // 6. [....] and Async have to match Action and ReplyAction + // 5. Sync and Async have to match on OneWay status + // 6. Sync and Async have to match Action and ReplyAction void VerifyConsistency(OperationConsistencyVerifier verifier) { verifier.VerifyParameterLength(); @@ -860,7 +860,7 @@ namespace System.ServiceModel.Description existingOp.TaskTResult = newOp.TaskTResult; if (existingOp.SyncMethod != null) { - // Task vs. [....] + // Task vs. Sync VerifyConsistency(new SyncTaskOperationConsistencyVerifier(existingOp, newOp)); } else @@ -876,7 +876,7 @@ namespace System.ServiceModel.Description existingOp.EndMethod = newOp.EndMethod; if (existingOp.SyncMethod != null) { - // Async vs. [....] + // Async vs. Sync VerifyConsistency(new SyncAsyncOperationConsistencyVerifier(existingOp, newOp)); } else @@ -894,12 +894,12 @@ namespace System.ServiceModel.Description newOp.TaskTResult = existingOp.TaskTResult; if (existingOp.TaskMethod != null) { - // [....] vs. Task + // Sync vs. Task VerifyConsistency(new SyncTaskOperationConsistencyVerifier(newOp, existingOp)); } else { - // [....] vs. Async + // Sync vs. Async VerifyConsistency(new SyncAsyncOperationConsistencyVerifier(newOp, existingOp)); } return newOp; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs index 656fc85a790..bb0dc9be896 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlExporter.cs @@ -991,7 +991,7 @@ namespace System.ServiceModel.Description int i = 0; prefix = prefixBase + i.ToString(CultureInfo.InvariantCulture); - //[....], consider do we need to check at higher scopes as well? + //Microsoft, consider do we need to check at higher scopes as well? while (PrefixExists(scopes[0].Namespaces.ToArray(), prefix)) prefix = prefixBase + (++i).ToString(CultureInfo.InvariantCulture); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs index cf5abf7fb7a..026247d854c 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Description/WsdlImporter.cs @@ -922,7 +922,7 @@ namespace System.ServiceModel.Description // This method checks if there is a match based on Names, between the specified OperationBinding and Operation. // When searching for the Operation associated with an OperationBinding, we need to return an exact match if possible, // or a partial match otherwise (when some of the Names are null). - // Bug 16833 @ CSDMain requires that partial matches are allowed, while the TFS bug 477838 requires that exact matches are done (when possible). + // if (wsdlOperationBinding.Name != wsdlOperation.Name) { return MatchResult.None; @@ -1189,7 +1189,7 @@ namespace System.ServiceModel.Description internal static XmlQualifiedName GetBindingName(WsdlNS.Port wsdlPort) { - // [....]: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_' + // Microsoft: composing names have potential problem of generating name that looks like an encoded name, consider avoiding '_' XmlName xmlName = new XmlName(string.Format(CultureInfo.InvariantCulture, "{0}_{1}", wsdlPort.Service.Name, wsdlPort.Name), true /*isEncoded*/); return new XmlQualifiedName(xmlName.EncodedName, wsdlPort.Service.ServiceDescription.TargetNamespace); } @@ -1233,7 +1233,7 @@ namespace System.ServiceModel.Description } else { - // [....]: why this is an Assert, and not an exception? + // Microsoft: why this is an Assert, and not an exception? Fx.Assert("Unsupported WSDL OM (More than 2 OperationMessages encountered in an Operation or WsdlOM is invalid)"); } // names the come from service description documents have to be valid NCNames; XmlName.ctor will validate. @@ -1920,7 +1920,7 @@ namespace System.ServiceModel.Description static Exception CreateExtensionException(IWsdlImportExtension importer, Exception e) { string errorMessage = SR.GetString(SR.WsdlExtensionImportError, importer.GetType().FullName, e.Message); - //consider [....], allow internal exceptions to throw WsdlImportException and handle it in some special way? + //consider Microsoft, allow internal exceptions to throw WsdlImportException and handle it in some special way? return new InvalidOperationException(errorMessage, e); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ActivityType.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ActivityType.cs index 4c4431f8472..951d2e5f3a8 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ActivityType.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ActivityType.cs @@ -22,4 +22,4 @@ namespace System.ServiceModel.Diagnostics WmiPutInstance, NumItems, // leave this item at the end of the list. } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs index 89aa50b117d..95b174c15cb 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersBase.cs @@ -77,9 +77,14 @@ namespace System.ServiceModel.Diagnostics this.instanceName = CreateFriendlyInstanceName(service, contract, uri); } - static internal string CreateFriendlyInstanceName(string service, string contract, string uri) + private static string GetFullInstanceName(string service, string contract, string uri) { // instance name is: serviceName.interfaceName.operationName@uri + return String.Format("{0}.{1}@{2}", service, contract, uri); + } + + private static string GetShortInstanceName(string service, string contract, string uri) + { int length = service.Length + contract.Length + uri.Length + 2; if (length > maxCounterLength) @@ -115,6 +120,32 @@ namespace System.ServiceModel.Diagnostics return service + "." + contract + "@" + uri.Replace('/', '|'); } + internal static string CreateFriendlyInstanceName(string service, string contract, string uri) + { + string shortInstanceName = GetShortInstanceName(service, contract, uri); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(service, contract, uri); + + return EnsureUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELENDPOINT.EndpointPerfCounters, shortInstanceName, fullInstanceName); + } + + internal static string GetFriendlyInstanceName(string service, string contract, string uri) + { + string shortInstanceName = GetShortInstanceName(service, contract, uri); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(service, contract, uri); + + return GetUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELENDPOINT.EndpointPerfCounters, shortInstanceName, fullInstanceName); + } + private static truncOptions GetCompressionTasks(int totalLen, int serviceLen, int contractLen, int uriLen) { truncOptions bitmask = 0; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersV2.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersV2.cs index 930153e8e28..447f3c6cdb0 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersV2.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/EndpointPerformanceCountersV2.cs @@ -154,6 +154,18 @@ namespace System.ServiceModel.Diagnostics get { return this.endpointCounterSetInstance != null; } } + // Immediately disposes and nulls the CounterSetInstance. This differs from Dispose because Dispose is "lazy" in that + // it holds weak references to the instances so we don't get corrupted state if the values are updated later. This + // method is used in situations when we need to delete the instance immediately and know the values won't be updated. + internal void DeleteInstance() + { + if (this.endpointCounterSetInstance != null) + { + this.endpointCounterSetInstance.Dispose(); + this.endpointCounterSetInstance = null; + } + } + protected override void Dispose(bool disposing) { try diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs index d6f84e46128..4e53f24b330 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersBase.cs @@ -72,9 +72,15 @@ namespace System.ServiceModel.Diagnostics this.instanceName = CreateFriendlyInstanceName(service, contract, operationName, uri); } - static internal string CreateFriendlyInstanceName(string service, string contract, string operation, string uri) + + private static string GetFullInstanceName(string service, string contract, string operation, string uri) { // instance name is: serviceName.interfaceName.operationName@uri + return String.Format("{0}.{1}.{2}@{3}", service, contract, operation, uri); + } + + private static string GetShortInstanceName(string service, string contract, string operation, string uri) + { int length = service.Length + contract.Length + operation.Length + uri.Length + 3; if (length > maxCounterLength) @@ -117,6 +123,32 @@ namespace System.ServiceModel.Diagnostics return service + "." + contract + "." + operation + "@" + uri.Replace('/', '|'); } + internal static string CreateFriendlyInstanceName(string service, string contract, string operation, string uri) + { + string shortInstanceName = GetShortInstanceName(service, contract, operation, uri); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(service, contract, operation, uri); + + return EnsureUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELOPERATION.OperationPerfCounters, shortInstanceName, fullInstanceName); + } + + internal static string GetFriendlyInstanceName(string service, string contract, string operation, string uri) + { + string shortInstanceName = GetShortInstanceName(service, contract, operation, uri); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(service, contract, operation, uri); + + return GetUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELOPERATION.OperationPerfCounters, shortInstanceName, fullInstanceName); + } + static truncOptions GetCompressionTasks(int totalLen, int serviceLen, int contractLen, int operationLen, int uriLen) { truncOptions bitmask = 0; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersV2.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersV2.cs index 697a2e11631..0226391b1c2 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersV2.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/OperationPerformanceCountersV2.cs @@ -139,6 +139,18 @@ namespace System.ServiceModel.Diagnostics get { return this.operationCounterSetInstance != null; } } + // Immediately disposes and nulls the CounterSetInstance. This differs from Dispose because Dispose is "lazy" in that + // it holds weak references to the instances so we don't get corrupted state if the values are updated later. This + // method is used in situations when we need to delete the instance immediately and know the values won't be updated. + internal void DeleteInstance() + { + if (this.operationCounterSetInstance != null) + { + this.operationCounterSetInstance.Dispose(); + this.operationCounterSetInstance = null; + } + } + protected override void Dispose(bool disposing) { try diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersBase.cs index b2988a8b220..bfe5aa06792 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersBase.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersBase.cs @@ -33,11 +33,67 @@ namespace System.ServiceModel.Diagnostics get; } + private static string GetInstanceNameWithHash(string instanceName, string fullInstanceName) + { + return String.Format("{0}{1}", instanceName, StringUtil.GetNonRandomizedHashCode(fullInstanceName).ToString("X", CultureInfo.InvariantCulture)); + } + + protected static string EnsureUniqueInstanceName(string categoryName, string instanceName, string fullInstanceName) + { + if (String.IsNullOrEmpty(categoryName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("categoryName"); + if (String.IsNullOrEmpty(instanceName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("instanceName"); + if (String.IsNullOrEmpty(fullInstanceName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("fullInstanceName"); + + try + { + // If the instance name is already used, append a hash of the full name to it. + if (PerformanceCounterCategory.InstanceExists(instanceName, categoryName)) + { + return GetInstanceNameWithHash(instanceName, fullInstanceName); + } + } + catch + { + // If an exception is thrown, return the instance name without modification. + } + + return instanceName; + } + + protected static string GetUniqueInstanceName(string categoryName, string instanceName, string fullInstanceName) + { + if (String.IsNullOrEmpty(categoryName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("categoryName"); + if (String.IsNullOrEmpty(instanceName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("instanceName"); + if (String.IsNullOrEmpty(fullInstanceName)) + throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNullOrEmptyString("fullInstanceName"); + + try + { + // If the instance name with the hash appended exists, return it. + string nameWithHash = GetInstanceNameWithHash(instanceName, fullInstanceName); + if (PerformanceCounterCategory.InstanceExists(nameWithHash, categoryName)) + { + return nameWithHash; + } + } + catch + { + // If an exception is thrown, return the instance name without modification. + } + + return instanceName; + } + // remove count chars from string and add a 2 char hash code to beginning or end, as specified. protected static string GetHashedString(string str, int startIndex, int count, bool hashAtEnd) { string returnVal = str.Remove(startIndex, count); - string hash = ((uint)str.GetHashCode() % 99).ToString("00", CultureInfo.InvariantCulture); + string hash = ((uint)StringUtil.GetNonRandomizedHashCode(str) % 99).ToString("00", CultureInfo.InvariantCulture); return hashAtEnd ? returnVal + hash : hash + returnVal; } @@ -59,9 +115,9 @@ namespace System.ServiceModel.Diagnostics // A CounterSetInstance is not disposed immediately when a service, endpoint or operation perf counter is disposed. Because messages // can be processed while a ServiceHost is being closed, and such messages can try to update perf counters data, resulting in AVs or - // corruptions (see bug 249132 @ CSDMain). So instead of disposing a CounterSetInstance, we hold a WeakReference to it, until either - // GC reclaims it or a new service/endpoint/operation perf counter is started with the same name (and re-uses the CounterSetInstance). - // The CounterSetInstance finalizer will free up the perf counters memory, so we don't have a leak. + // corruptions (see + + protected class CounterSetInstanceCache { // instance name -> WeakReference of CounterSetInstance diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersFactory.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersFactory.cs index 5f540b16b9f..d5dbfcb93e7 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersFactory.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/PerformanceCountersFactory.cs @@ -9,6 +9,8 @@ namespace System.ServiceModel.Diagnostics static class PerformanceCountersFactory { + private static bool categoriesExist = false; + static internal ServicePerformanceCountersBase CreateServiceCounters(ServiceHostBase serviceHost) { if (!CheckPermissions()) @@ -20,6 +22,7 @@ namespace System.ServiceModel.Diagnostics { try { + EnsureCategoriesExistIfNeeded(); var counters = new ServicePerformanceCountersV2(serviceHost); // Workaround Sys.Diag.PerformanceData problem: // Ensure that all three categories are initialized so other processes can still @@ -60,6 +63,7 @@ namespace System.ServiceModel.Diagnostics { try { + EnsureCategoriesExistIfNeeded(); return new EndpointPerformanceCountersV2(service, contract, uri); } #pragma warning suppress 56500 // covered by FxCOP @@ -94,6 +98,7 @@ namespace System.ServiceModel.Diagnostics { try { + EnsureCategoriesExistIfNeeded(); return new OperationPerformanceCountersV2(service, contract, operationName, uri); } #pragma warning suppress 56500 // covered by FxCOP @@ -139,5 +144,81 @@ namespace System.ServiceModel.Diagnostics return false; } + + // If EnsureUniquePerformanceCounterInstanceName is enabled, PerformanceCountersBase.cs will be checking if instances + // exist in each of these categories, so we need to ensure the categories all exist. This works around System.Diagnostics + // calls using PerformanceCounterLib to cache which categories do/don't exist. + private static void EnsureCategoriesExistIfNeeded() + { + if (categoriesExist || !ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return; + } + + OperationPerformanceCountersV2 operationCounter = null; + EndpointPerformanceCountersV2 endpointCounter = null; + ServicePerformanceCountersV2 serviceCounter = null; + + try + { + if (PerformanceCounterCategory.Exists(PerformanceCounterStrings.SERVICEMODELOPERATION.OperationPerfCounters) && + PerformanceCounterCategory.Exists(PerformanceCounterStrings.SERVICEMODELENDPOINT.EndpointPerfCounters) && + PerformanceCounterCategory.Exists(PerformanceCounterStrings.SERVICEMODELSERVICE.ServicePerfCounters)) + { + categoriesExist = true; + return; + } + + // Categories do not exist. Update PerformanceCounterLib's cache using dummy counters. + const string dummyValue = "_WCF_Admin"; + + + // Older operating systems (such as windows 7) report the category as not existing unless a counter instance + // has been created in it. Create one instance in each of the categories to ensure they will exist in the cache + // that System.Diagnostics calls use. + ServiceHost dummyServiceHost = new ServiceHost(typeof(object), new Uri("http://" + dummyValue)); + operationCounter = new OperationPerformanceCountersV2(dummyValue, dummyValue, dummyValue, dummyValue); + endpointCounter = new EndpointPerformanceCountersV2(dummyValue, dummyValue, dummyValue); + serviceCounter = new ServicePerformanceCountersV2(dummyServiceHost); + + // Throw away cached categories, then read from the categories to cause the cache to be repopulated. + PerformanceCounter.CloseSharedResources(); + PerformanceCounterCategory.Exists(dummyValue); + } + catch (UnauthorizedAccessException) + { + // Don't have permission to read performance counters. Trace a warning. + if (DiagnosticUtility.ShouldTraceWarning) + { + TraceUtility.TraceEvent(TraceEventType.Warning, + TraceCode.PerformanceCountersFailedForService, + SR.GetString(SR.EnsureCategoriesExistFailedPermission)); + } + } + catch + { + // Failed to ensure all of the categories exist. Catch the exception and try to create the counter anyway. + } + finally + { + // Delete the dummy counters, we don't need them anymore. + if (operationCounter != null) + { + operationCounter.DeleteInstance(); + } + + if (endpointCounter != null) + { + endpointCounter.DeleteInstance(); + } + + if (serviceCounter != null) + { + serviceCounter.DeleteInstance(); + } + + categoriesExist = true; + } + } } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs index 547633b7534..0443a521d52 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersBase.cs @@ -143,16 +143,31 @@ namespace System.ServiceModel.Diagnostics get { return (int)PerfCounters.TotalCounters; } } - static internal string CreateFriendlyInstanceName(ServiceHostBase serviceHost) + private static string GetServiceUri(ServiceHostBase serviceHost, ServiceInfo serviceInfo) { - // instance name is: serviceName@uri - ServiceInfo serviceInfo = new ServiceInfo(serviceHost); - string serviceName = serviceInfo.ServiceName; string uri; if (!TryGetFullVirtualPath(serviceHost, out uri)) { uri = serviceInfo.FirstAddress; } + return uri; + } + + private static string GetFullInstanceName(ServiceHostBase serviceHost) + { + // instance name is: serviceName@uri + ServiceInfo serviceInfo = new ServiceInfo(serviceHost); + string serviceName = serviceInfo.ServiceName; + string uri = GetServiceUri(serviceHost, serviceInfo); + return String.Format("{0}@{1}", serviceName, uri); + } + + private static string GetShortInstanceName(ServiceHostBase serviceHost) + { + ServiceInfo serviceInfo = new ServiceInfo(serviceHost); + string serviceName = serviceInfo.ServiceName; + string uri = GetServiceUri(serviceHost, serviceInfo); + int length = serviceName.Length + uri.Length + 2; if (length > maxCounterLength) @@ -181,6 +196,32 @@ namespace System.ServiceModel.Diagnostics return serviceName + "@" + uri.Replace('/', '|'); } + internal static string CreateFriendlyInstanceName(ServiceHostBase serviceHost) + { + string shortInstanceName = GetShortInstanceName(serviceHost); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(serviceHost); + + return EnsureUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELSERVICE.ServicePerfCounters, shortInstanceName, fullInstanceName); + } + + internal static string GetFriendlyInstanceName(ServiceHostBase serviceHost) + { + string shortInstanceName = GetShortInstanceName(serviceHost); + if (!ServiceModelAppSettings.EnsureUniquePerformanceCounterInstanceNames) + { + return shortInstanceName; + } + + string fullInstanceName = GetFullInstanceName(serviceHost); + + return GetUniqueInstanceName(PerformanceCounterStrings.SERVICEMODELSERVICE.ServicePerfCounters, shortInstanceName, fullInstanceName); + } + static bool TryGetFullVirtualPath(ServiceHostBase serviceHost, out string uri) { VirtualPathExtension pathExtension = serviceHost.Extensions.Find<VirtualPathExtension>(); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersV2.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersV2.cs index 9e53c72fe2a..b037f388f47 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersV2.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Diagnostics/ServicePerformanceCountersV2.cs @@ -232,6 +232,18 @@ using System.ServiceModel.Administration; get { return this.serviceCounterSetInstance != null; } } + // Immediately disposes and nulls the CounterSetInstance. This differs from Dispose because Dispose is "lazy" in that + // it holds weak references to the instances so we don't get corrupted state if the values are updated later. This + // method is used in situations when we need to delete the instance immediately and know the values won't be updated. + internal void DeleteInstance() + { + if (this.serviceCounterSetInstance != null) + { + this.serviceCounterSetInstance.Dispose(); + this.serviceCounterSetInstance = null; + } + } + protected override void Dispose(bool disposing) { try diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs index 08915244300..9f4d8c9c0bc 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ActionMessageFilterTable.cs @@ -111,7 +111,7 @@ namespace System.ServiceModel.Dispatcher this.filters.Add(filter, data); List<MessageFilter> filters; -#pragma warning suppress 56506 // [....], Actions will never be null +#pragma warning suppress 56506 // Microsoft, Actions will never be null if (filter.Actions.Count == 0) { this.always.Add(filter); @@ -426,7 +426,7 @@ namespace System.ServiceModel.Dispatcher if (this.filters.Remove(filter)) { -#pragma warning suppress 56506 // [....], ActionMessageFilter.Actions can never be null +#pragma warning suppress 56506 // Microsoft, ActionMessageFilter.Actions can never be null if (filter.Actions.Count == 0) { this.always.Remove(filter); @@ -436,9 +436,9 @@ namespace System.ServiceModel.Dispatcher List<MessageFilter> filters; for (int i = 0; i < filter.Actions.Count; ++i) { -#pragma warning suppress 56506 // [....], PreSharp generates a false error here +#pragma warning suppress 56506 // Microsoft, PreSharp generates a false error here filters = this.actions[filter.Actions[i]]; -#pragma warning suppress 56506 // [....], filters can never be null +#pragma warning suppress 56506 // Microsoft, filters can never be null if (filters.Count == 1) { this.actions.Remove(filter.Actions[i]); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs index 8a9955bd599..bad9a746f7b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/DuplexChannelBinder.cs @@ -537,7 +537,7 @@ namespace System.ServiceModel.Dispatcher } } - // ASSUMPTION: ([....]) caller holds lock (this.mutex) + // ASSUMPTION: (Microsoft) caller holds lock (this.mutex) void RequestStarting(Message message, IDuplexRequest request) { if (request != null) @@ -552,7 +552,7 @@ namespace System.ServiceModel.Dispatcher } - // ASSUMPTION: ([....]) caller holds lock (this.mutex) + // ASSUMPTION: (Microsoft) caller holds lock (this.mutex) void RequestCompleting(IDuplexRequest request) { this.pending--; @@ -1473,7 +1473,7 @@ namespace System.ServiceModel.Dispatcher public void EndClose(IAsyncResult result) { - // don't need to lock here since BeginClose is the [....]-point + // don't need to lock here since BeginClose is the sync-point if (this.closeState.TryUserClose()) { this.innerChannel.EndClose(result); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs index c61e56fb947..049a1b78495 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilter.cs @@ -92,7 +92,7 @@ namespace System.ServiceModel.Dispatcher } // To -#pragma warning suppress 56506 // [....], Message.Headers can never be null +#pragma warning suppress 56506 // Microsoft, Message.Headers can never be null Uri to = message.Headers.To; Uri actingAs = this.address.Uri; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs index b3d707904c1..7f5e509b82b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/EndpointAddressMessageFilterTable.cs @@ -153,7 +153,7 @@ namespace System.ServiceModel.Dispatcher this.candidates.Add(filter, can); CandidateSet cset; -#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null +#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null Uri soapToAddress = filter.Address.Uri; if (filter.IncludeHostNameInComparison) { @@ -181,7 +181,7 @@ namespace System.ServiceModel.Dispatcher // Update the QName ref count QName qname; int cnt; -#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null +#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null for (int i = 0; i < address.Headers.Count; ++i) { AddressHeader parameter = address.Headers[i]; @@ -719,7 +719,7 @@ namespace System.ServiceModel.Dispatcher } Candidate can = this.candidates[filter]; -#pragma warning suppress 56506 // [....], EndpointAddressMessageFilter.Address can never be null +#pragma warning suppress 56506 // Microsoft, EndpointAddressMessageFilter.Address can never be null Uri soapToAddress = filter.Address.Uri; CandidateSet cset = null; @@ -761,7 +761,7 @@ namespace System.ServiceModel.Dispatcher { // Adjust QName counts QName qname; -#pragma warning suppress 56506 // [....], EndpointAddress.Headers can never be null +#pragma warning suppress 56506 // Microsoft, EndpointAddress.Headers can never be null for (int i = 0; i < address.Headers.Count; ++i) { AddressHeader parameter = address.Headers[i]; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ErrorHandlingAcceptor.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ErrorHandlingAcceptor.cs index 87f9088a8ad..853a5f7386b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ErrorHandlingAcceptor.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ErrorHandlingAcceptor.cs @@ -56,9 +56,9 @@ namespace System.ServiceModel.Dispatcher { if ((this.dispatcher == null) || !this.dispatcher.HandleError(e)) { - // We only stop if the listener faults. It is a bug - // if the listener is in an invalid state and does not - // fault. So there are no cases today where this aborts. + // We only stop if the listener faults. It is a + + } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs index cb52945280c..60d24111d6a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ImmutableDispatchRuntime.cs @@ -1030,7 +1030,7 @@ namespace System.ServiceModel.Dispatcher void ProcessMessage31(ref MessageRpc rpc) { - rpc.NextProcessor = this.ProcessMessage4; + rpc.NextProcessor = this.processMessage4; if (this.transaction != null) { @@ -1144,7 +1144,7 @@ namespace System.ServiceModel.Dispatcher { if (!rpc.Operation.IsSynchronous) { - // If async call completes in [....], it tells us through the gate below + // If async call completes in sync, it tells us through the gate below rpc.PrepareInvokeContinueGate(); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs index 9a7e2012f19..b27cc867c80 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/InputChannelBinder.cs @@ -50,7 +50,7 @@ namespace System.ServiceModel.Dispatcher { get { -#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public +#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException()); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs index 3f1dd3be148..ebe6801b630 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/MessageFilterTable.cs @@ -153,7 +153,7 @@ namespace System.ServiceModel.Dispatcher throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument("filter", SR.GetString(SR.FilterExists)); } -#pragma warning suppress 56506 // [....], PreSharp generates a false warning here +#pragma warning suppress 56506 // Microsoft, PreSharp generates a false warning here Type filterType = filter.GetType(); Type tableType = null; IMessageFilterTable<TFilterData> table = null; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs index 2bfeafdac3c..2bcb3ceaede 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OperationInvokerBehavior.cs @@ -41,7 +41,7 @@ namespace System.ServiceModel.Dispatcher { if (description.BeginMethod != null) { - // both [....] and async methods are present on the contract, check the preference + // both sync and async methods are present on the contract, check the preference OperationBehaviorAttribute operationBehaviorAttribue = description.Behaviors.Find<OperationBehaviorAttribute>(); if ((operationBehaviorAttribue != null) && operationBehaviorAttribue.PreferAsyncInvocation) { @@ -54,7 +54,7 @@ namespace System.ServiceModel.Dispatcher } else { - // only [....] method is present on the contract + // only sync method is present on the contract dispatch.Invoker = new SyncMethodInvoker(description.SyncMethod); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs index 4c94fe775fe..e4a25a96a6a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/OutputChannelBinder.cs @@ -43,7 +43,7 @@ namespace System.ServiceModel.Dispatcher { get { -#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public +#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException()); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs index 53855e35933..91f21729a23 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilter.cs @@ -85,7 +85,7 @@ namespace System.ServiceModel.Dispatcher } // To -#pragma warning suppress 56506 // [....], Message.Headers can never be null +#pragma warning suppress 56506 // Microsoft, Message.Headers can never be null Uri to = message.Headers.To; object o; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs index d360c4ba441..5b8d787e79f 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrefixEndpointAddressMessageFilterTable.cs @@ -59,7 +59,7 @@ namespace System.ServiceModel.Dispatcher Candidate can = new Candidate(filter, data, mask, filter.HeaderLookup); this.candidates.Add(filter, can); -#pragma warning suppress 56506 // [....], PrefixEndpointAddressMessageFilter.Address can never be null +#pragma warning suppress 56506 // Microsoft, PrefixEndpointAddressMessageFilter.Address can never be null Uri soapToAddress = filter.Address.Uri; CandidateSet cset; @@ -134,7 +134,7 @@ namespace System.ServiceModel.Dispatcher } Candidate can = this.candidates[filter]; -#pragma warning suppress 56506 // [....], PrefixEndpointAddressMessageFilter.Address can never be null +#pragma warning suppress 56506 // Microsoft, PrefixEndpointAddressMessageFilter.Address can never be null Uri soapToAddress = filter.Address.Uri; CandidateSet cset = null; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs index 7387258171a..beddbbcfcfb 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/PrimitiveOperationFormatter.cs @@ -46,7 +46,7 @@ namespace System.ServiceModel.Dispatcher OperationFormatter.Validate(description, isRpc, false/*isEncoded*/); this.operation = description; -#pragma warning suppress 56506 // [....], OperationDescription.Messages never be null +#pragma warning suppress 56506 // Microsoft, OperationDescription.Messages never be null this.requestMessage = description.Messages[0]; if (description.Messages.Count == 2) this.responseMessage = description.Messages[1]; @@ -290,7 +290,7 @@ namespace System.ServiceModel.Dispatcher throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("description"); OperationDescription operation = description; -#pragma warning suppress 56506 // [....], OperationDescription.Messages never be null +#pragma warning suppress 56506 // Microsoft, OperationDescription.Messages never be null MessageDescription requestMessage = description.Messages[0]; MessageDescription responseMessage = null; if (description.Messages.Count == 2) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs index e3335d23660..046eea89a08 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryFunctions.cs @@ -55,7 +55,7 @@ namespace System.ServiceModel.Dispatcher List<NodeSequenceIterator> iterList; - // REFACTOR, [....], make this a function on QueryValueModel + // REFACTOR, Microsoft, make this a function on QueryValueModel internal XsltFunctionCallOpcode(XsltContext context, IXsltContextFunction function, int argCount) : base(OpcodeID.XsltFunction) { @@ -138,7 +138,7 @@ namespace System.ServiceModel.Dispatcher } else { - // PERF, [....], see if we can cache these arrays to avoid allocations + // PERF, Microsoft, see if we can cache these arrays to avoid allocations object[] xsltArgs = new object[this.argCount]; int iterationCount = context.TopArg.Count; for (int iteration = 0; iteration < iterationCount; ++iteration) @@ -1210,7 +1210,7 @@ namespace System.ServiceModel.Dispatcher StackFrame argKeys = context.SecondArg; StackFrame argValues = context[2]; - // PERF, [....], this is really slow. + // PERF, Microsoft, this is really slow. StringBuilder builder = new StringBuilder(); while (argSource.basePtr <= argSource.endPtr) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryMatcher.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryMatcher.cs index d34430b8733..6fec13b5cb6 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryMatcher.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryMatcher.cs @@ -337,8 +337,8 @@ namespace System.ServiceModel.Dispatcher // Fx will bind prefixes and functions here. if (namespaces != null) { - // There's a bug in System.Xml.XPath. If we pass an XsltContext to SetContext it won't throw if there's - // an undefined prefix. + // There's a + if (namespaces is XsltContext) { // Lex the xpath to find all prefixes used diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs index 0ee7900aaca..f56c2737a5e 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryNode.cs @@ -140,7 +140,7 @@ namespace System.ServiceModel.Dispatcher NodesetLast = 0x01, } - // PERF, [....], Remove when generic sort works + // PERF, Microsoft, Remove when generic sort works // Used to sort in document order #if NO internal class NodeSequenceItemObjectComparer : IComparer @@ -908,7 +908,7 @@ namespace System.ServiceModel.Dispatcher { this.Merge(false); - // PERF, [....], make this work + // PERF, Microsoft, make this work //Array.Sort<NodeSequenceItem>(this.items, 0, this.count, NodeSequence.Comparer); Array.Sort(this.items, 0, this.count, NodeSequence.ObjectComparer); @@ -974,7 +974,7 @@ namespace System.ServiceModel.Dispatcher return seq; /* - // PERF, [....], I think we can do the merge ourselves and avoid the sort. + // PERF, Microsoft, I think we can do the merge ourselves and avoid the sort. // Need to verify that the sequences are always in document order. for(int i = 0; i < this.count; ++i) { @@ -1055,13 +1055,13 @@ namespace System.ServiceModel.Dispatcher { if (this.index == 0) { -#pragma warning suppress 56503 // [....], postponing the public change +#pragma warning suppress 56503 // Microsoft, postponing the public change throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QueryProcessingException(QueryProcessingError.Unexpected, SR.GetString(SR.QueryContextNotSupportedInSequences))); } if (this.index > this.data.seq.Count) { -#pragma warning suppress 56503 // [....], postponing the public change +#pragma warning suppress 56503 // Microsoft, postponing the public change throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryAfterNodes))); } // @@ -1156,13 +1156,13 @@ namespace System.ServiceModel.Dispatcher { if (this.iter.CurrentPosition == 0) { -#pragma warning suppress 56503 // [....], postponing the public change +#pragma warning suppress 56503 // Microsoft, postponing the public change throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryBeforeNodes))); } if (this.iter.CurrentPosition > this.iter.Count) { -#pragma warning suppress 56503 // [....], postponing the public change +#pragma warning suppress 56503 // Microsoft, postponing the public change throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.QueryAfterNodes))); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs index 54818a997be..6df5f8ce144 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryProcessor.cs @@ -457,7 +457,7 @@ namespace System.ServiceModel.Dispatcher this.matcher = matcher; this.flags = QueryProcessingFlags.Match; - // PERF, [....], see if we can just let these to their default init + // PERF, Microsoft, see if we can just let these to their default init this.messageAction = null; //this.messageAddress = null; //this.messageVia = null; @@ -510,7 +510,7 @@ namespace System.ServiceModel.Dispatcher } else { -#pragma warning suppress 56503 // [....], property is more readable for this +#pragma warning suppress 56503 // Microsoft, property is more readable for this throw DiagnosticUtility.ExceptionUtility.ThrowHelperCritical(new QueryProcessingException(QueryProcessingError.Unexpected)); } this.counter = this.contextNode as INodeCounter; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs index e835c3651fd..133eb048b5e 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySelectOp.cs @@ -44,7 +44,7 @@ namespace System.ServiceModel.Dispatcher { get { - // PERF, [....], weaken guard? + // PERF, Microsoft, weaken guard? return QueryAxisType.Self == this.axis.Type || QueryAxisType.Child == this.axis.Type; //return ((QueryAxisType.Self == this.axis.Type) || ((this.axis.Type != QueryAxisType.DescendantOrSelf || this.axis.Type != QueryAxisType.Descendant)&& 0 != ((QueryNodeType.Element | QueryNodeType.Root) & this.type))); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs index 790a61eb0e0..40a6970b464 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QuerySubExprEliminator.cs @@ -278,8 +278,8 @@ namespace System.ServiceModel.Dispatcher internal class SubExprHeader : SubExpr { - // WS, [....], Can probably combine these - // WS, [....], Make this data structure less ugly (if possible) + // WS, Microsoft, Can probably combine these + // WS, Microsoft, Make this data structure less ugly (if possible) Dictionary<string, Dictionary<string, List<SubExpr>>> nameLookup; Dictionary<SubExpr, MyInt> indexLookup; @@ -329,7 +329,7 @@ namespace System.ServiceModel.Dispatcher context.SaveVariable(this.var, context.Processor.ElapsedCount(marker)); } - // WS, [....], see if we can put this array in the processor to save + // WS, Microsoft, see if we can put this array in the processor to save // an allocation. Perhaps we can use the variables slot we're going to fill NodeSequence[] childSequences = new NodeSequence[this.children.Count]; NodeSequence seq = context.Sequences[context.TopSequenceArg.basePtr].Sequence; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs index 6efce98ed0c..6327b5d0d53 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/QueryUtil.cs @@ -657,7 +657,7 @@ namespace System.ServiceModel.Dispatcher } else { - // PERF, [....], can this be made more efficient? Does it need to be? + // PERF, Microsoft, can this be made more efficient? Does it need to be? Remove(old); Insert(replace); } @@ -704,7 +704,7 @@ namespace System.ServiceModel.Dispatcher } else if (this.buffer.Length == this.size) { - // PERF, [....], how should we choose a new size? + // PERF, Microsoft, how should we choose a new size? T[] tmp = new T[this.size + 1]; if (index == 0) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs index fc2e8ea3f9f..3c15855a7dd 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/ReplyChannelBinder.cs @@ -50,7 +50,7 @@ namespace System.ServiceModel.Dispatcher { get { -#pragma warning suppress 56503 // [....], the property is really not implemented, cannot lie, API not public +#pragma warning suppress 56503 // Microsoft, the property is really not implemented, cannot lie, API not public throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new NotImplementedException()); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityImpersonationBehavior.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityImpersonationBehavior.cs index d25cc14579e..7832a4aa308 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityImpersonationBehavior.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityImpersonationBehavior.cs @@ -486,7 +486,7 @@ namespace System.ServiceModel.Dispatcher { public IDisposable Impersonate() { - // PreSharp Bug: Call 'Marshal.GetLastWin32Error' or 'Marshal.GetHRForLastWin32Error' before any other interop call. + // PreSharp #pragma warning suppress 56523 // The LastWin32Error can be ignored here. IntPtr threadHandle = SafeNativeMethods.GetCurrentThread(); SafeCloseHandle tokenHandle; @@ -527,12 +527,12 @@ namespace System.ServiceModel.Dispatcher void Undo() { - // PreSharp Bug: Call 'Marshal.GetLastWin32Error' or 'Marshal.GetHRForLastWin32Error' before any other interop call. + // PreSharp #pragma warning suppress 56523 // The LastWin32Error can be ignored here. Fx.Assert(this.threadHandle == SafeNativeMethods.GetCurrentThread(), ""); // We are in the Dispose method. If a failure occurs we just have to ignore it. - // PreSharp Bug: Call 'Marshal.GetLastWin32Error' or 'Marshal.GetHRForLastWin32Error' before any other interop call. - // #pragma warning suppress 56523 // The LastWin32Error can be ignored here. + // PreSharp + if (!SafeNativeMethods.SetCurrentThreadToken(IntPtr.Zero, this.tokenHandle)) { int error = Marshal.GetLastWin32Error(); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs index 0d0cb0f2c97..82a56eaf5fe 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SecurityValidationBehavior.cs @@ -235,7 +235,7 @@ namespace System.ServiceModel.Dispatcher if (sbe is SymmetricSecurityBindingElement || sbe is AsymmetricSecurityBindingElement) { // check to see if we are streaming - // ([....] 53690): need to have a general way get the transfer Mode from the binding + // (Microsoft 53690): need to have a general way get the transfer Mode from the binding // TransferMode transferMode = binding.GetProperty<TransferMode>(new BindingParameterCollection()); if (GetTransferMode(binding) != TransferMode.Buffered) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs index 9066da02bd9..7e37baf4ea9 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/SeekableMessageNavigator.cs @@ -138,7 +138,7 @@ namespace System.ServiceModel.Dispatcher // The base uri of the element // This is usually associated with the URI of the original data's location - // WS, [....], look into what readers from messages surface. If it's always null, we can save + // WS, Microsoft, look into what readers from messages surface. If it's always null, we can save // some memory public override string BaseURI { @@ -183,7 +183,7 @@ namespace System.ServiceModel.Dispatcher while (n != p.elem) { - // PERF, [....], we might be able to get rid of this check by tweaking the position + // PERF, Microsoft, we might be able to get rid of this check by tweaking the position // validator if (n == NullIndex) { @@ -779,7 +779,7 @@ namespace System.ServiceModel.Dispatcher // Move the navigator to the first child of the current node. public override bool MoveToFirstChild() { - // PERF, [....], do we need this check? The null check may be enough + // PERF, Microsoft, do we need this check? The null check may be enough // Only valid for the root or an element node if (this.location == RootIndex || this.dom.nodes[this.location].type == XPathNodeType.Element) { @@ -894,7 +894,7 @@ namespace System.ServiceModel.Dispatcher n = this.dom.nodes[n].nextSibling; } - // PERF, [....], can we just clear? + // PERF, Microsoft, can we just clear? // We didn't find it, so restore the namespace stack for (int i = 0; i < nsCount; ++i) { @@ -1483,7 +1483,7 @@ namespace System.ServiceModel.Dispatcher // Get the index of the next namespace that matches the scope // This function populates the namespace stack too - // PERF, [....], see if we can have this function set the current location too + // PERF, Microsoft, see if we can have this function set the current location too int FindNamespace(int parent, int ns, XPathNamespaceScope scope) { bool done = false; @@ -1932,7 +1932,7 @@ namespace System.ServiceModel.Dispatcher int n = NullIndex; do { - // PERF, [....], reorder cases so more common ones are earlier + // PERF, Microsoft, reorder cases so more common ones are earlier switch (reader.NodeType) { case XmlNodeType.Element: @@ -2118,7 +2118,7 @@ namespace System.ServiceModel.Dispatcher } } - // PERF, [....], find a better way to implement and have internal + // PERF, Microsoft, find a better way to implement and have internal void INodeCounter.Increase() { Increase(); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs index a11a8f82efa..37c3276d24f 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/StreamFormatter.cs @@ -332,7 +332,7 @@ namespace System.ServiceModel.Dispatcher { get { -#pragma warning suppress 56503 // [....], not a seekable stream, it is ok to throw NotSupported in this case +#pragma warning suppress 56503 // Microsoft, not a seekable stream, it is ok to throw NotSupported in this case throw TraceUtility.ThrowHelperError(new NotSupportedException(), this.message); } } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs index 1222eb30b45..9a9aee04f01 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Dispatcher/XPathMessageContext.cs @@ -162,7 +162,7 @@ namespace System.ServiceModel.Dispatcher if (argTypes == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("argTypes"); - // PERF, [....], factor ns if all same + // PERF, Microsoft, factor ns if all same string ns = LookupNamespace(prefix); for (int i = 0; i < functions.Length; ++i) { @@ -1254,7 +1254,7 @@ namespace System.ServiceModel.Dispatcher { do { - // PERF, [....], this will be faster if I cache the envelope namespace to do the + // PERF, Microsoft, this will be faster if I cache the envelope namespace to do the // actor lookup by hand long pos = nav.CurrentPosition; string navActor = XPathMessageFunctionActor.ExtractFromNavigator(nav); @@ -1283,9 +1283,9 @@ namespace System.ServiceModel.Dispatcher return docContext.Evaluate(expr); #if NO - // PERF, [....], I drafted this implementation before we found out that a bug in the Fx implementation would - // prevent us from constructing an XPathNodeIterator that they would accept. I'm keeping it - // around in the hope that I will be able to use it by M5.4. If not, it will be deleted. + // PERF, Microsoft, I drafted this implementation before we found out that a + + XPathNavigator basicNav = docContext.Clone(); SeekableXPathNavigator nav = basicNav as SeekableXPathNavigator; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/DnsEndpointIdentity.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/DnsEndpointIdentity.cs index 2b2991a1473..4ce51214c0e 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/DnsEndpointIdentity.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/DnsEndpointIdentity.cs @@ -25,7 +25,7 @@ namespace System.ServiceModel if (identity == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("identity"); - // PreSharp Bug: Parameter 'identity.ResourceType' to this public method must be validated: A null-dereference can occur here. + // PreSharp #pragma warning suppress 56506 // Claim.ClaimType will never return null if (!identity.ClaimType.Equals(ClaimTypes.Dns)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.UnrecognizedClaimTypeForIdentity, identity.ClaimType, ClaimTypes.Dns)); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs index 26583d1528c..dd22acb146b 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointAddress.cs @@ -342,7 +342,7 @@ namespace System.ServiceModel // NOTE: UserInfo, Query, and Fragment are ignored when comparing Uris as addresses // this is the WCF logic for comparing Uris that represent addresses - // this method must be kept in [....] with UriGetHashCode + // this method must be kept in sync with UriGetHashCode internal static bool UriEquals(Uri u1, Uri u2, bool ignoreCase, bool includeHostInComparison) { return UriEquals(u1, u2, ignoreCase, includeHostInComparison, true); @@ -393,7 +393,7 @@ namespace System.ServiceModel return string.Compare(u1Path, 0, u2Path, 0, u1Len, ignoreCase ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal) == 0; } - // this method must be kept in [....] with UriEquals + // this method must be kept in sync with UriEquals internal static int UriGetHashCode(Uri uri, bool includeHostInComparison) { return UriGetHashCode(uri, includeHostInComparison, true); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointIdentity.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointIdentity.cs index 59cbd6c2569..c8f69446d0f 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointIdentity.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointIdentity.cs @@ -69,7 +69,7 @@ namespace System.ServiceModel if (identity == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("identity"); - // PreSharp Bug: Parameter 'identity.ClaimType' to this public method must be validated: A null-dereference can occur here. + // PreSharp #pragma warning suppress 56506 // Claim.ClaimType will never return null if (identity.ClaimType.Equals(ClaimTypes.Dns)) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointTrait.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointTrait.cs index a1805b2d606..cc42d3bda8d 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointTrait.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/EndpointTrait.cs @@ -9,4 +9,4 @@ namespace System.ServiceModel { public abstract ChannelFactory<TChannel> CreateChannelFactory(); } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs index cbac59f62a0..409b9c82445 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/FaultReason.cs @@ -72,7 +72,7 @@ namespace System.ServiceModel return GetMatchingTranslation(CultureInfo.CurrentCulture); } - // [....], This function should always return a translation so that a fault can be surfaced. + // Microsoft, This function should always return a translation so that a fault can be surfaced. public FaultReasonText GetMatchingTranslation(CultureInfo cultureInfo) { if (cultureInfo == null) diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs new file mode 100644 index 00000000000..76196d79980 --- /dev/null +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/LocalAppContextSwitches.cs @@ -0,0 +1,33 @@ +// <copyright> +// Copyright (c) Microsoft Corporation. All rights reserved. +// </copyright> +namespace System.ServiceModel +{ + using System; + using System.Runtime.CompilerServices; + + // When adding a quirk, name it such that false is new behavior and true is old behavior. + // You are opting IN to old behavior. The new behavior is default. + // For example, we want to enable the functionality to explicitly add a connection close header + // in 4.6 and above. So we set DisableExplicitConnectionCloseHeader to true if running 4.5.2 or less. + internal static class LocalAppContextSwitches + { + private const string DisableExplicitConnectionCloseHeaderString = "Switch.System.ServiceModel.DisableExplicitConnectionCloseHeader"; + private static int disableExplicitConnectionCloseHeader; + + public static bool DisableExplicitConnectionCloseHeader + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + return LocalAppContext.GetCachedSwitchValue(DisableExplicitConnectionCloseHeaderString, ref disableExplicitConnectionCloseHeader); + } + } + + public static void SetDefaultsLessOrEqual_452() + { + // Define the switches that should be true for 4.5.2 or less, false for 4.6+. + LocalAppContext.DefineSwitchDefault(DisableExplicitConnectionCloseHeaderString, true); + } + } +} diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OSVersion.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OSVersion.cs index b70de211809..165d8db22b0 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OSVersion.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/OSVersion.cs @@ -46,4 +46,4 @@ namespace System.ServiceModel /// </summary> PostWin8, } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/RsaEndpointIdentity.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/RsaEndpointIdentity.cs index b0c64e3ce49..d1e3619beec 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/RsaEndpointIdentity.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/RsaEndpointIdentity.cs @@ -41,7 +41,7 @@ namespace System.ServiceModel if (identity == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("identity"); - // PreSharp Bug: Parameter 'identity.ClaimType' to this public method must be validated: A null-dereference can occur here. + // PreSharp #pragma warning suppress 56506 // Claim.ClaimType will never return null if (!identity.ClaimType.Equals(ClaimTypes.Rsa)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.UnrecognizedClaimTypeForIdentity, identity.ClaimType, ClaimTypes.Rsa)); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs index ff0d508ecb0..415a96411d1 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/CryptoHelper.cs @@ -178,7 +178,7 @@ namespace System.ServiceModel.Security catch (InvalidOperationException) { algorithmObject = null; - // We ---- the exception and continue. + // We swallow the exception and continue. } if (algorithmObject != null) { @@ -281,7 +281,7 @@ namespace System.ServiceModel.Security catch (InvalidOperationException) { algorithmObject = null; - // We ---- the exception and continue. + // We swallow the exception and continue. } if (algorithmObject != null) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/FederatedSecurityTokenManager.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/FederatedSecurityTokenManager.cs index 734d4d21936..4cd988b21cd 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/FederatedSecurityTokenManager.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/FederatedSecurityTokenManager.cs @@ -439,9 +439,9 @@ namespace System.ServiceModel.Security return _defaultTokenResolver; } /// <summary> - /// There is a bug in WCF where the version obtained from the public SecurityTokenVersion strings is wrong. - /// The internal MessageSecurityTokenVersion has the right version. - /// </summary> + /// There is a + + internal static SecurityVersion GetSecurityVersion( SecurityTokenVersion tokenVersion ) { if ( tokenVersion == null ) @@ -450,11 +450,11 @@ namespace System.ServiceModel.Security } // - // Workaround for WCF bug. - // In .NET 3.5 WCF returns the wrong Token Specification. We need to reflect on the - // internal code so we can access the SecurityVersion directly instead of depending - // on the security specification. - // + // Workaround for WCF + + + + if ( tokenVersion is MessageSecurityTokenVersion ) { SecurityVersion sv = ( tokenVersion as MessageSecurityTokenVersion ).SecurityVersion; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/RequestSecurityToken.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/RequestSecurityToken.cs index 846bfee75a6..a4a35f7d8f1 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/RequestSecurityToken.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/RequestSecurityToken.cs @@ -254,7 +254,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRST, "RequestProperties"))); } @@ -334,7 +334,7 @@ namespace System.ServiceModel.Security { if (!this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemAvailableInDeserializedRSTOnly, "RequestSecurityTokenXml"))); } @@ -374,7 +374,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRST, "AppliesTo"))); } @@ -388,7 +388,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRST, "AppliesToSerializer"))); } @@ -402,7 +402,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRST, "AppliesToType"))); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/RequestSecurityTokenResponse.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/RequestSecurityTokenResponse.cs index c84607d9427..0cfa08302c6 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/RequestSecurityTokenResponse.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/RequestSecurityTokenResponse.cs @@ -334,7 +334,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRSTR, "EntropyToken"))); } @@ -348,7 +348,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRSTR, "IssuedToken"))); } @@ -368,7 +368,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRSTR, "ProofToken"))); } @@ -388,7 +388,7 @@ namespace System.ServiceModel.Security { if (!this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemAvailableInDeserializedRSTROnly, "RequestSecurityTokenXml"))); } @@ -402,7 +402,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRST, "AppliesTo"))); } @@ -416,7 +416,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRST, "AppliesToSerializer"))); } @@ -430,7 +430,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRST, "AppliesToType"))); } @@ -444,7 +444,7 @@ namespace System.ServiceModel.Security { if (this.isReceiver) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ItemNotAvailableInDeserializedRSTR, "IsLifetimeSet"))); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SctClaimSerializer.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SctClaimSerializer.cs index 1ab82412c3a..d957ab82280 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SctClaimSerializer.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SctClaimSerializer.cs @@ -428,7 +428,7 @@ namespace System.ServiceModel.Security writer.WriteStartElement(dictionary.WindowsSidIdentity, dictionary.EmptyString); WriteSidAttribute(wid.User, dictionary, writer); - // This is to work around WOW64 bug Windows OS 1491447 + // This is to work around WOW64 string authenticationType = null; using (WindowsIdentity self = WindowsIdentity.GetCurrent()) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecureConversationDriver.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecureConversationDriver.cs index a3145e57e1a..68a7269529f 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecureConversationDriver.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecureConversationDriver.cs @@ -21,7 +21,7 @@ namespace System.ServiceModel.Security { get { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SecureConversationDriverVersionDoesNotSupportSession))); } @@ -31,7 +31,7 @@ namespace System.ServiceModel.Security { get { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SecureConversationDriverVersionDoesNotSupportSession))); } @@ -53,7 +53,7 @@ namespace System.ServiceModel.Security { get { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SecureConversationDriverVersionDoesNotSupportSession))); } @@ -63,7 +63,7 @@ namespace System.ServiceModel.Security { get { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.SecureConversationDriverVersionDoesNotSupportSession))); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionClientSettings.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionClientSettings.cs index e74c94855b8..946bb402256 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionClientSettings.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionClientSettings.cs @@ -2758,7 +2758,7 @@ namespace System.ServiceModel.Security { if (this.sessionId == null) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.ChannelMustBeOpenedToGetSessionId))); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs index 175f07c58c9..4f2357a444a 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecuritySessionSecurityTokenProvider.cs @@ -865,9 +865,9 @@ namespace System.ServiceModel.Security /* * Session issuance/renewal consists of the following steps (some may be async): - * 1. Create a channel ([....]) + * 1. Create a channel (sync) * 2. Open the channel (async) - * 3. Create the request to send to server ([....]) + * 3. Create the request to send to server (sync) * 4. Send the message and get reply (async) * 5. Process the reply to get the token * 6. Close the channel (async) and complete the async result diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs index e24e7b2ecc5..7047365f940 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityUtils.cs @@ -18,6 +18,7 @@ namespace System.ServiceModel.Security using System.Net.Security; using System.Runtime; using System.Security; + using System.Security.Authentication; using System.Security.Authentication.ExtendedProtection; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; @@ -105,6 +106,28 @@ namespace System.ServiceModel.Security } } + static class SslProtocolsHelper + { + internal static bool IsDefined(SslProtocols value) + { + SslProtocols allValues = SslProtocols.None; + foreach (var protocol in Enum.GetValues(typeof(SslProtocols))) + { + allValues |= (SslProtocols)protocol; + } + return (value & allValues) == value; + } + + internal static void Validate(SslProtocols value) + { + if (!IsDefined(value)) + { + throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidEnumArgumentException("value", (int)value, + typeof(SslProtocols))); + } + } + } + static class TokenImpersonationLevelHelper { internal static bool IsDefined(TokenImpersonationLevel value) @@ -261,7 +284,7 @@ namespace System.ServiceModel.Security volatile static bool isSslValidationRequirementDetermined = false; static readonly int MinimumSslCipherStrength = 128; - // these are kept in [....] with IIS70 + // these are kept in sync with IIS70 public const string AuthTypeNTLM = "NTLM"; public const string AuthTypeNegotiate = "Negotiate"; public const string AuthTypeKerberos = "Kerberos"; @@ -1378,7 +1401,7 @@ namespace System.ServiceModel.Security } } - // work-around to Windows SE Bug 141614 + // work-around to Windows SE [Fx.Tag.SecurityNote(Critical = "Uses unsafe critical method UnsafeGetPassword to access the credential password without a Demand.", Safe = "Only uses the password to construct a cloned NetworkCredential instance, does not leak password value.")] [SecuritySafeCritical] @@ -1412,7 +1435,7 @@ namespace System.ServiceModel.Security } } - // WORKAROUND, [....], VSWhidbey 561276: The first NetworkCredential must be created in a lock. + // WORKAROUND, Microsoft, VSWhidbey 561276: The first NetworkCredential must be created in a lock. internal static void PrepareNetworkCredential() { if (dummyNetworkCredential == null) @@ -1632,7 +1655,7 @@ namespace System.ServiceModel.Security { thisPtr.communicationObject.EndOpen(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -1707,7 +1730,7 @@ namespace System.ServiceModel.Security { thisPtr.communicationObject.EndClose(result); } -#pragma warning suppress 56500 // [....], transferring exception to another thread +#pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) @@ -2156,7 +2179,7 @@ namespace System.ServiceModel.Security if (keyIdentifierClause is EncryptedKeyIdentifierClause) { EncryptedKeyIdentifierClause keyClause = (EncryptedKeyIdentifierClause)keyIdentifierClause; - // PreSharp Bug: Parameter 'keyClause' to this public method must be validated: A null-dereference can occur here. + // PreSharp #pragma warning suppress 56506 // keyClause will not be null due to the if condition above. for (int i = 0; i < keyClause.EncryptingKeyIdentifier.Count; i++) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityVerifiedMessage.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityVerifiedMessage.cs index 99658e3d2b6..b8af32e48a7 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityVerifiedMessage.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/SecurityVerifiedMessage.cs @@ -70,7 +70,7 @@ namespace System.ServiceModel.Security { if (this.IsDisposed) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); } @@ -91,7 +91,7 @@ namespace System.ServiceModel.Security { if (this.IsDisposed) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw TraceUtility.ThrowHelperError(CreateMessageDisposedException(), this); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsSspiNegotiation.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsSspiNegotiation.cs index 0032edc9ea8..77a3dde3fdd 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsSspiNegotiation.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TlsSspiNegotiation.cs @@ -210,7 +210,7 @@ namespace System.ServiceModel.Security ThrowIfDisposed(); if (!IsValidContext) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception((int)SecurityStatus.InvalidHandle)); } @@ -229,7 +229,7 @@ namespace System.ServiceModel.Security ThrowIfDisposed(); if (!IsValidContext) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception((int)SecurityStatus.InvalidHandle)); } @@ -269,7 +269,7 @@ namespace System.ServiceModel.Security ThrowIfDisposed(); if (!IsValidContext) { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new Win32Exception((int)SecurityStatus.InvalidHandle)); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TransportSecurityProtocol.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TransportSecurityProtocol.cs index cf865bbb427..93c2c9b13af 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TransportSecurityProtocol.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TransportSecurityProtocol.cs @@ -240,6 +240,13 @@ namespace System.ServiceModel.Security securityHeader.ExpectEndorsingTokens = expectEndorsingTokens; securityHeader.MaxReceivedMessageSize = factory.SecurityBindingElement.MaxReceivedMessageSize; securityHeader.ReaderQuotas = factory.SecurityBindingElement.ReaderQuotas; + + // Due to compatibility, only honor this setting if this app setting is enabled + if (ServiceModelAppSettings.UseConfiguredTransportSecurityHeaderLayout) + { + securityHeader.Layout = factory.SecurityHeaderLayout; + } + TimeoutHelper timeoutHelper = new TimeoutHelper(timeout); if (!factory.ActAsInitiator) { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TrustDriver.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TrustDriver.cs index e052b20da66..7088b26b839 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TrustDriver.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/TrustDriver.cs @@ -38,7 +38,7 @@ namespace System.ServiceModel.Security { get { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.TrustDriverVersionDoesNotSupportIssuedTokens))); } @@ -49,7 +49,7 @@ namespace System.ServiceModel.Security { get { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.TrustDriverVersionDoesNotSupportIssuedTokens))); } @@ -75,7 +75,7 @@ namespace System.ServiceModel.Security { get { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.TrustDriverVersionDoesNotSupportSession))); } @@ -88,7 +88,7 @@ namespace System.ServiceModel.Security { get { - // PreSharp Bug: Property get methods should not throw exceptions. + // PreSharp #pragma warning suppress 56503 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.GetString(SR.TrustDriverVersionDoesNotSupportSession))); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs index e3d7cf18cc0..8b17d6e54ca 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityPolicy.cs @@ -2923,7 +2923,7 @@ namespace System.ServiceModel.Security return; } WsdlImporter wsdlImporter; - // NOTE: [....], Policy import/export is seperate from WSDL however, this policy importer + // NOTE: Microsoft, Policy import/export is seperate from WSDL however, this policy importer // invokes the WsdlImporter. In the event that the current MetadataImporter is a WsdlImporter, // we should use it's collection of extensions for the import process. Other wise WsdlImporter currentWsdlImporter = importer as WsdlImporter; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityTokenSerializer.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityTokenSerializer.cs index 85bed0f99b9..c4cd224b3b0 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityTokenSerializer.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSSecurityTokenSerializer.cs @@ -472,7 +472,7 @@ namespace System.ServiceModel.Security } } - // PreSharp Bug: Parameter 'element' to this public method must be validated: A null-dereference can occur here. + // PreSharp #pragma warning suppress 56506 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new XmlException(SR.GetString(SR.CannotReadToken, element.LocalName, element.NamespaceURI, element.GetAttribute(SecurityJan2004Strings.ValueType, null)))); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrust.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrust.cs index 2795cd2b3ec..5c6b6d26fbf 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrust.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrust.cs @@ -1524,7 +1524,7 @@ namespace System.ServiceModel.Security foreach (XmlNode node in element.ChildNodes) if (node is XmlElement) { - // PreSharp Bug: Parameter 'requiredClaims' to this public method must be validated: A null-dereference can occur here. + // PreSharp #pragma warning suppress 56506 requiredClaims.Add((XmlElement)node); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustFeb2005.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustFeb2005.cs index e098f79e161..e0d19660f81 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustFeb2005.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustFeb2005.cs @@ -282,7 +282,7 @@ namespace System.ServiceModel.Security public void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior) { // it is very unlikely that InteractiveChannelInitializers will be null, this is defensive in case ClientRuntime every has a - // bug. I am OK with this as ApplyingClientBehavior is a one-time channel setup. + // if (behavior != null && behavior.InteractiveChannelInitializers != null) { // clear away any interactive initializer diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs index 81df58a3069..5561ded581f 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Security/WSTrustServiceContract.cs @@ -1351,7 +1351,7 @@ namespace System.ServiceModel.Security internal class ProcessCoreAsyncResult : AsyncResult { // - // Encapsulate the local variables in the [....] version of ProcessCore as fields. + // Encapsulate the local variables in the sync version of ProcessCore as fields. // WSTrustServiceContract _trustServiceContract; DispatchContext _dispatchContext; diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs new file mode 100644 index 00000000000..b7c7db2a426 --- /dev/null +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAppSettings.cs @@ -0,0 +1,99 @@ +// <copyright> +// Copyright (c) Microsoft Corporation. All rights reserved. +// </copyright> + +namespace System.ServiceModel +{ + using System.Collections.Specialized; + using System.Configuration; + using System.Diagnostics.CodeAnalysis; + using System.Runtime; + + // Due to friend relationships with other assemblies, naming this class as AppSettings causes ambiguity when building those assemblies + internal static class ServiceModelAppSettings + { + internal const string HttpTransportPerFactoryConnectionPoolString = "wcf:httpTransportBinding:useUniqueConnectionPoolPerFactory"; + internal const string EnsureUniquePerformanceCounterInstanceNamesString = "wcf:ensureUniquePerformanceCounterInstanceNames"; + internal const string UseConfiguredTransportSecurityHeaderLayoutString = "wcf:useConfiguredTransportSecurityHeaderLayout"; + const bool DefaultHttpTransportPerFactoryConnectionPool = false; + const bool DefaultEnsureUniquePerformanceCounterInstanceNames = false; + const bool DefaultUseConfiguredTransportSecurityHeaderLayout = false; + static bool httpTransportPerFactoryConnectionPool; + static bool ensureUniquePerformanceCounterInstanceNames; + static bool useConfiguredTransportSecurityHeaderLayout; + static volatile bool settingsInitalized = false; + static object appSettingsLock = new object(); + + internal static bool HttpTransportPerFactoryConnectionPool + { + get + { + EnsureSettingsLoaded(); + + return httpTransportPerFactoryConnectionPool; + } + } + + internal static bool EnsureUniquePerformanceCounterInstanceNames + { + get + { + EnsureSettingsLoaded(); + + return ensureUniquePerformanceCounterInstanceNames; + } + } + + internal static bool UseConfiguredTransportSecurityHeaderLayout + { + get + { + EnsureSettingsLoaded(); + + return useConfiguredTransportSecurityHeaderLayout; + } + } + + [SuppressMessage(FxCop.Category.ReliabilityBasic, "Reliability104:CaughtAndHandledExceptionsRule", + Justification = "Handle the configuration exceptions here to avoid regressions on customer's existing scenarios")] + static void EnsureSettingsLoaded() + { + if (!settingsInitalized) + { + lock (appSettingsLock) + { + if (!settingsInitalized) + { + NameValueCollection appSettingsSection = null; + try + { + appSettingsSection = ConfigurationManager.AppSettings; + } + catch (ConfigurationErrorsException) + { + } + finally + { + if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[HttpTransportPerFactoryConnectionPoolString], out httpTransportPerFactoryConnectionPool)) + { + httpTransportPerFactoryConnectionPool = DefaultHttpTransportPerFactoryConnectionPool; + } + + if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[EnsureUniquePerformanceCounterInstanceNamesString], out ensureUniquePerformanceCounterInstanceNames)) + { + ensureUniquePerformanceCounterInstanceNames = DefaultEnsureUniquePerformanceCounterInstanceNames; + } + + if ((appSettingsSection == null) || !bool.TryParse(appSettingsSection[UseConfiguredTransportSecurityHeaderLayoutString], out useConfiguredTransportSecurityHeaderLayout)) + { + useConfiguredTransportSecurityHeaderLayout = DefaultUseConfiguredTransportSecurityHeaderLayout; + } + + settingsInitalized = true; + } + } + } + } + } + } +} diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAttributeTargets.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAttributeTargets.cs index a509ec937b2..6e73e4d0448 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAttributeTargets.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelAttributeTargets.cs @@ -20,4 +20,4 @@ namespace System.ServiceModel public const AttributeTargets ContractBehavior = ServiceBehavior | ClientBehavior; public const AttributeTargets OperationBehavior = AttributeTargets.Method; } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs index b90c5b928ac..f8d14752a32 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/ServiceModelStrings.cs @@ -8,4 +8,4 @@ namespace System.ServiceModel public abstract int Count { get; } public abstract string this[int index] { get; } } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/SpnEndpointIdentity.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/SpnEndpointIdentity.cs index 12a1e028970..2e20f2954bd 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/SpnEndpointIdentity.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/SpnEndpointIdentity.cs @@ -60,7 +60,7 @@ namespace System.ServiceModel if (identity == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("identity"); - // PreSharp Bug: Parameter 'identity.ResourceType' to this public method must be validated: A null-dereference can occur here. + // PreSharp #pragma warning suppress 56506 // Claim.ClaimType will never return null if (!identity.ClaimType.Equals(ClaimTypes.Spn)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.UnrecognizedClaimTypeForIdentity, identity.ClaimType, ClaimTypes.Spn)); diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/StringUtil.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/StringUtil.cs new file mode 100644 index 00000000000..cb8e8ef58a2 --- /dev/null +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/StringUtil.cs @@ -0,0 +1,63 @@ +// <copyright> +// Copyright (c) Microsoft Corporation. All rights reserved. +// </copyright> +namespace System.ServiceModel +{ + internal static class StringUtil + { + private static readonly bool randomizedStringHashingEnabled; + + static StringUtil() + { + // StringComparer.InvariantCultureIgnoreCase.GetHashCode is a stable hash between 32 and 64 bits. + // Test the result of this GetHashCode against a known test vector to see if randomized hashing is enabled. + randomizedStringHashingEnabled = StringComparer.InvariantCultureIgnoreCase.GetHashCode("The quick brown fox jumps over the lazy dog.") != 0x703e662e; + } + + // This should be used instead of String.GetHashCode if the value should be + // stable even if UseRandomizedStringHashing is enabled. + internal static int GetNonRandomizedHashCode(string str) + { + if (!randomizedStringHashingEnabled) + { + return str.GetHashCode(); + } + + return GetStableHashCode(str); + } + + // This is copied from the 32 bit implementation from String.GetHashCode. + // Since ServiceModel is compiled for MSIL, we can't have different functionality + // for 32 and 64 bits. + [System.Security.SecuritySafeCritical] + private static int GetStableHashCode(string str) + { + unsafe + { + fixed (char* src = str) + { + int hash1 = (5381 << 16) + 5381; + int hash2 = hash1; + + // 32 bit machines. + int* pint = (int*)src; + int len = str.Length; + while (len > 2) + { + hash1 = ((hash1 << 5) + hash1 + (hash1 >> 27)) ^ pint[0]; + hash2 = ((hash2 << 5) + hash2 + (hash2 >> 27)) ^ pint[1]; + pint += 2; + len -= 4; + } + + if (len > 0) + { + hash1 = ((hash1 << 5) + hash1 + (hash1 >> 27)) ^ pint[0]; + } + + return hash1 + (hash2 * 1566083941); + } + } + } + } +} diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs index 2b294d1acec..a7bfdc2a440 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Syndication/Rss20FeedFormatter.cs @@ -502,9 +502,8 @@ namespace System.ServiceModel.Syndication } } } - reader.ReadStartElement(); - link.Uri = new Uri(reader.ReadString(), UriKind.RelativeOrAbsolute); - reader.ReadEndElement(); + string uri = reader.ReadElementString(); + link.Uri = new Uri(uri, UriKind.RelativeOrAbsolute); return link; } @@ -655,10 +654,17 @@ namespace System.ServiceModel.Syndication } else if (reader.IsStartElement(Rss20Constants.PubDateTag, Rss20Constants.Rss20Namespace)) { + bool canReadContent = !reader.IsEmptyElement; reader.ReadStartElement(); - string str = reader.ReadString(); - result.PublishDate = DateFromString(str, reader); - reader.ReadEndElement(); + if (canReadContent) + { + string str = reader.ReadString(); + if (!string.IsNullOrEmpty(str)) + { + result.PublishDate = DateFromString(str, reader); + } + reader.ReadEndElement(); + } } else if (reader.IsStartElement(Rss20Constants.SourceTag, Rss20Constants.Rss20Namespace)) { @@ -691,9 +697,7 @@ namespace System.ServiceModel.Syndication } } } - reader.ReadStartElement(); - string feedTitle = reader.ReadString(); - reader.ReadEndElement(); + string feedTitle = reader.ReadElementString(); feed.Title = new TextSyndicationContent(feedTitle); result.SourceFeed = feed; } @@ -947,9 +951,17 @@ namespace System.ServiceModel.Syndication } else if (reader.IsStartElement(Rss20Constants.LastBuildDateTag, Rss20Constants.Rss20Namespace)) { + bool canReadContent = !reader.IsEmptyElement; reader.ReadStartElement(); - result.LastUpdatedTime = DateFromString(reader.ReadString(), reader); - reader.ReadEndElement(); + if (canReadContent) + { + string str = reader.ReadString(); + if (!string.IsNullOrEmpty(str)) + { + result.LastUpdatedTime = DateFromString(str, reader); + } + reader.ReadEndElement(); + } } else if (reader.IsStartElement(Rss20Constants.CategoryTag, Rss20Constants.Rss20Namespace)) { @@ -1112,7 +1124,7 @@ namespace System.ServiceModel.Syndication // if there's a single author with an email address, then serialize as the managingEditor // else serialize the authors as Atom extensions -#pragma warning disable 56506 // [....]: this.Feed.Authors is never null +#pragma warning disable 56506 // Microsoft: this.Feed.Authors is never null if ((this.Feed.Authors.Count == 1) && (this.Feed.Authors[0].Email != null)) #pragma warning restore 56506 { @@ -1137,7 +1149,7 @@ namespace System.ServiceModel.Syndication writer.WriteEndElement(); } -#pragma warning disable 56506 // [....]: this.Feed.Categories is never null +#pragma warning disable 56506 // Microsoft: this.Feed.Categories is never null for (int i = 0; i < this.Feed.Categories.Count; ++i) #pragma warning restore 56506 { @@ -1149,7 +1161,7 @@ namespace System.ServiceModel.Syndication writer.WriteElementString(Rss20Constants.GeneratorTag, this.Feed.Generator); } -#pragma warning disable 56506 // [....]: this.Feed.Contributors is never null +#pragma warning disable 56506 // Microsoft: this.Feed.Contributors is never null if (this.Feed.Contributors.Count > 0) #pragma warning restore 56506 { @@ -1251,7 +1263,7 @@ namespace System.ServiceModel.Syndication WriteAlternateLink(writer, firstAlternateLink, (item.BaseUri != null ? item.BaseUri : feedBaseUri)); } -#pragma warning disable 56506 // [....], item.Authors is never null +#pragma warning disable 56506 // Microsoft, item.Authors is never null if (item.Authors.Count == 1 && !string.IsNullOrEmpty(item.Authors[0].Email)) #pragma warning restore 56506 { @@ -1269,7 +1281,7 @@ namespace System.ServiceModel.Syndication } } -#pragma warning disable 56506 // [....], item.Categories is never null +#pragma warning disable 56506 // Microsoft, item.Categories is never null for (int i = 0; i < item.Categories.Count; ++i) #pragma warning restore 56506 { @@ -1397,7 +1409,7 @@ namespace System.ServiceModel.Syndication } } -#pragma warning disable 56506 // [....], item.COntributors is never null +#pragma warning disable 56506 // Microsoft, item.COntributors is never null if (item.Contributors.Count > 0) #pragma warning restore 56506 { diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/TcpTransportSecurity.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/TcpTransportSecurity.cs index af674bcdf0d..cecfed85e38 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/TcpTransportSecurity.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/TcpTransportSecurity.cs @@ -4,6 +4,7 @@ namespace System.ServiceModel { using System; + using System.Security.Authentication; using System.Security.Authentication.ExtendedProtection; using System.ServiceModel.Channels; using System.ServiceModel.Security; @@ -19,12 +20,14 @@ namespace System.ServiceModel TcpClientCredentialType clientCredentialType; ProtectionLevel protectionLevel; ExtendedProtectionPolicy extendedProtectionPolicy; + SslProtocols sslProtocols; public TcpTransportSecurity() { this.clientCredentialType = DefaultClientCredentialType; this.protectionLevel = DefaultProtectionLevel; this.extendedProtectionPolicy = ChannelBindingUtility.DefaultPolicy; + this.sslProtocols = TransportDefaults.SslProtocols; } [DefaultValue(DefaultClientCredentialType)] @@ -78,6 +81,17 @@ namespace System.ServiceModel } } + [DefaultValue(TransportDefaults.SslProtocols)] + public SslProtocols SslProtocols + { + get { return this.sslProtocols; } + set + { + SslProtocolsHelper.Validate(value); + this.sslProtocols = value; + } + } + SslStreamSecurityBindingElement CreateSslBindingElement(bool requireClientCertificate) { if (this.protectionLevel != ProtectionLevel.EncryptAndSign) @@ -88,17 +102,20 @@ namespace System.ServiceModel SslStreamSecurityBindingElement result = new SslStreamSecurityBindingElement(); result.RequireClientCertificate = requireClientCertificate; + result.SslProtocols = sslProtocols; return result; } - static bool IsSslBindingElement(BindingElement element, TcpTransportSecurity transportSecurity, out bool requireClientCertificate) + static bool IsSslBindingElement(BindingElement element, TcpTransportSecurity transportSecurity, out bool requireClientCertificate, out SslProtocols sslProtocols) { requireClientCertificate = false; + sslProtocols = TransportDefaults.SslProtocols; SslStreamSecurityBindingElement ssl = element as SslStreamSecurityBindingElement; if (ssl == null) return false; transportSecurity.ProtectionLevel = ProtectionLevel.EncryptAndSign; requireClientCertificate = ssl.RequireClientCertificate; + sslProtocols = ssl.SslProtocols; return true; } @@ -110,7 +127,8 @@ namespace System.ServiceModel internal static bool SetTransportProtectionOnly(BindingElement transport, TcpTransportSecurity transportSecurity) { bool requireClientCertificate; - return IsSslBindingElement(transport, transportSecurity, out requireClientCertificate); + SslProtocols sslProtocols; + return IsSslBindingElement(transport, transportSecurity, out requireClientCertificate, out sslProtocols); } internal BindingElement CreateTransportProtectionAndAuthentication() @@ -130,15 +148,17 @@ namespace System.ServiceModel internal static bool SetTransportProtectionAndAuthentication(BindingElement transport, TcpTransportSecurity transportSecurity) { bool requireClientCertificate = false; + SslProtocols sslProtocols = TransportDefaults.SslProtocols; if (transport is WindowsStreamSecurityBindingElement) { transportSecurity.ClientCredentialType = TcpClientCredentialType.Windows; transportSecurity.ProtectionLevel = ((WindowsStreamSecurityBindingElement)transport).ProtectionLevel; return true; } - else if (IsSslBindingElement(transport, transportSecurity, out requireClientCertificate)) + else if (IsSslBindingElement(transport, transportSecurity, out requireClientCertificate, out sslProtocols)) { transportSecurity.ClientCredentialType = requireClientCertificate ? TcpClientCredentialType.Certificate : TcpClientCredentialType.None; + transportSecurity.SslProtocols = sslProtocols; return true; } return false; @@ -148,6 +168,7 @@ namespace System.ServiceModel { return this.ClientCredentialType != TcpTransportSecurity.DefaultClientCredentialType || this.ProtectionLevel != TcpTransportSecurity.DefaultProtectionLevel + || this.SslProtocols != TransportDefaults.SslProtocols || ShouldSerializeExtendedProtectionPolicy(); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Transactions/IsolationFlags.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Transactions/IsolationFlags.cs index 927e14c6708..b4c249c4306 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Transactions/IsolationFlags.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Transactions/IsolationFlags.cs @@ -21,4 +21,4 @@ namespace System.ServiceModel.Transactions Optimistic = 0x00000010, ReadOnly = 0x00000020 } -} +}
\ No newline at end of file diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Transactions/WsatTransactionFormatter.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Transactions/WsatTransactionFormatter.cs index 737d71575ec..a70a3246731 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Transactions/WsatTransactionFormatter.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/Transactions/WsatTransactionFormatter.cs @@ -71,10 +71,10 @@ namespace System.ServiceModel.Transactions void ForcePromotion(Transaction transaction) { // Force promotion. This may throw TransactionException. - // We used to check the DistributedIdentifier property first, but VSWhidbey bug 547901 - // prevents us from doing so reliably in multi-threaded scenarios (there is a ---- - // in the System.Transactions code that can cause a NullReferenceException if we ask - // for the identifier while the transaction is being promoted) + // We used to check the DistributedIdentifier property first, but VSWhidbey + + + TransactionInterop.GetTransmitterPropagationToken(transaction); } diff --git a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/UpnEndpointIdentity.cs b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/UpnEndpointIdentity.cs index c00f1e0d9a1..5ea26cb17f4 100644 --- a/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/UpnEndpointIdentity.cs +++ b/mcs/class/referencesource/System.ServiceModel/System/ServiceModel/UpnEndpointIdentity.cs @@ -38,7 +38,7 @@ namespace System.ServiceModel if (identity == null) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("identity"); - // PreSharp Bug: Parameter 'identity.ResourceType' to this public method must be validated: A null-dereference can occur here. + // PreSharp #pragma warning suppress 56506 // Claim.ResourceType will never return null if (!identity.ClaimType.Equals(ClaimTypes.Upn)) throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgument(SR.GetString(SR.UnrecognizedClaimTypeForIdentity, identity.ClaimType, ClaimTypes.Upn)); |