From 988333633a7abe8fd8ed7a9bce54857eab15e388 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Thu, 29 Jul 2021 16:08:22 -0700 Subject: [PATCH 1/9] Remove the SupportedOSPlatform attribute from the ComWrappers API. --- .../src/System/Runtime/InteropServices/ComWrappers.cs | 1 + .../src/System/Runtime/InteropServices/ComWrappers.cs | 1 - .../ref/System.Runtime.InteropServices.cs | 2 +- src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt | 3 ++- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index 8538e63c06880..a6351198a2c59 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -300,6 +300,7 @@ public static void RegisterForTrackerSupport(ComWrappers instance) /// * P/Invokes with COM-related types /// * COM activation /// + [SupportedOSPlatform("windows")] public static void RegisterForMarshalling(ComWrappers instance) { if (instance == null) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index 72019f3d833cc..4171b7cb9f842 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -69,7 +69,6 @@ public enum CreateObjectFlags /// /// Class for managing wrappers of COM IUnknown types. /// - [SupportedOSPlatform("windows")] [CLSCompliant(false)] public abstract partial class ComWrappers { diff --git a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs index e6c03d03d2418..4ee5fcaf1a949 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -1125,7 +1125,6 @@ public enum CreateObjectFlags Aggregation = 4, Unwrap = 8, } - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.CLSCompliantAttribute(false)] public abstract class ComWrappers { @@ -1147,6 +1146,7 @@ public struct ComInterfaceDispatch public object GetOrRegisterObjectForComInstance(System.IntPtr externalComObject, CreateObjectFlags flags, object wrapper, System.IntPtr inner) { throw null; } protected abstract void ReleaseObjects(System.Collections.IEnumerable objects); public static void RegisterForTrackerSupport(ComWrappers instance) { } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void RegisterForMarshalling(ComWrappers instance) { } protected static void GetIUnknownImpl(out System.IntPtr fpQueryInterface, out System.IntPtr fpAddRef, out System.IntPtr fpRelease) { throw null; } } diff --git a/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt b/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt index 54945167821c8..8544cfdc67913 100644 --- a/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt +++ b/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt @@ -167,6 +167,7 @@ Compat issues with assembly System.Runtime.InteropServices: CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.AddRef(System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.QueryInterface(System.IntPtr, System.Guid, System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.Release(System.IntPtr)' in the contract but not the implementation. +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.ComWrappers' in the contract but not the implementation. Compat issues with assembly System.Security.Cryptography.Algorithms: CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.CryptoConfig' in the contract but not the implementation. Compat issues with assembly System.Threading.Tasks.Extensions: @@ -185,4 +186,4 @@ CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatfo CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Text.Json.Serialization.JsonConverterAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=false)]' in the implementation. -Total Issues: 171 +Total Issues: 172 From df278421323b08e2d6631a02fd87a9ddf37aa224 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Thu, 29 Jul 2021 17:20:53 -0700 Subject: [PATCH 2/9] Test the Marshal.QueryInterface, Marshal.AddRef, and Marshal.Release using ComWrappers. --- ...ystem.Runtime.InteropServices.Tests.csproj | 1 + .../InteropServices/Marshal/AddRefTests.cs | 5 +- .../Marshal/Common/COMWrappersImpl.cs | 42 ++++++++++ .../Marshal/QueryInterfaceTests.Windows.cs | 34 ++++++++- .../Marshal/QueryInterfaceTests.cs | 76 +++---------------- .../InteropServices/Marshal/ReleaseTests.cs | 5 +- 6 files changed, 90 insertions(+), 73 deletions(-) create mode 100644 src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj index f0ffe70d47c31..5235b8023a63d 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.Tests.csproj @@ -137,6 +137,7 @@ + diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AddRefTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AddRefTests.cs index c8cd89168b352..3008f13c56ceb 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AddRefTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AddRefTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.InteropServices.Tests.Common; using Xunit; namespace System.Runtime.InteropServices.Tests @@ -8,10 +9,10 @@ namespace System.Runtime.InteropServices.Tests public class AddRefTests { [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void AddRef_ValidPointer_Success() { - IntPtr iUnknown = Marshal.GetIUnknownForObject(new object()); + var cw = new ComWrappersImpl(); + IntPtr iUnknown = cw.GetOrCreateComInterfaceForObject(new object(), CreateComInterfaceFlags.None); try { Assert.Equal(2, Marshal.AddRef(iUnknown)); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs new file mode 100644 index 0000000000000..31f7264d8a5e6 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs @@ -0,0 +1,42 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections; +using System.Runtime.CompilerServices; +using Xunit; + +namespace System.Runtime.InteropServices.Tests.Common +{ + public class ComWrappersImpl : ComWrappers + { + public const string IID_TestQueryInterface = "1F906666-B388-4729-B78C-826BC5FD4245"; + + protected unsafe override ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count) + { + Assert.Equal(CreateComInterfaceFlags.None, flags); + + IntPtr fpQueryInterface = default; + IntPtr fpAddRef = default; + IntPtr fpRelease = default; + ComWrappers.GetIUnknownImpl(out fpQueryInterface, out fpAddRef, out fpRelease); + + var vtblRaw = (IntPtr*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(ComWrappersImpl), IntPtr.Size * 3); + vtblRaw[0] = fpQueryInterface; + vtblRaw[1] = fpAddRef; + vtblRaw[2] = fpRelease; + + var entryRaw = (ComInterfaceEntry*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(ComWrappersImpl), sizeof(ComInterfaceEntry)); + entryRaw->IID = new Guid(IID_TestQueryInterface); + entryRaw->Vtable = (IntPtr)vtblRaw; + + count = 1; + return entryRaw; + } + + protected override object CreateObject(IntPtr externalComObject, CreateObjectFlags flag) + => throw new NotImplementedException(); + + protected override void ReleaseObjects(IEnumerable objects) + => throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.Windows.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.Windows.cs index 30657253cc824..74ffdaad3b2db 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.Windows.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.Windows.cs @@ -9,6 +9,7 @@ namespace System.Runtime.InteropServices.Tests { public partial class QueryInterfaceTests { + public const string IID_IDISPATCH = "00020400-0000-0000-C000-000000000046"; public const string IID_IINSPECTABLE = "AF86E2E0-B12D-4c6a-9C5A-D7AA65101E90"; public static IEnumerable QueryInterface_ValidComObjectInterface_TestData() @@ -45,7 +46,25 @@ public static IEnumerable QueryInterface_ValidComObjectInterface_TestD [MemberData(nameof(QueryInterface_ValidComObjectInterface_TestData))] public void QueryInterface_ValidComObjectInterface_Success(object o, string iidString) { - QueryInterface_ValidInterface_Success(o, iidString); + IntPtr ptr = Marshal.GetIUnknownForObject(o); + try + { + Guid guid = new Guid(iidString); + Assert.Equal(0, Marshal.QueryInterface(ptr, ref guid, out IntPtr ppv)); + Assert.NotEqual(IntPtr.Zero, ppv); + try + { + Assert.Equal(new Guid(iidString), guid); + } + finally + { + Marshal.Release(ppv); + } + } + finally + { + Marshal.Release(ptr); + } } public static IEnumerable QueryInterface_NoSuchComObjectInterface_TestData() @@ -83,7 +102,18 @@ public static IEnumerable QueryInterface_NoSuchComObjectInterface_Test [MemberData(nameof(QueryInterface_NoSuchComObjectInterface_TestData))] public void QueryInterface_NoSuchComObjectInterface_Success(object o, string iidString) { - QueryInterface_NoSuchInterface_Success(o, iidString); + IntPtr ptr = Marshal.GetIUnknownForObject(o); + try + { + Guid iid = new Guid(iidString); + Assert.Equal(E_NOINTERFACE, Marshal.QueryInterface(ptr, ref iid, out IntPtr ppv)); + Assert.Equal(IntPtr.Zero, ppv); + Assert.Equal(new Guid(iidString), iid); + } + finally + { + Marshal.Release(ptr); + } } } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs index fbb7ca8c0fa6b..ab5ddf9d02371 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs @@ -12,71 +12,27 @@ public partial class QueryInterfaceTests { public const int E_NOINTERFACE = unchecked((int)0x80004002); public const string IID_IUNKNOWN = "00000000-0000-0000-C000-000000000046"; - public const string IID_IDISPATCH = "00020400-0000-0000-C000-000000000046"; public static IEnumerable QueryInterface_ValidInterface_TestData() { yield return new object[] { new object(), IID_IUNKNOWN }; - yield return new object[] { new object(), IID_IDISPATCH }; - - yield return new object[] { 10, IID_IUNKNOWN }; - if (!PlatformDetection.IsNetCore) - { - yield return new object[] { 10, IID_IDISPATCH }; - } - - yield return new object[] { "string", IID_IUNKNOWN }; - if (!PlatformDetection.IsNetCore) - { - yield return new object[] { "string", IID_IDISPATCH }; - } - - yield return new object[] { new NonGenericClass(), IID_IUNKNOWN }; - if (!PlatformDetection.IsNetCore) - { - yield return new object[] { new NonGenericClass(), IID_IDISPATCH }; - } - yield return new object[] { new GenericClass(), IID_IUNKNOWN }; - - yield return new object[] { new NonGenericStruct(), IID_IUNKNOWN }; - if (!PlatformDetection.IsNetCore) - { - yield return new object[] { new NonGenericStruct(), IID_IDISPATCH }; - } - yield return new object[] { new GenericStruct(), IID_IUNKNOWN }; - - yield return new object[] { Int32Enum.Value1, IID_IUNKNOWN }; - if (!PlatformDetection.IsNetCore) - { - yield return new object[] { Int32Enum.Value1, IID_IDISPATCH }; - } - - yield return new object[] { new int[] { 10 }, IID_IUNKNOWN }; - yield return new object[] { new int[][] { new int[] { 10 } }, IID_IUNKNOWN }; - yield return new object[] { new int[,] { { 10 } }, IID_IUNKNOWN }; - - MethodInfo method = typeof(GetObjectForIUnknownTests).GetMethod(nameof(NonGenericMethod), BindingFlags.NonPublic | BindingFlags.Static); - Delegate d = method.CreateDelegate(typeof(NonGenericDelegate)); - yield return new object[] { d, IID_IUNKNOWN }; - yield return new object[] { d, IID_IDISPATCH }; - - yield return new object[] { new KeyValuePair("key", 10), IID_IUNKNOWN }; + yield return new object[] { new object(), ComWrappersImpl.IID_TestQueryInterface }; } [Theory] [MemberData(nameof(QueryInterface_ValidInterface_TestData))] - [PlatformSpecific(TestPlatforms.Windows)] - public void QueryInterface_ValidInterface_Success(object o, string guid) + public void QueryInterface_ValidInterface_Success(object o, string iidString) { - IntPtr ptr = Marshal.GetIUnknownForObject(o); + var cw = new ComWrappersImpl(); + IntPtr ptr = cw.GetOrCreateComInterfaceForObject(o, CreateComInterfaceFlags.None); try { - Guid iidString = new Guid(guid); - Assert.Equal(0, Marshal.QueryInterface(ptr, ref iidString, out IntPtr ppv)); + Guid guid = new Guid(iidString); + Assert.Equal(0, Marshal.QueryInterface(ptr, ref guid, out IntPtr ppv)); Assert.NotEqual(IntPtr.Zero, ppv); try { - Assert.Equal(new Guid(guid), iidString); + Assert.Equal(new Guid(iidString), guid); } finally { @@ -93,23 +49,14 @@ public static IEnumerable QueryInterface_NoSuchInterface_TestData() { yield return new object[] { new object(), Guid.Empty.ToString() }; yield return new object[] { new object(), "927971f5-0939-11d1-8be1-00c04fd8d503" }; - - yield return new object[] { new int[] { 10 }, IID_IDISPATCH }; - yield return new object[] { new int[][] { new int[] { 10 } }, IID_IDISPATCH }; - yield return new object[] { new int[,] { { 10 } }, IID_IDISPATCH }; - - yield return new object[] { new GenericClass(), IID_IDISPATCH }; - yield return new object[] { new Dictionary(), IID_IDISPATCH }; - yield return new object[] { new GenericStruct(), IID_IDISPATCH }; - yield return new object[] { new KeyValuePair(), IID_IDISPATCH }; } [Theory] [MemberData(nameof(QueryInterface_NoSuchInterface_TestData))] - [PlatformSpecific(TestPlatforms.Windows)] public void QueryInterface_NoSuchInterface_Success(object o, string iidString) { - IntPtr ptr = Marshal.GetIUnknownForObject(o); + var cw = new ComWrappersImpl(); + IntPtr ptr = cw.GetOrCreateComInterfaceForObject(o, CreateComInterfaceFlags.None); try { Guid iid = new Guid(iidString); @@ -129,10 +76,5 @@ public void QueryInterface_ZeroPointer_ThrowsArgumentNullException() Guid iid = Guid.Empty; AssertExtensions.Throws("pUnk", () => Marshal.QueryInterface(IntPtr.Zero, ref iid, out IntPtr ppv)); } - - private static void NonGenericMethod(int i) { } - public delegate void NonGenericDelegate(int i); - - public enum Int32Enum : int { Value1, Value2 } } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/ReleaseTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/ReleaseTests.cs index 211270c699578..5f4dc65a34c02 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/ReleaseTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/ReleaseTests.cs @@ -1,6 +1,7 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.InteropServices.Tests.Common; using Xunit; namespace System.Runtime.InteropServices.Tests @@ -8,10 +9,10 @@ namespace System.Runtime.InteropServices.Tests public class ReleaseTests { [Fact] - [PlatformSpecific(TestPlatforms.Windows)] public void Release_ValidPointer_Success() { - IntPtr iUnknown = Marshal.GetIUnknownForObject(new object()); + var cw = new ComWrappersImpl(); + IntPtr iUnknown = cw.GetOrCreateComInterfaceForObject(new object(), CreateComInterfaceFlags.None); try { Marshal.AddRef(iUnknown); From e1825f7e1e2af95f3ab69ab38398174a5081011f Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Thu, 29 Jul 2021 17:48:33 -0700 Subject: [PATCH 3/9] Update ApiCompat baseline. Add message on how to update ApiCompat baseline if needed. --- src/libraries/shims/ApiCompat.proj | 2 +- .../shims/ApiCompatBaseline.PreviousNetCoreApp.txt | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libraries/shims/ApiCompat.proj b/src/libraries/shims/ApiCompat.proj index 9885f574fc6d8..d459f9a4de837 100644 --- a/src/libraries/shims/ApiCompat.proj +++ b/src/libraries/shims/ApiCompat.proj @@ -107,7 +107,7 @@ - + diff --git a/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt b/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt index 8544cfdc67913..69f17447741d8 100644 --- a/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt +++ b/src/libraries/shims/ApiCompatBaseline.PreviousNetCoreApp.txt @@ -89,6 +89,8 @@ CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Ru CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.AddRef(System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.QueryInterface(System.IntPtr, System.Guid, System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.Release(System.IntPtr)' in the contract but not the implementation. +CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. +CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.CryptoConfig' in the contract but not the implementation. Compat issues with assembly System: CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerAttribute' on 'System.ComponentModel.IComponent' changed from '[DesignerAttribute("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]' in the contract to '[DesignerAttribute("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]' in the implementation. @@ -164,14 +166,14 @@ CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Ru CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Runtime.Versioning.SupportedOSPlatformAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Constructor | AttributeTargets.Enum | AttributeTargets.Event | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Module | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]' in the implementation. Compat issues with assembly System.Runtime.InteropServices: +CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.ComWrappers' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.AddRef(System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.QueryInterface(System.IntPtr, System.Guid, System.IntPtr)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.Marshal.Release(System.IntPtr)' in the contract but not the implementation. -CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.SupportedOSPlatformAttribute' exists on 'System.Runtime.InteropServices.ComWrappers' in the contract but not the implementation. Compat issues with assembly System.Security.Cryptography.Algorithms: +CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. +CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. CannotRemoveAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' exists on 'System.Security.Cryptography.CryptoConfig' in the contract but not the implementation. -Compat issues with assembly System.Threading.Tasks.Extensions: -CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Runtime.CompilerServices.AsyncMethodBuilderAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]' in the implementation. Compat issues with assembly System.Text.Json: CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' exists on parameter 'returnType' on member 'System.Text.Json.JsonSerializer.Deserialize(System.ReadOnlySpan, System.Type, System.Text.Json.JsonSerializerOptions)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' exists on parameter 'returnType' on member 'System.Text.Json.JsonSerializer.Deserialize(System.String, System.Type, System.Text.Json.JsonSerializerOptions)' in the contract but not the implementation. @@ -181,9 +183,7 @@ CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAc CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' exists on parameter 'inputType' on member 'System.Text.Json.JsonSerializer.Serialize(System.Text.Json.Utf8JsonWriter, System.Object, System.Type, System.Text.Json.JsonSerializerOptions)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' exists on parameter 'inputType' on member 'System.Text.Json.JsonSerializer.SerializeAsync(System.IO.Stream, System.Object, System.Type, System.Text.Json.JsonSerializerOptions, System.Threading.CancellationToken)' in the contract but not the implementation. CannotRemoveAttribute : Attribute 'System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute' exists on parameter 'inputType' on member 'System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(System.Object, System.Type, System.Text.Json.JsonSerializerOptions)' in the contract but not the implementation. -CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. -CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. -CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesCcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. -CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Security.Cryptography.AesGcm' changed from '[UnsupportedOSPlatformAttribute("browser")]' in the contract to '[UnsupportedOSPlatformAttribute("browser")]' in the implementation. CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Text.Json.Serialization.JsonConverterAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Enum | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Property | AttributeTargets.Struct, AllowMultiple=false)]' in the implementation. +Compat issues with assembly System.Threading.Tasks.Extensions: +CannotChangeAttribute : Attribute 'System.AttributeUsageAttribute' on 'System.Runtime.CompilerServices.AsyncMethodBuilderAttribute' changed from '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]' in the contract to '[AttributeUsageAttribute(AttributeTargets.Class | AttributeTargets.Delegate | AttributeTargets.Enum | AttributeTargets.Interface | AttributeTargets.Method | AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]' in the implementation. Total Issues: 172 From 455641a6a38fa9a73f9cabc1b5aa5c70a4de091d Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Thu, 29 Jul 2021 17:54:38 -0700 Subject: [PATCH 4/9] Update src/libraries/shims/ApiCompat.proj --- src/libraries/shims/ApiCompat.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/shims/ApiCompat.proj b/src/libraries/shims/ApiCompat.proj index d459f9a4de837..4ade3e1c90441 100644 --- a/src/libraries/shims/ApiCompat.proj +++ b/src/libraries/shims/ApiCompat.proj @@ -107,7 +107,7 @@ - + From 69a125e50e94eba3e76fea8fb5e56a1ace302995 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Thu, 29 Jul 2021 18:23:59 -0700 Subject: [PATCH 5/9] Missing attribute --- .../Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs index 2cfac1e1919e9..f2701035b93ab 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs @@ -41,6 +41,7 @@ public static void RegisterForTrackerSupport(ComWrappers instance) throw new PlatformNotSupportedException(); } + [SupportedOSPlatform("windows")] public static void RegisterForMarshalling(ComWrappers instance) { throw new PlatformNotSupportedException(); From e4515585bb15cf9c866156c6d0b0284927ca0e3a Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Fri, 30 Jul 2021 15:21:52 -0700 Subject: [PATCH 6/9] Review feedback. --- .../InteropServices/ComWrappers.PlatformNotSupported.cs | 5 +++++ .../src/System/Runtime/InteropServices/ComWrappers.cs | 5 +++++ .../ref/System.Runtime.InteropServices.cs | 5 +++++ .../System/Runtime/InteropServices/Marshal/AddRefTests.cs | 1 + .../Runtime/InteropServices/Marshal/QueryInterfaceTests.cs | 1 + .../System/Runtime/InteropServices/Marshal/ReleaseTests.cs | 1 + 6 files changed, 18 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs index f2701035b93ab..3251d2cd4964e 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs @@ -6,6 +6,11 @@ namespace System.Runtime.InteropServices { + [UnsupportedOSPlatform("android")] + [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("maccatalyst")] + [UnsupportedOSPlatform("tvos")] public abstract partial class ComWrappers { public partial struct ComInterfaceDispatch diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index 4171b7cb9f842..ff16e14d4e39d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -69,6 +69,11 @@ public enum CreateObjectFlags /// /// Class for managing wrappers of COM IUnknown types. /// + [UnsupportedOSPlatform("android")] + [UnsupportedOSPlatform("browser")] + [UnsupportedOSPlatform("ios")] + [UnsupportedOSPlatform("maccatalyst")] + [UnsupportedOSPlatform("tvos")] [CLSCompliant(false)] public abstract partial class ComWrappers { diff --git a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs index 4ee5fcaf1a949..feb8ae7135abb 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -1125,6 +1125,11 @@ public enum CreateObjectFlags Aggregation = 4, Unwrap = 8, } + [System.Runtime.Versioning.UnsupportedOSPlatform("android")] + [System.Runtime.Versioning.UnsupportedOSPlatform("browser")] + [System.Runtime.Versioning.UnsupportedOSPlatform("ios")] + [System.Runtime.Versioning.UnsupportedOSPlatform("maccatalyst")] + [System.Runtime.Versioning.UnsupportedOSPlatform("tvos")] [System.CLSCompliantAttribute(false)] public abstract class ComWrappers { diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AddRefTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AddRefTests.cs index 3008f13c56ceb..ec5ae351bc79c 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AddRefTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/AddRefTests.cs @@ -9,6 +9,7 @@ namespace System.Runtime.InteropServices.Tests public class AddRefTests { [Fact] + [SkipOnMono("ComWrappers are not supported on Mono")] public void AddRef_ValidPointer_Success() { var cw = new ComWrappersImpl(); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs index ab5ddf9d02371..83d10ad0c497e 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs @@ -21,6 +21,7 @@ public static IEnumerable QueryInterface_ValidInterface_TestData() [Theory] [MemberData(nameof(QueryInterface_ValidInterface_TestData))] + [SkipOnMono("ComWrappers are not supported on Mono")] public void QueryInterface_ValidInterface_Success(object o, string iidString) { var cw = new ComWrappersImpl(); diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/ReleaseTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/ReleaseTests.cs index 5f4dc65a34c02..3ef69cfc0920f 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/ReleaseTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/ReleaseTests.cs @@ -9,6 +9,7 @@ namespace System.Runtime.InteropServices.Tests public class ReleaseTests { [Fact] + [SkipOnMono("ComWrappers are not supported on Mono")] public void Release_ValidPointer_Success() { var cw = new ComWrappersImpl(); From 12e3c60203991c42f2f69b4456ad3bdc227bd9bc Mon Sep 17 00:00:00 2001 From: Aaron R Robinson Date: Mon, 2 Aug 2021 11:21:55 -0700 Subject: [PATCH 7/9] Update ApiCompat for InteropServices project. --- .../InteropServices/ComWrappers.PlatformNotSupported.cs | 5 ----- .../src/MatchingRefApiCompatBaseline.txt | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs index 3251d2cd4964e..f2701035b93ab 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.PlatformNotSupported.cs @@ -6,11 +6,6 @@ namespace System.Runtime.InteropServices { - [UnsupportedOSPlatform("android")] - [UnsupportedOSPlatform("browser")] - [UnsupportedOSPlatform("ios")] - [UnsupportedOSPlatform("maccatalyst")] - [UnsupportedOSPlatform("tvos")] public abstract partial class ComWrappers { public partial struct ComInterfaceDispatch diff --git a/src/libraries/System.Runtime.InteropServices/src/MatchingRefApiCompatBaseline.txt b/src/libraries/System.Runtime.InteropServices/src/MatchingRefApiCompatBaseline.txt index 8a50ec864714b..dd2e06b69c3c2 100644 --- a/src/libraries/System.Runtime.InteropServices/src/MatchingRefApiCompatBaseline.txt +++ b/src/libraries/System.Runtime.InteropServices/src/MatchingRefApiCompatBaseline.txt @@ -1,5 +1,6 @@ Compat issues with assembly System.Runtime.InteropServices: TypesMustExist : Type 'System.Runtime.InteropServices.AssemblyRegistrationFlags' does not exist in the reference but it does exist in the implementation. +CannotChangeAttribute : Attribute 'System.Runtime.Versioning.UnsupportedOSPlatformAttribute' on 'System.Runtime.InteropServices.ComWrappers' changed from '[UnsupportedOSPlatformAttribute("android")]' in the implementation to '[UnsupportedOSPlatformAttribute("android")]' in the reference. TypesMustExist : Type 'System.Runtime.InteropServices.ExporterEventKind' does not exist in the reference but it does exist in the implementation. TypesMustExist : Type 'System.Runtime.InteropServices.IDispatchImplAttribute' does not exist in the reference but it does exist in the implementation. TypesMustExist : Type 'System.Runtime.InteropServices.IDispatchImplType' does not exist in the reference but it does exist in the implementation. @@ -7,5 +8,4 @@ TypesMustExist : Type 'System.Runtime.InteropServices.RegistrationClassContext' TypesMustExist : Type 'System.Runtime.InteropServices.RegistrationConnectionType' does not exist in the reference but it does exist in the implementation. TypesMustExist : Type 'System.Runtime.InteropServices.SetWin32ContextInIDispatchAttribute' does not exist in the reference but it does exist in the implementation. MembersMustExist : Member 'public void System.Runtime.InteropServices.UnmanagedFunctionPointerAttribute..ctor()' does not exist in the reference but it does exist in the implementation. -CannotRemoveAttribute : Attribute 'System.CLSCompliantAttribute' exists on 'System.Runtime.InteropServices.ComTypes.IDataObject' in the implementation but not the reference. Total Issues: 9 From cdc0154d16e5f4e6843eebc465d2d2d9d303ced5 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 2 Aug 2021 14:55:55 -0700 Subject: [PATCH 8/9] Test should not run on Mono. --- .../Runtime/InteropServices/Marshal/QueryInterfaceTests.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs index 83d10ad0c497e..a52f710abf576 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/QueryInterfaceTests.cs @@ -54,6 +54,7 @@ public static IEnumerable QueryInterface_NoSuchInterface_TestData() [Theory] [MemberData(nameof(QueryInterface_NoSuchInterface_TestData))] + [SkipOnMono("ComWrappers are not supported on Mono")] public void QueryInterface_NoSuchInterface_Success(object o, string iidString) { var cw = new ComWrappersImpl(); From ac47ce3aab40a81c66f111ba7b31d03994cf73b4 Mon Sep 17 00:00:00 2001 From: Aaron Robinson Date: Mon, 2 Aug 2021 18:07:40 -0700 Subject: [PATCH 9/9] Apply suggestions from code review --- .../Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs index 31f7264d8a5e6..f6b7180c299e3 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/Marshal/Common/COMWrappersImpl.cs @@ -9,6 +9,7 @@ namespace System.Runtime.InteropServices.Tests.Common { public class ComWrappersImpl : ComWrappers { + // Doesn't represent a real interface. The value is only used to support a call to QueryInterface for testing. public const string IID_TestQueryInterface = "1F906666-B388-4729-B78C-826BC5FD4245"; protected unsafe override ComInterfaceEntry* ComputeVtables(object obj, CreateComInterfaceFlags flags, out int count) @@ -39,4 +40,4 @@ protected override object CreateObject(IntPtr externalComObject, CreateObjectFla protected override void ReleaseObjects(IEnumerable objects) => throw new NotImplementedException(); } -} \ No newline at end of file +}