From: Adam Sitnik Date: Tue, 11 Aug 2020 14:18:34 +0000 (+0200) Subject: Add additional Windows-specific APIs (#40610) X-Git-Tag: submit/tizen/20210909.063632~6085 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77b752b7cec435943668df438ab9cb33d5ece253;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Add additional Windows-specific APIs (#40610) * mark System.Data.OleDb assembly as Windows-specific * mark System.Windows.Extensions assembly as Windows-specific * mark System.IO.FileInfo Encrypt and Decrypt methods as Windows-specific * System.Runtime.InteropServices * VB * mark entire ComWrappers type as Windows-specific * mark CspParameters class as Windows-specific --- diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelper.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelper.cs index 368d942..93fd276 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelper.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelper.cs @@ -81,12 +81,15 @@ // means that the problem is already quite complex and we should not be dealing with it - see // ComEventsMethod.Invoke +using System.Runtime.Versioning; + namespace System.Runtime.InteropServices { /// /// The static methods provided in ComEventsHelper allow using .NET delegates to subscribe to events /// raised COM objects. /// + [SupportedOSPlatform("windows")] public static class ComEventsHelper { /// diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs index 1b0c1a7..1e377a9 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.cs @@ -5,6 +5,7 @@ using System; using System.Collections; using System.Threading; using System.Runtime.CompilerServices; +using System.Runtime.Versioning; using Internal.Runtime.CompilerServices; namespace System.Runtime.InteropServices @@ -68,6 +69,7 @@ namespace System.Runtime.InteropServices /// /// Class for managing wrappers of COM IUnknown types. /// + [SupportedOSPlatform("windows")] [CLSCompliant(false)] public abstract partial class ComWrappers { diff --git a/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props b/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props index df1a195..de631eb 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props +++ b/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props @@ -5,5 +5,6 @@ $(MajorVersion).$(MinorVersion).$(PatchVersion) 10.0.6.0 Microsoft + true \ No newline at end of file diff --git a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs index db97852..922902e 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs +++ b/src/libraries/Microsoft.VisualBasic.Core/ref/Microsoft.VisualBasic.Core.cs @@ -250,12 +250,12 @@ namespace Microsoft.VisualBasic public sealed partial class DateAndTime { internal DateAndTime() { } - public static string DateString { get { throw null; } set { } } + public static string DateString { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } public static System.DateTime Now { get { throw null; } } - public static System.DateTime TimeOfDay { get { throw null; } set { } } + public static System.DateTime TimeOfDay { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } public static double Timer { get { throw null; } } - public static string TimeString { get { throw null; } set { } } - public static System.DateTime Today { get { throw null; } set { } } + public static string TimeString { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } + public static System.DateTime Today { get { throw null; } [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] set { } } public static System.DateTime DateAdd(Microsoft.VisualBasic.DateInterval Interval, double Number, System.DateTime DateValue) { throw null; } public static System.DateTime DateAdd(string Interval, double Number, object? DateValue) { throw null; } public static long DateDiff(Microsoft.VisualBasic.DateInterval Interval, System.DateTime Date1, System.DateTime Date2, Microsoft.VisualBasic.FirstDayOfWeek DayOfWeek = Microsoft.VisualBasic.FirstDayOfWeek.Sunday, Microsoft.VisualBasic.FirstWeekOfYear WeekOfYear = Microsoft.VisualBasic.FirstWeekOfYear.Jan1) { throw null; } @@ -332,11 +332,15 @@ namespace Microsoft.VisualBasic { internal FileSystem() { } public static void ChDir(string Path) { } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void ChDrive(char Drive) { } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void ChDrive(string? Drive) { } public static string CurDir() { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static string CurDir(char Drive) { throw null; } public static string Dir() { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static string Dir(string PathName, Microsoft.VisualBasic.FileAttribute Attributes = Microsoft.VisualBasic.FileAttribute.Normal) { throw null; } public static bool EOF(int FileNumber) { throw null; } public static Microsoft.VisualBasic.OpenMode FileAttr(int FileNumber) { throw null; } @@ -401,6 +405,7 @@ namespace Microsoft.VisualBasic public static void MkDir(string Path) { } public static void Print(int FileNumber, params object[] Output) { } public static void PrintLine(int FileNumber, params object[] Output) { } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void Rename(string OldPath, string NewPath) { } public static void Reset() { } public static void RmDir(string Path) { } @@ -486,21 +491,27 @@ namespace Microsoft.VisualBasic internal Interaction() { } public static void AppActivate(int ProcessId) { } public static void AppActivate(string Title) { } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void Beep() { } public static object? CallByName(object? ObjectRef, string ProcName, Microsoft.VisualBasic.CallType UseCallType, params object?[] Args) { throw null; } public static object? Choose(double Index, params object?[] Choice) { throw null; } public static string Command() { throw null; } public static object CreateObject(string ProgId, string? ServerName = "") { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void DeleteSetting(string AppName, string? Section = null, string? Key = null) { } public static string Environ(string? Expression) { throw null; } public static string Environ(int Expression) { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static string[,]? GetAllSettings(string AppName, string Section) { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static object? GetObject(string? PathName = null, string? Class = null) { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static string? GetSetting(string AppName, string Section, string Key, string? Default = "") { throw null; } public static object? IIf(bool Expression, object? TruePart, object? FalsePart) { throw null; } public static string InputBox(string Prompt, string Title = "", string DefaultResponse = "", int XPos = -1, int YPos = -1) { throw null; } public static MsgBoxResult MsgBox(object Prompt, MsgBoxStyle Buttons = MsgBoxStyle.ApplicationModal, object? Title = null) { throw null; } public static string Partition(long Number, long Start, long Stop, long Interval) { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static void SaveSetting(string AppName, string Section, string Key, string Setting) { } public static int Shell(string PathName, AppWinStyle Style = AppWinStyle.MinimizedFocus, bool Wait = false, int Timeout = -1) { throw null; } public static object? Switch(params object?[]? VarExpr) { throw null; } @@ -634,6 +645,7 @@ namespace Microsoft.VisualBasic public static string Space(int Number) { throw null; } public static string[] Split(string? Expression, string? Delimiter = " ", int Limit = -1, [Microsoft.VisualBasic.CompilerServices.OptionCompareAttribute] Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } public static int StrComp(string? String1, string? String2, Microsoft.VisualBasic.CompareMethod Compare = Microsoft.VisualBasic.CompareMethod.Binary) { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public static string? StrConv(string? str, Microsoft.VisualBasic.VbStrConv Conversion, int LocaleID = 0) { throw null; } public static string StrDup(int Number, char Character) { throw null; } public static object StrDup(int Number, object Character) { throw null; } diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/DateAndTime.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/DateAndTime.vb index bbaf10c..44623d9 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/DateAndTime.vb +++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/DateAndTime.vb @@ -3,6 +3,7 @@ Imports System Imports System.Globalization +Imports System.Runtime.Versioning Imports Microsoft.VisualBasic.CompilerServices Imports Microsoft.VisualBasic.CompilerServices.ExceptionUtils Imports Microsoft.VisualBasic.CompilerServices.Utils @@ -20,6 +21,7 @@ Namespace Microsoft.VisualBasic Get Return DateTime.Today End Get + Set(ByVal Value As DateTime) SetDate(Value) End Set @@ -38,6 +40,7 @@ Namespace Microsoft.VisualBasic 'Truncate to the nearest second Return New DateTime(Ticks - Ticks Mod TimeSpan.TicksPerSecond) End Get + Set(ByVal Value As DateTime) SetTime(Value) End Set @@ -49,6 +52,7 @@ Namespace Microsoft.VisualBasic Get Return (New DateTime(DateTime.Now.TimeOfDay.Ticks)).ToString("HH:mm:ss", GetInvariantCultureInfo()) End Get + Set(ByVal Value As String) Dim dt As Date @@ -93,6 +97,7 @@ Namespace Microsoft.VisualBasic Return DateTime.Today.ToString("MM\-dd\-yyyy", GetInvariantCultureInfo()) End If End Get + Set(ByVal Value As String) Dim NewDate As Date diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb index 35ce134..34c75b9 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb +++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/FileSystem.vb @@ -73,6 +73,7 @@ Namespace Microsoft.VisualBasic End Sub + Public Sub ChDrive(ByVal Drive As Char) Drive = System.Char.ToUpperInvariant(Drive) @@ -87,6 +88,7 @@ Namespace Microsoft.VisualBasic IO.Directory.SetCurrentDirectory(Drive & Path.VolumeSeparatorChar) End Sub + Public Sub ChDrive(ByVal Drive As String) Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, "Methods in Microsoft.VisualBasic should not call FileSystem public method.") @@ -105,6 +107,7 @@ Namespace Microsoft.VisualBasic Return Directory.GetCurrentDirectory() End Function + Public Function CurDir(ByVal Drive As Char) As String Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, "Methods in Microsoft.VisualBasic should not call FileSystem public method.") @@ -130,6 +133,7 @@ Namespace Microsoft.VisualBasic Return FindNextFile(System.Reflection.Assembly.GetCallingAssembly()) End Function + Public Function Dir(ByVal PathName As String, Optional ByVal Attributes As FileAttribute = FileAttribute.Normal) As String @@ -1160,6 +1164,7 @@ Namespace Microsoft.VisualBasic CloseAllFiles(System.Reflection.Assembly.GetCallingAssembly()) End Sub + Public Sub Rename(ByVal OldPath As String, ByVal NewPath As String) diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Interaction.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Interaction.vb index 9be740f..b8ec8bd 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Interaction.vb +++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Interaction.vb @@ -5,6 +5,7 @@ Imports System Imports System.Reflection Imports System.Text Imports System.Runtime.InteropServices +Imports System.Runtime.Versioning Imports Microsoft.Win32 Imports Microsoft.VisualBasic.CompilerServices @@ -117,6 +118,7 @@ Namespace Microsoft.VisualBasic ' User interaction functions. '============================================================================ + Public Sub Beep() #If TARGET_WINDOWS Then UnsafeNativeMethods.MessageBeep(0) @@ -315,6 +317,7 @@ Namespace Microsoft.VisualBasic ' Registry functions. '============================================================================ + Public Sub DeleteSetting(ByVal AppName As String, Optional ByVal Section As String = Nothing, Optional ByVal Key As String = Nothing) Dim AppSection As String Dim UserKey As RegistryKey @@ -346,6 +349,7 @@ Namespace Microsoft.VisualBasic End Try End Sub + Public Function GetAllSettings(ByVal AppName As String, ByVal Section As String) As String(,) Dim rk As RegistryKey Dim sAppSect As String @@ -404,6 +408,7 @@ Namespace Microsoft.VisualBasic End Try End Function + Public Function GetSetting(ByVal AppName As String, ByVal Section As String, ByVal Key As String, Optional ByVal [Default] As String = "") As String Dim rk As RegistryKey = Nothing Dim sAppSect As String @@ -443,6 +448,7 @@ Namespace Microsoft.VisualBasic End If End Function + Public Sub SaveSetting(ByVal AppName As String, ByVal Section As String, ByVal Key As String, ByVal Setting As String) Dim rk As RegistryKey Dim sIniSect As String @@ -534,6 +540,7 @@ Namespace Microsoft.VisualBasic End Try End Function + Public Function GetObject(Optional ByVal PathName As String = Nothing, Optional ByVal [Class] As String = Nothing) As Object 'Only works for Com2 objects, not for COM+ objects. diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Strings.vb b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Strings.vb index 3db1df0..d0fabaf 100644 --- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Strings.vb +++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft/VisualBasic/Strings.vb @@ -1996,6 +1996,7 @@ RedimAndExit: End Try End Function + Public Function StrConv(ByVal [str] As String, ByVal Conversion As VbStrConv, Optional ByVal LocaleID As Integer = 0) As String #If TARGET_WINDOWS Then Try diff --git a/src/libraries/System.Data.OleDb/Directory.Build.props b/src/libraries/System.Data.OleDb/Directory.Build.props index 571905e..cef5ef6 100644 --- a/src/libraries/System.Data.OleDb/Directory.Build.props +++ b/src/libraries/System.Data.OleDb/Directory.Build.props @@ -1,5 +1,6 @@  + true \ No newline at end of file diff --git a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs index e6fbef2..f84978d 100644 --- a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs +++ b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs @@ -190,8 +190,10 @@ namespace System.IO public System.IO.FileInfo CopyTo(string destFileName, bool overwrite) { throw null; } public System.IO.FileStream Create() { throw null; } public System.IO.StreamWriter CreateText() { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public void Decrypt() { } public override void Delete() { } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public void Encrypt() { } public void MoveTo(string destFileName) { } public void MoveTo(string destFileName, bool overwrite) { } diff --git a/src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs b/src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs index b901d65..fc391cdf 100644 --- a/src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs +++ b/src/libraries/System.IO.FileSystem/src/System/IO/FileInfo.cs @@ -5,6 +5,7 @@ using System; using System.Diagnostics; using System.IO; using System.Text; +using System.Runtime.Versioning; #if MS_IO_REDIST namespace Microsoft.IO @@ -182,8 +183,10 @@ namespace System.IO return new FileInfo(destinationFileName); } + [SupportedOSPlatform("windows")] public void Decrypt() => File.Decrypt(FullPath); + [SupportedOSPlatform("windows")] public void Encrypt() => File.Encrypt(FullPath); } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelpers.NoCom.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelpers.NoCom.cs index 7db1b92..394aa67 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelpers.NoCom.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsHelpers.NoCom.cs @@ -1,8 +1,11 @@ // 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.Versioning; + namespace System.Runtime.InteropServices { + [SupportedOSPlatform("windows")] public static class ComEventsHelper { public static void Combine(object rcw, Guid iid, int dispid, Delegate d) 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 62aa162..3a62225 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 @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections; +using System.Runtime.Versioning; namespace System.Runtime.InteropServices { @@ -21,6 +22,7 @@ namespace System.Runtime.InteropServices UniqueInstance = 2, } + [SupportedOSPlatform("windows")] [CLSCompliant(false)] public abstract class ComWrappers { diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs index 740d69a..599830f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/DispatchWrapper.cs @@ -6,6 +6,7 @@ using System.Runtime.Versioning; namespace System.Runtime.InteropServices { // Wrapper that is converted to a variant with VT_DISPATCH + [SupportedOSPlatform("windows")] public sealed class DispatchWrapper { public DispatchWrapper(object? obj) @@ -22,7 +23,6 @@ namespace System.Runtime.InteropServices } } - [SupportedOSPlatform("windows")] public object? WrappedObject { get; } } } 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 7bc7065..8eebad5 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -181,6 +181,7 @@ namespace System.Runtime.InteropServices public override System.Reflection.Module Module { get { throw null; } } public override string Name { get { throw null; } } public override System.Type? ReflectedType { get { throw null; } } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public override void AddEventHandler(object target, System.Delegate handler) { } public override System.Reflection.MethodInfo? GetAddMethod(bool nonPublic) { throw null; } public override object[] GetCustomAttributes(bool inherit) { throw null; } @@ -190,6 +191,7 @@ namespace System.Runtime.InteropServices public override System.Reflection.MethodInfo? GetRaiseMethod(bool nonPublic) { throw null; } public override System.Reflection.MethodInfo? GetRemoveMethod(bool nonPublic) { throw null; } public override bool IsDefined(System.Type attributeType, bool inherit) { throw null; } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public override void RemoveEventHandler(object target, System.Delegate handler) { } } [System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)] @@ -220,6 +222,7 @@ namespace System.Runtime.InteropServices public System.Type EventProvider { get { throw null; } } public System.Type SourceInterface { get { throw null; } } } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static partial class ComEventsHelper { @@ -313,11 +316,11 @@ namespace System.Runtime.InteropServices public DefaultParameterValueAttribute(object? value) { } public object? Value { get { throw null; } } } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public sealed partial class DispatchWrapper { public DispatchWrapper(object? obj) { } - [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public object? WrappedObject { get { throw null; } } } [System.AttributeUsageAttribute(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)] @@ -1019,6 +1022,7 @@ namespace System.Runtime.InteropServices TrackerObject = 1, UniqueInstance = 2, } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] [System.CLSCompliantAttribute(false)] public abstract class ComWrappers { diff --git a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComAwareEventInfo.cs b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComAwareEventInfo.cs index 5bc80c6..197e853 100644 --- a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComAwareEventInfo.cs +++ b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/ComAwareEventInfo.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Reflection; +using System.Runtime.Versioning; // This type is obsolete, and is expected to be used in very specific ways or it may // throw null reference exceptions. @@ -19,6 +20,7 @@ namespace System.Runtime.InteropServices _innerEventInfo = type.GetEvent(eventName)!; } + [SupportedOSPlatform("windows")] #pragma warning disable CS8765 // Nullability of parameters 'target' and 'handler' don't match overridden member public override void AddEventHandler(object target, Delegate handler) #pragma warning restore CS8765 @@ -36,6 +38,7 @@ namespace System.Runtime.InteropServices } } + [SupportedOSPlatform("windows")] #pragma warning disable CS8765 // Nullability of parameters 'target' and 'handler' don't match overridden member public override void RemoveEventHandler(object target, Delegate handler) #pragma warning restore CS8765 diff --git a/src/libraries/System.Security.Cryptography.Csp/ref/System.Security.Cryptography.Csp.cs b/src/libraries/System.Security.Cryptography.Csp/ref/System.Security.Cryptography.Csp.cs index d7b4db1..35ccd65 100644 --- a/src/libraries/System.Security.Cryptography.Csp/ref/System.Security.Cryptography.Csp.cs +++ b/src/libraries/System.Security.Cryptography.Csp/ref/System.Security.Cryptography.Csp.cs @@ -44,6 +44,7 @@ namespace System.Security.Cryptography public bool Removable { get { throw null; } } public string UniqueKeyContainerName { get { throw null; } } } + [System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")] public sealed partial class CspParameters { public string? KeyContainerName; diff --git a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CspParameters.cs b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CspParameters.cs index fa47f39..67cb9c5 100644 --- a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CspParameters.cs +++ b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CspParameters.cs @@ -4,10 +4,12 @@ using System; using System.Diagnostics; using System.Security.Cryptography; +using System.Runtime.Versioning; using Internal.NativeCrypto; namespace System.Security.Cryptography { + [SupportedOSPlatform("windows")] public sealed class CspParameters { public int ProviderType; diff --git a/src/libraries/System.Windows.Extensions/Directory.Build.props b/src/libraries/System.Windows.Extensions/Directory.Build.props index bdcfca3..2f8a894 100644 --- a/src/libraries/System.Windows.Extensions/Directory.Build.props +++ b/src/libraries/System.Windows.Extensions/Directory.Build.props @@ -2,5 +2,6 @@ Open + true \ No newline at end of file