diff options
author | Andrii Kurdiumov <kant2002@gmail.com> | 2021-07-13 23:47:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-13 23:47:02 +0300 |
commit | a38fc2fd272313165e30f8301d4d767a5c30f659 (patch) | |
tree | 8fa24e9bab9b1d1279f6cef9a32f84e6fa97aeff /src | |
parent | 271eea2a1720bfbb4098bd950198c2ebb6a96637 (diff) |
Remove IL2050 in System.Management (#54810)
* Remove IL2050 in System.Management
Remove unused functions which trigger IL2050
As per discussed in #54317
* Fix location of variables
Diffstat (limited to 'src')
4 files changed, 5 insertions, 37 deletions
diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs index 43263270343..c73b065ea59 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CoGetObjectContext.cs @@ -9,7 +9,7 @@ internal static partial class Interop { internal static partial class Ole32 { - [DllImport(Libraries.Ole32, PreserveSig = false)] - internal static extern IStream CreateStreamOnHGlobal(IntPtr hGlobal, bool fDeleteOnRelease); + [DllImport(Libraries.Ole32)] + internal static extern int CoGetObjectContext([MarshalAs(UnmanagedType.LPStruct)] Guid riid, out IntPtr ppv); } } diff --git a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CreateStreamOnHGlobal.cs b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CreateStreamOnHGlobal.cs index 1b153d786df..d65814a2f51 100644 --- a/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CreateStreamOnHGlobal.cs +++ b/src/libraries/Common/src/Interop/Windows/Ole32/Interop.CreateStreamOnHGlobal.cs @@ -8,7 +8,7 @@ internal static partial class Interop { internal static partial class Ole32 { - [DllImport(Libraries.Ole32)] - internal static extern int CoGetObjectContext([MarshalAs(UnmanagedType.LPStruct)] Guid riid, out IntPtr ppv); + [DllImport(Libraries.Ole32, PreserveSig = false)] + internal static extern IStream CreateStreamOnHGlobal(IntPtr hGlobal, bool fDeleteOnRelease); } } diff --git a/src/libraries/System.Management/src/ILLink/ILLink.Suppressions.xml b/src/libraries/System.Management/src/ILLink/ILLink.Suppressions.xml index 54f262023c9..fbf2a09e7eb 100644 --- a/src/libraries/System.Management/src/ILLink/ILLink.Suppressions.xml +++ b/src/libraries/System.Management/src/ILLink/ILLink.Suppressions.xml @@ -31,29 +31,5 @@ <property name="Scope">member</property> <property name="Target">M:System.Management.MTAHelper.WorkerThread</property> </attribute> - <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute"> - <argument>ILLink</argument> - <argument>IL2050</argument> - <property name="Scope">member</property> - <property name="Target">M:Interop.Ole32.CoMarshalInterface(System.Runtime.InteropServices.ComTypes.IStream,System.Guid,System.IntPtr,System.UInt32,System.IntPtr,System.UInt32)</property> - </attribute> - <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute"> - <argument>ILLink</argument> - <argument>IL2050</argument> - <property name="Scope">member</property> - <property name="Target">M:Interop.Ole32.CoUnmarshalInterface(System.Runtime.InteropServices.ComTypes.IStream,System.Guid)</property> - </attribute> - <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute"> - <argument>ILLink</argument> - <argument>IL2050</argument> - <property name="Scope">member</property> - <property name="Target">M:Interop.Ole32.CreateStreamOnHGlobal(System.IntPtr,System.Boolean)</property> - </attribute> - <attribute fullname="System.Diagnostics.CodeAnalysis.UnconditionalSuppressMessageAttribute"> - <argument>ILLink</argument> - <argument>IL2050</argument> - <property name="Scope">member</property> - <property name="Target">M:Interop.Ole32.GetHGlobalFromStream(System.Runtime.InteropServices.ComTypes.IStream)</property> - </attribute> </assembly> -</linker>
\ No newline at end of file +</linker> diff --git a/src/libraries/System.Management/src/System.Management.csproj b/src/libraries/System.Management/src/System.Management.csproj index 9fac8892aed..2d353115180 100644 --- a/src/libraries/System.Management/src/System.Management.csproj +++ b/src/libraries/System.Management/src/System.Management.csproj @@ -22,14 +22,6 @@ Link="Common\Interop\Windows\Kernel32\Interop.LoadLibrary.cs" /> <Compile Include="$(CommonPath)Interop\Windows\Ole32\Interop.CoGetObjectContext.cs" Link="Common\Interop\Windows\Ole32\Interop.CoGetObjectContext.cs" /> - <Compile Include="$(CommonPath)Interop\Windows\Ole32\Interop.CoMarshalInterface.cs" - Link="Common\Interop\Windows\Ole32\Interop.CoMarshalInterface.cs" /> - <Compile Include="$(CommonPath)Interop\Windows\Ole32\Interop.CoUnmarshalInterface.cs" - Link="Common\Interop\Windows\Ole32\Interop.CoUnmarshalInterface.cs" /> - <Compile Include="$(CommonPath)Interop\Windows\Ole32\Interop.CreateStreamOnHGlobal.cs" - Link="Common\Interop\Windows\Ole32\Interop.CreateStreamOnHGlobal.cs" /> - <Compile Include="$(CommonPath)Interop\Windows\Ole32\Interop.GetHGlobalFromStream.cs" - Link="Common\Interop\Windows\Ole32\Interop.GetHGlobalFromStream.cs" /> <Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs" Link="Common\Microsoft\Win32\SafeHandles\SafeLibraryHandle.cs" /> <Compile Include="System\Management\ManagementBaseObject.cs" /> |