* move all OSPlatformAttributes to a single file so they can be easily referenced in < .NET 5 libraries
* Adds System.Runtime.Versioning*Platform* annotation attributes to < .NET 5 builds
* introduce MinimiumSupportedWindowsPlatform
* introduce IsWindowsSpecific setting that adds MinimumOSPlatform attribute for Windows Specific libraries
* mark all Windows-specific libraries as such
* annotate Windows-specific System.Console methods and properites
* annotate Windows-specific DpapiProtectedConfigurationProvider type
* annotate throwing Windows-specific APIs from System.Diagnostics.Process namespace
* annotate throwing Windows-specific APIs from System.IO.MemoryMappedFiles namespace
* annotate Windows-specific APIs from System.IO.Pipes namespace
* the new attributes should support enums
* annotate Windows-specific APIs from HttpListenerTimeoutManager class
* annotate Windows-specific APIs from System.Net.Sockets namespace
* annotate Windows-specific APIs from System.Runtime.InteropServices namespace
* annotate Windows-specific APIs from System.Security.Cryptography.Csp namespace
* annotate Windows-specific APIs from System.Security.Cryptography.X509Certificates namespace
* annotate Windows-specific APIs from System.Threading namespace
* address code review feedback: dont introduce new constants, reuse existing SYSTEM_PRIVATE_CORELIB
* code review: import the namespace, simplify the attribute name
* add missing Socket.DuplicateAndClose and Socket(SocketInformation)
* fix the test name (it does not throw)
* add missing DriveInfo.set_VolumeLabel
* add System.IO.FileSystem File Encrypt and Descrypt methods
* simplify the < .NET 5 check
* enable nullable in explicit way as it's not enabled in all the projects where this file is included
* include platform attributes in projects that ask for it in explicit way
* set IncludePlatformAttributes to true for projects that include files from other projects
* use suggestions from Viktor and Santi
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
<NetCoreAppCurrentBrandName>.NET $(NetCoreAppCurrentVersion)</NetCoreAppCurrentBrandName>
<NetFrameworkCurrent>net472</NetFrameworkCurrent>
+ <MinimiumSupportedWindowsPlatform>WINDOWS7.0</MinimiumSupportedWindowsPlatform>
</PropertyGroup>
<!-- Honor the generic RuntimeConfiguration property. -->
</AssemblyMetadata>
</ItemGroup>
+ <!-- Adds MinimumOSPlatform attribute for Windows Specific libraries -->
+ <ItemGroup Condition="'$(IsWindowsSpecific)' == 'true' and '$(IsTestProject)' != 'true'">
+ <AssemblyAttribute Include="System.Runtime.Versioning.MinimumOSPlatform">
+ <_Parameter1>$(MinimiumSupportedWindowsPlatform)</_Parameter1>
+ </AssemblyAttribute>
+ </ItemGroup>
+
<Target Name="DecideIfWeNeedToIncludeDllSafeSearchPathAttribute"
Condition="'$(IsDotNetFrameworkProductAssembly)' == 'true' and '$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true'">
<!-- Adds Nullable annotation attributes to netstandard <= 2.0 builds -->
<Choose>
<When Condition="'$(Nullable)' != '' and ($(TargetFramework.StartsWith('netstandard1')) or '$(TargetFramework)' == 'netstandard2.0' or $(TargetFramework.StartsWith('netcoreapp2')) or '$(TargetFrameworkIdentifier)' == '.NETFramework')">
- <PropertyGroup>
- <DefineConstants>$(DefineConstants),INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
- </PropertyGroup>
<ItemGroup>
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\NullableAttributes.cs" Link="System\Diagnostics\CodeAnalysis\NullableAttributes.cs" />
</ItemGroup>
<ExcludeFromPackage Condition="'$(TargetFramework)' == '$(NetFrameworkCurrent)' and '$(ExcludeCurrentFullFrameworkFromPackage)' == 'true'">true</ExcludeFromPackage>
</PropertyGroup>
+ <!-- Adds System.Runtime.Versioning*Platform* annotation attributes to < .NET 5 builds -->
+ <Choose>
+ <When Condition="('$(IncludePlatformAttributes)' == 'true' or '$(IsWindowsSpecific)' == 'true') and ('$(TargetFrameworkIdentifier)' != '.NETCoreApp' or $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '5.0')))">
+ <ItemGroup>
+ <Compile Include="$(CoreLibSharedDir)System\Runtime\Versioning\PlatformAttributes.cs" Link="System\Runtime\Versioning\PlatformAttributes.cs" />
+ </ItemGroup>
+ </When>
+ </Choose>
+
<!-- The Default behavior in VS is to show files for the first target framework in TargetFrameworks property.
This is required to show all the files corresponding to all target frameworks in VS. -->
<ItemGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ClsCompliant>false</ClsCompliant>
<Nullable>annotations</Nullable>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\System.IO.FileSystem\src\System\IO\Directory.cs"
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
<IsNETCoreAppRef>false</IsNETCoreAppRef>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
protected virtual string ValueAttributeName { get { throw null; } }
public virtual object Create(object parent, object context, System.Xml.XmlNode section) { throw null; }
}
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public sealed partial class DpapiProtectedConfigurationProvider : System.Configuration.ProtectedConfigurationProvider
{
public DpapiProtectedConfigurationProvider() { }
using System.Security.Cryptography;
using System.Text;
using System.Xml;
+using System.Runtime.Versioning;
namespace System.Configuration
{
+ [MinimumOSPlatform("windows7.0")]
public sealed class DpapiProtectedConfigurationProvider : ProtectedConfigurationProvider
{
private bool _useMachineProtection = true;
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public static partial class Console
{
public static System.ConsoleColor BackgroundColor { get { throw null; } set { } }
- public static int BufferHeight { get { throw null; } set { } }
- public static int BufferWidth { get { throw null; } set { } }
+ public static int BufferHeight { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
+ public static int BufferWidth { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static bool CapsLock { get { throw null; } }
public static int CursorLeft { get { throw null; } set { } }
- public static int CursorSize { get { throw null; } set { } }
+ public static int CursorSize { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
public static int CursorTop { get { throw null; } set { } }
- public static bool CursorVisible { get { throw null; } set { } }
+ public static bool CursorVisible { [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] get { throw null; } set { } }
public static System.IO.TextWriter Error { get { throw null; } }
public static System.ConsoleColor ForegroundColor { get { throw null; } set { } }
- public static (int Left, int Top) GetCursorPosition() { throw null; }
public static System.IO.TextReader In { get { throw null; } }
public static System.Text.Encoding InputEncoding { get { throw null; } set { } }
public static bool IsErrorRedirected { get { throw null; } }
public static bool KeyAvailable { get { throw null; } }
public static int LargestWindowHeight { get { throw null; } }
public static int LargestWindowWidth { get { throw null; } }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static bool NumberLock { get { throw null; } }
public static System.IO.TextWriter Out { get { throw null; } }
public static System.Text.Encoding OutputEncoding { get { throw null; } set { } }
- public static string Title { get { throw null; } set { } }
+ public static string Title { [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] get { throw null; } set { } }
public static bool TreatControlCAsInput { get { throw null; } set { } }
- public static int WindowHeight { get { throw null; } set { } }
- public static int WindowLeft { get { throw null; } set { } }
- public static int WindowTop { get { throw null; } set { } }
- public static int WindowWidth { get { throw null; } set { } }
+ public static int WindowHeight { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
+ public static int WindowLeft { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
+ public static int WindowTop { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
+ public static int WindowWidth { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
public static event System.ConsoleCancelEventHandler? CancelKeyPress { add { } remove { } }
public static void Beep() { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void Beep(int frequency, int duration) { }
public static void Clear() { }
+ public static (int Left, int Top) GetCursorPosition() { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, System.ConsoleColor sourceForeColor, System.ConsoleColor sourceBackColor) { }
public static System.IO.Stream OpenStandardError() { throw null; }
public static System.IO.Stream OpenStandardError(int bufferSize) { throw null; }
public static System.ConsoleKeyInfo ReadKey(bool intercept) { throw null; }
public static string? ReadLine() { throw null; }
public static void ResetColor() { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void SetBufferSize(int width, int height) { }
public static void SetCursorPosition(int left, int top) { }
public static void SetError(System.IO.TextWriter newError) { }
public static void SetIn(System.IO.TextReader newIn) { }
public static void SetOut(System.IO.TextWriter newOut) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void SetWindowPosition(int left, int top) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void SetWindowSize(int width, int height) { }
public static void Write(bool value) { }
public static void Write(char value) { }
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.CompilerServices;
+using System.Runtime.Versioning;
using System.Text;
using System.Threading;
public static int CursorSize
{
get { return ConsolePal.CursorSize; }
+ [MinimumOSPlatform("windows7.0")]
set { ConsolePal.CursorSize = value; }
}
+ [MinimumOSPlatform("windows7.0")]
public static bool NumberLock
{
get { return ConsolePal.NumberLock; }
}
+ [MinimumOSPlatform("windows7.0")]
public static bool CapsLock
{
get { return ConsolePal.CapsLock; }
public static int BufferWidth
{
get { return ConsolePal.BufferWidth; }
+ [MinimumOSPlatform("windows7.0")]
set { ConsolePal.BufferWidth = value; }
}
public static int BufferHeight
{
get { return ConsolePal.BufferHeight; }
+ [MinimumOSPlatform("windows7.0")]
set { ConsolePal.BufferHeight = value; }
}
+ [MinimumOSPlatform("windows7.0")]
public static void SetBufferSize(int width, int height)
{
ConsolePal.SetBufferSize(width, height);
public static int WindowLeft
{
get { return ConsolePal.WindowLeft; }
+ [MinimumOSPlatform("windows7.0")]
set { ConsolePal.WindowLeft = value; }
}
public static int WindowTop
{
get { return ConsolePal.WindowTop; }
+ [MinimumOSPlatform("windows7.0")]
set { ConsolePal.WindowTop = value; }
}
public static int WindowWidth
{
get { return ConsolePal.WindowWidth; }
+ [MinimumOSPlatform("windows7.0")]
set { ConsolePal.WindowWidth = value; }
}
public static int WindowHeight
{
get { return ConsolePal.WindowHeight; }
+ [MinimumOSPlatform("windows7.0")]
set { ConsolePal.WindowHeight = value; }
}
+ [MinimumOSPlatform("windows7.0")]
public static void SetWindowPosition(int left, int top)
{
ConsolePal.SetWindowPosition(left, top);
}
+ [MinimumOSPlatform("windows7.0")]
public static void SetWindowSize(int width, int height)
{
ConsolePal.SetWindowSize(width, height);
public static bool CursorVisible
{
+ [MinimumOSPlatform("windows7.0")]
get { return ConsolePal.CursorVisible; }
set { ConsolePal.CursorVisible = value; }
}
public static string Title
{
+ [MinimumOSPlatform("windows7.0")]
get { return ConsolePal.Title; }
set
{
ConsolePal.Beep();
}
+ [MinimumOSPlatform("windows7.0")]
public static void Beep(int frequency, int duration)
{
ConsolePal.Beep(frequency, duration);
}
+ [MinimumOSPlatform("windows7.0")]
public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop)
{
ConsolePal.MoveBufferArea(sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop, ' ', ConsoleColor.Black, BackgroundColor);
}
+ [MinimumOSPlatform("windows7.0")]
public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
{
ConsolePal.MoveBufferArea(sourceLeft, sourceTop, sourceWidth, sourceHeight, targetLeft, targetTop, sourceChar, sourceForeColor, sourceBackColor);
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public System.Diagnostics.ProcessModule? MainModule { get { throw null; } }
public System.IntPtr MainWindowHandle { get { throw null; } }
public string MainWindowTitle { get { throw null; } }
- public System.IntPtr MaxWorkingSet { get { throw null; } set { } }
- public System.IntPtr MinWorkingSet { get { throw null; } set { } }
+ public System.IntPtr MaxWorkingSet { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
+ public System.IntPtr MinWorkingSet { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
public System.Diagnostics.ProcessModuleCollection Modules { get { throw null; } }
[System.ObsoleteAttribute("This property has been deprecated. Please use System.Diagnostics.Process.NonpagedSystemMemorySize64 instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public int NonpagedSystemMemorySize { get { throw null; } }
public static System.Diagnostics.Process Start(string fileName) { throw null; }
public static System.Diagnostics.Process Start(string fileName, string arguments) { throw null; }
[System.CLSCompliantAttribute(false)]
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.Diagnostics.Process Start(string fileName, string userName, System.Security.SecureString password, string domain) { throw null; }
[System.CLSCompliantAttribute(false)]
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.Diagnostics.Process Start(string fileName, string arguments, string userName, System.Security.SecureString password, string domain) { throw null; }
public override string ToString() { throw null; }
public void WaitForExit() { }
public System.Collections.ObjectModel.Collection<string> ArgumentList { get { throw null; } }
public string Arguments { get { throw null; } set { } }
public bool CreateNoWindow { get { throw null; } set { } }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public string Domain { get { throw null; } set { } }
public System.Collections.Generic.IDictionary<string, string?> Environment { get { throw null; } }
public System.Collections.Specialized.StringDictionary EnvironmentVariables { get { throw null; } }
public bool ErrorDialog { get { throw null; } set { } }
public System.IntPtr ErrorDialogParentHandle { get { throw null; } set { } }
public string FileName { get { throw null; } set { } }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public bool LoadUserProfile { get { throw null; } set { } }
[System.CLSCompliantAttribute(false)]
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public System.Security.SecureString? Password { get { throw null; } set { } }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public string? PasswordInClearText { get { throw null; } set { } }
public bool RedirectStandardError { get { throw null; } set { } }
public bool RedirectStandardInput { get { throw null; } set { } }
public int Id { get { throw null; } }
public int IdealProcessor { set { } }
public bool PriorityBoostEnabled { get { throw null; } set { } }
- public System.Diagnostics.ThreadPriorityLevel PriorityLevel { get { throw null; } set { } }
+ public System.Diagnostics.ThreadPriorityLevel PriorityLevel { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
public System.TimeSpan PrivilegedProcessorTime { get { throw null; } }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public System.IntPtr ProcessorAffinity { set { } }
public System.IntPtr StartAddress { get { throw null; } }
public System.DateTime StartTime { get { throw null; } }
using System.Security;
using System.Text;
using System.Threading;
+using System.Runtime.Versioning;
namespace System.Diagnostics
{
}
[CLSCompliant(false)]
+ [MinimumOSPlatform("windows7.0")]
public static Process Start(string fileName, string userName, SecureString password, string domain)
{
throw new PlatformNotSupportedException(SR.ProcessStartWithPasswordAndDomainNotSupported);
}
[CLSCompliant(false)]
+ [MinimumOSPlatform("windows7.0")]
public static Process Start(string fileName, string arguments, string userName, SecureString password, string domain)
{
throw new PlatformNotSupportedException(SR.ProcessStartWithPasswordAndDomainNotSupported);
using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
+using System.Runtime.Versioning;
using System.Security;
using System.Text;
using System.Threading;
}
[CLSCompliant(false)]
+ [MinimumOSPlatform("windows7.0")]
public static Process? Start(string fileName, string userName, SecureString password, string domain)
{
ProcessStartInfo startInfo = new ProcessStartInfo(fileName);
}
[CLSCompliant(false)]
+ [MinimumOSPlatform("windows7.0")]
public static Process? Start(string fileName, string arguments, string userName, SecureString password, string domain)
{
ProcessStartInfo startInfo = new ProcessStartInfo(fileName, arguments);
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+using System.Runtime.Versioning;
namespace System.Diagnostics
{
EnsureWorkingSetLimits();
return _maxWorkingSet;
}
+ [MinimumOSPlatform("windows7.0")]
set
{
SetWorkingSetLimits(null, value);
EnsureWorkingSetLimits();
return _minWorkingSet;
}
+ [MinimumOSPlatform("windows7.0")]
set
{
SetWorkingSetLimits(value, null);
using System;
using System.Security;
+using System.Runtime.Versioning;
namespace System.Diagnostics
{
{
private const bool CaseSensitiveEnvironmentVariables = true;
+ [MinimumOSPlatform("windows7.0")]
public string PasswordInClearText
{
get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(PasswordInClearText))); }
set { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(PasswordInClearText))); }
}
+ [MinimumOSPlatform("windows7.0")]
public string Domain
{
get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Domain))); }
set { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Domain))); }
}
+ [MinimumOSPlatform("windows7.0")]
public bool LoadUserProfile
{
get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(LoadUserProfile))); }
public string[] Verbs => Array.Empty<string>();
[CLSCompliant(false)]
+ [MinimumOSPlatform("windows7.0")]
public SecureString Password
{
get { throw new PlatformNotSupportedException(SR.Format(SR.ProcessStartSingleFeatureNotSupported, nameof(Password))); }
// The .NET Foundation licenses this file to you under the MIT license.
using System.Security;
+using System.Runtime.Versioning;
namespace System.Diagnostics
{
private const bool CaseSensitiveEnvironmentVariables = false;
+ [MinimumOSPlatform("windows7.0")]
public string? PasswordInClearText { get; set; }
+ [MinimumOSPlatform("windows7.0")]
public string Domain
{
get => _domain ?? string.Empty;
set => _domain = value;
}
+ [MinimumOSPlatform("windows7.0")]
public bool LoadUserProfile { get; set; }
[CLSCompliant(false)]
+ [MinimumOSPlatform("windows7.0")]
public SecureString? Password { get; set; }
}
}
// 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.Diagnostics
{
public partial class ProcessThread
/// two, etc. For example, the value 1 means run on processor one, 2 means run on
/// processor two, 3 means run on processor one or two.
/// </summary>
+ [MinimumOSPlatform("windows7.0")]
public IntPtr ProcessorAffinity
{
set { throw new PlatformNotSupportedException(); } // No ability to change the affinity of a thread in an arbitrary process
using Microsoft.Win32.SafeHandles;
using System.ComponentModel;
+using System.Runtime.Versioning;
namespace System.Diagnostics
{
/// two, etc. For example, the value 1 means run on processor one, 2 means run on
/// processor two, 3 means run on processor one or two.
/// </summary>
+ [MinimumOSPlatform("windows7.0")]
public IntPtr ProcessorAffinity
{
set
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
+using System.Runtime.Versioning;
namespace System.Diagnostics
{
}
return _priorityLevel.Value;
}
+ [MinimumOSPlatform("windows7.0")]
set
{
PriorityLevelCore = value;
}
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
- public void MainWindowHandle_GetUnix_ThrowsPlatformNotSupportedException()
+ public void MainWindowHandle_GetUnix_ReturnsDefaultValue()
{
CreateDefaultProcess();
to a different assembly. -->
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>ECMA</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
to a different assembly. -->
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
<IsNETCoreAppRef>false</IsNETCoreAppRef>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public long TotalFreeSpace { get { throw null; } }
public long TotalSize { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
- public string VolumeLabel { get { throw null; } set { } }
+ public string VolumeLabel { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
public static System.IO.DriveInfo[] GetDrives() { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Security;
+using System.Runtime.Versioning;
namespace System.IO
{
{
return Name;
}
+ [MinimumOSPlatform("windows7.0")]
set
{
throw new PlatformNotSupportedException();
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Text;
+using System.Runtime.Versioning;
namespace System.IO
{
return new string(volumeName);
}
+ [MinimumOSPlatform("windows7.0")]
set
{
uint oldMode;
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public static System.IO.FileStream Create(string path, int bufferSize) { throw null; }
public static System.IO.FileStream Create(string path, int bufferSize, System.IO.FileOptions options) { throw null; }
public static System.IO.StreamWriter CreateText(string path) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void Decrypt(string path) { }
public static void Delete(string path) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void Encrypt(string path) { }
public static bool Exists(string? path) { throw null; }
public static System.IO.FileAttributes GetAttributes(string path) { throw null; }
using System.Diagnostics;
using System.IO;
using System.Runtime.ExceptionServices;
+using System.Runtime.Versioning;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
FileSystem.MoveFile(fullSourceFileName, fullDestFileName, overwrite);
}
+ [MinimumOSPlatform("windows7.0")]
public static void Encrypt(string path)
{
FileSystem.Encrypt(path ?? throw new ArgumentNullException(nameof(path)));
}
+ [MinimumOSPlatform("windows7.0")]
public static void Decrypt(string path)
{
FileSystem.Decrypt(path ?? throw new ArgumentNullException(nameof(path)));
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity) { throw null; }
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; }
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateNew(string? mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.MemoryMappedFiles.MemoryMappedFileOptions options, System.IO.HandleInheritability inheritability) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile CreateOrOpen(string mapName, long capacity, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access, System.IO.MemoryMappedFiles.MemoryMappedFileOptions options, System.IO.HandleInheritability inheritability) { throw null; }
public System.IO.MemoryMappedFiles.MemoryMappedViewAccessor CreateViewAccessor() { throw null; }
public System.IO.MemoryMappedFiles.MemoryMappedViewAccessor CreateViewAccessor(long offset, long size) { throw null; }
public System.IO.MemoryMappedFiles.MemoryMappedViewStream CreateViewStream(long offset, long size, System.IO.MemoryMappedFiles.MemoryMappedFileAccess access) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile OpenExisting(string mapName) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile OpenExisting(string mapName, System.IO.MemoryMappedFiles.MemoryMappedFileRights desiredAccessRights) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IO.MemoryMappedFiles.MemoryMappedFile OpenExisting(string mapName, System.IO.MemoryMappedFiles.MemoryMappedFileRights desiredAccessRights, System.IO.HandleInheritability inheritability) { throw null; }
}
public enum MemoryMappedFileAccess
using Microsoft.Win32.SafeHandles;
using System.Diagnostics;
+using System.Runtime.Versioning;
namespace System.IO.MemoryMappedFiles
{
// the first override of this method. Note: having ReadWrite access to the object does not mean that we
// have ReadWrite access to the pages mapping the file. The OS will check against the access on the pages
// when a view is created.
+ [MinimumOSPlatform("windows7.0")]
public static MemoryMappedFile OpenExisting(string mapName)
{
return OpenExisting(mapName, MemoryMappedFileRights.ReadWrite, HandleInheritability.None);
}
+ [MinimumOSPlatform("windows7.0")]
public static MemoryMappedFile OpenExisting(string mapName, MemoryMappedFileRights desiredAccessRights)
{
return OpenExisting(mapName, desiredAccessRights, HandleInheritability.None);
}
+ [MinimumOSPlatform("windows7.0")]
public static MemoryMappedFile OpenExisting(string mapName, MemoryMappedFileRights desiredAccessRights,
HandleInheritability inheritability)
{
// memory mapped file if one exists with the same name. The capacity, options, and
// memoryMappedFileSecurity arguments will be ignored in the case of the later.
// This is ideal for P2P style IPC.
+ [MinimumOSPlatform("windows7.0")]
public static MemoryMappedFile CreateOrOpen(string mapName, long capacity)
{
return CreateOrOpen(mapName, capacity, MemoryMappedFileAccess.ReadWrite,
MemoryMappedFileOptions.None, HandleInheritability.None);
}
+ [MinimumOSPlatform("windows7.0")]
public static MemoryMappedFile CreateOrOpen(string mapName, long capacity,
MemoryMappedFileAccess access)
{
return CreateOrOpen(mapName, capacity, access, MemoryMappedFileOptions.None, HandleInheritability.None);
}
+ [MinimumOSPlatform("windows7.0")]
public static MemoryMappedFile CreateOrOpen(string mapName, long capacity,
MemoryMappedFileAccess access, MemoryMappedFileOptions options,
HandleInheritability inheritability)
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
<IsNETCoreAppRef>false</IsNETCoreAppRef>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public NamedPipeClientStream(string serverName, string pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options) : base (default(System.IO.Pipes.PipeDirection), default(int)) { }
public NamedPipeClientStream(string serverName, string pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options, System.Security.Principal.TokenImpersonationLevel impersonationLevel) : base (default(System.IO.Pipes.PipeDirection), default(int)) { }
public NamedPipeClientStream(string serverName, string pipeName, System.IO.Pipes.PipeDirection direction, System.IO.Pipes.PipeOptions options, System.Security.Principal.TokenImpersonationLevel impersonationLevel, System.IO.HandleInheritability inheritability) : base (default(System.IO.Pipes.PipeDirection), default(int)) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public int NumberOfServerInstances { get { throw null; } }
protected internal override void CheckPipePropertyOperations() { }
public void Connect() { }
public override int ReadByte() { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; }
public override void SetLength(long value) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public void WaitForPipeDrain() { }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public enum PipeTransmissionMode
{
Byte = 0,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
Message = 1,
}
}
using System.Net.Sockets;
using System.Security;
using System.Threading;
+using System.Runtime.Versioning;
namespace System.IO.Pipes
{
return true;
}
+ [MinimumOSPlatform("windows7.0")]
public int NumberOfServerInstances
{
get
using System.Security.Principal;
using System.Threading;
using Microsoft.Win32.SafeHandles;
+using System.Runtime.Versioning;
namespace System.IO.Pipes
{
return true;
}
+ [MinimumOSPlatform("windows7.0")]
public unsafe int NumberOfServerInstances
{
get
using System.IO;
using System.Threading;
using System.Threading.Tasks;
+using System.Runtime.Versioning;
namespace System.IO.Pipes
{
}
// Blocks until the other end of the pipe has read in all written buffer.
+ [MinimumOSPlatform("windows7.0")]
public void WaitForPipeDrain()
{
CheckWriteOperations();
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Win32.SafeHandles;
+using System.Runtime.Versioning;
namespace System.IO.Pipes
{
}
// Blocks until the other end of the pipe has read in all written buffer.
+ [MinimumOSPlatform("windows7.0")]
public void WaitForPipeDrain()
{
CheckWriteOperations();
// 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.IO.Pipes
{
public enum PipeTransmissionMode
{
Byte = 0,
+ [MinimumOSPlatform("windows7.0")]
Message = 1,
}
}
to a different assembly. -->
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<StrongNameKeyId>Open</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
{
internal HttpListenerTimeoutManager() { }
public System.TimeSpan DrainEntityBody { get { throw null; } set { } }
- public System.TimeSpan EntityBody { get { throw null; } set { } }
- public System.TimeSpan HeaderWait { get { throw null; } set { } }
+ public System.TimeSpan EntityBody { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
+ public System.TimeSpan HeaderWait { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
public System.TimeSpan IdleConnection { get { throw null; } set { } }
- public long MinSendBytesPerSecond { get { throw null; } set { } }
- public System.TimeSpan RequestQueue { get { throw null; } set { } }
+ public long MinSendBytesPerSecond { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
+ public System.TimeSpan RequestQueue { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
}
}
namespace System.Net.WebSockets
// 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.Net
{
public class HttpListenerTimeoutManager
public TimeSpan EntityBody
{
get => TimeSpan.Zero;
+ [MinimumOSPlatform("windows7.0")]
set
{
ValidateTimeout(value);
public TimeSpan HeaderWait
{
get => TimeSpan.Zero;
+ [MinimumOSPlatform("windows7.0")]
set
{
ValidateTimeout(value);
public long MinSendBytesPerSecond
{
get => 0;
+ [MinimumOSPlatform("windows7.0")]
set
{
if (value < 0 || value > uint.MaxValue)
public TimeSpan RequestQueue
{
get => TimeSpan.Zero;
+ [MinimumOSPlatform("windows7.0")]
set
{
ValidateTimeout(value);
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
+using System.Runtime.Versioning;
namespace System.Net
{
{
return GetTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.EntityBody);
}
+ [MinimumOSPlatform("windows7.0")]
set
{
SetTimespanTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.EntityBody, value);
{
return GetTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.RequestQueue);
}
+ [MinimumOSPlatform("windows7.0")]
set
{
SetTimespanTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.RequestQueue, value);
{
return GetTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.HeaderWait);
}
+ [MinimumOSPlatform("windows7.0")]
set
{
SetTimespanTimeout(Interop.HttpApi.HTTP_TIMEOUT_TYPE.HeaderWait, value);
//
return _minSendBytesPerSecond;
}
+ [MinimumOSPlatform("windows7.0")]
set
{
//
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
{
public enum IOControlCode : long
{
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
EnableCircularQueuing = (long)671088642,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
Flush = (long)671088644,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
AddressListChange = (long)671088663,
DataToRead = (long)1074030207,
OobDataRead = (long)1074033415,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
GetBroadcastAddress = (long)1207959557,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
AddressListQuery = (long)1207959574,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
QueryTargetPnpHandle = (long)1207959576,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
AsyncIO = (long)2147772029,
NonBlockingIO = (long)2147772030,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
AssociateHandle = (long)2281701377,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
MultipointLoopback = (long)2281701385,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
MulticastScope = (long)2281701386,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
SetQos = (long)2281701387,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
SetGroupQos = (long)2281701388,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
RoutingInterfaceChange = (long)2281701397,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
NamespaceChange = (long)2281701401,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
ReceiveAll = (long)2550136833,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
ReceiveAllMulticast = (long)2550136834,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
ReceiveAllIgmpMulticast = (long)2550136835,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
KeepAliveValues = (long)2550136836,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
AbsorbRouterAlert = (long)2550136837,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
UnicastInterface = (long)2550136838,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
LimitBroadcasts = (long)2550136839,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
BindToInterface = (long)2550136840,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
MulticastInterface = (long)2550136841,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
AddMulticastGroupOnInterface = (long)2550136842,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
DeleteMulticastGroupFromInterface = (long)2550136843,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
GetExtensionFunctionPointer = (long)3355443206,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
GetQos = (long)3355443207,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
GetGroupQos = (long)3355443208,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
TranslateHandle = (long)3355443213,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
RoutingInterfaceQuery = (long)3355443220,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
AddressListSort = (long)3355443225,
}
public partial struct IPPacketInformation
public bool DisconnectAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public System.Net.Sockets.SocketInformation DuplicateAndClose(int targetProcessId) { throw null; }
public System.Net.Sockets.Socket EndAccept(out byte[]? buffer, System.IAsyncResult asyncResult) { throw null; }
public System.Net.Sockets.Socket EndAccept(out byte[]? buffer, out int bytesTransferred, System.IAsyncResult asyncResult) { throw null; }
public int SendTo(byte[] buffer, System.Net.EndPoint remoteEP) { throw null; }
public int SendTo(byte[] buffer, System.Net.Sockets.SocketFlags socketFlags, System.Net.EndPoint remoteEP) { throw null; }
public bool SendToAsync(System.Net.Sockets.SocketAsyncEventArgs e) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public void SetIPProtectionLevel(System.Net.Sockets.IPProtectionLevel level) { }
public void SetRawSocketOption(int optionLevel, int optionName, System.ReadOnlySpan<byte> optionValue) { }
public void SetSocketOption(System.Net.Sockets.SocketOptionLevel optionLevel, System.Net.Sockets.SocketOptionName optionName, bool optionValue) { }
public System.Threading.Tasks.Task<System.Net.Sockets.Socket> AcceptSocketAsync() { throw null; }
public System.Net.Sockets.TcpClient AcceptTcpClient() { throw null; }
public System.Threading.Tasks.Task<System.Net.Sockets.TcpClient> AcceptTcpClientAsync() { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public void AllowNatTraversal(bool allowed) { }
public System.IAsyncResult BeginAcceptSocket(System.AsyncCallback? callback, object? state) { throw null; }
public System.IAsyncResult BeginAcceptTcpClient(System.AsyncCallback? callback, object? state) { throw null; }
UseDefaultWorkerThread = 0,
Disconnect = 1,
ReuseSocket = 2,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
WriteBehind = 4,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
UseSystemThread = 16,
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
UseKernelApc = 32,
}
public partial class UdpClient : System.IDisposable
public bool ExclusiveAddressUse { get { throw null; } set { } }
public bool MulticastLoopback { get { throw null; } set { } }
public short Ttl { get { throw null; } set { } }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public void AllowNatTraversal(bool allowed) { }
public System.IAsyncResult BeginReceive(System.AsyncCallback? requestCallback, object? state) { throw null; }
public System.IAsyncResult BeginSend(byte[] datagram, int bytes, System.AsyncCallback? requestCallback, object? state) { throw null; }
// 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.Net.Sockets
{
public enum IOControlCode : long
{
+ [MinimumOSPlatform("windows7.0")]
AsyncIO = 0x8004667D,
NonBlockingIO = 0x8004667E, // fionbio
DataToRead = 0x4004667F, // fionread
OobDataRead = 0x40047307,
+ [MinimumOSPlatform("windows7.0")]
AssociateHandle = 0x88000001, // SIO_ASSOCIATE_HANDLE
+ [MinimumOSPlatform("windows7.0")]
EnableCircularQueuing = 0x28000002,
+ [MinimumOSPlatform("windows7.0")]
Flush = 0x28000004,
+ [MinimumOSPlatform("windows7.0")]
GetBroadcastAddress = 0x48000005,
+ [MinimumOSPlatform("windows7.0")]
GetExtensionFunctionPointer = 0xC8000006,
+ [MinimumOSPlatform("windows7.0")]
GetQos = 0xC8000007,
+ [MinimumOSPlatform("windows7.0")]
GetGroupQos = 0xC8000008,
+ [MinimumOSPlatform("windows7.0")]
MultipointLoopback = 0x88000009,
+ [MinimumOSPlatform("windows7.0")]
MulticastScope = 0x8800000A,
+ [MinimumOSPlatform("windows7.0")]
SetQos = 0x8800000B,
+ [MinimumOSPlatform("windows7.0")]
SetGroupQos = 0x8800000C,
+ [MinimumOSPlatform("windows7.0")]
TranslateHandle = 0xC800000D,
+ [MinimumOSPlatform("windows7.0")]
RoutingInterfaceQuery = 0xC8000014,
+ [MinimumOSPlatform("windows7.0")]
RoutingInterfaceChange = 0x88000015,
+ [MinimumOSPlatform("windows7.0")]
AddressListQuery = 0x48000016,
+ [MinimumOSPlatform("windows7.0")]
AddressListChange = 0x28000017,
+ [MinimumOSPlatform("windows7.0")]
QueryTargetPnpHandle = 0x48000018,
+ [MinimumOSPlatform("windows7.0")]
NamespaceChange = 0x88000019,
+ [MinimumOSPlatform("windows7.0")]
AddressListSort = 0xC8000019,
+ [MinimumOSPlatform("windows7.0")]
ReceiveAll = 0x98000001,
+ [MinimumOSPlatform("windows7.0")]
ReceiveAllMulticast = 0x98000002,
+ [MinimumOSPlatform("windows7.0")]
ReceiveAllIgmpMulticast = 0x98000003,
+ [MinimumOSPlatform("windows7.0")]
KeepAliveValues = 0x98000004,
+ [MinimumOSPlatform("windows7.0")]
AbsorbRouterAlert = 0x98000005,
+ [MinimumOSPlatform("windows7.0")]
UnicastInterface = 0x98000006,
+ [MinimumOSPlatform("windows7.0")]
LimitBroadcasts = 0x98000007,
+ [MinimumOSPlatform("windows7.0")]
BindToInterface = 0x98000008,
+ [MinimumOSPlatform("windows7.0")]
MulticastInterface = 0x98000009,
+ [MinimumOSPlatform("windows7.0")]
AddMulticastGroupOnInterface = 0x9800000A,
+ [MinimumOSPlatform("windows7.0")]
DeleteMulticastGroupFromInterface = 0x9800000B
}
}
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using Microsoft.Win32.SafeHandles;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
+using System.Runtime.Versioning;
namespace System.Net.Sockets
{
public partial class Socket
{
+ [MinimumOSPlatform("windows7.0")]
public Socket(SocketInformation socketInformation)
{
// This constructor works in conjunction with DuplicateAndClose, which is not supported on Unix.
throw new PlatformNotSupportedException(SR.net_sockets_duplicateandclose_notsupported);
}
+ [MinimumOSPlatform("windows7.0")]
public SocketInformation DuplicateAndClose(int targetProcessId)
{
// DuplicateAndClose is not supported on Unix, since passing file descriptors between processes
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
using System.Threading;
+using System.Runtime.Versioning;
namespace System.Net.Sockets
{
internal void ReplaceHandleIfNecessaryAfterFailedConnect() { /* nop on Windows */ }
+ [MinimumOSPlatform("windows7.0")]
public Socket(SocketInformation socketInformation)
{
InitializeSockets();
blocking = true;
}
+ [MinimumOSPlatform("windows7.0")]
public SocketInformation DuplicateAndClose(int targetProcessId)
{
ThrowIfDisposed();
using System.Runtime.ExceptionServices;
using System.Runtime.InteropServices;
using System.Threading;
+using System.Runtime.Versioning;
namespace System.Net.Sockets
{
return realOptionLength;
}
+ [MinimumOSPlatform("windows7.0")]
public void SetIPProtectionLevel(IPProtectionLevel level)
{
if (level == IPProtectionLevel.Unspecified)
// The .NET Foundation licenses this file to you under the MIT license.
using System.Threading.Tasks;
+using System.Runtime.Versioning;
namespace System.Net.Sockets
{
}
}
+ [MinimumOSPlatform("windows7.0")]
public void AllowNatTraversal(bool allowed)
{
if (_active)
// 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.Net.Sockets
{
[Flags]
UseDefaultWorkerThread = 0x00,
Disconnect = 0x01,
ReuseSocket = 0x02,
+ [MinimumOSPlatform("windows7.0")]
WriteBehind = 0x04,
+ [MinimumOSPlatform("windows7.0")]
UseSystemThread = 0x10,
+ [MinimumOSPlatform("windows7.0")]
UseKernelApc = 0x20,
};
}
using System.Diagnostics.CodeAnalysis;
using System.Threading.Tasks;
+using System.Runtime.Versioning;
namespace System.Net.Sockets
{
}
}
+ [MinimumOSPlatform("windows7.0")]
public void AllowNatTraversal(bool allowed)
{
_clientSocket.SetIPProtectionLevel(allowed ? IPProtectionLevel.Unrestricted : IPProtectionLevel.EdgeRestricted);
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\ComponentGuaranteesAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\ComponentGuaranteesOptions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\FrameworkName.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\MinimumOSPlatformAttribute.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\ObsoletedInOSPlatformAttribute.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\OSPlatformAttribute.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\PlatformAttributes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\ResourceConsumptionAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\ResourceExposureAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\ResourceScope.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\TargetFrameworkAttribute.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\TargetPlatformAttribute.cs" />
- <Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\RemovedInOSPlatformAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Runtime\Versioning\VersioningHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\RuntimeType.cs" Condition="'$(TargetsCoreRT)' != 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\SByte.cs" />
{
/// <summary>Specifies that null is allowed as an input even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class AllowNullAttribute : Attribute { }
/// <summary>Specifies that null is disallowed as an input even if the corresponding type allows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class DisallowNullAttribute : Attribute { }
/// <summary>Specifies that an output may be null even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class MaybeNullAttribute : Attribute { }
/// <summary>Specifies that an output will not be null even if the corresponding type allows it. Specifies that an input argument was not null when the call returns.</summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class NotNullAttribute : Attribute { }
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter may be null even if the corresponding type disallows it.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class MaybeNullWhenAttribute : Attribute
{
/// <summary>Specifies that when a method returns <see cref="ReturnValue"/>, the parameter will not be null even if the corresponding type allows it.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class NotNullWhenAttribute : Attribute
{
/// <summary>Specifies that the output will be non-null if the named parameter is non-null.</summary>
[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property | AttributeTargets.ReturnValue, AllowMultiple = true, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class NotNullIfNotNullAttribute : Attribute
{
/// <summary>Applied to a method that will never return under any circumstance.</summary>
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class DoesNotReturnAttribute : Attribute { }
/// <summary>Specifies that the method will not return if the associated Boolean parameter is passed the specified value.</summary>
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class DoesNotReturnIfAttribute : Attribute
{
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class MemberNotNullAttribute : Attribute
{
/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values when returning with the specified return value condition.</summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
-#if INTERNAL_NULLABLE_ATTRIBUTES
- internal
-#else
+#if SYSTEM_PRIVATE_CORELIB
public
+#else
+ internal
#endif
sealed class MemberNotNullWhenAttribute : Attribute
{
// 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
{
// Wrapper that is converted to a variant with VT_DISPATCH
}
}
+ [MinimumOSPlatform("windows7.0")]
public object? WrappedObject { get; }
}
}
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.InteropServices.ComTypes;
+using System.Runtime.Versioning;
namespace System.Runtime.InteropServices
{
return e?.HResult ?? 0;
}
+ [MinimumOSPlatform("windows7.0")]
public static int AddRef(IntPtr pUnk)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
public static bool AreComObjectsAvailableForCleanup() => false;
+ [MinimumOSPlatform("windows7.0")]
public static IntPtr CreateAggregatedObject(IntPtr pOuter, object o)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static object BindToMoniker(string monikerName)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
{
}
+ [MinimumOSPlatform("windows7.0")]
public static IntPtr CreateAggregatedObject<T>(IntPtr pOuter, T o) where T : notnull
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static object? CreateWrapperOfType(object? o, Type t)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static TWrapper CreateWrapperOfType<T, TWrapper>([AllowNull] T o)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static void ChangeWrapperHandleStrength(object otp, bool fIsWeak)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static int FinalReleaseComObject(object o)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static IntPtr GetComInterfaceForObject(object o, Type T)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static IntPtr GetComInterfaceForObject(object o, Type T, CustomQueryInterfaceMode mode)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static IntPtr GetComInterfaceForObject<T, TInterface>([DisallowNull] T o)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static object? GetComObjectData(object obj, object key)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
return (IntPtr)(-1);
}
+ [MinimumOSPlatform("windows7.0")]
public static IntPtr GetIDispatchForObject(object o)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static IntPtr GetIUnknownForObject(object o)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static void GetNativeVariantForObject(object? obj, IntPtr pDstNativeVariant)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static void GetNativeVariantForObject<T>([AllowNull] T obj, IntPtr pDstNativeVariant)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static object GetTypedObjectForIUnknown(IntPtr pUnk, Type t)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static object GetObjectForIUnknown(IntPtr pUnk)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static object? GetObjectForNativeVariant(IntPtr pSrcNativeVariant)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
[return: MaybeNull]
public static T GetObjectForNativeVariant<T>(IntPtr pSrcNativeVariant)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static object?[] GetObjectsForNativeVariants(IntPtr aSrcNativeVariant, int cVars)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static T[] GetObjectsForNativeVariants<T>(IntPtr aSrcNativeVariant, int cVars)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static int GetStartComSlot(Type t)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static int GetEndComSlot(Type t)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static Type? GetTypeFromCLSID(Guid clsid)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static string GetTypeInfoName(ITypeInfo typeInfo)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static object GetUniqueObjectForIUnknown(IntPtr unknown)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
return false;
}
+ [MinimumOSPlatform("windows7.0")]
public static int QueryInterface(IntPtr pUnk, ref Guid iid, out IntPtr ppv)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static int Release(IntPtr pUnk)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static int ReleaseComObject(object o)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
+ [MinimumOSPlatform("windows7.0")]
public static bool SetComObjectData(object obj, object key, object? data)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Versioning
-{
- /// <summary>
- /// Records the operating system (and minimum version) that supports an API. Multiple attributes can be
- /// applied to indicate support on multiple operating systems.
- /// </summary>
- /// <remarks>
- /// Callers can apply a <see cref="System.Runtime.Versioning.MinimumOSPlatformAttribute" />
- /// or use guards to prevent calls to APIs on unsupported operating systems.
- ///
- /// A given platform should only be specified once.
- /// </remarks>
- [AttributeUsage(AttributeTargets.Assembly |
- AttributeTargets.Class |
- AttributeTargets.Constructor |
- AttributeTargets.Event |
- AttributeTargets.Field |
- AttributeTargets.Method |
- AttributeTargets.Module |
- AttributeTargets.Property |
- AttributeTargets.Struct,
- AllowMultiple = true, Inherited = false)]
- public sealed class MinimumOSPlatformAttribute : OSPlatformAttribute
- {
- public MinimumOSPlatformAttribute(string platformName) : base(platformName)
- {
- }
- }
-}
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Versioning
-{
- /// <summary>
- /// Base type for all platform-specific API attributes.
- /// </summary>
-#pragma warning disable CS3015 // Type has no accessible constructors which use only CLS-compliant types
- public abstract class OSPlatformAttribute : Attribute
-#pragma warning restore CS3015
- {
- private protected OSPlatformAttribute(string platformName)
- {
- PlatformName = platformName;
- }
- public string PlatformName { get; }
- }
-}
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Versioning
-{
- /// <summary>
- /// Marks APIs that were obsoleted in a given operating system version.
- ///
- /// Primarily used by OS bindings to indicate APIs that should only be used in
- /// earlier versions.
- /// </summary>
- [AttributeUsage(AttributeTargets.Assembly |
- AttributeTargets.Class |
- AttributeTargets.Constructor |
- AttributeTargets.Event |
- AttributeTargets.Field |
- AttributeTargets.Method |
- AttributeTargets.Module |
- AttributeTargets.Property |
- AttributeTargets.Struct,
- AllowMultiple = true, Inherited = false)]
- public sealed class ObsoletedInOSPlatformAttribute : OSPlatformAttribute
- {
- public ObsoletedInOSPlatformAttribute(string platformName) : base(platformName)
- {
- }
-
- public ObsoletedInOSPlatformAttribute(string platformName, string message) : base(platformName)
- {
- Message = message;
- }
-
- public string? Message { get; }
- public string? Url { get; set; }
- }
-}
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#nullable enable
+namespace System.Runtime.Versioning
+{
+ /// <summary>
+ /// Base type for all platform-specific API attributes.
+ /// </summary>
+#pragma warning disable CS3015 // Type has no accessible constructors which use only CLS-compliant types
+#if SYSTEM_PRIVATE_CORELIB
+ public
+#else
+ internal
+#endif
+ abstract class OSPlatformAttribute : Attribute
+#pragma warning restore CS3015
+ {
+ private protected OSPlatformAttribute(string platformName)
+ {
+ PlatformName = platformName;
+ }
+ public string PlatformName { get; }
+ }
+
+ /// <summary>
+ /// Records the platform that the project targeted.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.Assembly,
+ AllowMultiple = false, Inherited = false)]
+#if SYSTEM_PRIVATE_CORELIB
+ public
+#else
+ internal
+#endif
+ sealed class TargetPlatformAttribute : OSPlatformAttribute
+ {
+ public TargetPlatformAttribute(string platformName) : base(platformName)
+ {
+ }
+ }
+
+ /// <summary>
+ /// Records the operating system (and minimum version) that supports an API. Multiple attributes can be
+ /// applied to indicate support on multiple operating systems.
+ /// </summary>
+ /// <remarks>
+ /// Callers can apply a <see cref="System.Runtime.Versioning.MinimumOSPlatformAttribute" />
+ /// or use guards to prevent calls to APIs on unsupported operating systems.
+ ///
+ /// A given platform should only be specified once.
+ /// </remarks>
+ [AttributeUsage(AttributeTargets.Assembly |
+ AttributeTargets.Class |
+ AttributeTargets.Constructor |
+ AttributeTargets.Enum |
+ AttributeTargets.Event |
+ AttributeTargets.Field |
+ AttributeTargets.Method |
+ AttributeTargets.Module |
+ AttributeTargets.Property |
+ AttributeTargets.Struct,
+ AllowMultiple = true, Inherited = false)]
+#if SYSTEM_PRIVATE_CORELIB
+ public
+#else
+ internal
+#endif
+ sealed class MinimumOSPlatformAttribute : OSPlatformAttribute
+ {
+ public MinimumOSPlatformAttribute(string platformName) : base(platformName)
+ {
+ }
+ }
+
+ /// <summary>
+ /// Marks APIs that were obsoleted in a given operating system version.
+ ///
+ /// Primarily used by OS bindings to indicate APIs that should only be used in
+ /// earlier versions.
+ /// </summary>
+ [AttributeUsage(AttributeTargets.Assembly |
+ AttributeTargets.Class |
+ AttributeTargets.Constructor |
+ AttributeTargets.Enum |
+ AttributeTargets.Event |
+ AttributeTargets.Field |
+ AttributeTargets.Method |
+ AttributeTargets.Module |
+ AttributeTargets.Property |
+ AttributeTargets.Struct,
+ AllowMultiple = true, Inherited = false)]
+#if SYSTEM_PRIVATE_CORELIB
+ public
+#else
+ internal
+#endif
+ sealed class ObsoletedInOSPlatformAttribute : OSPlatformAttribute
+ {
+ public ObsoletedInOSPlatformAttribute(string platformName) : base(platformName)
+ {
+ }
+
+ public ObsoletedInOSPlatformAttribute(string platformName, string message) : base(platformName)
+ {
+ Message = message;
+ }
+
+ public string? Message { get; }
+ public string? Url { get; set; }
+ }
+
+ /// <summary>
+ /// Marks APIs that were removed in a given operating system version.
+ /// </summary>
+ /// <remarks>
+ /// Primarily used by OS bindings to indicate APIs that are only available in
+ /// earlier versions.
+ /// </remarks>
+ [AttributeUsage(AttributeTargets.Assembly |
+ AttributeTargets.Class |
+ AttributeTargets.Constructor |
+ AttributeTargets.Enum |
+ AttributeTargets.Event |
+ AttributeTargets.Field |
+ AttributeTargets.Method |
+ AttributeTargets.Module |
+ AttributeTargets.Property |
+ AttributeTargets.Struct,
+ AllowMultiple = true, Inherited = false)]
+#if SYSTEM_PRIVATE_CORELIB
+ public
+#else
+ internal
+#endif
+ sealed class RemovedInOSPlatformAttribute : OSPlatformAttribute
+ {
+ public RemovedInOSPlatformAttribute(string platformName) : base(platformName)
+ {
+ }
+ }
+}
\ No newline at end of file
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Versioning
-{
- /// <summary>
- /// Marks APIs that were removed in a given operating system version.
- /// </summary>
- /// <remarks>
- /// Primarily used by OS bindings to indicate APIs that are only available in
- /// earlier versions.
- /// </remarks>
- [AttributeUsage(AttributeTargets.Assembly |
- AttributeTargets.Class |
- AttributeTargets.Constructor |
- AttributeTargets.Event |
- AttributeTargets.Field |
- AttributeTargets.Method |
- AttributeTargets.Module |
- AttributeTargets.Property |
- AttributeTargets.Struct,
- AllowMultiple = true, Inherited = false)]
- public sealed class RemovedInOSPlatformAttribute : OSPlatformAttribute
- {
- public RemovedInOSPlatformAttribute(string platformName) : base(platformName)
- {
- }
- }
-}
+++ /dev/null
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace System.Runtime.Versioning
-{
- /// <summary>
- /// Records the platform that the project targeted.
- /// </summary>
- [AttributeUsage(AttributeTargets.Assembly,
- AllowMultiple = false, Inherited = false)]
- public sealed class TargetPlatformAttribute : OSPlatformAttribute
- {
- public TargetPlatformAttribute(string platformName) : base(platformName)
- {
- }
- }
-}
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
+using System.Runtime.Versioning;
namespace System.Threading
{
CreateEventCore(initialState, mode, name, out createdNew);
}
+ [MinimumOSPlatform("windows7.0")]
public static EventWaitHandle OpenExisting(string name)
{
switch (OpenExistingWorker(name, out EventWaitHandle? result))
}
}
+ [MinimumOSPlatform("windows7.0")]
public static bool TryOpenExisting(string name, [NotNullWhen(true)] out EventWaitHandle? result) =>
OpenExistingWorker(name, out result!) == OpenExistingResult.Success;
}
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
+using System.Runtime.Versioning;
namespace System.Threading
{
CreateSemaphoreCore(initialCount, maximumCount, name, out createdNew);
}
+ [MinimumOSPlatform("windows7.0")]
public static Semaphore OpenExisting(string name)
{
switch (OpenExistingWorker(name, out Semaphore? result))
}
}
+ [MinimumOSPlatform("windows7.0")]
public static bool TryOpenExisting(string name, [NotNullWhen(true)] out Semaphore? result) =>
OpenExistingWorker(name, out result!) == OpenExistingResult.Success;
using System.Globalization;
using System.Runtime.ConstrainedExecution;
using System.Security.Principal;
+using System.Runtime.Versioning;
namespace System.Threading
{
set => TrySetApartmentState(value);
}
+ [MinimumOSPlatform("windows7.0")]
public void SetApartmentState(ApartmentState state)
{
if (!TrySetApartmentState(state))
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public sealed partial class DispatchWrapper
{
public DispatchWrapper(object? obj) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public object? WrappedObject { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)]
{
public static readonly int SystemDefaultCharSize;
public static readonly int SystemMaxDBCSCharSize;
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static int AddRef(System.IntPtr pUnk) { throw null; }
public static System.IntPtr AllocCoTaskMem(int cb) { throw null; }
public static System.IntPtr AllocHGlobal(int cb) { throw null; }
public static System.IntPtr AllocHGlobal(System.IntPtr cb) { throw null; }
public static bool AreComObjectsAvailableForCleanup() { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static object BindToMoniker(string monikerName) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static void ChangeWrapperHandleStrength(object otp, bool fIsWeak) { }
public static void CleanupUnusedObjectsInCurrentContext() { }
public static void Copy(byte[] source, int startIndex, System.IntPtr destination, int length) { }
public static void Copy(System.IntPtr source, float[] destination, int startIndex, int length) { }
public static void Copy(System.IntPtr[] source, int startIndex, System.IntPtr destination, int length) { }
public static void Copy(float[] source, int startIndex, System.IntPtr destination, int length) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static System.IntPtr CreateAggregatedObject(System.IntPtr pOuter, object o) { throw null; }
public static System.IntPtr CreateAggregatedObject<T>(System.IntPtr pOuter, T o) where T : notnull { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("o")]
public static object? CreateWrapperOfType(object? o, System.Type t) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static TWrapper CreateWrapperOfType<T, TWrapper>([System.Diagnostics.CodeAnalysis.AllowNullAttribute] T o) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void DestroyStructure(System.IntPtr ptr, System.Type structuretype) { }
public static void DestroyStructure<T>(System.IntPtr ptr) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static int FinalReleaseComObject(object o) { throw null; }
public static void FreeBSTR(System.IntPtr ptr) { }
public static void FreeCoTaskMem(System.IntPtr ptr) { }
public static void FreeHGlobal(System.IntPtr hglobal) { }
public static System.Guid GenerateGuidForType(System.Type type) { throw null; }
public static string? GenerateProgIdForType(System.Type type) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static System.IntPtr GetComInterfaceForObject(object o, System.Type T) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static System.IntPtr GetComInterfaceForObject(object o, System.Type T, System.Runtime.InteropServices.CustomQueryInterfaceMode mode) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IntPtr GetComInterfaceForObject<T, TInterface>([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T o) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static object? GetComObjectData(object obj, object key) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static System.Delegate GetDelegateForFunctionPointer(System.IntPtr ptr, System.Type t) { throw null; }
public static TDelegate GetDelegateForFunctionPointer<TDelegate>(System.IntPtr ptr) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static int GetEndComSlot(System.Type t) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("GetExceptionCode() may be unavailable in future releases.")]
public static System.IntPtr GetHINSTANCE(System.Reflection.Module m) { throw null; }
public static int GetHRForException(System.Exception? e) { throw null; }
public static int GetHRForLastWin32Error() { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IntPtr GetIDispatchForObject(object o) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.IntPtr GetIUnknownForObject(object o) { throw null; }
public static int GetLastWin32Error() { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void GetNativeVariantForObject(object? obj, System.IntPtr pDstNativeVariant) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void GetNativeVariantForObject<T>([System.Diagnostics.CodeAnalysis.AllowNullAttribute] T obj, System.IntPtr pDstNativeVariant) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static object GetObjectForIUnknown(System.IntPtr pUnk) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static object? GetObjectForNativeVariant(System.IntPtr pSrcNativeVariant) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute]
public static T GetObjectForNativeVariant<T>(System.IntPtr pSrcNativeVariant) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static object?[] GetObjectsForNativeVariants(System.IntPtr aSrcNativeVariant, int cVars) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static T[] GetObjectsForNativeVariants<T>(System.IntPtr aSrcNativeVariant, int cVars) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static int GetStartComSlot(System.Type t) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static object GetTypedObjectForIUnknown(System.IntPtr pUnk, System.Type t) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.Type GetTypeFromCLSID(System.Guid clsid) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static string GetTypeInfoName(System.Runtime.InteropServices.ComTypes.ITypeInfo typeInfo) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static object GetUniqueObjectForIUnknown(System.IntPtr unknown) { throw null; }
public static bool IsComObject(object o) { throw null; }
public static bool IsTypeVisibleFromCom(System.Type t) { throw null; }
[return: System.Diagnostics.CodeAnalysis.MaybeNullAttribute]
public static T PtrToStructure<T>(System.IntPtr ptr) { throw null; }
public static void PtrToStructure<T>(System.IntPtr ptr, [System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T structure) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static int QueryInterface(System.IntPtr pUnk, ref System.Guid iid, out System.IntPtr ppv) { throw null; }
public static byte ReadByte(System.IntPtr ptr) { throw null; }
public static byte ReadByte(System.IntPtr ptr, int ofs) { throw null; }
public static System.IntPtr ReadIntPtr(object ptr, int ofs) { throw null; }
public static System.IntPtr ReAllocCoTaskMem(System.IntPtr pv, int cb) { throw null; }
public static System.IntPtr ReAllocHGlobal(System.IntPtr pv, System.IntPtr cb) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static int Release(System.IntPtr pUnk) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static int ReleaseComObject(object o) { throw null; }
public static System.IntPtr SecureStringToBSTR(System.Security.SecureString s) { throw null; }
public static System.IntPtr SecureStringToCoTaskMemAnsi(System.Security.SecureString s) { throw null; }
public static System.IntPtr SecureStringToCoTaskMemUnicode(System.Security.SecureString s) { throw null; }
public static System.IntPtr SecureStringToGlobalAllocAnsi(System.Security.SecureString s) { throw null; }
public static System.IntPtr SecureStringToGlobalAllocUnicode(System.Security.SecureString s) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static bool SetComObjectData(object obj, object key, object? data) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static int SizeOf(object structure) { throw null; }
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
<IsNETCoreAppRef>false</IsNETCoreAppRef>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
<IsNETCoreAppRef>false</IsNETCoreAppRef>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
public override void GenerateIV() { }
public override void GenerateKey() { }
}
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public sealed partial class CspKeyContainerInfo
{
public CspKeyContainerInfo(System.Security.Cryptography.CspParameters parameters) { }
{
public DSACryptoServiceProvider() { }
public DSACryptoServiceProvider(int dwKeySize) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public DSACryptoServiceProvider(int dwKeySize, System.Security.Cryptography.CspParameters? parameters) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public DSACryptoServiceProvider(System.Security.Cryptography.CspParameters? parameters) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public System.Security.Cryptography.CspKeyContainerInfo CspKeyContainerInfo { get { throw null; } }
public override string? KeyExchangeAlgorithm { get { throw null; } }
public override int KeySize { get { throw null; } }
public string HashName { get { throw null; } set { } }
public int IterationCount { get { throw null; } set { } }
public byte[]? Salt { get { throw null; } set { } }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public byte[] CryptDeriveKey(string? algname, string? alghashname, int keySize, byte[] rgbIV) { throw null; }
protected override void Dispose(bool disposing) { }
[System.ObsoleteAttribute("Rfc2898DeriveBytes replaces PasswordDeriveBytes for deriving key material from a password and is preferred in new applications.")]
{
public RC2CryptoServiceProvider() { }
public override int EffectiveKeySize { get { throw null; } set { } }
- public bool UseSalt { get { throw null; } set { } }
+ public bool UseSalt { get { throw null; } [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")] set { } }
public override System.Security.Cryptography.ICryptoTransform CreateDecryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; }
public override System.Security.Cryptography.ICryptoTransform CreateEncryptor(byte[] rgbKey, byte[]? rgbIV) { throw null; }
public override void GenerateIV() { }
{
public RSACryptoServiceProvider() { }
public RSACryptoServiceProvider(int dwKeySize) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public RSACryptoServiceProvider(int dwKeySize, System.Security.Cryptography.CspParameters? parameters) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public RSACryptoServiceProvider(System.Security.Cryptography.CspParameters? parameters) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public System.Security.Cryptography.CspKeyContainerInfo CspKeyContainerInfo { get { throw null; } }
public override string? KeyExchangeAlgorithm { get { throw null; } }
public override int KeySize { get { throw null; } }
// 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.Security.Cryptography
{
+ [MinimumOSPlatform("windows7.0")]
public sealed class CspKeyContainerInfo
{
public CspKeyContainerInfo(CspParameters parameters) { throw GetPlatformNotSupported(); }
using Internal.NativeCrypto;
using Microsoft.Win32.SafeHandles;
+using System.Runtime.Versioning;
namespace System.Security.Cryptography
{
+ [MinimumOSPlatform("windows7.0")]
public sealed class CspKeyContainerInfo
{
private readonly CspParameters _parameters;
using Internal.NativeCrypto;
using System.IO;
using System.Diagnostics;
+using System.Runtime.Versioning;
namespace System.Security.Cryptography
{
KeySize = dwKeySize;
}
+ [MinimumOSPlatform("windows7.0")]
public DSACryptoServiceProvider(int dwKeySize, CspParameters parameters)
{
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspParameters)));
}
+ [MinimumOSPlatform("windows7.0")]
public DSACryptoServiceProvider(CspParameters parameters)
{
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspParameters)));
public override bool TryCreateSignature(ReadOnlySpan<byte> hash, Span<byte> destination, out int bytesWritten) =>
_impl.TryCreateSignature(hash, destination, out bytesWritten);
+ [MinimumOSPlatform("windows7.0")]
public CspKeyContainerInfo CspKeyContainerInfo
{
get { throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspKeyContainerInfo))); }
using System.Buffers.Binary;
using System.Diagnostics;
using System.IO;
+using System.Runtime.Versioning;
using Internal.NativeCrypto;
namespace System.Security.Cryptography
/// for the cryptographic service provider (CSP).
/// </summary>
/// <param name="parameters">The parameters for the CSP.</param>
+ [MinimumOSPlatform("windows7.0")]
public DSACryptoServiceProvider(CspParameters? parameters)
: this(0, parameters)
{
/// <param name="dwKeySize">The size of the key for the cryptographic algorithm in bits.</param>
/// <param name="parameters">The parameters for the CSP.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA5350", Justification = "SHA1 is required by the FIPS 186-2 DSA spec.")]
+ [MinimumOSPlatform("windows7.0")]
public DSACryptoServiceProvider(int dwKeySize, CspParameters? parameters)
{
if (dwKeySize < 0)
/// <summary>
/// Gets a CspKeyContainerInfo object that describes additional information about a cryptographic key pair.
/// </summary>
+ [MinimumOSPlatform("windows7.0")]
public CspKeyContainerInfo CspKeyContainerInfo
{
get
// 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.Security.Cryptography
{
public partial class PasswordDeriveBytes : DeriveBytes
{
+ [MinimumOSPlatform("windows7.0")]
public byte[] CryptDeriveKey(string? algname, string? alghashname, int keySize, byte[] rgbIV)
{
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CryptDeriveKey)));
// The .NET Foundation licenses this file to you under the MIT license.
using Internal.NativeCrypto;
+using System.Runtime.Versioning;
#pragma warning disable CA5373 // Call to obsolete key derivation function PasswordDeriveBytes.*
{
private SafeProvHandle? _safeProvHandle;
+ [MinimumOSPlatform("windows7.0")]
public byte[] CryptDeriveKey(string? algname, string? alghashname, int keySize, byte[] rgbIV)
{
if (keySize < 0)
// The .NET Foundation licenses this file to you under the MIT license.
using Internal.Cryptography;
+using System.Runtime.Versioning;
namespace System.Security.Cryptography
{
public bool UseSalt
{
get { return false; }
+ [MinimumOSPlatform("windows7.0")]
set
{
// Don't allow a true value
using Internal.Cryptography;
using Internal.NativeCrypto;
using System.ComponentModel;
+using System.Runtime.Versioning;
namespace System.Security.Cryptography
{
{
return _use40bitSalt;
}
+ [MinimumOSPlatform("windows7.0")]
set
{
_use40bitSalt = value;
using Internal.Cryptography;
using Internal.NativeCrypto;
using System.IO;
+using System.Runtime.Versioning;
namespace System.Security.Cryptography
{
_impl = RSA.Create(dwKeySize);
}
+ [MinimumOSPlatform("windows7.0")]
public RSACryptoServiceProvider(int dwKeySize, CspParameters parameters) =>
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspParameters)));
+ [MinimumOSPlatform("windows7.0")]
public RSACryptoServiceProvider(CspParameters parameters) =>
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspParameters)));
+ [MinimumOSPlatform("windows7.0")]
public CspKeyContainerInfo CspKeyContainerInfo =>
throw new PlatformNotSupportedException(SR.Format(SR.Cryptography_CAPI_Required, nameof(CspKeyContainerInfo)));
using System.Diagnostics;
using System.IO;
+using System.Runtime.Versioning;
using Internal.Cryptography;
using Internal.NativeCrypto;
using Microsoft.Win32.SafeHandles;
{
}
+ [MinimumOSPlatform("windows7.0")]
public RSACryptoServiceProvider(int dwKeySize, CspParameters? parameters)
: this(dwKeySize, parameters, false)
{
}
+ [MinimumOSPlatform("windows7.0")]
public RSACryptoServiceProvider(CspParameters? parameters)
: this(0, parameters, true)
{
/// <summary>
/// CspKeyContainerInfo property
/// </summary>
+ [MinimumOSPlatform("windows7.0")]
public CspKeyContainerInfo CspKeyContainerInfo
{
get
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IncludePlatformAttributes>true</IncludePlatformAttributes>
</PropertyGroup>
</Project>
\ No newline at end of file
{
public X509Chain() { }
public X509Chain(bool useMachineContext) { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public X509Chain(System.IntPtr chainContext) { }
public System.IntPtr ChainContext { get { throw null; } }
public System.Security.Cryptography.X509Certificates.X509ChainElementCollection ChainElements { get { throw null; } }
using SafeX509ChainHandle = Microsoft.Win32.SafeHandles.SafeX509ChainHandle;
using Internal.Cryptography.Pal;
using System.Diagnostics;
+using System.Runtime.Versioning;
namespace System.Security.Cryptography.X509Certificates
{
_useMachineContext = useMachineContext;
}
+ [MinimumOSPlatform("windows7.0")]
public X509Chain(IntPtr chainContext)
{
_pal = ChainPal.FromHandle(chainContext);
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
<IsNETCoreAppRef>false</IsNETCoreAppRef>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
<PropertyGroup>
<StrongNameKeyId>Microsoft</StrongNameKeyId>
<IsNETCoreApp>true</IsNETCoreApp>
+ <IsWindowsSpecific>true</IsWindowsSpecific>
</PropertyGroup>
</Project>
\ No newline at end of file
public static void ResetAbort() { }
[System.ObsoleteAttribute("Thread.Resume has been deprecated. Please use other classes in System.Threading, such as Monitor, Mutex, Event, and Semaphore, to synchronize Threads or protect resources. https://go.microsoft.com/fwlink/?linkid=14202", false)]
public void Resume() { }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public void SetApartmentState(System.Threading.ApartmentState state) { }
[System.ObsoleteAttribute("Thread.SetCompressedStack is no longer supported. Please use the System.Threading.CompressedStack class")]
public void SetCompressedStack(System.Threading.CompressedStack stack) { }
public EventWaitHandle(bool initialState, System.Threading.EventResetMode mode) { }
public EventWaitHandle(bool initialState, System.Threading.EventResetMode mode, string? name) { }
public EventWaitHandle(bool initialState, System.Threading.EventResetMode mode, string? name, out bool createdNew) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.Threading.EventWaitHandle OpenExisting(string name) { throw null; }
public bool Reset() { throw null; }
public bool Set() { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static bool TryOpenExisting(string name, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Threading.EventWaitHandle? result) { throw null; }
}
public sealed partial class ExecutionContext : System.IDisposable, System.Runtime.Serialization.ISerializable
public Semaphore(int initialCount, int maximumCount) { }
public Semaphore(int initialCount, int maximumCount, string? name) { }
public Semaphore(int initialCount, int maximumCount, string? name, out bool createdNew) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static System.Threading.Semaphore OpenExisting(string name) { throw null; }
public int Release() { throw null; }
public int Release(int releaseCount) { throw null; }
+ [System.Runtime.Versioning.MinimumOSPlatformAttribute("windows7.0")]
public static bool TryOpenExisting(string name, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Threading.Semaphore? result) { throw null; }
}
public partial class SemaphoreFullException : System.SystemException