diff --git a/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/Factory.cpp b/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/Factory.cpp index 9c9ebadd..f96c3456 100644 --- a/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/Factory.cpp +++ b/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/Factory.cpp @@ -92,9 +92,6 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface _pFactory = (IDWriteFactory*)factoryTemp; } - #pragma warning (disable : 4950) // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency::WillNotCorruptState, Cer::Success)] - #pragma warning (default : 4950) // The Constrained Execution Region (CER) feature is not supported. __declspec(noinline) bool Factory::ReleaseHandle() { if (_wpfFontCollectionLoader != nullptr) diff --git a/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/Factory.h b/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/Factory.h index d9b5ec75..894c1e92 100644 --- a/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/Factory.h +++ b/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/Factory.h @@ -79,9 +79,6 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface protected: - #pragma warning (disable : 4950) // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency::WillNotCorruptState, Cer::Success)] - #pragma warning (default : 4950) // The Constrained Execution Region (CER) feature is not supported. virtual bool ReleaseHandle() override; internal: diff --git a/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/NativePointerWrapper.h b/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/NativePointerWrapper.h index 82fa5925..a1dafcd6 100644 --- a/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/NativePointerWrapper.h +++ b/src/Microsoft.DotNet.Wpf/src/DirectWriteForwarder/CPP/DWriteWrapper/NativePointerWrapper.h @@ -19,10 +19,7 @@ namespace MS { namespace Internal { namespace Text { namespace TextInterface { n NativePointerCriticalHandle(void* pNativePointer); virtual property bool IsInvalid - { - #pragma warning (disable : 4950) // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency::WillNotCorruptState, Cer::Success)] - #pragma warning (default : 4950) // The Constrained Execution Region (CER) feature is not supported. + { bool get() override; } diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsTablet.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsTablet.cs index 95c47a36..ecd3d791 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsTablet.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/MS/Win32/UnsafeNativeMethodsTablet.cs @@ -84,19 +84,13 @@ namespace MS.Win32.Recognizer // Do not provide a finalizer - SafeHandle's critical finalizer will // call ReleaseHandle for you. public override bool IsInvalid - { - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + { get { return IsClosed || handle == IntPtr.Zero; } } - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. override protected bool ReleaseHandle() { Debug.Assert(handle != IntPtr.Zero); @@ -126,19 +120,12 @@ namespace MS.Win32.Recognizer // call ReleaseHandle for you. public override bool IsInvalid { - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. get { return IsClosed || handle == IntPtr.Zero; } } - - - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + override protected bool ReleaseHandle() { //Note: It is not an error to have already called DestroyRecognizer diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/UnsafeNativeMethodsMilCoreApi.cs b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/UnsafeNativeMethodsMilCoreApi.cs index d196d310..28a50c5b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/UnsafeNativeMethodsMilCoreApi.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/UnsafeNativeMethodsMilCoreApi.cs @@ -524,9 +524,7 @@ namespace MS.Win32.PresentationCore [DllImport(DllImport.MilCore, EntryPoint = "MILAddRef")] internal static extern UInt32 AddRef(SafeReversePInvokeWrapper pIUnknown); - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [DllImport(DllImport.MilCore, EntryPoint = "MILRelease"), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + [DllImport(DllImport.MilCore, EntryPoint = "MILRelease")] internal static extern int Release(IntPtr pIUnkown); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/AssemblyFilter.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/AssemblyFilter.cs index 4c8d9bd7..2488be41 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/AssemblyFilter.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/AssemblyFilter.cs @@ -37,40 +37,7 @@ namespace MS.Internal internal void FilterCallback(Object sender, AssemblyLoadEventArgs args) { - // This code is reentrant - lock (_lock) - { - // Extract assembly - Assembly a = args.LoadedAssembly; - // xmlns cache loads assemblies as reflection only and we cannot inspect these using the code below - // so we ignore also keeping this first is super important because the first time cost is really high - // other wise also we cannot do any processing on a reflection only assembly aside from reflection based actions - if (!a.ReflectionOnly) - { - // check if it is in the Gac , this ensures that we eliminate any non GAC assembly which are of no risk - #pragma warning disable SYSLIB0005 // 'Assembly.GlobalAssemblyCache' is obsolete. - if (a.GlobalAssemblyCache) - #pragma warning restore SYSLIB0005 // 'Assembly.GlobalAssemblyCache' is obsolete. - { - string assemblyName = AssemblyNameWithFileVersion(a); - // If we are on the disallowed list kill the application domain - if (AssemblyOnDisallowedList(assemblyName)) - { - // Kill the application domain - UnsafeNativeMethods.ProcessUnhandledException_DLL(SR.Get(SRID.KillBitEnforcedShutdown) + assemblyName); - // I want to ensure that the process really dies - try - { - System.Environment.Exit(-1); - } - finally - { - Debug.Fail("Environment.Exit() failed."); - } - } - } - } - } + /* This method no longer applies to .NET Core and should be removed. */ } //appends assembly name with file version to generate a unique entry for the assembly lookup process diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/ResourceContainer.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/ResourceContainer.cs index 7c461f5a..3e418a4d 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/ResourceContainer.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/AppModel/ResourceContainer.cs @@ -252,9 +252,7 @@ namespace MS.Internal.AppModel // We do not care about assemblies loaded into the reflection-only context or the Gaced assemblies. // For example, in Sparkle whenever a project is built all dependent assemblies will be loaded reflection only. // We do no care about those. Only when a assembly is loaded into the execution context, we will need to update the cache. - #pragma warning disable SYSLIB0005 // 'Assembly.GlobalAssemblyCache' is obsolete. - if ((!assembly.ReflectionOnly) && (!assembly.GlobalAssemblyCache)) - #pragma warning restore SYSLIB0005 // 'Assembly.GlobalAssemblyCache' is obsolete. + if ((!assembly.ReflectionOnly)) { AssemblyName assemblyInfo = new AssemblyName(assembly.FullName); diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlTypeMapper.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlTypeMapper.cs index d5641775..f14626a3 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlTypeMapper.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XamlTypeMapper.cs @@ -229,9 +229,11 @@ namespace System.Windows.Markup // so they can be loaded again. The is the Dev build/load/build/load // Designer scenario. (Don't mess with GACed assemblies) Assembly assem = ReflectionHelper.GetAlreadyLoadedAssembly(asmName); - #pragma warning disable SYSLIB0005 // 'Assembly.GlobalAssemblyCache' is obsolete. - if (assem != null && !assem.GlobalAssemblyCache) - #pragma warning restore SYSLIB0005 // 'Assembly.GlobalAssemblyCache' is obsolete. + if (assem != null +#if NETFX + && !assem.GlobalAssemblyCache +#endif + ) { ReflectionHelper.ResetCacheForAssembly(asmName); // No way to reset SchemaContext at assembly granularity, so just reset the whole context diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Standard/NativeMethods.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Standard/NativeMethods.cs index 31d01e80..84feae55 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Standard/NativeMethods.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Standard/NativeMethods.cs @@ -1389,9 +1389,6 @@ namespace Standard private SafeDC() : base(true) { } - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. protected override bool ReleaseHandle() { if (_created) @@ -1514,9 +1511,6 @@ namespace Standard { private SafeHBITMAP() : base(true) { } - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. protected override bool ReleaseHandle() { return NativeMethods.DeleteObject(handle); @@ -1527,9 +1521,6 @@ namespace Standard { private SafeGdiplusStartupToken() : base(true) { } - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. protected override bool ReleaseHandle() { Status s = NativeMethods.GdiplusShutdown(this.handle); @@ -1598,9 +1589,7 @@ namespace Standard } [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + protected override bool ReleaseHandle() { try @@ -2665,9 +2654,7 @@ namespace Standard [SuppressMessage("Mricrosoft.Performance", "CA1811:AvoidUncalledPrivateCode")] [DllImport("kernel32.dll")] - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + [return: MarshalAs(UnmanagedType.Bool)] public static extern bool FindClose(IntPtr handle); diff --git a/src/Microsoft.DotNet.Wpf/src/ReachFramework/MS/Internal/Printing/Configuration/UnsafeNativeMethods.cs b/src/Microsoft.DotNet.Wpf/src/ReachFramework/MS/Internal/Printing/Configuration/UnsafeNativeMethods.cs index b8e093eb..9f41573e 100644 --- a/src/Microsoft.DotNet.Wpf/src/ReachFramework/MS/Internal/Printing/Configuration/UnsafeNativeMethods.cs +++ b/src/Microsoft.DotNet.Wpf/src/ReachFramework/MS/Internal/Printing/Configuration/UnsafeNativeMethods.cs @@ -75,9 +75,7 @@ namespace MS.Internal.Printing.Configuration /// device handle proxy has been bound to /// HRESULT code [DllImport(DllImport.PrntvPt, EntryPoint = "PTCloseProvider", CharSet = CharSet.Unicode, ExactSpelling = true)] - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + public static extern uint PTCloseProviderImpl(IntPtr handle); /// diff --git a/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/FallbackPTProvider.cs b/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/FallbackPTProvider.cs index 64c33995..a905a7ac 100644 --- a/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/FallbackPTProvider.cs +++ b/src/Microsoft.DotNet.Wpf/src/ReachFramework/PrintConfig/FallbackPTProvider.cs @@ -399,9 +399,7 @@ namespace MS.Internal.Printing.Configuration CultureInfo.InvariantCulture, DeviceNamespaceFormat, BuildInfo.WCP_VERSION_SUFFIX, - #pragma warning disable SYSLIB0013 - Uri.EscapeUriString(this._driverName), - #pragma warning restore SYSLIB0013 + Uri.EscapeDataString(this._driverName), this._driverVersion); } diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/ReaderWriterLockWrapper.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/ReaderWriterLockWrapper.cs index 12ab606c..52c4b02b 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/ReaderWriterLockWrapper.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Internal/ReaderWriterLockWrapper.cs @@ -299,9 +299,7 @@ namespace MS.Internal /// /// Wait for a set of handles. /// - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [PrePrepareMethod] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) { return MS.Win32.UnsafeNativeMethods.WaitForMultipleObjectsEx(waitHandles.Length, waitHandles, waitAll, millisecondsTimeout, false); diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/NativeMethodsOther.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/NativeMethodsOther.cs index 3c759380..3c0f89d6 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/NativeMethodsOther.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/NativeMethodsOther.cs @@ -258,9 +258,7 @@ namespace MS.Win32 private BitmapHandle(bool ownsHandle) : base(ownsHandle, NativeMethods.CommonHandles.GDI) { } - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + protected override bool ReleaseHandle() { return UnsafeNativeMethods.DeleteObject(handle); @@ -285,10 +283,7 @@ namespace MS.Win32 private IconHandle() : base(true, NativeMethods.CommonHandles.Icon) { } - - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + protected override bool ReleaseHandle() { return UnsafeNativeMethods.DestroyIcon(handle); @@ -314,9 +309,6 @@ namespace MS.Win32 { } - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. protected override bool ReleaseHandle() { return UnsafeNativeMethods.DestroyCursor( handle ); @@ -594,9 +586,6 @@ namespace MS.Win32 return (LocalFree(base.handle) == IntPtr.Zero); } - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. [DllImport("kernel32.dll")] private static extern IntPtr LocalFree(IntPtr hMem); } diff --git a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/UnsafeNativeMethodsOther.cs b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/UnsafeNativeMethodsOther.cs index c2742049..5f0d758f 100644 --- a/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/UnsafeNativeMethodsOther.cs +++ b/src/Microsoft.DotNet.Wpf/src/Shared/MS/Win32/UnsafeNativeMethodsOther.cs @@ -170,9 +170,7 @@ namespace MS.Win32 /// /// /// - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [DllImport(ExternDll.Kernel32, SetLastError = true), ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + [DllImport(ExternDll.Kernel32, SetLastError = true)] internal static extern IntPtr LocalFree(IntPtr hMem); #if BASE_NATIVEMETHODS @@ -638,9 +636,7 @@ namespace MS.Win32 } } [DllImport(ExternDll.User32, EntryPoint = "GetIconInfo", CharSet = CharSet.Auto, SetLastError = true)] - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + private static extern bool GetIconInfoImpl(HandleRef hIcon, [Out] ICONINFO_IMPL piconinfo); [StructLayout(LayoutKind.Sequential)] @@ -664,9 +660,6 @@ namespace MS.Win32 piconinfo = new NativeMethods.ICONINFO(); ICONINFO_IMPL iconInfoImpl = new ICONINFO_IMPL(); - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - SRCS.RuntimeHelpers.PrepareConstrainedRegions(); // Mark the following as special - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. try { // Intentionally empty diff --git a/src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/inc/GDIExporter/precomp.hpp b/src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/inc/GDIExporter/precomp.hpp index 7c9e5da8..e1705bbb 100644 --- a/src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/inc/GDIExporter/precomp.hpp +++ b/src/Microsoft.DotNet.Wpf/src/System.Printing/CPP/inc/GDIExporter/precomp.hpp @@ -2,9 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -// Turn off CER warnings: The Constrained Execution Region (CER) feature is not supported. -#pragma warning (disable : 4950) - #ifndef GDIEXPORTER #define GDIEXPORTER @@ -101,12 +98,10 @@ public: property bool IsInvalid { - [ReliabilityContract(Consistency::WillNotCorruptState, Cer::Success)] bool virtual get() override { return IsClosed || (handle == IntPtr::Zero); } } protected: - [ReliabilityContract(Consistency::WillNotCorruptState, Cer::Success)] bool virtual ReleaseHandle() override { IntPtr tempHandle = handle; @@ -140,7 +135,6 @@ public: #endif protected: - [ReliabilityContract(Consistency::WillNotCorruptState, Cer::Success)] bool virtual ReleaseHandle() override { IntPtr tempHandle = handle; @@ -168,7 +162,6 @@ public: property bool IsInvalid { - [ReliabilityContract(Consistency::WillNotCorruptState, Cer::Success)] bool virtual get() override { return IsClosed || (handle == IntPtr::Zero); } } @@ -181,7 +174,6 @@ public: } protected: - [ReliabilityContract(Consistency::WillNotCorruptState, Cer::Success)] bool virtual ReleaseHandle() override { IntPtr tempHandle = handle; diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Misc.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Misc.cs index 05079bee..f15e0bad 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Misc.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/MS/Internal/Automation/Misc.cs @@ -503,9 +503,6 @@ namespace MS.Internal.Automation } else { - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - RuntimeHelpers.PrepareConstrainedRegions(); - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. bool fRelease = false; try { diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/Condition.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/Condition.cs index 7c556809..0c39c90b 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/Condition.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClient/System/Windows/Automation/Condition.cs @@ -44,9 +44,6 @@ namespace System.Windows.Automation SafeConditionMemoryHandle sh = new SafeConditionMemoryHandle(); int size = Marshal.SizeOf(uiaCondition); - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - RuntimeHelpers.PrepareConstrainedRegions(); // ensures that the following finally block is atomic - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. try { } finally { @@ -66,9 +63,6 @@ namespace System.Windows.Automation int intPtrSize = Marshal.SizeOf(typeof(IntPtr)); - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - RuntimeHelpers.PrepareConstrainedRegions(); // ensures that the following finally block is atomic - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. try { } finally { diff --git a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/Misc.cs b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/Misc.cs index e4bb2cdb..be975199 100644 --- a/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/Misc.cs +++ b/src/Microsoft.DotNet.Wpf/src/UIAutomation/UIAutomationClientSideProviders/MS/Internal/AutomationProxies/Misc.cs @@ -995,9 +995,6 @@ namespace MS.Internal.AutomationProxies } else { - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - RuntimeHelpers.PrepareConstrainedRegions(); - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. bool fRelease = false; try { diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/DispatcherSynchronizationContext.cs b/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/DispatcherSynchronizationContext.cs index 919666ed..87f8dc45 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/DispatcherSynchronizationContext.cs +++ b/src/Microsoft.DotNet.Wpf/src/WindowsBase/System/Windows/Threading/DispatcherSynchronizationContext.cs @@ -89,9 +89,6 @@ namespace System.Windows.Threading /// /// Wait for a set of handles. /// - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [PrePrepareMethod] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. public override int Wait(IntPtr[] waitHandles, bool waitAll, int millisecondsTimeout) { if(_dispatcher._disableProcessingCount > 0) diff --git a/src/Microsoft.DotNet.Wpf/src/WindowsFormsIntegration/MS/Win32/UnsafeNativeMethods.cs b/src/Microsoft.DotNet.Wpf/src/WindowsFormsIntegration/MS/Win32/UnsafeNativeMethods.cs index 4ae49489..e019bca1 100644 --- a/src/Microsoft.DotNet.Wpf/src/WindowsFormsIntegration/MS/Win32/UnsafeNativeMethods.cs +++ b/src/Microsoft.DotNet.Wpf/src/WindowsFormsIntegration/MS/Win32/UnsafeNativeMethods.cs @@ -52,9 +52,7 @@ namespace MS.Win32 } [DllImport(ExternDll.Gdi32, ExactSpelling = true, CharSet = CharSet.Auto)] - #pragma warning disable SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. - [ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)] - #pragma warning restore SYSLIB0004 // The Constrained Execution Region (CER) feature is not supported. + [ResourceExposure(ResourceScope.None)] public static extern bool DeleteDC(IntPtr hDC); }