repo_name
stringclasses 6
values | pr_number
int64 512
78.9k
| pr_title
stringlengths 3
144
| pr_description
stringlengths 0
30.3k
| author
stringlengths 2
21
| date_created
timestamp[ns, tz=UTC] | date_merged
timestamp[ns, tz=UTC] | previous_commit
stringlengths 40
40
| pr_commit
stringlengths 40
40
| query
stringlengths 17
30.4k
| filepath
stringlengths 9
210
| before_content
stringlengths 0
112M
| after_content
stringlengths 0
112M
| label
int64 -1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/Microsoft.Extensions.Logging.Configuration/src/ILoggerProviderConfiguration.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.Extensions.Configuration;
namespace Microsoft.Extensions.Logging.Configuration
{
/// <summary>
/// Allows access to configuration section associated with logger provider
/// </summary>
/// <typeparam name="T">Type of logger provider to get configuration for</typeparam>
public interface ILoggerProviderConfiguration<T>
{
/// <summary>
/// Configuration section for requested logger provider
/// </summary>
IConfiguration Configuration { get; }
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.Extensions.Configuration;
namespace Microsoft.Extensions.Logging.Configuration
{
/// <summary>
/// Allows access to configuration section associated with logger provider
/// </summary>
/// <typeparam name="T">Type of logger provider to get configuration for</typeparam>
public interface ILoggerProviderConfiguration<T>
{
/// <summary>
/// Configuration section for requested logger provider
/// </summary>
IConfiguration Configuration { get; }
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/coreclr/nativeaot/System.Private.Interop/src/Internal/Runtime/CompilerHelpers/RuntimeInteropData.CoreRT.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using Internal.Runtime.Augments;
using Internal.NativeFormat;
using Internal.Runtime.TypeLoader;
using Internal.Reflection.Execution;
using System.Runtime.InteropServices;
namespace Internal.Runtime.CompilerHelpers
{
internal partial class RuntimeInteropData
{
public override IntPtr GetForwardDelegateCreationStub(RuntimeTypeHandle delegateTypeHandle)
{
GetMarshallersForDelegate(delegateTypeHandle, out _, out _, out IntPtr delegateCreationStub);
if (delegateCreationStub == IntPtr.Zero)
throw new MissingInteropDataException(SR.DelegateMarshalling_MissingInteropData, Type.GetTypeFromHandle(delegateTypeHandle));
return delegateCreationStub;
}
public override IntPtr GetDelegateMarshallingStub(RuntimeTypeHandle delegateTypeHandle, bool openStaticDelegate)
{
GetMarshallersForDelegate(delegateTypeHandle, out IntPtr openStub, out IntPtr closedStub, out _);
IntPtr pStub = openStaticDelegate ? openStub : closedStub;
if (pStub == IntPtr.Zero)
throw new MissingInteropDataException(SR.DelegateMarshalling_MissingInteropData, Type.GetTypeFromHandle(delegateTypeHandle));
return pStub;
}
#region "Struct Data"
public override bool TryGetStructUnmarshalStub(RuntimeTypeHandle structureTypeHandle, out IntPtr unmarshalStub)
=> TryGetMarshallersForStruct(structureTypeHandle, out _, out unmarshalStub, out _, out _, out _);
public override bool TryGetStructMarshalStub(RuntimeTypeHandle structureTypeHandle, out IntPtr marshalStub)
=> TryGetMarshallersForStruct(structureTypeHandle, out marshalStub, out _, out _, out _, out _);
public override bool TryGetDestroyStructureStub(RuntimeTypeHandle structureTypeHandle, out IntPtr destroyStub, out bool hasInvalidLayout)
=> TryGetMarshallersForStruct(structureTypeHandle, out _, out _, out destroyStub, out hasInvalidLayout, out _);
public override bool TryGetStructUnsafeStructSize(RuntimeTypeHandle structureTypeHandle, out int size)
=> TryGetMarshallersForStruct(structureTypeHandle, out _, out _, out _, out _, out size);
public override bool TryGetStructFieldOffset(RuntimeTypeHandle structureTypeHandle, string fieldName, out bool structExists, out uint offset)
{
NativeParser entryParser;
structExists = false;
if (TryGetStructData(structureTypeHandle, out _, out entryParser))
{
structExists = true;
uint mask = entryParser.GetUnsigned();
if ((mask & InteropDataConstants.HasMarshallers) != 0)
{
// skip the first 4 IntPtrs(3 stubs and size)
entryParser.SkipInteger();
entryParser.SkipInteger();
entryParser.SkipInteger();
entryParser.SkipInteger();
}
uint fieldCount = mask >> InteropDataConstants.FieldCountShift;
for (uint index = 0; index < fieldCount; index++)
{
string name = entryParser.GetString();
offset = entryParser.GetUnsigned();
if (name == fieldName)
{
return true;
}
}
}
offset = 0;
return false;
}
#endregion
private static unsafe bool TryGetNativeReaderForBlob(NativeFormatModuleInfo module, ReflectionMapBlob blob, out NativeReader reader)
{
byte* pBlob;
uint cbBlob;
if (module.TryFindBlob((int)blob, out pBlob, out cbBlob))
{
reader = new NativeReader(pBlob, cbBlob);
return true;
}
reader = default(NativeReader);
return false;
}
private unsafe bool GetMarshallersForDelegate(RuntimeTypeHandle delegateTypeHandle, out IntPtr openStub, out IntPtr closedStub, out IntPtr delegateCreationStub)
{
int delegateHashcode = delegateTypeHandle.GetHashCode();
openStub = IntPtr.Zero;
closedStub = IntPtr.Zero;
delegateCreationStub = IntPtr.Zero;
foreach (NativeFormatModuleInfo module in ModuleList.EnumerateModules())
{
NativeReader delegateMapReader;
if (TryGetNativeReaderForBlob(module, ReflectionMapBlob.DelegateMarshallingStubMap, out delegateMapReader))
{
NativeParser delegateMapParser = new NativeParser(delegateMapReader, 0);
NativeHashtable delegateHashtable = new NativeHashtable(delegateMapParser);
ExternalReferencesTable externalReferences = default(ExternalReferencesTable);
externalReferences.InitializeCommonFixupsTable(module);
var lookup = delegateHashtable.Lookup(delegateHashcode);
NativeParser entryParser;
while (!(entryParser = lookup.GetNext()).IsNull)
{
RuntimeTypeHandle foundDelegateType = externalReferences.GetRuntimeTypeHandleFromIndex(entryParser.GetUnsigned());
if (foundDelegateType.Equals(delegateTypeHandle))
{
openStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
closedStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
delegateCreationStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
return true;
}
}
}
}
return false;
}
private unsafe bool TryGetStructData(RuntimeTypeHandle structTypeHandle, out ExternalReferencesTable externalReferences, out NativeParser entryParser)
{
int structHashcode = structTypeHandle.GetHashCode();
externalReferences = default(ExternalReferencesTable);
entryParser = default(NativeParser);
foreach (NativeFormatModuleInfo module in ModuleList.EnumerateModules())
{
NativeReader structMapReader;
if (TryGetNativeReaderForBlob(module, ReflectionMapBlob.StructMarshallingStubMap, out structMapReader))
{
NativeParser structMapParser = new NativeParser(structMapReader, 0);
NativeHashtable structHashtable = new NativeHashtable(structMapParser);
externalReferences.InitializeCommonFixupsTable(module);
var lookup = structHashtable.Lookup(structHashcode);
while (!(entryParser = lookup.GetNext()).IsNull)
{
RuntimeTypeHandle foundStructType = externalReferences.GetRuntimeTypeHandleFromIndex(entryParser.GetUnsigned());
if (foundStructType.Equals(structTypeHandle))
{
return true;
}
}
}
}
return false;
}
private unsafe bool TryGetMarshallersForStruct(RuntimeTypeHandle structTypeHandle, out IntPtr marshalStub, out IntPtr unmarshalStub, out IntPtr destroyStub, out bool hasInvalidLayout, out int size)
{
marshalStub = IntPtr.Zero;
unmarshalStub = IntPtr.Zero;
destroyStub = IntPtr.Zero;
hasInvalidLayout = true;
size = 0;
ExternalReferencesTable externalReferences;
NativeParser entryParser;
if (TryGetStructData(structTypeHandle, out externalReferences, out entryParser))
{
uint mask = entryParser.GetUnsigned();
if ((mask & InteropDataConstants.HasMarshallers) != 0)
{
hasInvalidLayout = (mask & InteropDataConstants.HasInvalidLayout) != 0;
size = (int)entryParser.GetUnsigned();
marshalStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
unmarshalStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
destroyStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
return true;
}
}
return false;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using Internal.Runtime.Augments;
using Internal.NativeFormat;
using Internal.Runtime.TypeLoader;
using Internal.Reflection.Execution;
using System.Runtime.InteropServices;
namespace Internal.Runtime.CompilerHelpers
{
internal partial class RuntimeInteropData
{
public override IntPtr GetForwardDelegateCreationStub(RuntimeTypeHandle delegateTypeHandle)
{
GetMarshallersForDelegate(delegateTypeHandle, out _, out _, out IntPtr delegateCreationStub);
if (delegateCreationStub == IntPtr.Zero)
throw new MissingInteropDataException(SR.DelegateMarshalling_MissingInteropData, Type.GetTypeFromHandle(delegateTypeHandle));
return delegateCreationStub;
}
public override IntPtr GetDelegateMarshallingStub(RuntimeTypeHandle delegateTypeHandle, bool openStaticDelegate)
{
GetMarshallersForDelegate(delegateTypeHandle, out IntPtr openStub, out IntPtr closedStub, out _);
IntPtr pStub = openStaticDelegate ? openStub : closedStub;
if (pStub == IntPtr.Zero)
throw new MissingInteropDataException(SR.DelegateMarshalling_MissingInteropData, Type.GetTypeFromHandle(delegateTypeHandle));
return pStub;
}
#region "Struct Data"
public override bool TryGetStructUnmarshalStub(RuntimeTypeHandle structureTypeHandle, out IntPtr unmarshalStub)
=> TryGetMarshallersForStruct(structureTypeHandle, out _, out unmarshalStub, out _, out _, out _);
public override bool TryGetStructMarshalStub(RuntimeTypeHandle structureTypeHandle, out IntPtr marshalStub)
=> TryGetMarshallersForStruct(structureTypeHandle, out marshalStub, out _, out _, out _, out _);
public override bool TryGetDestroyStructureStub(RuntimeTypeHandle structureTypeHandle, out IntPtr destroyStub, out bool hasInvalidLayout)
=> TryGetMarshallersForStruct(structureTypeHandle, out _, out _, out destroyStub, out hasInvalidLayout, out _);
public override bool TryGetStructUnsafeStructSize(RuntimeTypeHandle structureTypeHandle, out int size)
=> TryGetMarshallersForStruct(structureTypeHandle, out _, out _, out _, out _, out size);
public override bool TryGetStructFieldOffset(RuntimeTypeHandle structureTypeHandle, string fieldName, out bool structExists, out uint offset)
{
NativeParser entryParser;
structExists = false;
if (TryGetStructData(structureTypeHandle, out _, out entryParser))
{
structExists = true;
uint mask = entryParser.GetUnsigned();
if ((mask & InteropDataConstants.HasMarshallers) != 0)
{
// skip the first 4 IntPtrs(3 stubs and size)
entryParser.SkipInteger();
entryParser.SkipInteger();
entryParser.SkipInteger();
entryParser.SkipInteger();
}
uint fieldCount = mask >> InteropDataConstants.FieldCountShift;
for (uint index = 0; index < fieldCount; index++)
{
string name = entryParser.GetString();
offset = entryParser.GetUnsigned();
if (name == fieldName)
{
return true;
}
}
}
offset = 0;
return false;
}
#endregion
private static unsafe bool TryGetNativeReaderForBlob(NativeFormatModuleInfo module, ReflectionMapBlob blob, out NativeReader reader)
{
byte* pBlob;
uint cbBlob;
if (module.TryFindBlob((int)blob, out pBlob, out cbBlob))
{
reader = new NativeReader(pBlob, cbBlob);
return true;
}
reader = default(NativeReader);
return false;
}
private unsafe bool GetMarshallersForDelegate(RuntimeTypeHandle delegateTypeHandle, out IntPtr openStub, out IntPtr closedStub, out IntPtr delegateCreationStub)
{
int delegateHashcode = delegateTypeHandle.GetHashCode();
openStub = IntPtr.Zero;
closedStub = IntPtr.Zero;
delegateCreationStub = IntPtr.Zero;
foreach (NativeFormatModuleInfo module in ModuleList.EnumerateModules())
{
NativeReader delegateMapReader;
if (TryGetNativeReaderForBlob(module, ReflectionMapBlob.DelegateMarshallingStubMap, out delegateMapReader))
{
NativeParser delegateMapParser = new NativeParser(delegateMapReader, 0);
NativeHashtable delegateHashtable = new NativeHashtable(delegateMapParser);
ExternalReferencesTable externalReferences = default(ExternalReferencesTable);
externalReferences.InitializeCommonFixupsTable(module);
var lookup = delegateHashtable.Lookup(delegateHashcode);
NativeParser entryParser;
while (!(entryParser = lookup.GetNext()).IsNull)
{
RuntimeTypeHandle foundDelegateType = externalReferences.GetRuntimeTypeHandleFromIndex(entryParser.GetUnsigned());
if (foundDelegateType.Equals(delegateTypeHandle))
{
openStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
closedStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
delegateCreationStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
return true;
}
}
}
}
return false;
}
private unsafe bool TryGetStructData(RuntimeTypeHandle structTypeHandle, out ExternalReferencesTable externalReferences, out NativeParser entryParser)
{
int structHashcode = structTypeHandle.GetHashCode();
externalReferences = default(ExternalReferencesTable);
entryParser = default(NativeParser);
foreach (NativeFormatModuleInfo module in ModuleList.EnumerateModules())
{
NativeReader structMapReader;
if (TryGetNativeReaderForBlob(module, ReflectionMapBlob.StructMarshallingStubMap, out structMapReader))
{
NativeParser structMapParser = new NativeParser(structMapReader, 0);
NativeHashtable structHashtable = new NativeHashtable(structMapParser);
externalReferences.InitializeCommonFixupsTable(module);
var lookup = structHashtable.Lookup(structHashcode);
while (!(entryParser = lookup.GetNext()).IsNull)
{
RuntimeTypeHandle foundStructType = externalReferences.GetRuntimeTypeHandleFromIndex(entryParser.GetUnsigned());
if (foundStructType.Equals(structTypeHandle))
{
return true;
}
}
}
}
return false;
}
private unsafe bool TryGetMarshallersForStruct(RuntimeTypeHandle structTypeHandle, out IntPtr marshalStub, out IntPtr unmarshalStub, out IntPtr destroyStub, out bool hasInvalidLayout, out int size)
{
marshalStub = IntPtr.Zero;
unmarshalStub = IntPtr.Zero;
destroyStub = IntPtr.Zero;
hasInvalidLayout = true;
size = 0;
ExternalReferencesTable externalReferences;
NativeParser entryParser;
if (TryGetStructData(structTypeHandle, out externalReferences, out entryParser))
{
uint mask = entryParser.GetUnsigned();
if ((mask & InteropDataConstants.HasMarshallers) != 0)
{
hasInvalidLayout = (mask & InteropDataConstants.HasInvalidLayout) != 0;
size = (int)entryParser.GetUnsigned();
marshalStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
unmarshalStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
destroyStub = externalReferences.GetIntPtrFromIndex(entryParser.GetUnsigned());
return true;
}
}
return false;
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Xunit;
namespace System.Threading.Tasks.Tests
{
public sealed class ParallelForEachAsyncTests
{
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void InvalidArguments_ThrowsException()
{
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IEnumerable<int>)null, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IEnumerable<int>)null, CancellationToken.None, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IEnumerable<int>)null, new ParallelOptions(), (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IAsyncEnumerable<int>)null, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IAsyncEnumerable<int>)null, CancellationToken.None, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IAsyncEnumerable<int>)null, new ParallelOptions(), (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("parallelOptions", () => { Parallel.ForEachAsync(Enumerable.Range(1, 10), null, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("parallelOptions", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), null, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(Enumerable.Range(1, 10), null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(Enumerable.Range(1, 10), CancellationToken.None, null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(Enumerable.Range(1, 10), new ParallelOptions(), null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), CancellationToken.None, null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), new ParallelOptions(), null); });
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void PreCanceled_CancelsSynchronously()
{
var box = new StrongBox<bool>(false);
var cts = new CancellationTokenSource();
cts.Cancel();
void AssertCanceled(Task t)
{
Assert.True(t.IsCanceled);
var oce = Assert.ThrowsAny<OperationCanceledException>(() => t.GetAwaiter().GetResult());
Assert.Equal(cts.Token, oce.CancellationToken);
}
Func<int, CancellationToken, ValueTask> body = (item, cancellationToken) =>
{
Assert.False(true, "Should not have been invoked");
return default;
};
AssertCanceled(Parallel.ForEachAsync(MarkStart(box), cts.Token, body));
AssertCanceled(Parallel.ForEachAsync(MarkStartAsync(box), cts.Token, body));
AssertCanceled(Parallel.ForEachAsync(MarkStart(box), new ParallelOptions { CancellationToken = cts.Token }, body));
AssertCanceled(Parallel.ForEachAsync(MarkStartAsync(box), new ParallelOptions { CancellationToken = cts.Token }, body));
Assert.False(box.Value);
static IEnumerable<int> MarkStart(StrongBox<bool> box)
{
Assert.False(box.Value);
box.Value = true;
yield return 0;
}
static async IAsyncEnumerable<int> MarkStartAsync(StrongBox<bool> box)
{
Assert.False(box.Value);
box.Value = true;
yield return 0;
await Task.Yield();
}
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(-1)]
[InlineData(1)]
[InlineData(2)]
[InlineData(4)]
[InlineData(128)]
public async Task Dop_WorkersCreatedRespectingLimit_Sync(int dop)
{
static IEnumerable<int> IterateUntilSet(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(IterateUntilSet(box), new ParallelOptions { MaxDegreeOfParallelism = dop }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, dop == -1 ? Environment.ProcessorCount : dop);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(-1)]
[InlineData(1)]
[InlineData(2)]
[InlineData(4)]
[InlineData(128)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/50566", TestPlatforms.Android)]
public async Task Dop_WorkersCreatedRespectingLimitAndTaskScheduler_Sync(int dop)
{
static IEnumerable<int> IterateUntilSet(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
const int MaxSchedulerLimit = 2;
Task t = Parallel.ForEachAsync(IterateUntilSet(box), new ParallelOptions { MaxDegreeOfParallelism = dop, TaskScheduler = new MaxConcurrencyLevelPassthroughTaskScheduler(MaxSchedulerLimit) }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, Math.Min(MaxSchedulerLimit, dop == -1 ? Environment.ProcessorCount : dop));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_Sync()
{
static IEnumerable<int> IterateUntilSet(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(IterateUntilSet(box), new ParallelOptions { TaskScheduler = new MaxConcurrencyLevelPassthroughTaskScheduler(-42) }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, Environment.ProcessorCount);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_Async()
{
static async IAsyncEnumerable<int> IterateUntilSet(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
await Task.Yield();
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(IterateUntilSet(box), new ParallelOptions { TaskScheduler = new MaxConcurrencyLevelPassthroughTaskScheduler(-42) }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, Environment.ProcessorCount);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Sync()
{
static IEnumerable<int> Iterate()
{
while (true) yield return 0;
}
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(Iterate(), cts.Token, (item, cancellationToken) => default);
Assert.False(t.IsCompleted);
cts.Cancel();
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Async()
{
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
static async IAsyncEnumerable<int> IterateAsync()
#pragma warning restore CS1998
{
while (true) yield return 0;
}
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(IterateAsync(), cts.Token, (item, cancellationToken) => default);
Assert.False(t.IsCompleted);
cts.Cancel();
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(-1)]
[InlineData(1)]
[InlineData(2)]
[InlineData(4)]
[InlineData(128)]
public async Task Dop_WorkersCreatedRespectingLimit_Async(int dop)
{
static async IAsyncEnumerable<int> IterateUntilSetAsync(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
await Task.Yield();
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(IterateUntilSetAsync(box), new ParallelOptions { MaxDegreeOfParallelism = dop }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, dop == -1 ? Environment.ProcessorCount : dop);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task EmptySource_Sync()
{
int counter = 0;
await Parallel.ForEachAsync(Enumerable.Range(0, 0), (item, cancellationToken) =>
{
Interlocked.Increment(ref counter);
return default;
});
Assert.Equal(0, counter);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task EmptySource_Async()
{
int counter = 0;
await Parallel.ForEachAsync(EnumerableRangeAsync(0, 0), (item, cancellationToken) =>
{
Interlocked.Increment(ref counter);
return default;
});
Assert.Equal(0, counter);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task AllItemsEnumeratedOnce_Sync(bool yield)
{
const int Start = 10, Count = 100;
var set = new HashSet<int>();
await Parallel.ForEachAsync(Enumerable.Range(Start, Count), async (item, cancellationToken) =>
{
lock (set)
{
Assert.True(set.Add(item));
}
if (yield)
{
await Task.Yield();
}
});
for (int i = Start; i < Start + Count; i++)
{
Assert.True(set.Contains(i));
}
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task AllItemsEnumeratedOnce_Async(bool yield)
{
const int Start = 10, Count = 100;
var set = new HashSet<int>();
await Parallel.ForEachAsync(EnumerableRangeAsync(Start, Count, yield), async (item, cancellationToken) =>
{
lock (set)
{
Assert.True(set.Add(item));
}
if (yield)
{
await Task.Yield();
}
});
for (int i = Start; i < Start + Count; i++)
{
Assert.True(set.Contains(i));
}
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Sync(bool defaultScheduler)
{
TaskScheduler scheduler = defaultScheduler ?
TaskScheduler.Default :
new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
TaskScheduler otherScheduler = new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
IEnumerable<int> Iterate()
{
Assert.Same(scheduler, TaskScheduler.Current);
for (int i = 1; i <= 100; i++)
{
yield return i;
Assert.Same(scheduler, TaskScheduler.Current);
}
}
var cq = new ConcurrentQueue<int>();
await Parallel.ForEachAsync(Iterate(), new ParallelOptions { TaskScheduler = scheduler }, async (item, cancellationToken) =>
{
Assert.Same(scheduler, TaskScheduler.Current);
await Task.Yield();
cq.Enqueue(item);
if (item % 10 == 0)
{
await new SwitchTo(otherScheduler);
}
});
Assert.Equal(Enumerable.Range(1, 100), cq.OrderBy(i => i));
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Async(bool defaultScheduler)
{
TaskScheduler scheduler = defaultScheduler ?
TaskScheduler.Default :
new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
TaskScheduler otherScheduler = new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
async IAsyncEnumerable<int> Iterate()
{
Assert.Same(scheduler, TaskScheduler.Current);
for (int i = 1; i <= 100; i++)
{
await Task.Yield();
yield return i;
Assert.Same(scheduler, TaskScheduler.Current);
}
}
var cq = new ConcurrentQueue<int>();
await Parallel.ForEachAsync(Iterate(), new ParallelOptions { TaskScheduler = scheduler }, async (item, cancellationToken) =>
{
Assert.Same(scheduler, TaskScheduler.Current);
await Task.Yield();
cq.Enqueue(item);
if (item % 10 == 0)
{
await new SwitchTo(otherScheduler);
}
});
Assert.Equal(Enumerable.Range(1, 100), cq.OrderBy(i => i));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_Sync()
{
static async IAsyncEnumerable<int> Infinite()
{
int i = 0;
while (true)
{
await Task.Yield();
yield return i++;
}
}
using var cts = new CancellationTokenSource(10);
OperationCanceledException oce = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => Parallel.ForEachAsync(Infinite(), cts.Token, async (item, cancellationToken) =>
{
await Task.Yield();
}));
Assert.Equal(cts.Token, oce.CancellationToken);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_Async()
{
static async IAsyncEnumerable<int> InfiniteAsync()
{
int i = 0;
while (true)
{
await Task.Yield();
yield return i++;
}
}
using var cts = new CancellationTokenSource(10);
OperationCanceledException oce = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => Parallel.ForEachAsync(InfiniteAsync(), cts.Token, async (item, cancellationToken) =>
{
await Task.Yield();
}));
Assert.Equal(cts.Token, oce.CancellationToken);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_CorrectTokenPassedToAsyncEnumerator()
{
static async IAsyncEnumerable<CancellationToken> YieldTokenAsync([EnumeratorCancellation] CancellationToken cancellationToken)
{
await Task.Yield();
yield return cancellationToken;
}
await Parallel.ForEachAsync(YieldTokenAsync(default), (item, cancellationToken) =>
{
Assert.Equal(cancellationToken, item);
return default;
});
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_SameTokenPassedToEveryInvocation_Sync()
{
var cq = new ConcurrentQueue<CancellationToken>();
await Parallel.ForEachAsync(Enumerable.Range(1, 100), async (item, cancellationToken) =>
{
cq.Enqueue(cancellationToken);
await Task.Yield();
});
Assert.Equal(100, cq.Count);
Assert.Equal(1, cq.Distinct().Count());
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_SameTokenPassedToEveryInvocation_Async()
{
var cq = new ConcurrentQueue<CancellationToken>();
await Parallel.ForEachAsync(EnumerableRangeAsync(1, 100), async (item, cancellationToken) =>
{
cq.Enqueue(cancellationToken);
await Task.Yield();
});
Assert.Equal(100, cq.Count);
Assert.Equal(1, cq.Distinct().Count());
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_HasPriorityOverExceptions_Sync()
{
static IEnumerable<int> Iterate()
{
int counter = 0;
while (true) yield return counter++;
}
var tcs = new TaskCompletionSource();
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { CancellationToken = cts.Token, MaxDegreeOfParallelism = 2 }, async (item, cancellationToken) =>
{
if (item == 0)
{
await tcs.Task;
cts.Cancel();
throw new FormatException();
}
else
{
tcs.TrySetResult();
await Task.Yield();
}
});
OperationCanceledException oce = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
Assert.Equal(cts.Token, oce.CancellationToken);
Assert.True(t.IsCanceled);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_HasPriorityOverExceptions_Async()
{
static async IAsyncEnumerable<int> Iterate()
{
int counter = 0;
while (true)
{
await Task.Yield();
yield return counter++;
}
}
var tcs = new TaskCompletionSource();
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { CancellationToken = cts.Token, MaxDegreeOfParallelism = 2 }, async (item, cancellationToken) =>
{
if (item == 0)
{
await tcs.Task;
cts.Cancel();
throw new FormatException();
}
else
{
tcs.TrySetResult();
await Task.Yield();
}
});
OperationCanceledException oce = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
Assert.Equal(cts.Token, oce.CancellationToken);
Assert.True(t.IsCanceled);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task Cancellation_FaultsForOceForNonCancellation(bool internalToken)
{
static async IAsyncEnumerable<int> Iterate()
{
int counter = 0;
while (true)
{
await Task.Yield();
yield return counter++;
}
}
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { CancellationToken = cts.Token }, (item, cancellationToken) =>
{
throw new OperationCanceledException(internalToken ? cancellationToken : cts.Token);
});
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(0, 4)]
[InlineData(1, 4)]
[InlineData(2, 4)]
[InlineData(3, 4)]
[InlineData(4, 4)]
public async Task Cancellation_InternalCancellationExceptionsArentFilteredOut(int numThrowingNonCanceledOce, int total)
{
var cts = new CancellationTokenSource();
var barrier = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
int remainingCount = total;
Task t = Parallel.ForEachAsync(Enumerable.Range(0, total), new ParallelOptions { CancellationToken = cts.Token, MaxDegreeOfParallelism = total }, async (item, cancellationToken) =>
{
// Wait for all operations to be started
if (Interlocked.Decrement(ref remainingCount) == 0)
{
barrier.SetResult();
}
await barrier.Task;
throw item < numThrowingNonCanceledOce ?
new OperationCanceledException(cancellationToken) :
throw new FormatException();
});
await Assert.ThrowsAnyAsync<Exception>(() => t);
Assert.Equal(total, t.Exception.InnerExceptions.Count);
Assert.Equal(numThrowingNonCanceledOce, t.Exception.InnerExceptions.Count(e => e is OperationCanceledException));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void Exception_FromGetEnumerator_Sync()
{
Task t = Parallel.ForEachAsync((IEnumerable<int>)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default);
Assert.True(t.IsFaulted);
Assert.Equal(1, t.Exception.InnerExceptions.Count);
Assert.IsType<FormatException>(t.Exception.InnerException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void Exception_FromGetEnumerator_Async()
{
Task t = Parallel.ForEachAsync((IAsyncEnumerable<int>)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default);
Assert.True(t.IsFaulted);
Assert.Equal(1, t.Exception.InnerExceptions.Count);
Assert.IsType<DivideByZeroException>(t.Exception.InnerException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void Exception_NullFromGetEnumerator_Sync()
{
Task t = Parallel.ForEachAsync((IEnumerable<int>)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default);
Assert.True(t.IsFaulted);
Assert.Equal(1, t.Exception.InnerExceptions.Count);
Assert.IsType<InvalidOperationException>(t.Exception.InnerException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void Exception_NullFromGetEnumerator_Async()
{
Task t = Parallel.ForEachAsync((IAsyncEnumerable<int>)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default);
Assert.True(t.IsFaulted);
Assert.Equal(1, t.Exception.InnerExceptions.Count);
Assert.IsType<InvalidOperationException>(t.Exception.InnerException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromMoveNext_Sync()
{
static IEnumerable<int> Iterate()
{
for (int i = 0; i < 10; i++)
{
if (i == 4)
{
throw new FormatException();
}
yield return i;
}
}
Task t = Parallel.ForEachAsync(Iterate(), (item, cancellationToken) => default);
await Assert.ThrowsAsync<FormatException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromMoveNext_Async()
{
static async IAsyncEnumerable<int> Iterate()
{
for (int i = 0; i < 10; i++)
{
await Task.Yield();
if (i == 4)
{
throw new FormatException();
}
yield return i;
}
}
Task t = Parallel.ForEachAsync(Iterate(), (item, cancellationToken) => default);
await Assert.ThrowsAsync<FormatException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromLoopBody_Sync()
{
static IEnumerable<int> Iterate()
{
yield return 1;
yield return 2;
}
var barrier = new Barrier(2);
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { MaxDegreeOfParallelism = barrier.ParticipantCount }, (item, cancellationToken) =>
{
barrier.SignalAndWait();
throw item switch
{
1 => new FormatException(),
2 => new InvalidTimeZoneException(),
_ => new Exception()
};
});
await Assert.ThrowsAnyAsync<Exception>(() => t);
Assert.True(t.IsFaulted);
Assert.Equal(2, t.Exception.InnerExceptions.Count);
Assert.Contains(t.Exception.InnerExceptions, e => e is FormatException);
Assert.Contains(t.Exception.InnerExceptions, e => e is InvalidTimeZoneException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromLoopBody_Async()
{
static async IAsyncEnumerable<int> Iterate()
{
await Task.Yield();
yield return 1;
yield return 2;
yield return 3;
yield return 4;
}
int remaining = 4;
var tcs = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { MaxDegreeOfParallelism = 4 }, async (item, cancellationToken) =>
{
if (Interlocked.Decrement(ref remaining) == 0)
{
tcs.SetResult();
}
await tcs.Task;
throw item switch
{
1 => new FormatException(),
2 => new InvalidTimeZoneException(),
3 => new ArithmeticException(),
4 => new DivideByZeroException(),
_ => new Exception()
};
});
await Assert.ThrowsAnyAsync<Exception>(() => t);
Assert.True(t.IsFaulted);
Assert.Equal(4, t.Exception.InnerExceptions.Count);
Assert.Contains(t.Exception.InnerExceptions, e => e is FormatException);
Assert.Contains(t.Exception.InnerExceptions, e => e is InvalidTimeZoneException);
Assert.Contains(t.Exception.InnerExceptions, e => e is ArithmeticException);
Assert.Contains(t.Exception.InnerExceptions, e => e is DivideByZeroException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromDispose_Sync()
{
Task t = Parallel.ForEachAsync((IEnumerable<int>)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default);
await Assert.ThrowsAsync<FormatException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromDispose_Async()
{
Task t = Parallel.ForEachAsync((IAsyncEnumerable<int>)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default);
await Assert.ThrowsAsync<DivideByZeroException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_ImplicitlyCancelsOtherWorkers_Sync()
{
static IEnumerable<int> Iterate()
{
int i = 0;
while (true)
{
yield return i++;
}
}
await Assert.ThrowsAsync<Exception>(() => Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) =>
{
await Task.Yield();
if (item == 1000)
{
throw new Exception();
}
}));
await Assert.ThrowsAsync<FormatException>(() => Parallel.ForEachAsync(Iterate(), new ParallelOptions { MaxDegreeOfParallelism = 2 }, async (item, cancellationToken) =>
{
if (item == 0)
{
throw new FormatException();
}
else
{
Assert.Equal(1, item);
var tcs = new TaskCompletionSource();
cancellationToken.Register(() => tcs.SetResult());
await tcs.Task;
}
}));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_ImplicitlyCancelsOtherWorkers_Async()
{
static async IAsyncEnumerable<int> Iterate()
{
int i = 0;
while (true)
{
await Task.Yield();
yield return i++;
}
}
await Assert.ThrowsAsync<Exception>(() => Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) =>
{
await Task.Yield();
if (item == 1000)
{
throw new Exception();
}
}));
await Assert.ThrowsAsync<FormatException>(() => Parallel.ForEachAsync(Iterate(), new ParallelOptions { MaxDegreeOfParallelism = 2 }, async (item, cancellationToken) =>
{
if (item == 0)
{
throw new FormatException();
}
else
{
Assert.Equal(1, item);
var tcs = new TaskCompletionSource();
cancellationToken.Register(() => tcs.SetResult());
await tcs.Task;
}
}));
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task ExecutionContext_FlowsToWorkerBodies_Sync(bool defaultScheduler)
{
TaskScheduler scheduler = defaultScheduler ?
TaskScheduler.Default :
new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
static IEnumerable<int> Iterate()
{
for (int i = 0; i < 100; i++)
{
yield return i;
}
}
var al = new AsyncLocal<int>();
al.Value = 42;
await Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) =>
{
await Task.Yield();
Assert.Equal(42, al.Value);
});
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false, false)]
[InlineData(false, true)]
[InlineData(true, false)]
[InlineData(true, true)]
public async Task ExecutionContext_FlowsToWorkerBodies_Async(bool defaultScheduler, bool flowContext)
{
TaskScheduler scheduler = defaultScheduler ?
TaskScheduler.Default :
new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
static async IAsyncEnumerable<int> Iterate()
{
for (int i = 0; i < 100; i++)
{
await Task.Yield();
yield return i;
}
}
var al = new AsyncLocal<int>();
al.Value = 42;
if (!flowContext)
{
ExecutionContext.SuppressFlow();
}
Task t = Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) =>
{
await Task.Yield();
Assert.Equal(flowContext ? 42 : 0, al.Value);
});
if (!flowContext)
{
ExecutionContext.RestoreFlow();
}
await t;
}
private static async IAsyncEnumerable<int> EnumerableRangeAsync(int start, int count, bool yield = true)
{
for (int i = start; i < start + count; i++)
{
if (yield)
{
await Task.Yield();
}
yield return i;
}
}
private sealed class ThrowsFromGetEnumerator : IAsyncEnumerable<int>, IEnumerable<int>
{
public IAsyncEnumerator<int> GetAsyncEnumerator(CancellationToken cancellationToken = default) => throw new DivideByZeroException();
public IEnumerator<int> GetEnumerator() => throw new FormatException();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
private sealed class ReturnsNullFromGetEnumerator : IAsyncEnumerable<int>, IEnumerable<int>
{
public IAsyncEnumerator<int> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;
public IEnumerator<int> GetEnumerator() => null;
IEnumerator IEnumerable.GetEnumerator() => null;
}
private sealed class ThrowsExceptionFromDispose : IAsyncEnumerable<int>, IEnumerable<int>, IAsyncEnumerator<int>, IEnumerator<int>
{
public int Current => throw new NotImplementedException();
object IEnumerator.Current => throw new NotImplementedException();
public void Dispose() => throw new FormatException();
public ValueTask DisposeAsync() => throw new DivideByZeroException();
public IAsyncEnumerator<int> GetAsyncEnumerator(CancellationToken cancellationToken = default) => this;
public IEnumerator<int> GetEnumerator() => this;
IEnumerator IEnumerable.GetEnumerator() => this;
public bool MoveNext() => false;
public ValueTask<bool> MoveNextAsync() => new ValueTask<bool>(false);
public void Reset() => throw new NotImplementedException();
}
private sealed class SwitchTo : INotifyCompletion
{
private readonly TaskScheduler _scheduler;
public SwitchTo(TaskScheduler scheduler) => _scheduler = scheduler;
public SwitchTo GetAwaiter() => this;
public bool IsCompleted => false;
public void GetResult() { }
public void OnCompleted(Action continuation) => Task.Factory.StartNew(continuation, CancellationToken.None, TaskCreationOptions.None, _scheduler);
}
private sealed class MaxConcurrencyLevelPassthroughTaskScheduler : TaskScheduler
{
public MaxConcurrencyLevelPassthroughTaskScheduler(int maximumConcurrencyLevel) =>
MaximumConcurrencyLevel = maximumConcurrencyLevel;
protected override IEnumerable<Task> GetScheduledTasks() => Array.Empty<Task>();
protected override void QueueTask(Task task) => ThreadPool.QueueUserWorkItem(_ => TryExecuteTask(task));
protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) => TryExecuteTask(task);
public override int MaximumConcurrencyLevel { 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.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using Xunit;
namespace System.Threading.Tasks.Tests
{
public sealed class ParallelForEachAsyncTests
{
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void InvalidArguments_ThrowsException()
{
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IEnumerable<int>)null, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IEnumerable<int>)null, CancellationToken.None, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IEnumerable<int>)null, new ParallelOptions(), (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IAsyncEnumerable<int>)null, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IAsyncEnumerable<int>)null, CancellationToken.None, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("source", () => { Parallel.ForEachAsync((IAsyncEnumerable<int>)null, new ParallelOptions(), (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("parallelOptions", () => { Parallel.ForEachAsync(Enumerable.Range(1, 10), null, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("parallelOptions", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), null, (item, cancellationToken) => default); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(Enumerable.Range(1, 10), null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(Enumerable.Range(1, 10), CancellationToken.None, null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(Enumerable.Range(1, 10), new ParallelOptions(), null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), CancellationToken.None, null); });
AssertExtensions.Throws<ArgumentNullException>("body", () => { Parallel.ForEachAsync(EnumerableRangeAsync(1, 10), new ParallelOptions(), null); });
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void PreCanceled_CancelsSynchronously()
{
var box = new StrongBox<bool>(false);
var cts = new CancellationTokenSource();
cts.Cancel();
void AssertCanceled(Task t)
{
Assert.True(t.IsCanceled);
var oce = Assert.ThrowsAny<OperationCanceledException>(() => t.GetAwaiter().GetResult());
Assert.Equal(cts.Token, oce.CancellationToken);
}
Func<int, CancellationToken, ValueTask> body = (item, cancellationToken) =>
{
Assert.False(true, "Should not have been invoked");
return default;
};
AssertCanceled(Parallel.ForEachAsync(MarkStart(box), cts.Token, body));
AssertCanceled(Parallel.ForEachAsync(MarkStartAsync(box), cts.Token, body));
AssertCanceled(Parallel.ForEachAsync(MarkStart(box), new ParallelOptions { CancellationToken = cts.Token }, body));
AssertCanceled(Parallel.ForEachAsync(MarkStartAsync(box), new ParallelOptions { CancellationToken = cts.Token }, body));
Assert.False(box.Value);
static IEnumerable<int> MarkStart(StrongBox<bool> box)
{
Assert.False(box.Value);
box.Value = true;
yield return 0;
}
static async IAsyncEnumerable<int> MarkStartAsync(StrongBox<bool> box)
{
Assert.False(box.Value);
box.Value = true;
yield return 0;
await Task.Yield();
}
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(-1)]
[InlineData(1)]
[InlineData(2)]
[InlineData(4)]
[InlineData(128)]
public async Task Dop_WorkersCreatedRespectingLimit_Sync(int dop)
{
static IEnumerable<int> IterateUntilSet(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(IterateUntilSet(box), new ParallelOptions { MaxDegreeOfParallelism = dop }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, dop == -1 ? Environment.ProcessorCount : dop);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(-1)]
[InlineData(1)]
[InlineData(2)]
[InlineData(4)]
[InlineData(128)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/50566", TestPlatforms.Android)]
public async Task Dop_WorkersCreatedRespectingLimitAndTaskScheduler_Sync(int dop)
{
static IEnumerable<int> IterateUntilSet(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
const int MaxSchedulerLimit = 2;
Task t = Parallel.ForEachAsync(IterateUntilSet(box), new ParallelOptions { MaxDegreeOfParallelism = dop, TaskScheduler = new MaxConcurrencyLevelPassthroughTaskScheduler(MaxSchedulerLimit) }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, Math.Min(MaxSchedulerLimit, dop == -1 ? Environment.ProcessorCount : dop));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_Sync()
{
static IEnumerable<int> IterateUntilSet(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(IterateUntilSet(box), new ParallelOptions { TaskScheduler = new MaxConcurrencyLevelPassthroughTaskScheduler(-42) }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, Environment.ProcessorCount);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_Async()
{
static async IAsyncEnumerable<int> IterateUntilSet(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
await Task.Yield();
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(IterateUntilSet(box), new ParallelOptions { TaskScheduler = new MaxConcurrencyLevelPassthroughTaskScheduler(-42) }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, Environment.ProcessorCount);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Sync()
{
static IEnumerable<int> Iterate()
{
while (true) yield return 0;
}
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(Iterate(), cts.Token, (item, cancellationToken) => default);
Assert.False(t.IsCompleted);
cts.Cancel();
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Async()
{
#pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously
static async IAsyncEnumerable<int> IterateAsync()
#pragma warning restore CS1998
{
while (true) yield return 0;
}
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(IterateAsync(), cts.Token, (item, cancellationToken) => default);
Assert.False(t.IsCompleted);
cts.Cancel();
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(-1)]
[InlineData(1)]
[InlineData(2)]
[InlineData(4)]
[InlineData(128)]
public async Task Dop_WorkersCreatedRespectingLimit_Async(int dop)
{
static async IAsyncEnumerable<int> IterateUntilSetAsync(StrongBox<bool> box)
{
int counter = 0;
while (!box.Value)
{
await Task.Yield();
yield return counter++;
}
}
var box = new StrongBox<bool>(false);
int activeWorkers = 0;
var block = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(IterateUntilSetAsync(box), new ParallelOptions { MaxDegreeOfParallelism = dop }, async (item, cancellationToken) =>
{
Interlocked.Increment(ref activeWorkers);
await block.Task;
});
Assert.False(t.IsCompleted);
await Task.Delay(20); // give the loop some time to run
box.Value = true;
block.SetResult();
await t;
Assert.InRange(activeWorkers, 0, dop == -1 ? Environment.ProcessorCount : dop);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task EmptySource_Sync()
{
int counter = 0;
await Parallel.ForEachAsync(Enumerable.Range(0, 0), (item, cancellationToken) =>
{
Interlocked.Increment(ref counter);
return default;
});
Assert.Equal(0, counter);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task EmptySource_Async()
{
int counter = 0;
await Parallel.ForEachAsync(EnumerableRangeAsync(0, 0), (item, cancellationToken) =>
{
Interlocked.Increment(ref counter);
return default;
});
Assert.Equal(0, counter);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task AllItemsEnumeratedOnce_Sync(bool yield)
{
const int Start = 10, Count = 100;
var set = new HashSet<int>();
await Parallel.ForEachAsync(Enumerable.Range(Start, Count), async (item, cancellationToken) =>
{
lock (set)
{
Assert.True(set.Add(item));
}
if (yield)
{
await Task.Yield();
}
});
for (int i = Start; i < Start + Count; i++)
{
Assert.True(set.Contains(i));
}
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task AllItemsEnumeratedOnce_Async(bool yield)
{
const int Start = 10, Count = 100;
var set = new HashSet<int>();
await Parallel.ForEachAsync(EnumerableRangeAsync(Start, Count, yield), async (item, cancellationToken) =>
{
lock (set)
{
Assert.True(set.Add(item));
}
if (yield)
{
await Task.Yield();
}
});
for (int i = Start; i < Start + Count; i++)
{
Assert.True(set.Contains(i));
}
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Sync(bool defaultScheduler)
{
TaskScheduler scheduler = defaultScheduler ?
TaskScheduler.Default :
new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
TaskScheduler otherScheduler = new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
IEnumerable<int> Iterate()
{
Assert.Same(scheduler, TaskScheduler.Current);
for (int i = 1; i <= 100; i++)
{
yield return i;
Assert.Same(scheduler, TaskScheduler.Current);
}
}
var cq = new ConcurrentQueue<int>();
await Parallel.ForEachAsync(Iterate(), new ParallelOptions { TaskScheduler = scheduler }, async (item, cancellationToken) =>
{
Assert.Same(scheduler, TaskScheduler.Current);
await Task.Yield();
cq.Enqueue(item);
if (item % 10 == 0)
{
await new SwitchTo(otherScheduler);
}
});
Assert.Equal(Enumerable.Range(1, 100), cq.OrderBy(i => i));
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Async(bool defaultScheduler)
{
TaskScheduler scheduler = defaultScheduler ?
TaskScheduler.Default :
new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
TaskScheduler otherScheduler = new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
async IAsyncEnumerable<int> Iterate()
{
Assert.Same(scheduler, TaskScheduler.Current);
for (int i = 1; i <= 100; i++)
{
await Task.Yield();
yield return i;
Assert.Same(scheduler, TaskScheduler.Current);
}
}
var cq = new ConcurrentQueue<int>();
await Parallel.ForEachAsync(Iterate(), new ParallelOptions { TaskScheduler = scheduler }, async (item, cancellationToken) =>
{
Assert.Same(scheduler, TaskScheduler.Current);
await Task.Yield();
cq.Enqueue(item);
if (item % 10 == 0)
{
await new SwitchTo(otherScheduler);
}
});
Assert.Equal(Enumerable.Range(1, 100), cq.OrderBy(i => i));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_Sync()
{
static async IAsyncEnumerable<int> Infinite()
{
int i = 0;
while (true)
{
await Task.Yield();
yield return i++;
}
}
using var cts = new CancellationTokenSource(10);
OperationCanceledException oce = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => Parallel.ForEachAsync(Infinite(), cts.Token, async (item, cancellationToken) =>
{
await Task.Yield();
}));
Assert.Equal(cts.Token, oce.CancellationToken);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_Async()
{
static async IAsyncEnumerable<int> InfiniteAsync()
{
int i = 0;
while (true)
{
await Task.Yield();
yield return i++;
}
}
using var cts = new CancellationTokenSource(10);
OperationCanceledException oce = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => Parallel.ForEachAsync(InfiniteAsync(), cts.Token, async (item, cancellationToken) =>
{
await Task.Yield();
}));
Assert.Equal(cts.Token, oce.CancellationToken);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_CorrectTokenPassedToAsyncEnumerator()
{
static async IAsyncEnumerable<CancellationToken> YieldTokenAsync([EnumeratorCancellation] CancellationToken cancellationToken)
{
await Task.Yield();
yield return cancellationToken;
}
await Parallel.ForEachAsync(YieldTokenAsync(default), (item, cancellationToken) =>
{
Assert.Equal(cancellationToken, item);
return default;
});
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_SameTokenPassedToEveryInvocation_Sync()
{
var cq = new ConcurrentQueue<CancellationToken>();
await Parallel.ForEachAsync(Enumerable.Range(1, 100), async (item, cancellationToken) =>
{
cq.Enqueue(cancellationToken);
await Task.Yield();
});
Assert.Equal(100, cq.Count);
Assert.Equal(1, cq.Distinct().Count());
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_SameTokenPassedToEveryInvocation_Async()
{
var cq = new ConcurrentQueue<CancellationToken>();
await Parallel.ForEachAsync(EnumerableRangeAsync(1, 100), async (item, cancellationToken) =>
{
cq.Enqueue(cancellationToken);
await Task.Yield();
});
Assert.Equal(100, cq.Count);
Assert.Equal(1, cq.Distinct().Count());
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_HasPriorityOverExceptions_Sync()
{
static IEnumerable<int> Iterate()
{
int counter = 0;
while (true) yield return counter++;
}
var tcs = new TaskCompletionSource();
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { CancellationToken = cts.Token, MaxDegreeOfParallelism = 2 }, async (item, cancellationToken) =>
{
if (item == 0)
{
await tcs.Task;
cts.Cancel();
throw new FormatException();
}
else
{
tcs.TrySetResult();
await Task.Yield();
}
});
OperationCanceledException oce = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
Assert.Equal(cts.Token, oce.CancellationToken);
Assert.True(t.IsCanceled);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Cancellation_HasPriorityOverExceptions_Async()
{
static async IAsyncEnumerable<int> Iterate()
{
int counter = 0;
while (true)
{
await Task.Yield();
yield return counter++;
}
}
var tcs = new TaskCompletionSource();
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { CancellationToken = cts.Token, MaxDegreeOfParallelism = 2 }, async (item, cancellationToken) =>
{
if (item == 0)
{
await tcs.Task;
cts.Cancel();
throw new FormatException();
}
else
{
tcs.TrySetResult();
await Task.Yield();
}
});
OperationCanceledException oce = await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
Assert.Equal(cts.Token, oce.CancellationToken);
Assert.True(t.IsCanceled);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task Cancellation_FaultsForOceForNonCancellation(bool internalToken)
{
static async IAsyncEnumerable<int> Iterate()
{
int counter = 0;
while (true)
{
await Task.Yield();
yield return counter++;
}
}
var cts = new CancellationTokenSource();
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { CancellationToken = cts.Token }, (item, cancellationToken) =>
{
throw new OperationCanceledException(internalToken ? cancellationToken : cts.Token);
});
await Assert.ThrowsAnyAsync<OperationCanceledException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(0, 4)]
[InlineData(1, 4)]
[InlineData(2, 4)]
[InlineData(3, 4)]
[InlineData(4, 4)]
public async Task Cancellation_InternalCancellationExceptionsArentFilteredOut(int numThrowingNonCanceledOce, int total)
{
var cts = new CancellationTokenSource();
var barrier = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously);
int remainingCount = total;
Task t = Parallel.ForEachAsync(Enumerable.Range(0, total), new ParallelOptions { CancellationToken = cts.Token, MaxDegreeOfParallelism = total }, async (item, cancellationToken) =>
{
// Wait for all operations to be started
if (Interlocked.Decrement(ref remainingCount) == 0)
{
barrier.SetResult();
}
await barrier.Task;
throw item < numThrowingNonCanceledOce ?
new OperationCanceledException(cancellationToken) :
throw new FormatException();
});
await Assert.ThrowsAnyAsync<Exception>(() => t);
Assert.Equal(total, t.Exception.InnerExceptions.Count);
Assert.Equal(numThrowingNonCanceledOce, t.Exception.InnerExceptions.Count(e => e is OperationCanceledException));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void Exception_FromGetEnumerator_Sync()
{
Task t = Parallel.ForEachAsync((IEnumerable<int>)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default);
Assert.True(t.IsFaulted);
Assert.Equal(1, t.Exception.InnerExceptions.Count);
Assert.IsType<FormatException>(t.Exception.InnerException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void Exception_FromGetEnumerator_Async()
{
Task t = Parallel.ForEachAsync((IAsyncEnumerable<int>)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default);
Assert.True(t.IsFaulted);
Assert.Equal(1, t.Exception.InnerExceptions.Count);
Assert.IsType<DivideByZeroException>(t.Exception.InnerException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void Exception_NullFromGetEnumerator_Sync()
{
Task t = Parallel.ForEachAsync((IEnumerable<int>)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default);
Assert.True(t.IsFaulted);
Assert.Equal(1, t.Exception.InnerExceptions.Count);
Assert.IsType<InvalidOperationException>(t.Exception.InnerException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void Exception_NullFromGetEnumerator_Async()
{
Task t = Parallel.ForEachAsync((IAsyncEnumerable<int>)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default);
Assert.True(t.IsFaulted);
Assert.Equal(1, t.Exception.InnerExceptions.Count);
Assert.IsType<InvalidOperationException>(t.Exception.InnerException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromMoveNext_Sync()
{
static IEnumerable<int> Iterate()
{
for (int i = 0; i < 10; i++)
{
if (i == 4)
{
throw new FormatException();
}
yield return i;
}
}
Task t = Parallel.ForEachAsync(Iterate(), (item, cancellationToken) => default);
await Assert.ThrowsAsync<FormatException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromMoveNext_Async()
{
static async IAsyncEnumerable<int> Iterate()
{
for (int i = 0; i < 10; i++)
{
await Task.Yield();
if (i == 4)
{
throw new FormatException();
}
yield return i;
}
}
Task t = Parallel.ForEachAsync(Iterate(), (item, cancellationToken) => default);
await Assert.ThrowsAsync<FormatException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromLoopBody_Sync()
{
static IEnumerable<int> Iterate()
{
yield return 1;
yield return 2;
}
var barrier = new Barrier(2);
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { MaxDegreeOfParallelism = barrier.ParticipantCount }, (item, cancellationToken) =>
{
barrier.SignalAndWait();
throw item switch
{
1 => new FormatException(),
2 => new InvalidTimeZoneException(),
_ => new Exception()
};
});
await Assert.ThrowsAnyAsync<Exception>(() => t);
Assert.True(t.IsFaulted);
Assert.Equal(2, t.Exception.InnerExceptions.Count);
Assert.Contains(t.Exception.InnerExceptions, e => e is FormatException);
Assert.Contains(t.Exception.InnerExceptions, e => e is InvalidTimeZoneException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromLoopBody_Async()
{
static async IAsyncEnumerable<int> Iterate()
{
await Task.Yield();
yield return 1;
yield return 2;
yield return 3;
yield return 4;
}
int remaining = 4;
var tcs = new TaskCompletionSource();
Task t = Parallel.ForEachAsync(Iterate(), new ParallelOptions { MaxDegreeOfParallelism = 4 }, async (item, cancellationToken) =>
{
if (Interlocked.Decrement(ref remaining) == 0)
{
tcs.SetResult();
}
await tcs.Task;
throw item switch
{
1 => new FormatException(),
2 => new InvalidTimeZoneException(),
3 => new ArithmeticException(),
4 => new DivideByZeroException(),
_ => new Exception()
};
});
await Assert.ThrowsAnyAsync<Exception>(() => t);
Assert.True(t.IsFaulted);
Assert.Equal(4, t.Exception.InnerExceptions.Count);
Assert.Contains(t.Exception.InnerExceptions, e => e is FormatException);
Assert.Contains(t.Exception.InnerExceptions, e => e is InvalidTimeZoneException);
Assert.Contains(t.Exception.InnerExceptions, e => e is ArithmeticException);
Assert.Contains(t.Exception.InnerExceptions, e => e is DivideByZeroException);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromDispose_Sync()
{
Task t = Parallel.ForEachAsync((IEnumerable<int>)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default);
await Assert.ThrowsAsync<FormatException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_FromDispose_Async()
{
Task t = Parallel.ForEachAsync((IAsyncEnumerable<int>)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default);
await Assert.ThrowsAsync<DivideByZeroException>(() => t);
Assert.True(t.IsFaulted);
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_ImplicitlyCancelsOtherWorkers_Sync()
{
static IEnumerable<int> Iterate()
{
int i = 0;
while (true)
{
yield return i++;
}
}
await Assert.ThrowsAsync<Exception>(() => Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) =>
{
await Task.Yield();
if (item == 1000)
{
throw new Exception();
}
}));
await Assert.ThrowsAsync<FormatException>(() => Parallel.ForEachAsync(Iterate(), new ParallelOptions { MaxDegreeOfParallelism = 2 }, async (item, cancellationToken) =>
{
if (item == 0)
{
throw new FormatException();
}
else
{
Assert.Equal(1, item);
var tcs = new TaskCompletionSource();
cancellationToken.Register(() => tcs.SetResult());
await tcs.Task;
}
}));
}
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task Exception_ImplicitlyCancelsOtherWorkers_Async()
{
static async IAsyncEnumerable<int> Iterate()
{
int i = 0;
while (true)
{
await Task.Yield();
yield return i++;
}
}
await Assert.ThrowsAsync<Exception>(() => Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) =>
{
await Task.Yield();
if (item == 1000)
{
throw new Exception();
}
}));
await Assert.ThrowsAsync<FormatException>(() => Parallel.ForEachAsync(Iterate(), new ParallelOptions { MaxDegreeOfParallelism = 2 }, async (item, cancellationToken) =>
{
if (item == 0)
{
throw new FormatException();
}
else
{
Assert.Equal(1, item);
var tcs = new TaskCompletionSource();
cancellationToken.Register(() => tcs.SetResult());
await tcs.Task;
}
}));
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
public async Task ExecutionContext_FlowsToWorkerBodies_Sync(bool defaultScheduler)
{
TaskScheduler scheduler = defaultScheduler ?
TaskScheduler.Default :
new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
static IEnumerable<int> Iterate()
{
for (int i = 0; i < 100; i++)
{
yield return i;
}
}
var al = new AsyncLocal<int>();
al.Value = 42;
await Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) =>
{
await Task.Yield();
Assert.Equal(42, al.Value);
});
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false, false)]
[InlineData(false, true)]
[InlineData(true, false)]
[InlineData(true, true)]
public async Task ExecutionContext_FlowsToWorkerBodies_Async(bool defaultScheduler, bool flowContext)
{
TaskScheduler scheduler = defaultScheduler ?
TaskScheduler.Default :
new ConcurrentExclusiveSchedulerPair().ConcurrentScheduler;
static async IAsyncEnumerable<int> Iterate()
{
for (int i = 0; i < 100; i++)
{
await Task.Yield();
yield return i;
}
}
var al = new AsyncLocal<int>();
al.Value = 42;
if (!flowContext)
{
ExecutionContext.SuppressFlow();
}
Task t = Parallel.ForEachAsync(Iterate(), async (item, cancellationToken) =>
{
await Task.Yield();
Assert.Equal(flowContext ? 42 : 0, al.Value);
});
if (!flowContext)
{
ExecutionContext.RestoreFlow();
}
await t;
}
private static async IAsyncEnumerable<int> EnumerableRangeAsync(int start, int count, bool yield = true)
{
for (int i = start; i < start + count; i++)
{
if (yield)
{
await Task.Yield();
}
yield return i;
}
}
private sealed class ThrowsFromGetEnumerator : IAsyncEnumerable<int>, IEnumerable<int>
{
public IAsyncEnumerator<int> GetAsyncEnumerator(CancellationToken cancellationToken = default) => throw new DivideByZeroException();
public IEnumerator<int> GetEnumerator() => throw new FormatException();
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
}
private sealed class ReturnsNullFromGetEnumerator : IAsyncEnumerable<int>, IEnumerable<int>
{
public IAsyncEnumerator<int> GetAsyncEnumerator(CancellationToken cancellationToken = default) => null;
public IEnumerator<int> GetEnumerator() => null;
IEnumerator IEnumerable.GetEnumerator() => null;
}
private sealed class ThrowsExceptionFromDispose : IAsyncEnumerable<int>, IEnumerable<int>, IAsyncEnumerator<int>, IEnumerator<int>
{
public int Current => throw new NotImplementedException();
object IEnumerator.Current => throw new NotImplementedException();
public void Dispose() => throw new FormatException();
public ValueTask DisposeAsync() => throw new DivideByZeroException();
public IAsyncEnumerator<int> GetAsyncEnumerator(CancellationToken cancellationToken = default) => this;
public IEnumerator<int> GetEnumerator() => this;
IEnumerator IEnumerable.GetEnumerator() => this;
public bool MoveNext() => false;
public ValueTask<bool> MoveNextAsync() => new ValueTask<bool>(false);
public void Reset() => throw new NotImplementedException();
}
private sealed class SwitchTo : INotifyCompletion
{
private readonly TaskScheduler _scheduler;
public SwitchTo(TaskScheduler scheduler) => _scheduler = scheduler;
public SwitchTo GetAwaiter() => this;
public bool IsCompleted => false;
public void GetResult() { }
public void OnCompleted(Action continuation) => Task.Factory.StartNew(continuation, CancellationToken.None, TaskCreationOptions.None, _scheduler);
}
private sealed class MaxConcurrencyLevelPassthroughTaskScheduler : TaskScheduler
{
public MaxConcurrencyLevelPassthroughTaskScheduler(int maximumConcurrencyLevel) =>
MaximumConcurrencyLevel = maximumConcurrencyLevel;
protected override IEnumerable<Task> GetScheduledTasks() => Array.Empty<Task>();
protected override void QueueTask(Task task) => ThreadPool.QueueUserWorkItem(_ => TryExecuteTask(task));
protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) => TryExecuteTask(task);
public override int MaximumConcurrencyLevel { get; }
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Subtraction.Byte.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void op_SubtractionByte()
{
var test = new VectorBinaryOpTest__op_SubtractionByte();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__op_SubtractionByte
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Byte>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Byte>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Byte>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Byte, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Byte, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector256<Byte> _fld1;
public Vector256<Byte> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref testStruct._fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref testStruct._fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionByte testClass)
{
var result = _fld1 - _fld2;
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 32;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector256<Byte>>() / sizeof(Byte);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector256<Byte>>() / sizeof(Byte);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector256<Byte>>() / sizeof(Byte);
private static Byte[] _data1 = new Byte[Op1ElementCount];
private static Byte[] _data2 = new Byte[Op2ElementCount];
private static Vector256<Byte> _clsVar1;
private static Vector256<Byte> _clsVar2;
private Vector256<Byte> _fld1;
private Vector256<Byte> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__op_SubtractionByte()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref _clsVar1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref _clsVar2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
}
public VectorBinaryOpTest__op_SubtractionByte()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref _fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref _fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
_dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Unsafe.Read<Vector256<Byte>>(_dataTable.inArray1Ptr) - Unsafe.Read<Vector256<Byte>>(_dataTable.inArray2Ptr);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Vector256<Byte>).GetMethod("op_Subtraction", new Type[] { typeof(Vector256<Byte>), typeof(Vector256<Byte>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector256<Byte>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector256<Byte>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector256<Byte>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = _clsVar1 - _clsVar2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector256<Byte>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector256<Byte>>(_dataTable.inArray2Ptr);
var result = op1 - op2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__op_SubtractionByte();
var result = test._fld1 - test._fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = _fld1 - _fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = test._fld1 - test._fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector256<Byte> op1, Vector256<Byte> op2, void* result, [CallerMemberName] string method = "")
{
Byte[] inArray1 = new Byte[Op1ElementCount];
Byte[] inArray2 = new Byte[Op2ElementCount];
Byte[] outArray = new Byte[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Byte>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Byte[] inArray1 = new Byte[Op1ElementCount];
Byte[] inArray2 = new Byte[Op2ElementCount];
Byte[] outArray = new Byte[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector256<Byte>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector256<Byte>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Byte>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (byte)(left[0] - right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (byte)(left[i] - right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector256)}.op_Subtraction<Byte>(Vector256<Byte>, Vector256<Byte>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void op_SubtractionByte()
{
var test = new VectorBinaryOpTest__op_SubtractionByte();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__op_SubtractionByte
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Byte[] inArray1, Byte[] inArray2, Byte[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Byte>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Byte>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Byte>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Byte, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Byte, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector256<Byte> _fld1;
public Vector256<Byte> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref testStruct._fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref testStruct._fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__op_SubtractionByte testClass)
{
var result = _fld1 - _fld2;
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 32;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector256<Byte>>() / sizeof(Byte);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector256<Byte>>() / sizeof(Byte);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector256<Byte>>() / sizeof(Byte);
private static Byte[] _data1 = new Byte[Op1ElementCount];
private static Byte[] _data2 = new Byte[Op2ElementCount];
private static Vector256<Byte> _clsVar1;
private static Vector256<Byte> _clsVar2;
private Vector256<Byte> _fld1;
private Vector256<Byte> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__op_SubtractionByte()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref _clsVar1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref _clsVar2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
}
public VectorBinaryOpTest__op_SubtractionByte()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref _fld1), ref Unsafe.As<Byte, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Byte>, byte>(ref _fld2), ref Unsafe.As<Byte, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Byte>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetByte(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetByte(); }
_dataTable = new DataTable(_data1, _data2, new Byte[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Unsafe.Read<Vector256<Byte>>(_dataTable.inArray1Ptr) - Unsafe.Read<Vector256<Byte>>(_dataTable.inArray2Ptr);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Vector256<Byte>).GetMethod("op_Subtraction", new Type[] { typeof(Vector256<Byte>), typeof(Vector256<Byte>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector256<Byte>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector256<Byte>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector256<Byte>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = _clsVar1 - _clsVar2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector256<Byte>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector256<Byte>>(_dataTable.inArray2Ptr);
var result = op1 - op2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__op_SubtractionByte();
var result = test._fld1 - test._fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = _fld1 - _fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = test._fld1 - test._fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector256<Byte> op1, Vector256<Byte> op2, void* result, [CallerMemberName] string method = "")
{
Byte[] inArray1 = new Byte[Op1ElementCount];
Byte[] inArray2 = new Byte[Op2ElementCount];
Byte[] outArray = new Byte[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Byte>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Byte[] inArray1 = new Byte[Op1ElementCount];
Byte[] inArray2 = new Byte[Op2ElementCount];
Byte[] outArray = new Byte[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector256<Byte>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector256<Byte>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Byte, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Byte>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Byte[] left, Byte[] right, Byte[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (byte)(left[0] - right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (byte)(left[i] - right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector256)}.op_Subtraction<Byte>(Vector256<Byte>, Vector256<Byte>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/mono/wasm/debugger/DebuggerTestSuite/MonoJsTests.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
namespace DebuggerTests
{
public class MonoJsTests : DebuggerTestBase
{
[Fact]
public async Task BadRaiseDebugEventsTest()
{
var bad_expressions = new[]
{
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event('')",
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event(undefined)",
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({})",
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({eventName:'foo'}, '')",
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({eventName:'foo'}, 12)"
};
foreach (var expression in bad_expressions)
{
var res = await cli.SendCommand($"Runtime.evaluate",
JObject.FromObject(new
{
expression,
returnByValue = true
}), token);
Assert.False(res.IsOk, $"Expected to fail for {expression}");
}
}
[Theory]
[InlineData(true)]
[InlineData(false)]
[InlineData(null)]
public async Task RaiseDebugEventTraceTest(bool? trace)
{
var tcs = new TaskCompletionSource<bool>();
insp.On("Runtime.consoleAPICalled", async (args, token) =>
{
if (args?["type"]?.Value<string>() == "debug" &&
args?["args"]?.Type == JTokenType.Array &&
args?["args"]?[0]?["value"]?.Value<string>()?.StartsWith("mono_wasm_debug_event_raised:") == true)
{
tcs.SetResult(true);
}
await Task.CompletedTask;
});
var trace_str = trace.HasValue ? $"trace: {trace.ToString().ToLower()}" : String.Empty;
var expression = $"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({{ eventName:'qwe' }}, {{ {trace_str} }})";
var res = await cli.SendCommand($"Runtime.evaluate", JObject.FromObject(new { expression }), token);
Assert.True(res.IsOk, $"Expected to pass for {expression}");
var t = await Task.WhenAny(tcs.Task, Task.Delay(2000));
if (trace == true)
Assert.True(tcs.Task == t, "Timed out waiting for the event to be logged");
else
Assert.False(tcs.Task == t, "Event should not have been logged");
}
[Theory]
[InlineData(true, 1)]
[InlineData(false, 0)]
public async Task DuplicateAssemblyLoadedEventNotLoadedFromBundle(bool load_pdb, int expected_count)
=> await AssemblyLoadedEventTest(
"lazy-debugger-test",
Path.Combine(DebuggerTestAppPath, "lazy-debugger-test.dll"),
load_pdb ? Path.Combine(DebuggerTestAppPath, "lazy-debugger-test.pdb") : null,
"/lazy-debugger-test.cs",
expected_count
);
[Theory]
[InlineData(true, 1)]
[InlineData(false, 1)] // Since it's being loaded from the bundle, it will have the pdb even if we don't provide one
public async Task DuplicateAssemblyLoadedEventForAssemblyFromBundle(bool load_pdb, int expected_count)
=> await AssemblyLoadedEventTest(
"debugger-test",
Path.Combine(DebuggerTestAppPath, "managed/debugger-test.dll"),
load_pdb ? Path.Combine(DebuggerTestAppPath, "managed/debugger-test.pdb") : null,
"/debugger-test.cs",
expected_count
);
[Fact]
public async Task DuplicateAssemblyLoadedEventWithEmbeddedPdbNotLoadedFromBundle()
=> await AssemblyLoadedEventTest(
"lazy-debugger-test-embedded",
Path.Combine(DebuggerTestAppPath, "lazy-debugger-test-embedded.dll"),
null,
"/lazy-debugger-test-embedded.cs",
expected_count: 1
);
async Task AssemblyLoadedEventTest(string asm_name, string asm_path, string pdb_path, string source_file, int expected_count)
{
int event_count = 0;
var tcs = new TaskCompletionSource<bool>();
insp.On("Debugger.scriptParsed", async (args, c) =>
{
try
{
var url = args["url"]?.Value<string>();
if (url?.EndsWith(source_file) == true)
{
event_count++;
if (event_count > expected_count)
tcs.SetResult(false);
}
}
catch (Exception ex)
{
tcs.SetException(ex);
}
await Task.CompletedTask;
});
byte[] bytes = File.ReadAllBytes(asm_path);
string asm_base64 = Convert.ToBase64String(bytes);
string pdb_base64 = String.Empty;
if (pdb_path != null)
{
bytes = File.ReadAllBytes(pdb_path);
pdb_base64 = Convert.ToBase64String(bytes);
}
var expression = $@"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({{
eventName: 'AssemblyLoaded',
assembly_name: '{asm_name}',
assembly_b64: '{asm_base64}',
pdb_b64: '{pdb_base64}'
}});";
var res = await cli.SendCommand($"Runtime.evaluate", JObject.FromObject(new { expression }), token);
Assert.True(res.IsOk, $"Expected to pass for {expression}");
res = await cli.SendCommand($"Runtime.evaluate", JObject.FromObject(new { expression }), token);
Assert.True(res.IsOk, $"Expected to pass for {expression}");
var t = await Task.WhenAny(tcs.Task, Task.Delay(2000));
if (t.IsFaulted)
throw t.Exception;
Assert.True(event_count <= expected_count, $"number of scriptParsed events received. Expected: {expected_count}, Actual: {event_count}");
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
namespace DebuggerTests
{
public class MonoJsTests : DebuggerTestBase
{
[Fact]
public async Task BadRaiseDebugEventsTest()
{
var bad_expressions = new[]
{
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event('')",
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event(undefined)",
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({})",
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({eventName:'foo'}, '')",
"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({eventName:'foo'}, 12)"
};
foreach (var expression in bad_expressions)
{
var res = await cli.SendCommand($"Runtime.evaluate",
JObject.FromObject(new
{
expression,
returnByValue = true
}), token);
Assert.False(res.IsOk, $"Expected to fail for {expression}");
}
}
[Theory]
[InlineData(true)]
[InlineData(false)]
[InlineData(null)]
public async Task RaiseDebugEventTraceTest(bool? trace)
{
var tcs = new TaskCompletionSource<bool>();
insp.On("Runtime.consoleAPICalled", async (args, token) =>
{
if (args?["type"]?.Value<string>() == "debug" &&
args?["args"]?.Type == JTokenType.Array &&
args?["args"]?[0]?["value"]?.Value<string>()?.StartsWith("mono_wasm_debug_event_raised:") == true)
{
tcs.SetResult(true);
}
await Task.CompletedTask;
});
var trace_str = trace.HasValue ? $"trace: {trace.ToString().ToLower()}" : String.Empty;
var expression = $"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({{ eventName:'qwe' }}, {{ {trace_str} }})";
var res = await cli.SendCommand($"Runtime.evaluate", JObject.FromObject(new { expression }), token);
Assert.True(res.IsOk, $"Expected to pass for {expression}");
var t = await Task.WhenAny(tcs.Task, Task.Delay(2000));
if (trace == true)
Assert.True(tcs.Task == t, "Timed out waiting for the event to be logged");
else
Assert.False(tcs.Task == t, "Event should not have been logged");
}
[Theory]
[InlineData(true, 1)]
[InlineData(false, 0)]
public async Task DuplicateAssemblyLoadedEventNotLoadedFromBundle(bool load_pdb, int expected_count)
=> await AssemblyLoadedEventTest(
"lazy-debugger-test",
Path.Combine(DebuggerTestAppPath, "lazy-debugger-test.dll"),
load_pdb ? Path.Combine(DebuggerTestAppPath, "lazy-debugger-test.pdb") : null,
"/lazy-debugger-test.cs",
expected_count
);
[Theory]
[InlineData(true, 1)]
[InlineData(false, 1)] // Since it's being loaded from the bundle, it will have the pdb even if we don't provide one
public async Task DuplicateAssemblyLoadedEventForAssemblyFromBundle(bool load_pdb, int expected_count)
=> await AssemblyLoadedEventTest(
"debugger-test",
Path.Combine(DebuggerTestAppPath, "managed/debugger-test.dll"),
load_pdb ? Path.Combine(DebuggerTestAppPath, "managed/debugger-test.pdb") : null,
"/debugger-test.cs",
expected_count
);
[Fact]
public async Task DuplicateAssemblyLoadedEventWithEmbeddedPdbNotLoadedFromBundle()
=> await AssemblyLoadedEventTest(
"lazy-debugger-test-embedded",
Path.Combine(DebuggerTestAppPath, "lazy-debugger-test-embedded.dll"),
null,
"/lazy-debugger-test-embedded.cs",
expected_count: 1
);
async Task AssemblyLoadedEventTest(string asm_name, string asm_path, string pdb_path, string source_file, int expected_count)
{
int event_count = 0;
var tcs = new TaskCompletionSource<bool>();
insp.On("Debugger.scriptParsed", async (args, c) =>
{
try
{
var url = args["url"]?.Value<string>();
if (url?.EndsWith(source_file) == true)
{
event_count++;
if (event_count > expected_count)
tcs.SetResult(false);
}
}
catch (Exception ex)
{
tcs.SetException(ex);
}
await Task.CompletedTask;
});
byte[] bytes = File.ReadAllBytes(asm_path);
string asm_base64 = Convert.ToBase64String(bytes);
string pdb_base64 = String.Empty;
if (pdb_path != null)
{
bytes = File.ReadAllBytes(pdb_path);
pdb_base64 = Convert.ToBase64String(bytes);
}
var expression = $@"getDotnetRuntime(0).INTERNAL.mono_wasm_raise_debug_event({{
eventName: 'AssemblyLoaded',
assembly_name: '{asm_name}',
assembly_b64: '{asm_base64}',
pdb_b64: '{pdb_base64}'
}});";
var res = await cli.SendCommand($"Runtime.evaluate", JObject.FromObject(new { expression }), token);
Assert.True(res.IsOk, $"Expected to pass for {expression}");
res = await cli.SendCommand($"Runtime.evaluate", JObject.FromObject(new { expression }), token);
Assert.True(res.IsOk, $"Expected to pass for {expression}");
var t = await Task.WhenAny(tcs.Task, Task.Delay(2000));
if (t.IsFaulted)
throw t.Exception;
Assert.True(event_count <= expected_count, $"number of scriptParsed events received. Expected: {expected_count}, Actual: {event_count}");
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/Common/src/Interop/Windows/Gdi32/Interop.GetClipRgn.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class Gdi32
{
[LibraryImport(Libraries.Gdi32)]
public static partial int GetClipRgn(IntPtr hdc, IntPtr hrgn);
public static int GetClipRgn(HandleRef hdc, IntPtr hrgn)
{
int result = GetClipRgn(hdc.Handle, hrgn);
GC.KeepAlive(hdc.Wrapper);
return result;
}
public static int GetClipRgn(HandleRef hdc, HandleRef hrgn)
{
int result = GetClipRgn(hdc.Handle, hrgn.Handle);
GC.KeepAlive(hdc.Wrapper);
GC.KeepAlive(hrgn.Wrapper);
return result;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class Gdi32
{
[LibraryImport(Libraries.Gdi32)]
public static partial int GetClipRgn(IntPtr hdc, IntPtr hrgn);
public static int GetClipRgn(HandleRef hdc, IntPtr hrgn)
{
int result = GetClipRgn(hdc.Handle, hrgn);
GC.KeepAlive(hdc.Wrapper);
return result;
}
public static int GetClipRgn(HandleRef hdc, HandleRef hrgn)
{
int result = GetClipRgn(hdc.Handle, hrgn.Handle);
GC.KeepAlive(hdc.Wrapper);
GC.KeepAlive(hrgn.Wrapper);
return result;
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha256.PlatformNotSupported.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#pragma warning disable IDE0060 // unused parameters
using System.Runtime.CompilerServices;
namespace System.Runtime.Intrinsics.Arm
{
/// <summary>
/// This class provides access to the ARM SHA256 hardware instructions via intrinsics
/// </summary>
[CLSCompliant(false)]
public abstract class Sha256 : ArmBase
{
internal Sha256() { }
public static new bool IsSupported { [Intrinsic] get => false; }
public new abstract class Arm64 : ArmBase.Arm64
{
internal Arm64() { }
public static new bool IsSupported { [Intrinsic] get { return false; } }
}
/// <summary>
/// uint32x4_t vsha256hq_u32 (uint32x4_t hash_abcd, uint32x4_t hash_efgh, uint32x4_t wk)
/// A32: SHA256H.32 Qd, Qn, Qm
/// A64: SHA256H Qd, Qn, Vm.4S
/// </summary>
public static Vector128<uint> HashUpdate1(Vector128<uint> hash_abcd, Vector128<uint> hash_efgh, Vector128<uint> wk) { throw new PlatformNotSupportedException(); }
/// <summary>
/// uint32x4_t vsha256h2q_u32 (uint32x4_t hash_efgh, uint32x4_t hash_abcd, uint32x4_t wk)
/// A32: SHA256H2.32 Qd, Qn, Qm
/// A64: SHA256H2 Qd, Qn, Vm.4S
/// </summary>
public static Vector128<uint> HashUpdate2(Vector128<uint> hash_efgh, Vector128<uint> hash_abcd, Vector128<uint> wk) { throw new PlatformNotSupportedException(); }
/// <summary>
/// uint32x4_t vsha256su0q_u32 (uint32x4_t w0_3, uint32x4_t w4_7)
/// A32: SHA256SU0.32 Qd, Qm
/// A64: SHA256SU0 Vd.4S, Vn.4S
/// </summary>
public static Vector128<uint> ScheduleUpdate0(Vector128<uint> w0_3, Vector128<uint> w4_7) { throw new PlatformNotSupportedException(); }
/// <summary>
/// uint32x4_t vsha256su1q_u32 (uint32x4_t w0_3, uint32x4_t w8_11, uint32x4_t w12_15)
/// A32: SHA256SU1.32 Qd, Qn, Qm
/// A64: SHA256SU1 Vd.4S, Vn.4S, Vm.4S
/// </summary>
public static Vector128<uint> ScheduleUpdate1(Vector128<uint> w0_3, Vector128<uint> w8_11, Vector128<uint> w12_15) { throw new PlatformNotSupportedException(); }
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#pragma warning disable IDE0060 // unused parameters
using System.Runtime.CompilerServices;
namespace System.Runtime.Intrinsics.Arm
{
/// <summary>
/// This class provides access to the ARM SHA256 hardware instructions via intrinsics
/// </summary>
[CLSCompliant(false)]
public abstract class Sha256 : ArmBase
{
internal Sha256() { }
public static new bool IsSupported { [Intrinsic] get => false; }
public new abstract class Arm64 : ArmBase.Arm64
{
internal Arm64() { }
public static new bool IsSupported { [Intrinsic] get { return false; } }
}
/// <summary>
/// uint32x4_t vsha256hq_u32 (uint32x4_t hash_abcd, uint32x4_t hash_efgh, uint32x4_t wk)
/// A32: SHA256H.32 Qd, Qn, Qm
/// A64: SHA256H Qd, Qn, Vm.4S
/// </summary>
public static Vector128<uint> HashUpdate1(Vector128<uint> hash_abcd, Vector128<uint> hash_efgh, Vector128<uint> wk) { throw new PlatformNotSupportedException(); }
/// <summary>
/// uint32x4_t vsha256h2q_u32 (uint32x4_t hash_efgh, uint32x4_t hash_abcd, uint32x4_t wk)
/// A32: SHA256H2.32 Qd, Qn, Qm
/// A64: SHA256H2 Qd, Qn, Vm.4S
/// </summary>
public static Vector128<uint> HashUpdate2(Vector128<uint> hash_efgh, Vector128<uint> hash_abcd, Vector128<uint> wk) { throw new PlatformNotSupportedException(); }
/// <summary>
/// uint32x4_t vsha256su0q_u32 (uint32x4_t w0_3, uint32x4_t w4_7)
/// A32: SHA256SU0.32 Qd, Qm
/// A64: SHA256SU0 Vd.4S, Vn.4S
/// </summary>
public static Vector128<uint> ScheduleUpdate0(Vector128<uint> w0_3, Vector128<uint> w4_7) { throw new PlatformNotSupportedException(); }
/// <summary>
/// uint32x4_t vsha256su1q_u32 (uint32x4_t w0_3, uint32x4_t w8_11, uint32x4_t w12_15)
/// A32: SHA256SU1.32 Qd, Qn, Qm
/// A64: SHA256SU1 Vd.4S, Vn.4S, Vm.4S
/// </summary>
public static Vector128<uint> ScheduleUpdate1(Vector128<uint> w0_3, Vector128<uint> w8_11, Vector128<uint> w12_15) { throw new PlatformNotSupportedException(); }
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/GatewayIPAddressInformationCollection.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
namespace System.Net.NetworkInformation
{
public class GatewayIPAddressInformationCollection : ICollection<GatewayIPAddressInformation>
{
private readonly List<GatewayIPAddressInformation> _addresses;
protected internal GatewayIPAddressInformationCollection()
{
_addresses = new List<GatewayIPAddressInformation>();
}
internal GatewayIPAddressInformationCollection(List<GatewayIPAddressInformation> addresses)
{
_addresses = addresses;
}
public virtual void CopyTo(GatewayIPAddressInformation[] array, int offset)
{
_addresses.CopyTo(array, offset);
}
public virtual int Count
{
get
{
return _addresses.Count;
}
}
public virtual bool IsReadOnly
{
get
{
return true;
}
}
public virtual GatewayIPAddressInformation this[int index]
{
get
{
return _addresses[index];
}
}
public virtual void Add(GatewayIPAddressInformation address)
{
throw new NotSupportedException(SR.net_collection_readonly);
}
internal void InternalAdd(GatewayIPAddressInformation address)
{
_addresses.Add(address);
}
public virtual bool Contains(GatewayIPAddressInformation address)
{
return _addresses.Contains(address);
}
public virtual IEnumerator<GatewayIPAddressInformation> GetEnumerator()
{
return _addresses.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
public virtual bool Remove(GatewayIPAddressInformation address)
{
throw new NotSupportedException(SR.net_collection_readonly);
}
public virtual void Clear()
{
throw new NotSupportedException(SR.net_collection_readonly);
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
namespace System.Net.NetworkInformation
{
public class GatewayIPAddressInformationCollection : ICollection<GatewayIPAddressInformation>
{
private readonly List<GatewayIPAddressInformation> _addresses;
protected internal GatewayIPAddressInformationCollection()
{
_addresses = new List<GatewayIPAddressInformation>();
}
internal GatewayIPAddressInformationCollection(List<GatewayIPAddressInformation> addresses)
{
_addresses = addresses;
}
public virtual void CopyTo(GatewayIPAddressInformation[] array, int offset)
{
_addresses.CopyTo(array, offset);
}
public virtual int Count
{
get
{
return _addresses.Count;
}
}
public virtual bool IsReadOnly
{
get
{
return true;
}
}
public virtual GatewayIPAddressInformation this[int index]
{
get
{
return _addresses[index];
}
}
public virtual void Add(GatewayIPAddressInformation address)
{
throw new NotSupportedException(SR.net_collection_readonly);
}
internal void InternalAdd(GatewayIPAddressInformation address)
{
_addresses.Add(address);
}
public virtual bool Contains(GatewayIPAddressInformation address)
{
return _addresses.Contains(address);
}
public virtual IEnumerator<GatewayIPAddressInformation> GetEnumerator()
{
return _addresses.GetEnumerator();
}
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
{
return this.GetEnumerator();
}
public virtual bool Remove(GatewayIPAddressInformation address)
{
throw new NotSupportedException(SR.net_collection_readonly);
}
public virtual void Clear()
{
throw new NotSupportedException(SR.net_collection_readonly);
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/System.Security.Permissions/src/System/Security/Permissions/HostProtectionAttribute.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Security.Permissions
{
#if NETCOREAPP
[Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
#endif
[AttributeUsage((AttributeTargets)(4205), AllowMultiple = true, Inherited = false)]
public sealed partial class HostProtectionAttribute : CodeAccessSecurityAttribute
{
public HostProtectionAttribute() : base(default(SecurityAction)) { }
public HostProtectionAttribute(SecurityAction action) : base(default(SecurityAction)) { }
public bool ExternalProcessMgmt { get; set; }
public bool ExternalThreading { get; set; }
public bool MayLeakOnAbort { get; set; }
public HostProtectionResource Resources { get; set; }
public bool SecurityInfrastructure { get; set; }
public bool SelfAffectingProcessMgmt { get; set; }
public bool SelfAffectingThreading { get; set; }
public bool SharedState { get; set; }
public bool Synchronization { get; set; }
public bool UI { get; set; }
public override IPermission CreatePermission() { return default(IPermission); }
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Security.Permissions
{
#if NETCOREAPP
[Obsolete(Obsoletions.CodeAccessSecurityMessage, DiagnosticId = Obsoletions.CodeAccessSecurityDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
#endif
[AttributeUsage((AttributeTargets)(4205), AllowMultiple = true, Inherited = false)]
public sealed partial class HostProtectionAttribute : CodeAccessSecurityAttribute
{
public HostProtectionAttribute() : base(default(SecurityAction)) { }
public HostProtectionAttribute(SecurityAction action) : base(default(SecurityAction)) { }
public bool ExternalProcessMgmt { get; set; }
public bool ExternalThreading { get; set; }
public bool MayLeakOnAbort { get; set; }
public HostProtectionResource Resources { get; set; }
public bool SecurityInfrastructure { get; set; }
public bool SelfAffectingProcessMgmt { get; set; }
public bool SelfAffectingThreading { get; set; }
public bool SharedState { get; set; }
public bool Synchronization { get; set; }
public bool UI { get; set; }
public override IPermission CreatePermission() { return default(IPermission); }
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/tests/JIT/HardwareIntrinsics/X86/Sse2/UnpackLow.Int32.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace JIT.HardwareIntrinsics.X86
{
public static partial class Program
{
private static void UnpackLowInt32()
{
var test = new SimpleBinaryOpTest__UnpackLowInt32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (Sse2.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
// Validates basic functionality works, using LoadAligned
test.RunBasicScenario_LoadAligned();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (Sse2.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
// Validates calling via reflection works, using LoadAligned
test.RunReflectionScenario_LoadAligned();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (Sse2.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (Sse2.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
// Validates passing a local works, using LoadAligned
test.RunLclVarScenario_LoadAligned();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (Sse2.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (Sse2.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (Sse2.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (Sse2.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__UnpackLowInt32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 32 && alignment != 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<Int32> _fld1;
public Vector128<Int32> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__UnpackLowInt32 testClass)
{
var result = Sse2.UnpackLow(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__UnpackLowInt32 testClass)
{
fixed (Vector128<Int32>* pFld1 = &_fld1)
fixed (Vector128<Int32>* pFld2 = &_fld2)
{
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(pFld1)),
Sse2.LoadVector128((Int32*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Vector128<Int32> _clsVar1;
private static Vector128<Int32> _clsVar2;
private Vector128<Int32> _fld1;
private Vector128<Int32> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__UnpackLowInt32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
}
public SimpleBinaryOpTest__UnpackLowInt32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => Sse2.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Sse2.UnpackLow(
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(_dataTable.inArray1Ptr)),
Sse2.LoadVector128((Int32*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_LoadAligned));
var result = Sse2.UnpackLow(
Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray1Ptr)),
Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Sse2).GetMethod(nameof(Sse2.UnpackLow), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(Sse2).GetMethod(nameof(Sse2.UnpackLow), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
Sse2.LoadVector128((Int32*)(_dataTable.inArray1Ptr)),
Sse2.LoadVector128((Int32*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_LoadAligned));
var result = typeof(Sse2).GetMethod(nameof(Sse2.UnpackLow), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray1Ptr)),
Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Sse2.UnpackLow(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<Int32>* pClsVar1 = &_clsVar1)
fixed (Vector128<Int32>* pClsVar2 = &_clsVar2)
{
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(pClsVar1)),
Sse2.LoadVector128((Int32*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr);
var result = Sse2.UnpackLow(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = Sse2.LoadVector128((Int32*)(_dataTable.inArray1Ptr));
var op2 = Sse2.LoadVector128((Int32*)(_dataTable.inArray2Ptr));
var result = Sse2.UnpackLow(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_LoadAligned));
var op1 = Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray1Ptr));
var op2 = Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray2Ptr));
var result = Sse2.UnpackLow(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__UnpackLowInt32();
var result = Sse2.UnpackLow(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__UnpackLowInt32();
fixed (Vector128<Int32>* pFld1 = &test._fld1)
fixed (Vector128<Int32>* pFld2 = &test._fld2)
{
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(pFld1)),
Sse2.LoadVector128((Int32*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Sse2.UnpackLow(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<Int32>* pFld1 = &_fld1)
fixed (Vector128<Int32>* pFld2 = &_fld2)
{
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(pFld1)),
Sse2.LoadVector128((Int32*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Sse2.UnpackLow(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(&test._fld1)),
Sse2.LoadVector128((Int32*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<Int32> op1, Vector128<Int32> op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != left[0])
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if ((i % 2 == 0) ? result[i] != left[i/2] : result[i] != right[(i - 1)/2])
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Sse2)}.{nameof(Sse2.UnpackLow)}<Int32>(Vector128<Int32>, Vector128<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
namespace JIT.HardwareIntrinsics.X86
{
public static partial class Program
{
private static void UnpackLowInt32()
{
var test = new SimpleBinaryOpTest__UnpackLowInt32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (Sse2.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
// Validates basic functionality works, using LoadAligned
test.RunBasicScenario_LoadAligned();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (Sse2.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
// Validates calling via reflection works, using LoadAligned
test.RunReflectionScenario_LoadAligned();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (Sse2.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (Sse2.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
// Validates passing a local works, using LoadAligned
test.RunLclVarScenario_LoadAligned();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (Sse2.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (Sse2.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (Sse2.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (Sse2.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__UnpackLowInt32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 32 && alignment != 16) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<Int32> _fld1;
public Vector128<Int32> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__UnpackLowInt32 testClass)
{
var result = Sse2.UnpackLow(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__UnpackLowInt32 testClass)
{
fixed (Vector128<Int32>* pFld1 = &_fld1)
fixed (Vector128<Int32>* pFld2 = &_fld2)
{
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(pFld1)),
Sse2.LoadVector128((Int32*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Vector128<Int32> _clsVar1;
private static Vector128<Int32> _clsVar2;
private Vector128<Int32> _fld1;
private Vector128<Int32> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__UnpackLowInt32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
}
public SimpleBinaryOpTest__UnpackLowInt32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => Sse2.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Sse2.UnpackLow(
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(_dataTable.inArray1Ptr)),
Sse2.LoadVector128((Int32*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_LoadAligned));
var result = Sse2.UnpackLow(
Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray1Ptr)),
Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Sse2).GetMethod(nameof(Sse2.UnpackLow), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(Sse2).GetMethod(nameof(Sse2.UnpackLow), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
Sse2.LoadVector128((Int32*)(_dataTable.inArray1Ptr)),
Sse2.LoadVector128((Int32*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_LoadAligned));
var result = typeof(Sse2).GetMethod(nameof(Sse2.UnpackLow), new Type[] { typeof(Vector128<Int32>), typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray1Ptr)),
Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Sse2.UnpackLow(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<Int32>* pClsVar1 = &_clsVar1)
fixed (Vector128<Int32>* pClsVar2 = &_clsVar2)
{
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(pClsVar1)),
Sse2.LoadVector128((Int32*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray2Ptr);
var result = Sse2.UnpackLow(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = Sse2.LoadVector128((Int32*)(_dataTable.inArray1Ptr));
var op2 = Sse2.LoadVector128((Int32*)(_dataTable.inArray2Ptr));
var result = Sse2.UnpackLow(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_LoadAligned()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_LoadAligned));
var op1 = Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray1Ptr));
var op2 = Sse2.LoadAlignedVector128((Int32*)(_dataTable.inArray2Ptr));
var result = Sse2.UnpackLow(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__UnpackLowInt32();
var result = Sse2.UnpackLow(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__UnpackLowInt32();
fixed (Vector128<Int32>* pFld1 = &test._fld1)
fixed (Vector128<Int32>* pFld2 = &test._fld2)
{
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(pFld1)),
Sse2.LoadVector128((Int32*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Sse2.UnpackLow(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<Int32>* pFld1 = &_fld1)
fixed (Vector128<Int32>* pFld2 = &_fld2)
{
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(pFld1)),
Sse2.LoadVector128((Int32*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Sse2.UnpackLow(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = Sse2.UnpackLow(
Sse2.LoadVector128((Int32*)(&test._fld1)),
Sse2.LoadVector128((Int32*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<Int32> op1, Vector128<Int32> op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != left[0])
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if ((i % 2 == 0) ? result[i] != left[i/2] : result[i] != right[(i - 1)/2])
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Sse2)}.{nameof(Sse2.UnpackLow)}<Int32>(Vector128<Int32>, Vector128<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/tests/JIT/HardwareIntrinsics/General/Vector64/ConvertToSingle.UInt32.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void ConvertToSingleUInt32()
{
var test = new VectorUnaryOpTest__ConvertToSingleUInt32();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorUnaryOpTest__ConvertToSingleUInt32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt32[] inArray1, Single[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<UInt32> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
return testStruct;
}
public void RunStructFldScenario(VectorUnaryOpTest__ConvertToSingleUInt32 testClass)
{
var result = Vector64.ConvertToSingle(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static UInt32[] _data1 = new UInt32[Op1ElementCount];
private static Vector64<UInt32> _clsVar1;
private Vector64<UInt32> _fld1;
private DataTable _dataTable;
static VectorUnaryOpTest__ConvertToSingleUInt32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _clsVar1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
}
public VectorUnaryOpTest__ConvertToSingleUInt32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
_dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector64.ConvertToSingle(
Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector64).GetMethod(nameof(Vector64.ConvertToSingle), new Type[] {
typeof(Vector64<UInt32>)
});
if (method is null)
{
method = typeof(Vector64).GetMethod(nameof(Vector64.ConvertToSingle), 1, new Type[] {
typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(Single));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector64.ConvertToSingle(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray1Ptr);
var result = Vector64.ConvertToSingle(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorUnaryOpTest__ConvertToSingleUInt32();
var result = Vector64.ConvertToSingle(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector64.ConvertToSingle(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector64.ConvertToSingle(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector64<UInt32> op1, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray1 = new UInt32[Op1ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray1 = new UInt32[Op1ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(UInt32[] firstOp, Single[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (float)(firstOp[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (float)(firstOp[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.ConvertToSingle)}<Single>(Vector64<UInt32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void ConvertToSingleUInt32()
{
var test = new VectorUnaryOpTest__ConvertToSingleUInt32();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorUnaryOpTest__ConvertToSingleUInt32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt32[] inArray1, Single[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<UInt32> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
return testStruct;
}
public void RunStructFldScenario(VectorUnaryOpTest__ConvertToSingleUInt32 testClass)
{
var result = Vector64.ConvertToSingle(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static UInt32[] _data1 = new UInt32[Op1ElementCount];
private static Vector64<UInt32> _clsVar1;
private Vector64<UInt32> _fld1;
private DataTable _dataTable;
static VectorUnaryOpTest__ConvertToSingleUInt32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _clsVar1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
}
public VectorUnaryOpTest__ConvertToSingleUInt32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<UInt32>, byte>(ref _fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
_dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector64.ConvertToSingle(
Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector64).GetMethod(nameof(Vector64.ConvertToSingle), new Type[] {
typeof(Vector64<UInt32>)
});
if (method is null)
{
method = typeof(Vector64).GetMethod(nameof(Vector64.ConvertToSingle), 1, new Type[] {
typeof(Vector64<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(Single));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector64.ConvertToSingle(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<UInt32>>(_dataTable.inArray1Ptr);
var result = Vector64.ConvertToSingle(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorUnaryOpTest__ConvertToSingleUInt32();
var result = Vector64.ConvertToSingle(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector64.ConvertToSingle(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector64.ConvertToSingle(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector64<UInt32> op1, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray1 = new UInt32[Op1ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray1 = new UInt32[Op1ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(UInt32[] firstOp, Single[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (float)(firstOp[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (float)(firstOp[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector64)}.{nameof(Vector64.ConvertToSingle)}<Single>(Vector64<UInt32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/tests/JIT/Generics/Exceptions/specific_struct_static02.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
using System;
public struct ValX0 { }
public struct ValY0 { }
public struct ValX1<T> { }
public struct ValY1<T> { }
public struct ValX2<T, U> { }
public struct ValY2<T, U> { }
public struct ValX3<T, U, V> { }
public struct ValY3<T, U, V> { }
public class RefX0 { }
public class RefY0 { }
public class RefX1<T> { }
public class RefY1<T> { }
public class RefX2<T, U> { }
public class RefY2<T, U> { }
public class RefX3<T, U, V> { }
public class RefY3<T, U, V> { }
public class GenException<T> : Exception { }
public struct Gen<T>
{
public static bool ExceptionTest(bool throwException)
{
if (throwException)
{
throw new GenException<T>();
}
else
{
return true;
}
}
}
public class Test_specific_struct_static02
{
public static int counter = 0;
public static bool result = true;
public static void Eval(bool exp)
{
if (!exp)
{
result = exp;
Console.WriteLine("Test Failed at location: " + counter);
}
counter++;
}
public static int Main()
{
int cLabel = 0;
while (cLabel < 50)
{
try
{
switch (cLabel)
{
case 0: cLabel++; Gen<int>.ExceptionTest(true); break;
case 1: cLabel++; Gen<double>.ExceptionTest(true); break;
case 2: cLabel++; Gen<string>.ExceptionTest(true); break;
case 3: cLabel++; Gen<object>.ExceptionTest(true); break;
case 4: cLabel++; Gen<Guid>.ExceptionTest(true); break;
case 5: cLabel++; Gen<int[]>.ExceptionTest(true); break;
case 6: cLabel++; Gen<double[,]>.ExceptionTest(true); break;
case 7: cLabel++; Gen<string[][][]>.ExceptionTest(true); break;
case 8: cLabel++; Gen<object[, , ,]>.ExceptionTest(true); break;
case 9: cLabel++; Gen<Guid[][, , ,][]>.ExceptionTest(true); break;
case 10: cLabel++; Gen<RefX1<int>[]>.ExceptionTest(true); break;
case 11: cLabel++; Gen<RefX1<double>[,]>.ExceptionTest(true); break;
case 12: cLabel++; Gen<RefX1<string>[][][]>.ExceptionTest(true); break;
case 13: cLabel++; Gen<RefX1<object>[, , ,]>.ExceptionTest(true); break;
case 14: cLabel++; Gen<RefX1<Guid>[][, , ,][]>.ExceptionTest(true); break;
case 15: cLabel++; Gen<RefX2<int, int>[]>.ExceptionTest(true); break;
case 16: cLabel++; Gen<RefX2<double, double>[,]>.ExceptionTest(true); break;
case 17: cLabel++; Gen<RefX2<string, string>[][][]>.ExceptionTest(true); break;
case 18: cLabel++; Gen<RefX2<object, object>[, , ,]>.ExceptionTest(true); break;
case 19: cLabel++; Gen<RefX2<Guid, Guid>[][, , ,][]>.ExceptionTest(true); break;
case 20: cLabel++; Gen<ValX1<int>[]>.ExceptionTest(true); break;
case 21: cLabel++; Gen<ValX1<double>[,]>.ExceptionTest(true); break;
case 22: cLabel++; Gen<ValX1<string>[][][]>.ExceptionTest(true); break;
case 23: cLabel++; Gen<ValX1<object>[, , ,]>.ExceptionTest(true); break;
case 24: cLabel++; Gen<ValX1<Guid>[][, , ,][]>.ExceptionTest(true); break;
case 25: cLabel++; Gen<ValX2<int, int>[]>.ExceptionTest(true); break;
case 26: cLabel++; Gen<ValX2<double, double>[,]>.ExceptionTest(true); break;
case 27: cLabel++; Gen<ValX2<string, string>[][][]>.ExceptionTest(true); break;
case 28: cLabel++; Gen<ValX2<object, object>[, , ,]>.ExceptionTest(true); break;
case 29: cLabel++; Gen<ValX2<Guid, Guid>[][, , ,][]>.ExceptionTest(true); break;
case 30: cLabel++; Gen<RefX1<int>>.ExceptionTest(true); break;
case 31: cLabel++; Gen<RefX1<ValX1<int>>>.ExceptionTest(true); break;
case 32: cLabel++; Gen<RefX2<int, string>>.ExceptionTest(true); break;
case 33: cLabel++; Gen<RefX3<int, string, Guid>>.ExceptionTest(true); break;
case 34: cLabel++; Gen<RefX1<RefX1<int>>>.ExceptionTest(true); break;
case 35: cLabel++; Gen<RefX1<RefX1<RefX1<string>>>>.ExceptionTest(true); break;
case 36: cLabel++; Gen<RefX1<RefX1<RefX1<RefX1<Guid>>>>>.ExceptionTest(true); break;
case 37: cLabel++; Gen<RefX1<RefX2<int, string>>>.ExceptionTest(true); break;
case 38: cLabel++; Gen<RefX2<RefX2<RefX1<int>, RefX3<int, string, RefX1<RefX2<int, string>>>>, RefX2<RefX1<int>, RefX3<int, string, RefX1<RefX2<int, string>>>>>>.ExceptionTest(true); break;
case 39: cLabel++; Gen<RefX3<RefX1<int[][, , ,]>, RefX2<object[, , ,][][], Guid[][][]>, RefX3<double[, , , , , , , , , ,], Guid[][][][, , , ,][, , , ,][][][], string[][][][][][][][][][][]>>>.ExceptionTest(true); break;
case 40: cLabel++; Gen<ValX1<int>>.ExceptionTest(true); break;
case 41: cLabel++; Gen<ValX1<RefX1<int>>>.ExceptionTest(true); break;
case 42: cLabel++; Gen<ValX2<int, string>>.ExceptionTest(true); break;
case 43: cLabel++; Gen<ValX3<int, string, Guid>>.ExceptionTest(true); break;
case 44: cLabel++; Gen<ValX1<ValX1<int>>>.ExceptionTest(true); break;
case 45: cLabel++; Gen<ValX1<ValX1<ValX1<string>>>>.ExceptionTest(true); break;
case 46: cLabel++; Gen<ValX1<ValX1<ValX1<ValX1<Guid>>>>>.ExceptionTest(true); break;
case 47: cLabel++; Gen<ValX1<ValX2<int, string>>>.ExceptionTest(true); break;
case 48: cLabel++; Gen<ValX2<ValX2<ValX1<int>, ValX3<int, string, ValX1<ValX2<int, string>>>>, ValX2<ValX1<int>, ValX3<int, string, ValX1<ValX2<int, string>>>>>>.ExceptionTest(true); break;
case 49: cLabel++; Gen<ValX3<ValX1<int[][, , ,]>, ValX2<object[, , ,][][], Guid[][][]>, ValX3<double[, , , , , , , , , ,], Guid[][][][, , , ,][, , , ,][][][], string[][][][][][][][][][][]>>>.ExceptionTest(true); break;
}
}
catch (GenException<int>) { Eval(cLabel == 1); }
catch (GenException<double>) { Eval(cLabel == 2); }
catch (GenException<string>) { Eval(cLabel == 3); }
catch (GenException<object>) { Eval(cLabel == 4); }
catch (GenException<Guid>) { Eval(cLabel == 5); }
catch (GenException<int[]>) { Eval(cLabel == 6); }
catch (GenException<double[,]>) { Eval(cLabel == 7); }
catch (GenException<string[][][]>) { Eval(cLabel == 8); }
catch (GenException<object[, , ,]>) { Eval(cLabel == 9); }
catch (GenException<Guid[][, , ,][]>) { Eval(cLabel == 10); }
catch (GenException<RefX1<int>[]>) { Eval(cLabel == 11); }
catch (GenException<RefX1<double>[,]>) { Eval(cLabel == 12); }
catch (GenException<RefX1<string>[][][]>) { Eval(cLabel == 13); }
catch (GenException<RefX1<object>[, , ,]>) { Eval(cLabel == 14); }
catch (GenException<RefX1<Guid>[][, , ,][]>) { Eval(cLabel == 15); }
catch (GenException<RefX2<int, int>[]>) { Eval(cLabel == 16); }
catch (GenException<RefX2<double, double>[,]>) { Eval(cLabel == 17); }
catch (GenException<RefX2<string, string>[][][]>) { Eval(cLabel == 18); }
catch (GenException<RefX2<object, object>[, , ,]>) { Eval(cLabel == 19); }
catch (GenException<RefX2<Guid, Guid>[][, , ,][]>) { Eval(cLabel == 20); }
catch (GenException<ValX1<int>[]>) { Eval(cLabel == 21); }
catch (GenException<ValX1<double>[,]>) { Eval(cLabel == 22); }
catch (GenException<ValX1<string>[][][]>) { Eval(cLabel == 23); }
catch (GenException<ValX1<object>[, , ,]>) { Eval(cLabel == 24); }
catch (GenException<ValX1<Guid>[][, , ,][]>) { Eval(cLabel == 25); }
catch (GenException<ValX2<int, int>[]>) { Eval(cLabel == 26); }
catch (GenException<ValX2<double, double>[,]>) { Eval(cLabel == 27); }
catch (GenException<ValX2<string, string>[][][]>) { Eval(cLabel == 28); }
catch (GenException<ValX2<object, object>[, , ,]>) { Eval(cLabel == 29); }
catch (GenException<ValX2<Guid, Guid>[][, , ,][]>) { Eval(cLabel == 30); }
catch (GenException<RefX1<int>>) { Eval(cLabel == 31); }
catch (GenException<RefX1<ValX1<int>>>) { Eval(cLabel == 32); }
catch (GenException<RefX2<int, string>>) { Eval(cLabel == 33); }
catch (GenException<RefX3<int, string, Guid>>) { Eval(cLabel == 34); }
catch (GenException<RefX1<RefX1<int>>>) { Eval(cLabel == 35); }
catch (GenException<RefX1<RefX1<RefX1<string>>>>) { Eval(cLabel == 36); }
catch (GenException<RefX1<RefX1<RefX1<RefX1<Guid>>>>>) { Eval(cLabel == 37); }
catch (GenException<RefX1<RefX2<int, string>>>) { Eval(cLabel == 38); }
catch (GenException<RefX2<RefX2<RefX1<int>, RefX3<int, string, RefX1<RefX2<int, string>>>>, RefX2<RefX1<int>, RefX3<int, string, RefX1<RefX2<int, string>>>>>>) { Eval(cLabel == 39); }
catch (GenException<RefX3<RefX1<int[][, , ,]>, RefX2<object[, , ,][][], Guid[][][]>, RefX3<double[, , , , , , , , , ,], Guid[][][][, , , ,][, , , ,][][][], string[][][][][][][][][][][]>>>) { Eval(cLabel == 40); }
catch (GenException<ValX1<int>>) { Eval(cLabel == 41); }
catch (GenException<ValX1<RefX1<int>>>) { Eval(cLabel == 42); }
catch (GenException<ValX2<int, string>>) { Eval(cLabel == 43); }
catch (GenException<ValX3<int, string, Guid>>) { Eval(cLabel == 44); }
catch (GenException<ValX1<ValX1<int>>>) { Eval(cLabel == 45); }
catch (GenException<ValX1<ValX1<ValX1<string>>>>) { Eval(cLabel == 46); }
catch (GenException<ValX1<ValX1<ValX1<ValX1<Guid>>>>>) { Eval(cLabel == 47); }
catch (GenException<ValX1<ValX2<int, string>>>) { Eval(cLabel == 48); }
catch (GenException<ValX2<ValX2<ValX1<int>, ValX3<int, string, ValX1<ValX2<int, string>>>>, ValX2<ValX1<int>, ValX3<int, string, ValX1<ValX2<int, string>>>>>>) { Eval(cLabel == 49); }
catch (GenException<ValX3<ValX1<int[][, , ,]>, ValX2<object[, , ,][][], Guid[][][]>, ValX3<double[, , , , , , , , , ,], Guid[][][][, , , ,][, , , ,][][][], string[][][][][][][][][][][]>>>) { Eval(cLabel == 50); }
}
if (result)
{
Console.WriteLine("Test Passed");
return 100;
}
else
{
Console.WriteLine("Test Failed");
return 1;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
using System;
public struct ValX0 { }
public struct ValY0 { }
public struct ValX1<T> { }
public struct ValY1<T> { }
public struct ValX2<T, U> { }
public struct ValY2<T, U> { }
public struct ValX3<T, U, V> { }
public struct ValY3<T, U, V> { }
public class RefX0 { }
public class RefY0 { }
public class RefX1<T> { }
public class RefY1<T> { }
public class RefX2<T, U> { }
public class RefY2<T, U> { }
public class RefX3<T, U, V> { }
public class RefY3<T, U, V> { }
public class GenException<T> : Exception { }
public struct Gen<T>
{
public static bool ExceptionTest(bool throwException)
{
if (throwException)
{
throw new GenException<T>();
}
else
{
return true;
}
}
}
public class Test_specific_struct_static02
{
public static int counter = 0;
public static bool result = true;
public static void Eval(bool exp)
{
if (!exp)
{
result = exp;
Console.WriteLine("Test Failed at location: " + counter);
}
counter++;
}
public static int Main()
{
int cLabel = 0;
while (cLabel < 50)
{
try
{
switch (cLabel)
{
case 0: cLabel++; Gen<int>.ExceptionTest(true); break;
case 1: cLabel++; Gen<double>.ExceptionTest(true); break;
case 2: cLabel++; Gen<string>.ExceptionTest(true); break;
case 3: cLabel++; Gen<object>.ExceptionTest(true); break;
case 4: cLabel++; Gen<Guid>.ExceptionTest(true); break;
case 5: cLabel++; Gen<int[]>.ExceptionTest(true); break;
case 6: cLabel++; Gen<double[,]>.ExceptionTest(true); break;
case 7: cLabel++; Gen<string[][][]>.ExceptionTest(true); break;
case 8: cLabel++; Gen<object[, , ,]>.ExceptionTest(true); break;
case 9: cLabel++; Gen<Guid[][, , ,][]>.ExceptionTest(true); break;
case 10: cLabel++; Gen<RefX1<int>[]>.ExceptionTest(true); break;
case 11: cLabel++; Gen<RefX1<double>[,]>.ExceptionTest(true); break;
case 12: cLabel++; Gen<RefX1<string>[][][]>.ExceptionTest(true); break;
case 13: cLabel++; Gen<RefX1<object>[, , ,]>.ExceptionTest(true); break;
case 14: cLabel++; Gen<RefX1<Guid>[][, , ,][]>.ExceptionTest(true); break;
case 15: cLabel++; Gen<RefX2<int, int>[]>.ExceptionTest(true); break;
case 16: cLabel++; Gen<RefX2<double, double>[,]>.ExceptionTest(true); break;
case 17: cLabel++; Gen<RefX2<string, string>[][][]>.ExceptionTest(true); break;
case 18: cLabel++; Gen<RefX2<object, object>[, , ,]>.ExceptionTest(true); break;
case 19: cLabel++; Gen<RefX2<Guid, Guid>[][, , ,][]>.ExceptionTest(true); break;
case 20: cLabel++; Gen<ValX1<int>[]>.ExceptionTest(true); break;
case 21: cLabel++; Gen<ValX1<double>[,]>.ExceptionTest(true); break;
case 22: cLabel++; Gen<ValX1<string>[][][]>.ExceptionTest(true); break;
case 23: cLabel++; Gen<ValX1<object>[, , ,]>.ExceptionTest(true); break;
case 24: cLabel++; Gen<ValX1<Guid>[][, , ,][]>.ExceptionTest(true); break;
case 25: cLabel++; Gen<ValX2<int, int>[]>.ExceptionTest(true); break;
case 26: cLabel++; Gen<ValX2<double, double>[,]>.ExceptionTest(true); break;
case 27: cLabel++; Gen<ValX2<string, string>[][][]>.ExceptionTest(true); break;
case 28: cLabel++; Gen<ValX2<object, object>[, , ,]>.ExceptionTest(true); break;
case 29: cLabel++; Gen<ValX2<Guid, Guid>[][, , ,][]>.ExceptionTest(true); break;
case 30: cLabel++; Gen<RefX1<int>>.ExceptionTest(true); break;
case 31: cLabel++; Gen<RefX1<ValX1<int>>>.ExceptionTest(true); break;
case 32: cLabel++; Gen<RefX2<int, string>>.ExceptionTest(true); break;
case 33: cLabel++; Gen<RefX3<int, string, Guid>>.ExceptionTest(true); break;
case 34: cLabel++; Gen<RefX1<RefX1<int>>>.ExceptionTest(true); break;
case 35: cLabel++; Gen<RefX1<RefX1<RefX1<string>>>>.ExceptionTest(true); break;
case 36: cLabel++; Gen<RefX1<RefX1<RefX1<RefX1<Guid>>>>>.ExceptionTest(true); break;
case 37: cLabel++; Gen<RefX1<RefX2<int, string>>>.ExceptionTest(true); break;
case 38: cLabel++; Gen<RefX2<RefX2<RefX1<int>, RefX3<int, string, RefX1<RefX2<int, string>>>>, RefX2<RefX1<int>, RefX3<int, string, RefX1<RefX2<int, string>>>>>>.ExceptionTest(true); break;
case 39: cLabel++; Gen<RefX3<RefX1<int[][, , ,]>, RefX2<object[, , ,][][], Guid[][][]>, RefX3<double[, , , , , , , , , ,], Guid[][][][, , , ,][, , , ,][][][], string[][][][][][][][][][][]>>>.ExceptionTest(true); break;
case 40: cLabel++; Gen<ValX1<int>>.ExceptionTest(true); break;
case 41: cLabel++; Gen<ValX1<RefX1<int>>>.ExceptionTest(true); break;
case 42: cLabel++; Gen<ValX2<int, string>>.ExceptionTest(true); break;
case 43: cLabel++; Gen<ValX3<int, string, Guid>>.ExceptionTest(true); break;
case 44: cLabel++; Gen<ValX1<ValX1<int>>>.ExceptionTest(true); break;
case 45: cLabel++; Gen<ValX1<ValX1<ValX1<string>>>>.ExceptionTest(true); break;
case 46: cLabel++; Gen<ValX1<ValX1<ValX1<ValX1<Guid>>>>>.ExceptionTest(true); break;
case 47: cLabel++; Gen<ValX1<ValX2<int, string>>>.ExceptionTest(true); break;
case 48: cLabel++; Gen<ValX2<ValX2<ValX1<int>, ValX3<int, string, ValX1<ValX2<int, string>>>>, ValX2<ValX1<int>, ValX3<int, string, ValX1<ValX2<int, string>>>>>>.ExceptionTest(true); break;
case 49: cLabel++; Gen<ValX3<ValX1<int[][, , ,]>, ValX2<object[, , ,][][], Guid[][][]>, ValX3<double[, , , , , , , , , ,], Guid[][][][, , , ,][, , , ,][][][], string[][][][][][][][][][][]>>>.ExceptionTest(true); break;
}
}
catch (GenException<int>) { Eval(cLabel == 1); }
catch (GenException<double>) { Eval(cLabel == 2); }
catch (GenException<string>) { Eval(cLabel == 3); }
catch (GenException<object>) { Eval(cLabel == 4); }
catch (GenException<Guid>) { Eval(cLabel == 5); }
catch (GenException<int[]>) { Eval(cLabel == 6); }
catch (GenException<double[,]>) { Eval(cLabel == 7); }
catch (GenException<string[][][]>) { Eval(cLabel == 8); }
catch (GenException<object[, , ,]>) { Eval(cLabel == 9); }
catch (GenException<Guid[][, , ,][]>) { Eval(cLabel == 10); }
catch (GenException<RefX1<int>[]>) { Eval(cLabel == 11); }
catch (GenException<RefX1<double>[,]>) { Eval(cLabel == 12); }
catch (GenException<RefX1<string>[][][]>) { Eval(cLabel == 13); }
catch (GenException<RefX1<object>[, , ,]>) { Eval(cLabel == 14); }
catch (GenException<RefX1<Guid>[][, , ,][]>) { Eval(cLabel == 15); }
catch (GenException<RefX2<int, int>[]>) { Eval(cLabel == 16); }
catch (GenException<RefX2<double, double>[,]>) { Eval(cLabel == 17); }
catch (GenException<RefX2<string, string>[][][]>) { Eval(cLabel == 18); }
catch (GenException<RefX2<object, object>[, , ,]>) { Eval(cLabel == 19); }
catch (GenException<RefX2<Guid, Guid>[][, , ,][]>) { Eval(cLabel == 20); }
catch (GenException<ValX1<int>[]>) { Eval(cLabel == 21); }
catch (GenException<ValX1<double>[,]>) { Eval(cLabel == 22); }
catch (GenException<ValX1<string>[][][]>) { Eval(cLabel == 23); }
catch (GenException<ValX1<object>[, , ,]>) { Eval(cLabel == 24); }
catch (GenException<ValX1<Guid>[][, , ,][]>) { Eval(cLabel == 25); }
catch (GenException<ValX2<int, int>[]>) { Eval(cLabel == 26); }
catch (GenException<ValX2<double, double>[,]>) { Eval(cLabel == 27); }
catch (GenException<ValX2<string, string>[][][]>) { Eval(cLabel == 28); }
catch (GenException<ValX2<object, object>[, , ,]>) { Eval(cLabel == 29); }
catch (GenException<ValX2<Guid, Guid>[][, , ,][]>) { Eval(cLabel == 30); }
catch (GenException<RefX1<int>>) { Eval(cLabel == 31); }
catch (GenException<RefX1<ValX1<int>>>) { Eval(cLabel == 32); }
catch (GenException<RefX2<int, string>>) { Eval(cLabel == 33); }
catch (GenException<RefX3<int, string, Guid>>) { Eval(cLabel == 34); }
catch (GenException<RefX1<RefX1<int>>>) { Eval(cLabel == 35); }
catch (GenException<RefX1<RefX1<RefX1<string>>>>) { Eval(cLabel == 36); }
catch (GenException<RefX1<RefX1<RefX1<RefX1<Guid>>>>>) { Eval(cLabel == 37); }
catch (GenException<RefX1<RefX2<int, string>>>) { Eval(cLabel == 38); }
catch (GenException<RefX2<RefX2<RefX1<int>, RefX3<int, string, RefX1<RefX2<int, string>>>>, RefX2<RefX1<int>, RefX3<int, string, RefX1<RefX2<int, string>>>>>>) { Eval(cLabel == 39); }
catch (GenException<RefX3<RefX1<int[][, , ,]>, RefX2<object[, , ,][][], Guid[][][]>, RefX3<double[, , , , , , , , , ,], Guid[][][][, , , ,][, , , ,][][][], string[][][][][][][][][][][]>>>) { Eval(cLabel == 40); }
catch (GenException<ValX1<int>>) { Eval(cLabel == 41); }
catch (GenException<ValX1<RefX1<int>>>) { Eval(cLabel == 42); }
catch (GenException<ValX2<int, string>>) { Eval(cLabel == 43); }
catch (GenException<ValX3<int, string, Guid>>) { Eval(cLabel == 44); }
catch (GenException<ValX1<ValX1<int>>>) { Eval(cLabel == 45); }
catch (GenException<ValX1<ValX1<ValX1<string>>>>) { Eval(cLabel == 46); }
catch (GenException<ValX1<ValX1<ValX1<ValX1<Guid>>>>>) { Eval(cLabel == 47); }
catch (GenException<ValX1<ValX2<int, string>>>) { Eval(cLabel == 48); }
catch (GenException<ValX2<ValX2<ValX1<int>, ValX3<int, string, ValX1<ValX2<int, string>>>>, ValX2<ValX1<int>, ValX3<int, string, ValX1<ValX2<int, string>>>>>>) { Eval(cLabel == 49); }
catch (GenException<ValX3<ValX1<int[][, , ,]>, ValX2<object[, , ,][][], Guid[][][]>, ValX3<double[, , , , , , , , , ,], Guid[][][][, , , ,][, , , ,][][][], string[][][][][][][][][][][]>>>) { Eval(cLabel == 50); }
}
if (result)
{
Console.WriteLine("Test Passed");
return 100;
}
else
{
Console.WriteLine("Test Failed");
return 1;
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/System.Net.HttpListener/src/System/Net/Managed/ChunkStream.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// System.Net.ChunkStream
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2003 Ximian, Inc (http://www.ximian.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Diagnostics;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
namespace System.Net
{
internal sealed class ChunkStream
{
private enum State
{
None,
PartialSize,
Body,
BodyFinished,
Trailer
}
private sealed class Chunk
{
public byte[] Bytes;
public int Offset;
public Chunk(byte[] chunk)
{
Bytes = chunk;
}
public int Read(byte[] buffer, int offset, int size)
{
int nread = (size > Bytes.Length - Offset) ? Bytes.Length - Offset : size;
Buffer.BlockCopy(Bytes, Offset, buffer, offset, nread);
Offset += nread;
return nread;
}
}
internal WebHeaderCollection _headers;
private int _chunkSize;
private int _chunkRead;
private int _totalWritten;
private State _state;
private StringBuilder _saved;
private bool _sawCR;
private bool _gotit;
private int _trailerState;
private List<Chunk> _chunks;
public ChunkStream(WebHeaderCollection headers)
{
_headers = headers;
_saved = new StringBuilder();
_chunks = new List<Chunk>();
_chunkSize = -1;
_totalWritten = 0;
}
public void ResetBuffer()
{
_chunkSize = -1;
_chunkRead = 0;
_totalWritten = 0;
_chunks.Clear();
}
public int Read(byte[] buffer, int offset, int size)
{
return ReadFromChunks(buffer, offset, size);
}
private int ReadFromChunks(byte[] buffer, int offset, int size)
{
int count = _chunks.Count;
int nread = 0;
var chunksForRemoving = new List<Chunk>(count);
for (int i = 0; i < count; i++)
{
Chunk chunk = _chunks[i];
if (chunk.Offset == chunk.Bytes.Length)
{
chunksForRemoving.Add(chunk);
continue;
}
nread += chunk.Read(buffer, offset + nread, size - nread);
if (nread == size)
break;
}
foreach (var chunk in chunksForRemoving)
_chunks.Remove(chunk);
return nread;
}
public void Write(byte[] buffer, int offset, int size)
{
// Note, the logic here only works when offset is 0 here.
// Otherwise, it would treat "size" as the end offset instead of an actual byte count from offset.
Debug.Assert(offset == 0);
if (offset < size)
InternalWrite(buffer, ref offset, size);
}
private void InternalWrite(byte[] buffer, ref int offset, int size)
{
if (_state == State.None || _state == State.PartialSize)
{
_state = GetChunkSize(buffer, ref offset, size);
if (_state == State.PartialSize)
return;
_saved.Length = 0;
_sawCR = false;
_gotit = false;
}
if (_state == State.Body && offset < size)
{
_state = ReadBody(buffer, ref offset, size);
if (_state == State.Body)
return;
}
if (_state == State.BodyFinished && offset < size)
{
_state = ReadCRLF(buffer, ref offset, size);
if (_state == State.BodyFinished)
return;
_sawCR = false;
}
if (_state == State.Trailer && offset < size)
{
_state = ReadTrailer(buffer, ref offset, size);
if (_state == State.Trailer)
return;
_saved.Length = 0;
_sawCR = false;
_gotit = false;
}
if (offset < size)
InternalWrite(buffer, ref offset, size);
}
public bool WantMore
{
get { return (_chunkRead != _chunkSize || _chunkSize != 0 || _state != State.None); }
}
public bool DataAvailable
{
get
{
int count = _chunks.Count;
for (int i = 0; i < count; i++)
{
Chunk ch = _chunks[i];
if (ch == null || ch.Bytes == null)
continue;
if (ch.Bytes.Length > 0 && ch.Offset < ch.Bytes.Length)
return (_state != State.Body);
}
return false;
}
}
public int TotalDataSize
{
get { return _totalWritten; }
}
public int ChunkLeft
{
get { return _chunkSize - _chunkRead; }
}
private State ReadBody(byte[] buffer, ref int offset, int size)
{
if (_chunkSize == 0)
return State.BodyFinished;
int diff = size - offset;
if (diff + _chunkRead > _chunkSize)
diff = _chunkSize - _chunkRead;
byte[] chunk = new byte[diff];
Buffer.BlockCopy(buffer, offset, chunk, 0, diff);
_chunks.Add(new Chunk(chunk));
offset += diff;
_chunkRead += diff;
_totalWritten += diff;
return (_chunkRead == _chunkSize) ? State.BodyFinished : State.Body;
}
private State GetChunkSize(byte[] buffer, ref int offset, int size)
{
_chunkRead = 0;
_chunkSize = 0;
char c = '\0';
while (offset < size)
{
c = (char)buffer[offset++];
if (c == '\r')
{
if (_sawCR)
ThrowProtocolViolation("2 CR found");
_sawCR = true;
continue;
}
if (_sawCR && c == '\n')
break;
if (c == ' ')
_gotit = true;
if (!_gotit)
_saved.Append(c);
if (_saved.Length > 20)
ThrowProtocolViolation("chunk size too long.");
}
if (!_sawCR || c != '\n')
{
if (offset < size)
ThrowProtocolViolation("Missing \\n");
try
{
if (_saved.Length > 0)
{
_chunkSize = int.Parse(RemoveChunkExtension(_saved.ToString()), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
}
}
catch (Exception)
{
ThrowProtocolViolation("Cannot parse chunk size.");
}
return State.PartialSize;
}
_chunkRead = 0;
try
{
_chunkSize = int.Parse(RemoveChunkExtension(_saved.ToString()), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
}
catch (Exception)
{
ThrowProtocolViolation("Cannot parse chunk size.");
}
if (_chunkSize == 0)
{
_trailerState = 2;
return State.Trailer;
}
return State.Body;
}
private static string RemoveChunkExtension(string input)
{
int idx = input.IndexOf(';');
if (idx == -1)
return input;
return input.Substring(0, idx);
}
private State ReadCRLF(byte[] buffer, ref int offset, int size)
{
if (!_sawCR)
{
if ((char)buffer[offset++] != '\r')
ThrowProtocolViolation("Expecting \\r");
_sawCR = true;
if (offset == size)
return State.BodyFinished;
}
if (_sawCR && (char)buffer[offset++] != '\n')
ThrowProtocolViolation("Expecting \\n");
return State.None;
}
private State ReadTrailer(byte[] buffer, ref int offset, int size)
{
char c;
// short path
if (_trailerState == 2 && (char)buffer[offset] == '\r' && _saved.Length == 0)
{
offset++;
if (offset < size && (char)buffer[offset] == '\n')
{
offset++;
return State.None;
}
offset--;
}
int st = _trailerState;
string stString = "\r\n\r";
while (offset < size && st < 4)
{
c = (char)buffer[offset++];
if ((st == 0 || st == 2) && c == '\r')
{
st++;
continue;
}
if ((st == 1 || st == 3) && c == '\n')
{
st++;
continue;
}
if (st > 0)
{
_saved.Append(stString.AsSpan(0, _saved.Length == 0 ? st - 2 : st));
st = 0;
if (_saved.Length > 4196)
ThrowProtocolViolation("Error reading trailer (too long).");
}
}
if (st < 4)
{
_trailerState = st;
if (offset < size)
ThrowProtocolViolation("Error reading trailer.");
return State.Trailer;
}
StringReader reader = new StringReader(_saved.ToString());
string? line;
while ((line = reader.ReadLine()) != null && line != "")
_headers.Add(line);
return State.None;
}
private static void ThrowProtocolViolation(string message)
{
WebException we = new WebException(message, null, WebExceptionStatus.ServerProtocolViolation, null);
throw we;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// System.Net.ChunkStream
//
// Authors:
// Gonzalo Paniagua Javier ([email protected])
//
// (C) 2003 Ximian, Inc (http://www.ximian.com)
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System.Collections;
using System.Diagnostics;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
namespace System.Net
{
internal sealed class ChunkStream
{
private enum State
{
None,
PartialSize,
Body,
BodyFinished,
Trailer
}
private sealed class Chunk
{
public byte[] Bytes;
public int Offset;
public Chunk(byte[] chunk)
{
Bytes = chunk;
}
public int Read(byte[] buffer, int offset, int size)
{
int nread = (size > Bytes.Length - Offset) ? Bytes.Length - Offset : size;
Buffer.BlockCopy(Bytes, Offset, buffer, offset, nread);
Offset += nread;
return nread;
}
}
internal WebHeaderCollection _headers;
private int _chunkSize;
private int _chunkRead;
private int _totalWritten;
private State _state;
private StringBuilder _saved;
private bool _sawCR;
private bool _gotit;
private int _trailerState;
private List<Chunk> _chunks;
public ChunkStream(WebHeaderCollection headers)
{
_headers = headers;
_saved = new StringBuilder();
_chunks = new List<Chunk>();
_chunkSize = -1;
_totalWritten = 0;
}
public void ResetBuffer()
{
_chunkSize = -1;
_chunkRead = 0;
_totalWritten = 0;
_chunks.Clear();
}
public int Read(byte[] buffer, int offset, int size)
{
return ReadFromChunks(buffer, offset, size);
}
private int ReadFromChunks(byte[] buffer, int offset, int size)
{
int count = _chunks.Count;
int nread = 0;
var chunksForRemoving = new List<Chunk>(count);
for (int i = 0; i < count; i++)
{
Chunk chunk = _chunks[i];
if (chunk.Offset == chunk.Bytes.Length)
{
chunksForRemoving.Add(chunk);
continue;
}
nread += chunk.Read(buffer, offset + nread, size - nread);
if (nread == size)
break;
}
foreach (var chunk in chunksForRemoving)
_chunks.Remove(chunk);
return nread;
}
public void Write(byte[] buffer, int offset, int size)
{
// Note, the logic here only works when offset is 0 here.
// Otherwise, it would treat "size" as the end offset instead of an actual byte count from offset.
Debug.Assert(offset == 0);
if (offset < size)
InternalWrite(buffer, ref offset, size);
}
private void InternalWrite(byte[] buffer, ref int offset, int size)
{
if (_state == State.None || _state == State.PartialSize)
{
_state = GetChunkSize(buffer, ref offset, size);
if (_state == State.PartialSize)
return;
_saved.Length = 0;
_sawCR = false;
_gotit = false;
}
if (_state == State.Body && offset < size)
{
_state = ReadBody(buffer, ref offset, size);
if (_state == State.Body)
return;
}
if (_state == State.BodyFinished && offset < size)
{
_state = ReadCRLF(buffer, ref offset, size);
if (_state == State.BodyFinished)
return;
_sawCR = false;
}
if (_state == State.Trailer && offset < size)
{
_state = ReadTrailer(buffer, ref offset, size);
if (_state == State.Trailer)
return;
_saved.Length = 0;
_sawCR = false;
_gotit = false;
}
if (offset < size)
InternalWrite(buffer, ref offset, size);
}
public bool WantMore
{
get { return (_chunkRead != _chunkSize || _chunkSize != 0 || _state != State.None); }
}
public bool DataAvailable
{
get
{
int count = _chunks.Count;
for (int i = 0; i < count; i++)
{
Chunk ch = _chunks[i];
if (ch == null || ch.Bytes == null)
continue;
if (ch.Bytes.Length > 0 && ch.Offset < ch.Bytes.Length)
return (_state != State.Body);
}
return false;
}
}
public int TotalDataSize
{
get { return _totalWritten; }
}
public int ChunkLeft
{
get { return _chunkSize - _chunkRead; }
}
private State ReadBody(byte[] buffer, ref int offset, int size)
{
if (_chunkSize == 0)
return State.BodyFinished;
int diff = size - offset;
if (diff + _chunkRead > _chunkSize)
diff = _chunkSize - _chunkRead;
byte[] chunk = new byte[diff];
Buffer.BlockCopy(buffer, offset, chunk, 0, diff);
_chunks.Add(new Chunk(chunk));
offset += diff;
_chunkRead += diff;
_totalWritten += diff;
return (_chunkRead == _chunkSize) ? State.BodyFinished : State.Body;
}
private State GetChunkSize(byte[] buffer, ref int offset, int size)
{
_chunkRead = 0;
_chunkSize = 0;
char c = '\0';
while (offset < size)
{
c = (char)buffer[offset++];
if (c == '\r')
{
if (_sawCR)
ThrowProtocolViolation("2 CR found");
_sawCR = true;
continue;
}
if (_sawCR && c == '\n')
break;
if (c == ' ')
_gotit = true;
if (!_gotit)
_saved.Append(c);
if (_saved.Length > 20)
ThrowProtocolViolation("chunk size too long.");
}
if (!_sawCR || c != '\n')
{
if (offset < size)
ThrowProtocolViolation("Missing \\n");
try
{
if (_saved.Length > 0)
{
_chunkSize = int.Parse(RemoveChunkExtension(_saved.ToString()), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
}
}
catch (Exception)
{
ThrowProtocolViolation("Cannot parse chunk size.");
}
return State.PartialSize;
}
_chunkRead = 0;
try
{
_chunkSize = int.Parse(RemoveChunkExtension(_saved.ToString()), NumberStyles.HexNumber, CultureInfo.InvariantCulture);
}
catch (Exception)
{
ThrowProtocolViolation("Cannot parse chunk size.");
}
if (_chunkSize == 0)
{
_trailerState = 2;
return State.Trailer;
}
return State.Body;
}
private static string RemoveChunkExtension(string input)
{
int idx = input.IndexOf(';');
if (idx == -1)
return input;
return input.Substring(0, idx);
}
private State ReadCRLF(byte[] buffer, ref int offset, int size)
{
if (!_sawCR)
{
if ((char)buffer[offset++] != '\r')
ThrowProtocolViolation("Expecting \\r");
_sawCR = true;
if (offset == size)
return State.BodyFinished;
}
if (_sawCR && (char)buffer[offset++] != '\n')
ThrowProtocolViolation("Expecting \\n");
return State.None;
}
private State ReadTrailer(byte[] buffer, ref int offset, int size)
{
char c;
// short path
if (_trailerState == 2 && (char)buffer[offset] == '\r' && _saved.Length == 0)
{
offset++;
if (offset < size && (char)buffer[offset] == '\n')
{
offset++;
return State.None;
}
offset--;
}
int st = _trailerState;
string stString = "\r\n\r";
while (offset < size && st < 4)
{
c = (char)buffer[offset++];
if ((st == 0 || st == 2) && c == '\r')
{
st++;
continue;
}
if ((st == 1 || st == 3) && c == '\n')
{
st++;
continue;
}
if (st > 0)
{
_saved.Append(stString.AsSpan(0, _saved.Length == 0 ? st - 2 : st));
st = 0;
if (_saved.Length > 4196)
ThrowProtocolViolation("Error reading trailer (too long).");
}
}
if (st < 4)
{
_trailerState = st;
if (offset < size)
ThrowProtocolViolation("Error reading trailer.");
return State.Trailer;
}
StringReader reader = new StringReader(_saved.ToString());
string? line;
while ((line = reader.ReadLine()) != null && line != "")
_headers.Add(line);
return State.None;
}
private static void ThrowProtocolViolation(string message)
{
WebException we = new WebException(message, null, WebExceptionStatus.ServerProtocolViolation, null);
throw we;
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/System.Text.Encoding/tests/System.Text.Encoding.Tests.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TestRuntime>true</TestRuntime>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<!-- Encoding.UTF7 and UTF7Encoding are obsolete, but we're the unit test project for it, so suppress warnings -->
<NoWarn>$(NoWarn),SYSLIB0001</NoWarn>
<EnableUnsafeUTF7Encoding>true</EnableUnsafeUTF7Encoding>
</PropertyGroup>
<ItemGroup>
<Compile Include="ASCIIEncoding\ASCIIEncodingEncode.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingDecode.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingGetDecoder.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingGetEncoder.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingGetMaxByteCount.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingGetMaxCharCount.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingTests.cs" />
<Compile Include="CustomEncoderReplacementFallback.cs" />
<Compile Include="Decoder\DecoderSpanTests.cs" />
<Compile Include="Decoder\DecoderConvert2.cs" />
<Compile Include="Decoder\DecoderCtor.cs" />
<Compile Include="Decoder\DecoderGetCharCount2.cs" />
<Compile Include="Decoder\DecoderGetCharCount3.cs" />
<Compile Include="Decoder\DecoderGetChars2.cs" />
<Compile Include="Decoder\DecoderGetChars3.cs" />
<Compile Include="Decoder\DecoderReset.cs" />
<Compile Include="DecoderFallback\DecoderFallbackTests.cs" />
<Compile Include="DecoderFallbackException\DecoderFallbackExceptionTests.cs" />
<Compile Include="EncoderFallbackException\EncoderFallbackExceptionTests.cs" />
<Compile Include="Encoder\EncoderSpanTests.cs" />
<Compile Include="Encoder\EncoderConvert2.cs" />
<Compile Include="Encoder\EncoderCtor.cs" />
<Compile Include="Encoder\EncoderGetByteCount2.cs" />
<Compile Include="Encoder\EncoderGetBytes2.cs" />
<Compile Include="Encoding\EncodingCtorTests.cs" />
<Compile Include="Encoding\EncodingGetEncodingTests.cs" />
<Compile Include="Encoding\EncodingConvertTests.cs" />
<Compile Include="Encoding\EncodingVirtualTests.cs" />
<Compile Include="Encoding\TranscodingStreamTests.cs" />
<Compile Include="Fallback\DecoderReplacementFallbackTests.cs" />
<Compile Include="Fallback\EncoderReplacementFallbackTests.cs" />
<Compile Include="Fallback\EncoderExceptionFallbackTests.cs" />
<Compile Include="Fallback\DecoderExceptionFallbackTests.cs" />
<Compile Include="NegativeEncodingTests.cs" />
<Compile Include="EncodingTestHelpers.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingEncode.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingDecode.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingGetMaxByteCount.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingGetMaxCharCount.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingTests.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingEncode.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingDecode.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingGetDecoder.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingGetEncoder.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingGetMaxByteCount.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingGetMaxCharCount.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingTests.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingDecode.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingGetMaxByteCount.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingGetMaxCharCount.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingTests.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingEncode.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingEncode.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingDecode.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingGetDecoder.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingGetEncoder.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingGetMaxByteCount.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingGetMaxCharCount.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingTests.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingEncode.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingDecode.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingGetDecoder.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingGetEncoder.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingGetMaxByteCount.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingGetMaxCharCount.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingTests.cs" />
<Compile Include="$(CommonTestPath)System\RandomDataGenerator.cs" />
<Compile Include="Encoding\Encoding.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncoding.cs" />
<Compile Include="Decoder\Decoder.cs" />
<Compile Include="Encoder\Encoder.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs" Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="$(CommonTestPath)System\IO\ConnectedStreams.cs" Link="Common\System\IO\ConnectedStreams.cs" />
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs" Link="ProductionCode\Common\System\Net\ArrayBuffer.cs" />
<Compile Include="$(CommonPath)System\Net\MultiArrayBuffer.cs" Link="ProductionCode\Common\System\Net\MultiArrayBuffer.cs" />
<Compile Include="$(CommonPath)System\Net\StreamBuffer.cs" Link="ProductionCode\Common\System\Net\StreamBuffer.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.IO.Pipelines\src\System.IO.Pipelines.csproj" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TestRuntime>true</TestRuntime>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<!-- Encoding.UTF7 and UTF7Encoding are obsolete, but we're the unit test project for it, so suppress warnings -->
<NoWarn>$(NoWarn),SYSLIB0001</NoWarn>
<EnableUnsafeUTF7Encoding>true</EnableUnsafeUTF7Encoding>
</PropertyGroup>
<ItemGroup>
<Compile Include="ASCIIEncoding\ASCIIEncodingEncode.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingDecode.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingGetDecoder.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingGetEncoder.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingGetMaxByteCount.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingGetMaxCharCount.cs" />
<Compile Include="ASCIIEncoding\ASCIIEncodingTests.cs" />
<Compile Include="CustomEncoderReplacementFallback.cs" />
<Compile Include="Decoder\DecoderSpanTests.cs" />
<Compile Include="Decoder\DecoderConvert2.cs" />
<Compile Include="Decoder\DecoderCtor.cs" />
<Compile Include="Decoder\DecoderGetCharCount2.cs" />
<Compile Include="Decoder\DecoderGetCharCount3.cs" />
<Compile Include="Decoder\DecoderGetChars2.cs" />
<Compile Include="Decoder\DecoderGetChars3.cs" />
<Compile Include="Decoder\DecoderReset.cs" />
<Compile Include="DecoderFallback\DecoderFallbackTests.cs" />
<Compile Include="DecoderFallbackException\DecoderFallbackExceptionTests.cs" />
<Compile Include="EncoderFallbackException\EncoderFallbackExceptionTests.cs" />
<Compile Include="Encoder\EncoderSpanTests.cs" />
<Compile Include="Encoder\EncoderConvert2.cs" />
<Compile Include="Encoder\EncoderCtor.cs" />
<Compile Include="Encoder\EncoderGetByteCount2.cs" />
<Compile Include="Encoder\EncoderGetBytes2.cs" />
<Compile Include="Encoding\EncodingCtorTests.cs" />
<Compile Include="Encoding\EncodingGetEncodingTests.cs" />
<Compile Include="Encoding\EncodingConvertTests.cs" />
<Compile Include="Encoding\EncodingVirtualTests.cs" />
<Compile Include="Encoding\TranscodingStreamTests.cs" />
<Compile Include="Fallback\DecoderReplacementFallbackTests.cs" />
<Compile Include="Fallback\EncoderReplacementFallbackTests.cs" />
<Compile Include="Fallback\EncoderExceptionFallbackTests.cs" />
<Compile Include="Fallback\DecoderExceptionFallbackTests.cs" />
<Compile Include="NegativeEncodingTests.cs" />
<Compile Include="EncodingTestHelpers.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingEncode.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingDecode.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingGetMaxByteCount.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingGetMaxCharCount.cs" />
<Compile Include="Latin1Encoding\Latin1EncodingTests.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingEncode.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingDecode.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingGetDecoder.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingGetEncoder.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingGetMaxByteCount.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingGetMaxCharCount.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncodingTests.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingDecode.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingGetMaxByteCount.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingGetMaxCharCount.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingTests.cs" />
<Compile Include="UTF32Encoding\UTF32EncodingEncode.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingEncode.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingDecode.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingGetDecoder.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingGetEncoder.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingGetMaxByteCount.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingGetMaxCharCount.cs" />
<Compile Include="UTF7Encoding\UTF7EncodingTests.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingEncode.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingDecode.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingGetDecoder.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingGetEncoder.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingGetMaxByteCount.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingGetMaxCharCount.cs" />
<Compile Include="UTF8Encoding\UTF8EncodingTests.cs" />
<Compile Include="$(CommonTestPath)System\RandomDataGenerator.cs" />
<Compile Include="Encoding\Encoding.cs" />
<Compile Include="UnicodeEncoding\UnicodeEncoding.cs" />
<Compile Include="Decoder\Decoder.cs" />
<Compile Include="Encoder\Encoder.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs" Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="$(CommonTestPath)System\IO\ConnectedStreams.cs" Link="Common\System\IO\ConnectedStreams.cs" />
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs" Link="ProductionCode\Common\System\Net\ArrayBuffer.cs" />
<Compile Include="$(CommonPath)System\Net\MultiArrayBuffer.cs" Link="ProductionCode\Common\System\Net\MultiArrayBuffer.cs" />
<Compile Include="$(CommonPath)System\Net\StreamBuffer.cs" Link="ProductionCode\Common\System\Net\StreamBuffer.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Moq" Version="$(MoqVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.IO.Pipelines\src\System.IO.Pipelines.csproj" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/tests/Loader/classloader/TypeGeneratorTests/TypeGeneratorTest1110/Generated1110.ilproj
|
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="Generated1110.il" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TestFramework\TestFramework.csproj" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="Generated1110.il" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TestFramework\TestFramework.csproj" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.Temps.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Linq.Expressions.Compiler
{
internal sealed partial class StackSpiller
{
/// <summary>
/// The source of temporary variables introduced during stack spilling.
/// </summary>
private readonly TempMaker _tm = new TempMaker();
/// <summary>
/// Creates a temporary variable of the specified <paramref name="type"/>.
/// </summary>
/// <param name="type">The type for the temporary variable to create.</param>
/// <returns>
/// A temporary variable of the specified <paramref name="type"/>. When the temporary
/// variable is no longer used, it should be returned by using the <see cref="Mark"/>
/// and <see cref="Free"/> mechanism provided.
/// </returns>
private ParameterExpression MakeTemp(Type type) => _tm.Temp(type);
/// <summary>
/// Gets a watermark into the stack of used temporary variables. The returned
/// watermark value can be passed to <see cref="Free"/> to free all variables
/// below the watermark value, allowing them to be reused.
/// </summary>
/// <returns>
/// A watermark value indicating the number of temporary variables currently in use.
/// </returns>
/// <remarks>
/// This is a performance optimization to lower the overall number of temporaries needed.
/// </remarks>
private int Mark() => _tm.Mark();
/// <summary>
/// Frees temporaries created since the last marking using <see cref="Mark"/>.
/// </summary>
/// <param name="mark">The watermark value up to which to recycle used temporary variables.</param>
/// <remarks>
/// This is a performance optimization to lower the overall number of temporaries needed.
/// </remarks>
private void Free(int mark) => _tm.Free(mark);
/// <summary>
/// Verifies that all temporary variables get properly returned to the free list
/// after stack spilling for a lambda expression has taken place. This is used
/// to detect misuse of the <see cref="Mark"/> and <see cref="Free"/> methods.
/// </summary>
[Conditional("DEBUG")]
private void VerifyTemps() => _tm.VerifyTemps();
/// <summary>
/// Creates and returns a temporary variable to store the result of evaluating
/// the specified <paramref name="expression"/>.
/// </summary>
/// <param name="expression">The expression to store in a temporary variable.</param>
/// <param name="save">An expression that assigns the <paramref name="expression"/> to the created temporary variable.</param>
/// <param name="byRef">Indicates whether the <paramref name="expression"/> represents a ByRef value.</param>
/// <returns>The temporary variable holding the result of evaluating <paramref name="expression"/>.</returns>
private ParameterExpression ToTemp(Expression expression, out Expression save, bool byRef)
{
Type tempType = byRef ? expression.Type.MakeByRefType() : expression.Type;
ParameterExpression temp = MakeTemp(tempType);
save = AssignBinaryExpression.Make(temp, expression, byRef);
return temp;
}
/// <summary>
/// Utility to create and recycle temporary variables.
/// </summary>
private sealed class TempMaker
{
/// <summary>
/// Index of the next temporary variable to create.
/// This value is used for naming temporary variables using an increasing index.
/// </summary>
private int _temp;
/// <summary>
/// List of free temporary variables. These can be recycled for new temporary variables.
/// </summary>
private List<ParameterExpression>? _freeTemps;
/// <summary>
/// Stack of temporary variables that are currently in use.
/// </summary>
private Stack<ParameterExpression>? _usedTemps;
/// <summary>
/// List of all temporary variables created by the stack spiller instance.
/// </summary>
internal List<ParameterExpression> Temps { get; } = new List<ParameterExpression>();
/// <summary>
/// Creates a temporary variable of the specified <paramref name="type"/>.
/// </summary>
/// <param name="type">The type for the temporary variable to create.</param>
/// <returns>
/// A temporary variable of the specified <paramref name="type"/>. When the temporary
/// variable is no longer used, it should be returned by using the <see cref="Mark"/>
/// and <see cref="Free"/> mechanism provided.
/// </returns>
internal ParameterExpression Temp(Type type)
{
ParameterExpression temp;
if (_freeTemps != null)
{
// Recycle from the free-list if possible.
for (int i = _freeTemps.Count - 1; i >= 0; i--)
{
temp = _freeTemps[i];
if (temp.Type == type)
{
_freeTemps.RemoveAt(i);
return UseTemp(temp);
}
}
}
// Not on the free-list, create a brand new one.
temp = ParameterExpression.Make(type, "$temp$" + _temp++, isByRef: false);
Temps.Add(temp);
return UseTemp(temp);
}
/// <summary>
/// Registers the temporary variable in the stack of used temporary variables.
/// The <see cref="Mark"/> and <see cref="Free"/> methods use a watermark index
/// into this stack to enable recycling temporary variables in bulk.
/// </summary>
/// <param name="temp">The temporary variable to mark as used.</param>
/// <returns>The original temporary variable.</returns>
private ParameterExpression UseTemp(ParameterExpression temp)
{
Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp));
Debug.Assert(_usedTemps == null || !_usedTemps.Contains(temp));
if (_usedTemps == null)
{
_usedTemps = new Stack<ParameterExpression>();
}
_usedTemps.Push(temp);
return temp;
}
/// <summary>
/// Puts the temporary variable on the free list which is used by the
/// <see cref="Temp"/> method to reuse temporary variables.
/// </summary>
/// <param name="temp">The temporary variable to mark as no longer in use.</param>
private void FreeTemp(ParameterExpression temp)
{
Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp));
if (_freeTemps == null)
{
_freeTemps = new List<ParameterExpression>();
}
_freeTemps.Add(temp);
}
/// <summary>
/// Gets a watermark into the stack of used temporary variables. The returned
/// watermark value can be passed to <see cref="Free"/> to free all variables
/// below the watermark value, allowing them to be reused.
/// </summary>
/// <returns>
/// A watermark value indicating the number of temporary variables currently in use.
/// </returns>
/// <remarks>
/// This is a performance optimization to lower the overall number of temporaries needed.
/// </remarks>
internal int Mark() => _usedTemps?.Count ?? 0;
/// <summary>
/// Frees temporaries created since the last marking using <see cref="Mark"/>.
/// </summary>
/// <param name="mark">The watermark value up to which to recycle used temporary variables.</param>
/// <remarks>
/// This is a performance optimization to lower the overall number of temporaries needed.
/// </remarks>
internal void Free(int mark)
{
// (_usedTemps != null) ==> (mark <= _usedTemps.Count)
Debug.Assert(_usedTemps == null || mark <= _usedTemps.Count);
// (_usedTemps == null) ==> (mark == 0)
Debug.Assert(mark == 0 || _usedTemps != null);
if (_usedTemps != null)
{
while (mark < _usedTemps.Count)
{
FreeTemp(_usedTemps.Pop());
}
}
}
/// <summary>
/// Verifies that all temporary variables get properly returned to the free list
/// after stack spilling for a lambda expression has taken place. This is used
/// to detect misuse of the <see cref="Mark"/> and <see cref="Free"/> methods.
/// </summary>
[Conditional("DEBUG")]
internal void VerifyTemps()
{
Debug.Assert(_usedTemps == null || _usedTemps.Count == 0);
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace System.Linq.Expressions.Compiler
{
internal sealed partial class StackSpiller
{
/// <summary>
/// The source of temporary variables introduced during stack spilling.
/// </summary>
private readonly TempMaker _tm = new TempMaker();
/// <summary>
/// Creates a temporary variable of the specified <paramref name="type"/>.
/// </summary>
/// <param name="type">The type for the temporary variable to create.</param>
/// <returns>
/// A temporary variable of the specified <paramref name="type"/>. When the temporary
/// variable is no longer used, it should be returned by using the <see cref="Mark"/>
/// and <see cref="Free"/> mechanism provided.
/// </returns>
private ParameterExpression MakeTemp(Type type) => _tm.Temp(type);
/// <summary>
/// Gets a watermark into the stack of used temporary variables. The returned
/// watermark value can be passed to <see cref="Free"/> to free all variables
/// below the watermark value, allowing them to be reused.
/// </summary>
/// <returns>
/// A watermark value indicating the number of temporary variables currently in use.
/// </returns>
/// <remarks>
/// This is a performance optimization to lower the overall number of temporaries needed.
/// </remarks>
private int Mark() => _tm.Mark();
/// <summary>
/// Frees temporaries created since the last marking using <see cref="Mark"/>.
/// </summary>
/// <param name="mark">The watermark value up to which to recycle used temporary variables.</param>
/// <remarks>
/// This is a performance optimization to lower the overall number of temporaries needed.
/// </remarks>
private void Free(int mark) => _tm.Free(mark);
/// <summary>
/// Verifies that all temporary variables get properly returned to the free list
/// after stack spilling for a lambda expression has taken place. This is used
/// to detect misuse of the <see cref="Mark"/> and <see cref="Free"/> methods.
/// </summary>
[Conditional("DEBUG")]
private void VerifyTemps() => _tm.VerifyTemps();
/// <summary>
/// Creates and returns a temporary variable to store the result of evaluating
/// the specified <paramref name="expression"/>.
/// </summary>
/// <param name="expression">The expression to store in a temporary variable.</param>
/// <param name="save">An expression that assigns the <paramref name="expression"/> to the created temporary variable.</param>
/// <param name="byRef">Indicates whether the <paramref name="expression"/> represents a ByRef value.</param>
/// <returns>The temporary variable holding the result of evaluating <paramref name="expression"/>.</returns>
private ParameterExpression ToTemp(Expression expression, out Expression save, bool byRef)
{
Type tempType = byRef ? expression.Type.MakeByRefType() : expression.Type;
ParameterExpression temp = MakeTemp(tempType);
save = AssignBinaryExpression.Make(temp, expression, byRef);
return temp;
}
/// <summary>
/// Utility to create and recycle temporary variables.
/// </summary>
private sealed class TempMaker
{
/// <summary>
/// Index of the next temporary variable to create.
/// This value is used for naming temporary variables using an increasing index.
/// </summary>
private int _temp;
/// <summary>
/// List of free temporary variables. These can be recycled for new temporary variables.
/// </summary>
private List<ParameterExpression>? _freeTemps;
/// <summary>
/// Stack of temporary variables that are currently in use.
/// </summary>
private Stack<ParameterExpression>? _usedTemps;
/// <summary>
/// List of all temporary variables created by the stack spiller instance.
/// </summary>
internal List<ParameterExpression> Temps { get; } = new List<ParameterExpression>();
/// <summary>
/// Creates a temporary variable of the specified <paramref name="type"/>.
/// </summary>
/// <param name="type">The type for the temporary variable to create.</param>
/// <returns>
/// A temporary variable of the specified <paramref name="type"/>. When the temporary
/// variable is no longer used, it should be returned by using the <see cref="Mark"/>
/// and <see cref="Free"/> mechanism provided.
/// </returns>
internal ParameterExpression Temp(Type type)
{
ParameterExpression temp;
if (_freeTemps != null)
{
// Recycle from the free-list if possible.
for (int i = _freeTemps.Count - 1; i >= 0; i--)
{
temp = _freeTemps[i];
if (temp.Type == type)
{
_freeTemps.RemoveAt(i);
return UseTemp(temp);
}
}
}
// Not on the free-list, create a brand new one.
temp = ParameterExpression.Make(type, "$temp$" + _temp++, isByRef: false);
Temps.Add(temp);
return UseTemp(temp);
}
/// <summary>
/// Registers the temporary variable in the stack of used temporary variables.
/// The <see cref="Mark"/> and <see cref="Free"/> methods use a watermark index
/// into this stack to enable recycling temporary variables in bulk.
/// </summary>
/// <param name="temp">The temporary variable to mark as used.</param>
/// <returns>The original temporary variable.</returns>
private ParameterExpression UseTemp(ParameterExpression temp)
{
Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp));
Debug.Assert(_usedTemps == null || !_usedTemps.Contains(temp));
if (_usedTemps == null)
{
_usedTemps = new Stack<ParameterExpression>();
}
_usedTemps.Push(temp);
return temp;
}
/// <summary>
/// Puts the temporary variable on the free list which is used by the
/// <see cref="Temp"/> method to reuse temporary variables.
/// </summary>
/// <param name="temp">The temporary variable to mark as no longer in use.</param>
private void FreeTemp(ParameterExpression temp)
{
Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp));
if (_freeTemps == null)
{
_freeTemps = new List<ParameterExpression>();
}
_freeTemps.Add(temp);
}
/// <summary>
/// Gets a watermark into the stack of used temporary variables. The returned
/// watermark value can be passed to <see cref="Free"/> to free all variables
/// below the watermark value, allowing them to be reused.
/// </summary>
/// <returns>
/// A watermark value indicating the number of temporary variables currently in use.
/// </returns>
/// <remarks>
/// This is a performance optimization to lower the overall number of temporaries needed.
/// </remarks>
internal int Mark() => _usedTemps?.Count ?? 0;
/// <summary>
/// Frees temporaries created since the last marking using <see cref="Mark"/>.
/// </summary>
/// <param name="mark">The watermark value up to which to recycle used temporary variables.</param>
/// <remarks>
/// This is a performance optimization to lower the overall number of temporaries needed.
/// </remarks>
internal void Free(int mark)
{
// (_usedTemps != null) ==> (mark <= _usedTemps.Count)
Debug.Assert(_usedTemps == null || mark <= _usedTemps.Count);
// (_usedTemps == null) ==> (mark == 0)
Debug.Assert(mark == 0 || _usedTemps != null);
if (_usedTemps != null)
{
while (mark < _usedTemps.Count)
{
FreeTemp(_usedTemps.Pop());
}
}
}
/// <summary>
/// Verifies that all temporary variables get properly returned to the free list
/// after stack spilling for a lambda expression has taken place. This is used
/// to detect misuse of the <see cref="Mark"/> and <see cref="Free"/> methods.
/// </summary>
[Conditional("DEBUG")]
internal void VerifyTemps()
{
Debug.Assert(_usedTemps == null || _usedTemps.Count == 0);
}
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/AddAcrossWidening.Vector128.UInt16.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void AddAcrossWidening_Vector128_UInt16()
{
var test = new SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt16[] inArray1, UInt32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt32>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt16> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
return testStruct;
}
public void RunStructFldScenario(SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16 testClass)
{
var result = AdvSimd.Arm64.AddAcrossWidening(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16 testClass)
{
fixed (Vector128<UInt16>* pFld1 = &_fld1)
{
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(pFld1))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
private static UInt16[] _data1 = new UInt16[Op1ElementCount];
private static Vector128<UInt16> _clsVar1;
private Vector128<UInt16> _fld1;
private DataTable _dataTable;
static SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
}
public SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
_dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.Arm64.AddAcrossWidening(
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddAcrossWidening), new Type[] { typeof(Vector128<UInt16>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddAcrossWidening), new Type[] { typeof(Vector128<UInt16>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.Arm64.AddAcrossWidening(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<UInt16>* pClsVar1 = &_clsVar1)
{
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(pClsVar1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr);
var result = AdvSimd.Arm64.AddAcrossWidening(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr));
var result = AdvSimd.Arm64.AddAcrossWidening(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16();
var result = AdvSimd.Arm64.AddAcrossWidening(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16();
fixed (Vector128<UInt16>* pFld1 = &test._fld1)
{
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.Arm64.AddAcrossWidening(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<UInt16>* pFld1 = &_fld1)
{
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.AddAcrossWidening(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(&test._fld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<UInt16> op1, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt32[] outArray = new UInt32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt32[] outArray = new UInt32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(UInt16[] firstOp, UInt32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (Helpers.AddAcrossWidening(firstOp) != result[0])
{
succeeded = false;
}
else
{
for (int i = 1; i < RetElementCount; i++)
{
if (result[i] != 0)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.AddAcrossWidening)}<UInt32>(Vector128<UInt16>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void AddAcrossWidening_Vector128_UInt16()
{
var test = new SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt16[] inArray1, UInt32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt16>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt32>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt16, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt16> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
return testStruct;
}
public void RunStructFldScenario(SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16 testClass)
{
var result = AdvSimd.Arm64.AddAcrossWidening(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16 testClass)
{
fixed (Vector128<UInt16>* pFld1 = &_fld1)
{
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(pFld1))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt16>>() / sizeof(UInt16);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<UInt32>>() / sizeof(UInt32);
private static UInt16[] _data1 = new UInt16[Op1ElementCount];
private static Vector128<UInt16> _clsVar1;
private Vector128<UInt16> _fld1;
private DataTable _dataTable;
static SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _clsVar1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
}
public SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt16>, byte>(ref _fld1), ref Unsafe.As<UInt16, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt16(); }
_dataTable = new DataTable(_data1, new UInt32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.Arm64.AddAcrossWidening(
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddAcrossWidening), new Type[] { typeof(Vector128<UInt16>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.AddAcrossWidening), new Type[] { typeof(Vector128<UInt16>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<UInt32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.Arm64.AddAcrossWidening(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<UInt16>* pClsVar1 = &_clsVar1)
{
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(pClsVar1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt16>>(_dataTable.inArray1Ptr);
var result = AdvSimd.Arm64.AddAcrossWidening(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((UInt16*)(_dataTable.inArray1Ptr));
var result = AdvSimd.Arm64.AddAcrossWidening(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16();
var result = AdvSimd.Arm64.AddAcrossWidening(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleUnaryOpTest__AddAcrossWidening_Vector128_UInt16();
fixed (Vector128<UInt16>* pFld1 = &test._fld1)
{
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.Arm64.AddAcrossWidening(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<UInt16>* pFld1 = &_fld1)
{
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.AddAcrossWidening(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.AddAcrossWidening(
AdvSimd.LoadVector128((UInt16*)(&test._fld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<UInt16> op1, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt32[] outArray = new UInt32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
UInt16[] inArray1 = new UInt16[Op1ElementCount];
UInt32[] outArray = new UInt32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt16, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt16>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<UInt32>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(UInt16[] firstOp, UInt32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (Helpers.AddAcrossWidening(firstOp) != result[0])
{
succeeded = false;
}
else
{
for (int i = 1; i < RetElementCount; i++)
{
if (result[i] != 0)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.AddAcrossWidening)}<UInt32>(Vector128<UInt16>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace System.Reflection
{
internal sealed partial class RuntimeModule : Module
{
internal RuntimeModule() { throw new NotSupportedException(); }
#region FCalls
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetType", StringMarshalling = StringMarshalling.Utf16)]
private static partial void GetType(QCallModule module, string className, [MarshalAs(UnmanagedType.Bool)] bool throwOnError, [MarshalAs(UnmanagedType.Bool)] bool ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive);
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetScopeName")]
private static partial void GetScopeName(QCallModule module, StringHandleOnStack retString);
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetFullyQualifiedName")]
private static partial void GetFullyQualifiedName(QCallModule module, StringHandleOnStack retString);
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern RuntimeType[] GetTypes(RuntimeModule module);
internal RuntimeType[] GetDefinedTypes()
{
return GetTypes(this);
}
#endregion
#region Module overrides
private static RuntimeTypeHandle[]? ConvertToTypeHandleArray(Type[]? genericArguments)
{
if (genericArguments == null)
return null;
int size = genericArguments.Length;
RuntimeTypeHandle[] typeHandleArgs = new RuntimeTypeHandle[size];
for (int i = 0; i < size; i++)
{
Type typeArg = genericArguments[i];
if (typeArg == null)
throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
typeArg = typeArg.UnderlyingSystemType;
if (typeArg == null)
throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
if (!(typeArg is RuntimeType))
throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
typeHandleArgs[i] = typeArg.TypeHandle;
}
return typeHandleArgs;
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override byte[] ResolveSignature(int metadataToken)
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
if (!tk.IsMemberRef && !tk.IsMethodDef && !tk.IsTypeSpec && !tk.IsSignature && !tk.IsFieldDef)
throw new ArgumentException(SR.Format(SR.Argument_InvalidToken, tk, this),
nameof(metadataToken));
ConstArray signature;
if (tk.IsMemberRef)
signature = MetadataImport.GetMemberRefProps(metadataToken);
else
signature = MetadataImport.GetSignatureFromToken(metadataToken);
byte[] sig = new byte[signature.Length];
for (int i = 0; i < signature.Length; i++)
sig[i] = signature[i];
return sig;
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override MethodBase? ResolveMethod(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
try
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!tk.IsMethodDef && !tk.IsMethodSpec)
{
if (!tk.IsMemberRef)
throw new ArgumentException(SR.Format(SR.Argument_ResolveMethod, tk, this),
nameof(metadataToken));
unsafe
{
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
if (*(MdSigCallingConvention*)sig.Signature == MdSigCallingConvention.Field)
throw new ArgumentException(SR.Format(SR.Argument_ResolveMethod, tk, this),
nameof(metadataToken));
}
}
RuntimeTypeHandle[]? typeArgs = null;
RuntimeTypeHandle[]? methodArgs = null;
if (genericTypeArguments?.Length > 0)
{
typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
}
if (genericMethodArguments?.Length > 0)
{
methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
}
ModuleHandle moduleHandle = new ModuleHandle(this);
IRuntimeMethodInfo methodHandle = moduleHandle.ResolveMethodHandle(tk, typeArgs, methodArgs).GetMethodInfo();
Type declaringType = RuntimeMethodHandle.GetDeclaringType(methodHandle);
if (declaringType.IsGenericType || declaringType.IsArray)
{
MetadataToken tkDeclaringType = new MetadataToken(MetadataImport.GetParentToken(tk));
if (tk.IsMethodSpec)
tkDeclaringType = new MetadataToken(MetadataImport.GetParentToken(tkDeclaringType));
declaringType = ResolveType(tkDeclaringType, genericTypeArguments, genericMethodArguments);
}
return RuntimeType.GetMethodBase(declaringType as RuntimeType, methodHandle);
}
catch (BadImageFormatException e)
{
throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
private FieldInfo? ResolveLiteralField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!MetadataImport.IsValidToken(tk) || !tk.IsFieldDef)
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
int tkDeclaringType;
string fieldName = MetadataImport.GetName(tk).ToString();
tkDeclaringType = MetadataImport.GetParentToken(tk);
Type declaringType = ResolveType(tkDeclaringType, genericTypeArguments, genericMethodArguments);
declaringType.GetFields();
try
{
return declaringType.GetField(fieldName,
BindingFlags.Static | BindingFlags.Instance |
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.DeclaredOnly);
}
catch
{
throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this), nameof(metadataToken));
}
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override FieldInfo? ResolveField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
try
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
RuntimeTypeHandle[]? typeArgs = null;
RuntimeTypeHandle[]? methodArgs = null;
if (genericTypeArguments?.Length > 0)
{
typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
}
if (genericMethodArguments?.Length > 0)
{
methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
}
ModuleHandle moduleHandle = new ModuleHandle(this);
if (!tk.IsFieldDef)
{
if (!tk.IsMemberRef)
throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this),
nameof(metadataToken));
unsafe
{
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
if (*(MdSigCallingConvention*)sig.Signature != MdSigCallingConvention.Field)
throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this),
nameof(metadataToken));
}
}
IRuntimeFieldInfo fieldHandle = moduleHandle.ResolveFieldHandle(metadataToken, typeArgs, methodArgs).GetRuntimeFieldInfo();
RuntimeType declaringType = RuntimeFieldHandle.GetApproxDeclaringType(fieldHandle.Value);
if (declaringType.IsGenericType || declaringType.IsArray)
{
int tkDeclaringType = ModuleHandle.GetMetadataImport(this).GetParentToken(metadataToken);
declaringType = (RuntimeType)ResolveType(tkDeclaringType, genericTypeArguments, genericMethodArguments);
}
return RuntimeType.GetFieldInfo(declaringType, fieldHandle);
}
catch (MissingFieldException)
{
return ResolveLiteralField(metadataToken, genericTypeArguments, genericMethodArguments);
}
catch (BadImageFormatException e)
{
throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override Type ResolveType(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
try
{
MetadataToken tk = new MetadataToken(metadataToken);
if (tk.IsGlobalTypeDefToken)
throw new ArgumentException(SR.Format(SR.Argument_ResolveModuleType, tk), nameof(metadataToken));
if (!tk.IsTypeDef && !tk.IsTypeSpec && !tk.IsTypeRef)
throw new ArgumentException(SR.Format(SR.Argument_ResolveType, tk, this), nameof(metadataToken));
RuntimeTypeHandle[]? typeArgs = null;
RuntimeTypeHandle[]? methodArgs = null;
if (genericTypeArguments?.Length > 0)
{
typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
}
if (genericMethodArguments?.Length > 0)
{
methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
}
return GetModuleHandleImpl().ResolveTypeHandle(metadataToken, typeArgs, methodArgs).GetRuntimeType();
}
catch (BadImageFormatException e)
{
throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override MemberInfo? ResolveMember(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
MetadataToken tk = new MetadataToken(metadataToken);
if (tk.IsProperty)
throw new ArgumentException(SR.InvalidOperation_PropertyInfoNotAvailable);
if (tk.IsEvent)
throw new ArgumentException(SR.InvalidOperation_EventInfoNotAvailable);
if (tk.IsMethodSpec || tk.IsMethodDef)
return ResolveMethod(metadataToken, genericTypeArguments, genericMethodArguments);
if (tk.IsFieldDef)
return ResolveField(metadataToken, genericTypeArguments, genericMethodArguments);
if (tk.IsTypeRef || tk.IsTypeDef || tk.IsTypeSpec)
return ResolveType(metadataToken, genericTypeArguments, genericMethodArguments);
if (tk.IsMemberRef)
{
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
unsafe
{
if (*(MdSigCallingConvention*)sig.Signature == MdSigCallingConvention.Field)
{
return ResolveField(tk, genericTypeArguments, genericMethodArguments);
}
else
{
return ResolveMethod(tk, genericTypeArguments, genericMethodArguments);
}
}
}
throw new ArgumentException(SR.Format(SR.Argument_ResolveMember, tk, this),
nameof(metadataToken));
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override string ResolveString(int metadataToken)
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!tk.IsString)
throw new ArgumentException(
SR.Format(SR.Argument_ResolveString, metadataToken, this));
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
string? str = MetadataImport.GetUserString(metadataToken);
if (str == null)
throw new ArgumentException(
SR.Format(SR.Argument_ResolveString, metadataToken, this));
return str;
}
public override void GetPEKind(out PortableExecutableKinds peKind, out ImageFileMachine machine)
{
ModuleHandle.GetPEKind(this, out peKind, out machine);
}
public override int MDStreamVersion => ModuleHandle.GetMDStreamVersion(this);
#endregion
#region Data Members
#pragma warning disable CA1823, 169
// If you add any data members, you need to update the native declaration ReflectModuleBaseObject.
private RuntimeType m_runtimeType;
private RuntimeAssembly m_runtimeAssembly;
private IntPtr m_pRefClass;
private IntPtr m_pData;
private IntPtr m_pGlobals;
private IntPtr m_pFields;
#pragma warning restore CA1823, 169
#endregion
#region Protected Virtuals
[RequiresUnreferencedCode("Methods might be removed because Module methods can't currently be annotated for dynamic access.")]
protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder,
CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers)
{
return GetMethodInternal(name, bindingAttr, binder, callConvention, types, modifiers);
}
[RequiresUnreferencedCode("Methods might be removed because Module methods can't currently be annotated for dynamic access.")]
internal MethodInfo? GetMethodInternal(string name, BindingFlags bindingAttr, Binder? binder,
CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers)
{
if (RuntimeType == null)
return null;
if (types == null)
{
return RuntimeType.GetMethod(name, bindingAttr);
}
else
{
return RuntimeType.GetMethod(name, bindingAttr, binder, callConvention, types, modifiers);
}
}
#endregion
#region Internal Members
internal RuntimeType RuntimeType => m_runtimeType ??= ModuleHandle.GetModuleType(this);
internal MetadataImport MetadataImport => ModuleHandle.GetMetadataImport(this);
#endregion
#region ICustomAttributeProvider Members
public override object[] GetCustomAttributes(bool inherit)
{
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!);
}
public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
public override bool IsDefined(Type attributeType!!, bool inherit)
{
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
public override IList<CustomAttributeData> GetCustomAttributesData()
{
return RuntimeCustomAttributeData.GetCustomAttributesInternal(this);
}
#endregion
#region Public Virtuals
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
throw new PlatformNotSupportedException();
}
[RequiresUnreferencedCode("Types might be removed")]
public override Type? GetType(
string className!!, // throw on null strings regardless of the value of "throwOnError"
bool throwOnError, bool ignoreCase)
{
RuntimeType? retType = null;
object? keepAlive = null;
RuntimeModule thisAsLocal = this;
GetType(new QCallModule(ref thisAsLocal), className, throwOnError, ignoreCase, ObjectHandleOnStack.Create(ref retType), ObjectHandleOnStack.Create(ref keepAlive));
GC.KeepAlive(keepAlive);
return retType;
}
[RequiresAssemblyFiles(UnknownStringMessageInRAF)]
internal string GetFullyQualifiedName()
{
string? fullyQualifiedName = null;
RuntimeModule thisAsLocal = this;
GetFullyQualifiedName(new QCallModule(ref thisAsLocal), new StringHandleOnStack(ref fullyQualifiedName));
return fullyQualifiedName!;
}
[RequiresAssemblyFiles(UnknownStringMessageInRAF)]
public override string FullyQualifiedName => GetFullyQualifiedName();
[RequiresUnreferencedCode("Types might be removed")]
public override Type[] GetTypes()
{
return GetTypes(this);
}
#endregion
#region Public Members
public override Guid ModuleVersionId
{
get
{
MetadataImport.GetScopeProps(out Guid mvid);
return mvid;
}
}
public override int MetadataToken => ModuleHandle.GetToken(this);
public override bool IsResource()
{
// CoreClr does not support resource-only modules.
return false;
}
[RequiresUnreferencedCode("Fields might be removed")]
public override FieldInfo[] GetFields(BindingFlags bindingFlags)
{
if (RuntimeType == null)
return Array.Empty<FieldInfo>();
return RuntimeType.GetFields(bindingFlags);
}
[RequiresUnreferencedCode("Fields might be removed")]
public override FieldInfo? GetField(string name!!, BindingFlags bindingAttr)
{
return RuntimeType?.GetField(name, bindingAttr);
}
[RequiresUnreferencedCode("Methods might be removed")]
public override MethodInfo[] GetMethods(BindingFlags bindingFlags)
{
if (RuntimeType == null)
return Array.Empty<MethodInfo>();
return RuntimeType.GetMethods(bindingFlags);
}
public override string ScopeName
{
get
{
string? scopeName = null;
RuntimeModule thisAsLocal = this;
GetScopeName(new QCallModule(ref thisAsLocal), new StringHandleOnStack(ref scopeName));
return scopeName!;
}
}
[RequiresAssemblyFiles(UnknownStringMessageInRAF)]
public override string Name
{
get
{
string s = GetFullyQualifiedName();
int i = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar);
if (i < 0)
return s;
return s.Substring(i + 1);
}
}
public override Assembly Assembly => GetRuntimeAssembly();
internal RuntimeAssembly GetRuntimeAssembly()
{
return m_runtimeAssembly;
}
protected override ModuleHandle GetModuleHandleImpl()
{
return new ModuleHandle(this);
}
internal IntPtr GetUnderlyingNativeHandle()
{
return m_pData;
}
#endregion
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
namespace System.Reflection
{
internal sealed partial class RuntimeModule : Module
{
internal RuntimeModule() { throw new NotSupportedException(); }
#region FCalls
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetType", StringMarshalling = StringMarshalling.Utf16)]
private static partial void GetType(QCallModule module, string className, [MarshalAs(UnmanagedType.Bool)] bool throwOnError, [MarshalAs(UnmanagedType.Bool)] bool ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive);
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetScopeName")]
private static partial void GetScopeName(QCallModule module, StringHandleOnStack retString);
[LibraryImport(RuntimeHelpers.QCall, EntryPoint = "RuntimeModule_GetFullyQualifiedName")]
private static partial void GetFullyQualifiedName(QCallModule module, StringHandleOnStack retString);
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern RuntimeType[] GetTypes(RuntimeModule module);
internal RuntimeType[] GetDefinedTypes()
{
return GetTypes(this);
}
#endregion
#region Module overrides
private static RuntimeTypeHandle[]? ConvertToTypeHandleArray(Type[]? genericArguments)
{
if (genericArguments == null)
return null;
int size = genericArguments.Length;
RuntimeTypeHandle[] typeHandleArgs = new RuntimeTypeHandle[size];
for (int i = 0; i < size; i++)
{
Type typeArg = genericArguments[i];
if (typeArg == null)
throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
typeArg = typeArg.UnderlyingSystemType;
if (typeArg == null)
throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
if (!(typeArg is RuntimeType))
throw new ArgumentException(SR.Argument_InvalidGenericInstArray);
typeHandleArgs[i] = typeArg.TypeHandle;
}
return typeHandleArgs;
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override byte[] ResolveSignature(int metadataToken)
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
if (!tk.IsMemberRef && !tk.IsMethodDef && !tk.IsTypeSpec && !tk.IsSignature && !tk.IsFieldDef)
throw new ArgumentException(SR.Format(SR.Argument_InvalidToken, tk, this),
nameof(metadataToken));
ConstArray signature;
if (tk.IsMemberRef)
signature = MetadataImport.GetMemberRefProps(metadataToken);
else
signature = MetadataImport.GetSignatureFromToken(metadataToken);
byte[] sig = new byte[signature.Length];
for (int i = 0; i < signature.Length; i++)
sig[i] = signature[i];
return sig;
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override MethodBase? ResolveMethod(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
try
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!tk.IsMethodDef && !tk.IsMethodSpec)
{
if (!tk.IsMemberRef)
throw new ArgumentException(SR.Format(SR.Argument_ResolveMethod, tk, this),
nameof(metadataToken));
unsafe
{
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
if (*(MdSigCallingConvention*)sig.Signature == MdSigCallingConvention.Field)
throw new ArgumentException(SR.Format(SR.Argument_ResolveMethod, tk, this),
nameof(metadataToken));
}
}
RuntimeTypeHandle[]? typeArgs = null;
RuntimeTypeHandle[]? methodArgs = null;
if (genericTypeArguments?.Length > 0)
{
typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
}
if (genericMethodArguments?.Length > 0)
{
methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
}
ModuleHandle moduleHandle = new ModuleHandle(this);
IRuntimeMethodInfo methodHandle = moduleHandle.ResolveMethodHandle(tk, typeArgs, methodArgs).GetMethodInfo();
Type declaringType = RuntimeMethodHandle.GetDeclaringType(methodHandle);
if (declaringType.IsGenericType || declaringType.IsArray)
{
MetadataToken tkDeclaringType = new MetadataToken(MetadataImport.GetParentToken(tk));
if (tk.IsMethodSpec)
tkDeclaringType = new MetadataToken(MetadataImport.GetParentToken(tkDeclaringType));
declaringType = ResolveType(tkDeclaringType, genericTypeArguments, genericMethodArguments);
}
return RuntimeType.GetMethodBase(declaringType as RuntimeType, methodHandle);
}
catch (BadImageFormatException e)
{
throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
private FieldInfo? ResolveLiteralField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!MetadataImport.IsValidToken(tk) || !tk.IsFieldDef)
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
int tkDeclaringType;
string fieldName = MetadataImport.GetName(tk).ToString();
tkDeclaringType = MetadataImport.GetParentToken(tk);
Type declaringType = ResolveType(tkDeclaringType, genericTypeArguments, genericMethodArguments);
declaringType.GetFields();
try
{
return declaringType.GetField(fieldName,
BindingFlags.Static | BindingFlags.Instance |
BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.DeclaredOnly);
}
catch
{
throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this), nameof(metadataToken));
}
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override FieldInfo? ResolveField(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
try
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
RuntimeTypeHandle[]? typeArgs = null;
RuntimeTypeHandle[]? methodArgs = null;
if (genericTypeArguments?.Length > 0)
{
typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
}
if (genericMethodArguments?.Length > 0)
{
methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
}
ModuleHandle moduleHandle = new ModuleHandle(this);
if (!tk.IsFieldDef)
{
if (!tk.IsMemberRef)
throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this),
nameof(metadataToken));
unsafe
{
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
if (*(MdSigCallingConvention*)sig.Signature != MdSigCallingConvention.Field)
throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this),
nameof(metadataToken));
}
}
IRuntimeFieldInfo fieldHandle = moduleHandle.ResolveFieldHandle(metadataToken, typeArgs, methodArgs).GetRuntimeFieldInfo();
RuntimeType declaringType = RuntimeFieldHandle.GetApproxDeclaringType(fieldHandle.Value);
if (declaringType.IsGenericType || declaringType.IsArray)
{
int tkDeclaringType = ModuleHandle.GetMetadataImport(this).GetParentToken(metadataToken);
declaringType = (RuntimeType)ResolveType(tkDeclaringType, genericTypeArguments, genericMethodArguments);
}
return RuntimeType.GetFieldInfo(declaringType, fieldHandle);
}
catch (MissingFieldException)
{
return ResolveLiteralField(metadataToken, genericTypeArguments, genericMethodArguments);
}
catch (BadImageFormatException e)
{
throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override Type ResolveType(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
try
{
MetadataToken tk = new MetadataToken(metadataToken);
if (tk.IsGlobalTypeDefToken)
throw new ArgumentException(SR.Format(SR.Argument_ResolveModuleType, tk), nameof(metadataToken));
if (!tk.IsTypeDef && !tk.IsTypeSpec && !tk.IsTypeRef)
throw new ArgumentException(SR.Format(SR.Argument_ResolveType, tk, this), nameof(metadataToken));
RuntimeTypeHandle[]? typeArgs = null;
RuntimeTypeHandle[]? methodArgs = null;
if (genericTypeArguments?.Length > 0)
{
typeArgs = ConvertToTypeHandleArray(genericTypeArguments);
}
if (genericMethodArguments?.Length > 0)
{
methodArgs = ConvertToTypeHandleArray(genericMethodArguments);
}
return GetModuleHandleImpl().ResolveTypeHandle(metadataToken, typeArgs, methodArgs).GetRuntimeType();
}
catch (BadImageFormatException e)
{
throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e);
}
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override MemberInfo? ResolveMember(int metadataToken, Type[]? genericTypeArguments, Type[]? genericMethodArguments)
{
MetadataToken tk = new MetadataToken(metadataToken);
if (tk.IsProperty)
throw new ArgumentException(SR.InvalidOperation_PropertyInfoNotAvailable);
if (tk.IsEvent)
throw new ArgumentException(SR.InvalidOperation_EventInfoNotAvailable);
if (tk.IsMethodSpec || tk.IsMethodDef)
return ResolveMethod(metadataToken, genericTypeArguments, genericMethodArguments);
if (tk.IsFieldDef)
return ResolveField(metadataToken, genericTypeArguments, genericMethodArguments);
if (tk.IsTypeRef || tk.IsTypeDef || tk.IsTypeSpec)
return ResolveType(metadataToken, genericTypeArguments, genericMethodArguments);
if (tk.IsMemberRef)
{
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
ConstArray sig = MetadataImport.GetMemberRefProps(tk);
unsafe
{
if (*(MdSigCallingConvention*)sig.Signature == MdSigCallingConvention.Field)
{
return ResolveField(tk, genericTypeArguments, genericMethodArguments);
}
else
{
return ResolveMethod(tk, genericTypeArguments, genericMethodArguments);
}
}
}
throw new ArgumentException(SR.Format(SR.Argument_ResolveMember, tk, this),
nameof(metadataToken));
}
[RequiresUnreferencedCode("Trimming changes metadata tokens")]
public override string ResolveString(int metadataToken)
{
MetadataToken tk = new MetadataToken(metadataToken);
if (!tk.IsString)
throw new ArgumentException(
SR.Format(SR.Argument_ResolveString, metadataToken, this));
if (!MetadataImport.IsValidToken(tk))
throw new ArgumentOutOfRangeException(nameof(metadataToken),
SR.Format(SR.Argument_InvalidToken, tk, this));
string? str = MetadataImport.GetUserString(metadataToken);
if (str == null)
throw new ArgumentException(
SR.Format(SR.Argument_ResolveString, metadataToken, this));
return str;
}
public override void GetPEKind(out PortableExecutableKinds peKind, out ImageFileMachine machine)
{
ModuleHandle.GetPEKind(this, out peKind, out machine);
}
public override int MDStreamVersion => ModuleHandle.GetMDStreamVersion(this);
#endregion
#region Data Members
#pragma warning disable CA1823, 169
// If you add any data members, you need to update the native declaration ReflectModuleBaseObject.
private RuntimeType m_runtimeType;
private RuntimeAssembly m_runtimeAssembly;
private IntPtr m_pRefClass;
private IntPtr m_pData;
private IntPtr m_pGlobals;
private IntPtr m_pFields;
#pragma warning restore CA1823, 169
#endregion
#region Protected Virtuals
[RequiresUnreferencedCode("Methods might be removed because Module methods can't currently be annotated for dynamic access.")]
protected override MethodInfo? GetMethodImpl(string name, BindingFlags bindingAttr, Binder? binder,
CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers)
{
return GetMethodInternal(name, bindingAttr, binder, callConvention, types, modifiers);
}
[RequiresUnreferencedCode("Methods might be removed because Module methods can't currently be annotated for dynamic access.")]
internal MethodInfo? GetMethodInternal(string name, BindingFlags bindingAttr, Binder? binder,
CallingConventions callConvention, Type[]? types, ParameterModifier[]? modifiers)
{
if (RuntimeType == null)
return null;
if (types == null)
{
return RuntimeType.GetMethod(name, bindingAttr);
}
else
{
return RuntimeType.GetMethod(name, bindingAttr, binder, callConvention, types, modifiers);
}
}
#endregion
#region Internal Members
internal RuntimeType RuntimeType => m_runtimeType ??= ModuleHandle.GetModuleType(this);
internal MetadataImport MetadataImport => ModuleHandle.GetMetadataImport(this);
#endregion
#region ICustomAttributeProvider Members
public override object[] GetCustomAttributes(bool inherit)
{
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!);
}
public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
public override bool IsDefined(Type attributeType!!, bool inherit)
{
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.IsDefined(this, attributeRuntimeType);
}
public override IList<CustomAttributeData> GetCustomAttributesData()
{
return RuntimeCustomAttributeData.GetCustomAttributesInternal(this);
}
#endregion
#region Public Virtuals
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
throw new PlatformNotSupportedException();
}
[RequiresUnreferencedCode("Types might be removed")]
public override Type? GetType(
string className!!, // throw on null strings regardless of the value of "throwOnError"
bool throwOnError, bool ignoreCase)
{
RuntimeType? retType = null;
object? keepAlive = null;
RuntimeModule thisAsLocal = this;
GetType(new QCallModule(ref thisAsLocal), className, throwOnError, ignoreCase, ObjectHandleOnStack.Create(ref retType), ObjectHandleOnStack.Create(ref keepAlive));
GC.KeepAlive(keepAlive);
return retType;
}
[RequiresAssemblyFiles(UnknownStringMessageInRAF)]
internal string GetFullyQualifiedName()
{
string? fullyQualifiedName = null;
RuntimeModule thisAsLocal = this;
GetFullyQualifiedName(new QCallModule(ref thisAsLocal), new StringHandleOnStack(ref fullyQualifiedName));
return fullyQualifiedName!;
}
[RequiresAssemblyFiles(UnknownStringMessageInRAF)]
public override string FullyQualifiedName => GetFullyQualifiedName();
[RequiresUnreferencedCode("Types might be removed")]
public override Type[] GetTypes()
{
return GetTypes(this);
}
#endregion
#region Public Members
public override Guid ModuleVersionId
{
get
{
MetadataImport.GetScopeProps(out Guid mvid);
return mvid;
}
}
public override int MetadataToken => ModuleHandle.GetToken(this);
public override bool IsResource()
{
// CoreClr does not support resource-only modules.
return false;
}
[RequiresUnreferencedCode("Fields might be removed")]
public override FieldInfo[] GetFields(BindingFlags bindingFlags)
{
if (RuntimeType == null)
return Array.Empty<FieldInfo>();
return RuntimeType.GetFields(bindingFlags);
}
[RequiresUnreferencedCode("Fields might be removed")]
public override FieldInfo? GetField(string name!!, BindingFlags bindingAttr)
{
return RuntimeType?.GetField(name, bindingAttr);
}
[RequiresUnreferencedCode("Methods might be removed")]
public override MethodInfo[] GetMethods(BindingFlags bindingFlags)
{
if (RuntimeType == null)
return Array.Empty<MethodInfo>();
return RuntimeType.GetMethods(bindingFlags);
}
public override string ScopeName
{
get
{
string? scopeName = null;
RuntimeModule thisAsLocal = this;
GetScopeName(new QCallModule(ref thisAsLocal), new StringHandleOnStack(ref scopeName));
return scopeName!;
}
}
[RequiresAssemblyFiles(UnknownStringMessageInRAF)]
public override string Name
{
get
{
string s = GetFullyQualifiedName();
int i = s.LastIndexOf(System.IO.Path.DirectorySeparatorChar);
if (i < 0)
return s;
return s.Substring(i + 1);
}
}
public override Assembly Assembly => GetRuntimeAssembly();
internal RuntimeAssembly GetRuntimeAssembly()
{
return m_runtimeAssembly;
}
protected override ModuleHandle GetModuleHandleImpl()
{
return new ModuleHandle(this);
}
internal IntPtr GetUnderlyingNativeHandle()
{
return m_pData;
}
#endregion
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/tests/JIT/Directed/PREFIX/unaligned/4/fielda_tests.ilproj
|
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="fielda_tests.il" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk.IL">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="fielda_tests.il" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/libraries/System.ComponentModel.Composition/tests/System/ComponentModel/Composition/MetadataViewProviderTests.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Reflection;
using Xunit;
namespace System.ComponentModel.Composition
{
internal static class TransparentTestCase
{
public static int GetMetadataView_IMetadataViewWithDefaultedIntInTranparentType(ITrans_MetadataViewWithDefaultedInt view)
{
return view.MyInt;
}
}
[MetadataViewImplementation(typeof(MetadataViewWithImplementation))]
public interface IMetadataViewWithImplementation
{
string String1 { get; }
string String2 { get; }
}
public class MetadataViewWithImplementation : IMetadataViewWithImplementation
{
public MetadataViewWithImplementation(IDictionary<string, object> metadata)
{
this.String1 = (string)metadata["String1"];
this.String2 = (string)metadata["String2"];
}
public string String1 { get; private set; }
public string String2 { get; private set; }
}
[MetadataViewImplementation(typeof(MetadataViewWithImplementationNoInterface))]
public interface IMetadataViewWithImplementationNoInterface
{
string String1 { get; }
string String2 { get; }
}
public class MetadataViewWithImplementationNoInterface
{
public MetadataViewWithImplementationNoInterface(IDictionary<string, object> metadata)
{
this.String1 = (string)metadata["String1"];
this.String2 = (string)metadata["String2"];
}
public string String1 { get; private set; }
public string String2 { get; private set; }
}
public class MetadataViewProviderTests
{
[Fact]
public void GetMetadataView_InterfaceWithPropertySetter_ShouldThrowNotSupported()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataViewWithPropertySetter>(metadata);
});
}
[Fact]
public void GetMetadataView_InterfaceWithMethod_ShouldThrowNotSupportedException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataViewWithMethod>(metadata);
});
}
[Fact]
public void GetMetadataView_InterfaceWithEvent_ShouldThrowNotSupportedException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataViewWithEvent>(metadata);
});
}
[Fact]
[ActiveIssue("https://github.com/mono/mono/issues/15169", TestRuntimes.Mono)]
public void GetMetadataView_InterfaceWithIndexer_ShouldThrowNotSupportedException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataViewWithIndexer>(metadata);
});
}
[Fact]
public void GetMetadataView_AbstractClass_ShouldThrowMissingMethodException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<AbstractClassMetadataView>(metadata);
});
}
[Fact]
public void GetMetadataView_AbstractClassWithConstructor_ShouldThrowMemberAccessException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<MemberAccessException>(() =>
{
MetadataViewProvider.GetMetadataView<AbstractClassWithConstructorMetadataView>(metadata);
});
}
[Fact]
public void GetMetadataView_IDictionaryAsTMetadataViewTypeArgument_ShouldReturnMetadata()
{
var metadata = new Dictionary<string, object>();
var result = MetadataViewProvider.GetMetadataView<IDictionary<string, object>>(metadata);
Assert.Same(metadata, result);
}
[Fact]
public void GetMetadataView_IEnumerableAsTMetadataViewTypeArgument_ShouldReturnMetadata()
{
var metadata = new Dictionary<string, object>();
var result = MetadataViewProvider.GetMetadataView<IEnumerable<KeyValuePair<string, object>>>(metadata);
Assert.Same(metadata, result);
}
[Fact]
public void GetMetadataView_DictionaryAsTMetadataViewTypeArgument_ShouldNotThrow()
{
var metadata = new Dictionary<string, object>();
MetadataViewProvider.GetMetadataView<Dictionary<string, object>>(metadata);
}
[Fact]
public void GetMetadataView_PrivateInterfaceAsTMetadataViewTypeArgument_ShouldhrowNotSupportedException()
{
var metadata = new Dictionary<string, object>();
metadata["CanActivate"] = true;
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<IActivator>(metadata);
});
}
[Fact]
public void GetMetadataView_DictionaryWithUncastableValueAsMetadataArgument_ShouldThrowCompositionContractMismatchException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = true;
Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView>(metadata);
});
}
[Fact]
public void GetMetadataView_InterfaceWithTwoPropertiesWithSameNameDifferentTypeAsTMetadataViewArgument_ShouldThrowContractMismatch()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = 10;
Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView2>(metadata);
});
}
[Fact]
public void GetMetadataView_RawMetadata()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = 10;
var view = MetadataViewProvider.GetMetadataView<RawMetadata>(new Dictionary<string, object>(metadata));
Assert.True(view.Count == metadata.Count);
Assert.True(view["Value"] == metadata["Value"]);
}
[Fact]
public void GetMetadataView_InterfaceInheritance()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
metadata["Value2"] = "value2";
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView3>(metadata);
Assert.Equal("value", view.Value);
Assert.Equal("value2", view.Value2);
}
[Fact]
public void GetMetadataView_CachesViewType()
{
var metadata1 = new Dictionary<string, object>();
metadata1["Value"] = "value1";
var view1 = MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView>(metadata1);
Assert.Equal("value1", view1.Value);
var metadata2 = new Dictionary<string, object>();
metadata2["Value"] = "value2";
var view2 = MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView>(metadata2);
Assert.Equal("value2", view2.Value);
Assert.Equal(view1.GetType(), view2.GetType());
}
private interface IActivator
{
bool CanActivate
{
get;
}
}
public class RawMetadata : Dictionary<string, object>
{
public RawMetadata(IDictionary<string, object> dictionary) : base(dictionary) { }
}
public abstract class AbstractClassMetadataView
{
public abstract object Value { get; }
}
public abstract class AbstractClassWithConstructorMetadataView
{
public AbstractClassWithConstructorMetadataView(IDictionary<string, object> metadata) { }
public abstract object Value { get; }
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedInt()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt>(new Dictionary<string, object>());
Assert.Equal(120, view.MyInt);
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedIntInTranparentType()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt>(new Dictionary<string, object>());
int result = TransparentTestCase.GetMetadataView_IMetadataViewWithDefaultedIntInTranparentType(view);
Assert.Equal(120, result);
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedIntAndInvalidMetadata()
{
Dictionary<string, object> metadata = new Dictionary<string, object>();
metadata = new Dictionary<string, object>();
metadata.Add("MyInt", 1.2);
var view1 = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt>(metadata);
Assert.Equal(120, view1.MyInt);
metadata = new Dictionary<string, object>();
metadata.Add("MyInt", "Hello, World");
var view2 = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt>(metadata);
Assert.Equal(120, view2.MyInt);
}
[Fact]
public void GetMetadataView_MetadataViewWithImplementation()
{
Dictionary<string, object> metadata = new Dictionary<string, object>();
metadata = new Dictionary<string, object>();
metadata.Add("String1", "One");
metadata.Add("String2", "Two");
var view1 = MetadataViewProvider.GetMetadataView<IMetadataViewWithImplementation>(metadata);
Assert.Equal("One", view1.String1);
Assert.Equal("Two", view1.String2);
Assert.Equal(typeof(MetadataViewWithImplementation), view1.GetType());
}
[Fact]
public void GetMetadataView_MetadataViewWithImplementationNoInterface()
{
var exception = Assert.Throws<CompositionContractMismatchException>(() =>
{
Dictionary<string, object> metadata = new Dictionary<string, object>();
metadata = new Dictionary<string, object>();
metadata.Add("String1", "One");
metadata.Add("String2", "Two");
var view1 = MetadataViewProvider.GetMetadataView<IMetadataViewWithImplementationNoInterface>(metadata);
});
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedBool()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedBool>(new Dictionary<string, object>());
Assert.False(view.MyBool);
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedInt64()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt64>(new Dictionary<string, object>());
Assert.Equal(long.MaxValue, view.MyInt64);
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedString()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedString>(new Dictionary<string, object>());
Assert.Equal("MyString", view.MyString);
}
[Fact]
public void GetMetadataView_IMetadataViewWithTypeMismatchDefaultValue()
{
var exception = Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithTypeMismatchDefaultValue>(new Dictionary<string, object>());
});
Assert.IsType<TargetInvocationException>(exception.InnerException);
}
[Fact]
public void GetMetadataView_IMetadataViewWithTypeMismatchOnUnbox()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = (short)9999;
var exception = Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithTypeMismatchDefaultValue>(new Dictionary<string, object>());
});
Assert.IsType<TargetInvocationException>(exception.InnerException);
}
[Fact]
public void TestMetadataIntConversion()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = (long)45;
var exception = Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_HasInt64>(metadata);
});
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Reflection;
using Xunit;
namespace System.ComponentModel.Composition
{
internal static class TransparentTestCase
{
public static int GetMetadataView_IMetadataViewWithDefaultedIntInTranparentType(ITrans_MetadataViewWithDefaultedInt view)
{
return view.MyInt;
}
}
[MetadataViewImplementation(typeof(MetadataViewWithImplementation))]
public interface IMetadataViewWithImplementation
{
string String1 { get; }
string String2 { get; }
}
public class MetadataViewWithImplementation : IMetadataViewWithImplementation
{
public MetadataViewWithImplementation(IDictionary<string, object> metadata)
{
this.String1 = (string)metadata["String1"];
this.String2 = (string)metadata["String2"];
}
public string String1 { get; private set; }
public string String2 { get; private set; }
}
[MetadataViewImplementation(typeof(MetadataViewWithImplementationNoInterface))]
public interface IMetadataViewWithImplementationNoInterface
{
string String1 { get; }
string String2 { get; }
}
public class MetadataViewWithImplementationNoInterface
{
public MetadataViewWithImplementationNoInterface(IDictionary<string, object> metadata)
{
this.String1 = (string)metadata["String1"];
this.String2 = (string)metadata["String2"];
}
public string String1 { get; private set; }
public string String2 { get; private set; }
}
public class MetadataViewProviderTests
{
[Fact]
public void GetMetadataView_InterfaceWithPropertySetter_ShouldThrowNotSupported()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataViewWithPropertySetter>(metadata);
});
}
[Fact]
public void GetMetadataView_InterfaceWithMethod_ShouldThrowNotSupportedException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataViewWithMethod>(metadata);
});
}
[Fact]
public void GetMetadataView_InterfaceWithEvent_ShouldThrowNotSupportedException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataViewWithEvent>(metadata);
});
}
[Fact]
[ActiveIssue("https://github.com/mono/mono/issues/15169", TestRuntimes.Mono)]
public void GetMetadataView_InterfaceWithIndexer_ShouldThrowNotSupportedException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataViewWithIndexer>(metadata);
});
}
[Fact]
public void GetMetadataView_AbstractClass_ShouldThrowMissingMethodException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<AbstractClassMetadataView>(metadata);
});
}
[Fact]
public void GetMetadataView_AbstractClassWithConstructor_ShouldThrowMemberAccessException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
Assert.Throws<MemberAccessException>(() =>
{
MetadataViewProvider.GetMetadataView<AbstractClassWithConstructorMetadataView>(metadata);
});
}
[Fact]
public void GetMetadataView_IDictionaryAsTMetadataViewTypeArgument_ShouldReturnMetadata()
{
var metadata = new Dictionary<string, object>();
var result = MetadataViewProvider.GetMetadataView<IDictionary<string, object>>(metadata);
Assert.Same(metadata, result);
}
[Fact]
public void GetMetadataView_IEnumerableAsTMetadataViewTypeArgument_ShouldReturnMetadata()
{
var metadata = new Dictionary<string, object>();
var result = MetadataViewProvider.GetMetadataView<IEnumerable<KeyValuePair<string, object>>>(metadata);
Assert.Same(metadata, result);
}
[Fact]
public void GetMetadataView_DictionaryAsTMetadataViewTypeArgument_ShouldNotThrow()
{
var metadata = new Dictionary<string, object>();
MetadataViewProvider.GetMetadataView<Dictionary<string, object>>(metadata);
}
[Fact]
public void GetMetadataView_PrivateInterfaceAsTMetadataViewTypeArgument_ShouldhrowNotSupportedException()
{
var metadata = new Dictionary<string, object>();
metadata["CanActivate"] = true;
Assert.Throws<NotSupportedException>(() =>
{
MetadataViewProvider.GetMetadataView<IActivator>(metadata);
});
}
[Fact]
public void GetMetadataView_DictionaryWithUncastableValueAsMetadataArgument_ShouldThrowCompositionContractMismatchException()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = true;
Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView>(metadata);
});
}
[Fact]
public void GetMetadataView_InterfaceWithTwoPropertiesWithSameNameDifferentTypeAsTMetadataViewArgument_ShouldThrowContractMismatch()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = 10;
Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView2>(metadata);
});
}
[Fact]
public void GetMetadataView_RawMetadata()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = 10;
var view = MetadataViewProvider.GetMetadataView<RawMetadata>(new Dictionary<string, object>(metadata));
Assert.True(view.Count == metadata.Count);
Assert.True(view["Value"] == metadata["Value"]);
}
[Fact]
public void GetMetadataView_InterfaceInheritance()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = "value";
metadata["Value2"] = "value2";
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView3>(metadata);
Assert.Equal("value", view.Value);
Assert.Equal("value2", view.Value2);
}
[Fact]
public void GetMetadataView_CachesViewType()
{
var metadata1 = new Dictionary<string, object>();
metadata1["Value"] = "value1";
var view1 = MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView>(metadata1);
Assert.Equal("value1", view1.Value);
var metadata2 = new Dictionary<string, object>();
metadata2["Value"] = "value2";
var view2 = MetadataViewProvider.GetMetadataView<ITrans_MetadataTests_MetadataView>(metadata2);
Assert.Equal("value2", view2.Value);
Assert.Equal(view1.GetType(), view2.GetType());
}
private interface IActivator
{
bool CanActivate
{
get;
}
}
public class RawMetadata : Dictionary<string, object>
{
public RawMetadata(IDictionary<string, object> dictionary) : base(dictionary) { }
}
public abstract class AbstractClassMetadataView
{
public abstract object Value { get; }
}
public abstract class AbstractClassWithConstructorMetadataView
{
public AbstractClassWithConstructorMetadataView(IDictionary<string, object> metadata) { }
public abstract object Value { get; }
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedInt()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt>(new Dictionary<string, object>());
Assert.Equal(120, view.MyInt);
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedIntInTranparentType()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt>(new Dictionary<string, object>());
int result = TransparentTestCase.GetMetadataView_IMetadataViewWithDefaultedIntInTranparentType(view);
Assert.Equal(120, result);
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedIntAndInvalidMetadata()
{
Dictionary<string, object> metadata = new Dictionary<string, object>();
metadata = new Dictionary<string, object>();
metadata.Add("MyInt", 1.2);
var view1 = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt>(metadata);
Assert.Equal(120, view1.MyInt);
metadata = new Dictionary<string, object>();
metadata.Add("MyInt", "Hello, World");
var view2 = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt>(metadata);
Assert.Equal(120, view2.MyInt);
}
[Fact]
public void GetMetadataView_MetadataViewWithImplementation()
{
Dictionary<string, object> metadata = new Dictionary<string, object>();
metadata = new Dictionary<string, object>();
metadata.Add("String1", "One");
metadata.Add("String2", "Two");
var view1 = MetadataViewProvider.GetMetadataView<IMetadataViewWithImplementation>(metadata);
Assert.Equal("One", view1.String1);
Assert.Equal("Two", view1.String2);
Assert.Equal(typeof(MetadataViewWithImplementation), view1.GetType());
}
[Fact]
public void GetMetadataView_MetadataViewWithImplementationNoInterface()
{
var exception = Assert.Throws<CompositionContractMismatchException>(() =>
{
Dictionary<string, object> metadata = new Dictionary<string, object>();
metadata = new Dictionary<string, object>();
metadata.Add("String1", "One");
metadata.Add("String2", "Two");
var view1 = MetadataViewProvider.GetMetadataView<IMetadataViewWithImplementationNoInterface>(metadata);
});
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedBool()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedBool>(new Dictionary<string, object>());
Assert.False(view.MyBool);
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedInt64()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedInt64>(new Dictionary<string, object>());
Assert.Equal(long.MaxValue, view.MyInt64);
}
[Fact]
public void GetMetadataView_IMetadataViewWithDefaultedString()
{
var view = MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithDefaultedString>(new Dictionary<string, object>());
Assert.Equal("MyString", view.MyString);
}
[Fact]
public void GetMetadataView_IMetadataViewWithTypeMismatchDefaultValue()
{
var exception = Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithTypeMismatchDefaultValue>(new Dictionary<string, object>());
});
Assert.IsType<TargetInvocationException>(exception.InnerException);
}
[Fact]
public void GetMetadataView_IMetadataViewWithTypeMismatchOnUnbox()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = (short)9999;
var exception = Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_MetadataViewWithTypeMismatchDefaultValue>(new Dictionary<string, object>());
});
Assert.IsType<TargetInvocationException>(exception.InnerException);
}
[Fact]
public void TestMetadataIntConversion()
{
var metadata = new Dictionary<string, object>();
metadata["Value"] = (long)45;
var exception = Assert.Throws<CompositionContractMismatchException>(() =>
{
MetadataViewProvider.GetMetadataView<ITrans_HasInt64>(metadata);
});
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/coreclr/md/inc/cahlprinternal.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
#ifndef __CAHLPR_H__
#define __CAHLPR_H__
#include "sarray.h"
#include "caparser.h"
//*****************************************************************************
// This class assists in the parsing of CustomAttribute blobs.
//*****************************************************************************
struct CaType
{
void Init(CorSerializationType _type)
{
_ASSERTE(_type != SERIALIZATION_TYPE_SZARRAY && _type != SERIALIZATION_TYPE_ENUM);
tag = _type;
arrayType = SERIALIZATION_TYPE_UNDEFINED;
enumType = SERIALIZATION_TYPE_UNDEFINED;
szEnumName = NULL;
cEnumName = 0;
}
void Init(CorSerializationType _type, CorSerializationType _arrayType, CorSerializationType _enumType, LPCSTR _szEnumName, ULONG _cEnumName)
{
tag = _type;
arrayType = _arrayType;
enumType = _enumType;
szEnumName = _szEnumName;
cEnumName = _cEnumName;
}
CorSerializationType tag;
CorSerializationType arrayType;
CorSerializationType enumType;
LPCSTR szEnumName;
ULONG cEnumName;
};
struct CaTypeCtor : public CaType
{
CaTypeCtor(CorSerializationType _type)
{
Init(_type);
}
CaTypeCtor(CorSerializationType _type, CorSerializationType _arrayType, CorSerializationType _enumType, LPCSTR _szEnumName, ULONG _cEnumName)
{
Init(_type, _arrayType, _enumType, _szEnumName, _cEnumName);
}
};
typedef struct CaValue
{
union
{
unsigned __int8 boolean;
signed __int8 i1;
unsigned __int8 u1;
signed __int16 i2;
unsigned __int16 u2;
signed __int32 i4;
unsigned __int32 u4;
signed __int64 i8;
unsigned __int64 u8;
float r4;
double r8;
struct
{
CorSerializationType tag;
SArray<CaValue>* pSArray;
ULONG length;
inline CaValue &operator[](int index) { return (*pSArray)[index]; }
} arr;
struct
{
LPCUTF8 pStr;
ULONG cbStr;
} str;
};
CaType type;
} CaValue;
#endif // __CAHLPR_H__
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
#ifndef __CAHLPR_H__
#define __CAHLPR_H__
#include "sarray.h"
#include "caparser.h"
//*****************************************************************************
// This class assists in the parsing of CustomAttribute blobs.
//*****************************************************************************
struct CaType
{
void Init(CorSerializationType _type)
{
_ASSERTE(_type != SERIALIZATION_TYPE_SZARRAY && _type != SERIALIZATION_TYPE_ENUM);
tag = _type;
arrayType = SERIALIZATION_TYPE_UNDEFINED;
enumType = SERIALIZATION_TYPE_UNDEFINED;
szEnumName = NULL;
cEnumName = 0;
}
void Init(CorSerializationType _type, CorSerializationType _arrayType, CorSerializationType _enumType, LPCSTR _szEnumName, ULONG _cEnumName)
{
tag = _type;
arrayType = _arrayType;
enumType = _enumType;
szEnumName = _szEnumName;
cEnumName = _cEnumName;
}
CorSerializationType tag;
CorSerializationType arrayType;
CorSerializationType enumType;
LPCSTR szEnumName;
ULONG cEnumName;
};
struct CaTypeCtor : public CaType
{
CaTypeCtor(CorSerializationType _type)
{
Init(_type);
}
CaTypeCtor(CorSerializationType _type, CorSerializationType _arrayType, CorSerializationType _enumType, LPCSTR _szEnumName, ULONG _cEnumName)
{
Init(_type, _arrayType, _enumType, _szEnumName, _cEnumName);
}
};
typedef struct CaValue
{
union
{
unsigned __int8 boolean;
signed __int8 i1;
unsigned __int8 u1;
signed __int16 i2;
unsigned __int16 u2;
signed __int32 i4;
unsigned __int32 u4;
signed __int64 i8;
unsigned __int64 u8;
float r4;
double r8;
struct
{
CorSerializationType tag;
SArray<CaValue>* pSArray;
ULONG length;
inline CaValue &operator[](int index) { return (*pSArray)[index]; }
} arr;
struct
{
LPCUTF8 pStr;
ULONG cbStr;
} str;
};
CaType type;
} CaValue;
#endif // __CAHLPR_H__
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/coreclr/pal/tests/palsuite/threading/OpenProcess/test1/childProcess.cpp
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*============================================================
**
** Source: childprocess.c
**
** Purpose: Test to ensure OpenProcess works properly.
** All this program does is return a predefined value.
**
** Dependencies: PAL_Initialize
** PAL_Terminate
** CreateMutexW
** WaitForSingleObject
** CloseHandle
**
**
**=========================================================*/
#include <palsuite.h>
#include "myexitcode.h"
PALTEST(threading_OpenProcess_test1_paltest_openprocess_test1_child, "threading/OpenProcess/test1/paltest_openprocess_test1_child")
{
HANDLE hMutex;
WCHAR wszMutexName[] = { 'T','E','S','T','1','\0' };
DWORD dwRet;
int i;
/* initialize the PAL */
if( PAL_Initialize(argc, argv) != 0 )
{
return( FAIL );
}
/* open a mutex to synchronize with the parent process */
hMutex = CreateMutexW( NULL, FALSE, wszMutexName );
if( hMutex == NULL )
{
Fail( "ERROR:%lu:CreateMutex() call failed\r\n", GetLastError() );
}
/* acquire the mutex lock */
dwRet = WaitForSingleObject( hMutex, 10000 );
if( dwRet != WAIT_OBJECT_0 )
{
Trace( "ERROR:WaitForSingleObject() returned %lu, "
"expected WAIT_OBJECT_0",
dwRet );
if( ! CloseHandle( hMutex ) )
{
Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() );
}
Fail( "test failed\n" );
}
/* simulate some activity */
for( i=0; i<50000; i++ )
;
/* close our mutex handle */
if( ! CloseHandle( hMutex ) )
{
Fail( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() );
}
/* terminate the PAL */
PAL_Terminate();
/* return the predefined exit code */
return TEST_EXIT_CODE;
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*============================================================
**
** Source: childprocess.c
**
** Purpose: Test to ensure OpenProcess works properly.
** All this program does is return a predefined value.
**
** Dependencies: PAL_Initialize
** PAL_Terminate
** CreateMutexW
** WaitForSingleObject
** CloseHandle
**
**
**=========================================================*/
#include <palsuite.h>
#include "myexitcode.h"
PALTEST(threading_OpenProcess_test1_paltest_openprocess_test1_child, "threading/OpenProcess/test1/paltest_openprocess_test1_child")
{
HANDLE hMutex;
WCHAR wszMutexName[] = { 'T','E','S','T','1','\0' };
DWORD dwRet;
int i;
/* initialize the PAL */
if( PAL_Initialize(argc, argv) != 0 )
{
return( FAIL );
}
/* open a mutex to synchronize with the parent process */
hMutex = CreateMutexW( NULL, FALSE, wszMutexName );
if( hMutex == NULL )
{
Fail( "ERROR:%lu:CreateMutex() call failed\r\n", GetLastError() );
}
/* acquire the mutex lock */
dwRet = WaitForSingleObject( hMutex, 10000 );
if( dwRet != WAIT_OBJECT_0 )
{
Trace( "ERROR:WaitForSingleObject() returned %lu, "
"expected WAIT_OBJECT_0",
dwRet );
if( ! CloseHandle( hMutex ) )
{
Trace( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() );
}
Fail( "test failed\n" );
}
/* simulate some activity */
for( i=0; i<50000; i++ )
;
/* close our mutex handle */
if( ! CloseHandle( hMutex ) )
{
Fail( "ERROR:%lu:CloseHandle() call failed\n", GetLastError() );
}
/* terminate the PAL */
PAL_Terminate();
/* return the predefined exit code */
return TEST_EXIT_CODE;
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/coreclr/tools/aot/ILCompiler.MetadataTransform/ILCompiler/Metadata/MetadataTransformResult.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using Internal.Metadata.NativeFormat.Writer;
using Cts = Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
namespace ILCompiler.Metadata
{
public struct MetadataTransformResult<T>
where T : struct, IMetadataPolicy
{
private Transform<T> _transform;
/// <summary>
/// Gets a collection of records representing the top level transformed metadata scopes.
/// </summary>
public IReadOnlyCollection<ScopeDefinition> Scopes
{
get
{
return _transform._scopeDefs.Records;
}
}
/// <summary>
/// Gets an instance of <see cref="MetadataTransform"/> that allows generation of additional
/// (non-definition) metadata records. This can be used to retrieve or create metadata records
/// to be referenced from e.g. code.
/// Note that the records may not be reachable from any of the top level <see cref="Scopes"/>.
/// To make sure the records get emitted into the metadata blob by the <see cref="MetadataWriter"/>,
/// add them to <see cref="MetadataWriter.AdditionalRootRecords"/>.
/// </summary>
public MetadataTransform Transform
{
get
{
return _transform;
}
}
internal MetadataTransformResult(Transform<T> transform)
{
_transform = transform;
}
/// <summary>
/// Attempts to retrieve a <see cref="TypeDefinition"/> record corresponding to the specified
/// <paramref name="type"/>. Returns null if not found.
/// </summary>
public TypeDefinition GetTransformedTypeDefinition(Cts.MetadataType type)
{
Debug.Assert(type.IsTypeDefinition);
MetadataRecord rec;
if (!_transform._types.TryGet(type, out rec))
{
return null;
}
return rec as TypeDefinition;
}
/// <summary>
/// Attempts to retrieve a <see cref="TypeReference"/> record corresponding to the specified
/// <paramref name="type"/>. Returns null if not found.
/// </summary>
public TypeReference GetTransformedTypeReference(Cts.MetadataType type)
{
Debug.Assert(type.IsTypeDefinition);
MetadataRecord rec;
if (!_transform._types.TryGet(type, out rec))
{
return null;
}
return rec as TypeReference;
}
/// <summary>
/// Attempts to retrieve a <see cref="Method"/> record corresponding to the specified
/// <paramref name="method"/>. Returns null if not found.
/// </summary>
public Method GetTransformedMethodDefinition(Cts.MethodDesc method)
{
Debug.Assert(method.IsTypicalMethodDefinition);
MetadataRecord rec;
if (!_transform._methods.TryGet(method, out rec))
{
return null;
}
return rec as Method;
}
/// <summary>
/// Attempts to retrieve a <see cref="Field"/> record corresponding to the specified
/// <paramref name="field"/>. Returns null if not found.
/// </summary>
public Field GetTransformedFieldDefinition(Cts.FieldDesc field)
{
Debug.Assert(field.OwningType.IsTypeDefinition);
MetadataRecord rec;
if (!_transform._fields.TryGet(field, out rec))
{
return null;
}
return rec as Field;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using Internal.Metadata.NativeFormat.Writer;
using Cts = Internal.TypeSystem;
using Debug = System.Diagnostics.Debug;
namespace ILCompiler.Metadata
{
public struct MetadataTransformResult<T>
where T : struct, IMetadataPolicy
{
private Transform<T> _transform;
/// <summary>
/// Gets a collection of records representing the top level transformed metadata scopes.
/// </summary>
public IReadOnlyCollection<ScopeDefinition> Scopes
{
get
{
return _transform._scopeDefs.Records;
}
}
/// <summary>
/// Gets an instance of <see cref="MetadataTransform"/> that allows generation of additional
/// (non-definition) metadata records. This can be used to retrieve or create metadata records
/// to be referenced from e.g. code.
/// Note that the records may not be reachable from any of the top level <see cref="Scopes"/>.
/// To make sure the records get emitted into the metadata blob by the <see cref="MetadataWriter"/>,
/// add them to <see cref="MetadataWriter.AdditionalRootRecords"/>.
/// </summary>
public MetadataTransform Transform
{
get
{
return _transform;
}
}
internal MetadataTransformResult(Transform<T> transform)
{
_transform = transform;
}
/// <summary>
/// Attempts to retrieve a <see cref="TypeDefinition"/> record corresponding to the specified
/// <paramref name="type"/>. Returns null if not found.
/// </summary>
public TypeDefinition GetTransformedTypeDefinition(Cts.MetadataType type)
{
Debug.Assert(type.IsTypeDefinition);
MetadataRecord rec;
if (!_transform._types.TryGet(type, out rec))
{
return null;
}
return rec as TypeDefinition;
}
/// <summary>
/// Attempts to retrieve a <see cref="TypeReference"/> record corresponding to the specified
/// <paramref name="type"/>. Returns null if not found.
/// </summary>
public TypeReference GetTransformedTypeReference(Cts.MetadataType type)
{
Debug.Assert(type.IsTypeDefinition);
MetadataRecord rec;
if (!_transform._types.TryGet(type, out rec))
{
return null;
}
return rec as TypeReference;
}
/// <summary>
/// Attempts to retrieve a <see cref="Method"/> record corresponding to the specified
/// <paramref name="method"/>. Returns null if not found.
/// </summary>
public Method GetTransformedMethodDefinition(Cts.MethodDesc method)
{
Debug.Assert(method.IsTypicalMethodDefinition);
MetadataRecord rec;
if (!_transform._methods.TryGet(method, out rec))
{
return null;
}
return rec as Method;
}
/// <summary>
/// Attempts to retrieve a <see cref="Field"/> record corresponding to the specified
/// <paramref name="field"/>. Returns null if not found.
/// </summary>
public Field GetTransformedFieldDefinition(Cts.FieldDesc field)
{
Debug.Assert(field.OwningType.IsTypeDefinition);
MetadataRecord rec;
if (!_transform._fields.TryGet(field, out rec))
{
return null;
}
return rec as Field;
}
}
}
| -1 |
dotnet/runtime
| 66,381 |
Disable timing out test on mono
|
Fix #66371.
|
eiriktsarpalis
| 2022-03-09T08:35:58Z | 2022-03-10T18:40:15Z |
406d8541926a608ec636b8e4865b4d168273aba3
|
7b71e1bf5c78204a63542a2a8efbfa71723b3d0f
|
Disable timing out test on mono. Fix #66371.
|
./src/tests/JIT/Methodical/Invoke/fptr/ftn_t.il
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
.assembly extern mscorlib { }
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly 'ftn_t'
{
// .custom instance void ['mscorlib']System.Diagnostics.DebuggableAttribute::.ctor(bool,
// bool) = ( 01 00 00 01 00 00 )
}
.assembly extern xunit.core {}
// MVID: {90803FD0-8E18-44C9-A242-98463ADD450D}
.namespace JitTest
{
.class private auto ansi Test
extends ['mscorlib']System.Object
{
.method private hidebysig static void DoStuff(method void *()) il managed
{
// Code size 1 (0x1)
.maxstack 8
ldarg.0
tail. calli void()
ret
} // end of method 'Test::DoStuff'
.method private hidebysig static method void *() RetStuff() il managed
{
// Code size 1 (0x1)
.maxstack 8
ldftn void JitTest.Test::DummyMethod()
ret
} // end of method 'Test::DoStuff'
.method private hidebysig static void DummyMethod() il managed
{
// Code size 1 (0x1)
.maxstack 8
ldstr "Looks good."
call void [System.Console]System.Console::WriteLine(class [mscorlib]System.String)
ret
} // end of method 'Test::DoStuff'
.method private hidebysig static void TestMain() il managed
{
.maxstack 4
.locals (int32 V_0)
ldftn void JitTest.Test::DummyMethod()
ldftn void JitTest.Test::DoStuff(method void *())
calli void (method void *())
ldftn method void *() JitTest.Test::RetStuff()
calli method void *()()
tail. calli void()
ret
} // end of method 'Test::TestMain'
.method private hidebysig static int32 Main() il managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 4
ldftn void JitTest.Test::TestMain()
calli void ()
ldc.i4 0x64
ret
} // end of method 'Test::Main'
.method public hidebysig specialname rtspecialname
instance void .ctor() il managed
{
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void ['mscorlib']System.Object::.ctor()
IL_0006: ret
} // end of method 'Test::.ctor'
} // end of class 'Test'
} // end of namespace 'JitTest'
//*********** DISASSEMBLY COMPLETE ***********************
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
.assembly extern mscorlib { }
.assembly extern System.Console
{
.publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A )
.ver 4:0:0:0
}
.assembly 'ftn_t'
{
// .custom instance void ['mscorlib']System.Diagnostics.DebuggableAttribute::.ctor(bool,
// bool) = ( 01 00 00 01 00 00 )
}
.assembly extern xunit.core {}
// MVID: {90803FD0-8E18-44C9-A242-98463ADD450D}
.namespace JitTest
{
.class private auto ansi Test
extends ['mscorlib']System.Object
{
.method private hidebysig static void DoStuff(method void *()) il managed
{
// Code size 1 (0x1)
.maxstack 8
ldarg.0
tail. calli void()
ret
} // end of method 'Test::DoStuff'
.method private hidebysig static method void *() RetStuff() il managed
{
// Code size 1 (0x1)
.maxstack 8
ldftn void JitTest.Test::DummyMethod()
ret
} // end of method 'Test::DoStuff'
.method private hidebysig static void DummyMethod() il managed
{
// Code size 1 (0x1)
.maxstack 8
ldstr "Looks good."
call void [System.Console]System.Console::WriteLine(class [mscorlib]System.String)
ret
} // end of method 'Test::DoStuff'
.method private hidebysig static void TestMain() il managed
{
.maxstack 4
.locals (int32 V_0)
ldftn void JitTest.Test::DummyMethod()
ldftn void JitTest.Test::DoStuff(method void *())
calli void (method void *())
ldftn method void *() JitTest.Test::RetStuff()
calli method void *()()
tail. calli void()
ret
} // end of method 'Test::TestMain'
.method private hidebysig static int32 Main() il managed
{
.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = (
01 00 00 00
)
.entrypoint
.maxstack 4
ldftn void JitTest.Test::TestMain()
calli void ()
ldc.i4 0x64
ret
} // end of method 'Test::Main'
.method public hidebysig specialname rtspecialname
instance void .ctor() il managed
{
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void ['mscorlib']System.Object::.ctor()
IL_0006: ret
} // end of method 'Test::.ctor'
} // end of class 'Test'
} // end of namespace 'JitTest'
//*********** DISASSEMBLY COMPLETE ***********************
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/gc/env/volatile.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// Volatile.h
//
//
// Defines the Volatile<T> type, which provides uniform volatile-ness on
// Visual C++ and GNU C++.
//
// Visual C++ treats accesses to volatile variables as follows: no read or write
// can be removed by the compiler, no global memory access can be moved backwards past
// a volatile read, and no global memory access can be moved forward past a volatile
// write.
//
// The GCC volatile semantic is straight out of the C standard: the compiler is not
// allowed to remove accesses to volatile variables, and it is not allowed to reorder
// volatile accesses relative to other volatile accesses. It is allowed to freely
// reorder non-volatile accesses relative to volatile accesses.
//
// We have lots of code that assumes that ordering of non-volatile accesses will be
// constrained relative to volatile accesses. For example, this pattern appears all
// over the place:
//
// static volatile int lock = 0;
//
// while (InterlockedCompareExchange(&lock, 0, 1))
// {
// //spin
// }
//
// //read and write variables protected by the lock
//
// lock = 0;
//
// This depends on the reads and writes in the critical section not moving past the
// final statement, which releases the lock. If this should happen, then you have an
// unintended race.
//
// The solution is to ban the use of the "volatile" keyword, and instead define our
// own type Volatile<T>, which acts like a variable of type T except that accesses to
// the variable are always given VC++'s volatile semantics.
//
// (NOTE: The code above is not intended to be an example of how a spinlock should be
// implemented; it has many flaws, and should not be used. This code is intended only
// to illustrate where we might get into trouble with GCC's volatile semantics.)
//
// @TODO: many of the variables marked volatile in the CLR do not actually need to be
// volatile. For example, if a variable is just always passed to Interlocked functions
// (such as a refcount variable), there is no need for it to be volatile. A future
// cleanup task should be to examine each volatile variable and make them non-volatile
// if possible.
//
// @TODO: link to a "Memory Models for CLR Devs" doc here (this doc does not yet exist).
//
#ifndef _VOLATILE_H_
#define _VOLATILE_H_
//
// This code is extremely compiler- and CPU-specific, and will need to be altered to
// support new compilers and/or CPUs. Here we enforce that we can only compile using
// VC++, or GCC on x86 or AMD64.
//
#if !defined(_MSC_VER) && !defined(__GNUC__)
#error The Volatile type is currently only defined for Visual C++ and GNU C++
#endif
#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_LOONGARCH64) && !defined(HOST_WASM)
#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, LOONGARCH64 or Wasm
#endif
#if defined(__GNUC__)
#if defined(HOST_ARM) || defined(HOST_ARM64)
// This is functionally equivalent to the MemoryBarrier() macro used on ARM on Windows.
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dmb ish" : : : "memory")
#elif defined(HOST_LOONGARCH64)
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dbar 0 " : : : "memory")
#else
//
// For GCC, we prevent reordering by the compiler by inserting the following after a volatile
// load (to prevent subsequent operations from moving before the read), and before a volatile
// write (to prevent prior operations from moving past the write). We don't need to do anything
// special to prevent CPU reorderings, because the x86 and AMD64 architectures are already
// sufficiently constrained for our purposes. If we ever need to run on weaker CPU architectures
// (such as PowerPC), then we will need to do more work.
//
// Please do not use this macro outside of this file. It is subject to change or removal without
// notice.
//
#define VOLATILE_MEMORY_BARRIER() asm volatile ("" : : : "memory")
#endif // HOST_ARM || HOST_ARM64
#elif (defined(HOST_ARM) || defined(HOST_ARM64)) && _ISO_VOLATILE
// ARM & ARM64 have a very weak memory model and very few tools to control that model. We're forced to perform a full
// memory barrier to preserve the volatile semantics. Technically this is only necessary on MP systems but we
// currently don't have a cheap way to determine the number of CPUs from this header file. Revisit this if it
// turns out to be a performance issue for the uni-proc case.
#define VOLATILE_MEMORY_BARRIER() MemoryBarrier()
#else
//
// On VC++, reorderings at the compiler and machine level are prevented by the use of the
// "volatile" keyword in VolatileLoad and VolatileStore. This should work on any CPU architecture
// targeted by VC++ with /iso_volatile-.
//
#define VOLATILE_MEMORY_BARRIER()
#endif // __GNUC__
template<typename T>
struct RemoveVolatile
{
typedef T type;
};
template<typename T>
struct RemoveVolatile<volatile T>
{
typedef T type;
};
//
// VolatileLoad loads a T from a pointer to T. It is guaranteed that this load will not be optimized
// away by the compiler, and that any operation that occurs after this load, in program order, will
// not be moved before this load. In general it is not guaranteed that the load will be atomic, though
// this is the case for most aligned scalar data types. If you need atomic loads or stores, you need
// to consult the compiler and CPU manuals to find which circumstances allow atomicity.
//
// Starting at version 3.8, clang errors out on initializing of type int * to volatile int *. To fix this, we add two templates to cast away volatility
// Helper structures for casting away volatileness
#if defined(HOST_ARM64) && defined(_MSC_VER)
#include <arm64intr.h>
#endif
template<typename T>
inline
T VolatileLoad(T const * pt)
{
#ifndef DACCESS_COMPILE
#if defined(HOST_ARM64) && defined(__GNUC__)
T val;
static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);
if((1 << sizeof(T)) & lockFreeAtomicSizeMask)
{
__atomic_load((T const *)pt, const_cast<typename RemoveVolatile<T>::type *>(&val), __ATOMIC_ACQUIRE);
}
else
{
val = *(T volatile const *)pt;
asm volatile ("dmb ishld" : : : "memory");
}
#elif defined(HOST_ARM64) && defined(_MSC_VER)
// silence warnings on casts in branches that are not taken.
#pragma warning(push)
#pragma warning(disable : 4302)
#pragma warning(disable : 4311)
#pragma warning(disable : 4312)
T val;
T* pv = &val;
switch (sizeof(T))
{
case 1:
*(unsigned __int8* )pv = __ldar8 ((unsigned __int8 volatile*)pt);
break;
case 2:
*(unsigned __int16*)pv = __ldar16((unsigned __int16 volatile*)pt);
break;
case 4:
*(unsigned __int32*)pv = __ldar32((unsigned __int32 volatile*)pt);
break;
case 8:
*(unsigned __int64*)pv = __ldar64((unsigned __int64 volatile*)pt);
break;
default:
val = *(T volatile const*)pt;
__dmb(_ARM64_BARRIER_ISHLD);
}
#pragma warning(pop)
#else
T val = *(T volatile const *)pt;
VOLATILE_MEMORY_BARRIER();
#endif
#else
T val = *pt;
#endif
return val;
}
template<typename T>
inline
T VolatileLoadWithoutBarrier(T const * pt)
{
#ifndef DACCESS_COMPILE
T val = *(T volatile const *)pt;
#else
T val = *pt;
#endif
return val;
}
template <typename T> class Volatile;
template<typename T>
inline
T VolatileLoad(Volatile<T> const * pt)
{
return pt->Load();
}
//
// VolatileStore stores a T into the target of a pointer to T. Is is guaranteed that this store will
// not be optimized away by the compiler, and that any operation that occurs before this store, in program
// order, will not be moved after this store. In general, it is not guaranteed that the store will be
// atomic, though this is the case for most aligned scalar data types. If you need atomic loads or stores,
// you need to consult the compiler and CPU manuals to find which circumstances allow atomicity.
//
template<typename T>
inline
void VolatileStore(T* pt, T val)
{
#ifndef DACCESS_COMPILE
#if defined(HOST_ARM64) && defined(__GNUC__)
static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);
if((1 << sizeof(T)) & lockFreeAtomicSizeMask)
{
__atomic_store((T volatile *)pt, &val, __ATOMIC_RELEASE);
}
else
{
VOLATILE_MEMORY_BARRIER();
*(T volatile *)pt = val;
}
#elif defined(HOST_ARM64) && defined(_MSC_VER)
// silence warnings on casts in branches that are not taken.
#pragma warning(push)
#pragma warning(disable : 4302)
#pragma warning(disable : 4311)
#pragma warning(disable : 4312)
T* pv = &val;
switch (sizeof(T))
{
case 1:
__stlr8 ((unsigned __int8 volatile*)pt, *(unsigned __int8* )pv);
break;
case 2:
__stlr16((unsigned __int16 volatile*)pt, *(unsigned __int16*)pv);
break;
case 4:
__stlr32((unsigned __int32 volatile*)pt, *(unsigned __int32*)pv);
break;
case 8:
__stlr64((unsigned __int64 volatile*)pt, *(unsigned __int64*)pv);
break;
default:
__dmb(_ARM64_BARRIER_ISH);
*(T volatile *)pt = val;
}
#pragma warning(pop)
#else
VOLATILE_MEMORY_BARRIER();
*(T volatile *)pt = val;
#endif
#else
*pt = val;
#endif
}
template<typename T>
inline
void VolatileStoreWithoutBarrier(T* pt, T val)
{
#ifndef DACCESS_COMPILE
*(T volatile *)pt = val;
#else
*pt = val;
#endif
}
//
// Volatile<T> implements accesses with our volatile semantics over a variable of type T.
// Wherever you would have used a "volatile Foo" or, equivalently, "Foo volatile", use Volatile<Foo>
// instead. If Foo is a pointer type, use VolatilePtr.
//
// Note that there are still some things that don't work with a Volatile<T>,
// that would have worked with a "volatile T". For example, you can't cast a Volatile<int> to a float.
// You must instead cast to an int, then to a float. Or you can call Load on the Volatile<int>, and
// cast the result to a float. In general, calling Load or Store explicitly will work around
// any problems that can't be solved by operator overloading.
//
// @TODO: it's not clear that we actually *want* any operator overloading here. It's in here primarily
// to ease the task of converting all of the old uses of the volatile keyword, but in the long
// run it's probably better if users of this class are forced to call Load() and Store() explicitly.
// This would make it much more clear where the memory barriers are, and which operations are actually
// being performed, but it will have to wait for another cleanup effort.
//
template <typename T>
class Volatile
{
private:
//
// The data which we are treating as volatile
//
T m_val;
public:
//
// Default constructor. Results in an unitialized value!
//
inline Volatile()
{
}
//
// Allow initialization of Volatile<T> from a T
//
inline Volatile(const T& val)
{
((volatile T &)m_val) = val;
}
//
// Copy constructor
//
inline Volatile(const Volatile<T>& other)
{
((volatile T &)m_val) = other.Load();
}
//
// Loads the value of the volatile variable. See code:VolatileLoad for the semantics of this operation.
//
inline T Load() const
{
return VolatileLoad(&m_val);
}
//
// Loads the value of the volatile variable atomically without erecting the memory barrier.
//
inline T LoadWithoutBarrier() const
{
return ((volatile T &)m_val);
}
//
// Stores a new value to the volatile variable. See code:VolatileStore for the semantics of this
// operation.
//
inline void Store(const T& val)
{
VolatileStore(&m_val, val);
}
//
// Stores a new value to the volatile variable atomically without erecting the memory barrier.
//
inline void StoreWithoutBarrier(const T& val) const
{
((volatile T &)m_val) = val;
}
//
// Gets a pointer to the volatile variable. This is dangerous, as it permits the variable to be
// accessed without using Load and Store, but it is necessary for passing Volatile<T> to APIs like
// InterlockedIncrement.
//
inline volatile T* GetPointer() { return (volatile T*)&m_val; }
//
// Gets the raw value of the variable. This is dangerous, as it permits the variable to be
// accessed without using Load and Store
//
inline T& RawValue() { return m_val; }
//
// Allow casts from Volatile<T> to T. Note that this allows implicit casts, so you can
// pass a Volatile<T> directly to a method that expects a T.
//
inline operator T() const
{
return this->Load();
}
//
// Assignment from T
//
inline Volatile<T>& operator=(T val) {Store(val); return *this;}
//
// Get the address of the volatile variable. This is dangerous, as it allows the value of the
// volatile variable to be accessed directly, without going through Load and Store, but it is
// necessary for passing Volatile<T> to APIs like InterlockedIncrement. Note that we are returning
// a pointer to a volatile T here, so we cannot accidentally pass this pointer to an API that
// expects a normal pointer.
//
inline T volatile * operator&() {return this->GetPointer();}
inline T volatile const * operator&() const {return this->GetPointer();}
//
// Comparison operators
//
template<typename TOther>
inline bool operator==(const TOther& other) const {return this->Load() == other;}
template<typename TOther>
inline bool operator!=(const TOther& other) const {return this->Load() != other;}
//
// Miscellaneous operators. Add more as necessary.
//
inline Volatile<T>& operator+=(T val) {Store(this->Load() + val); return *this;}
inline Volatile<T>& operator-=(T val) {Store(this->Load() - val); return *this;}
inline Volatile<T>& operator|=(T val) {Store(this->Load() | val); return *this;}
inline Volatile<T>& operator&=(T val) {Store(this->Load() & val); return *this;}
inline bool operator!() const { return !this->Load();}
//
// Prefix increment
//
inline Volatile& operator++() {this->Store(this->Load()+1); return *this;}
//
// Postfix increment
//
inline T operator++(int) {T val = this->Load(); this->Store(val+1); return val;}
//
// Prefix decrement
//
inline Volatile& operator--() {this->Store(this->Load()-1); return *this;}
//
// Postfix decrement
//
inline T operator--(int) {T val = this->Load(); this->Store(val-1); return val;}
};
//
// A VolatilePtr builds on Volatile<T> by adding operators appropriate to pointers.
// Wherever you would have used "Foo * volatile", use "VolatilePtr<Foo>" instead.
//
// VolatilePtr also allows the substution of other types for the underlying pointer. This
// allows you to wrap a VolatilePtr around a custom type that looks like a pointer. For example,
// if what you want is a "volatile DPTR<Foo>", use "VolatilePtr<Foo, DPTR<Foo>>".
//
template <typename T, typename P = T*>
class VolatilePtr : public Volatile<P>
{
public:
//
// Default constructor. Results in an uninitialized pointer!
//
inline VolatilePtr()
{
}
//
// Allow assignment from the pointer type.
//
inline VolatilePtr(P val) : Volatile<P>(val)
{
}
//
// Copy constructor
//
inline VolatilePtr(const VolatilePtr& other) : Volatile<P>(other)
{
}
//
// Cast to the pointer type
//
inline operator P() const
{
return (P)this->Load();
}
//
// Member access
//
inline P operator->() const
{
return (P)this->Load();
}
//
// Dereference the pointer
//
inline T& operator*() const
{
return *(P)this->Load();
}
//
// Access the pointer as an array
//
template <typename TIndex>
inline T& operator[](TIndex index)
{
return ((P)this->Load())[index];
}
};
#define VOLATILE(T) Volatile<T>
#endif //_VOLATILE_H_
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// Volatile.h
//
//
// Defines the Volatile<T> type, which provides uniform volatile-ness on
// Visual C++ and GNU C++.
//
// Visual C++ treats accesses to volatile variables as follows: no read or write
// can be removed by the compiler, no global memory access can be moved backwards past
// a volatile read, and no global memory access can be moved forward past a volatile
// write.
//
// The GCC volatile semantic is straight out of the C standard: the compiler is not
// allowed to remove accesses to volatile variables, and it is not allowed to reorder
// volatile accesses relative to other volatile accesses. It is allowed to freely
// reorder non-volatile accesses relative to volatile accesses.
//
// We have lots of code that assumes that ordering of non-volatile accesses will be
// constrained relative to volatile accesses. For example, this pattern appears all
// over the place:
//
// static volatile int lock = 0;
//
// while (InterlockedCompareExchange(&lock, 0, 1))
// {
// //spin
// }
//
// //read and write variables protected by the lock
//
// lock = 0;
//
// This depends on the reads and writes in the critical section not moving past the
// final statement, which releases the lock. If this should happen, then you have an
// unintended race.
//
// The solution is to ban the use of the "volatile" keyword, and instead define our
// own type Volatile<T>, which acts like a variable of type T except that accesses to
// the variable are always given VC++'s volatile semantics.
//
// (NOTE: The code above is not intended to be an example of how a spinlock should be
// implemented; it has many flaws, and should not be used. This code is intended only
// to illustrate where we might get into trouble with GCC's volatile semantics.)
//
// @TODO: many of the variables marked volatile in the CLR do not actually need to be
// volatile. For example, if a variable is just always passed to Interlocked functions
// (such as a refcount variable), there is no need for it to be volatile. A future
// cleanup task should be to examine each volatile variable and make them non-volatile
// if possible.
//
// @TODO: link to a "Memory Models for CLR Devs" doc here (this doc does not yet exist).
//
#ifndef _VOLATILE_H_
#define _VOLATILE_H_
//
// This code is extremely compiler- and CPU-specific, and will need to be altered to
// support new compilers and/or CPUs. Here we enforce that we can only compile using
// VC++, or GCC on x86 or AMD64.
//
#if !defined(_MSC_VER) && !defined(__GNUC__)
#error The Volatile type is currently only defined for Visual C++ and GNU C++
#endif
#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_LOONGARCH64) && !defined(HOST_WASM)
#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, LOONGARCH64 or Wasm
#endif
#if defined(__GNUC__)
#if defined(HOST_ARM) || defined(HOST_ARM64)
// This is functionally equivalent to the MemoryBarrier() macro used on ARM on Windows.
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dmb ish" : : : "memory")
#elif defined(HOST_LOONGARCH64)
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dbar 0 " : : : "memory")
#else
//
// For GCC, we prevent reordering by the compiler by inserting the following after a volatile
// load (to prevent subsequent operations from moving before the read), and before a volatile
// write (to prevent prior operations from moving past the write). We don't need to do anything
// special to prevent CPU reorderings, because the x86 and AMD64 architectures are already
// sufficiently constrained for our purposes. If we ever need to run on weaker CPU architectures
// (such as PowerPC), then we will need to do more work.
//
// Please do not use this macro outside of this file. It is subject to change or removal without
// notice.
//
#define VOLATILE_MEMORY_BARRIER() asm volatile ("" : : : "memory")
#endif // HOST_ARM || HOST_ARM64
#elif (defined(HOST_ARM) || defined(HOST_ARM64)) && _ISO_VOLATILE
// ARM & ARM64 have a very weak memory model and very few tools to control that model. We're forced to perform a full
// memory barrier to preserve the volatile semantics. Technically this is only necessary on MP systems but we
// currently don't have a cheap way to determine the number of CPUs from this header file. Revisit this if it
// turns out to be a performance issue for the uni-proc case.
#define VOLATILE_MEMORY_BARRIER() MemoryBarrier()
#else
//
// On VC++, reorderings at the compiler and machine level are prevented by the use of the
// "volatile" keyword in VolatileLoad and VolatileStore. This should work on any CPU architecture
// targeted by VC++ with /iso_volatile-.
//
#define VOLATILE_MEMORY_BARRIER()
#endif // __GNUC__
template<typename T>
struct RemoveVolatile
{
typedef T type;
};
template<typename T>
struct RemoveVolatile<volatile T>
{
typedef T type;
};
//
// VolatileLoad loads a T from a pointer to T. It is guaranteed that this load will not be optimized
// away by the compiler, and that any operation that occurs after this load, in program order, will
// not be moved before this load. In general it is not guaranteed that the load will be atomic, though
// this is the case for most aligned scalar data types. If you need atomic loads or stores, you need
// to consult the compiler and CPU manuals to find which circumstances allow atomicity.
//
// Starting at version 3.8, clang errors out on initializing of type int * to volatile int *. To fix this, we add two templates to cast away volatility
// Helper structures for casting away volatileness
#if defined(HOST_ARM64) && defined(_MSC_VER)
#include <arm64intr.h>
#endif
template<typename T>
inline
T VolatileLoad(T const * pt)
{
#ifndef DACCESS_COMPILE
#if defined(HOST_ARM64) && defined(__GNUC__)
T val;
static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);
if((1 << sizeof(T)) & lockFreeAtomicSizeMask)
{
__atomic_load((T const *)pt, const_cast<typename RemoveVolatile<T>::type *>(&val), __ATOMIC_ACQUIRE);
}
else
{
val = *(T volatile const *)pt;
asm volatile ("dmb ishld" : : : "memory");
}
#elif defined(HOST_ARM64) && defined(_MSC_VER)
// silence warnings on casts in branches that are not taken.
#pragma warning(push)
#pragma warning(disable : 4311)
#pragma warning(disable : 4312)
T val;
T* pv = &val;
switch (sizeof(T))
{
case 1:
*(unsigned __int8* )pv = __ldar8 ((unsigned __int8 volatile*)pt);
break;
case 2:
*(unsigned __int16*)pv = __ldar16((unsigned __int16 volatile*)pt);
break;
case 4:
*(unsigned __int32*)pv = __ldar32((unsigned __int32 volatile*)pt);
break;
case 8:
*(unsigned __int64*)pv = __ldar64((unsigned __int64 volatile*)pt);
break;
default:
val = *(T volatile const*)pt;
__dmb(_ARM64_BARRIER_ISHLD);
}
#pragma warning(pop)
#else
T val = *(T volatile const *)pt;
VOLATILE_MEMORY_BARRIER();
#endif
#else
T val = *pt;
#endif
return val;
}
template<typename T>
inline
T VolatileLoadWithoutBarrier(T const * pt)
{
#ifndef DACCESS_COMPILE
T val = *(T volatile const *)pt;
#else
T val = *pt;
#endif
return val;
}
template <typename T> class Volatile;
template<typename T>
inline
T VolatileLoad(Volatile<T> const * pt)
{
return pt->Load();
}
//
// VolatileStore stores a T into the target of a pointer to T. Is is guaranteed that this store will
// not be optimized away by the compiler, and that any operation that occurs before this store, in program
// order, will not be moved after this store. In general, it is not guaranteed that the store will be
// atomic, though this is the case for most aligned scalar data types. If you need atomic loads or stores,
// you need to consult the compiler and CPU manuals to find which circumstances allow atomicity.
//
template<typename T>
inline
void VolatileStore(T* pt, T val)
{
#ifndef DACCESS_COMPILE
#if defined(HOST_ARM64) && defined(__GNUC__)
static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);
if((1 << sizeof(T)) & lockFreeAtomicSizeMask)
{
__atomic_store((T volatile *)pt, &val, __ATOMIC_RELEASE);
}
else
{
VOLATILE_MEMORY_BARRIER();
*(T volatile *)pt = val;
}
#elif defined(HOST_ARM64) && defined(_MSC_VER)
// silence warnings on casts in branches that are not taken.
#pragma warning(push)
#pragma warning(disable : 4311)
#pragma warning(disable : 4312)
T* pv = &val;
switch (sizeof(T))
{
case 1:
__stlr8 ((unsigned __int8 volatile*)pt, *(unsigned __int8* )pv);
break;
case 2:
__stlr16((unsigned __int16 volatile*)pt, *(unsigned __int16*)pv);
break;
case 4:
__stlr32((unsigned __int32 volatile*)pt, *(unsigned __int32*)pv);
break;
case 8:
__stlr64((unsigned __int64 volatile*)pt, *(unsigned __int64*)pv);
break;
default:
__dmb(_ARM64_BARRIER_ISH);
*(T volatile *)pt = val;
}
#pragma warning(pop)
#else
VOLATILE_MEMORY_BARRIER();
*(T volatile *)pt = val;
#endif
#else
*pt = val;
#endif
}
template<typename T>
inline
void VolatileStoreWithoutBarrier(T* pt, T val)
{
#ifndef DACCESS_COMPILE
*(T volatile *)pt = val;
#else
*pt = val;
#endif
}
//
// Volatile<T> implements accesses with our volatile semantics over a variable of type T.
// Wherever you would have used a "volatile Foo" or, equivalently, "Foo volatile", use Volatile<Foo>
// instead. If Foo is a pointer type, use VolatilePtr.
//
// Note that there are still some things that don't work with a Volatile<T>,
// that would have worked with a "volatile T". For example, you can't cast a Volatile<int> to a float.
// You must instead cast to an int, then to a float. Or you can call Load on the Volatile<int>, and
// cast the result to a float. In general, calling Load or Store explicitly will work around
// any problems that can't be solved by operator overloading.
//
// @TODO: it's not clear that we actually *want* any operator overloading here. It's in here primarily
// to ease the task of converting all of the old uses of the volatile keyword, but in the long
// run it's probably better if users of this class are forced to call Load() and Store() explicitly.
// This would make it much more clear where the memory barriers are, and which operations are actually
// being performed, but it will have to wait for another cleanup effort.
//
template <typename T>
class Volatile
{
private:
//
// The data which we are treating as volatile
//
T m_val;
public:
//
// Default constructor. Results in an unitialized value!
//
inline Volatile()
{
}
//
// Allow initialization of Volatile<T> from a T
//
inline Volatile(const T& val)
{
((volatile T &)m_val) = val;
}
//
// Copy constructor
//
inline Volatile(const Volatile<T>& other)
{
((volatile T &)m_val) = other.Load();
}
//
// Loads the value of the volatile variable. See code:VolatileLoad for the semantics of this operation.
//
inline T Load() const
{
return VolatileLoad(&m_val);
}
//
// Loads the value of the volatile variable atomically without erecting the memory barrier.
//
inline T LoadWithoutBarrier() const
{
return ((volatile T &)m_val);
}
//
// Stores a new value to the volatile variable. See code:VolatileStore for the semantics of this
// operation.
//
inline void Store(const T& val)
{
VolatileStore(&m_val, val);
}
//
// Stores a new value to the volatile variable atomically without erecting the memory barrier.
//
inline void StoreWithoutBarrier(const T& val) const
{
((volatile T &)m_val) = val;
}
//
// Gets a pointer to the volatile variable. This is dangerous, as it permits the variable to be
// accessed without using Load and Store, but it is necessary for passing Volatile<T> to APIs like
// InterlockedIncrement.
//
inline volatile T* GetPointer() { return (volatile T*)&m_val; }
//
// Gets the raw value of the variable. This is dangerous, as it permits the variable to be
// accessed without using Load and Store
//
inline T& RawValue() { return m_val; }
//
// Allow casts from Volatile<T> to T. Note that this allows implicit casts, so you can
// pass a Volatile<T> directly to a method that expects a T.
//
inline operator T() const
{
return this->Load();
}
//
// Assignment from T
//
inline Volatile<T>& operator=(T val) {Store(val); return *this;}
//
// Get the address of the volatile variable. This is dangerous, as it allows the value of the
// volatile variable to be accessed directly, without going through Load and Store, but it is
// necessary for passing Volatile<T> to APIs like InterlockedIncrement. Note that we are returning
// a pointer to a volatile T here, so we cannot accidentally pass this pointer to an API that
// expects a normal pointer.
//
inline T volatile * operator&() {return this->GetPointer();}
inline T volatile const * operator&() const {return this->GetPointer();}
//
// Comparison operators
//
template<typename TOther>
inline bool operator==(const TOther& other) const {return this->Load() == other;}
template<typename TOther>
inline bool operator!=(const TOther& other) const {return this->Load() != other;}
//
// Miscellaneous operators. Add more as necessary.
//
inline Volatile<T>& operator+=(T val) {Store(this->Load() + val); return *this;}
inline Volatile<T>& operator-=(T val) {Store(this->Load() - val); return *this;}
inline Volatile<T>& operator|=(T val) {Store(this->Load() | val); return *this;}
inline Volatile<T>& operator&=(T val) {Store(this->Load() & val); return *this;}
inline bool operator!() const { return !this->Load();}
//
// Prefix increment
//
inline Volatile& operator++() {this->Store(this->Load()+1); return *this;}
//
// Postfix increment
//
inline T operator++(int) {T val = this->Load(); this->Store(val+1); return val;}
//
// Prefix decrement
//
inline Volatile& operator--() {this->Store(this->Load()-1); return *this;}
//
// Postfix decrement
//
inline T operator--(int) {T val = this->Load(); this->Store(val-1); return val;}
};
//
// A VolatilePtr builds on Volatile<T> by adding operators appropriate to pointers.
// Wherever you would have used "Foo * volatile", use "VolatilePtr<Foo>" instead.
//
// VolatilePtr also allows the substution of other types for the underlying pointer. This
// allows you to wrap a VolatilePtr around a custom type that looks like a pointer. For example,
// if what you want is a "volatile DPTR<Foo>", use "VolatilePtr<Foo, DPTR<Foo>>".
//
template <typename T, typename P = T*>
class VolatilePtr : public Volatile<P>
{
public:
//
// Default constructor. Results in an uninitialized pointer!
//
inline VolatilePtr()
{
}
//
// Allow assignment from the pointer type.
//
inline VolatilePtr(P val) : Volatile<P>(val)
{
}
//
// Copy constructor
//
inline VolatilePtr(const VolatilePtr& other) : Volatile<P>(other)
{
}
//
// Cast to the pointer type
//
inline operator P() const
{
return (P)this->Load();
}
//
// Member access
//
inline P operator->() const
{
return (P)this->Load();
}
//
// Dereference the pointer
//
inline T& operator*() const
{
return *(P)this->Load();
}
//
// Access the pointer as an array
//
template <typename TIndex>
inline T& operator[](TIndex index)
{
return ((P)this->Load())[index];
}
};
#define VOLATILE(T) Volatile<T>
#endif //_VOLATILE_H_
| 1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/inc/safemath.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ---------------------------------------------------------------------------
// safemath.h
//
// overflow checking infrastructure
// ---------------------------------------------------------------------------
#ifndef SAFEMATH_H_
#define SAFEMATH_H_
// This file is included from several places outside the CLR, so we can't
// pull in files like DebugMacros.h. However, we assume that the standard
// clrtypes (UINT32 etc.) are defined.
#include "debugmacrosext.h"
#ifndef _ASSERTE_SAFEMATH
#ifdef _ASSERTE
// Use _ASSERTE if we have it (should always be the case in the CLR)
#define _ASSERTE_SAFEMATH _ASSERTE
#else
// Otherwise (eg. we're being used from a tool like SOS) there isn't much
// we can rely on that is available everywhere. In
// several other tools we just take the recourse of disabling asserts,
// we'll do the same here.
// Ideally we'd have a collection of common utilities available everywhere.
#define _ASSERTE_SAFEMATH(a)
#endif
#endif
#include "static_assert.h"
#ifdef PAL_STDCPP_COMPAT
#include <type_traits>
#else
#include "clr_std/type_traits"
#endif
//==================================================================
// Semantics: if val can be represented as the exact same value
// when cast to Dst type, then FitsIn<Dst>(val) will return true;
// otherwise FitsIn returns false.
//
// Dst and Src must both be integral types.
//
// It's important to note that most of the conditionals in this
// function are based on static type information and as such will
// be optimized away. In particular, the case where the signs are
// identical will result in no code branches.
#ifdef _PREFAST_
#pragma warning(push)
#pragma warning(disable:6326) // PREfast warning: Potential comparison of a constant with another constant
#endif // _PREFAST_
template <typename Dst, typename Src>
inline bool FitsIn(Src val)
{
#ifdef _MSC_VER
static_assert_no_msg(!__is_class(Dst));
static_assert_no_msg(!__is_class(Src));
#endif
if (std::is_signed<Src>::value == std::is_signed<Dst>::value)
{ // Src and Dst are equally signed
if (sizeof(Src) <= sizeof(Dst))
{ // No truncation is possible
return true;
}
else
{ // Truncation is possible, requiring runtime check
return val == (Src)((Dst)val);
}
}
else if (std::is_signed<Src>::value)
{ // Src is signed, Dst is unsigned
#ifdef __GNUC__
// Workaround for GCC warning: "comparison is always
// false due to limited range of data type."
if (!(val == 0 || val > 0))
#else
if (val < 0)
#endif
{ // A negative number cannot be represented by an unsigned type
return false;
}
else
{
if (sizeof(Src) <= sizeof(Dst))
{ // No truncation is possible
return true;
}
else
{ // Truncation is possible, requiring runtime check
return val == (Src)((Dst)val);
}
}
}
else
{ // Src is unsigned, Dst is signed
if (sizeof(Src) < sizeof(Dst))
{ // No truncation is possible. Note that Src is strictly
// smaller than Dst.
return true;
}
else
{ // Truncation is possible, requiring runtime check
#ifdef __GNUC__
// Workaround for GCC warning: "comparison is always
// true due to limited range of data type." If in fact
// Dst were unsigned we'd never execute this code
// anyway.
return ((Dst)val > 0 || (Dst)val == 0) &&
#else
return ((Dst)val >= 0) &&
#endif
(val == (Src)((Dst)val));
}
}
}
// Requires that Dst is an integral type, and that DstMin and DstMax are the
// minimum and maximum values of that type, respectively. Returns "true" iff
// "val" can be represented in the range [DstMin..DstMax] (allowing loss of precision, but
// not truncation).
template <INT64 DstMin, UINT64 DstMax>
inline bool FloatFitsInIntType(float val)
{
float DstMinF = static_cast<float>(DstMin);
float DstMaxF = static_cast<float>(DstMax);
return DstMinF <= val && val <= DstMaxF;
}
template <INT64 DstMin, UINT64 DstMax>
inline bool DoubleFitsInIntType(double val)
{
double DstMinD = static_cast<double>(DstMin);
double DstMaxD = static_cast<double>(DstMax);
return DstMinD <= val && val <= DstMaxD;
}
#ifdef _PREFAST_
#pragma warning(pop)
#endif //_PREFAST_
#define ovadd_lt(a, b, rhs) (((a) + (b) < (rhs) ) && ((a) + (b) >= (a)))
#define ovadd_le(a, b, rhs) (((a) + (b) <= (rhs) ) && ((a) + (b) >= (a)))
#define ovadd_gt(a, b, rhs) (((a) + (b) > (rhs) ) || ((a) + (b) < (a)))
#define ovadd_ge(a, b, rhs) (((a) + (b) >= (rhs) ) || ((a) + (b) < (a)))
#define ovadd3_gt(a, b, c, rhs) (((a) + (b) + (c) > (rhs)) || ((a) + (b) < (a)) || ((a) + (b) + (c) < (c)))
//-----------------------------------------------------------------------------
//
// Liberally lifted from https://github.com/dcleblanc/SafeInt and modified.
//
// Modified to track an overflow bit instead of throwing exceptions. In most
// cases the Visual C++ optimizer (Whidbey beta1 - v14.00.40607) is able to
// optimize the bool away completely.
// Note that using a sentinal value (IntMax for example) to represent overflow
// actually results in poorer code-gen.
//
// This has also been simplified significantly to remove functionality we
// don't currently want (division, implicit conversions, many additional operators etc.)
//
// Example:
// unsafe: UINT32 bufSize = headerSize + elementCount * sizeof(void*);
// becomes:
// S_UINT32 bufSize = S_UINT32(headerSize) + S_UINT32(elementCount) *
// S_UINT32( sizeof(void*) );
// if( bufSize.IsOverflow() ) { <overflow-error> }
// else { use bufSize.Value() }
// or:
// UINT32 tmp, bufSize;
// if( !ClrSafeInt<UINT32>::multiply( elementCount, sizeof(void*), tmp ) ||
// !ClrSafeInt<UINT32>::addition( tmp, headerSize, bufSize ) )
// { <overflow-error> }
// else { use bufSize }
//
//-----------------------------------------------------------------------------
// TODO: Any way to prevent unintended instantiations? This is only designed to
// work with unsigned integral types (signed types will work but we probably
// don't need signed support).
template<typename T> class ClrSafeInt
{
public:
// Default constructor - 0 value by default
ClrSafeInt() :
m_value(0),
m_overflow(false)
COMMA_INDEBUG( m_checkedOverflow( false ) )
{
}
// Value constructor
// This is explicit because otherwise it would be harder to
// differentiate between checked and unchecked usage of an operator.
// I.e. si + x + y vs. si + ( x + y )
//
// Set the m_checkedOverflow bit to true since this is being initialized
// with a constant value and we know that it is valid. A scenario in
// which this is useful is when an overflow causes a fallback value to
// be used:
// if (val.IsOverflow())
// val = ClrSafeInt<T>(some_value);
explicit ClrSafeInt( T v ) :
m_value(v),
m_overflow(false)
COMMA_INDEBUG( m_checkedOverflow( true ) )
{
}
template <typename U>
explicit ClrSafeInt(U u) :
m_value(0),
m_overflow(false)
COMMA_INDEBUG( m_checkedOverflow( false ) )
{
if (!FitsIn<T>(u))
{
m_overflow = true;
}
else
{
m_value = (T)u;
}
}
template <typename U>
ClrSafeInt(ClrSafeInt<U> u) :
m_value(0),
m_overflow(false)
COMMA_INDEBUG( m_checkedOverflow( false ) )
{
if (u.IsOverflow() || !FitsIn<T>(u.Value()))
{
m_overflow = true;
}
else
{
m_value = (T)u.Value();
}
}
// Note: compiler-generated copy constructor and assignment operator
// are correct for our purposes.
// Note: The MS compiler will sometimes silently perform value-destroying
// conversions when calling the operators below.
// Eg. "ClrSafeInt<unsigned> s(0); s += int(-1);" will result in s
// having the value 0xffffffff without generating a compile-time warning.
// Narrowing conversions are generally level 4 warnings so may or may not
// be visible.
//
// In the original SafeInt class, all operators have an
// additional overload that takes an arbitrary type U and then safe
// conversions are performed (resulting in overflow whenever the value
// cannot be preserved).
// We could do the same thing, but currently don't because:
// - we don't believe there are common cases where this would result in a
// security hole.
// - the extra complexity isn't worth the benefits
// - it would prevent compiler warnings in the cases we do get warnings for.
// true if there has been an overflow leading up to the creation of this
// value, false otherwise.
// Note that in debug builds we track whether our client called this,
// so we should not be calling this method ourselves from within this class.
inline bool IsOverflow() const
{
INDEBUG( m_checkedOverflow = true; )
return m_overflow;
}
// Get the value of this integer.
// Must only be called when IsOverflow()==false. If this is called
// on overflow we'll assert in Debug and return 0 in release.
inline T Value() const
{
_ASSERTE_SAFEMATH( m_checkedOverflow ); // Ensure our caller first checked the overflow bit
_ASSERTE_SAFEMATH( !m_overflow );
return m_value;
}
// force the value into the overflow state.
inline void SetOverflow()
{
INDEBUG( this->m_checkedOverflow = false; )
this->m_overflow = true;
// incase someone manages to call Value in release mode - should be optimized out
this->m_value = 0;
}
//
// OPERATORS
//
// Addition and multiplication. Only permitted when both sides are explicitly
// wrapped inside of a ClrSafeInt and when the types match exactly.
// If we permitted a RHS of type 'T', then there would be differences
// in correctness between mathematically equivalent expressions such as
// "si + x + y" and "si + ( x + y )". Unfortunately, not permitting this
// makes expressions involving constants tedius and ugly since the constants
// must be wrapped in ClrSafeInt instances. If we become confident that
// our tools (PreFast) will catch all integer overflows, then we can probably
// safely add this.
inline ClrSafeInt<T> operator +(ClrSafeInt<T> rhs) const
{
ClrSafeInt<T> result; // value is initialized to 0
if( this->m_overflow ||
rhs.m_overflow ||
!addition( this->m_value, rhs.m_value, result.m_value ) )
{
result.m_overflow = true;
}
return result;
}
inline ClrSafeInt<T> operator -(ClrSafeInt<T> rhs) const
{
ClrSafeInt<T> result; // value is initialized to 0
if( this->m_overflow ||
rhs.m_overflow ||
!subtraction( this->m_value, rhs.m_value, result.m_value ) )
{
result.m_overflow = true;
}
return result;
}
inline ClrSafeInt<T> operator *(ClrSafeInt<T> rhs) const
{
ClrSafeInt<T> result; // value is initialized to 0
if( this->m_overflow ||
rhs.m_overflow ||
!multiply( this->m_value, rhs.m_value, result.m_value ) )
{
result.m_overflow = true;
}
return result;
}
// Accumulation operators
// Here it's ok to have versions that take a value of type 'T', however we still
// don't allow any mixed-type operations.
inline ClrSafeInt<T>& operator +=(ClrSafeInt<T> rhs)
{
INDEBUG( this->m_checkedOverflow = false; )
if( this->m_overflow ||
rhs.m_overflow ||
!ClrSafeInt<T>::addition( this->m_value, rhs.m_value, this->m_value ) )
{
this->SetOverflow();
}
return *this;
}
inline ClrSafeInt<T>& operator +=(T rhs)
{
INDEBUG( this->m_checkedOverflow = false; )
if( this->m_overflow ||
!ClrSafeInt<T>::addition( this->m_value, rhs, this->m_value ) )
{
this->SetOverflow();
}
return *this;
}
inline ClrSafeInt<T>& operator *=(ClrSafeInt<T> rhs)
{
INDEBUG( this->m_checkedOverflow = false; )
if( this->m_overflow ||
rhs.m_overflow ||
!ClrSafeInt<T>::multiply( this->m_value, rhs.m_value, this->m_value ) )
{
this->SetOverflow();
}
return *this;
}
inline ClrSafeInt<T>& operator *=(T rhs)
{
INDEBUG( this->m_checkedOverflow = false; )
if( this->m_overflow ||
!ClrSafeInt<T>::multiply( this->m_value, rhs, this->m_value ) )
{
this->SetOverflow();
}
return *this;
}
//
// STATIC HELPER METHODS
//these compile down to something as efficient as macros and allow run-time testing
//of type by the developer
//
template <typename U> static bool IsSigned(U)
{
return std::is_signed<U>::value;
}
static bool IsSigned()
{
return std::is_signed<T>::value;
}
static bool IsMixedSign(T lhs, T rhs)
{
return ((lhs ^ rhs) < 0);
}
static unsigned char BitCount(){return (sizeof(T)*8);}
static bool Is64Bit(){return sizeof(T) == 8;}
static bool Is32Bit(){return sizeof(T) == 4;}
static bool Is16Bit(){return sizeof(T) == 2;}
static bool Is8Bit(){return sizeof(T) == 1;}
//both of the following should optimize away
static T MaxInt()
{
if(IsSigned())
{
return (T)~((T)1 << (BitCount()-1));
}
//else
return (T)(~(T)0);
}
static T MinInt()
{
if(IsSigned())
{
return (T)((T)1 << (BitCount()-1));
}
else
{
return ((T)0);
}
}
// Align a value up to the nearest boundary, which must be a power of 2
inline void AlignUp( T alignment )
{
_ASSERTE_SAFEMATH( IsPowerOf2( alignment ) );
*this += (alignment - 1);
if( !this->m_overflow )
{
m_value &= ~(alignment - 1);
}
}
//
// Arithmetic implementation functions
//
//note - this looks complex, but most of the conditionals
//are constant and optimize away
//for example, a signed 64-bit check collapses to:
/*
if(lhs == 0 || rhs == 0)
return 0;
if(MaxInt()/+lhs < +rhs)
{
//overflow
throw SafeIntException(ERROR_ARITHMETIC_OVERFLOW);
}
//ok
return lhs * rhs;
Which ought to inline nicely
*/
// Returns true if safe, false for overflow.
static bool multiply(T lhs, T rhs, T &result)
{
if(Is64Bit())
{
//fast track this one - and avoid DIV_0 below
if(lhs == 0 || rhs == 0)
{
result = 0;
return true;
}
//we're 64 bit - slow, but the only way to do it
if(IsSigned())
{
if(!IsMixedSign(lhs, rhs))
{
//both positive or both negative
//result will be positive, check for lhs * rhs > MaxInt
if(lhs > 0)
{
//both positive
if(MaxInt()/lhs < rhs)
{
//overflow
return false;
}
}
else
{
//both negative
//comparison gets tricky unless we force it to positive
//EXCEPT that -MinInt is undefined - can't be done
//And MinInt always has a greater magnitude than MaxInt
if(lhs == MinInt() || rhs == MinInt())
{
//overflow
return false;
}
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning( disable : 4146 ) // unary minus applied to unsigned is still unsigned
#endif
if(MaxInt()/(-lhs) < (-rhs) )
{
//overflow
return false;
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
}
else
{
//mixed sign - this case is difficult
//test case is lhs * rhs < MinInt => overflow
//if lhs < 0 (implies rhs > 0),
//lhs < MinInt/rhs is the correct test
//else if lhs > 0
//rhs < MinInt/lhs is the correct test
//avoid dividing MinInt by a negative number,
//because MinInt/-1 is a corner case
if(lhs < 0)
{
if(lhs < MinInt()/rhs)
{
//overflow
return false;
}
}
else
{
if(rhs < MinInt()/lhs)
{
//overflow
return false;
}
}
}
//ok
result = lhs * rhs;
return true;
}
else
{
//unsigned, easy case
if(MaxInt()/lhs < rhs)
{
//overflow
return false;
}
//ok
result = lhs * rhs;
return true;
}
}
else if(Is32Bit())
{
//we're 32-bit
if(IsSigned())
{
INT64 tmp = (INT64)lhs * (INT64)rhs;
//upper 33 bits must be the same
//most common case is likely that both are positive - test first
if( (tmp & 0xffffffff80000000LL) == 0 ||
(tmp & 0xffffffff80000000LL) == 0xffffffff80000000LL)
{
//this is OK
result = (T)tmp;
return true;
}
//overflow
return false;
}
else
{
UINT64 tmp = (UINT64)lhs * (UINT64)rhs;
if (tmp & 0xffffffff00000000ULL) //overflow
{
//overflow
return false;
}
result = (T)tmp;
return true;
}
}
else if(Is16Bit())
{
//16-bit
if(IsSigned())
{
INT32 tmp = (INT32)lhs * (INT32)rhs;
//upper 17 bits must be the same
//most common case is likely that both are positive - test first
if( (tmp & 0xffff8000) == 0 || (tmp & 0xffff8000) == 0xffff8000)
{
//this is OK
result = (T)tmp;
return true;
}
//overflow
return false;
}
else
{
UINT32 tmp = (UINT32)lhs * (UINT32)rhs;
if (tmp & 0xffff0000) //overflow
{
return false;
}
result = (T)tmp;
return true;
}
}
else //8-bit
{
_ASSERTE_SAFEMATH(Is8Bit());
if(IsSigned())
{
INT16 tmp = (INT16)lhs * (INT16)rhs;
//upper 9 bits must be the same
//most common case is likely that both are positive - test first
if( (tmp & 0xff80) == 0 || (tmp & 0xff80) == 0xff80)
{
//this is OK
result = (T)tmp;
return true;
}
//overflow
return false;
}
else
{
UINT16 tmp = ((UINT16)lhs) * ((UINT16)rhs);
if (tmp & 0xff00) //overflow
{
return false;
}
result = (T)tmp;
return true;
}
}
}
// Returns true if safe, false on overflow
static inline bool addition(T lhs, T rhs, T &result)
{
if(IsSigned())
{
//test for +/- combo
if(!IsMixedSign(lhs, rhs))
{
//either two negatives, or 2 positives
#ifdef __GNUC__
// Workaround for GCC warning: "comparison is always
// false due to limited range of data type."
if (!(rhs == 0 || rhs > 0))
#else
if(rhs < 0)
#endif // __GNUC__ else
{
//two negatives
if(lhs < (T)(MinInt() - rhs)) //remember rhs < 0
{
return false;
}
//ok
}
else
{
//two positives
if((T)(MaxInt() - lhs) < rhs)
{
return false;
}
//OK
}
}
//else overflow not possible
result = lhs + rhs;
return true;
}
else //unsigned
{
if((T)(MaxInt() - lhs) < rhs)
{
return false;
}
result = lhs + rhs;
return true;
}
}
// Returns true if safe, false on overflow
static inline bool subtraction(T lhs, T rhs, T& result)
{
T tmp = lhs - rhs;
if(IsSigned())
{
if(IsMixedSign(lhs, rhs)) //test for +/- combo
{
//mixed positive and negative
//two cases - +X - -Y => X + Y - check for overflow against MaxInt()
// -X - +Y - check for overflow against MinInt()
if(lhs >= 0) //first case
{
//test is X - -Y > MaxInt()
//equivalent to X > MaxInt() - |Y|
//Y == MinInt() creates special case
//Even 0 - MinInt() can't be done
//note that the special case collapses into the general case, due to the fact
//MaxInt() - MinInt() == -1, and lhs is non-negative
//OR tmp should be GTE lhs
// old test - leave in for clarity
//if(lhs > (T)(MaxInt() + rhs)) //remember that rhs is negative
if(tmp < lhs)
{
return false;
}
//fall through to return value
}
else
{
//second case
//test is -X - Y < MinInt()
//or -X < MinInt() + Y
//we do not have the same issues because abs(MinInt()) > MaxInt()
//tmp should be LTE lhs
//if(lhs < (T)(MinInt() + rhs)) // old test - leave in for clarity
if(tmp > lhs)
{
return false;
}
//fall through to return value
}
}
// else
//both negative, or both positive
//no possible overflow
result = tmp;
return true;
}
else
{
//easy unsigned case
if(lhs < rhs)
{
return false;
}
result = tmp;
return true;
}
}
private:
// Private helper functions
// Note that's it occasionally handy to call the arithmetic implementation
// functions above so we leave them public, even though we almost always use
// the operators instead.
// True if the specified value is a power of two.
static inline bool IsPowerOf2( T x )
{
// find the smallest power of 2 >= x
T testPow = 1;
while( testPow < x )
{
testPow = testPow << 1; // advance to next power of 2
if( testPow <= 0 )
{
return false; // overflow
}
}
return( testPow == x );
}
//
// Instance data
//
// The integer value this instance represents, or 0 if overflow.
T m_value;
// True if overflow has been reached. Once this is set, it cannot be cleared.
bool m_overflow;
// In debug builds we verify that our caller checked the overflow bit before
// accessing the value. This flag is cleared on initialization, and whenever
// m_value or m_overflow changes, and set only when IsOverflow
// is called.
INDEBUG( mutable bool m_checkedOverflow; )
};
// Allows creation of a ClrSafeInt corresponding to the type of the argument.
template <typename T>
ClrSafeInt<T> AsClrSafeInt(T t)
{
return ClrSafeInt<T>(t);
}
template <typename T>
ClrSafeInt<T> AsClrSafeInt(ClrSafeInt<T> t)
{
return t;
}
// Convenience safe-integer types. Currently these are the only types
// we are using ClrSafeInt with. We may want to add others.
// These type names are based on our standardized names in clrtypes.h
typedef ClrSafeInt<UINT8> S_UINT8;
typedef ClrSafeInt<UINT16> S_UINT16;
//typedef ClrSafeInt<UINT32> S_UINT32;
#define S_UINT32 ClrSafeInt<UINT32>
typedef ClrSafeInt<UINT64> S_UINT64;
typedef ClrSafeInt<SIZE_T> S_SIZE_T;
#endif // SAFEMATH_H_
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ---------------------------------------------------------------------------
// safemath.h
//
// overflow checking infrastructure
// ---------------------------------------------------------------------------
#ifndef SAFEMATH_H_
#define SAFEMATH_H_
// This file is included from several places outside the CLR, so we can't
// pull in files like DebugMacros.h. However, we assume that the standard
// clrtypes (UINT32 etc.) are defined.
#include "debugmacrosext.h"
#ifndef _ASSERTE_SAFEMATH
#ifdef _ASSERTE
// Use _ASSERTE if we have it (should always be the case in the CLR)
#define _ASSERTE_SAFEMATH _ASSERTE
#else
// Otherwise (eg. we're being used from a tool like SOS) there isn't much
// we can rely on that is available everywhere. In
// several other tools we just take the recourse of disabling asserts,
// we'll do the same here.
// Ideally we'd have a collection of common utilities available everywhere.
#define _ASSERTE_SAFEMATH(a)
#endif
#endif
#include "static_assert.h"
#ifdef PAL_STDCPP_COMPAT
#include <type_traits>
#else
#include "clr_std/type_traits"
#endif
//==================================================================
// Semantics: if val can be represented as the exact same value
// when cast to Dst type, then FitsIn<Dst>(val) will return true;
// otherwise FitsIn returns false.
//
// Dst and Src must both be integral types.
//
// It's important to note that most of the conditionals in this
// function are based on static type information and as such will
// be optimized away. In particular, the case where the signs are
// identical will result in no code branches.
#ifdef _PREFAST_
#pragma warning(push)
#pragma warning(disable:6326) // PREfast warning: Potential comparison of a constant with another constant
#endif // _PREFAST_
template <typename Dst, typename Src>
inline bool FitsIn(Src val)
{
#ifdef _MSC_VER
static_assert_no_msg(!__is_class(Dst));
static_assert_no_msg(!__is_class(Src));
#endif
if (std::is_signed<Src>::value == std::is_signed<Dst>::value)
{ // Src and Dst are equally signed
if (sizeof(Src) <= sizeof(Dst))
{ // No truncation is possible
return true;
}
else
{ // Truncation is possible, requiring runtime check
return val == (Src)((Dst)val);
}
}
else if (std::is_signed<Src>::value)
{ // Src is signed, Dst is unsigned
#ifdef __GNUC__
// Workaround for GCC warning: "comparison is always
// false due to limited range of data type."
if (!(val == 0 || val > 0))
#else
if (val < 0)
#endif
{ // A negative number cannot be represented by an unsigned type
return false;
}
else
{
if (sizeof(Src) <= sizeof(Dst))
{ // No truncation is possible
return true;
}
else
{ // Truncation is possible, requiring runtime check
return val == (Src)((Dst)val);
}
}
}
else
{ // Src is unsigned, Dst is signed
if (sizeof(Src) < sizeof(Dst))
{ // No truncation is possible. Note that Src is strictly
// smaller than Dst.
return true;
}
else
{ // Truncation is possible, requiring runtime check
#ifdef __GNUC__
// Workaround for GCC warning: "comparison is always
// true due to limited range of data type." If in fact
// Dst were unsigned we'd never execute this code
// anyway.
return ((Dst)val > 0 || (Dst)val == 0) &&
#else
return ((Dst)val >= 0) &&
#endif
(val == (Src)((Dst)val));
}
}
}
// Requires that Dst is an integral type, and that DstMin and DstMax are the
// minimum and maximum values of that type, respectively. Returns "true" iff
// "val" can be represented in the range [DstMin..DstMax] (allowing loss of precision, but
// not truncation).
template <INT64 DstMin, UINT64 DstMax>
inline bool FloatFitsInIntType(float val)
{
float DstMinF = static_cast<float>(DstMin);
float DstMaxF = static_cast<float>(DstMax);
return DstMinF <= val && val <= DstMaxF;
}
template <INT64 DstMin, UINT64 DstMax>
inline bool DoubleFitsInIntType(double val)
{
double DstMinD = static_cast<double>(DstMin);
double DstMaxD = static_cast<double>(DstMax);
return DstMinD <= val && val <= DstMaxD;
}
#ifdef _PREFAST_
#pragma warning(pop)
#endif //_PREFAST_
#define ovadd_lt(a, b, rhs) (((a) + (b) < (rhs) ) && ((a) + (b) >= (a)))
#define ovadd_le(a, b, rhs) (((a) + (b) <= (rhs) ) && ((a) + (b) >= (a)))
#define ovadd_gt(a, b, rhs) (((a) + (b) > (rhs) ) || ((a) + (b) < (a)))
#define ovadd_ge(a, b, rhs) (((a) + (b) >= (rhs) ) || ((a) + (b) < (a)))
#define ovadd3_gt(a, b, c, rhs) (((a) + (b) + (c) > (rhs)) || ((a) + (b) < (a)) || ((a) + (b) + (c) < (c)))
//-----------------------------------------------------------------------------
//
// Liberally lifted from https://github.com/dcleblanc/SafeInt and modified.
//
// Modified to track an overflow bit instead of throwing exceptions. In most
// cases the Visual C++ optimizer (Whidbey beta1 - v14.00.40607) is able to
// optimize the bool away completely.
// Note that using a sentinal value (IntMax for example) to represent overflow
// actually results in poorer code-gen.
//
// This has also been simplified significantly to remove functionality we
// don't currently want (division, implicit conversions, many additional operators etc.)
//
// Example:
// unsafe: UINT32 bufSize = headerSize + elementCount * sizeof(void*);
// becomes:
// S_UINT32 bufSize = S_UINT32(headerSize) + S_UINT32(elementCount) *
// S_UINT32( sizeof(void*) );
// if( bufSize.IsOverflow() ) { <overflow-error> }
// else { use bufSize.Value() }
// or:
// UINT32 tmp, bufSize;
// if( !ClrSafeInt<UINT32>::multiply( elementCount, sizeof(void*), tmp ) ||
// !ClrSafeInt<UINT32>::addition( tmp, headerSize, bufSize ) )
// { <overflow-error> }
// else { use bufSize }
//
//-----------------------------------------------------------------------------
// TODO: Any way to prevent unintended instantiations? This is only designed to
// work with unsigned integral types (signed types will work but we probably
// don't need signed support).
template<typename T> class ClrSafeInt
{
public:
// Default constructor - 0 value by default
ClrSafeInt() :
m_value(0),
m_overflow(false)
COMMA_INDEBUG( m_checkedOverflow( false ) )
{
}
// Value constructor
// This is explicit because otherwise it would be harder to
// differentiate between checked and unchecked usage of an operator.
// I.e. si + x + y vs. si + ( x + y )
//
// Set the m_checkedOverflow bit to true since this is being initialized
// with a constant value and we know that it is valid. A scenario in
// which this is useful is when an overflow causes a fallback value to
// be used:
// if (val.IsOverflow())
// val = ClrSafeInt<T>(some_value);
explicit ClrSafeInt( T v ) :
m_value(v),
m_overflow(false)
COMMA_INDEBUG( m_checkedOverflow( true ) )
{
}
template <typename U>
explicit ClrSafeInt(U u) :
m_value(0),
m_overflow(false)
COMMA_INDEBUG( m_checkedOverflow( false ) )
{
if (!FitsIn<T>(u))
{
m_overflow = true;
}
else
{
m_value = (T)u;
}
}
template <typename U>
ClrSafeInt(ClrSafeInt<U> u) :
m_value(0),
m_overflow(false)
COMMA_INDEBUG( m_checkedOverflow( false ) )
{
if (u.IsOverflow() || !FitsIn<T>(u.Value()))
{
m_overflow = true;
}
else
{
m_value = (T)u.Value();
}
}
// Note: compiler-generated copy constructor and assignment operator
// are correct for our purposes.
// Note: The MS compiler will sometimes silently perform value-destroying
// conversions when calling the operators below.
// Eg. "ClrSafeInt<unsigned> s(0); s += int(-1);" will result in s
// having the value 0xffffffff without generating a compile-time warning.
// Narrowing conversions are generally level 4 warnings so may or may not
// be visible.
//
// In the original SafeInt class, all operators have an
// additional overload that takes an arbitrary type U and then safe
// conversions are performed (resulting in overflow whenever the value
// cannot be preserved).
// We could do the same thing, but currently don't because:
// - we don't believe there are common cases where this would result in a
// security hole.
// - the extra complexity isn't worth the benefits
// - it would prevent compiler warnings in the cases we do get warnings for.
// true if there has been an overflow leading up to the creation of this
// value, false otherwise.
// Note that in debug builds we track whether our client called this,
// so we should not be calling this method ourselves from within this class.
inline bool IsOverflow() const
{
INDEBUG( m_checkedOverflow = true; )
return m_overflow;
}
// Get the value of this integer.
// Must only be called when IsOverflow()==false. If this is called
// on overflow we'll assert in Debug and return 0 in release.
inline T Value() const
{
_ASSERTE_SAFEMATH( m_checkedOverflow ); // Ensure our caller first checked the overflow bit
_ASSERTE_SAFEMATH( !m_overflow );
return m_value;
}
// force the value into the overflow state.
inline void SetOverflow()
{
INDEBUG( this->m_checkedOverflow = false; )
this->m_overflow = true;
// incase someone manages to call Value in release mode - should be optimized out
this->m_value = 0;
}
//
// OPERATORS
//
// Addition and multiplication. Only permitted when both sides are explicitly
// wrapped inside of a ClrSafeInt and when the types match exactly.
// If we permitted a RHS of type 'T', then there would be differences
// in correctness between mathematically equivalent expressions such as
// "si + x + y" and "si + ( x + y )". Unfortunately, not permitting this
// makes expressions involving constants tedius and ugly since the constants
// must be wrapped in ClrSafeInt instances. If we become confident that
// our tools (PreFast) will catch all integer overflows, then we can probably
// safely add this.
inline ClrSafeInt<T> operator +(ClrSafeInt<T> rhs) const
{
ClrSafeInt<T> result; // value is initialized to 0
if( this->m_overflow ||
rhs.m_overflow ||
!addition( this->m_value, rhs.m_value, result.m_value ) )
{
result.m_overflow = true;
}
return result;
}
inline ClrSafeInt<T> operator -(ClrSafeInt<T> rhs) const
{
ClrSafeInt<T> result; // value is initialized to 0
if( this->m_overflow ||
rhs.m_overflow ||
!subtraction( this->m_value, rhs.m_value, result.m_value ) )
{
result.m_overflow = true;
}
return result;
}
inline ClrSafeInt<T> operator *(ClrSafeInt<T> rhs) const
{
ClrSafeInt<T> result; // value is initialized to 0
if( this->m_overflow ||
rhs.m_overflow ||
!multiply( this->m_value, rhs.m_value, result.m_value ) )
{
result.m_overflow = true;
}
return result;
}
// Accumulation operators
// Here it's ok to have versions that take a value of type 'T', however we still
// don't allow any mixed-type operations.
inline ClrSafeInt<T>& operator +=(ClrSafeInt<T> rhs)
{
INDEBUG( this->m_checkedOverflow = false; )
if( this->m_overflow ||
rhs.m_overflow ||
!ClrSafeInt<T>::addition( this->m_value, rhs.m_value, this->m_value ) )
{
this->SetOverflow();
}
return *this;
}
inline ClrSafeInt<T>& operator +=(T rhs)
{
INDEBUG( this->m_checkedOverflow = false; )
if( this->m_overflow ||
!ClrSafeInt<T>::addition( this->m_value, rhs, this->m_value ) )
{
this->SetOverflow();
}
return *this;
}
inline ClrSafeInt<T>& operator *=(ClrSafeInt<T> rhs)
{
INDEBUG( this->m_checkedOverflow = false; )
if( this->m_overflow ||
rhs.m_overflow ||
!ClrSafeInt<T>::multiply( this->m_value, rhs.m_value, this->m_value ) )
{
this->SetOverflow();
}
return *this;
}
inline ClrSafeInt<T>& operator *=(T rhs)
{
INDEBUG( this->m_checkedOverflow = false; )
if( this->m_overflow ||
!ClrSafeInt<T>::multiply( this->m_value, rhs, this->m_value ) )
{
this->SetOverflow();
}
return *this;
}
//
// STATIC HELPER METHODS
//these compile down to something as efficient as macros and allow run-time testing
//of type by the developer
//
template <typename U> static bool IsSigned(U)
{
return std::is_signed<U>::value;
}
static bool IsSigned()
{
return std::is_signed<T>::value;
}
static bool IsMixedSign(T lhs, T rhs)
{
return ((lhs ^ rhs) < 0);
}
static unsigned char BitCount(){return (sizeof(T)*8);}
static bool Is64Bit(){return sizeof(T) == 8;}
static bool Is32Bit(){return sizeof(T) == 4;}
static bool Is16Bit(){return sizeof(T) == 2;}
static bool Is8Bit(){return sizeof(T) == 1;}
//both of the following should optimize away
static T MaxInt()
{
if(IsSigned())
{
return (T)~((T)1 << (BitCount()-1));
}
//else
return (T)(~(T)0);
}
static T MinInt()
{
if(IsSigned())
{
return (T)((T)1 << (BitCount()-1));
}
else
{
return ((T)0);
}
}
// Align a value up to the nearest boundary, which must be a power of 2
inline void AlignUp( T alignment )
{
_ASSERTE_SAFEMATH( IsPowerOf2( alignment ) );
*this += (alignment - 1);
if( !this->m_overflow )
{
m_value &= ~(alignment - 1);
}
}
//
// Arithmetic implementation functions
//
//note - this looks complex, but most of the conditionals
//are constant and optimize away
//for example, a signed 64-bit check collapses to:
/*
if(lhs == 0 || rhs == 0)
return 0;
if(MaxInt()/+lhs < +rhs)
{
//overflow
throw SafeIntException(ERROR_ARITHMETIC_OVERFLOW);
}
//ok
return lhs * rhs;
Which ought to inline nicely
*/
// Returns true if safe, false for overflow.
static bool multiply(T lhs, T rhs, T &result)
{
if(Is64Bit())
{
//we're 64 bit - slow, but the only way to do it
if(IsSigned())
{
return ClrSafeInt<int64_t>::multiply((int64_t)lhs, (int64_t)rhs, (int64_t&)result);
}
else
{
return ClrSafeInt<uint64_t>::multiply((uint64_t)lhs, (uint64_t)rhs, (uint64_t&)result);
}
}
else if(Is32Bit())
{
//we're 32-bit
if(IsSigned())
{
return ClrSafeInt<int32_t>::multiply((int32_t)lhs, (int32_t)rhs, (int32_t&)result);
}
else
{
return ClrSafeInt<uint32_t>::multiply((uint32_t)lhs, (uint32_t)rhs, (uint32_t&)result);
}
}
else if(Is16Bit())
{
//16-bit
if(IsSigned())
{
return ClrSafeInt<int16_t>::multiply((int16_t)lhs, (int16_t)rhs, (int16_t&)result);
}
else
{
return ClrSafeInt<uint16_t>::multiply((uint16_t)lhs, (uint16_t)rhs, (uint16_t&)result);
}
}
else //8-bit
{
_ASSERTE_SAFEMATH(Is8Bit());
if(IsSigned())
{
return ClrSafeInt<int8_t>::multiply((int8_t)lhs, (int8_t)rhs, (int8_t&)result);
}
else
{
return ClrSafeInt<uint8_t>::multiply((uint8_t)lhs, (uint8_t)rhs, (uint8_t&)result);
}
}
}
// Returns true if safe, false on overflow
static inline bool addition(T lhs, T rhs, T &result)
{
if(IsSigned())
{
//test for +/- combo
if(!IsMixedSign(lhs, rhs))
{
//either two negatives, or 2 positives
#ifdef __GNUC__
// Workaround for GCC warning: "comparison is always
// false due to limited range of data type."
if (!(rhs == 0 || rhs > 0))
#else
if(rhs < 0)
#endif // __GNUC__ else
{
//two negatives
if(lhs < (T)(MinInt() - rhs)) //remember rhs < 0
{
return false;
}
//ok
}
else
{
//two positives
if((T)(MaxInt() - lhs) < rhs)
{
return false;
}
//OK
}
}
//else overflow not possible
result = lhs + rhs;
return true;
}
else //unsigned
{
if((T)(MaxInt() - lhs) < rhs)
{
return false;
}
result = lhs + rhs;
return true;
}
}
// Returns true if safe, false on overflow
static inline bool subtraction(T lhs, T rhs, T& result)
{
T tmp = lhs - rhs;
if(IsSigned())
{
if(IsMixedSign(lhs, rhs)) //test for +/- combo
{
//mixed positive and negative
//two cases - +X - -Y => X + Y - check for overflow against MaxInt()
// -X - +Y - check for overflow against MinInt()
if(lhs >= 0) //first case
{
//test is X - -Y > MaxInt()
//equivalent to X > MaxInt() - |Y|
//Y == MinInt() creates special case
//Even 0 - MinInt() can't be done
//note that the special case collapses into the general case, due to the fact
//MaxInt() - MinInt() == -1, and lhs is non-negative
//OR tmp should be GTE lhs
// old test - leave in for clarity
//if(lhs > (T)(MaxInt() + rhs)) //remember that rhs is negative
if(tmp < lhs)
{
return false;
}
//fall through to return value
}
else
{
//second case
//test is -X - Y < MinInt()
//or -X < MinInt() + Y
//we do not have the same issues because abs(MinInt()) > MaxInt()
//tmp should be LTE lhs
//if(lhs < (T)(MinInt() + rhs)) // old test - leave in for clarity
if(tmp > lhs)
{
return false;
}
//fall through to return value
}
}
// else
//both negative, or both positive
//no possible overflow
result = tmp;
return true;
}
else
{
//easy unsigned case
if(lhs < rhs)
{
return false;
}
result = tmp;
return true;
}
}
private:
// Private helper functions
// Note that's it occasionally handy to call the arithmetic implementation
// functions above so we leave them public, even though we almost always use
// the operators instead.
// True if the specified value is a power of two.
static inline bool IsPowerOf2( T x )
{
// find the smallest power of 2 >= x
T testPow = 1;
while( testPow < x )
{
testPow = testPow << 1; // advance to next power of 2
if( testPow <= 0 )
{
return false; // overflow
}
}
return( testPow == x );
}
//
// Instance data
//
// The integer value this instance represents, or 0 if overflow.
T m_value;
// True if overflow has been reached. Once this is set, it cannot be cleared.
bool m_overflow;
// In debug builds we verify that our caller checked the overflow bit before
// accessing the value. This flag is cleared on initialization, and whenever
// m_value or m_overflow changes, and set only when IsOverflow
// is called.
INDEBUG( mutable bool m_checkedOverflow; )
};
template <>
inline bool ClrSafeInt<int64_t>::multiply(int64_t lhs, int64_t rhs, int64_t &result)
{
//fast track this one - and avoid DIV_0 below
if(lhs == 0 || rhs == 0)
{
result = 0;
return true;
}
if(!IsMixedSign(lhs, rhs))
{
//both positive or both negative
//result will be positive, check for lhs * rhs > MaxInt
if(lhs > 0)
{
//both positive
if(MaxInt()/lhs < rhs)
{
//overflow
return false;
}
}
else
{
//both negative
//comparison gets tricky unless we force it to positive
//EXCEPT that -MinInt is undefined - can't be done
//And MinInt always has a greater magnitude than MaxInt
if(lhs == MinInt() || rhs == MinInt())
{
//overflow
return false;
}
if(MaxInt()/(-lhs) < (-rhs) )
{
//overflow
return false;
}
}
}
else
{
//mixed sign - this case is difficult
//test case is lhs * rhs < MinInt => overflow
//if lhs < 0 (implies rhs > 0),
//lhs < MinInt/rhs is the correct test
//else if lhs > 0
//rhs < MinInt/lhs is the correct test
//avoid dividing MinInt by a negative number,
//because MinInt/-1 is a corner case
if(lhs < 0)
{
if(lhs < MinInt()/rhs)
{
//overflow
return false;
}
}
else
{
if(rhs < MinInt()/lhs)
{
//overflow
return false;
}
}
}
//ok
result = lhs * rhs;
return true;
}
template <>
inline bool ClrSafeInt<uint64_t>::multiply(uint64_t lhs, uint64_t rhs, uint64_t &result)
{
//fast track this one - and avoid DIV_0 below
if(lhs == 0 || rhs == 0)
{
result = 0;
return true;
}
//unsigned, easy case
if(MaxInt()/lhs < rhs)
{
//overflow
return false;
}
//ok
result = lhs * rhs;
return true;
}
template <>
inline bool ClrSafeInt<int32_t>::multiply(int32_t lhs, int32_t rhs, int32_t &result)
{
INT64 tmp = (INT64)lhs * (INT64)rhs;
//upper 33 bits must be the same
//most common case is likely that both are positive - test first
if( (tmp & 0xffffffff80000000LL) == 0 ||
(tmp & 0xffffffff80000000LL) == 0xffffffff80000000LL)
{
//this is OK
result = (int32_t)tmp;
return true;
}
//overflow
return false;
}
template <>
inline bool ClrSafeInt<uint32_t>::multiply(uint32_t lhs, uint32_t rhs, uint32_t &result)
{
UINT64 tmp = (UINT64)lhs * (UINT64)rhs;
if (tmp & 0xffffffff00000000ULL) //overflow
{
//overflow
return false;
}
result = (uint32_t)tmp;
return true;
}
template <>
inline bool ClrSafeInt<int16_t>::multiply(int16_t lhs, int16_t rhs, int16_t &result)
{
INT32 tmp = (INT32)lhs * (INT32)rhs;
//upper 17 bits must be the same
//most common case is likely that both are positive - test first
if( (tmp & 0xffff8000) == 0 || (tmp & 0xffff8000) == 0xffff8000)
{
//this is OK
result = (int16_t)tmp;
return true;
}
//overflow
return false;
}
template <>
inline bool ClrSafeInt<uint16_t>::multiply(uint16_t lhs, uint16_t rhs, uint16_t &result)
{
UINT32 tmp = (UINT32)lhs * (UINT32)rhs;
if (tmp & 0xffff0000) //overflow
{
return false;
}
result = (uint16_t)tmp;
return true;
}
template <>
inline bool ClrSafeInt<int8_t>::multiply(int8_t lhs, int8_t rhs, int8_t &result)
{
INT16 tmp = (INT16)lhs * (INT16)rhs;
//upper 9 bits must be the same
//most common case is likely that both are positive - test first
if( (tmp & 0xff80) == 0 || (tmp & 0xff80) == 0xff80)
{
//this is OK
result = (int8_t)tmp;
return true;
}
//overflow
return false;
}
template <>
inline bool ClrSafeInt<uint8_t>::multiply(uint8_t lhs, uint8_t rhs, uint8_t &result)
{
UINT16 tmp = ((UINT16)lhs) * ((UINT16)rhs);
if (tmp & 0xff00) //overflow
{
return false;
}
result = (uint8_t)tmp;
return true;
}
// Allows creation of a ClrSafeInt corresponding to the type of the argument.
template <typename T>
ClrSafeInt<T> AsClrSafeInt(T t)
{
return ClrSafeInt<T>(t);
}
template <typename T>
ClrSafeInt<T> AsClrSafeInt(ClrSafeInt<T> t)
{
return t;
}
// Convenience safe-integer types. Currently these are the only types
// we are using ClrSafeInt with. We may want to add others.
// These type names are based on our standardized names in clrtypes.h
typedef ClrSafeInt<UINT8> S_UINT8;
typedef ClrSafeInt<UINT16> S_UINT16;
//typedef ClrSafeInt<UINT32> S_UINT32;
#define S_UINT32 ClrSafeInt<UINT32>
typedef ClrSafeInt<UINT64> S_UINT64;
typedef ClrSafeInt<SIZE_T> S_SIZE_T;
#endif // SAFEMATH_H_
| 1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/inc/volatile.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// Volatile.h
//
//
// Defines the Volatile<T> type, which provides uniform volatile-ness on
// Visual C++ and GNU C++.
//
// Visual C++ treats accesses to volatile variables as follows: no read or write
// can be removed by the compiler, no global memory access can be moved backwards past
// a volatile read, and no global memory access can be moved forward past a volatile
// write.
//
// The GCC volatile semantic is straight out of the C standard: the compiler is not
// allowed to remove accesses to volatile variables, and it is not allowed to reorder
// volatile accesses relative to other volatile accesses. It is allowed to freely
// reorder non-volatile accesses relative to volatile accesses.
//
// We have lots of code that assumes that ordering of non-volatile accesses will be
// constrained relative to volatile accesses. For example, this pattern appears all
// over the place:
//
// static volatile int lock = 0;
//
// while (InterlockedCompareExchange(&lock, 0, 1))
// {
// //spin
// }
//
// //read and write variables protected by the lock
//
// lock = 0;
//
// This depends on the reads and writes in the critical section not moving past the
// final statement, which releases the lock. If this should happen, then you have an
// unintended race.
//
// The solution is to ban the use of the "volatile" keyword, and instead define our
// own type Volatile<T>, which acts like a variable of type T except that accesses to
// the variable are always given VC++'s volatile semantics.
//
// (NOTE: The code above is not intended to be an example of how a spinlock should be
// implemented; it has many flaws, and should not be used. This code is intended only
// to illustrate where we might get into trouble with GCC's volatile semantics.)
//
// @TODO: many of the variables marked volatile in the CLR do not actually need to be
// volatile. For example, if a variable is just always passed to Interlocked functions
// (such as a refcount variable), there is no need for it to be volatile. A future
// cleanup task should be to examine each volatile variable and make them non-volatile
// if possible.
//
// @TODO: link to a "Memory Models for CLR Devs" doc here (this doc does not yet exist).
//
#ifndef _VOLATILE_H_
#define _VOLATILE_H_
#include "staticcontract.h"
//
// This code is extremely compiler- and CPU-specific, and will need to be altered to
// support new compilers and/or CPUs. Here we enforce that we can only compile using
// VC++, or GCC on x86 or AMD64.
//
#if !defined(_MSC_VER) && !defined(__GNUC__)
#error The Volatile type is currently only defined for Visual C++ and GNU C++
#endif
#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_LOONGARCH64) && !defined(HOST_S390X)
#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, LOONGARCH64, or S390X CPUs
#endif
#if defined(__GNUC__)
#if defined(HOST_ARMV6)
// DMB ISH not valid on ARMv6
#define VOLATILE_MEMORY_BARRIER() asm volatile ("mcr p15, 0, r0, c7, c10, 5" : : : "memory")
#elif defined(HOST_ARM) || defined(HOST_ARM64)
// This is functionally equivalent to the MemoryBarrier() macro used on ARM on Windows.
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dmb ish" : : : "memory")
#elif defined(HOST_LOONGARCH64)
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dbar 0 " : : : "memory")
#else
//
// For GCC, we prevent reordering by the compiler by inserting the following after a volatile
// load (to prevent subsequent operations from moving before the read), and before a volatile
// write (to prevent prior operations from moving past the write). We don't need to do anything
// special to prevent CPU reorderings, because the x86 and AMD64 architectures are already
// sufficiently constrained for our purposes. If we ever need to run on weaker CPU architectures
// (such as PowerPC), then we will need to do more work.
//
// Please do not use this macro outside of this file. It is subject to change or removal without
// notice.
//
#define VOLATILE_MEMORY_BARRIER() asm volatile ("" : : : "memory")
#endif // HOST_ARM || HOST_ARM64
#elif (defined(HOST_ARM) || defined(HOST_ARM64)) && _ISO_VOLATILE
// ARM & ARM64 have a very weak memory model and very few tools to control that model. We're forced to perform a full
// memory barrier to preserve the volatile semantics. Technically this is only necessary on MP systems but we
// currently don't have a cheap way to determine the number of CPUs from this header file. Revisit this if it
// turns out to be a performance issue for the uni-proc case.
#define VOLATILE_MEMORY_BARRIER() MemoryBarrier()
#else
//
// On VC++, reorderings at the compiler and machine level are prevented by the use of the
// "volatile" keyword in VolatileLoad and VolatileStore. This should work on any CPU architecture
// targeted by VC++ with /iso_volatile-.
//
#define VOLATILE_MEMORY_BARRIER()
#endif // __GNUC__
template<typename T>
struct RemoveVolatile
{
typedef T type;
};
template<typename T>
struct RemoveVolatile<volatile T>
{
typedef T type;
};
//
// VolatileLoad loads a T from a pointer to T. It is guaranteed that this load will not be optimized
// away by the compiler, and that any operation that occurs after this load, in program order, will
// not be moved before this load. In general it is not guaranteed that the load will be atomic, though
// this is the case for most aligned scalar data types. If you need atomic loads or stores, you need
// to consult the compiler and CPU manuals to find which circumstances allow atomicity.
//
// Starting at version 3.8, clang errors out on initializing of type int * to volatile int *. To fix this, we add two templates to cast away volatility
// Helper structures for casting away volatileness
#if defined(HOST_ARM64) && defined(_MSC_VER)
#include <arm64intr.h>
#endif
template<typename T>
inline
T VolatileLoad(T const * pt)
{
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
#ifndef DACCESS_COMPILE
#if defined(HOST_ARM64) && defined(__GNUC__)
T val;
static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);
if((1 << sizeof(T)) & lockFreeAtomicSizeMask)
{
__atomic_load((T const *)pt, const_cast<typename RemoveVolatile<T>::type *>(&val), __ATOMIC_ACQUIRE);
}
else
{
val = *(T volatile const *)pt;
asm volatile ("dmb ishld" : : : "memory");
}
#elif defined(HOST_ARM64) && defined(_MSC_VER)
// silence warnings on casts in branches that are not taken.
#pragma warning(push)
#pragma warning(disable : 4302)
#pragma warning(disable : 4311)
#pragma warning(disable : 4312)
T val;
T* pv = &val;
switch (sizeof(T))
{
case 1:
*(unsigned __int8* )pv = __ldar8 ((unsigned __int8 volatile*)pt);
break;
case 2:
*(unsigned __int16*)pv = __ldar16((unsigned __int16 volatile*)pt);
break;
case 4:
*(unsigned __int32*)pv = __ldar32((unsigned __int32 volatile*)pt);
break;
case 8:
*(unsigned __int64*)pv = __ldar64((unsigned __int64 volatile*)pt);
break;
default:
val = *(T volatile const*)pt;
__dmb(_ARM64_BARRIER_ISHLD);
}
#pragma warning(pop)
#else
T val = *(T volatile const *)pt;
VOLATILE_MEMORY_BARRIER();
#endif
#else
T val = *pt;
#endif
return val;
}
template<typename T>
inline
T VolatileLoadWithoutBarrier(T const * pt)
{
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
#ifndef DACCESS_COMPILE
T val = *(T volatile const *)pt;
#else
T val = *pt;
#endif
return val;
}
template <typename T> class Volatile;
template<typename T>
inline
T VolatileLoad(Volatile<T> const * pt)
{
STATIC_CONTRACT_SUPPORTS_DAC;
return pt->Load();
}
//
// VolatileStore stores a T into the target of a pointer to T. Is is guaranteed that this store will
// not be optimized away by the compiler, and that any operation that occurs before this store, in program
// order, will not be moved after this store. In general, it is not guaranteed that the store will be
// atomic, though this is the case for most aligned scalar data types. If you need atomic loads or stores,
// you need to consult the compiler and CPU manuals to find which circumstances allow atomicity.
//
template<typename T>
inline
void VolatileStore(T* pt, T val)
{
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
#ifndef DACCESS_COMPILE
#if defined(HOST_ARM64) && defined(__GNUC__)
static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);
if((1 << sizeof(T)) & lockFreeAtomicSizeMask)
{
__atomic_store((T volatile *)pt, &val, __ATOMIC_RELEASE);
}
else
{
VOLATILE_MEMORY_BARRIER();
*(T volatile *)pt = val;
}
#elif defined(HOST_ARM64) && defined(_MSC_VER)
// silence warnings on casts in branches that are not taken.
#pragma warning(push)
#pragma warning(disable : 4302)
#pragma warning(disable : 4311)
#pragma warning(disable : 4312)
T* pv = &val;
switch (sizeof(T))
{
case 1:
__stlr8 ((unsigned __int8 volatile*)pt, *(unsigned __int8* )pv);
break;
case 2:
__stlr16((unsigned __int16 volatile*)pt, *(unsigned __int16*)pv);
break;
case 4:
__stlr32((unsigned __int32 volatile*)pt, *(unsigned __int32*)pv);
break;
case 8:
__stlr64((unsigned __int64 volatile*)pt, *(unsigned __int64*)pv);
break;
default:
__dmb(_ARM64_BARRIER_ISH);
*(T volatile *)pt = val;
}
#pragma warning(pop)
#else
VOLATILE_MEMORY_BARRIER();
*(T volatile *)pt = val;
#endif
#else
*pt = val;
#endif
}
template<typename T>
inline
void VolatileStoreWithoutBarrier(T* pt, T val)
{
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
#ifndef DACCESS_COMPILE
*(T volatile *)pt = val;
#else
*pt = val;
#endif
}
//
// Memory ordering barrier that waits for loads in progress to complete.
// Any effects of loads or stores that appear after, in program order, will "happen after" relative to this.
// Other operations such as computation or instruction prefetch are not affected.
//
// Architectural mapping:
// arm64 : dmb ishld
// arm : dmb ish
// x86/64 : compiler fence
inline
void VolatileLoadBarrier()
{
#if defined(HOST_ARM64) && defined(__GNUC__)
asm volatile ("dmb ishld" : : : "memory");
#elif defined(HOST_ARM64) && defined(_MSC_VER)
__dmb(_ARM64_BARRIER_ISHLD);
#else
VOLATILE_MEMORY_BARRIER();
#endif
}
//
// Volatile<T> implements accesses with our volatile semantics over a variable of type T.
// Wherever you would have used a "volatile Foo" or, equivalently, "Foo volatile", use Volatile<Foo>
// instead. If Foo is a pointer type, use VolatilePtr.
//
// Note that there are still some things that don't work with a Volatile<T>,
// that would have worked with a "volatile T". For example, you can't cast a Volatile<int> to a float.
// You must instead cast to an int, then to a float. Or you can call Load on the Volatile<int>, and
// cast the result to a float. In general, calling Load or Store explicitly will work around
// any problems that can't be solved by operator overloading.
//
// @TODO: it's not clear that we actually *want* any operator overloading here. It's in here primarily
// to ease the task of converting all of the old uses of the volatile keyword, but in the long
// run it's probably better if users of this class are forced to call Load() and Store() explicitly.
// This would make it much more clear where the memory barriers are, and which operations are actually
// being performed, but it will have to wait for another cleanup effort.
//
template <typename T>
class Volatile
{
private:
//
// The data which we are treating as volatile
//
T m_val;
public:
//
// Default constructor. Results in an unitialized value!
//
inline Volatile()
{
STATIC_CONTRACT_SUPPORTS_DAC;
}
//
// Allow initialization of Volatile<T> from a T
//
inline Volatile(const T& val)
{
STATIC_CONTRACT_SUPPORTS_DAC;
((volatile T &)m_val) = val;
}
//
// Copy constructor
//
inline Volatile(const Volatile<T>& other)
{
STATIC_CONTRACT_SUPPORTS_DAC;
((volatile T &)m_val) = other.Load();
}
//
// Loads the value of the volatile variable. See code:VolatileLoad for the semantics of this operation.
//
inline T Load() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return VolatileLoad(&m_val);
}
//
// Loads the value of the volatile variable atomically without erecting the memory barrier.
//
inline T LoadWithoutBarrier() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return ((volatile T &)m_val);
}
//
// Stores a new value to the volatile variable. See code:VolatileStore for the semantics of this
// operation.
//
inline void Store(const T& val)
{
STATIC_CONTRACT_SUPPORTS_DAC;
VolatileStore(&m_val, val);
}
//
// Stores a new value to the volatile variable atomically without erecting the memory barrier.
//
inline void StoreWithoutBarrier(const T& val) const
{
STATIC_CONTRACT_SUPPORTS_DAC;
((volatile T &)m_val) = val;
}
//
// Gets a pointer to the volatile variable. This is dangerous, as it permits the variable to be
// accessed without using Load and Store, but it is necessary for passing Volatile<T> to APIs like
// InterlockedIncrement.
//
inline volatile T* GetPointer() { return (volatile T*)&m_val; }
//
// Gets the raw value of the variable. This is dangerous, as it permits the variable to be
// accessed without using Load and Store
//
inline T& RawValue() { return m_val; }
//
// Allow casts from Volatile<T> to T. Note that this allows implicit casts, so you can
// pass a Volatile<T> directly to a method that expects a T.
//
inline operator T() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return this->Load();
}
//
// Assignment from T
//
inline Volatile<T>& operator=(T val) {Store(val); return *this;}
//
// Get the address of the volatile variable. This is dangerous, as it allows the value of the
// volatile variable to be accessed directly, without going through Load and Store, but it is
// necessary for passing Volatile<T> to APIs like InterlockedIncrement. Note that we are returning
// a pointer to a volatile T here, so we cannot accidentally pass this pointer to an API that
// expects a normal pointer.
//
inline T volatile * operator&() {return this->GetPointer();}
inline T volatile const * operator&() const {return this->GetPointer();}
//
// Comparison operators
//
template<typename TOther>
inline bool operator==(const TOther& other) const {return this->Load() == other;}
template<typename TOther>
inline bool operator!=(const TOther& other) const {return this->Load() != other;}
//
// Miscellaneous operators. Add more as necessary.
//
inline Volatile<T>& operator+=(T val) {Store(this->Load() + val); return *this;}
inline Volatile<T>& operator-=(T val) {Store(this->Load() - val); return *this;}
inline Volatile<T>& operator|=(T val) {Store(this->Load() | val); return *this;}
inline Volatile<T>& operator&=(T val) {Store(this->Load() & val); return *this;}
inline bool operator!() const { STATIC_CONTRACT_SUPPORTS_DAC; return !this->Load();}
//
// Prefix increment
//
inline Volatile& operator++() {this->Store(this->Load()+1); return *this;}
//
// Postfix increment
//
inline T operator++(int) {T val = this->Load(); this->Store(val+1); return val;}
//
// Prefix decrement
//
inline Volatile& operator--() {this->Store(this->Load()-1); return *this;}
//
// Postfix decrement
//
inline T operator--(int) {T val = this->Load(); this->Store(val-1); return val;}
};
//
// A VolatilePtr builds on Volatile<T> by adding operators appropriate to pointers.
// Wherever you would have used "Foo * volatile", use "VolatilePtr<Foo>" instead.
//
// VolatilePtr also allows the substution of other types for the underlying pointer. This
// allows you to wrap a VolatilePtr around a custom type that looks like a pointer. For example,
// if what you want is a "volatile DPTR<Foo>", use "VolatilePtr<Foo, DPTR<Foo>>".
//
template <typename T, typename P = T*>
class VolatilePtr : public Volatile<P>
{
public:
//
// Default constructor. Results in an uninitialized pointer!
//
inline VolatilePtr()
{
STATIC_CONTRACT_SUPPORTS_DAC;
}
//
// Allow assignment from the pointer type.
//
inline VolatilePtr(P val) : Volatile<P>(val)
{
STATIC_CONTRACT_SUPPORTS_DAC;
}
//
// Copy constructor
//
inline VolatilePtr(const VolatilePtr& other) : Volatile<P>(other)
{
STATIC_CONTRACT_SUPPORTS_DAC;
}
//
// Cast to the pointer type
//
inline operator P() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return (P)this->Load();
}
//
// Member access
//
inline P operator->() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return (P)this->Load();
}
//
// Dereference the pointer
//
inline T& operator*() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return *(P)this->Load();
}
//
// Access the pointer as an array
//
template <typename TIndex>
inline T& operator[](TIndex index)
{
STATIC_CONTRACT_SUPPORTS_DAC;
return ((P)this->Load())[index];
}
};
//
// From here on out, we ban the use of the "volatile" keyword. If you found this while trying to define
// a volatile variable, go to the top of this file and start reading.
//
#ifdef volatile
#undef volatile
#endif
// ***** Temporarily removing this to unblock integration with new VC++ bits
//#define volatile (DoNotUseVolatileKeyword) volatile
// The substitution for volatile above is defined in such a way that we can still explicitly access the
// volatile keyword without error using the macros below. Use with care.
//#define REMOVE_DONOTUSE_ERROR(x)
//#define RAW_KEYWORD(x) REMOVE_DONOTUSE_ERROR x
#define RAW_KEYWORD(x) x
#ifdef DACCESS_COMPILE
// No need to use volatile in DAC builds - DAC is single-threaded and the target
// process is suspended.
#define VOLATILE(T) T
#else
// Disable use of Volatile<T> for GC/HandleTable code except on platforms where it's absolutely necessary.
#if defined(_MSC_VER) && !defined(HOST_ARM) && !defined(HOST_ARM64)
#define VOLATILE(T) T RAW_KEYWORD(volatile)
#else
#define VOLATILE(T) Volatile<T>
#endif
#endif // DACCESS_COMPILE
// VolatilePtr-specific clr::SafeAddRef and clr::SafeRelease
namespace clr
{
template < typename ItfT, typename PtrT > inline
#ifdef __checkReturn // Volatile.h is used in corunix headers, which don't define/nullify SAL.
__checkReturn
#endif
VolatilePtr<ItfT, PtrT>&
SafeAddRef(VolatilePtr<ItfT, PtrT>& pItf)
{
STATIC_CONTRACT_LIMITED_METHOD;
SafeAddRef(pItf.Load());
return pItf;
}
template < typename ItfT, typename PtrT > inline
ULONG
SafeRelease(VolatilePtr<ItfT, PtrT>& pItf)
{
STATIC_CONTRACT_LIMITED_METHOD;
return SafeRelease(pItf.Load());
}
}
#endif //_VOLATILE_H_
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// Volatile.h
//
//
// Defines the Volatile<T> type, which provides uniform volatile-ness on
// Visual C++ and GNU C++.
//
// Visual C++ treats accesses to volatile variables as follows: no read or write
// can be removed by the compiler, no global memory access can be moved backwards past
// a volatile read, and no global memory access can be moved forward past a volatile
// write.
//
// The GCC volatile semantic is straight out of the C standard: the compiler is not
// allowed to remove accesses to volatile variables, and it is not allowed to reorder
// volatile accesses relative to other volatile accesses. It is allowed to freely
// reorder non-volatile accesses relative to volatile accesses.
//
// We have lots of code that assumes that ordering of non-volatile accesses will be
// constrained relative to volatile accesses. For example, this pattern appears all
// over the place:
//
// static volatile int lock = 0;
//
// while (InterlockedCompareExchange(&lock, 0, 1))
// {
// //spin
// }
//
// //read and write variables protected by the lock
//
// lock = 0;
//
// This depends on the reads and writes in the critical section not moving past the
// final statement, which releases the lock. If this should happen, then you have an
// unintended race.
//
// The solution is to ban the use of the "volatile" keyword, and instead define our
// own type Volatile<T>, which acts like a variable of type T except that accesses to
// the variable are always given VC++'s volatile semantics.
//
// (NOTE: The code above is not intended to be an example of how a spinlock should be
// implemented; it has many flaws, and should not be used. This code is intended only
// to illustrate where we might get into trouble with GCC's volatile semantics.)
//
// @TODO: many of the variables marked volatile in the CLR do not actually need to be
// volatile. For example, if a variable is just always passed to Interlocked functions
// (such as a refcount variable), there is no need for it to be volatile. A future
// cleanup task should be to examine each volatile variable and make them non-volatile
// if possible.
//
// @TODO: link to a "Memory Models for CLR Devs" doc here (this doc does not yet exist).
//
#ifndef _VOLATILE_H_
#define _VOLATILE_H_
#include "staticcontract.h"
//
// This code is extremely compiler- and CPU-specific, and will need to be altered to
// support new compilers and/or CPUs. Here we enforce that we can only compile using
// VC++, or GCC on x86 or AMD64.
//
#if !defined(_MSC_VER) && !defined(__GNUC__)
#error The Volatile type is currently only defined for Visual C++ and GNU C++
#endif
#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_LOONGARCH64) && !defined(HOST_S390X)
#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, LOONGARCH64, or S390X CPUs
#endif
#if defined(__GNUC__)
#if defined(HOST_ARMV6)
// DMB ISH not valid on ARMv6
#define VOLATILE_MEMORY_BARRIER() asm volatile ("mcr p15, 0, r0, c7, c10, 5" : : : "memory")
#elif defined(HOST_ARM) || defined(HOST_ARM64)
// This is functionally equivalent to the MemoryBarrier() macro used on ARM on Windows.
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dmb ish" : : : "memory")
#elif defined(HOST_LOONGARCH64)
#define VOLATILE_MEMORY_BARRIER() asm volatile ("dbar 0 " : : : "memory")
#else
//
// For GCC, we prevent reordering by the compiler by inserting the following after a volatile
// load (to prevent subsequent operations from moving before the read), and before a volatile
// write (to prevent prior operations from moving past the write). We don't need to do anything
// special to prevent CPU reorderings, because the x86 and AMD64 architectures are already
// sufficiently constrained for our purposes. If we ever need to run on weaker CPU architectures
// (such as PowerPC), then we will need to do more work.
//
// Please do not use this macro outside of this file. It is subject to change or removal without
// notice.
//
#define VOLATILE_MEMORY_BARRIER() asm volatile ("" : : : "memory")
#endif // HOST_ARM || HOST_ARM64
#elif (defined(HOST_ARM) || defined(HOST_ARM64)) && _ISO_VOLATILE
// ARM & ARM64 have a very weak memory model and very few tools to control that model. We're forced to perform a full
// memory barrier to preserve the volatile semantics. Technically this is only necessary on MP systems but we
// currently don't have a cheap way to determine the number of CPUs from this header file. Revisit this if it
// turns out to be a performance issue for the uni-proc case.
#define VOLATILE_MEMORY_BARRIER() MemoryBarrier()
#else
//
// On VC++, reorderings at the compiler and machine level are prevented by the use of the
// "volatile" keyword in VolatileLoad and VolatileStore. This should work on any CPU architecture
// targeted by VC++ with /iso_volatile-.
//
#define VOLATILE_MEMORY_BARRIER()
#endif // __GNUC__
template<typename T>
struct RemoveVolatile
{
typedef T type;
};
template<typename T>
struct RemoveVolatile<volatile T>
{
typedef T type;
};
//
// VolatileLoad loads a T from a pointer to T. It is guaranteed that this load will not be optimized
// away by the compiler, and that any operation that occurs after this load, in program order, will
// not be moved before this load. In general it is not guaranteed that the load will be atomic, though
// this is the case for most aligned scalar data types. If you need atomic loads or stores, you need
// to consult the compiler and CPU manuals to find which circumstances allow atomicity.
//
// Starting at version 3.8, clang errors out on initializing of type int * to volatile int *. To fix this, we add two templates to cast away volatility
// Helper structures for casting away volatileness
#if defined(HOST_ARM64) && defined(_MSC_VER)
#include <arm64intr.h>
#endif
template<typename T>
inline
T VolatileLoad(T const * pt)
{
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
#ifndef DACCESS_COMPILE
#if defined(HOST_ARM64) && defined(__GNUC__)
T val;
static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);
if((1 << sizeof(T)) & lockFreeAtomicSizeMask)
{
__atomic_load((T const *)pt, const_cast<typename RemoveVolatile<T>::type *>(&val), __ATOMIC_ACQUIRE);
}
else
{
val = *(T volatile const *)pt;
asm volatile ("dmb ishld" : : : "memory");
}
#elif defined(HOST_ARM64) && defined(_MSC_VER)
// silence warnings on casts in branches that are not taken.
#pragma warning(push)
#pragma warning(disable : 4311)
#pragma warning(disable : 4312)
T val;
T* pv = &val;
switch (sizeof(T))
{
case 1:
*(unsigned __int8* )pv = __ldar8 ((unsigned __int8 volatile*)pt);
break;
case 2:
*(unsigned __int16*)pv = __ldar16((unsigned __int16 volatile*)pt);
break;
case 4:
*(unsigned __int32*)pv = __ldar32((unsigned __int32 volatile*)pt);
break;
case 8:
*(unsigned __int64*)pv = __ldar64((unsigned __int64 volatile*)pt);
break;
default:
val = *(T volatile const*)pt;
__dmb(_ARM64_BARRIER_ISHLD);
}
#pragma warning(pop)
#else
T val = *(T volatile const *)pt;
VOLATILE_MEMORY_BARRIER();
#endif
#else
T val = *pt;
#endif
return val;
}
template<typename T>
inline
T VolatileLoadWithoutBarrier(T const * pt)
{
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
#ifndef DACCESS_COMPILE
T val = *(T volatile const *)pt;
#else
T val = *pt;
#endif
return val;
}
template <typename T> class Volatile;
template<typename T>
inline
T VolatileLoad(Volatile<T> const * pt)
{
STATIC_CONTRACT_SUPPORTS_DAC;
return pt->Load();
}
//
// VolatileStore stores a T into the target of a pointer to T. Is is guaranteed that this store will
// not be optimized away by the compiler, and that any operation that occurs before this store, in program
// order, will not be moved after this store. In general, it is not guaranteed that the store will be
// atomic, though this is the case for most aligned scalar data types. If you need atomic loads or stores,
// you need to consult the compiler and CPU manuals to find which circumstances allow atomicity.
//
template<typename T>
inline
void VolatileStore(T* pt, T val)
{
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
#ifndef DACCESS_COMPILE
#if defined(HOST_ARM64) && defined(__GNUC__)
static const unsigned lockFreeAtomicSizeMask = (1 << 1) | (1 << 2) | (1 << 4) | (1 << 8);
if((1 << sizeof(T)) & lockFreeAtomicSizeMask)
{
__atomic_store((T volatile *)pt, &val, __ATOMIC_RELEASE);
}
else
{
VOLATILE_MEMORY_BARRIER();
*(T volatile *)pt = val;
}
#elif defined(HOST_ARM64) && defined(_MSC_VER)
// silence warnings on casts in branches that are not taken.
#pragma warning(push)
#pragma warning(disable : 4311)
#pragma warning(disable : 4312)
T* pv = &val;
switch (sizeof(T))
{
case 1:
__stlr8 ((unsigned __int8 volatile*)pt, *(unsigned __int8* )pv);
break;
case 2:
__stlr16((unsigned __int16 volatile*)pt, *(unsigned __int16*)pv);
break;
case 4:
__stlr32((unsigned __int32 volatile*)pt, *(unsigned __int32*)pv);
break;
case 8:
__stlr64((unsigned __int64 volatile*)pt, *(unsigned __int64*)pv);
break;
default:
__dmb(_ARM64_BARRIER_ISH);
*(T volatile *)pt = val;
}
#pragma warning(pop)
#else
VOLATILE_MEMORY_BARRIER();
*(T volatile *)pt = val;
#endif
#else
*pt = val;
#endif
}
template<typename T>
inline
void VolatileStoreWithoutBarrier(T* pt, T val)
{
STATIC_CONTRACT_SUPPORTS_DAC_HOST_ONLY;
#ifndef DACCESS_COMPILE
*(T volatile *)pt = val;
#else
*pt = val;
#endif
}
//
// Memory ordering barrier that waits for loads in progress to complete.
// Any effects of loads or stores that appear after, in program order, will "happen after" relative to this.
// Other operations such as computation or instruction prefetch are not affected.
//
// Architectural mapping:
// arm64 : dmb ishld
// arm : dmb ish
// x86/64 : compiler fence
inline
void VolatileLoadBarrier()
{
#if defined(HOST_ARM64) && defined(__GNUC__)
asm volatile ("dmb ishld" : : : "memory");
#elif defined(HOST_ARM64) && defined(_MSC_VER)
__dmb(_ARM64_BARRIER_ISHLD);
#else
VOLATILE_MEMORY_BARRIER();
#endif
}
//
// Volatile<T> implements accesses with our volatile semantics over a variable of type T.
// Wherever you would have used a "volatile Foo" or, equivalently, "Foo volatile", use Volatile<Foo>
// instead. If Foo is a pointer type, use VolatilePtr.
//
// Note that there are still some things that don't work with a Volatile<T>,
// that would have worked with a "volatile T". For example, you can't cast a Volatile<int> to a float.
// You must instead cast to an int, then to a float. Or you can call Load on the Volatile<int>, and
// cast the result to a float. In general, calling Load or Store explicitly will work around
// any problems that can't be solved by operator overloading.
//
// @TODO: it's not clear that we actually *want* any operator overloading here. It's in here primarily
// to ease the task of converting all of the old uses of the volatile keyword, but in the long
// run it's probably better if users of this class are forced to call Load() and Store() explicitly.
// This would make it much more clear where the memory barriers are, and which operations are actually
// being performed, but it will have to wait for another cleanup effort.
//
template <typename T>
class Volatile
{
private:
//
// The data which we are treating as volatile
//
T m_val;
public:
//
// Default constructor. Results in an unitialized value!
//
inline Volatile()
{
STATIC_CONTRACT_SUPPORTS_DAC;
}
//
// Allow initialization of Volatile<T> from a T
//
inline Volatile(const T& val)
{
STATIC_CONTRACT_SUPPORTS_DAC;
((volatile T &)m_val) = val;
}
//
// Copy constructor
//
inline Volatile(const Volatile<T>& other)
{
STATIC_CONTRACT_SUPPORTS_DAC;
((volatile T &)m_val) = other.Load();
}
//
// Loads the value of the volatile variable. See code:VolatileLoad for the semantics of this operation.
//
inline T Load() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return VolatileLoad(&m_val);
}
//
// Loads the value of the volatile variable atomically without erecting the memory barrier.
//
inline T LoadWithoutBarrier() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return ((volatile T &)m_val);
}
//
// Stores a new value to the volatile variable. See code:VolatileStore for the semantics of this
// operation.
//
inline void Store(const T& val)
{
STATIC_CONTRACT_SUPPORTS_DAC;
VolatileStore(&m_val, val);
}
//
// Stores a new value to the volatile variable atomically without erecting the memory barrier.
//
inline void StoreWithoutBarrier(const T& val) const
{
STATIC_CONTRACT_SUPPORTS_DAC;
((volatile T &)m_val) = val;
}
//
// Gets a pointer to the volatile variable. This is dangerous, as it permits the variable to be
// accessed without using Load and Store, but it is necessary for passing Volatile<T> to APIs like
// InterlockedIncrement.
//
inline volatile T* GetPointer() { return (volatile T*)&m_val; }
//
// Gets the raw value of the variable. This is dangerous, as it permits the variable to be
// accessed without using Load and Store
//
inline T& RawValue() { return m_val; }
//
// Allow casts from Volatile<T> to T. Note that this allows implicit casts, so you can
// pass a Volatile<T> directly to a method that expects a T.
//
inline operator T() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return this->Load();
}
//
// Assignment from T
//
inline Volatile<T>& operator=(T val) {Store(val); return *this;}
//
// Get the address of the volatile variable. This is dangerous, as it allows the value of the
// volatile variable to be accessed directly, without going through Load and Store, but it is
// necessary for passing Volatile<T> to APIs like InterlockedIncrement. Note that we are returning
// a pointer to a volatile T here, so we cannot accidentally pass this pointer to an API that
// expects a normal pointer.
//
inline T volatile * operator&() {return this->GetPointer();}
inline T volatile const * operator&() const {return this->GetPointer();}
//
// Comparison operators
//
template<typename TOther>
inline bool operator==(const TOther& other) const {return this->Load() == other;}
template<typename TOther>
inline bool operator!=(const TOther& other) const {return this->Load() != other;}
//
// Miscellaneous operators. Add more as necessary.
//
inline Volatile<T>& operator+=(T val) {Store(this->Load() + val); return *this;}
inline Volatile<T>& operator-=(T val) {Store(this->Load() - val); return *this;}
inline Volatile<T>& operator|=(T val) {Store(this->Load() | val); return *this;}
inline Volatile<T>& operator&=(T val) {Store(this->Load() & val); return *this;}
inline bool operator!() const { STATIC_CONTRACT_SUPPORTS_DAC; return !this->Load();}
//
// Prefix increment
//
inline Volatile& operator++() {this->Store(this->Load()+1); return *this;}
//
// Postfix increment
//
inline T operator++(int) {T val = this->Load(); this->Store(val+1); return val;}
//
// Prefix decrement
//
inline Volatile& operator--() {this->Store(this->Load()-1); return *this;}
//
// Postfix decrement
//
inline T operator--(int) {T val = this->Load(); this->Store(val-1); return val;}
};
//
// A VolatilePtr builds on Volatile<T> by adding operators appropriate to pointers.
// Wherever you would have used "Foo * volatile", use "VolatilePtr<Foo>" instead.
//
// VolatilePtr also allows the substution of other types for the underlying pointer. This
// allows you to wrap a VolatilePtr around a custom type that looks like a pointer. For example,
// if what you want is a "volatile DPTR<Foo>", use "VolatilePtr<Foo, DPTR<Foo>>".
//
template <typename T, typename P = T*>
class VolatilePtr : public Volatile<P>
{
public:
//
// Default constructor. Results in an uninitialized pointer!
//
inline VolatilePtr()
{
STATIC_CONTRACT_SUPPORTS_DAC;
}
//
// Allow assignment from the pointer type.
//
inline VolatilePtr(P val) : Volatile<P>(val)
{
STATIC_CONTRACT_SUPPORTS_DAC;
}
//
// Copy constructor
//
inline VolatilePtr(const VolatilePtr& other) : Volatile<P>(other)
{
STATIC_CONTRACT_SUPPORTS_DAC;
}
//
// Cast to the pointer type
//
inline operator P() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return (P)this->Load();
}
//
// Member access
//
inline P operator->() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return (P)this->Load();
}
//
// Dereference the pointer
//
inline T& operator*() const
{
STATIC_CONTRACT_SUPPORTS_DAC;
return *(P)this->Load();
}
//
// Access the pointer as an array
//
template <typename TIndex>
inline T& operator[](TIndex index)
{
STATIC_CONTRACT_SUPPORTS_DAC;
return ((P)this->Load())[index];
}
};
//
// From here on out, we ban the use of the "volatile" keyword. If you found this while trying to define
// a volatile variable, go to the top of this file and start reading.
//
#ifdef volatile
#undef volatile
#endif
// ***** Temporarily removing this to unblock integration with new VC++ bits
//#define volatile (DoNotUseVolatileKeyword) volatile
// The substitution for volatile above is defined in such a way that we can still explicitly access the
// volatile keyword without error using the macros below. Use with care.
//#define REMOVE_DONOTUSE_ERROR(x)
//#define RAW_KEYWORD(x) REMOVE_DONOTUSE_ERROR x
#define RAW_KEYWORD(x) x
#ifdef DACCESS_COMPILE
// No need to use volatile in DAC builds - DAC is single-threaded and the target
// process is suspended.
#define VOLATILE(T) T
#else
// Disable use of Volatile<T> for GC/HandleTable code except on platforms where it's absolutely necessary.
#if defined(_MSC_VER) && !defined(HOST_ARM) && !defined(HOST_ARM64)
#define VOLATILE(T) T RAW_KEYWORD(volatile)
#else
#define VOLATILE(T) Volatile<T>
#endif
#endif // DACCESS_COMPILE
// VolatilePtr-specific clr::SafeAddRef and clr::SafeRelease
namespace clr
{
template < typename ItfT, typename PtrT > inline
#ifdef __checkReturn // Volatile.h is used in corunix headers, which don't define/nullify SAL.
__checkReturn
#endif
VolatilePtr<ItfT, PtrT>&
SafeAddRef(VolatilePtr<ItfT, PtrT>& pItf)
{
STATIC_CONTRACT_LIMITED_METHOD;
SafeAddRef(pItf.Load());
return pItf;
}
template < typename ItfT, typename PtrT > inline
ULONG
SafeRelease(VolatilePtr<ItfT, PtrT>& pItf)
{
STATIC_CONTRACT_LIMITED_METHOD;
return SafeRelease(pItf.Load());
}
}
#endif //_VOLATILE_H_
| 1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/jit/vartype.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*****************************************************************************/
#ifndef _VARTYPE_H_
#define _VARTYPE_H_
/*****************************************************************************/
#include "error.h"
enum var_types_classification
{
VTF_ANY = 0x0000,
VTF_INT = 0x0001,
VTF_UNS = 0x0002, // type is unsigned
VTF_FLT = 0x0004,
VTF_GCR = 0x0008, // type is GC ref
VTF_BYR = 0x0010, // type is Byref
VTF_I = 0x0020, // is machine sized
VTF_S = 0x0040, // is a struct type
};
#include "vartypesdef.h"
/*****************************************************************************
* C-style pointers are implemented as TYP_INT or TYP_LONG depending on the
* platform
*/
#ifdef TARGET_64BIT
#define TYP_I_IMPL TYP_LONG
#define TYP_U_IMPL TYP_ULONG
#else
#define TYP_I_IMPL TYP_INT
#define TYP_U_IMPL TYP_UINT
#ifdef _PREFAST_
// We silence this in the 32-bit build because for portability, we like to have asserts like this:
// assert(op2->gtType == TYP_INT || op2->gtType == TYP_I_IMPL);
// This is obviously redundant for 32-bit builds, but we don't want to have ifdefs and different
// asserts just for 64-bit builds, so for now just silence the assert
#pragma warning(disable : 6287) // warning 6287: the left and right sub-expressions are identical
#endif //_PREFAST_
#endif
/*****************************************************************************/
const extern BYTE varTypeClassification[TYP_COUNT];
// make any class with a TypeGet member also have a function TypeGet() that does the same thing
template <class T>
inline var_types TypeGet(T* t)
{
return t->TypeGet();
}
// make a TypeGet function which is the identity function for var_types
// the point of this and the preceding template is now you can make template functions
// that work on var_types as well as any object that exposes a TypeGet method.
// such as all of these varTypeIs* functions
inline var_types TypeGet(var_types v)
{
return v;
}
#ifdef FEATURE_SIMD
template <class T>
inline bool varTypeIsSIMD(T vt)
{
switch (TypeGet(vt))
{
case TYP_SIMD8:
case TYP_SIMD12:
case TYP_SIMD16:
case TYP_SIMD32:
return true;
default:
return false;
}
}
#else // FEATURE_SIMD
// Always return false if FEATURE_SIMD is not enabled
template <class T>
inline bool varTypeIsSIMD(T vt)
{
return false;
}
#endif // !FEATURE_SIMD
template <class T>
inline bool varTypeIsIntegral(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_INT)) != 0);
}
template <class T>
inline bool varTypeIsIntegralOrI(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_INT | VTF_I)) != 0);
}
template <class T>
inline bool varTypeIsUnsigned(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_UNS)) != 0);
}
template <class T>
inline bool varTypeIsSigned(T vt)
{
return varTypeIsIntegralOrI(vt) && !varTypeIsUnsigned(vt);
}
// If "vt" represents an unsigned integral type, returns the corresponding signed integral type,
// otherwise returns the original type.
template <class T>
inline var_types varTypeToSigned(T vt)
{
var_types type = TypeGet(vt);
if (varTypeIsUnsigned(type))
{
switch (type)
{
case TYP_BOOL:
case TYP_UBYTE:
return TYP_BYTE;
case TYP_USHORT:
return TYP_SHORT;
case TYP_UINT:
return TYP_INT;
case TYP_ULONG:
return TYP_LONG;
default:
unreached();
}
}
return type;
}
// If "vt" represents a signed integral type, returns the corresponding unsigned integral type,
// otherwise returns the original type.
template <class T>
inline var_types varTypeToUnsigned(T vt)
{
// Force signed types into corresponding unsigned type.
var_types type = TypeGet(vt);
switch (type)
{
case TYP_BYTE:
return TYP_UBYTE;
case TYP_SHORT:
return TYP_USHORT;
case TYP_INT:
return TYP_UINT;
case TYP_LONG:
return TYP_ULONG;
default:
return type;
}
}
template <class T>
inline bool varTypeIsFloating(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_FLT)) != 0);
}
template <class T>
inline bool varTypeIsArithmetic(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_INT | VTF_FLT)) != 0);
}
template <class T>
inline unsigned varTypeGCtype(T vt)
{
return (unsigned)(varTypeClassification[TypeGet(vt)] & (VTF_GCR | VTF_BYR));
}
template <class T>
inline bool varTypeIsGC(T vt)
{
return (varTypeGCtype(vt) != 0);
}
template <class T>
inline bool varTypeIsI(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & VTF_I) != 0);
}
template <class T>
inline bool varTypeIsEnregisterable(T vt)
{
return (TypeGet(vt) != TYP_STRUCT);
}
template <class T>
inline bool varTypeIsByte(T vt)
{
return (TypeGet(vt) >= TYP_BOOL) && (TypeGet(vt) <= TYP_UBYTE);
}
template <class T>
inline bool varTypeIsShort(T vt)
{
return (TypeGet(vt) == TYP_SHORT) || (TypeGet(vt) == TYP_USHORT);
}
template <class T>
inline bool varTypeIsSmall(T vt)
{
return (TypeGet(vt) >= TYP_BOOL) && (TypeGet(vt) <= TYP_USHORT);
}
template <class T>
inline bool varTypeIsSmallInt(T vt)
{
return (TypeGet(vt) >= TYP_BYTE) && (TypeGet(vt) <= TYP_USHORT);
}
template <class T>
inline bool varTypeIsIntOrI(T vt)
{
return ((TypeGet(vt) == TYP_INT)
#ifdef TARGET_64BIT
|| (TypeGet(vt) == TYP_I_IMPL)
#endif // TARGET_64BIT
);
}
template <class T>
inline bool genActualTypeIsInt(T vt)
{
return ((TypeGet(vt) >= TYP_BOOL) && (TypeGet(vt) <= TYP_UINT));
}
template <class T>
inline bool genActualTypeIsIntOrI(T vt)
{
return ((TypeGet(vt) >= TYP_BOOL) && (TypeGet(vt) <= TYP_U_IMPL));
}
template <class T>
inline bool varTypeIsLong(T vt)
{
return (TypeGet(vt) >= TYP_LONG) && (TypeGet(vt) <= TYP_ULONG);
}
template <class T>
inline bool varTypeIsInt(T vt)
{
return (TypeGet(vt) >= TYP_INT) && (TypeGet(vt) <= TYP_UINT);
}
template <class T>
inline bool varTypeIsMultiReg(T vt)
{
#ifdef TARGET_64BIT
return false;
#else
return (TypeGet(vt) == TYP_LONG);
#endif
}
template <class T>
inline bool varTypeIsSingleReg(T vt)
{
return !varTypeIsMultiReg(vt);
}
template <class T>
inline bool varTypeIsComposite(T vt)
{
return (!varTypeIsArithmetic(TypeGet(vt)) && TypeGet(vt) != TYP_VOID);
}
// Is this type promotable?
// In general only structs are promotable.
// However, a SIMD type, e.g. TYP_SIMD may be handled as either a struct, OR a
// fully-promoted register type.
// On 32-bit systems longs are split into an upper and lower half, and they are
// handled as if they are structs with two integer fields.
template <class T>
inline bool varTypeIsPromotable(T vt)
{
return (varTypeIsStruct(vt) || (TypeGet(vt) == TYP_BLK)
#if !defined(TARGET_64BIT)
|| varTypeIsLong(vt)
#endif // !defined(TARGET_64BIT)
);
}
template <class T>
inline bool varTypeIsStruct(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & VTF_S) != 0);
}
template <class T>
inline bool varTypeUsesFloatReg(T vt)
{
// Note that not all targets support SIMD, but if they don't, varTypeIsSIMD will
// always return false.
return varTypeIsFloating(vt) || varTypeIsSIMD(vt);
}
template <class T>
inline bool varTypeUsesFloatArgReg(T vt)
{
#ifdef TARGET_ARM64
// Arm64 passes SIMD types in floating point registers.
return varTypeUsesFloatReg(vt);
#else
// Other targets pass them as regular structs - by reference or by value.
return varTypeIsFloating(vt);
#endif
}
//------------------------------------------------------------------------
// varTypeIsValidHfaType: Determine if the type is a valid HFA type
//
// Arguments:
// vt - the type of interest
//
// Return Value:
// Returns true iff the type is a valid HFA type.
//
// Notes:
// This should only be called with the return value from GetHfaType().
// The only valid values are TYP_UNDEF, for which this returns false,
// TYP_FLOAT, TYP_DOUBLE, or (ARM64-only) TYP_SIMD*.
//
template <class T>
inline bool varTypeIsValidHfaType(T vt)
{
if (GlobalJitOptions::compFeatureHfa)
{
bool isValid = (TypeGet(vt) != TYP_UNDEF);
if (isValid)
{
#ifdef TARGET_ARM64
assert(varTypeUsesFloatReg(vt));
#else // !TARGET_ARM64
assert(varTypeIsFloating(vt));
#endif // !TARGET_ARM64
}
return isValid;
}
else
{
return false;
}
}
/*****************************************************************************/
#endif // _VARTYPE_H_
/*****************************************************************************/
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*****************************************************************************/
#ifndef _VARTYPE_H_
#define _VARTYPE_H_
/*****************************************************************************/
#include "error.h"
enum var_types_classification
{
VTF_ANY = 0x0000,
VTF_INT = 0x0001,
VTF_UNS = 0x0002, // type is unsigned
VTF_FLT = 0x0004,
VTF_GCR = 0x0008, // type is GC ref
VTF_BYR = 0x0010, // type is Byref
VTF_I = 0x0020, // is machine sized
VTF_S = 0x0040, // is a struct type
};
#include "vartypesdef.h"
/*****************************************************************************
* C-style pointers are implemented as TYP_INT or TYP_LONG depending on the
* platform
*/
#ifdef TARGET_64BIT
#define TYP_I_IMPL TYP_LONG
#define TYP_U_IMPL TYP_ULONG
#else
#define TYP_I_IMPL TYP_INT
#define TYP_U_IMPL TYP_UINT
#ifdef _PREFAST_
// We silence this in the 32-bit build because for portability, we like to have asserts like this:
// assert(op2->gtType == TYP_INT || op2->gtType == TYP_I_IMPL);
// This is obviously redundant for 32-bit builds, but we don't want to have ifdefs and different
// asserts just for 64-bit builds, so for now just silence the assert
#pragma warning(disable : 6287) // warning 6287: the left and right sub-expressions are identical
#endif //_PREFAST_
#endif
/*****************************************************************************/
const extern BYTE varTypeClassification[TYP_COUNT];
// make any class with a TypeGet member also have a function TypeGet() that does the same thing
template <class T>
inline var_types TypeGet(T* t)
{
return t->TypeGet();
}
// make a TypeGet function which is the identity function for var_types
// the point of this and the preceding template is now you can make template functions
// that work on var_types as well as any object that exposes a TypeGet method.
// such as all of these varTypeIs* functions
inline var_types TypeGet(var_types v)
{
return v;
}
#ifdef FEATURE_SIMD
template <class T>
inline bool varTypeIsSIMD(T vt)
{
switch (TypeGet(vt))
{
case TYP_SIMD8:
case TYP_SIMD12:
case TYP_SIMD16:
case TYP_SIMD32:
return true;
default:
return false;
}
}
#else // FEATURE_SIMD
// Always return false if FEATURE_SIMD is not enabled
template <class T>
inline bool varTypeIsSIMD(T vt)
{
return false;
}
#endif // !FEATURE_SIMD
template <class T>
inline bool varTypeIsIntegral(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_INT)) != 0);
}
template <class T>
inline bool varTypeIsIntegralOrI(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_INT | VTF_I)) != 0);
}
template <class T>
inline bool varTypeIsUnsigned(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_UNS)) != 0);
}
template <class T>
inline bool varTypeIsSigned(T vt)
{
return varTypeIsIntegralOrI(vt) && !varTypeIsUnsigned(vt);
}
// If "vt" represents an unsigned integral type, returns the corresponding signed integral type,
// otherwise returns the original type.
template <class T>
inline var_types varTypeToSigned(T vt)
{
var_types type = TypeGet(vt);
if (varTypeIsUnsigned(type))
{
switch (type)
{
case TYP_BOOL:
case TYP_UBYTE:
return TYP_BYTE;
case TYP_USHORT:
return TYP_SHORT;
case TYP_UINT:
return TYP_INT;
case TYP_ULONG:
return TYP_LONG;
default:
unreached();
}
}
return type;
}
// If "vt" represents a signed integral type, returns the corresponding unsigned integral type,
// otherwise returns the original type.
template <class T>
inline var_types varTypeToUnsigned(T vt)
{
// Force signed types into corresponding unsigned type.
var_types type = TypeGet(vt);
switch (type)
{
case TYP_BYTE:
return TYP_UBYTE;
case TYP_SHORT:
return TYP_USHORT;
case TYP_INT:
return TYP_UINT;
case TYP_LONG:
return TYP_ULONG;
default:
return type;
}
}
template <class T>
inline bool varTypeIsFloating(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_FLT)) != 0);
}
template <class T>
inline bool varTypeIsArithmetic(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & (VTF_INT | VTF_FLT)) != 0);
}
template <class T>
inline unsigned varTypeGCtype(T vt)
{
return (unsigned)(varTypeClassification[TypeGet(vt)] & (VTF_GCR | VTF_BYR));
}
template <class T>
inline bool varTypeIsGC(T vt)
{
return (varTypeGCtype(vt) != 0);
}
template <class T>
inline bool varTypeIsI(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & VTF_I) != 0);
}
template <class T>
inline bool varTypeIsEnregisterable(T vt)
{
return (TypeGet(vt) != TYP_STRUCT);
}
template <class T>
inline bool varTypeIsByte(T vt)
{
return (TypeGet(vt) >= TYP_BOOL) && (TypeGet(vt) <= TYP_UBYTE);
}
template <class T>
inline bool varTypeIsShort(T vt)
{
return (TypeGet(vt) == TYP_SHORT) || (TypeGet(vt) == TYP_USHORT);
}
template <class T>
inline bool varTypeIsSmall(T vt)
{
return (TypeGet(vt) >= TYP_BOOL) && (TypeGet(vt) <= TYP_USHORT);
}
template <class T>
inline bool varTypeIsSmallInt(T vt)
{
return (TypeGet(vt) >= TYP_BYTE) && (TypeGet(vt) <= TYP_USHORT);
}
template <class T>
inline bool varTypeIsIntOrI(T vt)
{
return ((TypeGet(vt) == TYP_INT)
#ifdef TARGET_64BIT
|| (TypeGet(vt) == TYP_I_IMPL)
#endif // TARGET_64BIT
);
}
template <class T>
inline bool genActualTypeIsInt(T vt)
{
return ((TypeGet(vt) >= TYP_BOOL) && (TypeGet(vt) <= TYP_UINT));
}
template <class T>
inline bool genActualTypeIsIntOrI(T vt)
{
return ((TypeGet(vt) >= TYP_BOOL) && (TypeGet(vt) <= TYP_U_IMPL));
}
template <class T>
inline bool varTypeIsLong(T vt)
{
return (TypeGet(vt) >= TYP_LONG) && (TypeGet(vt) <= TYP_ULONG);
}
template <class T>
inline bool varTypeIsInt(T vt)
{
return (TypeGet(vt) >= TYP_INT) && (TypeGet(vt) <= TYP_UINT);
}
template <class T>
inline bool varTypeIsMultiReg(T vt)
{
#ifdef TARGET_64BIT
return false;
#else
return (TypeGet(vt) == TYP_LONG);
#endif
}
template <class T>
inline bool varTypeIsSingleReg(T vt)
{
return !varTypeIsMultiReg(vt);
}
template <class T>
inline bool varTypeIsComposite(T vt)
{
return (!varTypeIsArithmetic(TypeGet(vt)) && TypeGet(vt) != TYP_VOID);
}
// Is this type promotable?
// In general only structs are promotable.
// However, a SIMD type, e.g. TYP_SIMD may be handled as either a struct, OR a
// fully-promoted register type.
// On 32-bit systems longs are split into an upper and lower half, and they are
// handled as if they are structs with two integer fields.
template <class T>
inline bool varTypeIsPromotable(T vt)
{
return (varTypeIsStruct(vt) || (TypeGet(vt) == TYP_BLK)
#if !defined(TARGET_64BIT)
|| varTypeIsLong(vt)
#endif // !defined(TARGET_64BIT)
);
}
template <class T>
inline bool varTypeIsStruct(T vt)
{
return ((varTypeClassification[TypeGet(vt)] & VTF_S) != 0);
}
template <class T>
inline bool varTypeUsesFloatReg(T vt)
{
// Note that not all targets support SIMD, but if they don't, varTypeIsSIMD will
// always return false.
return varTypeIsFloating(vt) || varTypeIsSIMD(vt);
}
template <class T>
inline bool varTypeUsesFloatArgReg(T vt)
{
#ifdef TARGET_ARM64
// Arm64 passes SIMD types in floating point registers.
return varTypeUsesFloatReg(vt);
#else
// Other targets pass them as regular structs - by reference or by value.
return varTypeIsFloating(vt);
#endif
}
//------------------------------------------------------------------------
// varTypeIsValidHfaType: Determine if the type is a valid HFA type
//
// Arguments:
// vt - the type of interest
//
// Return Value:
// Returns true iff the type is a valid HFA type.
//
// Notes:
// This should only be called with the return value from GetHfaType().
// The only valid values are TYP_UNDEF, for which this returns false,
// TYP_FLOAT, TYP_DOUBLE, or (ARM64-only) TYP_SIMD*.
//
template <class T>
inline bool varTypeIsValidHfaType(T vt)
{
if (GlobalJitOptions::compFeatureHfa)
{
bool isValid = (TypeGet(vt) != TYP_UNDEF);
if (isValid)
{
#ifdef TARGET_ARM64
assert(varTypeUsesFloatReg(vt));
#else // !TARGET_ARM64
assert(varTypeIsFloating(vt));
#endif // !TARGET_ARM64
}
return isValid;
}
else
{
return false;
}
}
/*****************************************************************************/
#endif // _VARTYPE_H_
/*****************************************************************************/
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/pal/src/libunwind/include/unwind.h
|
/* libunwind - a platform-independent unwind library
Copyright (C) 2003 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _UNWIND_H
#define _UNWIND_H
/* For uint64_t */
#include <stdint.h>
#include <stdalign.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Minimal interface as per C++ ABI draft standard:
http://www.codesourcery.com/cxx-abi/abi-eh.html */
typedef enum
{
_URC_NO_REASON = 0,
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
_URC_FATAL_PHASE2_ERROR = 2,
_URC_FATAL_PHASE1_ERROR = 3,
_URC_NORMAL_STOP = 4,
_URC_END_OF_STACK = 5,
_URC_HANDLER_FOUND = 6,
_URC_INSTALL_CONTEXT = 7,
_URC_CONTINUE_UNWIND = 8
}
_Unwind_Reason_Code;
typedef int _Unwind_Action;
#define _UA_SEARCH_PHASE 1
#define _UA_CLEANUP_PHASE 2
#define _UA_HANDLER_FRAME 4
#define _UA_FORCE_UNWIND 8
struct _Unwind_Context; /* opaque data-structure */
struct _Unwind_Exception; /* forward-declaration */
typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
struct _Unwind_Exception *);
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
uint64_t,
struct _Unwind_Exception *,
struct _Unwind_Context *,
void *);
/* The C++ ABI requires exception_class, private_1, and private_2 to
be of type uint64 and the entire structure to be
double-word-aligned. Please note that exception_class stays 64-bit
even on 32-bit machines for gcc compatibility. */
struct _Unwind_Exception
{
alignas(8) uint64_t exception_class;
_Unwind_Exception_Cleanup_Fn exception_cleanup;
unsigned long private_1;
unsigned long private_2;
};
extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
_Unwind_Stop_Fn, void *);
extern void _Unwind_Resume (struct _Unwind_Exception *);
extern void _Unwind_DeleteException (struct _Unwind_Exception *);
extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);
#ifdef _GNU_SOURCE
/* Callback for _Unwind_Backtrace(). The backtrace stops immediately
if the callback returns any value other than _URC_NO_REASON. */
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
void *);
/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why
_UA_END_OF_STACK exists. */
# define _UA_END_OF_STACK 16
/* If the unwind was initiated due to a forced unwind, resume that
operation, else re-raise the exception. This is used by
__cxa_rethrow(). */
extern _Unwind_Reason_Code
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why
_Unwind_GetBSP() exists. */
extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);
/* Return the "canonical frame address" for the given context.
This is used by NPTL... */
extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);
/* Return the base-address for data references. */
extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);
/* Return the base-address for text references. */
extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);
/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any
cleanup. The first frame for which the callback is invoked is the
one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace()
returns _URC_END_OF_STACK when the backtrace stopped due to
reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it
stops for any other reason. */
extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
/* Find the start-address of the procedure containing the specified IP
or NULL if it cannot be found (e.g., because the function has no
unwind info). Note: there is not necessarily a one-to-one
correspondence between source-level functions and procedures: some
functions don't have unwind-info and others are split into multiple
procedures. */
extern void *_Unwind_FindEnclosingFunction (void *);
/* See also Linux Standard Base Spec:
http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */
#endif /* _GNU_SOURCE */
#ifdef __cplusplus
};
#endif
#endif /* _UNWIND_H */
|
/* libunwind - a platform-independent unwind library
Copyright (C) 2003 Hewlett-Packard Co
Contributed by David Mosberger-Tang <[email protected]>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _UNWIND_H
#define _UNWIND_H
/* For uint64_t */
#include <stdint.h>
#include <stdalign.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Minimal interface as per C++ ABI draft standard:
http://www.codesourcery.com/cxx-abi/abi-eh.html */
typedef enum
{
_URC_NO_REASON = 0,
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
_URC_FATAL_PHASE2_ERROR = 2,
_URC_FATAL_PHASE1_ERROR = 3,
_URC_NORMAL_STOP = 4,
_URC_END_OF_STACK = 5,
_URC_HANDLER_FOUND = 6,
_URC_INSTALL_CONTEXT = 7,
_URC_CONTINUE_UNWIND = 8
}
_Unwind_Reason_Code;
typedef int _Unwind_Action;
#define _UA_SEARCH_PHASE 1
#define _UA_CLEANUP_PHASE 2
#define _UA_HANDLER_FRAME 4
#define _UA_FORCE_UNWIND 8
struct _Unwind_Context; /* opaque data-structure */
struct _Unwind_Exception; /* forward-declaration */
typedef void (*_Unwind_Exception_Cleanup_Fn) (_Unwind_Reason_Code,
struct _Unwind_Exception *);
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn) (int, _Unwind_Action,
uint64_t,
struct _Unwind_Exception *,
struct _Unwind_Context *,
void *);
/* The C++ ABI requires exception_class, private_1, and private_2 to
be of type uint64 and the entire structure to be
double-word-aligned. Please note that exception_class stays 64-bit
even on 32-bit machines for gcc compatibility. */
struct _Unwind_Exception
{
alignas(8) uint64_t exception_class;
_Unwind_Exception_Cleanup_Fn exception_cleanup;
unsigned long private_1;
unsigned long private_2;
};
extern _Unwind_Reason_Code _Unwind_RaiseException (struct _Unwind_Exception *);
extern _Unwind_Reason_Code _Unwind_ForcedUnwind (struct _Unwind_Exception *,
_Unwind_Stop_Fn, void *);
extern void _Unwind_Resume (struct _Unwind_Exception *);
extern void _Unwind_DeleteException (struct _Unwind_Exception *);
extern unsigned long _Unwind_GetGR (struct _Unwind_Context *, int);
extern void _Unwind_SetGR (struct _Unwind_Context *, int, unsigned long);
extern unsigned long _Unwind_GetIP (struct _Unwind_Context *);
extern unsigned long _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
extern void _Unwind_SetIP (struct _Unwind_Context *, unsigned long);
extern unsigned long _Unwind_GetLanguageSpecificData (struct _Unwind_Context*);
extern unsigned long _Unwind_GetRegionStart (struct _Unwind_Context *);
#ifdef _GNU_SOURCE
/* Callback for _Unwind_Backtrace(). The backtrace stops immediately
if the callback returns any value other than _URC_NO_REASON. */
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (struct _Unwind_Context *,
void *);
/* See http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00082.html for why
_UA_END_OF_STACK exists. */
# define _UA_END_OF_STACK 16
/* If the unwind was initiated due to a forced unwind, resume that
operation, else re-raise the exception. This is used by
__cxa_rethrow(). */
extern _Unwind_Reason_Code
_Unwind_Resume_or_Rethrow (struct _Unwind_Exception *);
/* See http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00154.html for why
_Unwind_GetBSP() exists. */
extern unsigned long _Unwind_GetBSP (struct _Unwind_Context *);
/* Return the "canonical frame address" for the given context.
This is used by NPTL... */
extern unsigned long _Unwind_GetCFA (struct _Unwind_Context *);
/* Return the base-address for data references. */
extern unsigned long _Unwind_GetDataRelBase (struct _Unwind_Context *);
/* Return the base-address for text references. */
extern unsigned long _Unwind_GetTextRelBase (struct _Unwind_Context *);
/* Call _Unwind_Trace_Fn once for each stack-frame, without doing any
cleanup. The first frame for which the callback is invoked is the
one for the caller of _Unwind_Backtrace(). _Unwind_Backtrace()
returns _URC_END_OF_STACK when the backtrace stopped due to
reaching the end of the call-chain or _URC_FATAL_PHASE1_ERROR if it
stops for any other reason. */
extern _Unwind_Reason_Code _Unwind_Backtrace (_Unwind_Trace_Fn, void *);
/* Find the start-address of the procedure containing the specified IP
or NULL if it cannot be found (e.g., because the function has no
unwind info). Note: there is not necessarily a one-to-one
correspondence between source-level functions and procedures: some
functions don't have unwind-info and others are split into multiple
procedures. */
extern void *_Unwind_FindEnclosingFunction (void *);
/* See also Linux Standard Base Spec:
http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/libgcc-s.html */
#endif /* _GNU_SOURCE */
#ifdef __cplusplus
};
#endif
#endif /* _UNWIND_H */
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/md/inc/mdinternalrw.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//*****************************************************************************
// MDInternalRW.h
//
//
// Contains utility code for MD directory
//
//*****************************************************************************
#ifndef __MDInternalRW__h__
#define __MDInternalRW__h__
#ifdef FEATURE_METADATA_INTERNAL_APIS
#include "../inc/mdlog.h"
class UTSemReadWrite;
class MDInternalRW : public IMDInternalImportENC, public IMDCommon
{
friend class VerifyLayoutsMD;
public:
MDInternalRW();
virtual ~MDInternalRW();
__checkReturn
HRESULT Init(LPVOID pData, ULONG cbData, int bReadOnly);
__checkReturn
HRESULT InitWithStgdb(IUnknown *pUnk, CLiteWeightStgdbRW *pStgdb);
__checkReturn
HRESULT InitWithRO(MDInternalRO *pRO, int bReadOnly);
// *** IUnknown methods ***
__checkReturn
STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
__checkReturn
STDMETHODIMP TranslateSigWithScope(
IMDInternalImport *pAssemImport, // [IN] import assembly scope.
const void *pbHashValue, // [IN] hash value for the import assembly.
ULONG cbHashValue, // [IN] count of bytes in the hash value.
PCCOR_SIGNATURE pbSigBlob, // [IN] signature in the importing scope
ULONG cbSigBlob, // [IN] count of bytes of signature
IMetaDataAssemblyEmit *pAssemEmit, // [IN] assembly emit scope.
IMetaDataEmit *emit, // [IN] emit interface
CQuickBytes *pqkSigEmit, // [OUT] buffer to hold translated signature
ULONG *pcbSig) // [OUT] count of bytes in the translated signature
DAC_UNEXPECTED();
__checkReturn
STDMETHODIMP GetTypeDefRefTokenInTypeSpec(// return S_FALSE if enclosing type does not have a token
mdTypeSpec tkTypeSpec, // [IN] TypeSpec token to look at
mdToken *tkEnclosedToken) // [OUT] The enclosed type token
DAC_UNEXPECTED();
STDMETHODIMP_(IMetaModelCommon*) GetMetaModelCommon()
{
return static_cast<IMetaModelCommon*>(&m_pStgdb->m_MiniMd);
}
STDMETHODIMP_(IMetaModelCommonRO*) GetMetaModelCommonRO()
{
if (m_pStgdb->m_MiniMd.IsWritable())
{
_ASSERTE(!"IMetaModelCommonRO methods cannot be used because this importer is writable.");
return NULL;
}
return static_cast<IMetaModelCommonRO*>(&m_pStgdb->m_MiniMd);
}
__checkReturn
STDMETHODIMP SetOptimizeAccessForSpeed(// return hresult
BOOL fOptSpeed)
{
// If there is any optional work we can avoid (for example, because we have
// traded space for speed) this is the place to turn it off or on.
return S_OK;
}
//*****************************************************************************
// return the count of entries of a given kind in a scope
// For example, pass in mdtMethodDef will tell you how many MethodDef
// contained in a scope
//*****************************************************************************
STDMETHODIMP_(ULONG) GetCountWithTokenKind(// return hresult
DWORD tkKind) // [IN] pass in the kind of token.
DAC_UNEXPECTED();
//*****************************************************************************
// enumerator for typedef
//*****************************************************************************
__checkReturn
STDMETHODIMP EnumTypeDefInit( // return hresult
HENUMInternal *phEnum); // [OUT] buffer to fill for enumerator data
//*****************************************************************************
// enumerator for MethodImpl
//*****************************************************************************
__checkReturn
STDMETHODIMP EnumMethodImplInit( // return hresult
mdTypeDef td, // [IN] TypeDef over which to scope the enumeration.
HENUMInternal *phEnumBody, // [OUT] buffer to fill for enumerator data for MethodBody tokens.
HENUMInternal *phEnumDecl) // [OUT] buffer to fill for enumerator data for MethodDecl tokens.
DAC_UNEXPECTED();
STDMETHODIMP_(ULONG) EnumMethodImplGetCount(
HENUMInternal *phEnumBody, // [IN] MethodBody enumerator.
HENUMInternal *phEnumDecl) // [IN] MethodDecl enumerator.
DAC_UNEXPECTED();
STDMETHODIMP_(void) EnumMethodImplReset(
HENUMInternal *phEnumBody, // [IN] MethodBody enumerator.
HENUMInternal *phEnumDecl) // [IN] MethodDecl enumerator.
DAC_UNEXPECTED();
__checkReturn
STDMETHODIMP EnumMethodImplNext( // return hresult (S_OK = TRUE, S_FALSE = FALSE or error code)
HENUMInternal *phEnumBody, // [IN] input enum for MethodBody
HENUMInternal *phEnumDecl, // [IN] input enum for MethodDecl
mdToken *ptkBody, // [OUT] return token for MethodBody
mdToken *ptkDecl) // [OUT] return token for MethodDecl
DAC_UNEXPECTED();
STDMETHODIMP_(void) EnumMethodImplClose(
HENUMInternal *phEnumBody, // [IN] MethodBody enumerator.
HENUMInternal *phEnumDecl) // [IN] MethodDecl enumerator.
DAC_UNEXPECTED();
//*****************************************
// Enumerator helpers for memberdef, memberref, interfaceimp,
// event, property, param, methodimpl
//*****************************************
__checkReturn
STDMETHODIMP EnumGlobalFunctionsInit( // return hresult
HENUMInternal *phEnum); // [OUT] buffer to fill for enumerator data
__checkReturn
STDMETHODIMP EnumGlobalFieldsInit( // return hresult
HENUMInternal *phEnum); // [OUT] buffer to fill for enumerator data
__checkReturn
STDMETHODIMP EnumInit( // return S_FALSE if record not found
DWORD tkKind, // [IN] which table to work on
mdToken tkParent, // [IN] token to scope the search
HENUMInternal *phEnum); // [OUT] the enumerator to fill
__checkReturn
STDMETHODIMP EnumAllInit( // return S_FALSE if record not found
DWORD tkKind, // [IN] which table to work on
HENUMInternal *phEnum); // [OUT] the enumerator to fill
__checkReturn
STDMETHODIMP EnumCustomAttributeByNameInit(// return S_FALSE if record not found
mdToken tkParent, // [IN] token to scope the search
LPCSTR szName, // [IN] CustomAttribute's name to scope the search
HENUMInternal *phEnum); // [OUT] the enumerator to fill
__checkReturn
STDMETHODIMP GetParentToken(
mdToken tkChild, // [IN] given child token
mdToken *ptkParent); // [OUT] returning parent
__checkReturn
STDMETHODIMP GetCustomAttributeProps(
mdCustomAttribute at, // The attribute.
mdToken *ptkType); // Put attribute type here.
__checkReturn
STDMETHODIMP GetCustomAttributeAsBlob(
mdCustomAttribute cv, // [IN] given custom attribute token
void const **ppBlob, // [OUT] return the pointer to internal blob
ULONG *pcbSize); // [OUT] return the size of the blob
__checkReturn
STDMETHODIMP GetCustomAttributeByName( // S_OK or error.
mdToken tkObj, // [IN] Object with Custom Attribute.
LPCUTF8 szName, // [IN] Name of desired Custom Attribute.
const void **ppData, // [OUT] Put pointer to data here.
ULONG *pcbData); // [OUT] Put size of data here.
__checkReturn
STDMETHODIMP GetNameOfCustomAttribute( // S_OK or error.
mdCustomAttribute mdAttribute, // [IN] The Custom Attribute
LPCUTF8 *pszNamespace, // [OUT] Namespace of Custom Attribute.
LPCUTF8 *pszName); // [OUT] Name of Custom Attribute.
// returned void in v1.0/v1.1
__checkReturn
STDMETHODIMP GetScopeProps(
LPCSTR *pszName, // [OUT] scope name
GUID *pmvid); // [OUT] version id
// finding a particular method
__checkReturn
STDMETHODIMP FindMethodDef(
mdTypeDef classdef, // [IN] given typedef
LPCSTR szName, // [IN] member name
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of COM+ signature
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
mdMethodDef *pmd); // [OUT] matching memberdef
// return a iSeq's param given a MethodDef
__checkReturn
STDMETHODIMP FindParamOfMethod( // S_OK or error.
mdMethodDef md, // [IN] The owning method of the param.
ULONG iSeq, // [IN} The sequence # of the param.
mdParamDef *pparamdef); // [OUT] Put ParamDef token here.
//*****************************************
//
// GetName* functions
//
//*****************************************
// return the name and namespace of typedef
__checkReturn
STDMETHODIMP GetNameOfTypeDef(
mdTypeDef classdef, // given classdef
LPCSTR *pszname, // return class name(unqualified)
LPCSTR *psznamespace); // return the name space name
__checkReturn
STDMETHODIMP GetIsDualOfTypeDef(
mdTypeDef classdef, // [IN] given classdef.
ULONG *pDual); // [OUT] return dual flag here.
__checkReturn
STDMETHODIMP GetIfaceTypeOfTypeDef(
mdTypeDef tkTypeDef,
ULONG * pIface); // [OUT] 0=dual, 1=vtable, 2=dispinterface
__checkReturn
STDMETHODIMP GetNameOfMethodDef(
mdMethodDef tkMethodDef,
LPCSTR * pszName);
__checkReturn
STDMETHODIMP GetNameAndSigOfMethodDef(
mdMethodDef methoddef, // [IN] given memberdef
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to a blob value of COM+ signature
ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob
LPCSTR *pszName);
// return the name of a FieldDef
__checkReturn
STDMETHODIMP GetNameOfFieldDef(
mdFieldDef fd, // given memberdef
LPCSTR *pszName);
// return the name of typeref
__checkReturn
STDMETHODIMP GetNameOfTypeRef(
mdTypeRef classref, // [IN] given typeref
LPCSTR *psznamespace, // [OUT] return typeref name
LPCSTR *pszname); // [OUT] return typeref namespace
// return the resolutionscope of typeref
__checkReturn
STDMETHODIMP GetResolutionScopeOfTypeRef(
mdTypeRef classref, // given classref
mdToken *ptkResolutionScope);
// return the typeref token given the name.
__checkReturn
STDMETHODIMP FindTypeRefByName(
LPCSTR szNamespace, // [IN] Namespace for the TypeRef.
LPCSTR szName, // [IN] Name of the TypeRef.
mdToken tkResolutionScope, // [IN] Resolution Scope fo the TypeRef.
mdTypeRef *ptk); // [OUT] TypeRef token returned.
// return the TypeDef properties
__checkReturn
STDMETHODIMP GetTypeDefProps( // return hresult
mdTypeDef classdef, // given classdef
DWORD *pdwAttr, // return flags on class, tdPublic, tdAbstract
mdToken *ptkExtends); // [OUT] Put base class TypeDef/TypeRef here.
// return the item's guid
__checkReturn
STDMETHODIMP GetItemGuid( // return hresult
mdToken tkObj, // [IN] given item.
CLSID *pGuid); // [OUT] Put guid here.
// get enclosing class of NestedClass.
__checkReturn
STDMETHODIMP GetNestedClassProps( // S_OK or error
mdTypeDef tkNestedClass, // [IN] NestedClass token.
mdTypeDef *ptkEnclosingClass); // [OUT] EnclosingClass token.
// Get count of Nested classes given the enclosing class.
__checkReturn
STDMETHODIMP GetCountNestedClasses( // return count of Nested classes.
mdTypeDef tkEnclosingClass, // [IN]Enclosing class.
ULONG *pcNestedClassesCount);
// Return array of Nested classes given the enclosing class.
__checkReturn
STDMETHODIMP GetNestedClasses( // Return actual count.
mdTypeDef tkEnclosingClass, // [IN] Enclosing class.
mdTypeDef *rNestedClasses, // [OUT] Array of nested class tokens.
ULONG ulNestedClasses, // [IN] Size of array.
ULONG *pcNestedClasses);
// return the ModuleRef properties
__checkReturn
STDMETHODIMP GetModuleRefProps(
mdModuleRef mur, // [IN] moduleref token
LPCSTR *pszName); // [OUT] buffer to fill with the moduleref name
//*****************************************
//
// GetSig* functions
//
//*****************************************
__checkReturn
STDMETHODIMP GetSigOfMethodDef(
mdMethodDef methoddef, // [IN] given memberdef
ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob
PCCOR_SIGNATURE *ppSig);
__checkReturn
STDMETHODIMP GetSigOfFieldDef(
mdMethodDef methoddef, // [IN] given memberdef
ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob
PCCOR_SIGNATURE *ppSig);
__checkReturn
STDMETHODIMP GetSigFromToken(
mdToken tk, // FieldDef, MethodDef, Signature or TypeSpec token
ULONG * pcbSig,
PCCOR_SIGNATURE * ppSig);
//*****************************************
// get method property
//*****************************************
__checkReturn
STDMETHODIMP GetMethodDefProps(
mdMethodDef md, // The method for which to get props.
DWORD *pdwFlags);
STDMETHODIMP_(ULONG) GetMethodDefSlot(
mdMethodDef mb); // The method for which to get props.
//*****************************************
// return method implementation informaiton, like RVA and implflags
//*****************************************
__checkReturn
STDMETHODIMP GetMethodImplProps(
mdToken tk, // [IN] MethodDef or MethodImpl
DWORD *pulCodeRVA, // [OUT] CodeRVA
DWORD *pdwImplFlags); // [OUT] Impl. Flags
//*****************************************************************************
// return the field RVA
//*****************************************************************************
__checkReturn
STDMETHODIMP GetFieldRVA(
mdToken fd, // [IN] FieldDef
ULONG *pulCodeRVA); // [OUT] CodeRVA
//*****************************************************************************
// return the field offset for a given field
//*****************************************************************************
__checkReturn
STDMETHODIMP GetFieldOffset(
mdFieldDef fd, // [IN] fielddef
ULONG *pulOffset); // [OUT] FieldOffset
//*****************************************
// get field property
//*****************************************
__checkReturn
STDMETHODIMP GetFieldDefProps(
mdFieldDef fd, // [IN] given fielddef
DWORD *pdwFlags); // [OUT] return fdPublic, fdPrive, etc flags
//*****************************************************************************
// return default value of a token(could be paramdef, fielddef, or property
//*****************************************************************************
__checkReturn
STDMETHODIMP GetDefaultValue(
mdToken tk, // [IN] given FieldDef, ParamDef, or Property
MDDefaultValue *pDefaultValue); // [OUT] default value to fill
//*****************************************
// get dispid of a MethodDef or a FieldDef
//*****************************************
__checkReturn
STDMETHODIMP GetDispIdOfMemberDef( // return hresult
mdToken tk, // [IN] given methoddef or fielddef
ULONG *pDispid); // [OUT] Put the dispid here.
//*****************************************
// return TypeRef/TypeDef given an InterfaceImpl token
//*****************************************
__checkReturn
STDMETHODIMP GetTypeOfInterfaceImpl( // return the TypeRef/typedef token for the interfaceimpl
mdInterfaceImpl iiImpl, // given a interfaceimpl
mdToken *ptkType);
__checkReturn
STDMETHODIMP GetMethodSpecProps(
mdMethodSpec mi, // [IN] The method instantiation
mdToken *tkParent, // [OUT] MethodDef or MemberRef
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to the blob value of meta data
ULONG *pcbSigBlob); // [OUT] actual size of signature blob
//*****************************************
// look up function for TypeDef
//*****************************************
__checkReturn
STDMETHODIMP FindTypeDef(
LPCSTR szNamespace, // [IN] Namespace for the TypeDef.
LPCSTR szName, // [IN] Name of the TypeDef.
mdToken tkEnclosingClass, // [IN] TypeDef/TypeRef of enclosing class.
mdTypeDef *ptypedef); // [OUT] return typedef
__checkReturn
STDMETHODIMP FindTypeDefByGUID(
REFGUID guid, // guid to look up
mdTypeDef *ptypedef); // return typedef
//*****************************************
// return name and sig of a memberref
//*****************************************
__checkReturn
STDMETHODIMP GetNameAndSigOfMemberRef( // return name here
mdMemberRef memberref, // given memberref
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to a blob value of COM+ signature
ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob
LPCSTR *pszName);
//*****************************************************************************
// Given memberref, return the parent. It can be TypeRef, ModuleRef, MethodDef
//*****************************************************************************
__checkReturn
STDMETHODIMP GetParentOfMemberRef(
mdMemberRef memberref, // given memberref
mdToken *ptkParent); // return the parent token
__checkReturn
STDMETHODIMP GetParamDefProps(
mdParamDef paramdef, // given a paramdef
USHORT *pusSequence, // [OUT] slot number for this parameter
DWORD *pdwAttr, // [OUT] flags
LPCSTR *pszName); // [OUT] return the name of the parameter
//******************************************
// property info for method.
//******************************************
__checkReturn
STDMETHODIMP GetPropertyInfoForMethodDef( // Result.
mdMethodDef md, // [IN] memberdef
mdProperty *ppd, // [OUT] put property token here
LPCSTR *pName, // [OUT] put pointer to name here
ULONG *pSemantic); // [OUT] put semantic here
//*****************************************
// class layout/sequence information
//*****************************************
__checkReturn
STDMETHODIMP GetClassPackSize( // [OUT] return error if a class doesn't have packsize info
mdTypeDef td, // [IN] give typedef
ULONG *pdwPackSize); // [OUT] return the pack size of the class. 1, 2, 4, 8 or 16
__checkReturn
STDMETHODIMP GetClassTotalSize( // [OUT] return error if a class doesn't have total size info
mdTypeDef td, // [IN] give typedef
ULONG *pdwClassSize); // [OUT] return the total size of the class
__checkReturn
STDMETHODIMP GetClassLayoutInit(
mdTypeDef td, // [IN] give typedef
MD_CLASS_LAYOUT *pLayout); // [OUT] set up the status of query here
__checkReturn
STDMETHODIMP GetClassLayoutNext(
MD_CLASS_LAYOUT *pLayout, // [IN|OUT] set up the status of query here
mdFieldDef *pfd, // [OUT] return the fielddef
ULONG *pulOffset); // [OUT] return the offset/ulSequence associate with it
//*****************************************
// marshal information of a field
//*****************************************
__checkReturn
STDMETHODIMP GetFieldMarshal( // return error if no native type associate with the token
mdFieldDef fd, // [IN] given fielddef
PCCOR_SIGNATURE *pSigNativeType, // [OUT] the native type signature
ULONG *pcbNativeType); // [OUT] the count of bytes of *ppvNativeType
//*****************************************
// property APIs
//*****************************************
// find a property by name
__checkReturn
STDMETHODIMP FindProperty(
mdTypeDef td, // [IN] given a typdef
LPCSTR szPropName, // [IN] property name
mdProperty *pProp); // [OUT] return property token
__checkReturn
STDMETHODIMP GetPropertyProps(
mdProperty prop, // [IN] property token
LPCSTR *szProperty, // [OUT] property name
DWORD *pdwPropFlags, // [OUT] property flags.
PCCOR_SIGNATURE *ppvSig, // [OUT] property type. pointing to meta data internal blob
ULONG *pcbSig); // [OUT] count of bytes in *ppvSig
//**********************************
// Event APIs
//**********************************
__checkReturn
STDMETHODIMP FindEvent(
mdTypeDef td, // [IN] given a typdef
LPCSTR szEventName, // [IN] event name
mdEvent *pEvent); // [OUT] return event token
__checkReturn
STDMETHODIMP GetEventProps( // S_OK, S_FALSE, or error.
mdEvent ev, // [IN] event token
LPCSTR *pszEvent, // [OUT] Event name
DWORD *pdwEventFlags, // [OUT] Event flags.
mdToken *ptkEventType); // [OUT] EventType class
//**********************************
// Generics APIs
//**********************************
__checkReturn
STDMETHODIMP GetGenericParamProps( // S_OK or error.
mdGenericParam rd, // [IN] The type parameter
ULONG* pulSequence, // [OUT] Parameter sequence number
DWORD* pdwAttr, // [OUT] Type parameter flags (for future use)
mdToken *ptOwner, // [OUT] The owner (TypeDef or MethodDef)
DWORD *reserved, // [OUT] The kind (TypeDef/Ref/Spec, for future use)
LPCSTR *szName); // [OUT] The name
__checkReturn
STDMETHODIMP GetGenericParamConstraintProps( // S_OK or error.
mdGenericParamConstraint rd, // [IN] The constraint token
mdGenericParam *ptGenericParam, // [OUT] GenericParam that is constrained
mdToken *ptkConstraintType); // [OUT] TypeDef/Ref/Spec constraint
//**********************************
// find a particular associate of a property or an event
//**********************************
__checkReturn
STDMETHODIMP FindAssociate(
mdToken evprop, // [IN] given a property or event token
DWORD associate, // [IN] given a associate semantics(setter, getter, testdefault, reset, AddOn, RemoveOn, Fire)
mdMethodDef *pmd); // [OUT] return method def token
__checkReturn
STDMETHODIMP EnumAssociateInit(
mdToken evprop, // [IN] given a property or an event token
HENUMInternal *phEnum); // [OUT] cursor to hold the query result
__checkReturn
STDMETHODIMP GetAllAssociates(
HENUMInternal *phEnum, // [IN] query result form GetPropertyAssociateCounts
ASSOCIATE_RECORD *pAssociateRec, // [OUT] struct to fill for output
ULONG cAssociateRec); // [IN] size of the buffer
//**********************************
// Get info about a PermissionSet.
//**********************************
__checkReturn
STDMETHODIMP GetPermissionSetProps(
mdPermission pm, // [IN] the permission token.
DWORD *pdwAction, // [OUT] CorDeclSecurity.
void const **ppvPermission, // [OUT] permission blob.
ULONG *pcbPermission); // [OUT] count of bytes of pvPermission.
//****************************************
// Get the String given the String token.
// Returns a pointer to the string, or NULL in case of error.
//****************************************
__checkReturn
STDMETHODIMP GetUserString(
mdString stk, // [IN] the string token.
ULONG *pchString, // [OUT] count of characters in the string.
BOOL *pbIs80Plus, // [OUT] specifies where there are extended characters >= 0x80.
LPCWSTR *pwszUserString);
//*****************************************************************************
// p-invoke APIs.
//*****************************************************************************
__checkReturn
STDMETHODIMP GetPinvokeMap(
mdToken tk, // [IN] FieldDef or MethodDef.
DWORD *pdwMappingFlags, // [OUT] Flags used for mapping.
LPCSTR *pszImportName, // [OUT] Import name.
mdModuleRef *pmrImportDLL); // [OUT] ModuleRef token for the target DLL.
//*****************************************************************************
// Assembly MetaData APIs.
//*****************************************************************************
__checkReturn
STDMETHODIMP GetAssemblyProps(
mdAssembly mda, // [IN] The Assembly for which to get the properties.
const void **ppbPublicKey, // [OUT] Pointer to the public key.
ULONG *pcbPublicKey, // [OUT] Count of bytes in the public key.
ULONG *pulHashAlgId, // [OUT] Hash Algorithm.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
AssemblyMetaDataInternal *pMetaData,// [OUT] Assembly MetaData.
DWORD *pdwAssemblyFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP GetAssemblyRefProps(
mdAssemblyRef mdar, // [IN] The AssemblyRef for which to get the properties.
const void **ppbPublicKeyOrToken, // [OUT] Pointer to the public key or token.
ULONG *pcbPublicKeyOrToken, // [OUT] Count of bytes in the public key or token.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
AssemblyMetaDataInternal *pMetaData,// [OUT] Assembly MetaData.
const void **ppbHashValue, // [OUT] Hash blob.
ULONG *pcbHashValue, // [OUT] Count of bytes in the hash blob.
DWORD *pdwAssemblyRefFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP GetFileProps(
mdFile mdf, // [IN] The File for which to get the properties.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
const void **ppbHashValue, // [OUT] Pointer to the Hash Value Blob.
ULONG *pcbHashValue, // [OUT] Count of bytes in the Hash Value Blob.
DWORD *pdwFileFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP GetExportedTypeProps(
mdExportedType mdct, // [IN] The ExportedType for which to get the properties.
LPCSTR *pszNamespace, // [OUT] Buffer to fill with namespace.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
mdToken *ptkImplementation, // [OUT] mdFile or mdAssemblyRef that provides the ExportedType.
mdTypeDef *ptkTypeDef, // [OUT] TypeDef token within the file.
DWORD *pdwExportedTypeFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP GetManifestResourceProps(
mdManifestResource mdmr, // [IN] The ManifestResource for which to get the properties.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
mdToken *ptkImplementation, // [OUT] mdFile or mdAssemblyRef that provides the ExportedType.
DWORD *pdwOffset, // [OUT] Offset to the beginning of the resource within the file.
DWORD *pdwResourceFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP FindExportedTypeByName( // S_OK or error
LPCSTR szNamespace, // [IN] Namespace of the ExportedType.
LPCSTR szName, // [IN] Name of the ExportedType.
mdExportedType tkEnclosingType, // [IN] Token for the enclosing Type.
mdExportedType *pmct); // [OUT] Put ExportedType token here.
__checkReturn
STDMETHODIMP FindManifestResourceByName(// S_OK or error
LPCSTR szName, // [IN] Name of the resource.
mdManifestResource *pmmr); // [OUT] Put ManifestResource token here.
__checkReturn
STDMETHODIMP GetAssemblyFromScope( // S_OK or error
mdAssembly *ptkAssembly); // [OUT] Put token here.
//***************************************************************************
// return properties regarding a TypeSpec
//***************************************************************************
__checkReturn
STDMETHODIMP GetTypeSpecFromToken( // S_OK or error.
mdTypeSpec typespec, // [IN] Signature token.
PCCOR_SIGNATURE *ppvSig, // [OUT] return pointer to token.
ULONG *pcbSig); // [OUT] return size of signature.
//*****************************************************************************
// This function gets the "built for" version of a metadata scope.
// NOTE: if the scope has never been saved, it will not have a built-for
// version, and an empty string will be returned.
//*****************************************************************************
__checkReturn
STDMETHODIMP GetVersionString( // S_OK or error.
LPCSTR *pVer); // [OUT] Put version string here.
//*****************************************************************************
// helpers to convert a text signature to a com format
//*****************************************************************************
__checkReturn
STDMETHODIMP ConvertTextSigToComSig( // Return hresult.
BOOL fCreateTrIfNotFound, // [IN] create typeref if not found
LPCSTR pSignature, // [IN] class file format signature
CQuickBytes *pqbNewSig, // [OUT] place holder for COM+ signature
ULONG *pcbCount); // [OUT] the result size of signature
__checkReturn
STDMETHODIMP SetUserContextData( // S_OK or E_NOTIMPL
IUnknown *pIUnk); // The user context.
STDMETHODIMP_(BOOL) IsValidToken( // True or False.
mdToken tk); // [IN] Given token.
STDMETHODIMP_(IUnknown *) GetCachedPublicInterface(BOOL fWithLock); // return the cached public interface
__checkReturn
STDMETHODIMP SetCachedPublicInterface(IUnknown *pUnk); // return hresult
STDMETHODIMP_(UTSemReadWrite*) GetReaderWriterLock(); // return the reader writer lock
__checkReturn
STDMETHODIMP SetReaderWriterLock(UTSemReadWrite *pSem)
{
_ASSERTE(m_pSemReadWrite == NULL);
m_pSemReadWrite = pSem;
INDEBUG(m_pStgdb->m_MiniMd.Debug_SetLock(m_pSemReadWrite);)
return NOERROR;
}
// *** IMDInternalImportENC methods ***
__checkReturn
STDMETHODIMP ApplyEditAndContinue( // S_OK or error.
MDInternalRW *pDelta); // MD with the ENC delta.
__checkReturn
STDMETHODIMP EnumDeltaTokensInit( // return hresult
HENUMInternal *phEnum); // [OUT] buffer to fill for enumerator data
STDMETHODIMP_(mdModule) GetModuleFromScope(void);
// finding a particular method
__checkReturn
STDMETHODIMP FindMethodDefUsingCompare(
mdTypeDef classdef, // [IN] given typedef
LPCSTR szName, // [IN] member name
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of COM+ signature
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
PSIGCOMPARE pSignatureCompare, // [IN] Routine to compare signatures
void* pSignatureArgs, // [IN] Additional info to supply the compare function
mdMethodDef *pmd); // [OUT] matching memberdef
//*****************************************************************************
// return the table pointer and size for a given table index
//*****************************************************************************
__checkReturn
STDMETHODIMP GetTableInfoWithIndex(
ULONG index, // [IN] pass in the index
void **pTable, // [OUT] pointer to table at index
void **pTableSize); // [OUT] size of table at index
__checkReturn
STDMETHODIMP ApplyEditAndContinue(
void *pData, // [IN] the delta metadata
ULONG cbData, // [IN] length of pData
IMDInternalImport **ppv); // [OUT] the resulting metadata interface
FORCEINLINE CLiteWeightStgdbRW* GetMiniStgdb() { return m_pStgdb; }
FORCEINLINE UTSemReadWrite *getReaderWriterLock() { return m_pSemReadWrite; }
CLiteWeightStgdbRW *m_pStgdb;
private:
mdTypeDef m_tdModule; // <Module> typedef value.
LONG m_cRefs; // Ref count.
bool m_fOwnStgdb;
IUnknown *m_pUnk;
IUnknown *m_pUserUnk; // Release at shutdown.
IMetaDataHelper *m_pIMetaDataHelper;// pointer to cached public interface
UTSemReadWrite *m_pSemReadWrite; // read write lock for multi-threading.
bool m_fOwnSem; // Does MDInternalRW own this read write lock object?
public:
STDMETHODIMP_(DWORD) GetMetadataStreamVersion()
{
return (DWORD)m_pStgdb->m_MiniMd.m_Schema.m_minor |
((DWORD)m_pStgdb->m_MiniMd.m_Schema.m_major << 16);
};
__checkReturn
STDMETHODIMP SetVerifiedByTrustedSource(// return hresult
BOOL fVerified)
{
m_pStgdb->m_MiniMd.SetVerifiedByTrustedSource(fVerified);
return S_OK;
}
STDMETHODIMP GetRvaOffsetData(// S_OK or error
DWORD *pFirstMethodRvaOffset, // [OUT] Offset (from start of metadata) to the first RVA field in MethodDef table.
DWORD *pMethodDefRecordSize, // [OUT] Size of each record in MethodDef table.
DWORD *pMethodDefCount, // [OUT] Number of records in MethodDef table.
DWORD *pFirstFieldRvaOffset, // [OUT] Offset (from start of metadata) to the first RVA field in FieldRVA table.
DWORD *pFieldRvaRecordSize, // [OUT] Size of each record in FieldRVA table.
DWORD *pFieldRvaCount) // [OUT] Number of records in FieldRVA table.
{
return m_pStgdb->m_MiniMd.GetRvaOffsetData(
pFirstMethodRvaOffset,
pMethodDefRecordSize,
pMethodDefCount,
pFirstFieldRvaOffset,
pFieldRvaRecordSize,
pFieldRvaCount);
}
}; // class MDInternalRW
#endif //FEATURE_METADATA_INTERNAL_APIS
#endif // __MDInternalRW__h__
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//*****************************************************************************
// MDInternalRW.h
//
//
// Contains utility code for MD directory
//
//*****************************************************************************
#ifndef __MDInternalRW__h__
#define __MDInternalRW__h__
#ifdef FEATURE_METADATA_INTERNAL_APIS
#include "../inc/mdlog.h"
class UTSemReadWrite;
class MDInternalRW : public IMDInternalImportENC, public IMDCommon
{
friend class VerifyLayoutsMD;
public:
MDInternalRW();
virtual ~MDInternalRW();
__checkReturn
HRESULT Init(LPVOID pData, ULONG cbData, int bReadOnly);
__checkReturn
HRESULT InitWithStgdb(IUnknown *pUnk, CLiteWeightStgdbRW *pStgdb);
__checkReturn
HRESULT InitWithRO(MDInternalRO *pRO, int bReadOnly);
// *** IUnknown methods ***
__checkReturn
STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
STDMETHODIMP_(ULONG) AddRef(void);
STDMETHODIMP_(ULONG) Release(void);
__checkReturn
STDMETHODIMP TranslateSigWithScope(
IMDInternalImport *pAssemImport, // [IN] import assembly scope.
const void *pbHashValue, // [IN] hash value for the import assembly.
ULONG cbHashValue, // [IN] count of bytes in the hash value.
PCCOR_SIGNATURE pbSigBlob, // [IN] signature in the importing scope
ULONG cbSigBlob, // [IN] count of bytes of signature
IMetaDataAssemblyEmit *pAssemEmit, // [IN] assembly emit scope.
IMetaDataEmit *emit, // [IN] emit interface
CQuickBytes *pqkSigEmit, // [OUT] buffer to hold translated signature
ULONG *pcbSig) // [OUT] count of bytes in the translated signature
DAC_UNEXPECTED();
__checkReturn
STDMETHODIMP GetTypeDefRefTokenInTypeSpec(// return S_FALSE if enclosing type does not have a token
mdTypeSpec tkTypeSpec, // [IN] TypeSpec token to look at
mdToken *tkEnclosedToken) // [OUT] The enclosed type token
DAC_UNEXPECTED();
STDMETHODIMP_(IMetaModelCommon*) GetMetaModelCommon()
{
return static_cast<IMetaModelCommon*>(&m_pStgdb->m_MiniMd);
}
STDMETHODIMP_(IMetaModelCommonRO*) GetMetaModelCommonRO()
{
if (m_pStgdb->m_MiniMd.IsWritable())
{
_ASSERTE(!"IMetaModelCommonRO methods cannot be used because this importer is writable.");
return NULL;
}
return static_cast<IMetaModelCommonRO*>(&m_pStgdb->m_MiniMd);
}
__checkReturn
STDMETHODIMP SetOptimizeAccessForSpeed(// return hresult
BOOL fOptSpeed)
{
// If there is any optional work we can avoid (for example, because we have
// traded space for speed) this is the place to turn it off or on.
return S_OK;
}
//*****************************************************************************
// return the count of entries of a given kind in a scope
// For example, pass in mdtMethodDef will tell you how many MethodDef
// contained in a scope
//*****************************************************************************
STDMETHODIMP_(ULONG) GetCountWithTokenKind(// return hresult
DWORD tkKind) // [IN] pass in the kind of token.
DAC_UNEXPECTED();
//*****************************************************************************
// enumerator for typedef
//*****************************************************************************
__checkReturn
STDMETHODIMP EnumTypeDefInit( // return hresult
HENUMInternal *phEnum); // [OUT] buffer to fill for enumerator data
//*****************************************************************************
// enumerator for MethodImpl
//*****************************************************************************
__checkReturn
STDMETHODIMP EnumMethodImplInit( // return hresult
mdTypeDef td, // [IN] TypeDef over which to scope the enumeration.
HENUMInternal *phEnumBody, // [OUT] buffer to fill for enumerator data for MethodBody tokens.
HENUMInternal *phEnumDecl) // [OUT] buffer to fill for enumerator data for MethodDecl tokens.
DAC_UNEXPECTED();
STDMETHODIMP_(ULONG) EnumMethodImplGetCount(
HENUMInternal *phEnumBody, // [IN] MethodBody enumerator.
HENUMInternal *phEnumDecl) // [IN] MethodDecl enumerator.
DAC_UNEXPECTED();
STDMETHODIMP_(void) EnumMethodImplReset(
HENUMInternal *phEnumBody, // [IN] MethodBody enumerator.
HENUMInternal *phEnumDecl) // [IN] MethodDecl enumerator.
DAC_UNEXPECTED();
__checkReturn
STDMETHODIMP EnumMethodImplNext( // return hresult (S_OK = TRUE, S_FALSE = FALSE or error code)
HENUMInternal *phEnumBody, // [IN] input enum for MethodBody
HENUMInternal *phEnumDecl, // [IN] input enum for MethodDecl
mdToken *ptkBody, // [OUT] return token for MethodBody
mdToken *ptkDecl) // [OUT] return token for MethodDecl
DAC_UNEXPECTED();
STDMETHODIMP_(void) EnumMethodImplClose(
HENUMInternal *phEnumBody, // [IN] MethodBody enumerator.
HENUMInternal *phEnumDecl) // [IN] MethodDecl enumerator.
DAC_UNEXPECTED();
//*****************************************
// Enumerator helpers for memberdef, memberref, interfaceimp,
// event, property, param, methodimpl
//*****************************************
__checkReturn
STDMETHODIMP EnumGlobalFunctionsInit( // return hresult
HENUMInternal *phEnum); // [OUT] buffer to fill for enumerator data
__checkReturn
STDMETHODIMP EnumGlobalFieldsInit( // return hresult
HENUMInternal *phEnum); // [OUT] buffer to fill for enumerator data
__checkReturn
STDMETHODIMP EnumInit( // return S_FALSE if record not found
DWORD tkKind, // [IN] which table to work on
mdToken tkParent, // [IN] token to scope the search
HENUMInternal *phEnum); // [OUT] the enumerator to fill
__checkReturn
STDMETHODIMP EnumAllInit( // return S_FALSE if record not found
DWORD tkKind, // [IN] which table to work on
HENUMInternal *phEnum); // [OUT] the enumerator to fill
__checkReturn
STDMETHODIMP EnumCustomAttributeByNameInit(// return S_FALSE if record not found
mdToken tkParent, // [IN] token to scope the search
LPCSTR szName, // [IN] CustomAttribute's name to scope the search
HENUMInternal *phEnum); // [OUT] the enumerator to fill
__checkReturn
STDMETHODIMP GetParentToken(
mdToken tkChild, // [IN] given child token
mdToken *ptkParent); // [OUT] returning parent
__checkReturn
STDMETHODIMP GetCustomAttributeProps(
mdCustomAttribute at, // The attribute.
mdToken *ptkType); // Put attribute type here.
__checkReturn
STDMETHODIMP GetCustomAttributeAsBlob(
mdCustomAttribute cv, // [IN] given custom attribute token
void const **ppBlob, // [OUT] return the pointer to internal blob
ULONG *pcbSize); // [OUT] return the size of the blob
__checkReturn
STDMETHODIMP GetCustomAttributeByName( // S_OK or error.
mdToken tkObj, // [IN] Object with Custom Attribute.
LPCUTF8 szName, // [IN] Name of desired Custom Attribute.
const void **ppData, // [OUT] Put pointer to data here.
ULONG *pcbData); // [OUT] Put size of data here.
__checkReturn
STDMETHODIMP GetNameOfCustomAttribute( // S_OK or error.
mdCustomAttribute mdAttribute, // [IN] The Custom Attribute
LPCUTF8 *pszNamespace, // [OUT] Namespace of Custom Attribute.
LPCUTF8 *pszName); // [OUT] Name of Custom Attribute.
// returned void in v1.0/v1.1
__checkReturn
STDMETHODIMP GetScopeProps(
LPCSTR *pszName, // [OUT] scope name
GUID *pmvid); // [OUT] version id
// finding a particular method
__checkReturn
STDMETHODIMP FindMethodDef(
mdTypeDef classdef, // [IN] given typedef
LPCSTR szName, // [IN] member name
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of COM+ signature
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
mdMethodDef *pmd); // [OUT] matching memberdef
// return a iSeq's param given a MethodDef
__checkReturn
STDMETHODIMP FindParamOfMethod( // S_OK or error.
mdMethodDef md, // [IN] The owning method of the param.
ULONG iSeq, // [IN} The sequence # of the param.
mdParamDef *pparamdef); // [OUT] Put ParamDef token here.
//*****************************************
//
// GetName* functions
//
//*****************************************
// return the name and namespace of typedef
__checkReturn
STDMETHODIMP GetNameOfTypeDef(
mdTypeDef classdef, // given classdef
LPCSTR *pszname, // return class name(unqualified)
LPCSTR *psznamespace); // return the name space name
__checkReturn
STDMETHODIMP GetIsDualOfTypeDef(
mdTypeDef classdef, // [IN] given classdef.
ULONG *pDual); // [OUT] return dual flag here.
__checkReturn
STDMETHODIMP GetIfaceTypeOfTypeDef(
mdTypeDef tkTypeDef,
ULONG * pIface); // [OUT] 0=dual, 1=vtable, 2=dispinterface
__checkReturn
STDMETHODIMP GetNameOfMethodDef(
mdMethodDef tkMethodDef,
LPCSTR * pszName);
__checkReturn
STDMETHODIMP GetNameAndSigOfMethodDef(
mdMethodDef methoddef, // [IN] given memberdef
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to a blob value of COM+ signature
ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob
LPCSTR *pszName);
// return the name of a FieldDef
__checkReturn
STDMETHODIMP GetNameOfFieldDef(
mdFieldDef fd, // given memberdef
LPCSTR *pszName);
// return the name of typeref
__checkReturn
STDMETHODIMP GetNameOfTypeRef(
mdTypeRef classref, // [IN] given typeref
LPCSTR *psznamespace, // [OUT] return typeref name
LPCSTR *pszname); // [OUT] return typeref namespace
// return the resolutionscope of typeref
__checkReturn
STDMETHODIMP GetResolutionScopeOfTypeRef(
mdTypeRef classref, // given classref
mdToken *ptkResolutionScope);
// return the typeref token given the name.
__checkReturn
STDMETHODIMP FindTypeRefByName(
LPCSTR szNamespace, // [IN] Namespace for the TypeRef.
LPCSTR szName, // [IN] Name of the TypeRef.
mdToken tkResolutionScope, // [IN] Resolution Scope fo the TypeRef.
mdTypeRef *ptk); // [OUT] TypeRef token returned.
// return the TypeDef properties
__checkReturn
STDMETHODIMP GetTypeDefProps( // return hresult
mdTypeDef classdef, // given classdef
DWORD *pdwAttr, // return flags on class, tdPublic, tdAbstract
mdToken *ptkExtends); // [OUT] Put base class TypeDef/TypeRef here.
// return the item's guid
__checkReturn
STDMETHODIMP GetItemGuid( // return hresult
mdToken tkObj, // [IN] given item.
CLSID *pGuid); // [OUT] Put guid here.
// get enclosing class of NestedClass.
__checkReturn
STDMETHODIMP GetNestedClassProps( // S_OK or error
mdTypeDef tkNestedClass, // [IN] NestedClass token.
mdTypeDef *ptkEnclosingClass); // [OUT] EnclosingClass token.
// Get count of Nested classes given the enclosing class.
__checkReturn
STDMETHODIMP GetCountNestedClasses( // return count of Nested classes.
mdTypeDef tkEnclosingClass, // [IN]Enclosing class.
ULONG *pcNestedClassesCount);
// Return array of Nested classes given the enclosing class.
__checkReturn
STDMETHODIMP GetNestedClasses( // Return actual count.
mdTypeDef tkEnclosingClass, // [IN] Enclosing class.
mdTypeDef *rNestedClasses, // [OUT] Array of nested class tokens.
ULONG ulNestedClasses, // [IN] Size of array.
ULONG *pcNestedClasses);
// return the ModuleRef properties
__checkReturn
STDMETHODIMP GetModuleRefProps(
mdModuleRef mur, // [IN] moduleref token
LPCSTR *pszName); // [OUT] buffer to fill with the moduleref name
//*****************************************
//
// GetSig* functions
//
//*****************************************
__checkReturn
STDMETHODIMP GetSigOfMethodDef(
mdMethodDef methoddef, // [IN] given memberdef
ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob
PCCOR_SIGNATURE *ppSig);
__checkReturn
STDMETHODIMP GetSigOfFieldDef(
mdMethodDef methoddef, // [IN] given memberdef
ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob
PCCOR_SIGNATURE *ppSig);
__checkReturn
STDMETHODIMP GetSigFromToken(
mdToken tk, // FieldDef, MethodDef, Signature or TypeSpec token
ULONG * pcbSig,
PCCOR_SIGNATURE * ppSig);
//*****************************************
// get method property
//*****************************************
__checkReturn
STDMETHODIMP GetMethodDefProps(
mdMethodDef md, // The method for which to get props.
DWORD *pdwFlags);
STDMETHODIMP_(ULONG) GetMethodDefSlot(
mdMethodDef mb); // The method for which to get props.
//*****************************************
// return method implementation informaiton, like RVA and implflags
//*****************************************
__checkReturn
STDMETHODIMP GetMethodImplProps(
mdToken tk, // [IN] MethodDef or MethodImpl
DWORD *pulCodeRVA, // [OUT] CodeRVA
DWORD *pdwImplFlags); // [OUT] Impl. Flags
//*****************************************************************************
// return the field RVA
//*****************************************************************************
__checkReturn
STDMETHODIMP GetFieldRVA(
mdToken fd, // [IN] FieldDef
ULONG *pulCodeRVA); // [OUT] CodeRVA
//*****************************************************************************
// return the field offset for a given field
//*****************************************************************************
__checkReturn
STDMETHODIMP GetFieldOffset(
mdFieldDef fd, // [IN] fielddef
ULONG *pulOffset); // [OUT] FieldOffset
//*****************************************
// get field property
//*****************************************
__checkReturn
STDMETHODIMP GetFieldDefProps(
mdFieldDef fd, // [IN] given fielddef
DWORD *pdwFlags); // [OUT] return fdPublic, fdPrive, etc flags
//*****************************************************************************
// return default value of a token(could be paramdef, fielddef, or property
//*****************************************************************************
__checkReturn
STDMETHODIMP GetDefaultValue(
mdToken tk, // [IN] given FieldDef, ParamDef, or Property
MDDefaultValue *pDefaultValue); // [OUT] default value to fill
//*****************************************
// get dispid of a MethodDef or a FieldDef
//*****************************************
__checkReturn
STDMETHODIMP GetDispIdOfMemberDef( // return hresult
mdToken tk, // [IN] given methoddef or fielddef
ULONG *pDispid); // [OUT] Put the dispid here.
//*****************************************
// return TypeRef/TypeDef given an InterfaceImpl token
//*****************************************
__checkReturn
STDMETHODIMP GetTypeOfInterfaceImpl( // return the TypeRef/typedef token for the interfaceimpl
mdInterfaceImpl iiImpl, // given a interfaceimpl
mdToken *ptkType);
__checkReturn
STDMETHODIMP GetMethodSpecProps(
mdMethodSpec mi, // [IN] The method instantiation
mdToken *tkParent, // [OUT] MethodDef or MemberRef
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to the blob value of meta data
ULONG *pcbSigBlob); // [OUT] actual size of signature blob
//*****************************************
// look up function for TypeDef
//*****************************************
__checkReturn
STDMETHODIMP FindTypeDef(
LPCSTR szNamespace, // [IN] Namespace for the TypeDef.
LPCSTR szName, // [IN] Name of the TypeDef.
mdToken tkEnclosingClass, // [IN] TypeDef/TypeRef of enclosing class.
mdTypeDef *ptypedef); // [OUT] return typedef
__checkReturn
STDMETHODIMP FindTypeDefByGUID(
REFGUID guid, // guid to look up
mdTypeDef *ptypedef); // return typedef
//*****************************************
// return name and sig of a memberref
//*****************************************
__checkReturn
STDMETHODIMP GetNameAndSigOfMemberRef( // return name here
mdMemberRef memberref, // given memberref
PCCOR_SIGNATURE *ppvSigBlob, // [OUT] point to a blob value of COM+ signature
ULONG *pcbSigBlob, // [OUT] count of bytes in the signature blob
LPCSTR *pszName);
//*****************************************************************************
// Given memberref, return the parent. It can be TypeRef, ModuleRef, MethodDef
//*****************************************************************************
__checkReturn
STDMETHODIMP GetParentOfMemberRef(
mdMemberRef memberref, // given memberref
mdToken *ptkParent); // return the parent token
__checkReturn
STDMETHODIMP GetParamDefProps(
mdParamDef paramdef, // given a paramdef
USHORT *pusSequence, // [OUT] slot number for this parameter
DWORD *pdwAttr, // [OUT] flags
LPCSTR *pszName); // [OUT] return the name of the parameter
//******************************************
// property info for method.
//******************************************
__checkReturn
STDMETHODIMP GetPropertyInfoForMethodDef( // Result.
mdMethodDef md, // [IN] memberdef
mdProperty *ppd, // [OUT] put property token here
LPCSTR *pName, // [OUT] put pointer to name here
ULONG *pSemantic); // [OUT] put semantic here
//*****************************************
// class layout/sequence information
//*****************************************
__checkReturn
STDMETHODIMP GetClassPackSize( // [OUT] return error if a class doesn't have packsize info
mdTypeDef td, // [IN] give typedef
ULONG *pdwPackSize); // [OUT] return the pack size of the class. 1, 2, 4, 8 or 16
__checkReturn
STDMETHODIMP GetClassTotalSize( // [OUT] return error if a class doesn't have total size info
mdTypeDef td, // [IN] give typedef
ULONG *pdwClassSize); // [OUT] return the total size of the class
__checkReturn
STDMETHODIMP GetClassLayoutInit(
mdTypeDef td, // [IN] give typedef
MD_CLASS_LAYOUT *pLayout); // [OUT] set up the status of query here
__checkReturn
STDMETHODIMP GetClassLayoutNext(
MD_CLASS_LAYOUT *pLayout, // [IN|OUT] set up the status of query here
mdFieldDef *pfd, // [OUT] return the fielddef
ULONG *pulOffset); // [OUT] return the offset/ulSequence associate with it
//*****************************************
// marshal information of a field
//*****************************************
__checkReturn
STDMETHODIMP GetFieldMarshal( // return error if no native type associate with the token
mdFieldDef fd, // [IN] given fielddef
PCCOR_SIGNATURE *pSigNativeType, // [OUT] the native type signature
ULONG *pcbNativeType); // [OUT] the count of bytes of *ppvNativeType
//*****************************************
// property APIs
//*****************************************
// find a property by name
__checkReturn
STDMETHODIMP FindProperty(
mdTypeDef td, // [IN] given a typdef
LPCSTR szPropName, // [IN] property name
mdProperty *pProp); // [OUT] return property token
__checkReturn
STDMETHODIMP GetPropertyProps(
mdProperty prop, // [IN] property token
LPCSTR *szProperty, // [OUT] property name
DWORD *pdwPropFlags, // [OUT] property flags.
PCCOR_SIGNATURE *ppvSig, // [OUT] property type. pointing to meta data internal blob
ULONG *pcbSig); // [OUT] count of bytes in *ppvSig
//**********************************
// Event APIs
//**********************************
__checkReturn
STDMETHODIMP FindEvent(
mdTypeDef td, // [IN] given a typdef
LPCSTR szEventName, // [IN] event name
mdEvent *pEvent); // [OUT] return event token
__checkReturn
STDMETHODIMP GetEventProps( // S_OK, S_FALSE, or error.
mdEvent ev, // [IN] event token
LPCSTR *pszEvent, // [OUT] Event name
DWORD *pdwEventFlags, // [OUT] Event flags.
mdToken *ptkEventType); // [OUT] EventType class
//**********************************
// Generics APIs
//**********************************
__checkReturn
STDMETHODIMP GetGenericParamProps( // S_OK or error.
mdGenericParam rd, // [IN] The type parameter
ULONG* pulSequence, // [OUT] Parameter sequence number
DWORD* pdwAttr, // [OUT] Type parameter flags (for future use)
mdToken *ptOwner, // [OUT] The owner (TypeDef or MethodDef)
DWORD *reserved, // [OUT] The kind (TypeDef/Ref/Spec, for future use)
LPCSTR *szName); // [OUT] The name
__checkReturn
STDMETHODIMP GetGenericParamConstraintProps( // S_OK or error.
mdGenericParamConstraint rd, // [IN] The constraint token
mdGenericParam *ptGenericParam, // [OUT] GenericParam that is constrained
mdToken *ptkConstraintType); // [OUT] TypeDef/Ref/Spec constraint
//**********************************
// find a particular associate of a property or an event
//**********************************
__checkReturn
STDMETHODIMP FindAssociate(
mdToken evprop, // [IN] given a property or event token
DWORD associate, // [IN] given a associate semantics(setter, getter, testdefault, reset, AddOn, RemoveOn, Fire)
mdMethodDef *pmd); // [OUT] return method def token
__checkReturn
STDMETHODIMP EnumAssociateInit(
mdToken evprop, // [IN] given a property or an event token
HENUMInternal *phEnum); // [OUT] cursor to hold the query result
__checkReturn
STDMETHODIMP GetAllAssociates(
HENUMInternal *phEnum, // [IN] query result form GetPropertyAssociateCounts
ASSOCIATE_RECORD *pAssociateRec, // [OUT] struct to fill for output
ULONG cAssociateRec); // [IN] size of the buffer
//**********************************
// Get info about a PermissionSet.
//**********************************
__checkReturn
STDMETHODIMP GetPermissionSetProps(
mdPermission pm, // [IN] the permission token.
DWORD *pdwAction, // [OUT] CorDeclSecurity.
void const **ppvPermission, // [OUT] permission blob.
ULONG *pcbPermission); // [OUT] count of bytes of pvPermission.
//****************************************
// Get the String given the String token.
// Returns a pointer to the string, or NULL in case of error.
//****************************************
__checkReturn
STDMETHODIMP GetUserString(
mdString stk, // [IN] the string token.
ULONG *pchString, // [OUT] count of characters in the string.
BOOL *pbIs80Plus, // [OUT] specifies where there are extended characters >= 0x80.
LPCWSTR *pwszUserString);
//*****************************************************************************
// p-invoke APIs.
//*****************************************************************************
__checkReturn
STDMETHODIMP GetPinvokeMap(
mdToken tk, // [IN] FieldDef or MethodDef.
DWORD *pdwMappingFlags, // [OUT] Flags used for mapping.
LPCSTR *pszImportName, // [OUT] Import name.
mdModuleRef *pmrImportDLL); // [OUT] ModuleRef token for the target DLL.
//*****************************************************************************
// Assembly MetaData APIs.
//*****************************************************************************
__checkReturn
STDMETHODIMP GetAssemblyProps(
mdAssembly mda, // [IN] The Assembly for which to get the properties.
const void **ppbPublicKey, // [OUT] Pointer to the public key.
ULONG *pcbPublicKey, // [OUT] Count of bytes in the public key.
ULONG *pulHashAlgId, // [OUT] Hash Algorithm.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
AssemblyMetaDataInternal *pMetaData,// [OUT] Assembly MetaData.
DWORD *pdwAssemblyFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP GetAssemblyRefProps(
mdAssemblyRef mdar, // [IN] The AssemblyRef for which to get the properties.
const void **ppbPublicKeyOrToken, // [OUT] Pointer to the public key or token.
ULONG *pcbPublicKeyOrToken, // [OUT] Count of bytes in the public key or token.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
AssemblyMetaDataInternal *pMetaData,// [OUT] Assembly MetaData.
const void **ppbHashValue, // [OUT] Hash blob.
ULONG *pcbHashValue, // [OUT] Count of bytes in the hash blob.
DWORD *pdwAssemblyRefFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP GetFileProps(
mdFile mdf, // [IN] The File for which to get the properties.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
const void **ppbHashValue, // [OUT] Pointer to the Hash Value Blob.
ULONG *pcbHashValue, // [OUT] Count of bytes in the Hash Value Blob.
DWORD *pdwFileFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP GetExportedTypeProps(
mdExportedType mdct, // [IN] The ExportedType for which to get the properties.
LPCSTR *pszNamespace, // [OUT] Buffer to fill with namespace.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
mdToken *ptkImplementation, // [OUT] mdFile or mdAssemblyRef that provides the ExportedType.
mdTypeDef *ptkTypeDef, // [OUT] TypeDef token within the file.
DWORD *pdwExportedTypeFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP GetManifestResourceProps(
mdManifestResource mdmr, // [IN] The ManifestResource for which to get the properties.
LPCSTR *pszName, // [OUT] Buffer to fill with name.
mdToken *ptkImplementation, // [OUT] mdFile or mdAssemblyRef that provides the ExportedType.
DWORD *pdwOffset, // [OUT] Offset to the beginning of the resource within the file.
DWORD *pdwResourceFlags); // [OUT] Flags.
__checkReturn
STDMETHODIMP FindExportedTypeByName( // S_OK or error
LPCSTR szNamespace, // [IN] Namespace of the ExportedType.
LPCSTR szName, // [IN] Name of the ExportedType.
mdExportedType tkEnclosingType, // [IN] Token for the enclosing Type.
mdExportedType *pmct); // [OUT] Put ExportedType token here.
__checkReturn
STDMETHODIMP FindManifestResourceByName(// S_OK or error
LPCSTR szName, // [IN] Name of the resource.
mdManifestResource *pmmr); // [OUT] Put ManifestResource token here.
__checkReturn
STDMETHODIMP GetAssemblyFromScope( // S_OK or error
mdAssembly *ptkAssembly); // [OUT] Put token here.
//***************************************************************************
// return properties regarding a TypeSpec
//***************************************************************************
__checkReturn
STDMETHODIMP GetTypeSpecFromToken( // S_OK or error.
mdTypeSpec typespec, // [IN] Signature token.
PCCOR_SIGNATURE *ppvSig, // [OUT] return pointer to token.
ULONG *pcbSig); // [OUT] return size of signature.
//*****************************************************************************
// This function gets the "built for" version of a metadata scope.
// NOTE: if the scope has never been saved, it will not have a built-for
// version, and an empty string will be returned.
//*****************************************************************************
__checkReturn
STDMETHODIMP GetVersionString( // S_OK or error.
LPCSTR *pVer); // [OUT] Put version string here.
//*****************************************************************************
// helpers to convert a text signature to a com format
//*****************************************************************************
__checkReturn
STDMETHODIMP ConvertTextSigToComSig( // Return hresult.
BOOL fCreateTrIfNotFound, // [IN] create typeref if not found
LPCSTR pSignature, // [IN] class file format signature
CQuickBytes *pqbNewSig, // [OUT] place holder for COM+ signature
ULONG *pcbCount); // [OUT] the result size of signature
__checkReturn
STDMETHODIMP SetUserContextData( // S_OK or E_NOTIMPL
IUnknown *pIUnk); // The user context.
STDMETHODIMP_(BOOL) IsValidToken( // True or False.
mdToken tk); // [IN] Given token.
STDMETHODIMP_(IUnknown *) GetCachedPublicInterface(BOOL fWithLock); // return the cached public interface
__checkReturn
STDMETHODIMP SetCachedPublicInterface(IUnknown *pUnk); // return hresult
STDMETHODIMP_(UTSemReadWrite*) GetReaderWriterLock(); // return the reader writer lock
__checkReturn
STDMETHODIMP SetReaderWriterLock(UTSemReadWrite *pSem)
{
_ASSERTE(m_pSemReadWrite == NULL);
m_pSemReadWrite = pSem;
INDEBUG(m_pStgdb->m_MiniMd.Debug_SetLock(m_pSemReadWrite);)
return NOERROR;
}
// *** IMDInternalImportENC methods ***
__checkReturn
STDMETHODIMP ApplyEditAndContinue( // S_OK or error.
MDInternalRW *pDelta); // MD with the ENC delta.
__checkReturn
STDMETHODIMP EnumDeltaTokensInit( // return hresult
HENUMInternal *phEnum); // [OUT] buffer to fill for enumerator data
STDMETHODIMP_(mdModule) GetModuleFromScope(void);
// finding a particular method
__checkReturn
STDMETHODIMP FindMethodDefUsingCompare(
mdTypeDef classdef, // [IN] given typedef
LPCSTR szName, // [IN] member name
PCCOR_SIGNATURE pvSigBlob, // [IN] point to a blob value of COM+ signature
ULONG cbSigBlob, // [IN] count of bytes in the signature blob
PSIGCOMPARE pSignatureCompare, // [IN] Routine to compare signatures
void* pSignatureArgs, // [IN] Additional info to supply the compare function
mdMethodDef *pmd); // [OUT] matching memberdef
//*****************************************************************************
// return the table pointer and size for a given table index
//*****************************************************************************
__checkReturn
STDMETHODIMP GetTableInfoWithIndex(
ULONG index, // [IN] pass in the index
void **pTable, // [OUT] pointer to table at index
void **pTableSize); // [OUT] size of table at index
__checkReturn
STDMETHODIMP ApplyEditAndContinue(
void *pData, // [IN] the delta metadata
ULONG cbData, // [IN] length of pData
IMDInternalImport **ppv); // [OUT] the resulting metadata interface
FORCEINLINE CLiteWeightStgdbRW* GetMiniStgdb() { return m_pStgdb; }
FORCEINLINE UTSemReadWrite *getReaderWriterLock() { return m_pSemReadWrite; }
CLiteWeightStgdbRW *m_pStgdb;
private:
mdTypeDef m_tdModule; // <Module> typedef value.
LONG m_cRefs; // Ref count.
bool m_fOwnStgdb;
IUnknown *m_pUnk;
IUnknown *m_pUserUnk; // Release at shutdown.
IMetaDataHelper *m_pIMetaDataHelper;// pointer to cached public interface
UTSemReadWrite *m_pSemReadWrite; // read write lock for multi-threading.
bool m_fOwnSem; // Does MDInternalRW own this read write lock object?
public:
STDMETHODIMP_(DWORD) GetMetadataStreamVersion()
{
return (DWORD)m_pStgdb->m_MiniMd.m_Schema.m_minor |
((DWORD)m_pStgdb->m_MiniMd.m_Schema.m_major << 16);
};
__checkReturn
STDMETHODIMP SetVerifiedByTrustedSource(// return hresult
BOOL fVerified)
{
m_pStgdb->m_MiniMd.SetVerifiedByTrustedSource(fVerified);
return S_OK;
}
STDMETHODIMP GetRvaOffsetData(// S_OK or error
DWORD *pFirstMethodRvaOffset, // [OUT] Offset (from start of metadata) to the first RVA field in MethodDef table.
DWORD *pMethodDefRecordSize, // [OUT] Size of each record in MethodDef table.
DWORD *pMethodDefCount, // [OUT] Number of records in MethodDef table.
DWORD *pFirstFieldRvaOffset, // [OUT] Offset (from start of metadata) to the first RVA field in FieldRVA table.
DWORD *pFieldRvaRecordSize, // [OUT] Size of each record in FieldRVA table.
DWORD *pFieldRvaCount) // [OUT] Number of records in FieldRVA table.
{
return m_pStgdb->m_MiniMd.GetRvaOffsetData(
pFirstMethodRvaOffset,
pMethodDefRecordSize,
pMethodDefCount,
pFirstFieldRvaOffset,
pFieldRvaRecordSize,
pFieldRvaCount);
}
}; // class MDInternalRW
#endif //FEATURE_METADATA_INTERNAL_APIS
#endif // __MDInternalRW__h__
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey_dsa.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include "pal_types.h"
#include "pal_compiler.h"
#include "opensslshim.h"
/*
Shims the EVP_PKEY_get1_DSA method.
Returns the DSA instance for the EVP_PKEY.
*/
PALEXPORT DSA* CryptoNative_EvpPkeyGetDsa(EVP_PKEY* pkey);
/*
Shims the EVP_PKEY_set1_DSA method to set the DSA
instance on the EVP_KEY.
Returns 1 upon success, otherwise 0.
*/
PALEXPORT int32_t CryptoNative_EvpPkeySetDsa(EVP_PKEY* pkey, DSA* dsa);
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include "pal_types.h"
#include "pal_compiler.h"
#include "opensslshim.h"
/*
Shims the EVP_PKEY_get1_DSA method.
Returns the DSA instance for the EVP_PKEY.
*/
PALEXPORT DSA* CryptoNative_EvpPkeyGetDsa(EVP_PKEY* pkey);
/*
Shims the EVP_PKEY_set1_DSA method to set the DSA
instance on the EVP_KEY.
Returns 1 upon success, otherwise 0.
*/
PALEXPORT int32_t CryptoNative_EvpPkeySetDsa(EVP_PKEY* pkey, DSA* dsa);
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/pal/tests/palsuite/threading/ExitThread/test2/myexitcode.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*============================================================================
**
** Source: myexitcode.h
**
** Purpose: Define an exit code.
**
**
**==========================================================================*/
#define TEST_EXIT_CODE 316
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/*============================================================================
**
** Source: myexitcode.h
**
** Purpose: Define an exit code.
**
**
**==========================================================================*/
#define TEST_EXIT_CODE 316
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/native/external/rapidjson/memorybuffer.h
|
// Tencent is pleased to support the open source community by making RapidJSON available.
//
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
//
// Licensed under the MIT License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
#ifndef RAPIDJSON_MEMORYBUFFER_H_
#define RAPIDJSON_MEMORYBUFFER_H_
#include "stream.h"
#include "internal/stack.h"
RAPIDJSON_NAMESPACE_BEGIN
//! Represents an in-memory output byte stream.
/*!
This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.
It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.
Differences between MemoryBuffer and StringBuffer:
1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer.
2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.
\tparam Allocator type for allocating memory buffer.
\note implements Stream concept
*/
template <typename Allocator = CrtAllocator>
struct GenericMemoryBuffer {
typedef char Ch; // byte
GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
void Put(Ch c) { *stack_.template Push<Ch>() = c; }
void Flush() {}
void Clear() { stack_.Clear(); }
void ShrinkToFit() { stack_.ShrinkToFit(); }
Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
void Pop(size_t count) { stack_.template Pop<Ch>(count); }
const Ch* GetBuffer() const {
return stack_.template Bottom<Ch>();
}
size_t GetSize() const { return stack_.GetSize(); }
static const size_t kDefaultCapacity = 256;
mutable internal::Stack<Allocator> stack_;
};
typedef GenericMemoryBuffer<> MemoryBuffer;
//! Implement specialized version of PutN() with memset() for better performance.
template<>
inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {
std::memset(memoryBuffer.stack_.Push<char>(n), c, n * sizeof(c));
}
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_MEMORYBUFFER_H_
|
// Tencent is pleased to support the open source community by making RapidJSON available.
//
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
//
// Licensed under the MIT License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy of the License at
//
// http://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software distributed
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
#ifndef RAPIDJSON_MEMORYBUFFER_H_
#define RAPIDJSON_MEMORYBUFFER_H_
#include "stream.h"
#include "internal/stack.h"
RAPIDJSON_NAMESPACE_BEGIN
//! Represents an in-memory output byte stream.
/*!
This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.
It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.
Differences between MemoryBuffer and StringBuffer:
1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer.
2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.
\tparam Allocator type for allocating memory buffer.
\note implements Stream concept
*/
template <typename Allocator = CrtAllocator>
struct GenericMemoryBuffer {
typedef char Ch; // byte
GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
void Put(Ch c) { *stack_.template Push<Ch>() = c; }
void Flush() {}
void Clear() { stack_.Clear(); }
void ShrinkToFit() { stack_.ShrinkToFit(); }
Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
void Pop(size_t count) { stack_.template Pop<Ch>(count); }
const Ch* GetBuffer() const {
return stack_.template Bottom<Ch>();
}
size_t GetSize() const { return stack_.GetSize(); }
static const size_t kDefaultCapacity = 256;
mutable internal::Stack<Allocator> stack_;
};
typedef GenericMemoryBuffer<> MemoryBuffer;
//! Implement specialized version of PutN() with memset() for better performance.
template<>
inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {
std::memset(memoryBuffer.stack_.Push<char>(n), c, n * sizeof(c));
}
RAPIDJSON_NAMESPACE_END
#endif // RAPIDJSON_MEMORYBUFFER_H_
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/ilasm/asmtemplates.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef ASMTEMPLATES_H
#define ASMTEMPLATES_H
#ifdef _PREFAST_
#pragma warning(push)
#pragma warning(disable:22008) // "Suppress PREfast warnings about integer overflow"
#endif
inline ULONG GrowBuffer(ULONG startingSize)
{
int toAdd = startingSize >> 1;
if (toAdd < 8)
toAdd = 8;
if (toAdd > 2048)
toAdd = 2048;
return startingSize + toAdd;
}
/*****************************************************************************/
/* LIFO (stack) and FIFO (queue) templates (must precede #include "method.h")*/
template <class T>
class LIST_EL
{
public:
T* m_Ptr;
LIST_EL <T> *m_Next;
LIST_EL(T *item) {m_Next = NULL; m_Ptr = item; };
};
template <class T>
class LIFO
{
public:
inline LIFO() { m_pHead = NULL; };
inline ~LIFO() {T *val; while((val = POP()) != NULL) delete val; };
void PUSH(T *item)
{
m_pTemp = new LIST_EL <T>(item);
m_pTemp->m_Next = m_pHead;
m_pHead = m_pTemp;
};
T* POP()
{
T* ret = NULL;
if((m_pTemp = m_pHead) != NULL)
{
m_pHead = m_pHead->m_Next;
ret = m_pTemp->m_Ptr;
delete m_pTemp;
}
return ret;
};
private:
LIST_EL <T> *m_pHead;
LIST_EL <T> *m_pTemp;
};
template <class T>
class FIFO
{
public:
FIFO() { m_Arr = NULL; m_ulArrLen = 0; m_ulCount = 0; m_ulOffset = 0; };
~FIFO() {
if(m_Arr) {
for(ULONG i=0; i < m_ulCount; i++) {
if(m_Arr[i+m_ulOffset]) delete m_Arr[i+m_ulOffset];
}
delete [] m_Arr;
}
};
void RESET(bool DeleteElements = true) {
if(m_Arr) {
for(ULONG i=0; i < m_ulCount; i++) {
if(DeleteElements) delete m_Arr[i+m_ulOffset];
m_Arr[i+m_ulOffset] = NULL;
}
m_ulCount = 0;
m_ulOffset= 0;
}
};
void PUSH(T *item)
{
if(item)
{
if(m_ulCount+m_ulOffset >= m_ulArrLen)
{
if(m_ulOffset)
{
memcpy(m_Arr,&m_Arr[m_ulOffset],m_ulCount*sizeof(T*));
m_ulOffset = 0;
}
else
{
m_ulArrLen = GrowBuffer(m_ulArrLen);
T** tmp = new T*[m_ulArrLen];
if(tmp)
{
if(m_Arr)
{
memcpy(tmp,m_Arr,m_ulCount*sizeof(T*));
delete [] m_Arr;
}
m_Arr = tmp;
}
else fprintf(stderr,"\nOut of memory!\n");
}
}
m_Arr[m_ulOffset+m_ulCount] = item;
m_ulCount++;
}
};
ULONG COUNT() { return m_ulCount; };
T* POP()
{
T* ret = NULL;
if(m_ulCount)
{
ret = m_Arr[m_ulOffset++];
m_ulCount--;
}
return ret;
};
T* PEEK(ULONG idx) { return (idx < m_ulCount) ? m_Arr[m_ulOffset+idx] : NULL; };
private:
T** m_Arr;
ULONG m_ulCount;
ULONG m_ulOffset;
ULONG m_ulArrLen;
};
template <class T> struct Indx256
{
void* table[256];
Indx256() { memset(table,0,sizeof(table)); };
~Indx256()
{
ClearAll(true);
for(int i = 1; i < 256; i++) delete ((Indx256*)(table[i]));
};
T** IndexString(BYTE* psz, T* pObj)
{
if(*psz == 0)
{
table[0] = (void*)pObj;
return (T**)table;
}
else
{
Indx256* pInd = (Indx256*)(table[*psz]);
if(pInd == NULL)
{
pInd = new Indx256;
if(pInd)
table[*psz] = pInd;
else
{
_ASSERTE(!"Out of memory in Indx256::IndexString!");
fprintf(stderr,"\nOut of memory in Indx256::IndexString!\n");
return NULL;
}
}
return pInd->IndexString(psz+1,pObj);
}
};
T* FindString(BYTE* psz)
{
if(*psz > 0)
{
Indx256* pInd = (Indx256*)(table[*psz]);
return (pInd == NULL) ? NULL : pInd->FindString(psz+1);
}
return (T*)(table[0]); // if i==0
};
void ClearAll(bool DeleteObj)
{
if(DeleteObj) delete (T*)(table[0]);
table[0] = NULL;
for(unsigned i = 1; i < 256; i++)
{
if(table[i])
{
Indx256* pInd = (Indx256*)(table[i]);
pInd->ClearAll(DeleteObj);
//delete pInd;
//table[i] = NULL;
}
}
};
};
//
// Template intended for named objects, that expose function char* NameOf()
//
template <class T>
class FIFO_INDEXED
{
public:
FIFO_INDEXED() { m_Arr = NULL; m_ulArrLen = 0; m_ulCount = 0; m_ulOffset = 0; };
~FIFO_INDEXED() {
if(m_Arr)
{
RESET(true);
delete [] m_Arr;
}
};
void RESET(bool DeleteElements = true) {
if(m_Arr) {
unsigned i;
if(DeleteElements)
{
for(i=m_ulOffset; i < m_ulOffset+m_ulCount; i++)
{
T** ppT = m_Arr[i];
delete *ppT;
}
}
for(i=m_ulOffset; i < m_ulOffset+m_ulCount; i++)
{
*m_Arr[i] = NULL;
}
memset(&m_Arr[m_ulOffset],0,m_ulCount*sizeof(void*));
m_ulCount = 0;
m_ulOffset= 0;
}
};
void PUSH(T *item)
{
if(item)
{
T** itemaddr = m_Index.IndexString((BYTE*)(item->NameOf()),item);
if(m_ulCount+m_ulOffset >= m_ulArrLen)
{
if(m_ulOffset)
{
memcpy(m_Arr,&m_Arr[m_ulOffset],m_ulCount*sizeof(T*));
m_ulOffset = 0;
}
else
{
m_ulArrLen = GrowBuffer(m_ulArrLen);
T*** tmp = new T**[m_ulArrLen];
if(tmp)
{
if(m_Arr)
{
memcpy(tmp,m_Arr,m_ulCount*sizeof(T**));
delete [] m_Arr;
}
m_Arr = tmp;
}
else fprintf(stderr,"\nOut of memory!\n");
}
}
m_Arr[m_ulOffset+m_ulCount] = itemaddr;
m_ulCount++;
}
};
ULONG COUNT() { return m_ulCount; };
T* POP()
{
T* ret = NULL;
if(m_ulCount)
{
ret = *(m_Arr[m_ulOffset]);
*m_Arr[m_ulOffset] = NULL;
m_ulOffset++;
m_ulCount--;
}
return ret;
};
T* PEEK(ULONG idx) { return (idx < m_ulCount) ? *(m_Arr[m_ulOffset+idx]) : NULL; };
T* FIND(T* item) { return m_Index.FindString((BYTE*)(item->NameOf())); };
private:
T*** m_Arr;
ULONG m_ulCount;
ULONG m_ulOffset;
ULONG m_ulArrLen;
Indx256<T> m_Index;
};
template <class T>
class SORTEDARRAY
{
public:
SORTEDARRAY() { m_Arr = NULL; m_ulArrLen = 0; m_ulCount = 0; m_ulOffset = 0; };
~SORTEDARRAY() {
if(m_Arr) {
for(ULONG i=0; i < m_ulCount; i++) {
if(m_Arr[i+m_ulOffset]) delete m_Arr[i+m_ulOffset];
}
delete [] m_Arr;
}
};
void RESET(bool DeleteElements = true) {
if(m_Arr) {
if(DeleteElements)
{
for(ULONG i=0; i < m_ulCount; i++) {
delete m_Arr[i+m_ulOffset];
}
}
memset(m_Arr,0,m_ulArrLen*sizeof(T*));
m_ulCount = 0;
m_ulOffset= 0;
}
};
void PUSH(T *item)
{
if(item)
{
if(m_ulCount+m_ulOffset >= m_ulArrLen)
{
if(m_ulOffset)
{
memcpy(m_Arr,&m_Arr[m_ulOffset],m_ulCount*sizeof(T*));
m_ulOffset = 0;
}
else
{
m_ulArrLen = GrowBuffer(m_ulArrLen);
T** tmp = new T*[m_ulArrLen];
if(tmp)
{
if(m_Arr)
{
memcpy(tmp,m_Arr,m_ulCount*sizeof(T*));
delete [] m_Arr;
}
m_Arr = tmp;
}
else fprintf(stderr,"\nOut of memory!\n");
}
}
if(m_ulCount)
{
// find 1st arr.element > item
T** low = &m_Arr[m_ulOffset];
T** high = &m_Arr[m_ulOffset+m_ulCount-1];
T** mid;
if(item->ComparedTo(*high) > 0) mid = high+1;
else if(item->ComparedTo(*low) < 0) mid = low;
else for(;;)
{
mid = &low[(high - low) >> 1];
int cmp = item->ComparedTo(*mid);
if (mid == low)
{
if(cmp > 0) mid++;
break;
}
if (cmp > 0) low = mid;
else high = mid;
}
/////////////////////////////////////////////
memmove(mid+1,mid,(BYTE*)&m_Arr[m_ulOffset+m_ulCount]-(BYTE*)mid);
*mid = item;
}
else m_Arr[m_ulOffset+m_ulCount] = item;
m_ulCount++;
}
};
ULONG COUNT() { return m_ulCount; };
T* POP()
{
T* ret = NULL;
if(m_ulCount)
{
ret = m_Arr[m_ulOffset++];
m_ulCount--;
}
return ret;
};
T* PEEK(ULONG idx) { return (idx < m_ulCount) ? m_Arr[m_ulOffset+idx] : NULL; };
T* FIND(T* item)
{
if(m_ulCount)
{
T** low = &m_Arr[m_ulOffset];
T** high = &m_Arr[m_ulOffset+m_ulCount-1];
T** mid;
if(item->ComparedTo(*high) == 0) return(*high);
for(;;)
{
mid = &low[(high - low) >> 1];
int cmp = item->ComparedTo(*mid);
if (cmp == 0) return(*mid);
if (mid == low) break;
if (cmp > 0) low = mid;
else high = mid;
}
}
return NULL;
};
/*
T* FIND(U item)
{
if(m_ulCount)
{
T** low = &m_Arr[m_ulOffset];
T** high = &m_Arr[m_ulOffset+m_ulCount-1];
T** mid;
if((*high)->Compare(item) == 0) return(*high);
for(;;)
{
mid = &low[(high - low) >> 1];
int cmp = (*mid)->Compare(item);
if (cmp == 0) return(*mid);
if (mid == low) break;
if (cmp > 0) low = mid;
else high = mid;
}
}
return NULL;
};
*/
BOOL DEL(T* item)
{
if(m_ulCount)
{
T** low = &m_Arr[m_ulOffset];
T** high = &m_Arr[m_ulOffset+m_ulCount-1];
T** mid;
if(item->ComparedTo(*high) == 0)
{
delete (*high);
m_ulCount--;
return TRUE;
}
for(;;)
{
mid = &low[(high - low) >> 1];
int cmp = item->ComparedTo(*mid);
if (cmp == 0)
{
delete (*mid);
memmove(mid,mid+1,(BYTE*)&m_Arr[m_ulOffset+m_ulCount]-(BYTE*)mid-1);
m_ulCount--;
return TRUE;
}
if (mid == low) break;
if (cmp > 0) low = mid;
else high = mid;
}
}
return FALSE;
};
private:
T** m_Arr;
ULONG m_ulCount;
ULONG m_ulOffset;
ULONG m_ulArrLen;
};
template <class T> struct RBNODE
{
private:
DWORD dwRed;
public:
DWORD dwInUse;
T* tVal;
RBNODE<T>* pLeft;
RBNODE<T>* pRight;
RBNODE<T>* pParent;
RBNODE()
{
pLeft = pRight = pParent = NULL;
tVal = NULL;
dwRed = dwInUse = 0;
};
RBNODE(T* pVal, DWORD dwColor)
{
pLeft = pRight = pParent = NULL;
tVal = pVal;
dwRed = dwColor;
dwInUse = 0;
};
bool IsRed() { return (dwRed != 0); };
void SetRed() { dwRed = 1; };
void SetBlack() { dwRed = 0; };
};
#define BUCKETCOUNT 512
template <class T> class RBNODEBUCKET
{
private:
RBNODEBUCKET<T>* pNext;
RBNODE<T> bucket[BUCKETCOUNT];
unsigned alloc_count;
public:
RBNODEBUCKET()
{
alloc_count = 0;
pNext = NULL;
};
~RBNODEBUCKET() { if(pNext) delete pNext; };
bool CanAlloc() { return (alloc_count < BUCKETCOUNT); };
RBNODE<T>* AllocNode()
{
RBNODE<T>* pRet;
for(unsigned i = 0; i < BUCKETCOUNT; i++)
{
if(bucket[i].dwInUse == 0)
{
alloc_count++;
pRet = &bucket[i];
memset(pRet, 0, sizeof(RBNODE<T>));
pRet->dwInUse = 1;
return pRet;
}
}
_ASSERTE(!"AllocNode returns NULL");
return NULL;
};
bool FreeNode(RBNODE<T>* ptr)
{
size_t idx = ((size_t)ptr - (size_t)bucket)/sizeof(RBNODE<T>);
if(idx < BUCKETCOUNT)
{
bucket[idx].dwInUse = 0;
alloc_count--;
return true;
}
return false;
};
RBNODEBUCKET<T>* Next() { return pNext; };
void Append(RBNODEBUCKET<T>* ptr) { pNext = ptr; };
};
template <class T> class RBNODEPOOL
{
private:
RBNODEBUCKET<T> base;
public:
RBNODEPOOL()
{
memset(&base,0,sizeof(RBNODEBUCKET<T>));
};
RBNODE<T>* AllocNode()
{
RBNODEBUCKET<T>* pBucket = &base;
RBNODEBUCKET<T>* pLastBucket = &base;
do
{
if(pBucket->CanAlloc())
{
return pBucket->AllocNode();
}
pLastBucket = pBucket;
pBucket = pBucket->Next();
}
while (pBucket != NULL);
pLastBucket->Append(new RBNODEBUCKET<T>);
return pLastBucket->Next()->AllocNode();
};
void FreeNode(RBNODE<T>* ptr)
{
RBNODEBUCKET<T>* pBucket = &base;
do
{
if(pBucket->FreeNode(ptr))
break;
pBucket = pBucket->Next();
}
while (pBucket != NULL);
};
};
template <class T> class RBTREE
{
private:
RBNODE<T>* pRoot;
RBNODE<T>* pNil;
RBNODEPOOL<T> NodePool;
void RotateLeft(RBNODE<T>* pX)
{
RBNODE<T>* pY;
pY = pX->pRight;
pX->pRight = pY->pLeft;
if(pY->pLeft != pNil)
pY->pLeft->pParent = pX;
pY->pParent = pX->pParent;
if(pX == pX->pParent->pLeft)
pX->pParent->pLeft = pY;
else
pX->pParent->pRight = pY;
pY->pLeft = pX;
pX->pParent = pY;
};
void RotateRight(RBNODE<T>* pX)
{
RBNODE<T>* pY;
pY = pX->pLeft;
pX->pLeft = pY->pRight;
if(pY->pRight != pNil)
pY->pRight->pParent = pX;
pY->pParent = pX->pParent;
if(pX == pX->pParent->pLeft)
pX->pParent->pLeft = pY;
else
pX->pParent->pRight = pY;
pY->pRight = pX;
pX->pParent = pY;
};
void InsertNode(RBNODE<T>* pZ)
{
RBNODE<T>* pX;
RBNODE<T>* pY;
pZ->pLeft = pZ->pRight = pNil;
pY = pRoot;
pX = pRoot->pLeft;
if(pX != pY)
{
while(pX != pNil)
{
pY = pX;
if(pX->tVal->ComparedTo(pZ->tVal) > 0)
pX = pX->pLeft;
else
pX = pX->pRight;
}
}
pZ->pParent = pY;
if((pY == pRoot) || (pY->tVal->ComparedTo(pZ->tVal) > 0))
pY->pLeft = pZ;
else
pY->pRight = pZ;
};
void InitSpecNode(RBNODE<T>* pNode)
{
pNode->pLeft = pNode->pRight = pNode->pParent = pNode;
};
void DeleteNode(RBNODE<T>* pNode, bool DeletePayload = true)
{
if((pNode != pNil)&&(pNode != pRoot))
{
DeleteNode(pNode->pLeft, DeletePayload);
DeleteNode(pNode->pRight, DeletePayload);
if(DeletePayload)
delete pNode->tVal;
NodePool.FreeNode(pNode);
}
};
public:
RBTREE()
{
pRoot = NodePool.AllocNode();
InitSpecNode(pRoot);
pNil = NodePool.AllocNode();
InitSpecNode(pNil);
};
~RBTREE()
{
//RESET(false);
//NodePool.FreeNode(pRoot);
//NodePool.FreeNode(pNil);
};
void RESET(bool DeletePayload = true)
{
DeleteNode(pRoot->pLeft, DeletePayload);
InitSpecNode(pRoot);
InitSpecNode(pNil);
};
void PUSH(T* pT)
{
RBNODE<T>* pX;
RBNODE<T>* pY;
RBNODE<T>* pNewNode = NodePool.AllocNode();
pNewNode->tVal = pT;
pNewNode->SetRed();
InsertNode(pNewNode);
for(pX = pNewNode; pX->pParent->IsRed();)
{
if(pX->pParent == pX->pParent->pLeft)
{
pY = pX->pParent->pRight;
if(pY->IsRed())
{
pX->pParent->SetBlack();
pY->SetBlack();
pX->pParent->pParent->SetRed();
pX = pX->pParent->pParent;
}
else
{
if(pX == pX->pParent->pRight)
{
pX = pX->pParent;
RotateLeft(pX);
}
pX->pParent->SetBlack();
pX->pParent->pParent->SetRed();
RotateRight(pX->pParent->pParent);
}
}
else // if(pX->pParent == pX->pParent->pRight)
{
pY = pX->pParent->pParent->pLeft;
if(pY->IsRed())
{
pX->pParent->SetBlack();
pY->SetBlack();
pX->pParent->pParent->SetRed();
pX = pX->pParent->pParent;
}
else
{
if(pX == pX->pParent->pLeft)
{
pX = pX->pParent;
RotateRight(pX);
}
pX->pParent->SetBlack();
pX->pParent->pParent->SetRed();
RotateLeft(pX->pParent->pParent);
}
}// end if(pX->pParent == pX->pParent->pLeft) -- else
} // end for(pX = pNewNode; pX->pParent->IsRed();)
pRoot->pLeft->SetBlack();
};
T* FIND(T* pT)
{
RBNODE<T>* pX = pRoot->pLeft;
if((pX != pNil) && (pX != pRoot))
{
int cmp = pX->tVal->ComparedTo(pT);
while(cmp != 0)
{
if(cmp > 0)
pX = pX->pLeft;
else
pX = pX->pRight;
if(pX == pNil)
return NULL;
cmp = pX->tVal->ComparedTo(pT);
}
return pX->tVal;
}
return NULL;
};
};
#ifdef _PREFAST_
#pragma warning(pop)
#endif
#endif //ASMTEMPLATES_H
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef ASMTEMPLATES_H
#define ASMTEMPLATES_H
#ifdef _PREFAST_
#pragma warning(push)
#pragma warning(disable:22008) // "Suppress PREfast warnings about integer overflow"
#endif
inline ULONG GrowBuffer(ULONG startingSize)
{
int toAdd = startingSize >> 1;
if (toAdd < 8)
toAdd = 8;
if (toAdd > 2048)
toAdd = 2048;
return startingSize + toAdd;
}
/*****************************************************************************/
/* LIFO (stack) and FIFO (queue) templates (must precede #include "method.h")*/
template <class T>
class LIST_EL
{
public:
T* m_Ptr;
LIST_EL <T> *m_Next;
LIST_EL(T *item) {m_Next = NULL; m_Ptr = item; };
};
template <class T>
class LIFO
{
public:
inline LIFO() { m_pHead = NULL; };
inline ~LIFO() {T *val; while((val = POP()) != NULL) delete val; };
void PUSH(T *item)
{
m_pTemp = new LIST_EL <T>(item);
m_pTemp->m_Next = m_pHead;
m_pHead = m_pTemp;
};
T* POP()
{
T* ret = NULL;
if((m_pTemp = m_pHead) != NULL)
{
m_pHead = m_pHead->m_Next;
ret = m_pTemp->m_Ptr;
delete m_pTemp;
}
return ret;
};
private:
LIST_EL <T> *m_pHead;
LIST_EL <T> *m_pTemp;
};
template <class T>
class FIFO
{
public:
FIFO() { m_Arr = NULL; m_ulArrLen = 0; m_ulCount = 0; m_ulOffset = 0; };
~FIFO() {
if(m_Arr) {
for(ULONG i=0; i < m_ulCount; i++) {
if(m_Arr[i+m_ulOffset]) delete m_Arr[i+m_ulOffset];
}
delete [] m_Arr;
}
};
void RESET(bool DeleteElements = true) {
if(m_Arr) {
for(ULONG i=0; i < m_ulCount; i++) {
if(DeleteElements) delete m_Arr[i+m_ulOffset];
m_Arr[i+m_ulOffset] = NULL;
}
m_ulCount = 0;
m_ulOffset= 0;
}
};
void PUSH(T *item)
{
if(item)
{
if(m_ulCount+m_ulOffset >= m_ulArrLen)
{
if(m_ulOffset)
{
memcpy(m_Arr,&m_Arr[m_ulOffset],m_ulCount*sizeof(T*));
m_ulOffset = 0;
}
else
{
m_ulArrLen = GrowBuffer(m_ulArrLen);
T** tmp = new T*[m_ulArrLen];
if(tmp)
{
if(m_Arr)
{
memcpy(tmp,m_Arr,m_ulCount*sizeof(T*));
delete [] m_Arr;
}
m_Arr = tmp;
}
else fprintf(stderr,"\nOut of memory!\n");
}
}
m_Arr[m_ulOffset+m_ulCount] = item;
m_ulCount++;
}
};
ULONG COUNT() { return m_ulCount; };
T* POP()
{
T* ret = NULL;
if(m_ulCount)
{
ret = m_Arr[m_ulOffset++];
m_ulCount--;
}
return ret;
};
T* PEEK(ULONG idx) { return (idx < m_ulCount) ? m_Arr[m_ulOffset+idx] : NULL; };
private:
T** m_Arr;
ULONG m_ulCount;
ULONG m_ulOffset;
ULONG m_ulArrLen;
};
template <class T> struct Indx256
{
void* table[256];
Indx256() { memset(table,0,sizeof(table)); };
~Indx256()
{
ClearAll(true);
for(int i = 1; i < 256; i++) delete ((Indx256*)(table[i]));
};
T** IndexString(BYTE* psz, T* pObj)
{
if(*psz == 0)
{
table[0] = (void*)pObj;
return (T**)table;
}
else
{
Indx256* pInd = (Indx256*)(table[*psz]);
if(pInd == NULL)
{
pInd = new Indx256;
if(pInd)
table[*psz] = pInd;
else
{
_ASSERTE(!"Out of memory in Indx256::IndexString!");
fprintf(stderr,"\nOut of memory in Indx256::IndexString!\n");
return NULL;
}
}
return pInd->IndexString(psz+1,pObj);
}
};
T* FindString(BYTE* psz)
{
if(*psz > 0)
{
Indx256* pInd = (Indx256*)(table[*psz]);
return (pInd == NULL) ? NULL : pInd->FindString(psz+1);
}
return (T*)(table[0]); // if i==0
};
void ClearAll(bool DeleteObj)
{
if(DeleteObj) delete (T*)(table[0]);
table[0] = NULL;
for(unsigned i = 1; i < 256; i++)
{
if(table[i])
{
Indx256* pInd = (Indx256*)(table[i]);
pInd->ClearAll(DeleteObj);
//delete pInd;
//table[i] = NULL;
}
}
};
};
//
// Template intended for named objects, that expose function char* NameOf()
//
template <class T>
class FIFO_INDEXED
{
public:
FIFO_INDEXED() { m_Arr = NULL; m_ulArrLen = 0; m_ulCount = 0; m_ulOffset = 0; };
~FIFO_INDEXED() {
if(m_Arr)
{
RESET(true);
delete [] m_Arr;
}
};
void RESET(bool DeleteElements = true) {
if(m_Arr) {
unsigned i;
if(DeleteElements)
{
for(i=m_ulOffset; i < m_ulOffset+m_ulCount; i++)
{
T** ppT = m_Arr[i];
delete *ppT;
}
}
for(i=m_ulOffset; i < m_ulOffset+m_ulCount; i++)
{
*m_Arr[i] = NULL;
}
memset(&m_Arr[m_ulOffset],0,m_ulCount*sizeof(void*));
m_ulCount = 0;
m_ulOffset= 0;
}
};
void PUSH(T *item)
{
if(item)
{
T** itemaddr = m_Index.IndexString((BYTE*)(item->NameOf()),item);
if(m_ulCount+m_ulOffset >= m_ulArrLen)
{
if(m_ulOffset)
{
memcpy(m_Arr,&m_Arr[m_ulOffset],m_ulCount*sizeof(T*));
m_ulOffset = 0;
}
else
{
m_ulArrLen = GrowBuffer(m_ulArrLen);
T*** tmp = new T**[m_ulArrLen];
if(tmp)
{
if(m_Arr)
{
memcpy(tmp,m_Arr,m_ulCount*sizeof(T**));
delete [] m_Arr;
}
m_Arr = tmp;
}
else fprintf(stderr,"\nOut of memory!\n");
}
}
m_Arr[m_ulOffset+m_ulCount] = itemaddr;
m_ulCount++;
}
};
ULONG COUNT() { return m_ulCount; };
T* POP()
{
T* ret = NULL;
if(m_ulCount)
{
ret = *(m_Arr[m_ulOffset]);
*m_Arr[m_ulOffset] = NULL;
m_ulOffset++;
m_ulCount--;
}
return ret;
};
T* PEEK(ULONG idx) { return (idx < m_ulCount) ? *(m_Arr[m_ulOffset+idx]) : NULL; };
T* FIND(T* item) { return m_Index.FindString((BYTE*)(item->NameOf())); };
private:
T*** m_Arr;
ULONG m_ulCount;
ULONG m_ulOffset;
ULONG m_ulArrLen;
Indx256<T> m_Index;
};
template <class T>
class SORTEDARRAY
{
public:
SORTEDARRAY() { m_Arr = NULL; m_ulArrLen = 0; m_ulCount = 0; m_ulOffset = 0; };
~SORTEDARRAY() {
if(m_Arr) {
for(ULONG i=0; i < m_ulCount; i++) {
if(m_Arr[i+m_ulOffset]) delete m_Arr[i+m_ulOffset];
}
delete [] m_Arr;
}
};
void RESET(bool DeleteElements = true) {
if(m_Arr) {
if(DeleteElements)
{
for(ULONG i=0; i < m_ulCount; i++) {
delete m_Arr[i+m_ulOffset];
}
}
memset(m_Arr,0,m_ulArrLen*sizeof(T*));
m_ulCount = 0;
m_ulOffset= 0;
}
};
void PUSH(T *item)
{
if(item)
{
if(m_ulCount+m_ulOffset >= m_ulArrLen)
{
if(m_ulOffset)
{
memcpy(m_Arr,&m_Arr[m_ulOffset],m_ulCount*sizeof(T*));
m_ulOffset = 0;
}
else
{
m_ulArrLen = GrowBuffer(m_ulArrLen);
T** tmp = new T*[m_ulArrLen];
if(tmp)
{
if(m_Arr)
{
memcpy(tmp,m_Arr,m_ulCount*sizeof(T*));
delete [] m_Arr;
}
m_Arr = tmp;
}
else fprintf(stderr,"\nOut of memory!\n");
}
}
if(m_ulCount)
{
// find 1st arr.element > item
T** low = &m_Arr[m_ulOffset];
T** high = &m_Arr[m_ulOffset+m_ulCount-1];
T** mid;
if(item->ComparedTo(*high) > 0) mid = high+1;
else if(item->ComparedTo(*low) < 0) mid = low;
else for(;;)
{
mid = &low[(high - low) >> 1];
int cmp = item->ComparedTo(*mid);
if (mid == low)
{
if(cmp > 0) mid++;
break;
}
if (cmp > 0) low = mid;
else high = mid;
}
/////////////////////////////////////////////
memmove(mid+1,mid,(BYTE*)&m_Arr[m_ulOffset+m_ulCount]-(BYTE*)mid);
*mid = item;
}
else m_Arr[m_ulOffset+m_ulCount] = item;
m_ulCount++;
}
};
ULONG COUNT() { return m_ulCount; };
T* POP()
{
T* ret = NULL;
if(m_ulCount)
{
ret = m_Arr[m_ulOffset++];
m_ulCount--;
}
return ret;
};
T* PEEK(ULONG idx) { return (idx < m_ulCount) ? m_Arr[m_ulOffset+idx] : NULL; };
T* FIND(T* item)
{
if(m_ulCount)
{
T** low = &m_Arr[m_ulOffset];
T** high = &m_Arr[m_ulOffset+m_ulCount-1];
T** mid;
if(item->ComparedTo(*high) == 0) return(*high);
for(;;)
{
mid = &low[(high - low) >> 1];
int cmp = item->ComparedTo(*mid);
if (cmp == 0) return(*mid);
if (mid == low) break;
if (cmp > 0) low = mid;
else high = mid;
}
}
return NULL;
};
/*
T* FIND(U item)
{
if(m_ulCount)
{
T** low = &m_Arr[m_ulOffset];
T** high = &m_Arr[m_ulOffset+m_ulCount-1];
T** mid;
if((*high)->Compare(item) == 0) return(*high);
for(;;)
{
mid = &low[(high - low) >> 1];
int cmp = (*mid)->Compare(item);
if (cmp == 0) return(*mid);
if (mid == low) break;
if (cmp > 0) low = mid;
else high = mid;
}
}
return NULL;
};
*/
BOOL DEL(T* item)
{
if(m_ulCount)
{
T** low = &m_Arr[m_ulOffset];
T** high = &m_Arr[m_ulOffset+m_ulCount-1];
T** mid;
if(item->ComparedTo(*high) == 0)
{
delete (*high);
m_ulCount--;
return TRUE;
}
for(;;)
{
mid = &low[(high - low) >> 1];
int cmp = item->ComparedTo(*mid);
if (cmp == 0)
{
delete (*mid);
memmove(mid,mid+1,(BYTE*)&m_Arr[m_ulOffset+m_ulCount]-(BYTE*)mid-1);
m_ulCount--;
return TRUE;
}
if (mid == low) break;
if (cmp > 0) low = mid;
else high = mid;
}
}
return FALSE;
};
private:
T** m_Arr;
ULONG m_ulCount;
ULONG m_ulOffset;
ULONG m_ulArrLen;
};
template <class T> struct RBNODE
{
private:
DWORD dwRed;
public:
DWORD dwInUse;
T* tVal;
RBNODE<T>* pLeft;
RBNODE<T>* pRight;
RBNODE<T>* pParent;
RBNODE()
{
pLeft = pRight = pParent = NULL;
tVal = NULL;
dwRed = dwInUse = 0;
};
RBNODE(T* pVal, DWORD dwColor)
{
pLeft = pRight = pParent = NULL;
tVal = pVal;
dwRed = dwColor;
dwInUse = 0;
};
bool IsRed() { return (dwRed != 0); };
void SetRed() { dwRed = 1; };
void SetBlack() { dwRed = 0; };
};
#define BUCKETCOUNT 512
template <class T> class RBNODEBUCKET
{
private:
RBNODEBUCKET<T>* pNext;
RBNODE<T> bucket[BUCKETCOUNT];
unsigned alloc_count;
public:
RBNODEBUCKET()
{
alloc_count = 0;
pNext = NULL;
};
~RBNODEBUCKET() { if(pNext) delete pNext; };
bool CanAlloc() { return (alloc_count < BUCKETCOUNT); };
RBNODE<T>* AllocNode()
{
RBNODE<T>* pRet;
for(unsigned i = 0; i < BUCKETCOUNT; i++)
{
if(bucket[i].dwInUse == 0)
{
alloc_count++;
pRet = &bucket[i];
memset(pRet, 0, sizeof(RBNODE<T>));
pRet->dwInUse = 1;
return pRet;
}
}
_ASSERTE(!"AllocNode returns NULL");
return NULL;
};
bool FreeNode(RBNODE<T>* ptr)
{
size_t idx = ((size_t)ptr - (size_t)bucket)/sizeof(RBNODE<T>);
if(idx < BUCKETCOUNT)
{
bucket[idx].dwInUse = 0;
alloc_count--;
return true;
}
return false;
};
RBNODEBUCKET<T>* Next() { return pNext; };
void Append(RBNODEBUCKET<T>* ptr) { pNext = ptr; };
};
template <class T> class RBNODEPOOL
{
private:
RBNODEBUCKET<T> base;
public:
RBNODEPOOL()
{
memset(&base,0,sizeof(RBNODEBUCKET<T>));
};
RBNODE<T>* AllocNode()
{
RBNODEBUCKET<T>* pBucket = &base;
RBNODEBUCKET<T>* pLastBucket = &base;
do
{
if(pBucket->CanAlloc())
{
return pBucket->AllocNode();
}
pLastBucket = pBucket;
pBucket = pBucket->Next();
}
while (pBucket != NULL);
pLastBucket->Append(new RBNODEBUCKET<T>);
return pLastBucket->Next()->AllocNode();
};
void FreeNode(RBNODE<T>* ptr)
{
RBNODEBUCKET<T>* pBucket = &base;
do
{
if(pBucket->FreeNode(ptr))
break;
pBucket = pBucket->Next();
}
while (pBucket != NULL);
};
};
template <class T> class RBTREE
{
private:
RBNODE<T>* pRoot;
RBNODE<T>* pNil;
RBNODEPOOL<T> NodePool;
void RotateLeft(RBNODE<T>* pX)
{
RBNODE<T>* pY;
pY = pX->pRight;
pX->pRight = pY->pLeft;
if(pY->pLeft != pNil)
pY->pLeft->pParent = pX;
pY->pParent = pX->pParent;
if(pX == pX->pParent->pLeft)
pX->pParent->pLeft = pY;
else
pX->pParent->pRight = pY;
pY->pLeft = pX;
pX->pParent = pY;
};
void RotateRight(RBNODE<T>* pX)
{
RBNODE<T>* pY;
pY = pX->pLeft;
pX->pLeft = pY->pRight;
if(pY->pRight != pNil)
pY->pRight->pParent = pX;
pY->pParent = pX->pParent;
if(pX == pX->pParent->pLeft)
pX->pParent->pLeft = pY;
else
pX->pParent->pRight = pY;
pY->pRight = pX;
pX->pParent = pY;
};
void InsertNode(RBNODE<T>* pZ)
{
RBNODE<T>* pX;
RBNODE<T>* pY;
pZ->pLeft = pZ->pRight = pNil;
pY = pRoot;
pX = pRoot->pLeft;
if(pX != pY)
{
while(pX != pNil)
{
pY = pX;
if(pX->tVal->ComparedTo(pZ->tVal) > 0)
pX = pX->pLeft;
else
pX = pX->pRight;
}
}
pZ->pParent = pY;
if((pY == pRoot) || (pY->tVal->ComparedTo(pZ->tVal) > 0))
pY->pLeft = pZ;
else
pY->pRight = pZ;
};
void InitSpecNode(RBNODE<T>* pNode)
{
pNode->pLeft = pNode->pRight = pNode->pParent = pNode;
};
void DeleteNode(RBNODE<T>* pNode, bool DeletePayload = true)
{
if((pNode != pNil)&&(pNode != pRoot))
{
DeleteNode(pNode->pLeft, DeletePayload);
DeleteNode(pNode->pRight, DeletePayload);
if(DeletePayload)
delete pNode->tVal;
NodePool.FreeNode(pNode);
}
};
public:
RBTREE()
{
pRoot = NodePool.AllocNode();
InitSpecNode(pRoot);
pNil = NodePool.AllocNode();
InitSpecNode(pNil);
};
~RBTREE()
{
//RESET(false);
//NodePool.FreeNode(pRoot);
//NodePool.FreeNode(pNil);
};
void RESET(bool DeletePayload = true)
{
DeleteNode(pRoot->pLeft, DeletePayload);
InitSpecNode(pRoot);
InitSpecNode(pNil);
};
void PUSH(T* pT)
{
RBNODE<T>* pX;
RBNODE<T>* pY;
RBNODE<T>* pNewNode = NodePool.AllocNode();
pNewNode->tVal = pT;
pNewNode->SetRed();
InsertNode(pNewNode);
for(pX = pNewNode; pX->pParent->IsRed();)
{
if(pX->pParent == pX->pParent->pLeft)
{
pY = pX->pParent->pRight;
if(pY->IsRed())
{
pX->pParent->SetBlack();
pY->SetBlack();
pX->pParent->pParent->SetRed();
pX = pX->pParent->pParent;
}
else
{
if(pX == pX->pParent->pRight)
{
pX = pX->pParent;
RotateLeft(pX);
}
pX->pParent->SetBlack();
pX->pParent->pParent->SetRed();
RotateRight(pX->pParent->pParent);
}
}
else // if(pX->pParent == pX->pParent->pRight)
{
pY = pX->pParent->pParent->pLeft;
if(pY->IsRed())
{
pX->pParent->SetBlack();
pY->SetBlack();
pX->pParent->pParent->SetRed();
pX = pX->pParent->pParent;
}
else
{
if(pX == pX->pParent->pLeft)
{
pX = pX->pParent;
RotateRight(pX);
}
pX->pParent->SetBlack();
pX->pParent->pParent->SetRed();
RotateLeft(pX->pParent->pParent);
}
}// end if(pX->pParent == pX->pParent->pLeft) -- else
} // end for(pX = pNewNode; pX->pParent->IsRed();)
pRoot->pLeft->SetBlack();
};
T* FIND(T* pT)
{
RBNODE<T>* pX = pRoot->pLeft;
if((pX != pNil) && (pX != pRoot))
{
int cmp = pX->tVal->ComparedTo(pT);
while(cmp != 0)
{
if(cmp > 0)
pX = pX->pLeft;
else
pX = pX->pRight;
if(pX == pNil)
return NULL;
cmp = pX->tVal->ComparedTo(pT);
}
return pX->tVal;
}
return NULL;
};
};
#ifdef _PREFAST_
#pragma warning(pop)
#endif
#endif //ASMTEMPLATES_H
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/pal/src/libunwind/src/riscv/init.h
|
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
Copyright (C) 2014 Tilera Corp.
Copyright (C) 2021 Zhaofeng Li
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "unwind_i.h"
static inline int
common_init (struct cursor *c, unsigned use_prev_instr)
{
int ret, i;
for (i = 0; i < 32; i++)
c->dwarf.loc[i] = DWARF_REG_LOC (&c->dwarf, UNW_RISCV_X0 + i);
for (i = 32; i < DWARF_NUM_PRESERVED_REGS; i++)
c->dwarf.loc[i] = DWARF_NULL_LOC;
c->dwarf.loc[UNW_RISCV_PC] = DWARF_REG_LOC (&c->dwarf, UNW_RISCV_PC);
ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_RISCV_PC], &c->dwarf.ip);
if (ret < 0)
return ret;
ret = dwarf_get (&c->dwarf, DWARF_REG_LOC (&c->dwarf, UNW_TDEP_SP),
&c->dwarf.cfa);
if (ret < 0)
return ret;
c->sigcontext_format = RISCV_SCF_NONE;
c->sigcontext_addr = 0;
c->sigcontext_sp = 0;
c->sigcontext_pc = 0;
c->dwarf.args_size = 0;
c->dwarf.stash_frames = 0;
c->dwarf.use_prev_instr = use_prev_instr;
c->dwarf.pi_valid = 0;
c->dwarf.pi_is_dynamic = 0;
c->dwarf.hint = 0;
c->dwarf.prev_rs = 0;
return 0;
}
|
/* libunwind - a platform-independent unwind library
Copyright (C) 2008 CodeSourcery
Copyright (C) 2014 Tilera Corp.
Copyright (C) 2021 Zhaofeng Li
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "unwind_i.h"
static inline int
common_init (struct cursor *c, unsigned use_prev_instr)
{
int ret, i;
for (i = 0; i < 32; i++)
c->dwarf.loc[i] = DWARF_REG_LOC (&c->dwarf, UNW_RISCV_X0 + i);
for (i = 32; i < DWARF_NUM_PRESERVED_REGS; i++)
c->dwarf.loc[i] = DWARF_NULL_LOC;
c->dwarf.loc[UNW_RISCV_PC] = DWARF_REG_LOC (&c->dwarf, UNW_RISCV_PC);
ret = dwarf_get (&c->dwarf, c->dwarf.loc[UNW_RISCV_PC], &c->dwarf.ip);
if (ret < 0)
return ret;
ret = dwarf_get (&c->dwarf, DWARF_REG_LOC (&c->dwarf, UNW_TDEP_SP),
&c->dwarf.cfa);
if (ret < 0)
return ret;
c->sigcontext_format = RISCV_SCF_NONE;
c->sigcontext_addr = 0;
c->sigcontext_sp = 0;
c->sigcontext_pc = 0;
c->dwarf.args_size = 0;
c->dwarf.stash_frames = 0;
c->dwarf.use_prev_instr = use_prev_instr;
c->dwarf.pi_valid = 0;
c->dwarf.pi_is_dynamic = 0;
c->dwarf.hint = 0;
c->dwarf.prev_rs = 0;
return 0;
}
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/mono/mono/profiler/helper.h
|
#ifndef __MONO_PROFHELPER_H__
#define __MONO_PROFHELPER_H__
#ifndef HOST_WIN32
#include <sys/select.h>
#endif
#ifdef HOST_WIN32
#include <winsock2.h>
#endif
void mono_profhelper_add_to_fd_set (fd_set *set, int fd, int *max_fd);
void mono_profhelper_close_socket_fd (int fd);
void mono_profhelper_setup_command_server (int *server_socket, int *command_port, const char* profiler_name);
#endif
|
#ifndef __MONO_PROFHELPER_H__
#define __MONO_PROFHELPER_H__
#ifndef HOST_WIN32
#include <sys/select.h>
#endif
#ifdef HOST_WIN32
#include <winsock2.h>
#endif
void mono_profhelper_add_to_fd_set (fd_set *set, int fd, int *max_fd);
void mono_profhelper_close_socket_fd (int fd);
void mono_profhelper_setup_command_server (int *server_socket, int *command_port, const char* profiler_name);
#endif
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/vm/assemblybinder.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef _ASSEMBLYBINDER_H
#define _ASSEMBLYBINDER_H
#include <sarray.h>
#include "../binder/inc/applicationcontext.hpp"
class PEImage;
class NativeImage;
class Assembly;
class Module;
class AssemblyLoaderAllocator;
class AssemblyBinder
{
public:
HRESULT BindAssemblyByName(AssemblyNameData* pAssemblyNameData, BINDER_SPACE::Assembly** ppAssembly);
virtual HRESULT BindUsingPEImage(PEImage* pPEImage, BINDER_SPACE::Assembly** ppAssembly) = 0;
virtual HRESULT BindUsingAssemblyName(BINDER_SPACE::AssemblyName* pAssemblyName, BINDER_SPACE::Assembly** ppAssembly) = 0;
/// <summary>
/// Get LoaderAllocator for binders that contain it. For other binders, return NULL.
/// </summary>
virtual AssemblyLoaderAllocator* GetLoaderAllocator() = 0;
/// <summary>
/// Tells if the binder is a default binder (not a custom one)
/// </summary>
virtual bool IsDefault() = 0;
inline BINDER_SPACE::ApplicationContext* GetAppContext()
{
return &m_appContext;
}
INT_PTR GetManagedAssemblyLoadContext()
{
return m_ptrManagedAssemblyLoadContext;
}
void SetManagedAssemblyLoadContext(INT_PTR ptrManagedDefaultBinderInstance)
{
m_ptrManagedAssemblyLoadContext = ptrManagedDefaultBinderInstance;
}
NativeImage* LoadNativeImage(Module* componentModule, LPCUTF8 nativeImageName);
void AddLoadedAssembly(Assembly* loadedAssembly);
private:
BINDER_SPACE::ApplicationContext m_appContext;
// A GC handle to the managed AssemblyLoadContext.
// It is a long weak handle for collectible AssemblyLoadContexts and strong handle for non-collectible ones.
INT_PTR m_ptrManagedAssemblyLoadContext;
SArray<NativeImage*> m_nativeImages;
SArray<Assembly*> m_loadedAssemblies;
};
#endif
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef _ASSEMBLYBINDER_H
#define _ASSEMBLYBINDER_H
#include <sarray.h>
#include "../binder/inc/applicationcontext.hpp"
class PEImage;
class NativeImage;
class Assembly;
class Module;
class AssemblyLoaderAllocator;
class AssemblyBinder
{
public:
HRESULT BindAssemblyByName(AssemblyNameData* pAssemblyNameData, BINDER_SPACE::Assembly** ppAssembly);
virtual HRESULT BindUsingPEImage(PEImage* pPEImage, BINDER_SPACE::Assembly** ppAssembly) = 0;
virtual HRESULT BindUsingAssemblyName(BINDER_SPACE::AssemblyName* pAssemblyName, BINDER_SPACE::Assembly** ppAssembly) = 0;
/// <summary>
/// Get LoaderAllocator for binders that contain it. For other binders, return NULL.
/// </summary>
virtual AssemblyLoaderAllocator* GetLoaderAllocator() = 0;
/// <summary>
/// Tells if the binder is a default binder (not a custom one)
/// </summary>
virtual bool IsDefault() = 0;
inline BINDER_SPACE::ApplicationContext* GetAppContext()
{
return &m_appContext;
}
INT_PTR GetManagedAssemblyLoadContext()
{
return m_ptrManagedAssemblyLoadContext;
}
void SetManagedAssemblyLoadContext(INT_PTR ptrManagedDefaultBinderInstance)
{
m_ptrManagedAssemblyLoadContext = ptrManagedDefaultBinderInstance;
}
NativeImage* LoadNativeImage(Module* componentModule, LPCUTF8 nativeImageName);
void AddLoadedAssembly(Assembly* loadedAssembly);
private:
BINDER_SPACE::ApplicationContext m_appContext;
// A GC handle to the managed AssemblyLoadContext.
// It is a long weak handle for collectible AssemblyLoadContexts and strong handle for non-collectible ones.
INT_PTR m_ptrManagedAssemblyLoadContext;
SArray<NativeImage*> m_nativeImages;
SArray<Assembly*> m_loadedAssemblies;
};
#endif
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/gc/vxsort/vxsort_targets_enable_avx2.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifdef __GNUC__
#ifdef __clang__
#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
#else
#pragma GCC push_options
#pragma GCC target("avx512f")
#endif
#endif
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifdef __GNUC__
#ifdef __clang__
#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
#else
#pragma GCC push_options
#pragma GCC target("avx512f")
#endif
#endif
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/native/corehost/hostfxr_resolver.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef __HOSTFXR_RESOLVER_T_H__
#define __HOSTFXR_RESOLVER_T_H__
#include "hostfxr.h"
#include "pal.h"
#include "error_codes.h"
class hostfxr_resolver_t
{
public:
hostfxr_resolver_t(const pal::string_t& app_root);
~hostfxr_resolver_t();
StatusCode status_code() const { return m_status_code; }
const pal::string_t& host_path() const { return m_host_path; }
const pal::string_t& dotnet_root() const { return m_dotnet_root; }
const pal::string_t& fxr_path() const { return m_fxr_path; }
hostfxr_main_bundle_startupinfo_fn resolve_main_bundle_startupinfo();
hostfxr_set_error_writer_fn resolve_set_error_writer();
hostfxr_main_startupinfo_fn resolve_main_startupinfo();
hostfxr_main_fn resolve_main_v1();
private:
pal::dll_t m_hostfxr_dll{nullptr};
pal::string_t m_host_path;
pal::string_t m_dotnet_root;
pal::string_t m_fxr_path;
bool m_requires_startupinfo_iface{false};
StatusCode m_status_code;
};
#endif // __HOSTFXR_RESOLVER_T_H__
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef __HOSTFXR_RESOLVER_T_H__
#define __HOSTFXR_RESOLVER_T_H__
#include "hostfxr.h"
#include "pal.h"
#include "error_codes.h"
class hostfxr_resolver_t
{
public:
hostfxr_resolver_t(const pal::string_t& app_root);
~hostfxr_resolver_t();
StatusCode status_code() const { return m_status_code; }
const pal::string_t& host_path() const { return m_host_path; }
const pal::string_t& dotnet_root() const { return m_dotnet_root; }
const pal::string_t& fxr_path() const { return m_fxr_path; }
hostfxr_main_bundle_startupinfo_fn resolve_main_bundle_startupinfo();
hostfxr_set_error_writer_fn resolve_set_error_writer();
hostfxr_main_startupinfo_fn resolve_main_startupinfo();
hostfxr_main_fn resolve_main_v1();
private:
pal::dll_t m_hostfxr_dll{nullptr};
pal::string_t m_host_path;
pal::string_t m_dotnet_root;
pal::string_t m_fxr_path;
bool m_requires_startupinfo_iface{false};
StatusCode m_status_code;
};
#endif // __HOSTFXR_RESOLVER_T_H__
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/vm/eventing/eventpipe/ep-rt-coreclr.h
|
// Implementation of ep-rt.h targeting CoreCLR runtime.
#ifndef __EVENTPIPE_RT_CORECLR_H__
#define __EVENTPIPE_RT_CORECLR_H__
#include <eventpipe/ep-rt-config.h>
#ifdef ENABLE_PERFTRACING
#include <eventpipe/ep-thread.h>
#include <eventpipe/ep-types.h>
#include <eventpipe/ep-provider.h>
#include <eventpipe/ep-session-provider.h>
#include "fstream.h"
#include "typestring.h"
#include "win32threadpool.h"
#include "clrversion.h"
#undef EP_INFINITE_WAIT
#define EP_INFINITE_WAIT INFINITE
#undef EP_GCX_PREEMP_ENTER
#define EP_GCX_PREEMP_ENTER { GCX_PREEMP();
#undef EP_GCX_PREEMP_EXIT
#define EP_GCX_PREEMP_EXIT }
#undef EP_ALWAYS_INLINE
#define EP_ALWAYS_INLINE FORCEINLINE
#undef EP_NEVER_INLINE
#define EP_NEVER_INLINE NOINLINE
#undef EP_ALIGN_UP
#define EP_ALIGN_UP(val,align) ALIGN_UP(val,align)
#ifndef EP_RT_BUILD_TYPE_FUNC_NAME
#define EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, type_name, func_name) \
prefix_name ## _rt_ ## type_name ## _ ## func_name
#endif
template<typename LIST_TYPE>
static
inline
void
_rt_coreclr_list_alloc (LIST_TYPE *list) {
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL);
list->list = new (nothrow) typename LIST_TYPE::list_type_t ();
}
template<typename LIST_TYPE>
static
inline
void
_rt_coreclr_list_free (
LIST_TYPE *list,
void (*callback)(void *))
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL);
if (list->list) {
while (!list->list->IsEmpty ()) {
typename LIST_TYPE::element_type_t *current = list->list->RemoveHead ();
if (callback)
callback (reinterpret_cast<void *>(current->GetValue ()));
delete current;
}
delete list->list;
}
list->list = NULL;
}
template<typename LIST_TYPE>
static
inline
void
_rt_coreclr_list_clear (
LIST_TYPE *list,
void (*callback)(void *))
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
while (!list->list->IsEmpty ()) {
typename LIST_TYPE::element_type_t *current = list->list->RemoveHead ();
if (callback)
callback (reinterpret_cast<void *>(current->GetValue ()));
delete current;
}
}
template<typename LIST_TYPE, typename LIST_ITEM>
static
inline
bool
_rt_coreclr_list_append (
LIST_TYPE *list,
LIST_ITEM item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
typename LIST_TYPE::element_type_t *node = new (nothrow) typename LIST_TYPE::element_type_t (item);
if (node)
list->list->InsertTail (node);
return (node != NULL);
}
template<typename LIST_TYPE, typename LIST_ITEM, typename CONST_LIST_ITEM = LIST_ITEM>
static
inline
void
_rt_coreclr_list_remove (
LIST_TYPE *list,
CONST_LIST_ITEM item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
typename LIST_TYPE::element_type_t *current = list->list->GetHead ();
while (current) {
if (current->GetValue () == item) {
if (list->list->FindAndRemove (current))
delete current;
break;
}
current = list->list->GetNext (current);
}
}
template<typename LIST_TYPE, typename LIST_ITEM, typename CONST_LIST_TYPE = const LIST_TYPE, typename CONST_LIST_ITEM = const LIST_ITEM>
static
inline
bool
_rt_coreclr_list_find (
CONST_LIST_TYPE *list,
CONST_LIST_ITEM item_to_find,
LIST_ITEM *found_item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
EP_ASSERT (found_item != NULL);
bool found = false;
typename LIST_TYPE::element_type_t *current = list->list->GetHead ();
while (current) {
if (current->GetValue () == item_to_find) {
*found_item = current->GetValue ();
found = true;
break;
}
current = list->list->GetNext (current);
}
return found;
}
template<typename LIST_TYPE, typename CONST_LIST_TYPE = const LIST_TYPE>
static
inline
bool
_rt_coreclr_list_is_empty (CONST_LIST_TYPE *list)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL);
return (list->list == NULL || list->list->IsEmpty ());
}
template<typename LIST_TYPE, typename CONST_LIST_TYPE = const LIST_TYPE>
static
inline
bool
_rt_coreclr_list_is_valid (CONST_LIST_TYPE *list)
{
STATIC_CONTRACT_NOTHROW;
return (list != NULL && list->list != NULL);
}
template<typename LIST_TYPE, typename ITERATOR_TYPE, typename CONST_LIST_TYPE = const LIST_TYPE>
static
inline
ITERATOR_TYPE
_rt_coreclr_list_iterator_begin (CONST_LIST_TYPE *list)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
return list->list->begin ();
}
template<typename LIST_TYPE, typename ITERATOR_TYPE, typename CONST_LIST_TYPE = const LIST_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
bool
_rt_coreclr_list_iterator_end (
CONST_LIST_TYPE *list,
CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL && iterator != NULL);
return (*iterator == list->list->end ());
}
template<typename ITERATOR_TYPE>
static
inline
void
_rt_coreclr_list_iterator_next (ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL);
(*iterator)++;
}
template<typename ITERATOR_TYPE, typename ITEM_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
ITEM_TYPE
_rt_coreclr_list_iterator_value (CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL);
return const_cast<ITERATOR_TYPE *>(iterator)->operator*();
}
template<typename QUEUE_TYPE>
static
inline
void
_rt_coreclr_queue_alloc (QUEUE_TYPE *queue)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL);
queue->queue = new (nothrow) typename QUEUE_TYPE::queue_type_t ();
}
template<typename QUEUE_TYPE>
static
inline
void
_rt_coreclr_queue_free (QUEUE_TYPE *queue)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL);
if (queue->queue)
delete queue->queue;
queue->queue = NULL;
}
template<typename QUEUE_TYPE, typename ITEM_TYPE>
static
inline
bool
_rt_coreclr_queue_pop_head (
QUEUE_TYPE *queue,
ITEM_TYPE *item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL && queue->queue != NULL && item != NULL);
bool found = true;
typename QUEUE_TYPE::element_type_t *node = queue->queue->RemoveHead ();
if (node) {
*item = node->m_Value;
delete node;
} else {
*item = NULL;
found = false;
}
return found;
}
template<typename QUEUE_TYPE, typename ITEM_TYPE>
static
inline
bool
_rt_coreclr_queue_push_head (
QUEUE_TYPE *queue,
ITEM_TYPE item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL && queue->queue != NULL);
typename QUEUE_TYPE::element_type_t *node = new (nothrow) typename QUEUE_TYPE::element_type_t (item);
if (node)
queue->queue->InsertHead (node);
return (node != NULL);
}
template<typename QUEUE_TYPE, typename ITEM_TYPE>
static
inline
bool
_rt_coreclr_queue_push_tail (
QUEUE_TYPE *queue,
ITEM_TYPE item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL && queue->queue != NULL);
typename QUEUE_TYPE::element_type_t *node = new (nothrow) typename QUEUE_TYPE::element_type_t (item);
if (node)
queue->queue->InsertTail (node);
return (node != NULL);
}
template<typename QUEUE_TYPE, typename CONST_QUEUE_TYPE = const QUEUE_TYPE>
static
inline
bool
_rt_coreclr_queue_is_empty (CONST_QUEUE_TYPE *queue)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL && queue->queue != NULL);
return (queue->queue != NULL && queue->queue->IsEmpty ());
}
template<typename QUEUE_TYPE, typename CONST_QUEUE_TYPE = const QUEUE_TYPE>
static
inline
bool
_rt_coreclr_queue_is_valid (CONST_QUEUE_TYPE *queue)
{
STATIC_CONTRACT_NOTHROW;
return (queue != NULL && queue->queue != NULL);
}
template<typename ARRAY_TYPE>
static
inline
void
_rt_coreclr_array_alloc (ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL);
ep_array->array = new (nothrow) typename ARRAY_TYPE::array_type_t ();
}
template<typename ARRAY_TYPE>
static
inline
void
_rt_coreclr_array_alloc_capacity (
ARRAY_TYPE *ep_array,
size_t capacity)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL);
ep_array->array = new (nothrow) typename ARRAY_TYPE::array_type_t ();
if (ep_array->array)
ep_array->array->AllocNoThrow (capacity);
}
template<typename ARRAY_TYPE>
static
inline
void
_rt_coreclr_array_init_capacity (
ARRAY_TYPE *ep_array,
size_t capacity)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL);
if (ep_array->array)
ep_array->array->AllocNoThrow (capacity);
}
template<typename ARRAY_TYPE>
static
inline
void
_rt_coreclr_array_free (ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL);
if (ep_array->array) {
delete ep_array->array;
ep_array->array = NULL;
}
}
template<typename ARRAY_TYPE, typename ITEM_TYPE>
static
inline
bool
_rt_coreclr_array_append (
ARRAY_TYPE *ep_array,
ITEM_TYPE item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
return ep_array->array->PushNoThrow (item);
}
template<typename ARRAY_TYPE, typename ITEM_TYPE>
static
inline
void
_rt_coreclr_array_clear (ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
while (ep_array->array->Size () > 0)
ITEM_TYPE item = ep_array->array->Pop ();
ep_array->array->Shrink ();
}
template<typename ARRAY_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
size_t
_rt_coreclr_array_size (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
return ep_array->array->Size ();
}
template<typename ARRAY_TYPE, typename ITEM_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
ITEM_TYPE *
_rt_coreclr_array_data (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
return ep_array->array->Ptr ();
}
template<typename ARRAY_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
bool
_rt_coreclr_array_is_valid (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
return (ep_array->array != NULL);
}
template<typename ARRAY_TYPE, typename ITERATOR_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
ITERATOR_TYPE
_rt_coreclr_array_iterator_begin (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
ITERATOR_TYPE temp;
temp.array = ep_array->array;
temp.index = 0;
return temp;
}
template<typename ARRAY_TYPE, typename ITERATOR_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
bool
_rt_coreclr_array_iterator_end (
CONST_ARRAY_TYPE *ep_array,
CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && iterator != NULL && iterator->array != NULL);
return (iterator->index >= static_cast<size_t>(iterator->array->Size ()));
}
template<typename ITERATOR_TYPE>
static
inline
void
_rt_coreclr_array_iterator_next (ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL);
iterator->index++;
}
template<typename ITERATOR_TYPE, typename ITEM_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
ITEM_TYPE
_rt_coreclr_array_iterator_value (const CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL && iterator->array != NULL);
EP_ASSERT (iterator->index < static_cast<size_t>(iterator->array->Size ()));
return iterator->array->operator[] (iterator->index);
}
template<typename ARRAY_TYPE, typename ITERATOR_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
ITERATOR_TYPE
_rt_coreclr_array_reverse_iterator_begin (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
ITERATOR_TYPE temp;
temp.array = ep_array->array;
temp.index = static_cast<size_t>(ep_array->array->Size ());
return temp;
}
template<typename ARRAY_TYPE, typename ITERATOR_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
bool
_rt_coreclr_array_reverse_iterator_end (
CONST_ARRAY_TYPE *ep_array,
CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && iterator != NULL && iterator->array != NULL);
return (iterator->index == 0);
}
template<typename ITERATOR_TYPE>
static
inline
void
_rt_coreclr_array_reverse_iterator_next (ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL);
iterator->index--;
}
template<typename ITERATOR_TYPE, typename ITEM_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
ITEM_TYPE
_rt_coreclr_array_reverse_iterator_value (CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL && iterator->array != NULL);
EP_ASSERT (iterator->index > 0);
return iterator->array->operator[] (iterator->index - 1);
}
template<typename HASH_MAP_TYPE>
static
inline
void
_rt_coreclr_hash_map_alloc (
HASH_MAP_TYPE *hash_map,
uint32_t (*hash_callback)(const void *),
bool (*eq_callback)(const void *, const void *),
void (*key_free_callback)(void *),
void (*value_free_callback)(void *))
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && key_free_callback == NULL);
hash_map->table = new (nothrow) typename HASH_MAP_TYPE::table_type_t ();
hash_map->callbacks.key_free_func = key_free_callback;
hash_map->callbacks.value_free_func = value_free_callback;
}
template<typename HASH_MAP_TYPE>
static
inline
void
_rt_coreclr_hash_map_free (HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL);
if (hash_map->table) {
if (hash_map->callbacks.value_free_func) {
for (typename HASH_MAP_TYPE::table_type_t::Iterator iterator = hash_map->table->Begin (); iterator != hash_map->table->End (); ++iterator)
hash_map->callbacks.value_free_func (reinterpret_cast<void *>((ptrdiff_t)(iterator->Value ())));
}
delete hash_map->table;
}
}
template<typename HASH_MAP_TYPE, typename KEY_TYPE, typename VALUE_TYPE>
static
inline
bool
_rt_coreclr_hash_map_add (
HASH_MAP_TYPE *hash_map,
KEY_TYPE key,
VALUE_TYPE value)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
return hash_map->table->AddNoThrow (typename HASH_MAP_TYPE::table_type_t::element_t (key, value));
}
template<typename HASH_MAP_TYPE, typename KEY_TYPE, typename VALUE_TYPE>
static
inline
bool
_rt_coreclr_hash_map_add_or_replace (
HASH_MAP_TYPE *hash_map,
KEY_TYPE key,
VALUE_TYPE value)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
return hash_map->table->AddOrReplaceNoThrow (typename HASH_MAP_TYPE::table_type_t::element_t (key, value));
}
template<typename HASH_MAP_TYPE>
static
inline
void
_rt_coreclr_hash_map_remove_all (HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
if (hash_map->callbacks.value_free_func) {
for (typename HASH_MAP_TYPE::table_type_t::Iterator iterator = hash_map->table->Begin (); iterator != hash_map->table->End (); ++iterator)
hash_map->callbacks.value_free_func (reinterpret_cast<void *>((ptrdiff_t)(iterator->Value ())));
}
hash_map->table->RemoveAll ();
}
template<typename HASH_MAP_TYPE, typename KEY_TYPE, typename VALUE_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE, typename CONST_KEY_TYPE = const KEY_TYPE>
static
inline
bool
_rt_coreclr_hash_map_lookup (
CONST_HASH_MAP_TYPE *hash_map,
CONST_KEY_TYPE key,
VALUE_TYPE *value)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
const typename HASH_MAP_TYPE::table_type_t::element_t *ret = hash_map->table->LookupPtr ((KEY_TYPE)key);
if (ret == NULL)
return false;
*value = ret->Value ();
return true;
}
template<typename HASH_MAP_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE>
static
inline
uint32_t
_rt_coreclr_hash_map_count (CONST_HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
return hash_map->table->GetCount ();
}
template<typename HASH_MAP_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE>
static
inline
bool
_rt_coreclr_hash_map_is_valid (CONST_HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
return (hash_map != NULL && hash_map->table != NULL);
}
template<typename HASH_MAP_TYPE, typename KEY_TYPE, typename CONST_KEY_TYPE = const KEY_TYPE>
static
inline
void
_rt_coreclr_hash_map_remove (
HASH_MAP_TYPE *hash_map,
CONST_KEY_TYPE key)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
const typename HASH_MAP_TYPE::table_type_t::element_t *ret = NULL;
if (hash_map->callbacks.value_free_func)
ret = hash_map->table->LookupPtr ((KEY_TYPE)key);
hash_map->table->Remove ((KEY_TYPE)key);
if (ret)
hash_map->callbacks.value_free_func (reinterpret_cast<void *>(static_cast<ptrdiff_t>(ret->Value ())));
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE>
static
inline
ITERATOR_TYPE
_rt_coreclr_hash_map_iterator_begin (CONST_HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
return hash_map->table->Begin ();
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
bool
_rt_coreclr_hash_map_iterator_end (
CONST_HASH_MAP_TYPE *hash_map,
CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL && iterator != NULL);
return (hash_map->table->End () == *iterator);
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE>
static
inline
void
_rt_coreclr_hash_map_iterator_next (ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (iterator != NULL);
(*iterator)++;
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE, typename KEY_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
KEY_TYPE
_rt_coreclr_hash_map_iterator_key (CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (iterator != NULL);
return (*iterator)->Key ();
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE, typename VALUE_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
VALUE_TYPE
_rt_coreclr_hash_map_iterator_value (CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (iterator != NULL);
return (*iterator)->Value ();
}
#define EP_RT_DEFINE_LIST_PREFIX(prefix_name, list_name, list_type, item_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, alloc) (list_type *list) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_alloc<list_type>(list); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, free) (list_type *list, void (*callback)(void *)) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_free<list_type>(list, callback); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, clear) (list_type *list, void (*callback)(void *)) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_clear<list_type>(list, callback); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, append) (list_type *list, item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_append<list_type, item_type>(list, item); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, remove) (list_type *list, const item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_remove<list_type, item_type>(list, item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, find) (const list_type *list, const item_type item_to_find, item_type *found_item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_find<list_type, item_type>(list, item_to_find, found_item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, is_empty) (const list_type *list) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_is_empty<list_type>(list); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, is_valid) (const list_type *list) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_is_valid<list_type>(list); \
}
#undef EP_RT_DEFINE_LIST
#define EP_RT_DEFINE_LIST(list_name, list_type, item_type) \
EP_RT_DEFINE_LIST_PREFIX(ep, list_name, list_type, item_type)
#define EP_RT_DEFINE_LIST_ITERATOR_PREFIX(prefix_name, list_name, list_type, iterator_type, item_type) \
static inline iterator_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, iterator_begin) (const list_type *list) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_iterator_begin<list_type, iterator_type>(list); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, iterator_end) (const list_type *list, const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_iterator_end<list_type, iterator_type>(list, iterator); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, iterator_next) (iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_iterator_next<iterator_type>(iterator); \
} \
static inline item_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, iterator_value) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_iterator_value<iterator_type, item_type>(iterator); \
}
#undef EP_RT_DEFINE_LIST_ITERATOR
#define EP_RT_DEFINE_LIST_ITERATOR(list_name, list_type, iterator_type, item_type) \
EP_RT_DEFINE_LIST_ITERATOR_PREFIX(ep, list_name, list_type, iterator_type, item_type)
#define EP_RT_DEFINE_QUEUE_PREFIX(prefix_name, queue_name, queue_type, item_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, alloc) (queue_type *queue) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_queue_alloc<queue_type>(queue); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, free) (queue_type *queue) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_queue_free<queue_type>(queue); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, pop_head) (queue_type *queue, item_type *item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_pop_head<queue_type, item_type>(queue, item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, push_head) (queue_type *queue, item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_push_head<queue_type, item_type>(queue, item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, push_tail) (queue_type *queue, item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_push_tail<queue_type, item_type>(queue, item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, is_empty) (const queue_type *queue) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_is_empty<queue_type>(queue); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, is_valid) (const queue_type *queue) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_is_valid<queue_type>(queue); \
}
#undef EP_RT_DEFINE_QUEUE
#define EP_RT_DEFINE_QUEUE(queue_name, queue_type, item_type) \
EP_RT_DEFINE_QUEUE_PREFIX(ep, queue_name, queue_type, item_type)
#define EP_RT_DEFINE_ARRAY_PREFIX(prefix_name, array_name, array_type, iterator_type, item_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, alloc) (array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_alloc<array_type>(ep_array); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, alloc_capacity) (array_type *ep_array, size_t capacity) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_alloc_capacity<array_type>(ep_array, capacity); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, free) (array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_free<array_type>(ep_array); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, append) (array_type *ep_array, item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_append<array_type, item_type> (ep_array, item); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, clear) (array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_clear<array_type, item_type> (ep_array); \
} \
static inline size_t EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, size) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_size<array_type> (ep_array); \
} \
static inline item_type * EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, data) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_data<array_type, item_type> (ep_array); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, is_valid) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_is_valid<array_type> (ep_array); \
}
#define EP_RT_DEFINE_LOCAL_ARRAY_PREFIX(prefix_name, array_name, array_type, iterator_type, item_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, init) (array_type *ep_array) { \
STATIC_CONTRACT_NOTHROW; \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, init_capacity) (array_type *ep_array, size_t capacity) { \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_init_capacity<array_type>(ep_array, capacity); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, fini) (array_type *ep_array) { \
STATIC_CONTRACT_NOTHROW; \
}
#undef EP_RT_DEFINE_ARRAY
#define EP_RT_DEFINE_ARRAY(array_name, array_type, iterator_type, item_type) \
EP_RT_DEFINE_ARRAY_PREFIX(ep, array_name, array_type, iterator_type, item_type)
#undef EP_RT_DEFINE_LOCAL_ARRAY
#define EP_RT_DEFINE_LOCAL_ARRAY(array_name, array_type, iterator_type, item_type) \
EP_RT_DEFINE_LOCAL_ARRAY_PREFIX(ep, array_name, array_type, iterator_type, item_type)
#define EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, var_type) \
var_type::array_type_t _local_ ##var_name; \
var_type var_name; \
var_name.array = &_local_ ##var_name
#define EP_RT_DEFINE_ARRAY_ITERATOR_PREFIX(prefix_name, array_name, array_type, iterator_type, item_type) \
static inline iterator_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, iterator_begin) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_iterator_begin<array_type, iterator_type> (ep_array); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, iterator_end) (const array_type *ep_array, const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_iterator_end<array_type, iterator_type> (ep_array, iterator); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, iterator_next) (iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_iterator_next<iterator_type> (iterator); \
} \
static inline item_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, iterator_value) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_iterator_value<iterator_type, item_type> (iterator); \
}
#define EP_RT_DEFINE_ARRAY_REVERSE_ITERATOR_PREFIX(prefix_name, array_name, array_type, iterator_type, item_type) \
static inline iterator_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, reverse_iterator_begin) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_reverse_iterator_begin<array_type, iterator_type> (ep_array); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, reverse_iterator_end) (const array_type *ep_array, const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_reverse_iterator_end<array_type, iterator_type> (ep_array, iterator); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, reverse_iterator_next) (iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_reverse_iterator_next<iterator_type> (iterator); \
} \
static inline item_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, reverse_iterator_value) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_reverse_iterator_value<iterator_type, item_type> (iterator); \
}
#undef EP_RT_DEFINE_ARRAY_ITERATOR
#define EP_RT_DEFINE_ARRAY_ITERATOR(array_name, array_type, iterator_type, item_type) \
EP_RT_DEFINE_ARRAY_ITERATOR_PREFIX(ep, array_name, array_type, iterator_type, item_type)
#undef EP_RT_DEFINE_ARRAY_REVERSE_ITERATOR
#define EP_RT_DEFINE_ARRAY_REVERSE_ITERATOR(array_name, array_type, iterator_type, item_type) \
EP_RT_DEFINE_ARRAY_REVERSE_ITERATOR_PREFIX(ep, array_name, array_type, iterator_type, item_type)
#define EP_RT_DEFINE_HASH_MAP_BASE_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, alloc) (hash_map_type *hash_map, uint32_t (*hash_callback)(const void *), bool (*eq_callback)(const void *, const void *), void (*key_free_callback)(void *), void (*value_free_callback)(void *)) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_alloc<hash_map_type>(hash_map, hash_callback, eq_callback, key_free_callback, value_free_callback); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, free) (hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_free<hash_map_type>(hash_map); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, add) (hash_map_type *hash_map, key_type key, value_type value) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_add<hash_map_type, key_type, value_type>(hash_map, key, value); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, remove_all) (hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_remove_all<hash_map_type>(hash_map); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, lookup) (const hash_map_type *hash_map, const key_type key, value_type *value) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_lookup<hash_map_type, key_type, value_type>(hash_map, key, value); \
} \
static inline uint32_t EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, count) (const hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_count<hash_map_type>(hash_map); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, is_valid) (const hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_is_valid<hash_map_type>(hash_map); \
}
#define EP_RT_DEFINE_HASH_MAP_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_BASE_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, add_or_replace) (hash_map_type *hash_map, key_type key, value_type value) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_add_or_replace<hash_map_type, key_type, value_type>(hash_map, key, value); \
} \
#define EP_RT_DEFINE_HASH_MAP_REMOVE_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_BASE_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, remove) (hash_map_type *hash_map, const key_type key) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_remove<hash_map_type, key_type>(hash_map, key); \
}
#undef EP_RT_DEFINE_HASH_MAP
#define EP_RT_DEFINE_HASH_MAP(hash_map_name, hash_map_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_PREFIX(ep, hash_map_name, hash_map_type, key_type, value_type)
#undef EP_RT_DEFINE_HASH_MAP_REMOVE
#define EP_RT_DEFINE_HASH_MAP_REMOVE(hash_map_name, hash_map_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_REMOVE_PREFIX(ep, hash_map_name, hash_map_type, key_type, value_type)
#define EP_RT_DEFINE_HASH_MAP_ITERATOR_PREFIX(prefix_name, hash_map_name, hash_map_type, iterator_type, key_type, value_type) \
static inline iterator_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_begin) (const hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_iterator_begin<hash_map_type, iterator_type>(hash_map); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_end) (const hash_map_type *hash_map, const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_iterator_end<hash_map_type, iterator_type>(hash_map, iterator); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_next) (iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_iterator_next<hash_map_type, iterator_type>(iterator); \
} \
static inline key_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_key) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_iterator_key<hash_map_type, iterator_type, key_type>(iterator); \
} \
static inline value_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_value) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_iterator_value<hash_map_type, iterator_type, value_type>(iterator); \
}
#undef EP_RT_DEFINE_HASH_MAP_ITERATOR
#define EP_RT_DEFINE_HASH_MAP_ITERATOR(hash_map_name, hash_map_type, iterator_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_ITERATOR_PREFIX(ep, hash_map_name, hash_map_type, iterator_type, key_type, value_type)
static
inline
ep_rt_lock_handle_t *
ep_rt_coreclr_config_lock_get (void)
{
STATIC_CONTRACT_NOTHROW;
extern ep_rt_lock_handle_t _ep_rt_coreclr_config_lock_handle;
return &_ep_rt_coreclr_config_lock_handle;
}
static
inline
const ep_char8_t *
ep_rt_entrypoint_assembly_name_get_utf8 (void)
{
STATIC_CONTRACT_NOTHROW;
AppDomain *app_domain_ref = nullptr;
Assembly *assembly_ref = nullptr;
app_domain_ref = GetAppDomain ();
if (app_domain_ref != nullptr)
{
assembly_ref = app_domain_ref->GetRootAssembly ();
if (assembly_ref != nullptr)
{
return reinterpret_cast<const ep_char8_t*>(assembly_ref->GetSimpleName ());
}
}
// fallback to the empty string if we can't get assembly info, e.g., if the runtime is
// suspended before an assembly is loaded.
return reinterpret_cast<const ep_char8_t*>("");
}
static
const ep_char8_t *
ep_rt_runtime_version_get_utf8 (void)
{
STATIC_CONTRACT_NOTHROW;
return reinterpret_cast<const ep_char8_t*>(CLR_PRODUCT_VERSION);
}
/*
* Atomics.
*/
static
inline
uint32_t
ep_rt_atomic_inc_uint32_t (volatile uint32_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<uint32_t>(InterlockedIncrement ((volatile LONG *)(value)));
}
static
inline
uint32_t
ep_rt_atomic_dec_uint32_t (volatile uint32_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<uint32_t>(InterlockedDecrement ((volatile LONG *)(value)));
}
static
inline
int32_t
ep_rt_atomic_inc_int32_t (volatile int32_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int32_t>(InterlockedIncrement ((volatile LONG *)(value)));
}
static
inline
int32_t
ep_rt_atomic_dec_int32_t (volatile int32_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int32_t>(InterlockedDecrement ((volatile LONG *)(value)));
}
static
inline
int64_t
ep_rt_atomic_inc_int64_t (volatile int64_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int64_t>(InterlockedIncrement64 ((volatile LONG64 *)(value)));
}
static
inline
int64_t
ep_rt_atomic_dec_int64_t (volatile int64_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int64_t>(InterlockedDecrement64 ((volatile LONG64 *)(value)));
}
static
inline
size_t
ep_rt_atomic_compare_exchange_size_t (volatile size_t *target, size_t expected, size_t value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<size_t>(InterlockedCompareExchangeT<size_t> (target, value, expected));
}
/*
* EventPipe.
*/
EP_RT_DEFINE_ARRAY (session_id_array, ep_rt_session_id_array_t, ep_rt_session_id_array_iterator_t, EventPipeSessionID)
EP_RT_DEFINE_ARRAY_ITERATOR (session_id_array, ep_rt_session_id_array_t, ep_rt_session_id_array_iterator_t, EventPipeSessionID)
EP_RT_DEFINE_ARRAY (execution_checkpoint_array, ep_rt_execution_checkpoint_array_t, ep_rt_execution_checkpoint_array_iterator_t, EventPipeExecutionCheckpoint *)
EP_RT_DEFINE_ARRAY_ITERATOR (execution_checkpoint_array, ep_rt_execution_checkpoint_array_t, ep_rt_execution_checkpoint_array_iterator_t, EventPipeExecutionCheckpoint *)
static
void
ep_rt_init (void)
{
STATIC_CONTRACT_NOTHROW;
extern ep_rt_lock_handle_t _ep_rt_coreclr_config_lock_handle;
extern CrstStatic _ep_rt_coreclr_config_lock;
_ep_rt_coreclr_config_lock_handle.lock = &_ep_rt_coreclr_config_lock;
_ep_rt_coreclr_config_lock_handle.lock->InitNoThrow (CrstEventPipe, (CrstFlags)(CRST_REENTRANCY | CRST_TAKEN_DURING_SHUTDOWN | CRST_HOST_BREAKABLE));
if (CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeProcNumbers) != 0) {
#ifndef TARGET_UNIX
// setup the windows processor group offset table
uint16_t groups = ::GetActiveProcessorGroupCount ();
extern uint32_t *_ep_rt_coreclr_proc_group_offsets;
_ep_rt_coreclr_proc_group_offsets = new (nothrow) uint32_t [groups];
if (_ep_rt_coreclr_proc_group_offsets) {
uint32_t procs = 0;
for (uint16_t i = 0; i < procs; ++i) {
_ep_rt_coreclr_proc_group_offsets [i] = procs;
procs += GetActiveProcessorCount (i);
}
}
#endif
}
}
static
inline
void
ep_rt_init_finish (void)
{
STATIC_CONTRACT_NOTHROW;
}
static
inline
void
ep_rt_shutdown (void)
{
STATIC_CONTRACT_NOTHROW;
}
static
inline
bool
ep_rt_config_aquire (void)
{
STATIC_CONTRACT_NOTHROW;
return ep_rt_lock_aquire (ep_rt_coreclr_config_lock_get ());
}
static
inline
bool
ep_rt_config_release (void)
{
STATIC_CONTRACT_NOTHROW;
return ep_rt_lock_release (ep_rt_coreclr_config_lock_get ());
}
#ifdef EP_CHECKED_BUILD
static
inline
void
ep_rt_config_requires_lock_held (void)
{
STATIC_CONTRACT_NOTHROW;
ep_rt_lock_requires_lock_held (ep_rt_coreclr_config_lock_get ());
}
static
inline
void
ep_rt_config_requires_lock_not_held (void)
{
STATIC_CONTRACT_NOTHROW;
ep_rt_lock_requires_lock_not_held (ep_rt_coreclr_config_lock_get ());
}
#endif
static
inline
bool
ep_rt_walk_managed_stack_for_thread (
ep_rt_thread_handle_t thread,
EventPipeStackContents *stack_contents)
{
STATIC_CONTRACT_NOTHROW;
extern bool ep_rt_coreclr_walk_managed_stack_for_thread (ep_rt_thread_handle_t thread, EventPipeStackContents *stack_contents);
return ep_rt_coreclr_walk_managed_stack_for_thread (thread, stack_contents);
}
static
inline
bool
ep_rt_method_get_simple_assembly_name (
ep_rt_method_desc_t *method,
ep_char8_t *name,
size_t name_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (method != NULL);
EP_ASSERT (name != NULL);
const ep_char8_t *assembly_name = method->GetLoaderModule ()->GetAssembly ()->GetSimpleName ();
if (!assembly_name)
return false;
size_t assembly_name_len = strlen (assembly_name) + 1;
size_t to_copy = assembly_name_len < name_len ? assembly_name_len : name_len;
memcpy (name, assembly_name, to_copy);
name [to_copy - 1] = 0;
return true;
}
static
bool
ep_rt_method_get_full_name (
ep_rt_method_desc_t *method,
ep_char8_t *name,
size_t name_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (method != NULL);
EP_ASSERT (name != NULL);
bool result = true;
EX_TRY
{
SString method_name;
StackScratchBuffer conversion;
TypeString::AppendMethodInternal (method_name, method, TypeString::FormatNamespace | TypeString::FormatSignature);
const ep_char8_t *method_name_utf8 = method_name.GetUTF8 (conversion);
if (method_name_utf8) {
size_t method_name_utf8_len = strlen (method_name_utf8) + 1;
size_t to_copy = method_name_utf8_len < name_len ? method_name_utf8_len : name_len;
memcpy (name, method_name_utf8, to_copy);
name [to_copy - 1] = 0;
} else {
result = false;
}
}
EX_CATCH
{
result = false;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
static
inline
void
ep_rt_provider_config_init (EventPipeProviderConfiguration *provider_config)
{
STATIC_CONTRACT_NOTHROW;
if (!ep_rt_utf8_string_compare (ep_config_get_rundown_provider_name_utf8 (), ep_provider_config_get_provider_name (provider_config))) {
MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.Level = ep_provider_config_get_logging_level (provider_config);
MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.EnabledKeywordsBitmask = ep_provider_config_get_keywords (provider_config);
MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled = true;
}
}
// This function is auto-generated from /src/scripts/genEventPipe.py
#ifdef TARGET_UNIX
extern "C" void InitProvidersAndEvents ();
#else
extern void InitProvidersAndEvents ();
#endif
static
void
ep_rt_init_providers_and_events (void)
{
STATIC_CONTRACT_NOTHROW;
EX_TRY
{
InitProvidersAndEvents ();
}
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
}
static
inline
bool
ep_rt_providers_validate_all_disabled (void)
{
STATIC_CONTRACT_NOTHROW;
return (!MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled &&
!MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled &&
!MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled);
}
static
inline
void
ep_rt_prepare_provider_invoke_callback (EventPipeProviderCallbackData *provider_callback_data)
{
STATIC_CONTRACT_NOTHROW;
}
static
void
ep_rt_provider_invoke_callback (
EventPipeCallback callback_func,
const uint8_t *source_id,
unsigned long is_enabled,
uint8_t level,
uint64_t match_any_keywords,
uint64_t match_all_keywords,
EventFilterDescriptor *filter_data,
void *callback_data)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (callback_func != NULL);
EX_TRY
{
(*callback_func)(
source_id,
is_enabled,
level,
match_any_keywords,
match_all_keywords,
filter_data,
callback_data);
}
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
}
/*
* EventPipeBuffer.
*/
EP_RT_DEFINE_ARRAY (buffer_array, ep_rt_buffer_array_t, ep_rt_buffer_array_iterator_t, EventPipeBuffer *)
EP_RT_DEFINE_LOCAL_ARRAY (buffer_array, ep_rt_buffer_array_t, ep_rt_buffer_array_iterator_t, EventPipeBuffer *)
EP_RT_DEFINE_ARRAY_ITERATOR (buffer_array, ep_rt_buffer_array_t, ep_rt_buffer_array_iterator_t, EventPipeBuffer *)
#undef EP_RT_DECLARE_LOCAL_BUFFER_ARRAY
#define EP_RT_DECLARE_LOCAL_BUFFER_ARRAY(var_name) \
EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, ep_rt_buffer_array_t)
/*
* EventPipeBufferList.
*/
EP_RT_DEFINE_ARRAY (buffer_list_array, ep_rt_buffer_list_array_t, ep_rt_buffer_list_array_iterator_t, EventPipeBufferList *)
EP_RT_DEFINE_LOCAL_ARRAY (buffer_list_array, ep_rt_buffer_list_array_t, ep_rt_buffer_list_array_iterator_t, EventPipeBufferList *)
EP_RT_DEFINE_ARRAY_ITERATOR (buffer_list_array, ep_rt_buffer_list_array_t, ep_rt_buffer_list_array_iterator_t, EventPipeBufferList *)
#undef EP_RT_DECLARE_LOCAL_BUFFER_LIST_ARRAY
#define EP_RT_DECLARE_LOCAL_BUFFER_LIST_ARRAY(var_name) \
EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, ep_rt_buffer_list_array_t)
/*
* EventPipeEvent.
*/
EP_RT_DEFINE_LIST (event_list, ep_rt_event_list_t, EventPipeEvent *)
EP_RT_DEFINE_LIST_ITERATOR (event_list, ep_rt_event_list_t, ep_rt_event_list_iterator_t, EventPipeEvent *)
/*
* EventPipeFile.
*/
EP_RT_DEFINE_HASH_MAP_REMOVE(metadata_labels_hash, ep_rt_metadata_labels_hash_map_t, EventPipeEvent *, uint32_t)
EP_RT_DEFINE_HASH_MAP(stack_hash, ep_rt_stack_hash_map_t, StackHashKey *, StackHashEntry *)
EP_RT_DEFINE_HASH_MAP_ITERATOR(stack_hash, ep_rt_stack_hash_map_t, ep_rt_stack_hash_map_iterator_t, StackHashKey *, StackHashEntry *)
/*
* EventPipeProvider.
*/
EP_RT_DEFINE_LIST (provider_list, ep_rt_provider_list_t, EventPipeProvider *)
EP_RT_DEFINE_LIST_ITERATOR (provider_list, ep_rt_provider_list_t, ep_rt_provider_list_iterator_t, EventPipeProvider *)
EP_RT_DEFINE_QUEUE (provider_callback_data_queue, ep_rt_provider_callback_data_queue_t, EventPipeProviderCallbackData *)
static
EventPipeProvider *
ep_rt_provider_list_find_by_name (
const ep_rt_provider_list_t *list,
const ep_char8_t *name)
{
STATIC_CONTRACT_NOTHROW;
// The provider list should be non-NULL, but can be NULL on shutdown.
if (list) {
SList<SListElem<EventPipeProvider *>> *provider_list = list->list;
SListElem<EventPipeProvider *> *element = provider_list->GetHead ();
while (element) {
EventPipeProvider *provider = element->GetValue ();
if (ep_rt_utf8_string_compare (ep_provider_get_provider_name (element->GetValue ()), name) == 0)
return provider;
element = provider_list->GetNext (element);
}
}
return NULL;
}
/*
* EventPipeProviderConfiguration.
*/
EP_RT_DEFINE_ARRAY (provider_config_array, ep_rt_provider_config_array_t, ep_rt_provider_config_array_iterator_t, EventPipeProviderConfiguration)
EP_RT_DEFINE_ARRAY_ITERATOR (provider_config_array, ep_rt_provider_config_array_t, ep_rt_provider_config_array_iterator_t, EventPipeProviderConfiguration)
static
inline
bool
ep_rt_config_value_get_enable (void)
{
STATIC_CONTRACT_NOTHROW;
return CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EnableEventPipe) != 0;
}
static
inline
ep_char8_t *
ep_rt_config_value_get_config (void)
{
STATIC_CONTRACT_NOTHROW;
CLRConfigStringHolder value(CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeConfig));
return ep_rt_utf16_to_utf8_string (reinterpret_cast<ep_char16_t *>(value.GetValue ()), -1);
}
static
inline
ep_char8_t *
ep_rt_config_value_get_output_path (void)
{
STATIC_CONTRACT_NOTHROW;
CLRConfigStringHolder value(CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeOutputPath));
return ep_rt_utf16_to_utf8_string (reinterpret_cast<ep_char16_t *>(value.GetValue ()), -1);
}
static
inline
uint32_t
ep_rt_config_value_get_circular_mb (void)
{
STATIC_CONTRACT_NOTHROW;
return CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeCircularMB);
}
static
inline
bool
ep_rt_config_value_get_output_streaming (void)
{
STATIC_CONTRACT_NOTHROW;
return CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeOutputStreaming) != 0;
}
static
inline
bool
ep_rt_config_value_get_use_portable_thread_pool (void)
{
STATIC_CONTRACT_NOTHROW;
return ThreadpoolMgr::UsePortableThreadPool ();
}
/*
* EventPipeSampleProfiler.
*/
static
inline
void
ep_rt_sample_profiler_write_sampling_event_for_threads (
ep_rt_thread_handle_t sampling_thread,
EventPipeEvent *sampling_event)
{
STATIC_CONTRACT_NOTHROW;
extern void ep_rt_coreclr_sample_profiler_write_sampling_event_for_threads (ep_rt_thread_handle_t sampling_thread, EventPipeEvent *sampling_event);
ep_rt_coreclr_sample_profiler_write_sampling_event_for_threads (sampling_thread, sampling_event);
}
static
inline
void
ep_rt_notify_profiler_provider_created (EventPipeProvider *provider)
{
STATIC_CONTRACT_NOTHROW;
#ifndef DACCESS_COMPILE
// Let the profiler know the provider has been created so it can register if it wants to
BEGIN_PROFILER_CALLBACK (CORProfilerTrackEventPipe ());
(&g_profControlBlock)->EventPipeProviderCreated (provider);
END_PROFILER_CALLBACK ();
#endif // DACCESS_COMPILE
}
/*
* EventPipeSessionProvider.
*/
EP_RT_DEFINE_LIST (session_provider_list, ep_rt_session_provider_list_t, EventPipeSessionProvider *)
EP_RT_DEFINE_LIST_ITERATOR (session_provider_list, ep_rt_session_provider_list_t, ep_rt_session_provider_list_iterator_t, EventPipeSessionProvider *)
static
EventPipeSessionProvider *
ep_rt_session_provider_list_find_by_name (
const ep_rt_session_provider_list_t *list,
const ep_char8_t *name)
{
STATIC_CONTRACT_NOTHROW;
SList<SListElem<EventPipeSessionProvider *>> *provider_list = list->list;
EventPipeSessionProvider *session_provider = NULL;
SListElem<EventPipeSessionProvider *> *element = provider_list->GetHead ();
while (element) {
EventPipeSessionProvider *candidate = element->GetValue ();
if (ep_rt_utf8_string_compare (ep_session_provider_get_provider_name (candidate), name) == 0) {
session_provider = candidate;
break;
}
element = provider_list->GetNext (element);
}
return session_provider;
}
/*
* EventPipeSequencePoint.
*/
EP_RT_DEFINE_LIST (sequence_point_list, ep_rt_sequence_point_list_t, EventPipeSequencePoint *)
EP_RT_DEFINE_LIST_ITERATOR (sequence_point_list, ep_rt_sequence_point_list_t, ep_rt_sequence_point_list_iterator_t, EventPipeSequencePoint *)
/*
* EventPipeThread.
*/
EP_RT_DEFINE_LIST (thread_list, ep_rt_thread_list_t, EventPipeThread *)
EP_RT_DEFINE_LIST_ITERATOR (thread_list, ep_rt_thread_list_t, ep_rt_thread_list_iterator_t, EventPipeThread *)
EP_RT_DEFINE_ARRAY (thread_array, ep_rt_thread_array_t, ep_rt_thread_array_iterator_t, EventPipeThread *)
EP_RT_DEFINE_LOCAL_ARRAY (thread_array, ep_rt_thread_array_t, ep_rt_thread_array_iterator_t, EventPipeThread *)
EP_RT_DEFINE_ARRAY_ITERATOR (thread_array, ep_rt_thread_array_t, ep_rt_thread_array_iterator_t, EventPipeThread *)
#undef EP_RT_DECLARE_LOCAL_THREAD_ARRAY
#define EP_RT_DECLARE_LOCAL_THREAD_ARRAY(var_name) \
EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, ep_rt_thread_array_t)
/*
* EventPipeThreadSessionState.
*/
EP_RT_DEFINE_LIST (thread_session_state_list, ep_rt_thread_session_state_list_t, EventPipeThreadSessionState *)
EP_RT_DEFINE_LIST_ITERATOR (thread_session_state_list, ep_rt_thread_session_state_list_t, ep_rt_thread_session_state_list_iterator_t, EventPipeThreadSessionState *)
EP_RT_DEFINE_ARRAY (thread_session_state_array, ep_rt_thread_session_state_array_t, ep_rt_thread_session_state_array_iterator_t, EventPipeThreadSessionState *)
EP_RT_DEFINE_LOCAL_ARRAY (thread_session_state_array, ep_rt_thread_session_state_array_t, ep_rt_thread_session_state_array_iterator_t, EventPipeThreadSessionState *)
EP_RT_DEFINE_ARRAY_ITERATOR (thread_session_state_array, ep_rt_thread_session_state_array_t, ep_rt_thread_session_state_array_iterator_t, EventPipeThreadSessionState *)
#undef EP_RT_DECLARE_LOCAL_THREAD_SESSION_STATE_ARRAY
#define EP_RT_DECLARE_LOCAL_THREAD_SESSION_STATE_ARRAY(var_name) \
EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, ep_rt_thread_session_state_array_t)
/*
* Arrays.
*/
static
inline
uint8_t *
ep_rt_byte_array_alloc (size_t len)
{
STATIC_CONTRACT_NOTHROW;
return new (nothrow) uint8_t [len];
}
static
inline
void
ep_rt_byte_array_free (uint8_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
if (ptr)
delete [] ptr;
}
/*
* Event.
*/
static
void
ep_rt_wait_event_alloc (
ep_rt_wait_event_handle_t *wait_event,
bool manual,
bool initial)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (wait_event != NULL);
EP_ASSERT (wait_event->event == NULL);
wait_event->event = new (nothrow) CLREventStatic ();
if (wait_event->event) {
EX_TRY
{
if (manual)
wait_event->event->CreateManualEvent (initial);
else
wait_event->event->CreateAutoEvent (initial);
}
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
}
}
static
inline
void
ep_rt_wait_event_free (ep_rt_wait_event_handle_t *wait_event)
{
STATIC_CONTRACT_NOTHROW;
if (wait_event != NULL && wait_event->event != NULL) {
wait_event->event->CloseEvent ();
delete wait_event->event;
wait_event->event = NULL;
}
}
static
inline
bool
ep_rt_wait_event_set (ep_rt_wait_event_handle_t *wait_event)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (wait_event != NULL && wait_event->event != NULL);
return wait_event->event->Set ();
}
static
int32_t
ep_rt_wait_event_wait (
ep_rt_wait_event_handle_t *wait_event,
uint32_t timeout,
bool alertable)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (wait_event != NULL && wait_event->event != NULL);
int32_t result;
EX_TRY
{
result = wait_event->event->Wait (timeout, alertable);
}
EX_CATCH
{
result = -1;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
static
inline
EventPipeWaitHandle
ep_rt_wait_event_get_wait_handle (ep_rt_wait_event_handle_t *wait_event)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (wait_event != NULL && wait_event->event != NULL);
return reinterpret_cast<EventPipeWaitHandle>(wait_event->event->GetHandleUNHOSTED ());
}
static
inline
bool
ep_rt_wait_event_is_valid (ep_rt_wait_event_handle_t *wait_event)
{
STATIC_CONTRACT_NOTHROW;
if (wait_event == NULL || wait_event->event == NULL)
return false;
return wait_event->event->IsValid ();
}
/*
* Misc.
*/
static
inline
int
ep_rt_get_last_error (void)
{
STATIC_CONTRACT_NOTHROW;
return ::GetLastError ();
}
static
inline
bool
ep_rt_process_detach (void)
{
STATIC_CONTRACT_NOTHROW;
return (bool)g_fProcessDetach;
}
static
inline
bool
ep_rt_process_shutdown (void)
{
STATIC_CONTRACT_NOTHROW;
return (bool)g_fEEShutDown;
}
static
inline
void
ep_rt_create_activity_id (
uint8_t *activity_id,
uint32_t activity_id_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (activity_id != NULL);
EP_ASSERT (activity_id_len == EP_ACTIVITY_ID_SIZE);
CoCreateGuid (reinterpret_cast<GUID *>(activity_id));
}
static
inline
bool
ep_rt_is_running (void)
{
STATIC_CONTRACT_NOTHROW;
return (bool)g_fEEStarted;
}
static
inline
void
ep_rt_execute_rundown (ep_rt_execution_checkpoint_array_t *execution_checkpoints)
{
STATIC_CONTRACT_NOTHROW;
//TODO: Write execution checkpoint rundown events.
if (CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeRundown) > 0) {
// Ask the runtime to emit rundown events.
if (g_fEEStarted && !g_fEEShutDown)
ETW::EnumerationLog::EndRundown ();
}
}
/*
* Objects.
*/
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_object_alloc
#define ep_rt_object_alloc(obj_type) (new (nothrow) obj_type())
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_object_array_alloc
#define ep_rt_object_array_alloc(obj_type,size) (new (nothrow) obj_type [size]())
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_object_array_free
#define ep_rt_object_array_free(obj_ptr) do { if (obj_ptr) delete [] obj_ptr; } while(0)
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_object_free
#define ep_rt_object_free(obj_ptr) do { if (obj_ptr) delete obj_ptr; } while(0)
/*
* PAL.
*/
typedef struct _rt_coreclr_thread_params_internal_t {
ep_rt_thread_params_t thread_params;
} rt_coreclr_thread_params_internal_t;
#undef EP_RT_DEFINE_THREAD_FUNC
#define EP_RT_DEFINE_THREAD_FUNC(name) static ep_rt_thread_start_func_return_t WINAPI name (LPVOID data)
EP_RT_DEFINE_THREAD_FUNC (ep_rt_thread_coreclr_start_func)
{
STATIC_CONTRACT_NOTHROW;
rt_coreclr_thread_params_internal_t *thread_params = reinterpret_cast<rt_coreclr_thread_params_internal_t *>(data);
DWORD result = thread_params->thread_params.thread_func (thread_params);
if (thread_params->thread_params.thread)
::DestroyThread (thread_params->thread_params.thread);
delete thread_params;
return result;
}
static
bool
ep_rt_thread_create (
void *thread_func,
void *params,
EventPipeThreadType thread_type,
void *id)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (thread_func != NULL);
bool result = false;
EX_TRY
{
rt_coreclr_thread_params_internal_t *thread_params = new (nothrow) rt_coreclr_thread_params_internal_t ();
if (thread_params) {
thread_params->thread_params.thread_type = thread_type;
if (thread_type == EP_THREAD_TYPE_SESSION || thread_type == EP_THREAD_TYPE_SAMPLING) {
thread_params->thread_params.thread = SetupUnstartedThread ();
thread_params->thread_params.thread_func = reinterpret_cast<LPTHREAD_START_ROUTINE>(thread_func);
thread_params->thread_params.thread_params = params;
if (thread_params->thread_params.thread->CreateNewThread (0, ep_rt_thread_coreclr_start_func, thread_params)) {
thread_params->thread_params.thread->SetBackground (TRUE);
thread_params->thread_params.thread->StartThread ();
if (id)
*reinterpret_cast<DWORD *>(id) = thread_params->thread_params.thread->GetThreadId ();
result = true;
}
} else if (thread_type == EP_THREAD_TYPE_SERVER) {
DWORD thread_id = 0;
HANDLE server_thread = ::CreateThread (nullptr, 0, reinterpret_cast<LPTHREAD_START_ROUTINE>(thread_func), nullptr, 0, &thread_id);
if (server_thread != NULL) {
::CloseHandle (server_thread);
if (id)
*reinterpret_cast<DWORD *>(id) = thread_id;
result = true;
}
}
}
}
EX_CATCH
{
result = false;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
static
inline
void
ep_rt_thread_sleep (uint64_t ns)
{
STATIC_CONTRACT_NOTHROW;
#ifdef TARGET_UNIX
PAL_nanosleep (ns);
#else //TARGET_UNIX
const uint32_t NUM_NANOSECONDS_IN_1_MS = 1000000;
ClrSleepEx (static_cast<DWORD>(ns / NUM_NANOSECONDS_IN_1_MS), FALSE);
#endif //TARGET_UNIX
}
static
inline
uint32_t
ep_rt_current_process_get_id (void)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<uint32_t>(GetCurrentProcessId ());
}
static
inline
uint32_t
ep_rt_current_processor_get_number (void)
{
STATIC_CONTRACT_NOTHROW;
#ifndef TARGET_UNIX
extern uint32_t *_ep_rt_coreclr_proc_group_offsets;
if (_ep_rt_coreclr_proc_group_offsets) {
PROCESSOR_NUMBER proc;
GetCurrentProcessorNumberEx (&proc);
return _ep_rt_coreclr_proc_group_offsets [proc.Group] + proc.Number;
}
#endif
return 0xFFFFFFFF;
}
static
inline
uint32_t
ep_rt_processors_get_count (void)
{
STATIC_CONTRACT_NOTHROW;
SYSTEM_INFO sys_info = {};
GetSystemInfo (&sys_info);
return static_cast<uint32_t>(sys_info.dwNumberOfProcessors);
}
static
inline
ep_rt_thread_id_t
ep_rt_current_thread_get_id (void)
{
STATIC_CONTRACT_NOTHROW;
#ifdef TARGET_UNIX
return static_cast<ep_rt_thread_id_t>(::PAL_GetCurrentOSThreadId ());
#else
return static_cast<ep_rt_thread_id_t>(::GetCurrentThreadId ());
#endif
}
static
inline
int64_t
ep_rt_perf_counter_query (void)
{
STATIC_CONTRACT_NOTHROW;
LARGE_INTEGER value;
if (QueryPerformanceCounter (&value))
return static_cast<int64_t>(value.QuadPart);
else
return 0;
}
static
inline
int64_t
ep_rt_perf_frequency_query (void)
{
STATIC_CONTRACT_NOTHROW;
LARGE_INTEGER value;
if (QueryPerformanceFrequency (&value))
return static_cast<int64_t>(value.QuadPart);
else
return 0;
}
static
inline
void
ep_rt_system_time_get (EventPipeSystemTime *system_time)
{
STATIC_CONTRACT_NOTHROW;
SYSTEMTIME value;
GetSystemTime (&value);
EP_ASSERT(system_time != NULL);
ep_system_time_set (
system_time,
value.wYear,
value.wMonth,
value.wDayOfWeek,
value.wDay,
value.wHour,
value.wMinute,
value.wSecond,
value.wMilliseconds);
}
static
inline
int64_t
ep_rt_system_timestamp_get (void)
{
STATIC_CONTRACT_NOTHROW;
FILETIME value;
GetSystemTimeAsFileTime (&value);
return static_cast<int64_t>(((static_cast<uint64_t>(value.dwHighDateTime)) << 32) | static_cast<uint64_t>(value.dwLowDateTime));
}
static
inline
int32_t
ep_rt_system_get_alloc_granularity (void)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int32_t>(g_SystemInfo.dwAllocationGranularity);
}
static
inline
const ep_char8_t *
ep_rt_os_command_line_get (void)
{
STATIC_CONTRACT_NOTHROW;
EP_UNREACHABLE ("Can not reach here");
return NULL;
}
static
ep_rt_file_handle_t
ep_rt_file_open_write (const ep_char8_t *path)
{
STATIC_CONTRACT_NOTHROW;
ep_char16_t *path_utf16 = ep_rt_utf8_to_utf16_string (path, -1);
ep_return_null_if_nok (path_utf16 != NULL);
CFileStream *file_stream = new (nothrow) CFileStream ();
if (file_stream && FAILED (file_stream->OpenForWrite (reinterpret_cast<LPWSTR>(path_utf16)))) {
delete file_stream;
file_stream = NULL;
}
ep_rt_utf16_string_free (path_utf16);
return static_cast<ep_rt_file_handle_t>(file_stream);
}
static
inline
bool
ep_rt_file_close (ep_rt_file_handle_t file_handle)
{
STATIC_CONTRACT_NOTHROW;
// Closed in destructor.
if (file_handle)
delete file_handle;
return true;
}
static
inline
bool
ep_rt_file_write (
ep_rt_file_handle_t file_handle,
const uint8_t *buffer,
uint32_t bytes_to_write,
uint32_t *bytes_written)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (buffer != NULL);
ep_return_false_if_nok (file_handle != NULL);
ULONG out_count;
HRESULT result = reinterpret_cast<CFileStream *>(file_handle)->Write (buffer, bytes_to_write, &out_count);
*bytes_written = static_cast<uint32_t>(out_count);
return result == S_OK;
}
static
inline
uint8_t *
ep_rt_valloc0 (size_t buffer_size)
{
STATIC_CONTRACT_NOTHROW;
return reinterpret_cast<uint8_t *>(ClrVirtualAlloc (NULL, buffer_size, MEM_COMMIT, PAGE_READWRITE));
}
static
inline
void
ep_rt_vfree (
uint8_t *buffer,
size_t buffer_size)
{
STATIC_CONTRACT_NOTHROW;
if (buffer)
ClrVirtualFree (buffer, 0, MEM_RELEASE);
}
static
inline
uint32_t
ep_rt_temp_path_get (
ep_char8_t *buffer,
uint32_t buffer_len)
{
STATIC_CONTRACT_NOTHROW;
EP_UNREACHABLE ("Can not reach here");
return 0;
}
EP_RT_DEFINE_ARRAY (env_array_utf16, ep_rt_env_array_utf16_t, ep_rt_env_array_utf16_iterator_t, ep_char16_t *)
EP_RT_DEFINE_ARRAY_ITERATOR (env_array_utf16, ep_rt_env_array_utf16_t, ep_rt_env_array_utf16_iterator_t, ep_char16_t *)
static
void
ep_rt_os_environment_get_utf16 (ep_rt_env_array_utf16_t *env_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (env_array != NULL);
LPWSTR envs = GetEnvironmentStringsW ();
if (envs) {
LPWSTR next = envs;
while (*next) {
ep_rt_env_array_utf16_append (env_array, ep_rt_utf16_string_dup (reinterpret_cast<const ep_char16_t *>(next)));
next += ep_rt_utf16_string_len (reinterpret_cast<const ep_char16_t *>(next)) + 1;
}
FreeEnvironmentStringsW (envs);
}
}
/*
* Lock.
*/
static
bool
ep_rt_lock_aquire (ep_rt_lock_handle_t *lock)
{
STATIC_CONTRACT_NOTHROW;
bool result = true;
EX_TRY
{
if (lock) {
CrstBase::CrstHolderWithState holder (lock->lock);
holder.SuppressRelease ();
}
}
EX_CATCH
{
result = false;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
static
bool
ep_rt_lock_release (ep_rt_lock_handle_t *lock)
{
STATIC_CONTRACT_NOTHROW;
bool result = true;
EX_TRY
{
if (lock) {
CrstBase::UnsafeCrstInverseHolder holder (lock->lock);
holder.SuppressRelease ();
}
}
EX_CATCH
{
result = false;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
#ifdef EP_CHECKED_BUILD
static
inline
void
ep_rt_lock_requires_lock_held (const ep_rt_lock_handle_t *lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (((ep_rt_lock_handle_t *)lock)->lock->OwnedByCurrentThread ());
}
static
inline
void
ep_rt_lock_requires_lock_not_held (const ep_rt_lock_handle_t *lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (lock->lock == NULL || !((ep_rt_lock_handle_t *)lock)->lock->OwnedByCurrentThread ());
}
#endif
/*
* SpinLock.
*/
static
void
ep_rt_spin_lock_alloc (ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EX_TRY
{
spin_lock->lock = new (nothrow) SpinLock ();
spin_lock->lock->Init (LOCK_TYPE_DEFAULT);
}
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
}
static
inline
void
ep_rt_spin_lock_free (ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
if (spin_lock && spin_lock->lock) {
delete spin_lock->lock;
spin_lock->lock = NULL;
}
}
static
inline
bool
ep_rt_spin_lock_aquire (ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_rt_spin_lock_is_valid (spin_lock));
SpinLock::AcquireLock (spin_lock->lock);
return true;
}
static
inline
bool
ep_rt_spin_lock_release (ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_rt_spin_lock_is_valid (spin_lock));
SpinLock::ReleaseLock (spin_lock->lock);
return true;
}
#ifdef EP_CHECKED_BUILD
static
inline
void
ep_rt_spin_lock_requires_lock_held (const ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_rt_spin_lock_is_valid (spin_lock));
EP_ASSERT (spin_lock->lock->OwnedByCurrentThread ());
}
static
inline
void
ep_rt_spin_lock_requires_lock_not_held (const ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (spin_lock->lock == NULL || !spin_lock->lock->OwnedByCurrentThread ());
}
#endif
static
inline
bool
ep_rt_spin_lock_is_valid (const ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
return (spin_lock != NULL && spin_lock->lock != NULL);
}
/*
* String.
*/
static
inline
int
ep_rt_utf8_string_compare (
const ep_char8_t *str1,
const ep_char8_t *str2)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (str1 != NULL && str2 != NULL);
return strcmp (reinterpret_cast<const char *>(str1), reinterpret_cast<const char *>(str2));
}
static
inline
int
ep_rt_utf8_string_compare_ignore_case (
const ep_char8_t *str1,
const ep_char8_t *str2)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (str1 != NULL && str2 != NULL);
return _stricmp (reinterpret_cast<const char *>(str1), reinterpret_cast<const char *>(str2));
}
static
inline
bool
ep_rt_utf8_string_is_null_or_empty (const ep_char8_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (str == NULL)
return true;
while (*str) {
if (!isspace (*str))
return false;
str++;
}
return true;
}
static
inline
ep_char8_t *
ep_rt_utf8_string_dup (const ep_char8_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (!str)
return NULL;
return _strdup (str);
}
static
inline
ep_char8_t *
ep_rt_utf8_string_dup_range (const ep_char8_t *str, const ep_char8_t *strEnd)
{
ptrdiff_t byte_len = strEnd - str;
ep_char8_t *buffer = reinterpret_cast<ep_char8_t *>(malloc(byte_len + 1));
if (buffer != NULL)
{
memcpy (buffer, str, byte_len);
buffer [byte_len] = '\0';
}
return buffer;
}
static
inline
ep_char8_t *
ep_rt_utf8_string_strtok (
ep_char8_t *str,
const ep_char8_t *delimiter,
ep_char8_t **context)
{
STATIC_CONTRACT_NOTHROW;
return strtok_s (str, delimiter, context);
}
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_utf8_string_snprintf
#define ep_rt_utf8_string_snprintf( \
str, \
str_len, \
format, ...) \
sprintf_s (reinterpret_cast<char *>(str), static_cast<size_t>(str_len), reinterpret_cast<const char *>(format), __VA_ARGS__)
static
inline
bool
ep_rt_utf8_string_replace (
ep_char8_t **str,
const ep_char8_t *strSearch,
const ep_char8_t *strReplacement
)
{
STATIC_CONTRACT_NOTHROW;
if ((*str) == NULL)
return false;
ep_char8_t* strFound = strstr(*str, strSearch);
if (strFound != NULL)
{
size_t strSearchLen = strlen(strSearch);
size_t newStrSize = strlen(*str) + strlen(strReplacement) - strSearchLen + 1;
ep_char8_t *newStr = reinterpret_cast<ep_char8_t *>(malloc(newStrSize));
if (newStr == NULL)
{
*str = NULL;
return false;
}
ep_rt_utf8_string_snprintf(newStr, newStrSize, "%.*s%s%s", (int)(strFound - (*str)), *str, strReplacement, strFound + strSearchLen);
ep_rt_utf8_string_free(*str);
*str = newStr;
return true;
}
return false;
}
static
ep_char16_t *
ep_rt_utf8_to_utf16_string (
const ep_char8_t *str,
size_t len)
{
STATIC_CONTRACT_NOTHROW;
if (!str)
return NULL;
COUNT_T len_utf16 = WszMultiByteToWideChar (CP_UTF8, 0, str, static_cast<int>(len), 0, 0);
if (len_utf16 == 0)
return NULL;
if (static_cast<int>(len) != -1)
len_utf16 += 1;
ep_char16_t *str_utf16 = reinterpret_cast<ep_char16_t *>(malloc (len_utf16 * sizeof (ep_char16_t)));
if (!str_utf16)
return NULL;
len_utf16 = WszMultiByteToWideChar (CP_UTF8, 0, str, static_cast<int>(len), reinterpret_cast<LPWSTR>(str_utf16), len_utf16);
if (len_utf16 == 0) {
free (str_utf16);
return NULL;
}
str_utf16 [len_utf16 - 1] = 0;
return str_utf16;
}
static
inline
ep_char16_t *
ep_rt_utf16_string_dup (const ep_char16_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (!str)
return NULL;
size_t str_size = (ep_rt_utf16_string_len (str) + 1) * sizeof (ep_char16_t);
ep_char16_t *str_dup = reinterpret_cast<ep_char16_t *>(malloc (str_size));
if (str_dup)
memcpy (str_dup, str, str_size);
return str_dup;
}
static
inline
void
ep_rt_utf8_string_free (ep_char8_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (str)
free (str);
}
static
inline
size_t
ep_rt_utf16_string_len (const ep_char16_t *str)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (str != NULL);
return wcslen (reinterpret_cast<LPCWSTR>(str));
}
static
ep_char8_t *
ep_rt_utf16_to_utf8_string (
const ep_char16_t *str,
size_t len)
{
STATIC_CONTRACT_NOTHROW;
if (!str)
return NULL;
COUNT_T size_utf8 = WszWideCharToMultiByte (CP_UTF8, 0, reinterpret_cast<LPCWSTR>(str), static_cast<int>(len), NULL, 0, NULL, NULL);
if (size_utf8 == 0)
return NULL;
if (static_cast<int>(len) != -1)
size_utf8 += 1;
ep_char8_t *str_utf8 = reinterpret_cast<ep_char8_t *>(malloc (size_utf8));
if (!str_utf8)
return NULL;
size_utf8 = WszWideCharToMultiByte (CP_UTF8, 0, reinterpret_cast<LPCWSTR>(str), static_cast<int>(len), reinterpret_cast<LPSTR>(str_utf8), size_utf8, NULL, NULL);
if (size_utf8 == 0) {
free (str_utf8);
return NULL;
}
str_utf8 [size_utf8 - 1] = 0;
return str_utf8;
}
static
inline
void
ep_rt_utf16_string_free (ep_char16_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (str)
free (str);
}
static
inline
const ep_char8_t *
ep_rt_managed_command_line_get (void)
{
STATIC_CONTRACT_NOTHROW;
EP_UNREACHABLE ("Can not reach here");
return NULL;
}
static
const ep_char8_t *
ep_rt_diagnostics_command_line_get (void)
{
STATIC_CONTRACT_NOTHROW;
// In coreclr, this value can change over time, specifically before vs after suspension in diagnostics server.
// The host initalizes the runtime in two phases, init and exec assembly. On non-Windows platforms the commandline returned by the runtime
// is different during each phase. We suspend during init where the runtime has populated the commandline with a
// mock value (the full path of the executing assembly) and the actual value isn't populated till the exec assembly phase.
// On Windows this does not apply as the value is retrieved directly from the OS any time it is requested.
// As a result, we cannot actually cache this value. We need to return the _current_ value.
// This function needs to handle freeing the string in order to make it consistent with Mono's version.
// To that end, we'll "cache" it here so we free the previous string when we get it again.
extern ep_char8_t *_ep_rt_coreclr_diagnostics_cmd_line;
if (_ep_rt_coreclr_diagnostics_cmd_line)
ep_rt_utf8_string_free(_ep_rt_coreclr_diagnostics_cmd_line);
_ep_rt_coreclr_diagnostics_cmd_line = ep_rt_utf16_to_utf8_string (reinterpret_cast<const ep_char16_t *>(GetCommandLineForDiagnostics ()), -1);
return _ep_rt_coreclr_diagnostics_cmd_line;
}
/*
* Thread.
*/
static
inline
EventPipeThreadHolder *
thread_holder_alloc_func (void)
{
STATIC_CONTRACT_NOTHROW;
EventPipeThreadHolder *instance = ep_thread_holder_alloc (ep_thread_alloc());
if (instance)
ep_thread_register (ep_thread_holder_get_thread (instance));
return instance;
}
static
inline
void
thread_holder_free_func (EventPipeThreadHolder * thread_holder)
{
STATIC_CONTRACT_NOTHROW;
if (thread_holder) {
ep_thread_unregister (ep_thread_holder_get_thread (thread_holder));
ep_thread_holder_free (thread_holder);
}
}
class EventPipeCoreCLRThreadHolderTLS {
public:
EventPipeCoreCLRThreadHolderTLS ()
{
STATIC_CONTRACT_NOTHROW;
}
~EventPipeCoreCLRThreadHolderTLS ()
{
STATIC_CONTRACT_NOTHROW;
if (m_threadHolder) {
thread_holder_free_func (m_threadHolder);
m_threadHolder = NULL;
}
}
static inline EventPipeThreadHolder * getThreadHolder ()
{
STATIC_CONTRACT_NOTHROW;
return g_threadHolderTLS.m_threadHolder;
}
static inline EventPipeThreadHolder * createThreadHolder ()
{
STATIC_CONTRACT_NOTHROW;
if (g_threadHolderTLS.m_threadHolder) {
thread_holder_free_func (g_threadHolderTLS.m_threadHolder);
g_threadHolderTLS.m_threadHolder = NULL;
}
g_threadHolderTLS.m_threadHolder = thread_holder_alloc_func ();
return g_threadHolderTLS.m_threadHolder;
}
private:
EventPipeThreadHolder *m_threadHolder;
static thread_local EventPipeCoreCLRThreadHolderTLS g_threadHolderTLS;
};
static
void
ep_rt_thread_setup (void)
{
STATIC_CONTRACT_NOTHROW;
Thread* thread_handle = SetupThreadNoThrow ();
EP_ASSERT (thread_handle != NULL);
}
static
inline
EventPipeThread *
ep_rt_thread_get (void)
{
STATIC_CONTRACT_NOTHROW;
EventPipeThreadHolder *thread_holder = EventPipeCoreCLRThreadHolderTLS::getThreadHolder ();
return thread_holder ? ep_thread_holder_get_thread (thread_holder) : NULL;
}
static
inline
EventPipeThread *
ep_rt_thread_get_or_create (void)
{
STATIC_CONTRACT_NOTHROW;
EventPipeThreadHolder *thread_holder = EventPipeCoreCLRThreadHolderTLS::getThreadHolder ();
if (!thread_holder)
thread_holder = EventPipeCoreCLRThreadHolderTLS::createThreadHolder ();
return ep_thread_holder_get_thread (thread_holder);
}
static
inline
ep_rt_thread_handle_t
ep_rt_thread_get_handle (void)
{
STATIC_CONTRACT_NOTHROW;
return GetThreadNULLOk ();
}
static
inline
ep_rt_thread_id_t
ep_rt_thread_get_id (ep_rt_thread_handle_t thread_handle)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (thread_handle != NULL);
return ep_rt_uint64_t_to_thread_id_t (thread_handle->GetOSThreadId64 ());
}
static
inline
uint64_t
ep_rt_thread_id_t_to_uint64_t (ep_rt_thread_id_t thread_id)
{
return static_cast<uint64_t>(thread_id);
}
static
inline
ep_rt_thread_id_t
ep_rt_uint64_t_to_thread_id_t (uint64_t thread_id)
{
return static_cast<ep_rt_thread_id_t>(thread_id);
}
static
inline
bool
ep_rt_thread_has_started (ep_rt_thread_handle_t thread_handle)
{
STATIC_CONTRACT_NOTHROW;
return thread_handle != NULL && thread_handle->HasStarted ();
}
static
inline
ep_rt_thread_activity_id_handle_t
ep_rt_thread_get_activity_id_handle (void)
{
STATIC_CONTRACT_NOTHROW;
return GetThread ();
}
static
inline
const uint8_t *
ep_rt_thread_get_activity_id_cref (ep_rt_thread_activity_id_handle_t activity_id_handle)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (activity_id_handle != NULL);
return reinterpret_cast<const uint8_t *>(activity_id_handle->GetActivityId ());
}
static
inline
void
ep_rt_thread_get_activity_id (
ep_rt_thread_activity_id_handle_t activity_id_handle,
uint8_t *activity_id,
uint32_t activity_id_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (activity_id_handle != NULL);
EP_ASSERT (activity_id != NULL);
EP_ASSERT (activity_id_len == EP_ACTIVITY_ID_SIZE);
memcpy (activity_id, ep_rt_thread_get_activity_id_cref (activity_id_handle), EP_ACTIVITY_ID_SIZE);
}
static
inline
void
ep_rt_thread_set_activity_id (
ep_rt_thread_activity_id_handle_t activity_id_handle,
const uint8_t *activity_id,
uint32_t activity_id_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (activity_id_handle != NULL);
EP_ASSERT (activity_id != NULL);
EP_ASSERT (activity_id_len == EP_ACTIVITY_ID_SIZE);
activity_id_handle->SetActivityId (reinterpret_cast<LPCGUID>(activity_id));
}
#undef EP_YIELD_WHILE
#define EP_YIELD_WHILE(condition) YIELD_WHILE(condition)
/*
* ThreadSequenceNumberMap.
*/
EP_RT_DEFINE_HASH_MAP_REMOVE(thread_sequence_number_map, ep_rt_thread_sequence_number_hash_map_t, EventPipeThreadSessionState *, uint32_t)
EP_RT_DEFINE_HASH_MAP_ITERATOR(thread_sequence_number_map, ep_rt_thread_sequence_number_hash_map_t, ep_rt_thread_sequence_number_hash_map_iterator_t, EventPipeThreadSessionState *, uint32_t)
/*
* Volatile.
*/
static
inline
uint32_t
ep_rt_volatile_load_uint32_t (const volatile uint32_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoad<uint32_t> ((const uint32_t *)ptr);
}
static
inline
uint32_t
ep_rt_volatile_load_uint32_t_without_barrier (const volatile uint32_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoadWithoutBarrier<uint32_t> ((const uint32_t *)ptr);
}
static
inline
void
ep_rt_volatile_store_uint32_t (
volatile uint32_t *ptr,
uint32_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStore<uint32_t> ((uint32_t *)ptr, value);
}
static
inline
void
ep_rt_volatile_store_uint32_t_without_barrier (
volatile uint32_t *ptr,
uint32_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStoreWithoutBarrier<uint32_t>((uint32_t *)ptr, value);
}
static
inline
uint64_t
ep_rt_volatile_load_uint64_t (const volatile uint64_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoad<uint64_t> ((const uint64_t *)ptr);
}
static
inline
uint64_t
ep_rt_volatile_load_uint64_t_without_barrier (const volatile uint64_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoadWithoutBarrier<uint64_t> ((const uint64_t *)ptr);
}
static
inline
void
ep_rt_volatile_store_uint64_t (
volatile uint64_t *ptr,
uint64_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStore<uint64_t> ((uint64_t *)ptr, value);
}
static
inline
void
ep_rt_volatile_store_uint64_t_without_barrier (
volatile uint64_t *ptr,
uint64_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStoreWithoutBarrier<uint64_t> ((uint64_t *)ptr, value);
}
static
inline
int64_t
ep_rt_volatile_load_int64_t (const volatile int64_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoad<int64_t> ((int64_t *)ptr);
}
static
inline
int64_t
ep_rt_volatile_load_int64_t_without_barrier (const volatile int64_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoadWithoutBarrier<int64_t> ((int64_t *)ptr);
}
static
inline
void
ep_rt_volatile_store_int64_t (
volatile int64_t *ptr,
int64_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStore<int64_t> ((int64_t *)ptr, value);
}
static
inline
void
ep_rt_volatile_store_int64_t_without_barrier (
volatile int64_t *ptr,
int64_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStoreWithoutBarrier<int64_t> ((int64_t *)ptr, value);
}
static
inline
void *
ep_rt_volatile_load_ptr (volatile void **ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoad<void *> ((void **)ptr);
}
static
inline
void *
ep_rt_volatile_load_ptr_without_barrier (volatile void **ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoadWithoutBarrier<void *> ((void **)ptr);
}
static
inline
void
ep_rt_volatile_store_ptr (
volatile void **ptr,
void *value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStore<void *> ((void **)ptr, value);
}
static
inline
void
ep_rt_volatile_store_ptr_without_barrier (
volatile void **ptr,
void *value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStoreWithoutBarrier<void *> ((void **)ptr, value);
}
#endif /* ENABLE_PERFTRACING */
#endif /* __EVENTPIPE_RT_CORECLR_H__ */
|
// Implementation of ep-rt.h targeting CoreCLR runtime.
#ifndef __EVENTPIPE_RT_CORECLR_H__
#define __EVENTPIPE_RT_CORECLR_H__
#include <eventpipe/ep-rt-config.h>
#ifdef ENABLE_PERFTRACING
#include <eventpipe/ep-thread.h>
#include <eventpipe/ep-types.h>
#include <eventpipe/ep-provider.h>
#include <eventpipe/ep-session-provider.h>
#include "fstream.h"
#include "typestring.h"
#include "win32threadpool.h"
#include "clrversion.h"
#undef EP_INFINITE_WAIT
#define EP_INFINITE_WAIT INFINITE
#undef EP_GCX_PREEMP_ENTER
#define EP_GCX_PREEMP_ENTER { GCX_PREEMP();
#undef EP_GCX_PREEMP_EXIT
#define EP_GCX_PREEMP_EXIT }
#undef EP_ALWAYS_INLINE
#define EP_ALWAYS_INLINE FORCEINLINE
#undef EP_NEVER_INLINE
#define EP_NEVER_INLINE NOINLINE
#undef EP_ALIGN_UP
#define EP_ALIGN_UP(val,align) ALIGN_UP(val,align)
#ifndef EP_RT_BUILD_TYPE_FUNC_NAME
#define EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, type_name, func_name) \
prefix_name ## _rt_ ## type_name ## _ ## func_name
#endif
template<typename LIST_TYPE>
static
inline
void
_rt_coreclr_list_alloc (LIST_TYPE *list) {
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL);
list->list = new (nothrow) typename LIST_TYPE::list_type_t ();
}
template<typename LIST_TYPE>
static
inline
void
_rt_coreclr_list_free (
LIST_TYPE *list,
void (*callback)(void *))
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL);
if (list->list) {
while (!list->list->IsEmpty ()) {
typename LIST_TYPE::element_type_t *current = list->list->RemoveHead ();
if (callback)
callback (reinterpret_cast<void *>(current->GetValue ()));
delete current;
}
delete list->list;
}
list->list = NULL;
}
template<typename LIST_TYPE>
static
inline
void
_rt_coreclr_list_clear (
LIST_TYPE *list,
void (*callback)(void *))
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
while (!list->list->IsEmpty ()) {
typename LIST_TYPE::element_type_t *current = list->list->RemoveHead ();
if (callback)
callback (reinterpret_cast<void *>(current->GetValue ()));
delete current;
}
}
template<typename LIST_TYPE, typename LIST_ITEM>
static
inline
bool
_rt_coreclr_list_append (
LIST_TYPE *list,
LIST_ITEM item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
typename LIST_TYPE::element_type_t *node = new (nothrow) typename LIST_TYPE::element_type_t (item);
if (node)
list->list->InsertTail (node);
return (node != NULL);
}
template<typename LIST_TYPE, typename LIST_ITEM, typename CONST_LIST_ITEM = LIST_ITEM>
static
inline
void
_rt_coreclr_list_remove (
LIST_TYPE *list,
CONST_LIST_ITEM item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
typename LIST_TYPE::element_type_t *current = list->list->GetHead ();
while (current) {
if (current->GetValue () == item) {
if (list->list->FindAndRemove (current))
delete current;
break;
}
current = list->list->GetNext (current);
}
}
template<typename LIST_TYPE, typename LIST_ITEM, typename CONST_LIST_TYPE = const LIST_TYPE, typename CONST_LIST_ITEM = const LIST_ITEM>
static
inline
bool
_rt_coreclr_list_find (
CONST_LIST_TYPE *list,
CONST_LIST_ITEM item_to_find,
LIST_ITEM *found_item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
EP_ASSERT (found_item != NULL);
bool found = false;
typename LIST_TYPE::element_type_t *current = list->list->GetHead ();
while (current) {
if (current->GetValue () == item_to_find) {
*found_item = current->GetValue ();
found = true;
break;
}
current = list->list->GetNext (current);
}
return found;
}
template<typename LIST_TYPE, typename CONST_LIST_TYPE = const LIST_TYPE>
static
inline
bool
_rt_coreclr_list_is_empty (CONST_LIST_TYPE *list)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL);
return (list->list == NULL || list->list->IsEmpty ());
}
template<typename LIST_TYPE, typename CONST_LIST_TYPE = const LIST_TYPE>
static
inline
bool
_rt_coreclr_list_is_valid (CONST_LIST_TYPE *list)
{
STATIC_CONTRACT_NOTHROW;
return (list != NULL && list->list != NULL);
}
template<typename LIST_TYPE, typename ITERATOR_TYPE, typename CONST_LIST_TYPE = const LIST_TYPE>
static
inline
ITERATOR_TYPE
_rt_coreclr_list_iterator_begin (CONST_LIST_TYPE *list)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL);
return list->list->begin ();
}
template<typename LIST_TYPE, typename ITERATOR_TYPE, typename CONST_LIST_TYPE = const LIST_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
bool
_rt_coreclr_list_iterator_end (
CONST_LIST_TYPE *list,
CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (list != NULL && list->list != NULL && iterator != NULL);
return (*iterator == list->list->end ());
}
template<typename ITERATOR_TYPE>
static
inline
void
_rt_coreclr_list_iterator_next (ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL);
(*iterator)++;
}
template<typename ITERATOR_TYPE, typename ITEM_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
ITEM_TYPE
_rt_coreclr_list_iterator_value (CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL);
return const_cast<ITERATOR_TYPE *>(iterator)->operator*();
}
template<typename QUEUE_TYPE>
static
inline
void
_rt_coreclr_queue_alloc (QUEUE_TYPE *queue)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL);
queue->queue = new (nothrow) typename QUEUE_TYPE::queue_type_t ();
}
template<typename QUEUE_TYPE>
static
inline
void
_rt_coreclr_queue_free (QUEUE_TYPE *queue)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL);
if (queue->queue)
delete queue->queue;
queue->queue = NULL;
}
template<typename QUEUE_TYPE, typename ITEM_TYPE>
static
inline
bool
_rt_coreclr_queue_pop_head (
QUEUE_TYPE *queue,
ITEM_TYPE *item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL && queue->queue != NULL && item != NULL);
bool found = true;
typename QUEUE_TYPE::element_type_t *node = queue->queue->RemoveHead ();
if (node) {
*item = node->m_Value;
delete node;
} else {
*item = NULL;
found = false;
}
return found;
}
template<typename QUEUE_TYPE, typename ITEM_TYPE>
static
inline
bool
_rt_coreclr_queue_push_head (
QUEUE_TYPE *queue,
ITEM_TYPE item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL && queue->queue != NULL);
typename QUEUE_TYPE::element_type_t *node = new (nothrow) typename QUEUE_TYPE::element_type_t (item);
if (node)
queue->queue->InsertHead (node);
return (node != NULL);
}
template<typename QUEUE_TYPE, typename ITEM_TYPE>
static
inline
bool
_rt_coreclr_queue_push_tail (
QUEUE_TYPE *queue,
ITEM_TYPE item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL && queue->queue != NULL);
typename QUEUE_TYPE::element_type_t *node = new (nothrow) typename QUEUE_TYPE::element_type_t (item);
if (node)
queue->queue->InsertTail (node);
return (node != NULL);
}
template<typename QUEUE_TYPE, typename CONST_QUEUE_TYPE = const QUEUE_TYPE>
static
inline
bool
_rt_coreclr_queue_is_empty (CONST_QUEUE_TYPE *queue)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (queue != NULL && queue->queue != NULL);
return (queue->queue != NULL && queue->queue->IsEmpty ());
}
template<typename QUEUE_TYPE, typename CONST_QUEUE_TYPE = const QUEUE_TYPE>
static
inline
bool
_rt_coreclr_queue_is_valid (CONST_QUEUE_TYPE *queue)
{
STATIC_CONTRACT_NOTHROW;
return (queue != NULL && queue->queue != NULL);
}
template<typename ARRAY_TYPE>
static
inline
void
_rt_coreclr_array_alloc (ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL);
ep_array->array = new (nothrow) typename ARRAY_TYPE::array_type_t ();
}
template<typename ARRAY_TYPE>
static
inline
void
_rt_coreclr_array_alloc_capacity (
ARRAY_TYPE *ep_array,
size_t capacity)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL);
ep_array->array = new (nothrow) typename ARRAY_TYPE::array_type_t ();
if (ep_array->array)
ep_array->array->AllocNoThrow (capacity);
}
template<typename ARRAY_TYPE>
static
inline
void
_rt_coreclr_array_init_capacity (
ARRAY_TYPE *ep_array,
size_t capacity)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL);
if (ep_array->array)
ep_array->array->AllocNoThrow (capacity);
}
template<typename ARRAY_TYPE>
static
inline
void
_rt_coreclr_array_free (ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL);
if (ep_array->array) {
delete ep_array->array;
ep_array->array = NULL;
}
}
template<typename ARRAY_TYPE, typename ITEM_TYPE>
static
inline
bool
_rt_coreclr_array_append (
ARRAY_TYPE *ep_array,
ITEM_TYPE item)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
return ep_array->array->PushNoThrow (item);
}
template<typename ARRAY_TYPE, typename ITEM_TYPE>
static
inline
void
_rt_coreclr_array_clear (ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
while (ep_array->array->Size () > 0)
ITEM_TYPE item = ep_array->array->Pop ();
ep_array->array->Shrink ();
}
template<typename ARRAY_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
size_t
_rt_coreclr_array_size (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
return ep_array->array->Size ();
}
template<typename ARRAY_TYPE, typename ITEM_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
ITEM_TYPE *
_rt_coreclr_array_data (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
return ep_array->array->Ptr ();
}
template<typename ARRAY_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
bool
_rt_coreclr_array_is_valid (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
return (ep_array->array != NULL);
}
template<typename ARRAY_TYPE, typename ITERATOR_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
ITERATOR_TYPE
_rt_coreclr_array_iterator_begin (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
ITERATOR_TYPE temp;
temp.array = ep_array->array;
temp.index = 0;
return temp;
}
template<typename ARRAY_TYPE, typename ITERATOR_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
bool
_rt_coreclr_array_iterator_end (
CONST_ARRAY_TYPE *ep_array,
CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && iterator != NULL && iterator->array != NULL);
return (iterator->index >= static_cast<size_t>(iterator->array->Size ()));
}
template<typename ITERATOR_TYPE>
static
inline
void
_rt_coreclr_array_iterator_next (ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL);
iterator->index++;
}
template<typename ITERATOR_TYPE, typename ITEM_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
ITEM_TYPE
_rt_coreclr_array_iterator_value (const CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL && iterator->array != NULL);
EP_ASSERT (iterator->index < static_cast<size_t>(iterator->array->Size ()));
return iterator->array->operator[] (iterator->index);
}
template<typename ARRAY_TYPE, typename ITERATOR_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE>
static
inline
ITERATOR_TYPE
_rt_coreclr_array_reverse_iterator_begin (CONST_ARRAY_TYPE *ep_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && ep_array->array != NULL);
ITERATOR_TYPE temp;
temp.array = ep_array->array;
temp.index = static_cast<size_t>(ep_array->array->Size ());
return temp;
}
template<typename ARRAY_TYPE, typename ITERATOR_TYPE, typename CONST_ARRAY_TYPE = const ARRAY_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
bool
_rt_coreclr_array_reverse_iterator_end (
CONST_ARRAY_TYPE *ep_array,
CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_array != NULL && iterator != NULL && iterator->array != NULL);
return (iterator->index == 0);
}
template<typename ITERATOR_TYPE>
static
inline
void
_rt_coreclr_array_reverse_iterator_next (ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL);
iterator->index--;
}
template<typename ITERATOR_TYPE, typename ITEM_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
ITEM_TYPE
_rt_coreclr_array_reverse_iterator_value (CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (iterator != NULL && iterator->array != NULL);
EP_ASSERT (iterator->index > 0);
return iterator->array->operator[] (iterator->index - 1);
}
template<typename HASH_MAP_TYPE>
static
inline
void
_rt_coreclr_hash_map_alloc (
HASH_MAP_TYPE *hash_map,
uint32_t (*hash_callback)(const void *),
bool (*eq_callback)(const void *, const void *),
void (*key_free_callback)(void *),
void (*value_free_callback)(void *))
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && key_free_callback == NULL);
hash_map->table = new (nothrow) typename HASH_MAP_TYPE::table_type_t ();
hash_map->callbacks.key_free_func = key_free_callback;
hash_map->callbacks.value_free_func = value_free_callback;
}
template<typename HASH_MAP_TYPE>
static
inline
void
_rt_coreclr_hash_map_free (HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL);
if (hash_map->table) {
if (hash_map->callbacks.value_free_func) {
for (typename HASH_MAP_TYPE::table_type_t::Iterator iterator = hash_map->table->Begin (); iterator != hash_map->table->End (); ++iterator)
hash_map->callbacks.value_free_func (reinterpret_cast<void *>((ptrdiff_t)(iterator->Value ())));
}
delete hash_map->table;
}
}
template<typename HASH_MAP_TYPE, typename KEY_TYPE, typename VALUE_TYPE>
static
inline
bool
_rt_coreclr_hash_map_add (
HASH_MAP_TYPE *hash_map,
KEY_TYPE key,
VALUE_TYPE value)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
return hash_map->table->AddNoThrow (typename HASH_MAP_TYPE::table_type_t::element_t (key, value));
}
template<typename HASH_MAP_TYPE, typename KEY_TYPE, typename VALUE_TYPE>
static
inline
bool
_rt_coreclr_hash_map_add_or_replace (
HASH_MAP_TYPE *hash_map,
KEY_TYPE key,
VALUE_TYPE value)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
return hash_map->table->AddOrReplaceNoThrow (typename HASH_MAP_TYPE::table_type_t::element_t (key, value));
}
template<typename HASH_MAP_TYPE>
static
inline
void
_rt_coreclr_hash_map_remove_all (HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
if (hash_map->callbacks.value_free_func) {
for (typename HASH_MAP_TYPE::table_type_t::Iterator iterator = hash_map->table->Begin (); iterator != hash_map->table->End (); ++iterator)
hash_map->callbacks.value_free_func (reinterpret_cast<void *>((ptrdiff_t)(iterator->Value ())));
}
hash_map->table->RemoveAll ();
}
template<typename HASH_MAP_TYPE, typename KEY_TYPE, typename VALUE_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE, typename CONST_KEY_TYPE = const KEY_TYPE>
static
inline
bool
_rt_coreclr_hash_map_lookup (
CONST_HASH_MAP_TYPE *hash_map,
CONST_KEY_TYPE key,
VALUE_TYPE *value)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
const typename HASH_MAP_TYPE::table_type_t::element_t *ret = hash_map->table->LookupPtr ((KEY_TYPE)key);
if (ret == NULL)
return false;
*value = ret->Value ();
return true;
}
template<typename HASH_MAP_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE>
static
inline
uint32_t
_rt_coreclr_hash_map_count (CONST_HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
return hash_map->table->GetCount ();
}
template<typename HASH_MAP_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE>
static
inline
bool
_rt_coreclr_hash_map_is_valid (CONST_HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
return (hash_map != NULL && hash_map->table != NULL);
}
template<typename HASH_MAP_TYPE, typename KEY_TYPE, typename CONST_KEY_TYPE = const KEY_TYPE>
static
inline
void
_rt_coreclr_hash_map_remove (
HASH_MAP_TYPE *hash_map,
CONST_KEY_TYPE key)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
const typename HASH_MAP_TYPE::table_type_t::element_t *ret = NULL;
if (hash_map->callbacks.value_free_func)
ret = hash_map->table->LookupPtr ((KEY_TYPE)key);
hash_map->table->Remove ((KEY_TYPE)key);
if (ret)
hash_map->callbacks.value_free_func (reinterpret_cast<void *>(static_cast<ptrdiff_t>(ret->Value ())));
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE>
static
inline
ITERATOR_TYPE
_rt_coreclr_hash_map_iterator_begin (CONST_HASH_MAP_TYPE *hash_map)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL);
return hash_map->table->Begin ();
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE, typename CONST_HASH_MAP_TYPE = const HASH_MAP_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
bool
_rt_coreclr_hash_map_iterator_end (
CONST_HASH_MAP_TYPE *hash_map,
CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (hash_map != NULL && hash_map->table != NULL && iterator != NULL);
return (hash_map->table->End () == *iterator);
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE>
static
inline
void
_rt_coreclr_hash_map_iterator_next (ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (iterator != NULL);
(*iterator)++;
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE, typename KEY_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
KEY_TYPE
_rt_coreclr_hash_map_iterator_key (CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (iterator != NULL);
return (*iterator)->Key ();
}
template<typename HASH_MAP_TYPE, typename ITERATOR_TYPE, typename VALUE_TYPE, typename CONST_ITERATOR_TYPE = const ITERATOR_TYPE>
static
inline
VALUE_TYPE
_rt_coreclr_hash_map_iterator_value (CONST_ITERATOR_TYPE *iterator)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (HASH_MAP_TYPE::table_type_t::s_NoThrow);
EP_ASSERT (iterator != NULL);
return (*iterator)->Value ();
}
#define EP_RT_DEFINE_LIST_PREFIX(prefix_name, list_name, list_type, item_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, alloc) (list_type *list) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_alloc<list_type>(list); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, free) (list_type *list, void (*callback)(void *)) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_free<list_type>(list, callback); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, clear) (list_type *list, void (*callback)(void *)) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_clear<list_type>(list, callback); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, append) (list_type *list, item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_append<list_type, item_type>(list, item); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, remove) (list_type *list, const item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_remove<list_type, item_type>(list, item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, find) (const list_type *list, const item_type item_to_find, item_type *found_item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_find<list_type, item_type>(list, item_to_find, found_item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, is_empty) (const list_type *list) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_is_empty<list_type>(list); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, is_valid) (const list_type *list) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_is_valid<list_type>(list); \
}
#undef EP_RT_DEFINE_LIST
#define EP_RT_DEFINE_LIST(list_name, list_type, item_type) \
EP_RT_DEFINE_LIST_PREFIX(ep, list_name, list_type, item_type)
#define EP_RT_DEFINE_LIST_ITERATOR_PREFIX(prefix_name, list_name, list_type, iterator_type, item_type) \
static inline iterator_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, iterator_begin) (const list_type *list) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_iterator_begin<list_type, iterator_type>(list); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, iterator_end) (const list_type *list, const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_iterator_end<list_type, iterator_type>(list, iterator); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, iterator_next) (iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_list_iterator_next<iterator_type>(iterator); \
} \
static inline item_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, list_name, iterator_value) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_list_iterator_value<iterator_type, item_type>(iterator); \
}
#undef EP_RT_DEFINE_LIST_ITERATOR
#define EP_RT_DEFINE_LIST_ITERATOR(list_name, list_type, iterator_type, item_type) \
EP_RT_DEFINE_LIST_ITERATOR_PREFIX(ep, list_name, list_type, iterator_type, item_type)
#define EP_RT_DEFINE_QUEUE_PREFIX(prefix_name, queue_name, queue_type, item_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, alloc) (queue_type *queue) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_queue_alloc<queue_type>(queue); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, free) (queue_type *queue) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_queue_free<queue_type>(queue); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, pop_head) (queue_type *queue, item_type *item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_pop_head<queue_type, item_type>(queue, item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, push_head) (queue_type *queue, item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_push_head<queue_type, item_type>(queue, item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, push_tail) (queue_type *queue, item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_push_tail<queue_type, item_type>(queue, item); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, is_empty) (const queue_type *queue) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_is_empty<queue_type>(queue); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, queue_name, is_valid) (const queue_type *queue) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_queue_is_valid<queue_type>(queue); \
}
#undef EP_RT_DEFINE_QUEUE
#define EP_RT_DEFINE_QUEUE(queue_name, queue_type, item_type) \
EP_RT_DEFINE_QUEUE_PREFIX(ep, queue_name, queue_type, item_type)
#define EP_RT_DEFINE_ARRAY_PREFIX(prefix_name, array_name, array_type, iterator_type, item_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, alloc) (array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_alloc<array_type>(ep_array); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, alloc_capacity) (array_type *ep_array, size_t capacity) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_alloc_capacity<array_type>(ep_array, capacity); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, free) (array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_free<array_type>(ep_array); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, append) (array_type *ep_array, item_type item) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_append<array_type, item_type> (ep_array, item); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, clear) (array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_clear<array_type, item_type> (ep_array); \
} \
static inline size_t EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, size) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_size<array_type> (ep_array); \
} \
static inline item_type * EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, data) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_data<array_type, item_type> (ep_array); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, is_valid) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_is_valid<array_type> (ep_array); \
}
#define EP_RT_DEFINE_LOCAL_ARRAY_PREFIX(prefix_name, array_name, array_type, iterator_type, item_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, init) (array_type *ep_array) { \
STATIC_CONTRACT_NOTHROW; \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, init_capacity) (array_type *ep_array, size_t capacity) { \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_init_capacity<array_type>(ep_array, capacity); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, fini) (array_type *ep_array) { \
STATIC_CONTRACT_NOTHROW; \
}
#undef EP_RT_DEFINE_ARRAY
#define EP_RT_DEFINE_ARRAY(array_name, array_type, iterator_type, item_type) \
EP_RT_DEFINE_ARRAY_PREFIX(ep, array_name, array_type, iterator_type, item_type)
#undef EP_RT_DEFINE_LOCAL_ARRAY
#define EP_RT_DEFINE_LOCAL_ARRAY(array_name, array_type, iterator_type, item_type) \
EP_RT_DEFINE_LOCAL_ARRAY_PREFIX(ep, array_name, array_type, iterator_type, item_type)
#define EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, var_type) \
var_type::array_type_t _local_ ##var_name; \
var_type var_name; \
var_name.array = &_local_ ##var_name
#define EP_RT_DEFINE_ARRAY_ITERATOR_PREFIX(prefix_name, array_name, array_type, iterator_type, item_type) \
static inline iterator_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, iterator_begin) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_iterator_begin<array_type, iterator_type> (ep_array); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, iterator_end) (const array_type *ep_array, const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_iterator_end<array_type, iterator_type> (ep_array, iterator); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, iterator_next) (iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_iterator_next<iterator_type> (iterator); \
} \
static inline item_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, iterator_value) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_iterator_value<iterator_type, item_type> (iterator); \
}
#define EP_RT_DEFINE_ARRAY_REVERSE_ITERATOR_PREFIX(prefix_name, array_name, array_type, iterator_type, item_type) \
static inline iterator_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, reverse_iterator_begin) (const array_type *ep_array) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_reverse_iterator_begin<array_type, iterator_type> (ep_array); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, reverse_iterator_end) (const array_type *ep_array, const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_reverse_iterator_end<array_type, iterator_type> (ep_array, iterator); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, reverse_iterator_next) (iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_array_reverse_iterator_next<iterator_type> (iterator); \
} \
static inline item_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, array_name, reverse_iterator_value) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_array_reverse_iterator_value<iterator_type, item_type> (iterator); \
}
#undef EP_RT_DEFINE_ARRAY_ITERATOR
#define EP_RT_DEFINE_ARRAY_ITERATOR(array_name, array_type, iterator_type, item_type) \
EP_RT_DEFINE_ARRAY_ITERATOR_PREFIX(ep, array_name, array_type, iterator_type, item_type)
#undef EP_RT_DEFINE_ARRAY_REVERSE_ITERATOR
#define EP_RT_DEFINE_ARRAY_REVERSE_ITERATOR(array_name, array_type, iterator_type, item_type) \
EP_RT_DEFINE_ARRAY_REVERSE_ITERATOR_PREFIX(ep, array_name, array_type, iterator_type, item_type)
#define EP_RT_DEFINE_HASH_MAP_BASE_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, alloc) (hash_map_type *hash_map, uint32_t (*hash_callback)(const void *), bool (*eq_callback)(const void *, const void *), void (*key_free_callback)(void *), void (*value_free_callback)(void *)) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_alloc<hash_map_type>(hash_map, hash_callback, eq_callback, key_free_callback, value_free_callback); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, free) (hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_free<hash_map_type>(hash_map); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, add) (hash_map_type *hash_map, key_type key, value_type value) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_add<hash_map_type, key_type, value_type>(hash_map, key, value); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, remove_all) (hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_remove_all<hash_map_type>(hash_map); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, lookup) (const hash_map_type *hash_map, const key_type key, value_type *value) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_lookup<hash_map_type, key_type, value_type>(hash_map, key, value); \
} \
static inline uint32_t EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, count) (const hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_count<hash_map_type>(hash_map); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, is_valid) (const hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_is_valid<hash_map_type>(hash_map); \
}
#define EP_RT_DEFINE_HASH_MAP_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_BASE_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, add_or_replace) (hash_map_type *hash_map, key_type key, value_type value) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_add_or_replace<hash_map_type, key_type, value_type>(hash_map, key, value); \
} \
#define EP_RT_DEFINE_HASH_MAP_REMOVE_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_BASE_PREFIX(prefix_name, hash_map_name, hash_map_type, key_type, value_type) \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, remove) (hash_map_type *hash_map, const key_type key) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_remove<hash_map_type, key_type>(hash_map, key); \
}
#undef EP_RT_DEFINE_HASH_MAP
#define EP_RT_DEFINE_HASH_MAP(hash_map_name, hash_map_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_PREFIX(ep, hash_map_name, hash_map_type, key_type, value_type)
#undef EP_RT_DEFINE_HASH_MAP_REMOVE
#define EP_RT_DEFINE_HASH_MAP_REMOVE(hash_map_name, hash_map_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_REMOVE_PREFIX(ep, hash_map_name, hash_map_type, key_type, value_type)
#define EP_RT_DEFINE_HASH_MAP_ITERATOR_PREFIX(prefix_name, hash_map_name, hash_map_type, iterator_type, key_type, value_type) \
static inline iterator_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_begin) (const hash_map_type *hash_map) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_iterator_begin<hash_map_type, iterator_type>(hash_map); \
} \
static inline bool EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_end) (const hash_map_type *hash_map, const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_iterator_end<hash_map_type, iterator_type>(hash_map, iterator); \
} \
static inline void EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_next) (iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
_rt_coreclr_hash_map_iterator_next<hash_map_type, iterator_type>(iterator); \
} \
static inline key_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_key) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_iterator_key<hash_map_type, iterator_type, key_type>(iterator); \
} \
static inline value_type EP_RT_BUILD_TYPE_FUNC_NAME(prefix_name, hash_map_name, iterator_value) (const iterator_type *iterator) \
{ \
STATIC_CONTRACT_NOTHROW; \
return _rt_coreclr_hash_map_iterator_value<hash_map_type, iterator_type, value_type>(iterator); \
}
#undef EP_RT_DEFINE_HASH_MAP_ITERATOR
#define EP_RT_DEFINE_HASH_MAP_ITERATOR(hash_map_name, hash_map_type, iterator_type, key_type, value_type) \
EP_RT_DEFINE_HASH_MAP_ITERATOR_PREFIX(ep, hash_map_name, hash_map_type, iterator_type, key_type, value_type)
static
inline
ep_rt_lock_handle_t *
ep_rt_coreclr_config_lock_get (void)
{
STATIC_CONTRACT_NOTHROW;
extern ep_rt_lock_handle_t _ep_rt_coreclr_config_lock_handle;
return &_ep_rt_coreclr_config_lock_handle;
}
static
inline
const ep_char8_t *
ep_rt_entrypoint_assembly_name_get_utf8 (void)
{
STATIC_CONTRACT_NOTHROW;
AppDomain *app_domain_ref = nullptr;
Assembly *assembly_ref = nullptr;
app_domain_ref = GetAppDomain ();
if (app_domain_ref != nullptr)
{
assembly_ref = app_domain_ref->GetRootAssembly ();
if (assembly_ref != nullptr)
{
return reinterpret_cast<const ep_char8_t*>(assembly_ref->GetSimpleName ());
}
}
// fallback to the empty string if we can't get assembly info, e.g., if the runtime is
// suspended before an assembly is loaded.
return reinterpret_cast<const ep_char8_t*>("");
}
static
const ep_char8_t *
ep_rt_runtime_version_get_utf8 (void)
{
STATIC_CONTRACT_NOTHROW;
return reinterpret_cast<const ep_char8_t*>(CLR_PRODUCT_VERSION);
}
/*
* Atomics.
*/
static
inline
uint32_t
ep_rt_atomic_inc_uint32_t (volatile uint32_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<uint32_t>(InterlockedIncrement ((volatile LONG *)(value)));
}
static
inline
uint32_t
ep_rt_atomic_dec_uint32_t (volatile uint32_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<uint32_t>(InterlockedDecrement ((volatile LONG *)(value)));
}
static
inline
int32_t
ep_rt_atomic_inc_int32_t (volatile int32_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int32_t>(InterlockedIncrement ((volatile LONG *)(value)));
}
static
inline
int32_t
ep_rt_atomic_dec_int32_t (volatile int32_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int32_t>(InterlockedDecrement ((volatile LONG *)(value)));
}
static
inline
int64_t
ep_rt_atomic_inc_int64_t (volatile int64_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int64_t>(InterlockedIncrement64 ((volatile LONG64 *)(value)));
}
static
inline
int64_t
ep_rt_atomic_dec_int64_t (volatile int64_t *value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int64_t>(InterlockedDecrement64 ((volatile LONG64 *)(value)));
}
static
inline
size_t
ep_rt_atomic_compare_exchange_size_t (volatile size_t *target, size_t expected, size_t value)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<size_t>(InterlockedCompareExchangeT<size_t> (target, value, expected));
}
/*
* EventPipe.
*/
EP_RT_DEFINE_ARRAY (session_id_array, ep_rt_session_id_array_t, ep_rt_session_id_array_iterator_t, EventPipeSessionID)
EP_RT_DEFINE_ARRAY_ITERATOR (session_id_array, ep_rt_session_id_array_t, ep_rt_session_id_array_iterator_t, EventPipeSessionID)
EP_RT_DEFINE_ARRAY (execution_checkpoint_array, ep_rt_execution_checkpoint_array_t, ep_rt_execution_checkpoint_array_iterator_t, EventPipeExecutionCheckpoint *)
EP_RT_DEFINE_ARRAY_ITERATOR (execution_checkpoint_array, ep_rt_execution_checkpoint_array_t, ep_rt_execution_checkpoint_array_iterator_t, EventPipeExecutionCheckpoint *)
static
void
ep_rt_init (void)
{
STATIC_CONTRACT_NOTHROW;
extern ep_rt_lock_handle_t _ep_rt_coreclr_config_lock_handle;
extern CrstStatic _ep_rt_coreclr_config_lock;
_ep_rt_coreclr_config_lock_handle.lock = &_ep_rt_coreclr_config_lock;
_ep_rt_coreclr_config_lock_handle.lock->InitNoThrow (CrstEventPipe, (CrstFlags)(CRST_REENTRANCY | CRST_TAKEN_DURING_SHUTDOWN | CRST_HOST_BREAKABLE));
if (CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeProcNumbers) != 0) {
#ifndef TARGET_UNIX
// setup the windows processor group offset table
uint16_t groups = ::GetActiveProcessorGroupCount ();
extern uint32_t *_ep_rt_coreclr_proc_group_offsets;
_ep_rt_coreclr_proc_group_offsets = new (nothrow) uint32_t [groups];
if (_ep_rt_coreclr_proc_group_offsets) {
uint32_t procs = 0;
for (uint16_t i = 0; i < procs; ++i) {
_ep_rt_coreclr_proc_group_offsets [i] = procs;
procs += GetActiveProcessorCount (i);
}
}
#endif
}
}
static
inline
void
ep_rt_init_finish (void)
{
STATIC_CONTRACT_NOTHROW;
}
static
inline
void
ep_rt_shutdown (void)
{
STATIC_CONTRACT_NOTHROW;
}
static
inline
bool
ep_rt_config_aquire (void)
{
STATIC_CONTRACT_NOTHROW;
return ep_rt_lock_aquire (ep_rt_coreclr_config_lock_get ());
}
static
inline
bool
ep_rt_config_release (void)
{
STATIC_CONTRACT_NOTHROW;
return ep_rt_lock_release (ep_rt_coreclr_config_lock_get ());
}
#ifdef EP_CHECKED_BUILD
static
inline
void
ep_rt_config_requires_lock_held (void)
{
STATIC_CONTRACT_NOTHROW;
ep_rt_lock_requires_lock_held (ep_rt_coreclr_config_lock_get ());
}
static
inline
void
ep_rt_config_requires_lock_not_held (void)
{
STATIC_CONTRACT_NOTHROW;
ep_rt_lock_requires_lock_not_held (ep_rt_coreclr_config_lock_get ());
}
#endif
static
inline
bool
ep_rt_walk_managed_stack_for_thread (
ep_rt_thread_handle_t thread,
EventPipeStackContents *stack_contents)
{
STATIC_CONTRACT_NOTHROW;
extern bool ep_rt_coreclr_walk_managed_stack_for_thread (ep_rt_thread_handle_t thread, EventPipeStackContents *stack_contents);
return ep_rt_coreclr_walk_managed_stack_for_thread (thread, stack_contents);
}
static
inline
bool
ep_rt_method_get_simple_assembly_name (
ep_rt_method_desc_t *method,
ep_char8_t *name,
size_t name_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (method != NULL);
EP_ASSERT (name != NULL);
const ep_char8_t *assembly_name = method->GetLoaderModule ()->GetAssembly ()->GetSimpleName ();
if (!assembly_name)
return false;
size_t assembly_name_len = strlen (assembly_name) + 1;
size_t to_copy = assembly_name_len < name_len ? assembly_name_len : name_len;
memcpy (name, assembly_name, to_copy);
name [to_copy - 1] = 0;
return true;
}
static
bool
ep_rt_method_get_full_name (
ep_rt_method_desc_t *method,
ep_char8_t *name,
size_t name_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (method != NULL);
EP_ASSERT (name != NULL);
bool result = true;
EX_TRY
{
SString method_name;
StackScratchBuffer conversion;
TypeString::AppendMethodInternal (method_name, method, TypeString::FormatNamespace | TypeString::FormatSignature);
const ep_char8_t *method_name_utf8 = method_name.GetUTF8 (conversion);
if (method_name_utf8) {
size_t method_name_utf8_len = strlen (method_name_utf8) + 1;
size_t to_copy = method_name_utf8_len < name_len ? method_name_utf8_len : name_len;
memcpy (name, method_name_utf8, to_copy);
name [to_copy - 1] = 0;
} else {
result = false;
}
}
EX_CATCH
{
result = false;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
static
inline
void
ep_rt_provider_config_init (EventPipeProviderConfiguration *provider_config)
{
STATIC_CONTRACT_NOTHROW;
if (!ep_rt_utf8_string_compare (ep_config_get_rundown_provider_name_utf8 (), ep_provider_config_get_provider_name (provider_config))) {
MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.Level = ep_provider_config_get_logging_level (provider_config);
MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.EnabledKeywordsBitmask = ep_provider_config_get_keywords (provider_config);
MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled = true;
}
}
// This function is auto-generated from /src/scripts/genEventPipe.py
#ifdef TARGET_UNIX
extern "C" void InitProvidersAndEvents ();
#else
extern void InitProvidersAndEvents ();
#endif
static
void
ep_rt_init_providers_and_events (void)
{
STATIC_CONTRACT_NOTHROW;
EX_TRY
{
InitProvidersAndEvents ();
}
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
}
static
inline
bool
ep_rt_providers_validate_all_disabled (void)
{
STATIC_CONTRACT_NOTHROW;
return (!MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled &&
!MICROSOFT_WINDOWS_DOTNETRUNTIME_PRIVATE_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled &&
!MICROSOFT_WINDOWS_DOTNETRUNTIME_RUNDOWN_PROVIDER_DOTNET_Context.EventPipeProvider.IsEnabled);
}
static
inline
void
ep_rt_prepare_provider_invoke_callback (EventPipeProviderCallbackData *provider_callback_data)
{
STATIC_CONTRACT_NOTHROW;
}
static
void
ep_rt_provider_invoke_callback (
EventPipeCallback callback_func,
const uint8_t *source_id,
unsigned long is_enabled,
uint8_t level,
uint64_t match_any_keywords,
uint64_t match_all_keywords,
EventFilterDescriptor *filter_data,
void *callback_data)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (callback_func != NULL);
EX_TRY
{
(*callback_func)(
source_id,
is_enabled,
level,
match_any_keywords,
match_all_keywords,
filter_data,
callback_data);
}
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
}
/*
* EventPipeBuffer.
*/
EP_RT_DEFINE_ARRAY (buffer_array, ep_rt_buffer_array_t, ep_rt_buffer_array_iterator_t, EventPipeBuffer *)
EP_RT_DEFINE_LOCAL_ARRAY (buffer_array, ep_rt_buffer_array_t, ep_rt_buffer_array_iterator_t, EventPipeBuffer *)
EP_RT_DEFINE_ARRAY_ITERATOR (buffer_array, ep_rt_buffer_array_t, ep_rt_buffer_array_iterator_t, EventPipeBuffer *)
#undef EP_RT_DECLARE_LOCAL_BUFFER_ARRAY
#define EP_RT_DECLARE_LOCAL_BUFFER_ARRAY(var_name) \
EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, ep_rt_buffer_array_t)
/*
* EventPipeBufferList.
*/
EP_RT_DEFINE_ARRAY (buffer_list_array, ep_rt_buffer_list_array_t, ep_rt_buffer_list_array_iterator_t, EventPipeBufferList *)
EP_RT_DEFINE_LOCAL_ARRAY (buffer_list_array, ep_rt_buffer_list_array_t, ep_rt_buffer_list_array_iterator_t, EventPipeBufferList *)
EP_RT_DEFINE_ARRAY_ITERATOR (buffer_list_array, ep_rt_buffer_list_array_t, ep_rt_buffer_list_array_iterator_t, EventPipeBufferList *)
#undef EP_RT_DECLARE_LOCAL_BUFFER_LIST_ARRAY
#define EP_RT_DECLARE_LOCAL_BUFFER_LIST_ARRAY(var_name) \
EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, ep_rt_buffer_list_array_t)
/*
* EventPipeEvent.
*/
EP_RT_DEFINE_LIST (event_list, ep_rt_event_list_t, EventPipeEvent *)
EP_RT_DEFINE_LIST_ITERATOR (event_list, ep_rt_event_list_t, ep_rt_event_list_iterator_t, EventPipeEvent *)
/*
* EventPipeFile.
*/
EP_RT_DEFINE_HASH_MAP_REMOVE(metadata_labels_hash, ep_rt_metadata_labels_hash_map_t, EventPipeEvent *, uint32_t)
EP_RT_DEFINE_HASH_MAP(stack_hash, ep_rt_stack_hash_map_t, StackHashKey *, StackHashEntry *)
EP_RT_DEFINE_HASH_MAP_ITERATOR(stack_hash, ep_rt_stack_hash_map_t, ep_rt_stack_hash_map_iterator_t, StackHashKey *, StackHashEntry *)
/*
* EventPipeProvider.
*/
EP_RT_DEFINE_LIST (provider_list, ep_rt_provider_list_t, EventPipeProvider *)
EP_RT_DEFINE_LIST_ITERATOR (provider_list, ep_rt_provider_list_t, ep_rt_provider_list_iterator_t, EventPipeProvider *)
EP_RT_DEFINE_QUEUE (provider_callback_data_queue, ep_rt_provider_callback_data_queue_t, EventPipeProviderCallbackData *)
static
EventPipeProvider *
ep_rt_provider_list_find_by_name (
const ep_rt_provider_list_t *list,
const ep_char8_t *name)
{
STATIC_CONTRACT_NOTHROW;
// The provider list should be non-NULL, but can be NULL on shutdown.
if (list) {
SList<SListElem<EventPipeProvider *>> *provider_list = list->list;
SListElem<EventPipeProvider *> *element = provider_list->GetHead ();
while (element) {
EventPipeProvider *provider = element->GetValue ();
if (ep_rt_utf8_string_compare (ep_provider_get_provider_name (element->GetValue ()), name) == 0)
return provider;
element = provider_list->GetNext (element);
}
}
return NULL;
}
/*
* EventPipeProviderConfiguration.
*/
EP_RT_DEFINE_ARRAY (provider_config_array, ep_rt_provider_config_array_t, ep_rt_provider_config_array_iterator_t, EventPipeProviderConfiguration)
EP_RT_DEFINE_ARRAY_ITERATOR (provider_config_array, ep_rt_provider_config_array_t, ep_rt_provider_config_array_iterator_t, EventPipeProviderConfiguration)
static
inline
bool
ep_rt_config_value_get_enable (void)
{
STATIC_CONTRACT_NOTHROW;
return CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EnableEventPipe) != 0;
}
static
inline
ep_char8_t *
ep_rt_config_value_get_config (void)
{
STATIC_CONTRACT_NOTHROW;
CLRConfigStringHolder value(CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeConfig));
return ep_rt_utf16_to_utf8_string (reinterpret_cast<ep_char16_t *>(value.GetValue ()), -1);
}
static
inline
ep_char8_t *
ep_rt_config_value_get_output_path (void)
{
STATIC_CONTRACT_NOTHROW;
CLRConfigStringHolder value(CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeOutputPath));
return ep_rt_utf16_to_utf8_string (reinterpret_cast<ep_char16_t *>(value.GetValue ()), -1);
}
static
inline
uint32_t
ep_rt_config_value_get_circular_mb (void)
{
STATIC_CONTRACT_NOTHROW;
return CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeCircularMB);
}
static
inline
bool
ep_rt_config_value_get_output_streaming (void)
{
STATIC_CONTRACT_NOTHROW;
return CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeOutputStreaming) != 0;
}
static
inline
bool
ep_rt_config_value_get_use_portable_thread_pool (void)
{
STATIC_CONTRACT_NOTHROW;
return ThreadpoolMgr::UsePortableThreadPool ();
}
/*
* EventPipeSampleProfiler.
*/
static
inline
void
ep_rt_sample_profiler_write_sampling_event_for_threads (
ep_rt_thread_handle_t sampling_thread,
EventPipeEvent *sampling_event)
{
STATIC_CONTRACT_NOTHROW;
extern void ep_rt_coreclr_sample_profiler_write_sampling_event_for_threads (ep_rt_thread_handle_t sampling_thread, EventPipeEvent *sampling_event);
ep_rt_coreclr_sample_profiler_write_sampling_event_for_threads (sampling_thread, sampling_event);
}
static
inline
void
ep_rt_notify_profiler_provider_created (EventPipeProvider *provider)
{
STATIC_CONTRACT_NOTHROW;
#ifndef DACCESS_COMPILE
// Let the profiler know the provider has been created so it can register if it wants to
BEGIN_PROFILER_CALLBACK (CORProfilerTrackEventPipe ());
(&g_profControlBlock)->EventPipeProviderCreated (provider);
END_PROFILER_CALLBACK ();
#endif // DACCESS_COMPILE
}
/*
* EventPipeSessionProvider.
*/
EP_RT_DEFINE_LIST (session_provider_list, ep_rt_session_provider_list_t, EventPipeSessionProvider *)
EP_RT_DEFINE_LIST_ITERATOR (session_provider_list, ep_rt_session_provider_list_t, ep_rt_session_provider_list_iterator_t, EventPipeSessionProvider *)
static
EventPipeSessionProvider *
ep_rt_session_provider_list_find_by_name (
const ep_rt_session_provider_list_t *list,
const ep_char8_t *name)
{
STATIC_CONTRACT_NOTHROW;
SList<SListElem<EventPipeSessionProvider *>> *provider_list = list->list;
EventPipeSessionProvider *session_provider = NULL;
SListElem<EventPipeSessionProvider *> *element = provider_list->GetHead ();
while (element) {
EventPipeSessionProvider *candidate = element->GetValue ();
if (ep_rt_utf8_string_compare (ep_session_provider_get_provider_name (candidate), name) == 0) {
session_provider = candidate;
break;
}
element = provider_list->GetNext (element);
}
return session_provider;
}
/*
* EventPipeSequencePoint.
*/
EP_RT_DEFINE_LIST (sequence_point_list, ep_rt_sequence_point_list_t, EventPipeSequencePoint *)
EP_RT_DEFINE_LIST_ITERATOR (sequence_point_list, ep_rt_sequence_point_list_t, ep_rt_sequence_point_list_iterator_t, EventPipeSequencePoint *)
/*
* EventPipeThread.
*/
EP_RT_DEFINE_LIST (thread_list, ep_rt_thread_list_t, EventPipeThread *)
EP_RT_DEFINE_LIST_ITERATOR (thread_list, ep_rt_thread_list_t, ep_rt_thread_list_iterator_t, EventPipeThread *)
EP_RT_DEFINE_ARRAY (thread_array, ep_rt_thread_array_t, ep_rt_thread_array_iterator_t, EventPipeThread *)
EP_RT_DEFINE_LOCAL_ARRAY (thread_array, ep_rt_thread_array_t, ep_rt_thread_array_iterator_t, EventPipeThread *)
EP_RT_DEFINE_ARRAY_ITERATOR (thread_array, ep_rt_thread_array_t, ep_rt_thread_array_iterator_t, EventPipeThread *)
#undef EP_RT_DECLARE_LOCAL_THREAD_ARRAY
#define EP_RT_DECLARE_LOCAL_THREAD_ARRAY(var_name) \
EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, ep_rt_thread_array_t)
/*
* EventPipeThreadSessionState.
*/
EP_RT_DEFINE_LIST (thread_session_state_list, ep_rt_thread_session_state_list_t, EventPipeThreadSessionState *)
EP_RT_DEFINE_LIST_ITERATOR (thread_session_state_list, ep_rt_thread_session_state_list_t, ep_rt_thread_session_state_list_iterator_t, EventPipeThreadSessionState *)
EP_RT_DEFINE_ARRAY (thread_session_state_array, ep_rt_thread_session_state_array_t, ep_rt_thread_session_state_array_iterator_t, EventPipeThreadSessionState *)
EP_RT_DEFINE_LOCAL_ARRAY (thread_session_state_array, ep_rt_thread_session_state_array_t, ep_rt_thread_session_state_array_iterator_t, EventPipeThreadSessionState *)
EP_RT_DEFINE_ARRAY_ITERATOR (thread_session_state_array, ep_rt_thread_session_state_array_t, ep_rt_thread_session_state_array_iterator_t, EventPipeThreadSessionState *)
#undef EP_RT_DECLARE_LOCAL_THREAD_SESSION_STATE_ARRAY
#define EP_RT_DECLARE_LOCAL_THREAD_SESSION_STATE_ARRAY(var_name) \
EP_RT_DECLARE_LOCAL_ARRAY_VARIABLE(var_name, ep_rt_thread_session_state_array_t)
/*
* Arrays.
*/
static
inline
uint8_t *
ep_rt_byte_array_alloc (size_t len)
{
STATIC_CONTRACT_NOTHROW;
return new (nothrow) uint8_t [len];
}
static
inline
void
ep_rt_byte_array_free (uint8_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
if (ptr)
delete [] ptr;
}
/*
* Event.
*/
static
void
ep_rt_wait_event_alloc (
ep_rt_wait_event_handle_t *wait_event,
bool manual,
bool initial)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (wait_event != NULL);
EP_ASSERT (wait_event->event == NULL);
wait_event->event = new (nothrow) CLREventStatic ();
if (wait_event->event) {
EX_TRY
{
if (manual)
wait_event->event->CreateManualEvent (initial);
else
wait_event->event->CreateAutoEvent (initial);
}
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
}
}
static
inline
void
ep_rt_wait_event_free (ep_rt_wait_event_handle_t *wait_event)
{
STATIC_CONTRACT_NOTHROW;
if (wait_event != NULL && wait_event->event != NULL) {
wait_event->event->CloseEvent ();
delete wait_event->event;
wait_event->event = NULL;
}
}
static
inline
bool
ep_rt_wait_event_set (ep_rt_wait_event_handle_t *wait_event)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (wait_event != NULL && wait_event->event != NULL);
return wait_event->event->Set ();
}
static
int32_t
ep_rt_wait_event_wait (
ep_rt_wait_event_handle_t *wait_event,
uint32_t timeout,
bool alertable)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (wait_event != NULL && wait_event->event != NULL);
int32_t result;
EX_TRY
{
result = wait_event->event->Wait (timeout, alertable);
}
EX_CATCH
{
result = -1;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
static
inline
EventPipeWaitHandle
ep_rt_wait_event_get_wait_handle (ep_rt_wait_event_handle_t *wait_event)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (wait_event != NULL && wait_event->event != NULL);
return reinterpret_cast<EventPipeWaitHandle>(wait_event->event->GetHandleUNHOSTED ());
}
static
inline
bool
ep_rt_wait_event_is_valid (ep_rt_wait_event_handle_t *wait_event)
{
STATIC_CONTRACT_NOTHROW;
if (wait_event == NULL || wait_event->event == NULL)
return false;
return wait_event->event->IsValid ();
}
/*
* Misc.
*/
static
inline
int
ep_rt_get_last_error (void)
{
STATIC_CONTRACT_NOTHROW;
return ::GetLastError ();
}
static
inline
bool
ep_rt_process_detach (void)
{
STATIC_CONTRACT_NOTHROW;
return (bool)g_fProcessDetach;
}
static
inline
bool
ep_rt_process_shutdown (void)
{
STATIC_CONTRACT_NOTHROW;
return (bool)g_fEEShutDown;
}
static
inline
void
ep_rt_create_activity_id (
uint8_t *activity_id,
uint32_t activity_id_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (activity_id != NULL);
EP_ASSERT (activity_id_len == EP_ACTIVITY_ID_SIZE);
CoCreateGuid (reinterpret_cast<GUID *>(activity_id));
}
static
inline
bool
ep_rt_is_running (void)
{
STATIC_CONTRACT_NOTHROW;
return (bool)g_fEEStarted;
}
static
inline
void
ep_rt_execute_rundown (ep_rt_execution_checkpoint_array_t *execution_checkpoints)
{
STATIC_CONTRACT_NOTHROW;
//TODO: Write execution checkpoint rundown events.
if (CLRConfig::GetConfigValue (CLRConfig::INTERNAL_EventPipeRundown) > 0) {
// Ask the runtime to emit rundown events.
if (g_fEEStarted && !g_fEEShutDown)
ETW::EnumerationLog::EndRundown ();
}
}
/*
* Objects.
*/
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_object_alloc
#define ep_rt_object_alloc(obj_type) (new (nothrow) obj_type())
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_object_array_alloc
#define ep_rt_object_array_alloc(obj_type,size) (new (nothrow) obj_type [size]())
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_object_array_free
#define ep_rt_object_array_free(obj_ptr) do { if (obj_ptr) delete [] obj_ptr; } while(0)
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_object_free
#define ep_rt_object_free(obj_ptr) do { if (obj_ptr) delete obj_ptr; } while(0)
/*
* PAL.
*/
typedef struct _rt_coreclr_thread_params_internal_t {
ep_rt_thread_params_t thread_params;
} rt_coreclr_thread_params_internal_t;
#undef EP_RT_DEFINE_THREAD_FUNC
#define EP_RT_DEFINE_THREAD_FUNC(name) static ep_rt_thread_start_func_return_t WINAPI name (LPVOID data)
EP_RT_DEFINE_THREAD_FUNC (ep_rt_thread_coreclr_start_func)
{
STATIC_CONTRACT_NOTHROW;
rt_coreclr_thread_params_internal_t *thread_params = reinterpret_cast<rt_coreclr_thread_params_internal_t *>(data);
DWORD result = thread_params->thread_params.thread_func (thread_params);
if (thread_params->thread_params.thread)
::DestroyThread (thread_params->thread_params.thread);
delete thread_params;
return result;
}
static
bool
ep_rt_thread_create (
void *thread_func,
void *params,
EventPipeThreadType thread_type,
void *id)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (thread_func != NULL);
bool result = false;
EX_TRY
{
rt_coreclr_thread_params_internal_t *thread_params = new (nothrow) rt_coreclr_thread_params_internal_t ();
if (thread_params) {
thread_params->thread_params.thread_type = thread_type;
if (thread_type == EP_THREAD_TYPE_SESSION || thread_type == EP_THREAD_TYPE_SAMPLING) {
thread_params->thread_params.thread = SetupUnstartedThread ();
thread_params->thread_params.thread_func = reinterpret_cast<LPTHREAD_START_ROUTINE>(thread_func);
thread_params->thread_params.thread_params = params;
if (thread_params->thread_params.thread->CreateNewThread (0, ep_rt_thread_coreclr_start_func, thread_params)) {
thread_params->thread_params.thread->SetBackground (TRUE);
thread_params->thread_params.thread->StartThread ();
if (id)
*reinterpret_cast<DWORD *>(id) = thread_params->thread_params.thread->GetThreadId ();
result = true;
}
} else if (thread_type == EP_THREAD_TYPE_SERVER) {
DWORD thread_id = 0;
HANDLE server_thread = ::CreateThread (nullptr, 0, reinterpret_cast<LPTHREAD_START_ROUTINE>(thread_func), nullptr, 0, &thread_id);
if (server_thread != NULL) {
::CloseHandle (server_thread);
if (id)
*reinterpret_cast<DWORD *>(id) = thread_id;
result = true;
}
}
}
}
EX_CATCH
{
result = false;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
static
inline
void
ep_rt_thread_sleep (uint64_t ns)
{
STATIC_CONTRACT_NOTHROW;
#ifdef TARGET_UNIX
PAL_nanosleep (ns);
#else //TARGET_UNIX
const uint32_t NUM_NANOSECONDS_IN_1_MS = 1000000;
ClrSleepEx (static_cast<DWORD>(ns / NUM_NANOSECONDS_IN_1_MS), FALSE);
#endif //TARGET_UNIX
}
static
inline
uint32_t
ep_rt_current_process_get_id (void)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<uint32_t>(GetCurrentProcessId ());
}
static
inline
uint32_t
ep_rt_current_processor_get_number (void)
{
STATIC_CONTRACT_NOTHROW;
#ifndef TARGET_UNIX
extern uint32_t *_ep_rt_coreclr_proc_group_offsets;
if (_ep_rt_coreclr_proc_group_offsets) {
PROCESSOR_NUMBER proc;
GetCurrentProcessorNumberEx (&proc);
return _ep_rt_coreclr_proc_group_offsets [proc.Group] + proc.Number;
}
#endif
return 0xFFFFFFFF;
}
static
inline
uint32_t
ep_rt_processors_get_count (void)
{
STATIC_CONTRACT_NOTHROW;
SYSTEM_INFO sys_info = {};
GetSystemInfo (&sys_info);
return static_cast<uint32_t>(sys_info.dwNumberOfProcessors);
}
static
inline
ep_rt_thread_id_t
ep_rt_current_thread_get_id (void)
{
STATIC_CONTRACT_NOTHROW;
#ifdef TARGET_UNIX
return static_cast<ep_rt_thread_id_t>(::PAL_GetCurrentOSThreadId ());
#else
return static_cast<ep_rt_thread_id_t>(::GetCurrentThreadId ());
#endif
}
static
inline
int64_t
ep_rt_perf_counter_query (void)
{
STATIC_CONTRACT_NOTHROW;
LARGE_INTEGER value;
if (QueryPerformanceCounter (&value))
return static_cast<int64_t>(value.QuadPart);
else
return 0;
}
static
inline
int64_t
ep_rt_perf_frequency_query (void)
{
STATIC_CONTRACT_NOTHROW;
LARGE_INTEGER value;
if (QueryPerformanceFrequency (&value))
return static_cast<int64_t>(value.QuadPart);
else
return 0;
}
static
inline
void
ep_rt_system_time_get (EventPipeSystemTime *system_time)
{
STATIC_CONTRACT_NOTHROW;
SYSTEMTIME value;
GetSystemTime (&value);
EP_ASSERT(system_time != NULL);
ep_system_time_set (
system_time,
value.wYear,
value.wMonth,
value.wDayOfWeek,
value.wDay,
value.wHour,
value.wMinute,
value.wSecond,
value.wMilliseconds);
}
static
inline
int64_t
ep_rt_system_timestamp_get (void)
{
STATIC_CONTRACT_NOTHROW;
FILETIME value;
GetSystemTimeAsFileTime (&value);
return static_cast<int64_t>(((static_cast<uint64_t>(value.dwHighDateTime)) << 32) | static_cast<uint64_t>(value.dwLowDateTime));
}
static
inline
int32_t
ep_rt_system_get_alloc_granularity (void)
{
STATIC_CONTRACT_NOTHROW;
return static_cast<int32_t>(g_SystemInfo.dwAllocationGranularity);
}
static
inline
const ep_char8_t *
ep_rt_os_command_line_get (void)
{
STATIC_CONTRACT_NOTHROW;
EP_UNREACHABLE ("Can not reach here");
return NULL;
}
static
ep_rt_file_handle_t
ep_rt_file_open_write (const ep_char8_t *path)
{
STATIC_CONTRACT_NOTHROW;
ep_char16_t *path_utf16 = ep_rt_utf8_to_utf16_string (path, -1);
ep_return_null_if_nok (path_utf16 != NULL);
CFileStream *file_stream = new (nothrow) CFileStream ();
if (file_stream && FAILED (file_stream->OpenForWrite (reinterpret_cast<LPWSTR>(path_utf16)))) {
delete file_stream;
file_stream = NULL;
}
ep_rt_utf16_string_free (path_utf16);
return static_cast<ep_rt_file_handle_t>(file_stream);
}
static
inline
bool
ep_rt_file_close (ep_rt_file_handle_t file_handle)
{
STATIC_CONTRACT_NOTHROW;
// Closed in destructor.
if (file_handle)
delete file_handle;
return true;
}
static
inline
bool
ep_rt_file_write (
ep_rt_file_handle_t file_handle,
const uint8_t *buffer,
uint32_t bytes_to_write,
uint32_t *bytes_written)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (buffer != NULL);
ep_return_false_if_nok (file_handle != NULL);
ULONG out_count;
HRESULT result = reinterpret_cast<CFileStream *>(file_handle)->Write (buffer, bytes_to_write, &out_count);
*bytes_written = static_cast<uint32_t>(out_count);
return result == S_OK;
}
static
inline
uint8_t *
ep_rt_valloc0 (size_t buffer_size)
{
STATIC_CONTRACT_NOTHROW;
return reinterpret_cast<uint8_t *>(ClrVirtualAlloc (NULL, buffer_size, MEM_COMMIT, PAGE_READWRITE));
}
static
inline
void
ep_rt_vfree (
uint8_t *buffer,
size_t buffer_size)
{
STATIC_CONTRACT_NOTHROW;
if (buffer)
ClrVirtualFree (buffer, 0, MEM_RELEASE);
}
static
inline
uint32_t
ep_rt_temp_path_get (
ep_char8_t *buffer,
uint32_t buffer_len)
{
STATIC_CONTRACT_NOTHROW;
EP_UNREACHABLE ("Can not reach here");
return 0;
}
EP_RT_DEFINE_ARRAY (env_array_utf16, ep_rt_env_array_utf16_t, ep_rt_env_array_utf16_iterator_t, ep_char16_t *)
EP_RT_DEFINE_ARRAY_ITERATOR (env_array_utf16, ep_rt_env_array_utf16_t, ep_rt_env_array_utf16_iterator_t, ep_char16_t *)
static
void
ep_rt_os_environment_get_utf16 (ep_rt_env_array_utf16_t *env_array)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (env_array != NULL);
LPWSTR envs = GetEnvironmentStringsW ();
if (envs) {
LPWSTR next = envs;
while (*next) {
ep_rt_env_array_utf16_append (env_array, ep_rt_utf16_string_dup (reinterpret_cast<const ep_char16_t *>(next)));
next += ep_rt_utf16_string_len (reinterpret_cast<const ep_char16_t *>(next)) + 1;
}
FreeEnvironmentStringsW (envs);
}
}
/*
* Lock.
*/
static
bool
ep_rt_lock_aquire (ep_rt_lock_handle_t *lock)
{
STATIC_CONTRACT_NOTHROW;
bool result = true;
EX_TRY
{
if (lock) {
CrstBase::CrstHolderWithState holder (lock->lock);
holder.SuppressRelease ();
}
}
EX_CATCH
{
result = false;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
static
bool
ep_rt_lock_release (ep_rt_lock_handle_t *lock)
{
STATIC_CONTRACT_NOTHROW;
bool result = true;
EX_TRY
{
if (lock) {
CrstBase::UnsafeCrstInverseHolder holder (lock->lock);
holder.SuppressRelease ();
}
}
EX_CATCH
{
result = false;
}
EX_END_CATCH(SwallowAllExceptions);
return result;
}
#ifdef EP_CHECKED_BUILD
static
inline
void
ep_rt_lock_requires_lock_held (const ep_rt_lock_handle_t *lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (((ep_rt_lock_handle_t *)lock)->lock->OwnedByCurrentThread ());
}
static
inline
void
ep_rt_lock_requires_lock_not_held (const ep_rt_lock_handle_t *lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (lock->lock == NULL || !((ep_rt_lock_handle_t *)lock)->lock->OwnedByCurrentThread ());
}
#endif
/*
* SpinLock.
*/
static
void
ep_rt_spin_lock_alloc (ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EX_TRY
{
spin_lock->lock = new (nothrow) SpinLock ();
spin_lock->lock->Init (LOCK_TYPE_DEFAULT);
}
EX_CATCH {}
EX_END_CATCH(SwallowAllExceptions);
}
static
inline
void
ep_rt_spin_lock_free (ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
if (spin_lock && spin_lock->lock) {
delete spin_lock->lock;
spin_lock->lock = NULL;
}
}
static
inline
bool
ep_rt_spin_lock_aquire (ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_rt_spin_lock_is_valid (spin_lock));
SpinLock::AcquireLock (spin_lock->lock);
return true;
}
static
inline
bool
ep_rt_spin_lock_release (ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_rt_spin_lock_is_valid (spin_lock));
SpinLock::ReleaseLock (spin_lock->lock);
return true;
}
#ifdef EP_CHECKED_BUILD
static
inline
void
ep_rt_spin_lock_requires_lock_held (const ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (ep_rt_spin_lock_is_valid (spin_lock));
EP_ASSERT (spin_lock->lock->OwnedByCurrentThread ());
}
static
inline
void
ep_rt_spin_lock_requires_lock_not_held (const ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (spin_lock->lock == NULL || !spin_lock->lock->OwnedByCurrentThread ());
}
#endif
static
inline
bool
ep_rt_spin_lock_is_valid (const ep_rt_spin_lock_handle_t *spin_lock)
{
STATIC_CONTRACT_NOTHROW;
return (spin_lock != NULL && spin_lock->lock != NULL);
}
/*
* String.
*/
static
inline
int
ep_rt_utf8_string_compare (
const ep_char8_t *str1,
const ep_char8_t *str2)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (str1 != NULL && str2 != NULL);
return strcmp (reinterpret_cast<const char *>(str1), reinterpret_cast<const char *>(str2));
}
static
inline
int
ep_rt_utf8_string_compare_ignore_case (
const ep_char8_t *str1,
const ep_char8_t *str2)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (str1 != NULL && str2 != NULL);
return _stricmp (reinterpret_cast<const char *>(str1), reinterpret_cast<const char *>(str2));
}
static
inline
bool
ep_rt_utf8_string_is_null_or_empty (const ep_char8_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (str == NULL)
return true;
while (*str) {
if (!isspace (*str))
return false;
str++;
}
return true;
}
static
inline
ep_char8_t *
ep_rt_utf8_string_dup (const ep_char8_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (!str)
return NULL;
return _strdup (str);
}
static
inline
ep_char8_t *
ep_rt_utf8_string_dup_range (const ep_char8_t *str, const ep_char8_t *strEnd)
{
ptrdiff_t byte_len = strEnd - str;
ep_char8_t *buffer = reinterpret_cast<ep_char8_t *>(malloc(byte_len + 1));
if (buffer != NULL)
{
memcpy (buffer, str, byte_len);
buffer [byte_len] = '\0';
}
return buffer;
}
static
inline
ep_char8_t *
ep_rt_utf8_string_strtok (
ep_char8_t *str,
const ep_char8_t *delimiter,
ep_char8_t **context)
{
STATIC_CONTRACT_NOTHROW;
return strtok_s (str, delimiter, context);
}
// STATIC_CONTRACT_NOTHROW
#undef ep_rt_utf8_string_snprintf
#define ep_rt_utf8_string_snprintf( \
str, \
str_len, \
format, ...) \
sprintf_s (reinterpret_cast<char *>(str), static_cast<size_t>(str_len), reinterpret_cast<const char *>(format), __VA_ARGS__)
static
inline
bool
ep_rt_utf8_string_replace (
ep_char8_t **str,
const ep_char8_t *strSearch,
const ep_char8_t *strReplacement
)
{
STATIC_CONTRACT_NOTHROW;
if ((*str) == NULL)
return false;
ep_char8_t* strFound = strstr(*str, strSearch);
if (strFound != NULL)
{
size_t strSearchLen = strlen(strSearch);
size_t newStrSize = strlen(*str) + strlen(strReplacement) - strSearchLen + 1;
ep_char8_t *newStr = reinterpret_cast<ep_char8_t *>(malloc(newStrSize));
if (newStr == NULL)
{
*str = NULL;
return false;
}
ep_rt_utf8_string_snprintf(newStr, newStrSize, "%.*s%s%s", (int)(strFound - (*str)), *str, strReplacement, strFound + strSearchLen);
ep_rt_utf8_string_free(*str);
*str = newStr;
return true;
}
return false;
}
static
ep_char16_t *
ep_rt_utf8_to_utf16_string (
const ep_char8_t *str,
size_t len)
{
STATIC_CONTRACT_NOTHROW;
if (!str)
return NULL;
COUNT_T len_utf16 = WszMultiByteToWideChar (CP_UTF8, 0, str, static_cast<int>(len), 0, 0);
if (len_utf16 == 0)
return NULL;
if (static_cast<int>(len) != -1)
len_utf16 += 1;
ep_char16_t *str_utf16 = reinterpret_cast<ep_char16_t *>(malloc (len_utf16 * sizeof (ep_char16_t)));
if (!str_utf16)
return NULL;
len_utf16 = WszMultiByteToWideChar (CP_UTF8, 0, str, static_cast<int>(len), reinterpret_cast<LPWSTR>(str_utf16), len_utf16);
if (len_utf16 == 0) {
free (str_utf16);
return NULL;
}
str_utf16 [len_utf16 - 1] = 0;
return str_utf16;
}
static
inline
ep_char16_t *
ep_rt_utf16_string_dup (const ep_char16_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (!str)
return NULL;
size_t str_size = (ep_rt_utf16_string_len (str) + 1) * sizeof (ep_char16_t);
ep_char16_t *str_dup = reinterpret_cast<ep_char16_t *>(malloc (str_size));
if (str_dup)
memcpy (str_dup, str, str_size);
return str_dup;
}
static
inline
void
ep_rt_utf8_string_free (ep_char8_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (str)
free (str);
}
static
inline
size_t
ep_rt_utf16_string_len (const ep_char16_t *str)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (str != NULL);
return wcslen (reinterpret_cast<LPCWSTR>(str));
}
static
ep_char8_t *
ep_rt_utf16_to_utf8_string (
const ep_char16_t *str,
size_t len)
{
STATIC_CONTRACT_NOTHROW;
if (!str)
return NULL;
COUNT_T size_utf8 = WszWideCharToMultiByte (CP_UTF8, 0, reinterpret_cast<LPCWSTR>(str), static_cast<int>(len), NULL, 0, NULL, NULL);
if (size_utf8 == 0)
return NULL;
if (static_cast<int>(len) != -1)
size_utf8 += 1;
ep_char8_t *str_utf8 = reinterpret_cast<ep_char8_t *>(malloc (size_utf8));
if (!str_utf8)
return NULL;
size_utf8 = WszWideCharToMultiByte (CP_UTF8, 0, reinterpret_cast<LPCWSTR>(str), static_cast<int>(len), reinterpret_cast<LPSTR>(str_utf8), size_utf8, NULL, NULL);
if (size_utf8 == 0) {
free (str_utf8);
return NULL;
}
str_utf8 [size_utf8 - 1] = 0;
return str_utf8;
}
static
inline
void
ep_rt_utf16_string_free (ep_char16_t *str)
{
STATIC_CONTRACT_NOTHROW;
if (str)
free (str);
}
static
inline
const ep_char8_t *
ep_rt_managed_command_line_get (void)
{
STATIC_CONTRACT_NOTHROW;
EP_UNREACHABLE ("Can not reach here");
return NULL;
}
static
const ep_char8_t *
ep_rt_diagnostics_command_line_get (void)
{
STATIC_CONTRACT_NOTHROW;
// In coreclr, this value can change over time, specifically before vs after suspension in diagnostics server.
// The host initalizes the runtime in two phases, init and exec assembly. On non-Windows platforms the commandline returned by the runtime
// is different during each phase. We suspend during init where the runtime has populated the commandline with a
// mock value (the full path of the executing assembly) and the actual value isn't populated till the exec assembly phase.
// On Windows this does not apply as the value is retrieved directly from the OS any time it is requested.
// As a result, we cannot actually cache this value. We need to return the _current_ value.
// This function needs to handle freeing the string in order to make it consistent with Mono's version.
// To that end, we'll "cache" it here so we free the previous string when we get it again.
extern ep_char8_t *_ep_rt_coreclr_diagnostics_cmd_line;
if (_ep_rt_coreclr_diagnostics_cmd_line)
ep_rt_utf8_string_free(_ep_rt_coreclr_diagnostics_cmd_line);
_ep_rt_coreclr_diagnostics_cmd_line = ep_rt_utf16_to_utf8_string (reinterpret_cast<const ep_char16_t *>(GetCommandLineForDiagnostics ()), -1);
return _ep_rt_coreclr_diagnostics_cmd_line;
}
/*
* Thread.
*/
static
inline
EventPipeThreadHolder *
thread_holder_alloc_func (void)
{
STATIC_CONTRACT_NOTHROW;
EventPipeThreadHolder *instance = ep_thread_holder_alloc (ep_thread_alloc());
if (instance)
ep_thread_register (ep_thread_holder_get_thread (instance));
return instance;
}
static
inline
void
thread_holder_free_func (EventPipeThreadHolder * thread_holder)
{
STATIC_CONTRACT_NOTHROW;
if (thread_holder) {
ep_thread_unregister (ep_thread_holder_get_thread (thread_holder));
ep_thread_holder_free (thread_holder);
}
}
class EventPipeCoreCLRThreadHolderTLS {
public:
EventPipeCoreCLRThreadHolderTLS ()
{
STATIC_CONTRACT_NOTHROW;
}
~EventPipeCoreCLRThreadHolderTLS ()
{
STATIC_CONTRACT_NOTHROW;
if (m_threadHolder) {
thread_holder_free_func (m_threadHolder);
m_threadHolder = NULL;
}
}
static inline EventPipeThreadHolder * getThreadHolder ()
{
STATIC_CONTRACT_NOTHROW;
return g_threadHolderTLS.m_threadHolder;
}
static inline EventPipeThreadHolder * createThreadHolder ()
{
STATIC_CONTRACT_NOTHROW;
if (g_threadHolderTLS.m_threadHolder) {
thread_holder_free_func (g_threadHolderTLS.m_threadHolder);
g_threadHolderTLS.m_threadHolder = NULL;
}
g_threadHolderTLS.m_threadHolder = thread_holder_alloc_func ();
return g_threadHolderTLS.m_threadHolder;
}
private:
EventPipeThreadHolder *m_threadHolder;
static thread_local EventPipeCoreCLRThreadHolderTLS g_threadHolderTLS;
};
static
void
ep_rt_thread_setup (void)
{
STATIC_CONTRACT_NOTHROW;
Thread* thread_handle = SetupThreadNoThrow ();
EP_ASSERT (thread_handle != NULL);
}
static
inline
EventPipeThread *
ep_rt_thread_get (void)
{
STATIC_CONTRACT_NOTHROW;
EventPipeThreadHolder *thread_holder = EventPipeCoreCLRThreadHolderTLS::getThreadHolder ();
return thread_holder ? ep_thread_holder_get_thread (thread_holder) : NULL;
}
static
inline
EventPipeThread *
ep_rt_thread_get_or_create (void)
{
STATIC_CONTRACT_NOTHROW;
EventPipeThreadHolder *thread_holder = EventPipeCoreCLRThreadHolderTLS::getThreadHolder ();
if (!thread_holder)
thread_holder = EventPipeCoreCLRThreadHolderTLS::createThreadHolder ();
return ep_thread_holder_get_thread (thread_holder);
}
static
inline
ep_rt_thread_handle_t
ep_rt_thread_get_handle (void)
{
STATIC_CONTRACT_NOTHROW;
return GetThreadNULLOk ();
}
static
inline
ep_rt_thread_id_t
ep_rt_thread_get_id (ep_rt_thread_handle_t thread_handle)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (thread_handle != NULL);
return ep_rt_uint64_t_to_thread_id_t (thread_handle->GetOSThreadId64 ());
}
static
inline
uint64_t
ep_rt_thread_id_t_to_uint64_t (ep_rt_thread_id_t thread_id)
{
return static_cast<uint64_t>(thread_id);
}
static
inline
ep_rt_thread_id_t
ep_rt_uint64_t_to_thread_id_t (uint64_t thread_id)
{
return static_cast<ep_rt_thread_id_t>(thread_id);
}
static
inline
bool
ep_rt_thread_has_started (ep_rt_thread_handle_t thread_handle)
{
STATIC_CONTRACT_NOTHROW;
return thread_handle != NULL && thread_handle->HasStarted ();
}
static
inline
ep_rt_thread_activity_id_handle_t
ep_rt_thread_get_activity_id_handle (void)
{
STATIC_CONTRACT_NOTHROW;
return GetThread ();
}
static
inline
const uint8_t *
ep_rt_thread_get_activity_id_cref (ep_rt_thread_activity_id_handle_t activity_id_handle)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (activity_id_handle != NULL);
return reinterpret_cast<const uint8_t *>(activity_id_handle->GetActivityId ());
}
static
inline
void
ep_rt_thread_get_activity_id (
ep_rt_thread_activity_id_handle_t activity_id_handle,
uint8_t *activity_id,
uint32_t activity_id_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (activity_id_handle != NULL);
EP_ASSERT (activity_id != NULL);
EP_ASSERT (activity_id_len == EP_ACTIVITY_ID_SIZE);
memcpy (activity_id, ep_rt_thread_get_activity_id_cref (activity_id_handle), EP_ACTIVITY_ID_SIZE);
}
static
inline
void
ep_rt_thread_set_activity_id (
ep_rt_thread_activity_id_handle_t activity_id_handle,
const uint8_t *activity_id,
uint32_t activity_id_len)
{
STATIC_CONTRACT_NOTHROW;
EP_ASSERT (activity_id_handle != NULL);
EP_ASSERT (activity_id != NULL);
EP_ASSERT (activity_id_len == EP_ACTIVITY_ID_SIZE);
activity_id_handle->SetActivityId (reinterpret_cast<LPCGUID>(activity_id));
}
#undef EP_YIELD_WHILE
#define EP_YIELD_WHILE(condition) YIELD_WHILE(condition)
/*
* ThreadSequenceNumberMap.
*/
EP_RT_DEFINE_HASH_MAP_REMOVE(thread_sequence_number_map, ep_rt_thread_sequence_number_hash_map_t, EventPipeThreadSessionState *, uint32_t)
EP_RT_DEFINE_HASH_MAP_ITERATOR(thread_sequence_number_map, ep_rt_thread_sequence_number_hash_map_t, ep_rt_thread_sequence_number_hash_map_iterator_t, EventPipeThreadSessionState *, uint32_t)
/*
* Volatile.
*/
static
inline
uint32_t
ep_rt_volatile_load_uint32_t (const volatile uint32_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoad<uint32_t> ((const uint32_t *)ptr);
}
static
inline
uint32_t
ep_rt_volatile_load_uint32_t_without_barrier (const volatile uint32_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoadWithoutBarrier<uint32_t> ((const uint32_t *)ptr);
}
static
inline
void
ep_rt_volatile_store_uint32_t (
volatile uint32_t *ptr,
uint32_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStore<uint32_t> ((uint32_t *)ptr, value);
}
static
inline
void
ep_rt_volatile_store_uint32_t_without_barrier (
volatile uint32_t *ptr,
uint32_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStoreWithoutBarrier<uint32_t>((uint32_t *)ptr, value);
}
static
inline
uint64_t
ep_rt_volatile_load_uint64_t (const volatile uint64_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoad<uint64_t> ((const uint64_t *)ptr);
}
static
inline
uint64_t
ep_rt_volatile_load_uint64_t_without_barrier (const volatile uint64_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoadWithoutBarrier<uint64_t> ((const uint64_t *)ptr);
}
static
inline
void
ep_rt_volatile_store_uint64_t (
volatile uint64_t *ptr,
uint64_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStore<uint64_t> ((uint64_t *)ptr, value);
}
static
inline
void
ep_rt_volatile_store_uint64_t_without_barrier (
volatile uint64_t *ptr,
uint64_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStoreWithoutBarrier<uint64_t> ((uint64_t *)ptr, value);
}
static
inline
int64_t
ep_rt_volatile_load_int64_t (const volatile int64_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoad<int64_t> ((int64_t *)ptr);
}
static
inline
int64_t
ep_rt_volatile_load_int64_t_without_barrier (const volatile int64_t *ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoadWithoutBarrier<int64_t> ((int64_t *)ptr);
}
static
inline
void
ep_rt_volatile_store_int64_t (
volatile int64_t *ptr,
int64_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStore<int64_t> ((int64_t *)ptr, value);
}
static
inline
void
ep_rt_volatile_store_int64_t_without_barrier (
volatile int64_t *ptr,
int64_t value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStoreWithoutBarrier<int64_t> ((int64_t *)ptr, value);
}
static
inline
void *
ep_rt_volatile_load_ptr (volatile void **ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoad<void *> ((void **)ptr);
}
static
inline
void *
ep_rt_volatile_load_ptr_without_barrier (volatile void **ptr)
{
STATIC_CONTRACT_NOTHROW;
return VolatileLoadWithoutBarrier<void *> ((void **)ptr);
}
static
inline
void
ep_rt_volatile_store_ptr (
volatile void **ptr,
void *value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStore<void *> ((void **)ptr, value);
}
static
inline
void
ep_rt_volatile_store_ptr_without_barrier (
volatile void **ptr,
void *value)
{
STATIC_CONTRACT_NOTHROW;
VolatileStoreWithoutBarrier<void *> ((void **)ptr, value);
}
#endif /* ENABLE_PERFTRACING */
#endif /* __EVENTPIPE_RT_CORECLR_H__ */
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/inc/configuration.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// --------------------------------------------------------------------------------------------------
// configuration.h
//
//
// Access and update configuration values, falling back on legacy CLRConfig methods where necessary.
//
// --------------------------------------------------------------------------------------------------
#include "clrconfig.h"
#ifndef __configuration_h__
#define __configuration_h__
class Configuration
{
public:
static void InitializeConfigurationKnobs(int numberOfConfigs, LPCWSTR *configNames, LPCWSTR *configValues);
// Returns (in priority order):
// - The value of the ConfigDWORDInfo if it's set
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcstoul).
// - The default set in the ConfigDWORDInfo
static DWORD GetKnobDWORDValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcstoul)
// - The default value passed in
static DWORD GetKnobDWORDValue(LPCWSTR name, DWORD defaultValue);
// Unfortunately our traditional config system insists on interpreting numbers as 32-bit so intepret the config
// in the traditional way separately if you need to.
//
// Returns value for name if found in config.
static ULONGLONG GetKnobULONGLONGValue(LPCWSTR name, ULONGLONG defaultValue);
// Returns (in priority order):
// - The value of the ConfigStringInfo if it's set
// - The value of the ConfigurationKnob (searched by name) if it's set
// - nullptr
static LPCWSTR GetKnobStringValue(LPCWSTR name, const CLRConfig::ConfigStringInfo& stringInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set
// - nullptr
static LPCWSTR GetKnobStringValue(LPCWSTR name);
// Returns (in priority order):
// - The value of the ConfigDWORDInfo if it's set (1 is true, anything else is false)
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with "true").
// - The default set in the ConfigDWORDInfo (1 is true, anything else is false)
static bool GetKnobBooleanValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with "true").
// - The default value passed in
static bool GetKnobBooleanValue(LPCWSTR name, bool defaultValue);
};
#endif // __configuration_h__
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// --------------------------------------------------------------------------------------------------
// configuration.h
//
//
// Access and update configuration values, falling back on legacy CLRConfig methods where necessary.
//
// --------------------------------------------------------------------------------------------------
#include "clrconfig.h"
#ifndef __configuration_h__
#define __configuration_h__
class Configuration
{
public:
static void InitializeConfigurationKnobs(int numberOfConfigs, LPCWSTR *configNames, LPCWSTR *configValues);
// Returns (in priority order):
// - The value of the ConfigDWORDInfo if it's set
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcstoul).
// - The default set in the ConfigDWORDInfo
static DWORD GetKnobDWORDValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcstoul)
// - The default value passed in
static DWORD GetKnobDWORDValue(LPCWSTR name, DWORD defaultValue);
// Unfortunately our traditional config system insists on interpreting numbers as 32-bit so intepret the config
// in the traditional way separately if you need to.
//
// Returns value for name if found in config.
static ULONGLONG GetKnobULONGLONGValue(LPCWSTR name, ULONGLONG defaultValue);
// Returns (in priority order):
// - The value of the ConfigStringInfo if it's set
// - The value of the ConfigurationKnob (searched by name) if it's set
// - nullptr
static LPCWSTR GetKnobStringValue(LPCWSTR name, const CLRConfig::ConfigStringInfo& stringInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set
// - nullptr
static LPCWSTR GetKnobStringValue(LPCWSTR name);
// Returns (in priority order):
// - The value of the ConfigDWORDInfo if it's set (1 is true, anything else is false)
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with "true").
// - The default set in the ConfigDWORDInfo (1 is true, anything else is false)
static bool GetKnobBooleanValue(LPCWSTR name, const CLRConfig::ConfigDWORDInfo& dwordInfo);
// Returns (in priority order):
// - The value of the ConfigurationKnob (searched by name) if it's set (performs a wcscmp with "true").
// - The default value passed in
static bool GetKnobBooleanValue(LPCWSTR name, bool defaultValue);
};
#endif // __configuration_h__
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/gc/env/gcenv.os.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// Interface between GC and the OS specific functionality
//
#ifndef __GCENV_OS_H__
#define __GCENV_OS_H__
#ifdef Sleep
// This is a funny workaround for the fact that "common.h" defines Sleep to be
// Dont_Use_Sleep, with the hope of causing linker errors whenever someone tries to use sleep.
//
// However, GCToOSInterface defines a function called Sleep, which (due to this define) becomes
// "Dont_Use_Sleep", which the GC in turn happily uses. The symbol that GCToOSInterface actually
// exported was called "GCToOSInterface::Dont_Use_Sleep". While we progress in making the GC standalone,
// we'll need to break the dependency on common.h (the VM header) and this problem will become moot.
#undef Sleep
#endif // Sleep
#ifdef HAS_SYSTEM_YIELDPROCESSOR
// YieldProcessor is defined to Dont_Use_YieldProcessor. Restore it to the system-default implementation for the GC.
#undef YieldProcessor
#define YieldProcessor System_YieldProcessor
#endif
#define NUMA_NODE_UNDEFINED UINT16_MAX
bool ParseIndexOrRange(const char** config_string, size_t* start_index, size_t* end_index);
// Critical section used by the GC
class CLRCriticalSection
{
CRITICAL_SECTION m_cs;
public:
// Initialize the critical section
bool Initialize();
// Destroy the critical section
void Destroy();
// Enter the critical section. Blocks until the section can be entered.
void Enter();
// Leave the critical section
void Leave();
};
// Flags for the GCToOSInterface::VirtualReserve method
struct VirtualReserveFlags
{
enum
{
None = 0,
WriteWatch = 1,
};
};
// An event is a synchronization object whose state can be set and reset
// indicating that an event has occured. It is used pervasively throughout
// the GC.
//
// Note that GCEvent deliberately leaks its contents by not having a non-trivial destructor.
// This is by design; since all uses of GCEvent have static lifetime, their destructors
// are run on process exit, potentially concurrently with other threads that may still be
// operating on the static event. To avoid these sorts of unsafety, GCEvent chooses to
// not have a destructor at all. The cost of this is leaking a small amount of memory, but
// this is not a problem since a majority of the uses of GCEvent are static.
// See https://github.com/dotnet/runtime/issues/7919 for more details on the hazards of
// static destructors.
class GCEvent {
private:
class Impl;
Impl *m_impl;
public:
// Constructs a new uninitialized event.
GCEvent();
// Closes the event. Attempting to use the event past calling CloseEvent
// is a logic error.
void CloseEvent();
// "Sets" the event, indicating that a particular event has occured. May
// wake up other threads waiting on this event. Depending on whether or
// not this event is an auto-reset event, the state of the event may
// or may not be automatically reset after Set is called.
void Set();
// Resets the event, resetting it back to a non-signalled state. Auto-reset
// events automatically reset once the event is set, while manual-reset
// events do not reset until Reset is called. It is a no-op to call Reset
// on an auto-reset event.
void Reset();
// Waits for some period of time for this event to be signalled. The
// period of time may be infinite (if the timeout argument is INFINITE) or
// it may be a specified period of time, in milliseconds.
// Returns:
// One of three values, depending on how why this thread was awoken:
// WAIT_OBJECT_0 - This event was signalled and woke up this thread.
// WAIT_TIMEOUT - The timeout interval expired without this event being signalled.
// WAIT_FAILED - The wait failed.
uint32_t Wait(uint32_t timeout, bool alertable);
// Determines whether or not this event is valid.
// Returns:
// true if this event is invalid (i.e. it has not yet been initialized or
// has already been closed), false otherwise
bool IsValid() const
{
return m_impl != nullptr;
}
// Initializes this event to be a host-aware manual reset event with the
// given initial state.
// Returns:
// true if the initialization succeeded, false if it did not
bool CreateManualEventNoThrow(bool initialState);
// Initializes this event to be a host-aware auto-resetting event with the
// given initial state.
// Returns:
// true if the initialization succeeded, false if it did not
bool CreateAutoEventNoThrow(bool initialState);
// Initializes this event to be a host-unaware manual reset event with the
// given initial state.
// Returns:
// true if the initialization succeeded, false if it did not
bool CreateOSManualEventNoThrow(bool initialState);
// Initializes this event to be a host-unaware auto-resetting event with the
// given initial state.
// Returns:
// true if the initialization succeeded, false if it did not
bool CreateOSAutoEventNoThrow(bool initialState);
};
// GC thread function prototype
typedef void (*GCThreadFunction)(void* param);
#ifdef HOST_64BIT
// Right now we support maximum 1024 procs - meaning that we will create at most
// that many GC threads and GC heaps.
#define MAX_SUPPORTED_CPUS 1024
#define MAX_SUPPORTED_NODES 64
#else
#define MAX_SUPPORTED_CPUS 64
#define MAX_SUPPORTED_NODES 16
#endif // HOST_64BIT
// Add of processor indices used to store affinity.
class AffinitySet
{
static const size_t BitsPerBitsetEntry = 8 * sizeof(uintptr_t);
uintptr_t m_bitset[MAX_SUPPORTED_CPUS / BitsPerBitsetEntry];
static uintptr_t GetBitsetEntryMask(size_t cpuIndex)
{
return (uintptr_t)1 << (cpuIndex & (BitsPerBitsetEntry - 1));
}
static size_t GetBitsetEntryIndex(size_t cpuIndex)
{
return cpuIndex / BitsPerBitsetEntry;
}
public:
static const size_t BitsetDataSize = MAX_SUPPORTED_CPUS / BitsPerBitsetEntry;
AffinitySet()
{
memset(m_bitset, 0, sizeof(m_bitset));
}
uintptr_t* GetBitsetData()
{
return m_bitset;
}
// Check if the set contains a processor
bool Contains(size_t cpuIndex) const
{
return (m_bitset[GetBitsetEntryIndex(cpuIndex)] & GetBitsetEntryMask(cpuIndex)) != 0;
}
// Add a processor to the set
void Add(size_t cpuIndex)
{
m_bitset[GetBitsetEntryIndex(cpuIndex)] |= GetBitsetEntryMask(cpuIndex);
}
// Remove a processor from the set
void Remove(size_t cpuIndex)
{
m_bitset[GetBitsetEntryIndex(cpuIndex)] &= ~GetBitsetEntryMask(cpuIndex);
}
// Check if the set is empty
bool IsEmpty() const
{
for (size_t i = 0; i < MAX_SUPPORTED_CPUS / BitsPerBitsetEntry; i++)
{
if (m_bitset[i] != 0)
{
return false;
}
}
return true;
}
// Return number of processors in the affinity set
size_t Count() const
{
size_t count = 0;
for (size_t i = 0; i < MAX_SUPPORTED_CPUS; i++)
{
if (Contains(i))
{
count++;
}
}
return count;
}
};
// Interface that the GC uses to invoke OS specific functionality
class GCToOSInterface
{
public:
//
// Initialization and shutdown of the interface
//
// Initialize the interface implementation
// Return:
// true if it has succeeded, false if it has failed
static bool Initialize();
// Shutdown the interface implementation
static void Shutdown();
//
// Virtual memory management
//
// Reserve virtual memory range.
// Parameters:
// size - size of the virtual memory range
// alignment - requested memory alignment
// flags - flags to control special settings like write watching
// node - the NUMA node to reserve memory on
// Return:
// Starting virtual address of the reserved range
// Notes:
// Previous uses of this API aligned the `size` parameter to the platform
// allocation granularity. This is not required by POSIX or Windows. Windows will
// round the size up to the nearest page boundary. POSIX does not specify what is done,
// but Linux probably also rounds up. If an implementation of GCToOSInterface needs to
// align to the allocation granularity, it will do so in its implementation.
//
// Windows guarantees that the returned mapping will be aligned to the allocation
// granularity.
static void* VirtualReserve(size_t size, size_t alignment, uint32_t flags, uint16_t node = NUMA_NODE_UNDEFINED);
// Release virtual memory range previously reserved using VirtualReserve
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
static bool VirtualRelease(void *address, size_t size);
// Commit virtual memory range. It must be part of a range reserved using VirtualReserve.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
static bool VirtualCommit(void *address, size_t size, uint16_t node = NUMA_NODE_UNDEFINED);
// Reserve and Commit virtual memory range for Large Pages
// Parameters:
// size - size of the virtual memory range
// Return:
// Address of the allocated memory
static void* VirtualReserveAndCommitLargePages(size_t size, uint16_t node = NUMA_NODE_UNDEFINED);
// Decomit virtual memory range.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
static bool VirtualDecommit(void *address, size_t size);
// Reset virtual memory range. Indicates that data in the memory range specified by address and size is no
// longer of interest, but it should not be decommitted.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// unlock - true if the memory range should also be unlocked
// Return:
// true if it has succeeded, false if it has failed
static bool VirtualReset(void *address, size_t size, bool unlock);
//
// Write watching
//
// Check if the OS supports write watching
static bool SupportsWriteWatch();
// Reset the write tracking state for the specified virtual memory range.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
static void ResetWriteWatch(void *address, size_t size);
// Retrieve addresses of the pages that are written to in a region of virtual memory
// Parameters:
// resetState - true indicates to reset the write tracking state
// address - starting virtual address
// size - size of the virtual memory range
// pageAddresses - buffer that receives an array of page addresses in the memory region
// pageAddressesCount - on input, size of the lpAddresses array, in array elements
// on output, the number of page addresses that are returned in the array.
// Return:
// true if it has succeeded, false if it has failed
static bool GetWriteWatch(bool resetState, void* address, size_t size, void** pageAddresses, uintptr_t* pageAddressesCount);
//
// Thread and process
//
// Causes the calling thread to sleep for the specified number of milliseconds
// Parameters:
// sleepMSec - time to sleep before switching to another thread
static void Sleep(uint32_t sleepMSec);
// Causes the calling thread to yield execution to another thread that is ready to run on the current processor.
// Parameters:
// switchCount - number of times the YieldThread was called in a loop
static void YieldThread(uint32_t switchCount);
// Get the number of the current processor
static uint32_t GetCurrentProcessorNumber();
// Check if the OS supports getting current processor number
static bool CanGetCurrentProcessorNumber();
// Set ideal processor for the current thread
// Parameters:
// srcProcNo - processor number the thread currently runs on
// dstProcNo - processor number the thread should be migrated to
// Return:
// true if it has succeeded, false if it has failed
static bool SetCurrentThreadIdealAffinity(uint16_t srcProcNo, uint16_t dstProcNo);
static bool GetCurrentThreadIdealProc(uint16_t* procNo);
// Get numeric id of the current thread if possible on the
// current platform. It is indended for logging purposes only.
// Return:
// Numeric id of the current thread or 0 if the
static uint64_t GetCurrentThreadIdForLogging();
// Get id of the current process
// Return:
// Id of the current process
static uint32_t GetCurrentProcessId();
//
// Processor topology
//
// Get size of the on die cache per logical processor
// Parameters:
// trueSize - true to return true cache size, false to return scaled up size based on
// the processor architecture
// Return:
// Size of the cache
static size_t GetCacheSizePerLogicalCpu(bool trueSize = true);
// Sets the calling thread's affinity to only run on the processor specified.
// Parameters:
// procNo - The requested affinity for the calling thread.
//
// Return:
// true if setting the affinity was successful, false otherwise.
static bool SetThreadAffinity(uint16_t procNo);
// Boosts the calling thread's thread priority to a level higher than the default
// for new threads.
// Parameters:
// None.
// Return:
// true if the priority boost was successful, false otherwise.
static bool BoostThreadPriority();
// Set the set of processors enabled for GC threads for the current process based on config specified affinity mask and set
// Parameters:
// configAffinityMask - mask specified by the GCHeapAffinitizeMask config
// configAffinitySet - affinity set specified by the GCHeapAffinitizeRanges config
// Return:
// set of enabled processors
static const AffinitySet* SetGCThreadsAffinitySet(uintptr_t configAffinityMask, const AffinitySet* configAffinitySet);
//
// Global memory info
//
// Return the size of the user-mode portion of the virtual address space of this process.
// Return:
// non zero if it has succeeded, 0 if it has failed
static size_t GetVirtualMemoryLimit();
// Get the physical memory that this process can use.
// Return:
// non zero if it has succeeded, 0 if it has failed
// *is_restricted is set to true if asked and running in restricted.
// Remarks:
// If a process runs with a restricted memory limit, it returns the limit. If there's no limit
// specified, it returns amount of actual physical memory.
static uint64_t GetPhysicalMemoryLimit(bool* is_restricted=NULL);
// Get memory status
// Parameters:
// restricted_limit - The amount of physical memory in bytes that the current process is being restricted to. If non-zero, it used to calculate
// memory_load and available_physical. If zero, memory_load and available_physical is calculate based on all available memory.
// memory_load - A number between 0 and 100 that specifies the approximate percentage of physical memory
// that is in use (0 indicates no memory use and 100 indicates full memory use).
// available_physical - The amount of physical memory currently available, in bytes.
// available_page_file - The maximum amount of memory the current process can commit, in bytes.
// Remarks:
// Any parameter can be null.
static void GetMemoryStatus(uint64_t restricted_limit, uint32_t* memory_load, uint64_t* available_physical, uint64_t* available_page_file);
// Get size of an OS memory page
static size_t GetPageSize();
//
// Misc
//
// Flush write buffers of processors that are executing threads of the current process
static void FlushProcessWriteBuffers();
// Break into a debugger
static void DebugBreak();
//
// Time
//
// Get a high precision performance counter
// Return:
// The counter value
static int64_t QueryPerformanceCounter();
// Get a frequency of the high precision performance counter
// Return:
// The counter frequency
static int64_t QueryPerformanceFrequency();
// Get a time stamp with a low precision
// Return:
// Time stamp in milliseconds
static uint32_t GetLowPrecisionTimeStamp();
// Gets the total number of processors on the machine, not taking
// into account current process affinity.
// Return:
// Number of processors on the machine
static uint32_t GetTotalProcessorCount();
// Is NUMA support available
static bool CanEnableGCNumaAware();
// TODO: add Linux implementation.
// For no NUMA this returns false.
static bool GetNumaInfo(uint16_t* total_nodes, uint32_t* max_procs_per_node);
// Is CPU Group enabled
// This only applies on Windows and only used by instrumentation but is on the
// interface due to LocalGC.
static bool CanEnableGCCPUGroups();
// Get processor number and optionally its NUMA node number for the specified heap number
// Parameters:
// heap_number - heap number to get the result for
// proc_no - set to the selected processor number
// node_no - set to the NUMA node of the selected processor or to NUMA_NODE_UNDEFINED
// Return:
// true if it succeeded
static bool GetProcessorForHeap(uint16_t heap_number, uint16_t* proc_no, uint16_t* node_no);
// For no CPU groups this returns false.
static bool GetCPUGroupInfo(uint16_t* total_groups, uint32_t* max_procs_per_group);
// Parse the confing string describing affinitization ranges and update the passed in affinitySet accordingly
// Parameters:
// config_string - string describing the affinitization range, platform specific
// start_index - the range start index extracted from the config_string
// end_index - the range end index extracted from the config_string, equal to the start_index if only an index and not a range was passed in
// Return:
// true if the configString was successfully parsed, false if it was not correct
static bool ParseGCHeapAffinitizeRangesEntry(const char** config_string, size_t* start_index, size_t* end_index);
};
#endif // __GCENV_OS_H__
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// Interface between GC and the OS specific functionality
//
#ifndef __GCENV_OS_H__
#define __GCENV_OS_H__
#ifdef Sleep
// This is a funny workaround for the fact that "common.h" defines Sleep to be
// Dont_Use_Sleep, with the hope of causing linker errors whenever someone tries to use sleep.
//
// However, GCToOSInterface defines a function called Sleep, which (due to this define) becomes
// "Dont_Use_Sleep", which the GC in turn happily uses. The symbol that GCToOSInterface actually
// exported was called "GCToOSInterface::Dont_Use_Sleep". While we progress in making the GC standalone,
// we'll need to break the dependency on common.h (the VM header) and this problem will become moot.
#undef Sleep
#endif // Sleep
#ifdef HAS_SYSTEM_YIELDPROCESSOR
// YieldProcessor is defined to Dont_Use_YieldProcessor. Restore it to the system-default implementation for the GC.
#undef YieldProcessor
#define YieldProcessor System_YieldProcessor
#endif
#define NUMA_NODE_UNDEFINED UINT16_MAX
bool ParseIndexOrRange(const char** config_string, size_t* start_index, size_t* end_index);
// Critical section used by the GC
class CLRCriticalSection
{
CRITICAL_SECTION m_cs;
public:
// Initialize the critical section
bool Initialize();
// Destroy the critical section
void Destroy();
// Enter the critical section. Blocks until the section can be entered.
void Enter();
// Leave the critical section
void Leave();
};
// Flags for the GCToOSInterface::VirtualReserve method
struct VirtualReserveFlags
{
enum
{
None = 0,
WriteWatch = 1,
};
};
// An event is a synchronization object whose state can be set and reset
// indicating that an event has occured. It is used pervasively throughout
// the GC.
//
// Note that GCEvent deliberately leaks its contents by not having a non-trivial destructor.
// This is by design; since all uses of GCEvent have static lifetime, their destructors
// are run on process exit, potentially concurrently with other threads that may still be
// operating on the static event. To avoid these sorts of unsafety, GCEvent chooses to
// not have a destructor at all. The cost of this is leaking a small amount of memory, but
// this is not a problem since a majority of the uses of GCEvent are static.
// See https://github.com/dotnet/runtime/issues/7919 for more details on the hazards of
// static destructors.
class GCEvent {
private:
class Impl;
Impl *m_impl;
public:
// Constructs a new uninitialized event.
GCEvent();
// Closes the event. Attempting to use the event past calling CloseEvent
// is a logic error.
void CloseEvent();
// "Sets" the event, indicating that a particular event has occured. May
// wake up other threads waiting on this event. Depending on whether or
// not this event is an auto-reset event, the state of the event may
// or may not be automatically reset after Set is called.
void Set();
// Resets the event, resetting it back to a non-signalled state. Auto-reset
// events automatically reset once the event is set, while manual-reset
// events do not reset until Reset is called. It is a no-op to call Reset
// on an auto-reset event.
void Reset();
// Waits for some period of time for this event to be signalled. The
// period of time may be infinite (if the timeout argument is INFINITE) or
// it may be a specified period of time, in milliseconds.
// Returns:
// One of three values, depending on how why this thread was awoken:
// WAIT_OBJECT_0 - This event was signalled and woke up this thread.
// WAIT_TIMEOUT - The timeout interval expired without this event being signalled.
// WAIT_FAILED - The wait failed.
uint32_t Wait(uint32_t timeout, bool alertable);
// Determines whether or not this event is valid.
// Returns:
// true if this event is invalid (i.e. it has not yet been initialized or
// has already been closed), false otherwise
bool IsValid() const
{
return m_impl != nullptr;
}
// Initializes this event to be a host-aware manual reset event with the
// given initial state.
// Returns:
// true if the initialization succeeded, false if it did not
bool CreateManualEventNoThrow(bool initialState);
// Initializes this event to be a host-aware auto-resetting event with the
// given initial state.
// Returns:
// true if the initialization succeeded, false if it did not
bool CreateAutoEventNoThrow(bool initialState);
// Initializes this event to be a host-unaware manual reset event with the
// given initial state.
// Returns:
// true if the initialization succeeded, false if it did not
bool CreateOSManualEventNoThrow(bool initialState);
// Initializes this event to be a host-unaware auto-resetting event with the
// given initial state.
// Returns:
// true if the initialization succeeded, false if it did not
bool CreateOSAutoEventNoThrow(bool initialState);
};
// GC thread function prototype
typedef void (*GCThreadFunction)(void* param);
#ifdef HOST_64BIT
// Right now we support maximum 1024 procs - meaning that we will create at most
// that many GC threads and GC heaps.
#define MAX_SUPPORTED_CPUS 1024
#define MAX_SUPPORTED_NODES 64
#else
#define MAX_SUPPORTED_CPUS 64
#define MAX_SUPPORTED_NODES 16
#endif // HOST_64BIT
// Add of processor indices used to store affinity.
class AffinitySet
{
static const size_t BitsPerBitsetEntry = 8 * sizeof(uintptr_t);
uintptr_t m_bitset[MAX_SUPPORTED_CPUS / BitsPerBitsetEntry];
static uintptr_t GetBitsetEntryMask(size_t cpuIndex)
{
return (uintptr_t)1 << (cpuIndex & (BitsPerBitsetEntry - 1));
}
static size_t GetBitsetEntryIndex(size_t cpuIndex)
{
return cpuIndex / BitsPerBitsetEntry;
}
public:
static const size_t BitsetDataSize = MAX_SUPPORTED_CPUS / BitsPerBitsetEntry;
AffinitySet()
{
memset(m_bitset, 0, sizeof(m_bitset));
}
uintptr_t* GetBitsetData()
{
return m_bitset;
}
// Check if the set contains a processor
bool Contains(size_t cpuIndex) const
{
return (m_bitset[GetBitsetEntryIndex(cpuIndex)] & GetBitsetEntryMask(cpuIndex)) != 0;
}
// Add a processor to the set
void Add(size_t cpuIndex)
{
m_bitset[GetBitsetEntryIndex(cpuIndex)] |= GetBitsetEntryMask(cpuIndex);
}
// Remove a processor from the set
void Remove(size_t cpuIndex)
{
m_bitset[GetBitsetEntryIndex(cpuIndex)] &= ~GetBitsetEntryMask(cpuIndex);
}
// Check if the set is empty
bool IsEmpty() const
{
for (size_t i = 0; i < MAX_SUPPORTED_CPUS / BitsPerBitsetEntry; i++)
{
if (m_bitset[i] != 0)
{
return false;
}
}
return true;
}
// Return number of processors in the affinity set
size_t Count() const
{
size_t count = 0;
for (size_t i = 0; i < MAX_SUPPORTED_CPUS; i++)
{
if (Contains(i))
{
count++;
}
}
return count;
}
};
// Interface that the GC uses to invoke OS specific functionality
class GCToOSInterface
{
public:
//
// Initialization and shutdown of the interface
//
// Initialize the interface implementation
// Return:
// true if it has succeeded, false if it has failed
static bool Initialize();
// Shutdown the interface implementation
static void Shutdown();
//
// Virtual memory management
//
// Reserve virtual memory range.
// Parameters:
// size - size of the virtual memory range
// alignment - requested memory alignment
// flags - flags to control special settings like write watching
// node - the NUMA node to reserve memory on
// Return:
// Starting virtual address of the reserved range
// Notes:
// Previous uses of this API aligned the `size` parameter to the platform
// allocation granularity. This is not required by POSIX or Windows. Windows will
// round the size up to the nearest page boundary. POSIX does not specify what is done,
// but Linux probably also rounds up. If an implementation of GCToOSInterface needs to
// align to the allocation granularity, it will do so in its implementation.
//
// Windows guarantees that the returned mapping will be aligned to the allocation
// granularity.
static void* VirtualReserve(size_t size, size_t alignment, uint32_t flags, uint16_t node = NUMA_NODE_UNDEFINED);
// Release virtual memory range previously reserved using VirtualReserve
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
static bool VirtualRelease(void *address, size_t size);
// Commit virtual memory range. It must be part of a range reserved using VirtualReserve.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
static bool VirtualCommit(void *address, size_t size, uint16_t node = NUMA_NODE_UNDEFINED);
// Reserve and Commit virtual memory range for Large Pages
// Parameters:
// size - size of the virtual memory range
// Return:
// Address of the allocated memory
static void* VirtualReserveAndCommitLargePages(size_t size, uint16_t node = NUMA_NODE_UNDEFINED);
// Decomit virtual memory range.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// Return:
// true if it has succeeded, false if it has failed
static bool VirtualDecommit(void *address, size_t size);
// Reset virtual memory range. Indicates that data in the memory range specified by address and size is no
// longer of interest, but it should not be decommitted.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
// unlock - true if the memory range should also be unlocked
// Return:
// true if it has succeeded, false if it has failed
static bool VirtualReset(void *address, size_t size, bool unlock);
//
// Write watching
//
// Check if the OS supports write watching
static bool SupportsWriteWatch();
// Reset the write tracking state for the specified virtual memory range.
// Parameters:
// address - starting virtual address
// size - size of the virtual memory range
static void ResetWriteWatch(void *address, size_t size);
// Retrieve addresses of the pages that are written to in a region of virtual memory
// Parameters:
// resetState - true indicates to reset the write tracking state
// address - starting virtual address
// size - size of the virtual memory range
// pageAddresses - buffer that receives an array of page addresses in the memory region
// pageAddressesCount - on input, size of the lpAddresses array, in array elements
// on output, the number of page addresses that are returned in the array.
// Return:
// true if it has succeeded, false if it has failed
static bool GetWriteWatch(bool resetState, void* address, size_t size, void** pageAddresses, uintptr_t* pageAddressesCount);
//
// Thread and process
//
// Causes the calling thread to sleep for the specified number of milliseconds
// Parameters:
// sleepMSec - time to sleep before switching to another thread
static void Sleep(uint32_t sleepMSec);
// Causes the calling thread to yield execution to another thread that is ready to run on the current processor.
// Parameters:
// switchCount - number of times the YieldThread was called in a loop
static void YieldThread(uint32_t switchCount);
// Get the number of the current processor
static uint32_t GetCurrentProcessorNumber();
// Check if the OS supports getting current processor number
static bool CanGetCurrentProcessorNumber();
// Set ideal processor for the current thread
// Parameters:
// srcProcNo - processor number the thread currently runs on
// dstProcNo - processor number the thread should be migrated to
// Return:
// true if it has succeeded, false if it has failed
static bool SetCurrentThreadIdealAffinity(uint16_t srcProcNo, uint16_t dstProcNo);
static bool GetCurrentThreadIdealProc(uint16_t* procNo);
// Get numeric id of the current thread if possible on the
// current platform. It is indended for logging purposes only.
// Return:
// Numeric id of the current thread or 0 if the
static uint64_t GetCurrentThreadIdForLogging();
// Get id of the current process
// Return:
// Id of the current process
static uint32_t GetCurrentProcessId();
//
// Processor topology
//
// Get size of the on die cache per logical processor
// Parameters:
// trueSize - true to return true cache size, false to return scaled up size based on
// the processor architecture
// Return:
// Size of the cache
static size_t GetCacheSizePerLogicalCpu(bool trueSize = true);
// Sets the calling thread's affinity to only run on the processor specified.
// Parameters:
// procNo - The requested affinity for the calling thread.
//
// Return:
// true if setting the affinity was successful, false otherwise.
static bool SetThreadAffinity(uint16_t procNo);
// Boosts the calling thread's thread priority to a level higher than the default
// for new threads.
// Parameters:
// None.
// Return:
// true if the priority boost was successful, false otherwise.
static bool BoostThreadPriority();
// Set the set of processors enabled for GC threads for the current process based on config specified affinity mask and set
// Parameters:
// configAffinityMask - mask specified by the GCHeapAffinitizeMask config
// configAffinitySet - affinity set specified by the GCHeapAffinitizeRanges config
// Return:
// set of enabled processors
static const AffinitySet* SetGCThreadsAffinitySet(uintptr_t configAffinityMask, const AffinitySet* configAffinitySet);
//
// Global memory info
//
// Return the size of the user-mode portion of the virtual address space of this process.
// Return:
// non zero if it has succeeded, 0 if it has failed
static size_t GetVirtualMemoryLimit();
// Get the physical memory that this process can use.
// Return:
// non zero if it has succeeded, 0 if it has failed
// *is_restricted is set to true if asked and running in restricted.
// Remarks:
// If a process runs with a restricted memory limit, it returns the limit. If there's no limit
// specified, it returns amount of actual physical memory.
static uint64_t GetPhysicalMemoryLimit(bool* is_restricted=NULL);
// Get memory status
// Parameters:
// restricted_limit - The amount of physical memory in bytes that the current process is being restricted to. If non-zero, it used to calculate
// memory_load and available_physical. If zero, memory_load and available_physical is calculate based on all available memory.
// memory_load - A number between 0 and 100 that specifies the approximate percentage of physical memory
// that is in use (0 indicates no memory use and 100 indicates full memory use).
// available_physical - The amount of physical memory currently available, in bytes.
// available_page_file - The maximum amount of memory the current process can commit, in bytes.
// Remarks:
// Any parameter can be null.
static void GetMemoryStatus(uint64_t restricted_limit, uint32_t* memory_load, uint64_t* available_physical, uint64_t* available_page_file);
// Get size of an OS memory page
static size_t GetPageSize();
//
// Misc
//
// Flush write buffers of processors that are executing threads of the current process
static void FlushProcessWriteBuffers();
// Break into a debugger
static void DebugBreak();
//
// Time
//
// Get a high precision performance counter
// Return:
// The counter value
static int64_t QueryPerformanceCounter();
// Get a frequency of the high precision performance counter
// Return:
// The counter frequency
static int64_t QueryPerformanceFrequency();
// Get a time stamp with a low precision
// Return:
// Time stamp in milliseconds
static uint32_t GetLowPrecisionTimeStamp();
// Gets the total number of processors on the machine, not taking
// into account current process affinity.
// Return:
// Number of processors on the machine
static uint32_t GetTotalProcessorCount();
// Is NUMA support available
static bool CanEnableGCNumaAware();
// TODO: add Linux implementation.
// For no NUMA this returns false.
static bool GetNumaInfo(uint16_t* total_nodes, uint32_t* max_procs_per_node);
// Is CPU Group enabled
// This only applies on Windows and only used by instrumentation but is on the
// interface due to LocalGC.
static bool CanEnableGCCPUGroups();
// Get processor number and optionally its NUMA node number for the specified heap number
// Parameters:
// heap_number - heap number to get the result for
// proc_no - set to the selected processor number
// node_no - set to the NUMA node of the selected processor or to NUMA_NODE_UNDEFINED
// Return:
// true if it succeeded
static bool GetProcessorForHeap(uint16_t heap_number, uint16_t* proc_no, uint16_t* node_no);
// For no CPU groups this returns false.
static bool GetCPUGroupInfo(uint16_t* total_groups, uint32_t* max_procs_per_group);
// Parse the confing string describing affinitization ranges and update the passed in affinitySet accordingly
// Parameters:
// config_string - string describing the affinitization range, platform specific
// start_index - the range start index extracted from the config_string
// end_index - the range end index extracted from the config_string, equal to the start_index if only an index and not a range was passed in
// Return:
// true if the configString was successfully parsed, false if it was not correct
static bool ParseGCHeapAffinitizeRangesEntry(const char** config_string, size_t* start_index, size_t* end_index);
};
#endif // __GCENV_OS_H__
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/native/corehost/runtime_config.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef __RUNTIME_CONFIG_H__
#define __RUNTIME_CONFIG_H__
#include <list>
#include "pal.h"
#include <external/rapidjson/fwd.h>
#include "fx_reference.h"
class runtime_config_t
{
public:
struct settings_t
{
settings_t();
bool has_apply_patches;
bool apply_patches;
void set_apply_patches(bool value) { has_apply_patches = true; apply_patches = value; }
bool has_roll_forward;
roll_forward_option roll_forward;
void set_roll_forward(roll_forward_option value) { has_roll_forward = true; roll_forward = value; }
};
public:
runtime_config_t();
void parse(const pal::string_t& path, const pal::string_t& dev_path, const settings_t& override_settings);
bool is_valid() const { return m_valid; }
const pal::string_t& get_path() const { return m_path; }
const pal::string_t& get_dev_path() const { return m_dev_path; }
const pal::string_t& get_tfm() const;
const std::list<pal::string_t>& get_probe_paths() const;
bool get_is_framework_dependent() const;
bool parse_opts(const json_parser_t::value_t& opts);
void combine_properties(std::unordered_map<pal::string_t, pal::string_t>& combined_properties) const;
const fx_reference_vector_t& get_frameworks() const { return m_frameworks; }
const fx_reference_vector_t& get_included_frameworks() const { return m_included_frameworks; }
void set_fx_version(pal::string_t version);
private:
bool ensure_parsed(); //todo: const runtime_config_t* defaults
bool ensure_dev_config_parsed();
std::unordered_map<pal::string_t, pal::string_t> m_properties;
fx_reference_vector_t m_frameworks;
fx_reference_vector_t m_included_frameworks;
settings_t m_default_settings; // the default settings (Steps #0 and #1)
settings_t m_override_settings; // the settings that can't be changed (Step #5)
std::vector<std::string> m_prop_keys;
std::vector<std::string> m_prop_values;
std::list<pal::string_t> m_probe_paths;
pal::string_t m_tfm;
// This is used to detect cases where rollForward is used together with the obsoleted
// rollForwardOnNoCandidateFx/applyPatches.
// Flags
enum specified_setting
{
none = 0x0,
specified_roll_forward = 0x1,
specified_roll_forward_on_no_candidate_fx_or_apply_patched = 0x2
} m_specified_settings;
pal::string_t m_dev_path;
pal::string_t m_path;
bool m_is_framework_dependent;
bool m_valid;
// Cached value of DOTNET_ROLL_FORWARD_TO_PRERELEASE to avoid testing env. variables too often.
// If set to true, all versions (including pre-release) are considered even if starting from a release framework reference.
bool m_roll_forward_to_prerelease;
bool parse_framework(const json_parser_t::value_t& fx_obj, fx_reference_t& fx_out, bool name_and_version_only = false);
bool read_framework_array(const json_parser_t::value_t& frameworks, fx_reference_vector_t& frameworks_out, bool name_and_version_only = false);
bool mark_specified_setting(specified_setting setting);
};
#endif // __RUNTIME_CONFIG_H__
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef __RUNTIME_CONFIG_H__
#define __RUNTIME_CONFIG_H__
#include <list>
#include "pal.h"
#include <external/rapidjson/fwd.h>
#include "fx_reference.h"
class runtime_config_t
{
public:
struct settings_t
{
settings_t();
bool has_apply_patches;
bool apply_patches;
void set_apply_patches(bool value) { has_apply_patches = true; apply_patches = value; }
bool has_roll_forward;
roll_forward_option roll_forward;
void set_roll_forward(roll_forward_option value) { has_roll_forward = true; roll_forward = value; }
};
public:
runtime_config_t();
void parse(const pal::string_t& path, const pal::string_t& dev_path, const settings_t& override_settings);
bool is_valid() const { return m_valid; }
const pal::string_t& get_path() const { return m_path; }
const pal::string_t& get_dev_path() const { return m_dev_path; }
const pal::string_t& get_tfm() const;
const std::list<pal::string_t>& get_probe_paths() const;
bool get_is_framework_dependent() const;
bool parse_opts(const json_parser_t::value_t& opts);
void combine_properties(std::unordered_map<pal::string_t, pal::string_t>& combined_properties) const;
const fx_reference_vector_t& get_frameworks() const { return m_frameworks; }
const fx_reference_vector_t& get_included_frameworks() const { return m_included_frameworks; }
void set_fx_version(pal::string_t version);
private:
bool ensure_parsed(); //todo: const runtime_config_t* defaults
bool ensure_dev_config_parsed();
std::unordered_map<pal::string_t, pal::string_t> m_properties;
fx_reference_vector_t m_frameworks;
fx_reference_vector_t m_included_frameworks;
settings_t m_default_settings; // the default settings (Steps #0 and #1)
settings_t m_override_settings; // the settings that can't be changed (Step #5)
std::vector<std::string> m_prop_keys;
std::vector<std::string> m_prop_values;
std::list<pal::string_t> m_probe_paths;
pal::string_t m_tfm;
// This is used to detect cases where rollForward is used together with the obsoleted
// rollForwardOnNoCandidateFx/applyPatches.
// Flags
enum specified_setting
{
none = 0x0,
specified_roll_forward = 0x1,
specified_roll_forward_on_no_candidate_fx_or_apply_patched = 0x2
} m_specified_settings;
pal::string_t m_dev_path;
pal::string_t m_path;
bool m_is_framework_dependent;
bool m_valid;
// Cached value of DOTNET_ROLL_FORWARD_TO_PRERELEASE to avoid testing env. variables too often.
// If set to true, all versions (including pre-release) are considered even if starting from a release framework reference.
bool m_roll_forward_to_prerelease;
bool parse_framework(const json_parser_t::value_t& fx_obj, fx_reference_t& fx_out, bool name_and_version_only = false);
bool read_framework_array(const json_parser_t::value_t& frameworks, fx_reference_vector_t& frameworks_out, bool name_and_version_only = false);
bool mark_specified_setting(specified_setting setting);
};
#endif // __RUNTIME_CONFIG_H__
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/inc/dacvars.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// This file contains the globals and statics that are visible to DAC.
// It is used for the following:
// 1. in daccess.h to build the table of DAC globals
// 2. in enummem.cpp to dump out the related memory of static and globals
// in a mini dump or heap dump
// 3. in DacUpdateDll and tools\DacTablenGen\main.cs
//
// To use this functionality for other tools or purposes, define the
// DEFINE_DACVAR macro & include dacvars.h like so (see enummem.cpp and/or
// daccess.h for examples):
//
// #define DEFINE_DACVAR(type, size, id, var) type id; //this defn. discards
// //the size
// #include "dacvars.h"
//
// @dbgtodo:
// Ideally we may be able to build a tool that generates this automatically.
// At the least, we should automatically verify that the contents of this file
// are consistent with the uses of all the macros like SVAL_DECL and GARY_DECL.
//
//=================================================
// INSTRUCTIONS FOR ADDING VARIABLES TO THIS FILE
//=================================================
// You need to add a global or static declared with DAC macros, such as SPTR_*
// GPTR_*, SVAL_*, GVAL_*, or GARY_*, only if the global or static is actually used
// in a DACized code path. If you have declared a static or global that way just
// because you were pattern-matching or because you anticipate that the variable
// may eventually be used in a DACized code path, you don't need to add it here,
// although in that case, you should not really use the DAC macro when you declare
// the global or static.
// * * *
// The FIRST ARGUMENT should always be specified as ULONG. This is the type of
// the offsets for the corresponding id in the _DacGlobals table.
// @dbgtodo:
// We should get rid of the ULONG argument since it's always the same. We would
// also need to modify DacTablenGen\main.cs.
// * * *
// The SECOND ARGUMENT, "true_type," is used to calculate the true size of the
// static/global variable. It is currently used only in enummem.cpp to write out
// theproper size of memory for dumps.
// * * *
// The THIRD ARGUMENT should be a qualified name. If the variable is a static data
// member, the name should be <class_name>__<member_name>. If the variable is a
// global, the name should be <dac>__<global_name>.
// * * *
// The FOURTH ARGUMENT should be the actual name of the static/global variable. If
// static data the should be [<namespace>::]<class_name>::<member_name>. If global,
// it should look like <global_name>.
// * * *
// If you need to add an entry to this file, your type may not be visible when
// this file is compiled. In that case, you need to do one of two things:
// - If the type is a pointer type, you can simply use UNKNOWN_POINTER_TYPE as the
// "true type." It may be useful to specify the non-visible type in a comment.
// - If the type is a composite/user-defined type, you must #include the header
// file that defines the type in enummem.cpp. Do NOT #include it in daccess.h
// Array types may be dumped via an explicit call to enumMem, so they should
// be declared with DEFINE_DACVAR_NO_DUMP. The size in this case is immaterial, since
// nothing will be dumped.
#ifndef DEFINE_DACVAR
#define DEFINE_DACVAR(type, true_type, id, var)
#endif
// Use this macro to define a static var that is known to DAC, but not captured in a dump.
#ifndef DEFINE_DACVAR_NO_DUMP
#define DEFINE_DACVAR_NO_DUMP(type, true_type, id, var)
#endif
#define UNKNOWN_POINTER_TYPE SIZE_T
DEFINE_DACVAR(ULONG, PTR_RangeSection, ExecutionManager__m_CodeRangeList, ExecutionManager::m_CodeRangeList)
DEFINE_DACVAR(ULONG, PTR_EECodeManager, ExecutionManager__m_pDefaultCodeMan, ExecutionManager::m_pDefaultCodeMan)
DEFINE_DACVAR(ULONG, LONG, ExecutionManager__m_dwReaderCount, ExecutionManager::m_dwReaderCount)
DEFINE_DACVAR(ULONG, LONG, ExecutionManager__m_dwWriterLock, ExecutionManager::m_dwWriterLock)
DEFINE_DACVAR(ULONG, PTR_EEJitManager, ExecutionManager__m_pEEJitManager, ExecutionManager::m_pEEJitManager)
#ifdef FEATURE_READYTORUN
DEFINE_DACVAR(ULONG, PTR_ReadyToRunJitManager, ExecutionManager__m_pReadyToRunJitManager, ExecutionManager::m_pReadyToRunJitManager)
#endif
DEFINE_DACVAR_NO_DUMP(ULONG, VMHELPDEF *, dac__hlpFuncTable, ::hlpFuncTable)
DEFINE_DACVAR(ULONG, VMHELPDEF *, dac__hlpDynamicFuncTable, ::hlpDynamicFuncTable)
DEFINE_DACVAR(ULONG, PTR_StubManager, StubManager__g_pFirstManager, StubManager::g_pFirstManager)
DEFINE_DACVAR(ULONG, PTR_PrecodeStubManager, PrecodeStubManager__g_pManager, PrecodeStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_StubLinkStubManager, StubLinkStubManager__g_pManager, StubLinkStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_ThunkHeapStubManager, ThunkHeapStubManager__g_pManager, ThunkHeapStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_JumpStubStubManager, JumpStubStubManager__g_pManager, JumpStubStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_RangeSectionStubManager, RangeSectionStubManager__g_pManager, RangeSectionStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_DelegateInvokeStubManager, DelegateInvokeStubManager__g_pManager, DelegateInvokeStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_VirtualCallStubManagerManager, VirtualCallStubManagerManager__g_pManager, VirtualCallStubManagerManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_CallCountingStubManager, CallCountingStubManager__g_pManager, CallCountingStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_ThreadStore, ThreadStore__s_pThreadStore, ThreadStore::s_pThreadStore)
DEFINE_DACVAR(ULONG, int, ThreadpoolMgr__cpuUtilization, ThreadpoolMgr::cpuUtilization)
DEFINE_DACVAR(ULONG, ThreadpoolMgr::ThreadCounter, ThreadpoolMgr__WorkerCounter, ThreadpoolMgr::WorkerCounter)
DEFINE_DACVAR(ULONG, int, ThreadpoolMgr__MinLimitTotalWorkerThreads, ThreadpoolMgr::MinLimitTotalWorkerThreads)
DEFINE_DACVAR(ULONG, DWORD, ThreadpoolMgr__MaxLimitTotalWorkerThreads, ThreadpoolMgr::MaxLimitTotalWorkerThreads)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE /*PTR_WorkRequest*/, ThreadpoolMgr__WorkRequestHead, ThreadpoolMgr::WorkRequestHead) // PTR_WorkRequest is not defined. So use a pointer type
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE /*PTR_WorkRequest*/, ThreadpoolMgr__WorkRequestTail, ThreadpoolMgr::WorkRequestTail) //
DEFINE_DACVAR(ULONG, ThreadpoolMgr::ThreadCounter, ThreadpoolMgr__CPThreadCounter, ThreadpoolMgr::CPThreadCounter)
DEFINE_DACVAR(ULONG, LONG, ThreadpoolMgr__MaxFreeCPThreads, ThreadpoolMgr::MaxFreeCPThreads)
DEFINE_DACVAR(ULONG, LONG, ThreadpoolMgr__MaxLimitTotalCPThreads, ThreadpoolMgr::MaxLimitTotalCPThreads)
DEFINE_DACVAR(ULONG, LONG, ThreadpoolMgr__MinLimitTotalCPThreads, ThreadpoolMgr::MinLimitTotalCPThreads)
DEFINE_DACVAR(ULONG, LIST_ENTRY, ThreadpoolMgr__TimerQueue, ThreadpoolMgr::TimerQueue)
DEFINE_DACVAR_NO_DUMP(ULONG, SIZE_T, dac__HillClimbingLog, ::HillClimbingLog)
DEFINE_DACVAR(ULONG, int, dac__HillClimbingLogFirstIndex, ::HillClimbingLogFirstIndex)
DEFINE_DACVAR(ULONG, int, dac__HillClimbingLogSize, ::HillClimbingLogSize)
DEFINE_DACVAR(ULONG, PTR_Thread, dac__g_pFinalizerThread, ::g_pFinalizerThread)
DEFINE_DACVAR(ULONG, PTR_Thread, dac__g_pSuspensionThread, ::g_pSuspensionThread)
DEFINE_DACVAR(ULONG, DWORD, dac__g_heap_type, g_heap_type)
DEFINE_DACVAR(ULONG, PTR_GcDacVars, dac__g_gcDacGlobals, g_gcDacGlobals)
DEFINE_DACVAR(ULONG, PTR_AppDomain, AppDomain__m_pTheAppDomain, AppDomain::m_pTheAppDomain)
DEFINE_DACVAR(ULONG, PTR_SystemDomain, SystemDomain__m_pSystemDomain, SystemDomain::m_pSystemDomain)
#ifdef FEATURE_INTEROP_DEBUGGING
DEFINE_DACVAR(ULONG, DWORD, dac__g_debuggerWordTLSIndex, g_debuggerWordTLSIndex)
#endif
DEFINE_DACVAR(ULONG, DWORD, dac__g_TlsIndex, g_TlsIndex)
DEFINE_DACVAR(ULONG, PTR_SString, SString__s_Empty, SString::s_Empty)
DEFINE_DACVAR(ULONG, INT32, ArrayBase__s_arrayBoundsZero, ArrayBase::s_arrayBoundsZero)
DEFINE_DACVAR(ULONG, BOOL, StackwalkCache__s_Enabled, StackwalkCache::s_Enabled)
DEFINE_DACVAR(ULONG, PTR_JITNotification, dac__g_pNotificationTable, ::g_pNotificationTable)
DEFINE_DACVAR(ULONG, ULONG32, dac__g_dacNotificationFlags, ::g_dacNotificationFlags)
DEFINE_DACVAR(ULONG, PTR_GcNotification, dac__g_pGcNotificationTable, ::g_pGcNotificationTable)
DEFINE_DACVAR(ULONG, PTR_EEConfig, dac__g_pConfig, ::g_pConfig)
DEFINE_DACVAR(ULONG, CoreLibBinder, dac__g_CoreLib, ::g_CoreLib)
#if defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)
DEFINE_DACVAR(ULONG, ProfControlBlock, dac__g_profControlBlock, ::g_profControlBlock)
#endif // defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)
DEFINE_DACVAR(ULONG, PTR_DWORD, dac__g_card_table, ::g_card_table)
DEFINE_DACVAR(ULONG, PTR_BYTE, dac__g_lowest_address, ::g_lowest_address)
DEFINE_DACVAR(ULONG, PTR_BYTE, dac__g_highest_address, ::g_highest_address)
DEFINE_DACVAR(ULONG, IGCHeap, dac__g_pGCHeap, ::g_pGCHeap)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThinLockThreadIdDispenser, ::g_pThinLockThreadIdDispenser)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pModuleIndexDispenser, ::g_pModuleIndexDispenser)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pObjectClass, ::g_pObjectClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pRuntimeTypeClass, ::g_pRuntimeTypeClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pCanonMethodTableClass, ::g_pCanonMethodTableClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pStringClass, ::g_pStringClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pArrayClass, ::g_pArrayClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pSZArrayHelperClass, ::g_pSZArrayHelperClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pNullableClass, ::g_pNullableClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pByReferenceClass, ::g_pByReferenceClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pExceptionClass, ::g_pExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThreadAbortExceptionClass, ::g_pThreadAbortExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pOutOfMemoryExceptionClass, ::g_pOutOfMemoryExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pStackOverflowExceptionClass, ::g_pStackOverflowExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pExecutionEngineExceptionClass, ::g_pExecutionEngineExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pDelegateClass, ::g_pDelegateClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pMulticastDelegateClass, ::g_pMulticastDelegateClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pFreeObjectMethodTable, ::g_pFreeObjectMethodTable)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pOverlappedDataClass, ::g_pOverlappedDataClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pValueTypeClass, ::g_pValueTypeClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pEnumClass, ::g_pEnumClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThreadClass, ::g_pThreadClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pPredefinedArrayTypes, ::g_pPredefinedArrayTypes)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_TypedReferenceMT, ::g_TypedReferenceMT)
#ifdef FEATURE_COMINTEROP
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pBaseCOMObject, ::g_pBaseCOMObject)
#endif
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pIDynamicInterfaceCastableInterface, ::g_pIDynamicInterfaceCastableInterface)
#ifdef FEATURE_ICASTABLE
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pICastableInterface, ::g_pICastableInterface)
#endif // FEATURE_ICASTABLE
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pObjectFinalizerMD, ::g_pObjectFinalizerMD)
DEFINE_DACVAR(ULONG, bool, dac__g_fProcessDetach, ::g_fProcessDetach)
DEFINE_DACVAR(ULONG, DWORD, dac__g_fEEShutDown, ::g_fEEShutDown)
DEFINE_DACVAR(ULONG, ULONG, dac__g_CORDebuggerControlFlags, ::g_CORDebuggerControlFlags)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pDebugger, ::g_pDebugger)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pDebugInterface, ::g_pDebugInterface)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pEEDbgInterfaceImpl, ::g_pEEDbgInterfaceImpl)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pEEInterface, ::g_pEEInterface)
DEFINE_DACVAR(ULONG, ULONG, dac__CLRJitAttachState, ::CLRJitAttachState)
DEFINE_DACVAR(ULONG, BOOL, Debugger__s_fCanChangeNgenFlags, Debugger::s_fCanChangeNgenFlags)
DEFINE_DACVAR(ULONG, PTR_DebuggerPatchTable, DebuggerController__g_patches, DebuggerController::g_patches)
DEFINE_DACVAR(ULONG, BOOL, DebuggerController__g_patchTableValid, DebuggerController::g_patchTableValid)
DEFINE_DACVAR(ULONG, SIZE_T, dac__gLowestFCall, ::gLowestFCall)
DEFINE_DACVAR(ULONG, SIZE_T, dac__gHighestFCall, ::gHighestFCall)
DEFINE_DACVAR(ULONG, SIZE_T, dac__gFCallMethods, ::gFCallMethods)
DEFINE_DACVAR(ULONG, PTR_SyncTableEntry, dac__g_pSyncTable, ::g_pSyncTable)
#ifdef FEATURE_COMINTEROP
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pRCWCleanupList, ::g_pRCWCleanupList)
#endif // FEATURE_COMINTEROP
#ifndef TARGET_UNIX
DEFINE_DACVAR(ULONG, SIZE_T, dac__g_runtimeLoadedBaseAddress, ::g_runtimeLoadedBaseAddress)
DEFINE_DACVAR(ULONG, SIZE_T, dac__g_runtimeVirtualSize, ::g_runtimeVirtualSize)
#endif // !TARGET_UNIX
DEFINE_DACVAR(ULONG, SyncBlockCache *, SyncBlockCache__s_pSyncBlockCache, SyncBlockCache::s_pSyncBlockCache)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pStressLog, ::g_pStressLog)
DEFINE_DACVAR(ULONG, SIZE_T, dac__s_gsCookie, ::s_gsCookie)
DEFINE_DACVAR_NO_DUMP(ULONG, SIZE_T, dac__g_FCDynamicallyAssignedImplementations, ::g_FCDynamicallyAssignedImplementations)
#ifndef TARGET_UNIX
DEFINE_DACVAR(ULONG, HANDLE, dac__g_hContinueStartupEvent, ::g_hContinueStartupEvent)
#endif // !TARGET_UNIX
DEFINE_DACVAR(ULONG, DWORD, CorHost2__m_dwStartupFlags, CorHost2::m_dwStartupFlags)
DEFINE_DACVAR(ULONG, HRESULT, dac__g_hrFatalError, ::g_hrFatalError)
#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
DEFINE_DACVAR(ULONG, DWORD, dac__g_MiniMetaDataBuffMaxSize, ::g_MiniMetaDataBuffMaxSize)
DEFINE_DACVAR(ULONG, TADDR, dac__g_MiniMetaDataBuffAddress, ::g_MiniMetaDataBuffAddress)
#endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
DEFINE_DACVAR(ULONG, SIZE_T, dac__g_clrNotificationArguments, ::g_clrNotificationArguments)
#ifdef EnC_SUPPORTED
DEFINE_DACVAR(ULONG, bool, dac__g_metadataUpdatesApplied, ::g_metadataUpdatesApplied)
#endif
#undef DEFINE_DACVAR
#undef DEFINE_DACVAR_NO_DUMP
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// This file contains the globals and statics that are visible to DAC.
// It is used for the following:
// 1. in daccess.h to build the table of DAC globals
// 2. in enummem.cpp to dump out the related memory of static and globals
// in a mini dump or heap dump
// 3. in DacUpdateDll and tools\DacTablenGen\main.cs
//
// To use this functionality for other tools or purposes, define the
// DEFINE_DACVAR macro & include dacvars.h like so (see enummem.cpp and/or
// daccess.h for examples):
//
// #define DEFINE_DACVAR(type, size, id, var) type id; //this defn. discards
// //the size
// #include "dacvars.h"
//
// @dbgtodo:
// Ideally we may be able to build a tool that generates this automatically.
// At the least, we should automatically verify that the contents of this file
// are consistent with the uses of all the macros like SVAL_DECL and GARY_DECL.
//
//=================================================
// INSTRUCTIONS FOR ADDING VARIABLES TO THIS FILE
//=================================================
// You need to add a global or static declared with DAC macros, such as SPTR_*
// GPTR_*, SVAL_*, GVAL_*, or GARY_*, only if the global or static is actually used
// in a DACized code path. If you have declared a static or global that way just
// because you were pattern-matching or because you anticipate that the variable
// may eventually be used in a DACized code path, you don't need to add it here,
// although in that case, you should not really use the DAC macro when you declare
// the global or static.
// * * *
// The FIRST ARGUMENT should always be specified as ULONG. This is the type of
// the offsets for the corresponding id in the _DacGlobals table.
// @dbgtodo:
// We should get rid of the ULONG argument since it's always the same. We would
// also need to modify DacTablenGen\main.cs.
// * * *
// The SECOND ARGUMENT, "true_type," is used to calculate the true size of the
// static/global variable. It is currently used only in enummem.cpp to write out
// theproper size of memory for dumps.
// * * *
// The THIRD ARGUMENT should be a qualified name. If the variable is a static data
// member, the name should be <class_name>__<member_name>. If the variable is a
// global, the name should be <dac>__<global_name>.
// * * *
// The FOURTH ARGUMENT should be the actual name of the static/global variable. If
// static data the should be [<namespace>::]<class_name>::<member_name>. If global,
// it should look like <global_name>.
// * * *
// If you need to add an entry to this file, your type may not be visible when
// this file is compiled. In that case, you need to do one of two things:
// - If the type is a pointer type, you can simply use UNKNOWN_POINTER_TYPE as the
// "true type." It may be useful to specify the non-visible type in a comment.
// - If the type is a composite/user-defined type, you must #include the header
// file that defines the type in enummem.cpp. Do NOT #include it in daccess.h
// Array types may be dumped via an explicit call to enumMem, so they should
// be declared with DEFINE_DACVAR_NO_DUMP. The size in this case is immaterial, since
// nothing will be dumped.
#ifndef DEFINE_DACVAR
#define DEFINE_DACVAR(type, true_type, id, var)
#endif
// Use this macro to define a static var that is known to DAC, but not captured in a dump.
#ifndef DEFINE_DACVAR_NO_DUMP
#define DEFINE_DACVAR_NO_DUMP(type, true_type, id, var)
#endif
#define UNKNOWN_POINTER_TYPE SIZE_T
DEFINE_DACVAR(ULONG, PTR_RangeSection, ExecutionManager__m_CodeRangeList, ExecutionManager::m_CodeRangeList)
DEFINE_DACVAR(ULONG, PTR_EECodeManager, ExecutionManager__m_pDefaultCodeMan, ExecutionManager::m_pDefaultCodeMan)
DEFINE_DACVAR(ULONG, LONG, ExecutionManager__m_dwReaderCount, ExecutionManager::m_dwReaderCount)
DEFINE_DACVAR(ULONG, LONG, ExecutionManager__m_dwWriterLock, ExecutionManager::m_dwWriterLock)
DEFINE_DACVAR(ULONG, PTR_EEJitManager, ExecutionManager__m_pEEJitManager, ExecutionManager::m_pEEJitManager)
#ifdef FEATURE_READYTORUN
DEFINE_DACVAR(ULONG, PTR_ReadyToRunJitManager, ExecutionManager__m_pReadyToRunJitManager, ExecutionManager::m_pReadyToRunJitManager)
#endif
DEFINE_DACVAR_NO_DUMP(ULONG, VMHELPDEF *, dac__hlpFuncTable, ::hlpFuncTable)
DEFINE_DACVAR(ULONG, VMHELPDEF *, dac__hlpDynamicFuncTable, ::hlpDynamicFuncTable)
DEFINE_DACVAR(ULONG, PTR_StubManager, StubManager__g_pFirstManager, StubManager::g_pFirstManager)
DEFINE_DACVAR(ULONG, PTR_PrecodeStubManager, PrecodeStubManager__g_pManager, PrecodeStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_StubLinkStubManager, StubLinkStubManager__g_pManager, StubLinkStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_ThunkHeapStubManager, ThunkHeapStubManager__g_pManager, ThunkHeapStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_JumpStubStubManager, JumpStubStubManager__g_pManager, JumpStubStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_RangeSectionStubManager, RangeSectionStubManager__g_pManager, RangeSectionStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_DelegateInvokeStubManager, DelegateInvokeStubManager__g_pManager, DelegateInvokeStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_VirtualCallStubManagerManager, VirtualCallStubManagerManager__g_pManager, VirtualCallStubManagerManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_CallCountingStubManager, CallCountingStubManager__g_pManager, CallCountingStubManager::g_pManager)
DEFINE_DACVAR(ULONG, PTR_ThreadStore, ThreadStore__s_pThreadStore, ThreadStore::s_pThreadStore)
DEFINE_DACVAR(ULONG, int, ThreadpoolMgr__cpuUtilization, ThreadpoolMgr::cpuUtilization)
DEFINE_DACVAR(ULONG, ThreadpoolMgr::ThreadCounter, ThreadpoolMgr__WorkerCounter, ThreadpoolMgr::WorkerCounter)
DEFINE_DACVAR(ULONG, int, ThreadpoolMgr__MinLimitTotalWorkerThreads, ThreadpoolMgr::MinLimitTotalWorkerThreads)
DEFINE_DACVAR(ULONG, DWORD, ThreadpoolMgr__MaxLimitTotalWorkerThreads, ThreadpoolMgr::MaxLimitTotalWorkerThreads)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE /*PTR_WorkRequest*/, ThreadpoolMgr__WorkRequestHead, ThreadpoolMgr::WorkRequestHead) // PTR_WorkRequest is not defined. So use a pointer type
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE /*PTR_WorkRequest*/, ThreadpoolMgr__WorkRequestTail, ThreadpoolMgr::WorkRequestTail) //
DEFINE_DACVAR(ULONG, ThreadpoolMgr::ThreadCounter, ThreadpoolMgr__CPThreadCounter, ThreadpoolMgr::CPThreadCounter)
DEFINE_DACVAR(ULONG, LONG, ThreadpoolMgr__MaxFreeCPThreads, ThreadpoolMgr::MaxFreeCPThreads)
DEFINE_DACVAR(ULONG, LONG, ThreadpoolMgr__MaxLimitTotalCPThreads, ThreadpoolMgr::MaxLimitTotalCPThreads)
DEFINE_DACVAR(ULONG, LONG, ThreadpoolMgr__MinLimitTotalCPThreads, ThreadpoolMgr::MinLimitTotalCPThreads)
DEFINE_DACVAR(ULONG, LIST_ENTRY, ThreadpoolMgr__TimerQueue, ThreadpoolMgr::TimerQueue)
DEFINE_DACVAR_NO_DUMP(ULONG, SIZE_T, dac__HillClimbingLog, ::HillClimbingLog)
DEFINE_DACVAR(ULONG, int, dac__HillClimbingLogFirstIndex, ::HillClimbingLogFirstIndex)
DEFINE_DACVAR(ULONG, int, dac__HillClimbingLogSize, ::HillClimbingLogSize)
DEFINE_DACVAR(ULONG, PTR_Thread, dac__g_pFinalizerThread, ::g_pFinalizerThread)
DEFINE_DACVAR(ULONG, PTR_Thread, dac__g_pSuspensionThread, ::g_pSuspensionThread)
DEFINE_DACVAR(ULONG, DWORD, dac__g_heap_type, g_heap_type)
DEFINE_DACVAR(ULONG, PTR_GcDacVars, dac__g_gcDacGlobals, g_gcDacGlobals)
DEFINE_DACVAR(ULONG, PTR_AppDomain, AppDomain__m_pTheAppDomain, AppDomain::m_pTheAppDomain)
DEFINE_DACVAR(ULONG, PTR_SystemDomain, SystemDomain__m_pSystemDomain, SystemDomain::m_pSystemDomain)
#ifdef FEATURE_INTEROP_DEBUGGING
DEFINE_DACVAR(ULONG, DWORD, dac__g_debuggerWordTLSIndex, g_debuggerWordTLSIndex)
#endif
DEFINE_DACVAR(ULONG, DWORD, dac__g_TlsIndex, g_TlsIndex)
DEFINE_DACVAR(ULONG, PTR_SString, SString__s_Empty, SString::s_Empty)
DEFINE_DACVAR(ULONG, INT32, ArrayBase__s_arrayBoundsZero, ArrayBase::s_arrayBoundsZero)
DEFINE_DACVAR(ULONG, BOOL, StackwalkCache__s_Enabled, StackwalkCache::s_Enabled)
DEFINE_DACVAR(ULONG, PTR_JITNotification, dac__g_pNotificationTable, ::g_pNotificationTable)
DEFINE_DACVAR(ULONG, ULONG32, dac__g_dacNotificationFlags, ::g_dacNotificationFlags)
DEFINE_DACVAR(ULONG, PTR_GcNotification, dac__g_pGcNotificationTable, ::g_pGcNotificationTable)
DEFINE_DACVAR(ULONG, PTR_EEConfig, dac__g_pConfig, ::g_pConfig)
DEFINE_DACVAR(ULONG, CoreLibBinder, dac__g_CoreLib, ::g_CoreLib)
#if defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)
DEFINE_DACVAR(ULONG, ProfControlBlock, dac__g_profControlBlock, ::g_profControlBlock)
#endif // defined(PROFILING_SUPPORTED) || defined(PROFILING_SUPPORTED_DATA)
DEFINE_DACVAR(ULONG, PTR_DWORD, dac__g_card_table, ::g_card_table)
DEFINE_DACVAR(ULONG, PTR_BYTE, dac__g_lowest_address, ::g_lowest_address)
DEFINE_DACVAR(ULONG, PTR_BYTE, dac__g_highest_address, ::g_highest_address)
DEFINE_DACVAR(ULONG, IGCHeap, dac__g_pGCHeap, ::g_pGCHeap)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThinLockThreadIdDispenser, ::g_pThinLockThreadIdDispenser)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pModuleIndexDispenser, ::g_pModuleIndexDispenser)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pObjectClass, ::g_pObjectClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pRuntimeTypeClass, ::g_pRuntimeTypeClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pCanonMethodTableClass, ::g_pCanonMethodTableClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pStringClass, ::g_pStringClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pArrayClass, ::g_pArrayClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pSZArrayHelperClass, ::g_pSZArrayHelperClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pNullableClass, ::g_pNullableClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pByReferenceClass, ::g_pByReferenceClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pExceptionClass, ::g_pExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThreadAbortExceptionClass, ::g_pThreadAbortExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pOutOfMemoryExceptionClass, ::g_pOutOfMemoryExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pStackOverflowExceptionClass, ::g_pStackOverflowExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pExecutionEngineExceptionClass, ::g_pExecutionEngineExceptionClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pDelegateClass, ::g_pDelegateClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pMulticastDelegateClass, ::g_pMulticastDelegateClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pFreeObjectMethodTable, ::g_pFreeObjectMethodTable)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pOverlappedDataClass, ::g_pOverlappedDataClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pValueTypeClass, ::g_pValueTypeClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pEnumClass, ::g_pEnumClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pThreadClass, ::g_pThreadClass)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pPredefinedArrayTypes, ::g_pPredefinedArrayTypes)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_TypedReferenceMT, ::g_TypedReferenceMT)
#ifdef FEATURE_COMINTEROP
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pBaseCOMObject, ::g_pBaseCOMObject)
#endif
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pIDynamicInterfaceCastableInterface, ::g_pIDynamicInterfaceCastableInterface)
#ifdef FEATURE_ICASTABLE
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pICastableInterface, ::g_pICastableInterface)
#endif // FEATURE_ICASTABLE
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pObjectFinalizerMD, ::g_pObjectFinalizerMD)
DEFINE_DACVAR(ULONG, bool, dac__g_fProcessDetach, ::g_fProcessDetach)
DEFINE_DACVAR(ULONG, DWORD, dac__g_fEEShutDown, ::g_fEEShutDown)
DEFINE_DACVAR(ULONG, ULONG, dac__g_CORDebuggerControlFlags, ::g_CORDebuggerControlFlags)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pDebugger, ::g_pDebugger)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pDebugInterface, ::g_pDebugInterface)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pEEDbgInterfaceImpl, ::g_pEEDbgInterfaceImpl)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pEEInterface, ::g_pEEInterface)
DEFINE_DACVAR(ULONG, ULONG, dac__CLRJitAttachState, ::CLRJitAttachState)
DEFINE_DACVAR(ULONG, BOOL, Debugger__s_fCanChangeNgenFlags, Debugger::s_fCanChangeNgenFlags)
DEFINE_DACVAR(ULONG, PTR_DebuggerPatchTable, DebuggerController__g_patches, DebuggerController::g_patches)
DEFINE_DACVAR(ULONG, BOOL, DebuggerController__g_patchTableValid, DebuggerController::g_patchTableValid)
DEFINE_DACVAR(ULONG, SIZE_T, dac__gLowestFCall, ::gLowestFCall)
DEFINE_DACVAR(ULONG, SIZE_T, dac__gHighestFCall, ::gHighestFCall)
DEFINE_DACVAR(ULONG, SIZE_T, dac__gFCallMethods, ::gFCallMethods)
DEFINE_DACVAR(ULONG, PTR_SyncTableEntry, dac__g_pSyncTable, ::g_pSyncTable)
#ifdef FEATURE_COMINTEROP
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pRCWCleanupList, ::g_pRCWCleanupList)
#endif // FEATURE_COMINTEROP
#ifndef TARGET_UNIX
DEFINE_DACVAR(ULONG, SIZE_T, dac__g_runtimeLoadedBaseAddress, ::g_runtimeLoadedBaseAddress)
DEFINE_DACVAR(ULONG, SIZE_T, dac__g_runtimeVirtualSize, ::g_runtimeVirtualSize)
#endif // !TARGET_UNIX
DEFINE_DACVAR(ULONG, SyncBlockCache *, SyncBlockCache__s_pSyncBlockCache, SyncBlockCache::s_pSyncBlockCache)
DEFINE_DACVAR(ULONG, UNKNOWN_POINTER_TYPE, dac__g_pStressLog, ::g_pStressLog)
DEFINE_DACVAR(ULONG, SIZE_T, dac__s_gsCookie, ::s_gsCookie)
DEFINE_DACVAR_NO_DUMP(ULONG, SIZE_T, dac__g_FCDynamicallyAssignedImplementations, ::g_FCDynamicallyAssignedImplementations)
#ifndef TARGET_UNIX
DEFINE_DACVAR(ULONG, HANDLE, dac__g_hContinueStartupEvent, ::g_hContinueStartupEvent)
#endif // !TARGET_UNIX
DEFINE_DACVAR(ULONG, DWORD, CorHost2__m_dwStartupFlags, CorHost2::m_dwStartupFlags)
DEFINE_DACVAR(ULONG, HRESULT, dac__g_hrFatalError, ::g_hrFatalError)
#ifdef FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
DEFINE_DACVAR(ULONG, DWORD, dac__g_MiniMetaDataBuffMaxSize, ::g_MiniMetaDataBuffMaxSize)
DEFINE_DACVAR(ULONG, TADDR, dac__g_MiniMetaDataBuffAddress, ::g_MiniMetaDataBuffAddress)
#endif // FEATURE_MINIMETADATA_IN_TRIAGEDUMPS
DEFINE_DACVAR(ULONG, SIZE_T, dac__g_clrNotificationArguments, ::g_clrNotificationArguments)
#ifdef EnC_SUPPORTED
DEFINE_DACVAR(ULONG, bool, dac__g_metadataUpdatesApplied, ::g_metadataUpdatesApplied)
#endif
#undef DEFINE_DACVAR
#undef DEFINE_DACVAR_NO_DUMP
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/native/corehost/bundle/info.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef __INFO_H_
#define __INFO_H_
#include "error_codes.h"
#include "header.h"
// bundle::info supports:
// * API for identification of a single-file app bundle, and
// * Minimal probing and mapping functionality only for the app.runtimeconfig.json and app.deps.json files.
// bundle::info is used by HostFxr to read the above config files.
namespace bundle
{
struct info_t
{
struct config_t
{
config_t()
: m_location(nullptr) {}
config_t(const config_t& config)
{
m_path = config.m_path;
m_location = config.m_location;
}
config_t(const pal::string_t& path, const location_t *location=nullptr)
{
m_path = path;
m_location = location;
}
bool matches(const pal::string_t& path) const
{
return m_location->is_valid() && path.compare(m_path) == 0;
}
static bool probe(const pal::string_t& path)
{
return is_single_file_bundle() &&
(the_app->m_deps_json.matches(path) || the_app->m_runtimeconfig_json.matches(path));
}
void set_location(const location_t* location)
{
m_location = location;
}
static char* map(const pal::string_t& path, const location_t* &location);
static void unmap(const char* addr, const location_t* location);
private:
pal::string_t m_path;
const location_t *m_location;
};
static StatusCode process_bundle(const pal::char_t* bundle_path, const pal::char_t *app_path, int64_t header_offset);
static bool is_single_file_bundle() { return the_app != nullptr; }
bool is_netcoreapp3_compat_mode() const { return m_header.is_netcoreapp3_compat_mode(); }
const pal::string_t& base_path() const { return m_base_path; }
int64_t header_offset() const { return m_header_offset; }
// Global single-file info object
static const info_t* the_app;
protected:
info_t(const pal::char_t* bundle_path,
const pal::char_t* app_path,
int64_t header_offset);
const char* map_bundle();
void unmap_bundle(const char* addr) const;
pal::string_t m_bundle_path;
pal::string_t m_base_path;
size_t m_bundle_size;
int64_t m_header_offset;
int64_t m_offset_in_file;
header_t m_header;
config_t m_deps_json;
config_t m_runtimeconfig_json;
private:
StatusCode process_header();
};
}
#endif // __INFO_H_
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef __INFO_H_
#define __INFO_H_
#include "error_codes.h"
#include "header.h"
// bundle::info supports:
// * API for identification of a single-file app bundle, and
// * Minimal probing and mapping functionality only for the app.runtimeconfig.json and app.deps.json files.
// bundle::info is used by HostFxr to read the above config files.
namespace bundle
{
struct info_t
{
struct config_t
{
config_t()
: m_location(nullptr) {}
config_t(const config_t& config)
{
m_path = config.m_path;
m_location = config.m_location;
}
config_t(const pal::string_t& path, const location_t *location=nullptr)
{
m_path = path;
m_location = location;
}
bool matches(const pal::string_t& path) const
{
return m_location->is_valid() && path.compare(m_path) == 0;
}
static bool probe(const pal::string_t& path)
{
return is_single_file_bundle() &&
(the_app->m_deps_json.matches(path) || the_app->m_runtimeconfig_json.matches(path));
}
void set_location(const location_t* location)
{
m_location = location;
}
static char* map(const pal::string_t& path, const location_t* &location);
static void unmap(const char* addr, const location_t* location);
private:
pal::string_t m_path;
const location_t *m_location;
};
static StatusCode process_bundle(const pal::char_t* bundle_path, const pal::char_t *app_path, int64_t header_offset);
static bool is_single_file_bundle() { return the_app != nullptr; }
bool is_netcoreapp3_compat_mode() const { return m_header.is_netcoreapp3_compat_mode(); }
const pal::string_t& base_path() const { return m_base_path; }
int64_t header_offset() const { return m_header_offset; }
// Global single-file info object
static const info_t* the_app;
protected:
info_t(const pal::char_t* bundle_path,
const pal::char_t* app_path,
int64_t header_offset);
const char* map_bundle();
void unmap_bundle(const char* addr) const;
pal::string_t m_bundle_path;
pal::string_t m_base_path;
size_t m_bundle_size;
int64_t m_header_offset;
int64_t m_offset_in_file;
header_t m_header;
config_t m_deps_json;
config_t m_runtimeconfig_json;
private:
StatusCode process_header();
};
}
#endif // __INFO_H_
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/ReverseElement8.Vector128.Int32.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void ReverseElement8_Vector128_Int32()
{
var test = new SimpleUnaryOpTest__ReverseElement8_Vector128_Int32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleUnaryOpTest__ReverseElement8_Vector128_Int32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<Int32> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleUnaryOpTest__ReverseElement8_Vector128_Int32 testClass)
{
var result = AdvSimd.ReverseElement8(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleUnaryOpTest__ReverseElement8_Vector128_Int32 testClass)
{
fixed (Vector128<Int32>* pFld1 = &_fld1)
{
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(pFld1))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Vector128<Int32> _clsVar1;
private Vector128<Int32> _fld1;
private DataTable _dataTable;
static SimpleUnaryOpTest__ReverseElement8_Vector128_Int32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
}
public SimpleUnaryOpTest__ReverseElement8_Vector128_Int32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.ReverseElement8(
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.ReverseElement8), new Type[] { typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.ReverseElement8), new Type[] { typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.ReverseElement8(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<Int32>* pClsVar1 = &_clsVar1)
{
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(pClsVar1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr);
var result = AdvSimd.ReverseElement8(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr));
var result = AdvSimd.ReverseElement8(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleUnaryOpTest__ReverseElement8_Vector128_Int32();
var result = AdvSimd.ReverseElement8(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleUnaryOpTest__ReverseElement8_Vector128_Int32();
fixed (Vector128<Int32>* pFld1 = &test._fld1)
{
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.ReverseElement8(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<Int32>* pFld1 = &_fld1)
{
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.ReverseElement8(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(&test._fld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<Int32> op1, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.ReverseElement8(firstOp[i]) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.ReverseElement8)}<Int32>(Vector128<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void ReverseElement8_Vector128_Int32()
{
var test = new SimpleUnaryOpTest__ReverseElement8_Vector128_Int32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleUnaryOpTest__ReverseElement8_Vector128_Int32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<Int32> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleUnaryOpTest__ReverseElement8_Vector128_Int32 testClass)
{
var result = AdvSimd.ReverseElement8(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleUnaryOpTest__ReverseElement8_Vector128_Int32 testClass)
{
fixed (Vector128<Int32>* pFld1 = &_fld1)
{
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(pFld1))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Vector128<Int32> _clsVar1;
private Vector128<Int32> _fld1;
private DataTable _dataTable;
static SimpleUnaryOpTest__ReverseElement8_Vector128_Int32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
}
public SimpleUnaryOpTest__ReverseElement8_Vector128_Int32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.ReverseElement8(
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.ReverseElement8), new Type[] { typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.ReverseElement8), new Type[] { typeof(Vector128<Int32>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.ReverseElement8(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector128<Int32>* pClsVar1 = &_clsVar1)
{
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(pClsVar1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray1Ptr);
var result = AdvSimd.ReverseElement8(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray1Ptr));
var result = AdvSimd.ReverseElement8(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleUnaryOpTest__ReverseElement8_Vector128_Int32();
var result = AdvSimd.ReverseElement8(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleUnaryOpTest__ReverseElement8_Vector128_Int32();
fixed (Vector128<Int32>* pFld1 = &test._fld1)
{
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.ReverseElement8(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector128<Int32>* pFld1 = &_fld1)
{
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.ReverseElement8(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.ReverseElement8(
AdvSimd.LoadVector128((Int32*)(&test._fld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector128<Int32> op1, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<Int32>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(Int32[] firstOp, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.ReverseElement8(firstOp[i]) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.ReverseElement8)}<Int32>(Vector128<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/JIT/Regression/JitBlue/GitHub_39823/GitHub_39823.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
<Optimize>True</Optimize>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>Full</DebugType>
<Optimize>True</Optimize>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/JIT/CodeGenBringUpTests/FPDivConst_r.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="FPDivConst.cs" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="FPDivConst.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/coreclr/tools/superpmi/mcs/mcs.h
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef _MCS
#define _MCS
#endif
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef _MCS
#define _MCS
#endif
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/JIT/CodeGenBringUpTests/Sub1.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
using System;
using System.Runtime.CompilerServices;
public class BringUpTest_Sub1
{
const int Pass = 100;
const int Fail = -1;
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public static int Sub1(int x) { return x - 1; }
public static int Main()
{
int y = Sub1(1);
if (y == 0) return Pass;
else return Fail;
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
using System;
using System.Runtime.CompilerServices;
public class BringUpTest_Sub1
{
const int Pass = 100;
const int Fail = -1;
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public static int Sub1(int x) { return x - 1; }
public static int Main()
{
int y = Sub1(1);
if (y == 0) return Pass;
else return Fail;
}
}
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/Loader/classloader/DefaultInterfaceMethods/regressions/github44533.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/ReciprocalEstimate.Vector64.Single.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void ReciprocalEstimate_Vector64_Single()
{
var test = new SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Single[] inArray1, Single[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Single> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = BitConverter.Int32BitsToSingle(0x3e4ed9ed); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
return testStruct;
}
public void RunStructFldScenario(SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single testClass)
{
var result = AdvSimd.ReciprocalEstimate(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single testClass)
{
fixed (Vector64<Single>* pFld1 = &_fld1)
{
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(pFld1))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static Single[] _data1 = new Single[Op1ElementCount];
private static Vector64<Single> _clsVar1;
private Vector64<Single> _fld1;
private DataTable _dataTable;
static SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = BitConverter.Int32BitsToSingle(0x3e4ed9ed); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
}
public SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = BitConverter.Int32BitsToSingle(0x3e4ed9ed); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = BitConverter.Int32BitsToSingle(0x3e4ed9ed); }
_dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.ReciprocalEstimate(
Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.ReciprocalEstimate), new Type[] { typeof(Vector64<Single>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.ReciprocalEstimate), new Type[] { typeof(Vector64<Single>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.ReciprocalEstimate(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Single>* pClsVar1 = &_clsVar1)
{
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(pClsVar1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr);
var result = AdvSimd.ReciprocalEstimate(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr));
var result = AdvSimd.ReciprocalEstimate(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single();
var result = AdvSimd.ReciprocalEstimate(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single();
fixed (Vector64<Single>* pFld1 = &test._fld1)
{
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.ReciprocalEstimate(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Single>* pFld1 = &_fld1)
{
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.ReciprocalEstimate(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(&test._fld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector64<Single> op1, void* result, [CallerMemberName] string method = "")
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Single>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (BitConverter.SingleToInt32Bits(result[i]) != 0x409e8000)
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.ReciprocalEstimate)}<Single>(Vector64<Single>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void ReciprocalEstimate_Vector64_Single()
{
var test = new SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single
{
private struct DataTable
{
private byte[] inArray1;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Single[] inArray1, Single[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Single> _fld1;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = BitConverter.Int32BitsToSingle(0x3e4ed9ed); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
return testStruct;
}
public void RunStructFldScenario(SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single testClass)
{
var result = AdvSimd.ReciprocalEstimate(_fld1);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single testClass)
{
fixed (Vector64<Single>* pFld1 = &_fld1)
{
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(pFld1))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static Single[] _data1 = new Single[Op1ElementCount];
private static Vector64<Single> _clsVar1;
private Vector64<Single> _fld1;
private DataTable _dataTable;
static SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = BitConverter.Int32BitsToSingle(0x3e4ed9ed); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
}
public SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = BitConverter.Int32BitsToSingle(0x3e4ed9ed); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Single>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = BitConverter.Int32BitsToSingle(0x3e4ed9ed); }
_dataTable = new DataTable(_data1, new Single[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.ReciprocalEstimate(
Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.ReciprocalEstimate), new Type[] { typeof(Vector64<Single>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.ReciprocalEstimate), new Type[] { typeof(Vector64<Single>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.ReciprocalEstimate(
_clsVar1
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Single>* pClsVar1 = &_clsVar1)
{
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(pClsVar1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Single>>(_dataTable.inArray1Ptr);
var result = AdvSimd.ReciprocalEstimate(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Single*)(_dataTable.inArray1Ptr));
var result = AdvSimd.ReciprocalEstimate(op1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single();
var result = AdvSimd.ReciprocalEstimate(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleUnaryOpTest__ReciprocalEstimate_Vector64_Single();
fixed (Vector64<Single>* pFld1 = &test._fld1)
{
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.ReciprocalEstimate(_fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Single>* pFld1 = &_fld1)
{
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(pFld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.ReciprocalEstimate(test._fld1);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.ReciprocalEstimate(
AdvSimd.LoadVector64((Single*)(&test._fld1))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector64<Single> op1, void* result, [CallerMemberName] string method = "")
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(void* op1, void* result, [CallerMemberName] string method = "")
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Single>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(inArray1, outArray, method);
}
private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (BitConverter.SingleToInt32Bits(result[i]) != 0x409e8000)
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.ReciprocalEstimate)}<Single>(Vector64<Single>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/libraries/Common/src/Interop/Windows/WinSock/Interop.WSAPROTOCOL_INFOW.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
using System.Net.Sockets;
internal static partial class Interop
{
internal static partial class Winsock
{
public const int SO_PROTOCOL_INFOW = 0x2005;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal unsafe struct WSAPROTOCOL_INFOW
{
private const int WSAPROTOCOL_LEN = 255;
internal uint dwServiceFlags1;
internal uint dwServiceFlags2;
internal uint dwServiceFlags3;
internal uint dwServiceFlags4;
internal uint dwProviderFlags;
internal Guid ProviderId;
internal uint dwCatalogEntryId;
internal WSAPROTOCOLCHAIN ProtocolChain;
internal int iVersion;
internal AddressFamily iAddressFamily;
internal int iMaxSockAddr;
internal int iMinSockAddr;
internal SocketType iSocketType;
internal ProtocolType iProtocol;
internal int iProtocolMaxOffset;
internal int iNetworkByteOrder;
internal int iSecurityScheme;
internal uint dwMessageSize;
internal uint dwProviderReserved;
internal fixed char szProtocol[WSAPROTOCOL_LEN + 1];
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct WSAPROTOCOLCHAIN
{
private const int MAX_PROTOCOL_CHAIN = 7;
internal int ChainLen;
internal fixed uint ChainEntries[MAX_PROTOCOL_CHAIN];
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
using System.Net.Sockets;
internal static partial class Interop
{
internal static partial class Winsock
{
public const int SO_PROTOCOL_INFOW = 0x2005;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
internal unsafe struct WSAPROTOCOL_INFOW
{
private const int WSAPROTOCOL_LEN = 255;
internal uint dwServiceFlags1;
internal uint dwServiceFlags2;
internal uint dwServiceFlags3;
internal uint dwServiceFlags4;
internal uint dwProviderFlags;
internal Guid ProviderId;
internal uint dwCatalogEntryId;
internal WSAPROTOCOLCHAIN ProtocolChain;
internal int iVersion;
internal AddressFamily iAddressFamily;
internal int iMaxSockAddr;
internal int iMinSockAddr;
internal SocketType iSocketType;
internal ProtocolType iProtocol;
internal int iProtocolMaxOffset;
internal int iNetworkByteOrder;
internal int iSecurityScheme;
internal uint dwMessageSize;
internal uint dwProviderReserved;
internal fixed char szProtocol[WSAPROTOCOL_LEN + 1];
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct WSAPROTOCOLCHAIN
{
private const int MAX_PROTOCOL_CHAIN = 7;
internal int ChainLen;
internal fixed uint ChainEntries[MAX_PROTOCOL_CHAIN];
}
}
}
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/JIT/Directed/coverage/oldtests/cse2.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//Testing common sub-expression elimination in random code
using System;
internal unsafe class testout1
{
public static int sa = 2;
public static int sb = 1;
public struct VT_0_1_2_5_2
{
public double a4_0_1_2_5_2;
}
public struct VT_0_1_2_5_1
{
public double a1_0_1_2_5_1;
}
public struct VT_0_1_2_4_3
{
public long a0_0_1_2_4_3;
}
public struct VT_0_1_2_4_2
{
public double a2_0_1_2_4_2;
}
public struct VT_0_1_2_3_2
{
public long a2_0_1_2_3_2;
}
public struct VT_0_1_2_3_1
{
public int a1_0_1_2_3_1;
public long a4_0_1_2_3_1;
}
public struct VT_0_1_2_2_2
{
public double a3_0_1_2_2_2;
}
public struct VT_0_1_2_2_1
{
public long a0_0_1_2_2_1;
public double a1_0_1_2_2_1;
public double a4_0_1_2_2_1;
public long a5_0_1_2_2_1;
}
public struct VT_0_1_2_1_2
{
public int a1_0_1_2_1_2;
public double a4_0_1_2_1_2;
}
public struct VT_0_1_2_1_1
{
public double a0_0_1_2_1_1;
public double a3_0_1_2_1_1;
public double a4_0_1_2_1_1;
}
public struct VT_0_1_2_5
{
public double a1_0_1_2_5;
public double a2_0_1_2_5;
}
public struct VT_0_1_2_3
{
public int a1_0_1_2_3;
public long a2_0_1_2_3;
}
public struct VT_0_1_2_2
{
public double a3_0_1_2_2;
}
public struct VT_0_1_2_1
{
public double a1_0_1_2_1;
public double a3_0_1_2_1;
}
public struct VT_0_1_2
{
public double a0_0_1_2;
}
public struct VT_0_1
{
public float a2_0_1;
public int a3_0_1;
}
public struct VT_0
{
public float a2_0;
public double a3_0;
public double a4_0;
}
public class CL_0_1_2_5_2
{
public long a0_0_1_2_5_2 = -sa * sb;
}
public class CL_0_1_2_5_1
{
public double[,,] arr3d_0_1_2_5_1 = new double[5, 11, 4];
}
public class CL_0_1_2_4_1
{
public long[,,] arr3d_0_1_2_4_1 = new long[5, 11, 4];
public long a1_0_1_2_4_1 = sa + sb;
}
public class CL_0_1_2_3_2
{
public long[,,] arr3d_0_1_2_3_2 = new long[5, 11, 4];
public int[,] arr2d_0_1_2_3_2 = new int[3, 11];
}
public class CL_0_1_2_3_1
{
public long[] arr1d_0_1_2_3_1 = new long[11];
public int[,,] arr3d_0_1_2_3_1 = new int[5, 11, 4];
public int a5_0_1_2_3_1 = -sa / sb;
}
public class CL_0_1_2_2_2
{
public double a4_0_1_2_2_2 = sa - sb;
}
public class CL_0_1_2_2_1
{
public int[,] arr2d_0_1_2_2_1 = new int[3, 11];
}
public class CL_0_1_2_1_2
{
public double a0_0_1_2_1_2 = sa - sb;
}
public class CL_0_1_2_5
{
public int[,] arr2d_0_1_2_5 = new int[3, 11];
}
public class CL_0_1_2_1
{
public long[,] arr2d_0_1_2_1 = new long[3, 11];
}
public class CL_0_1
{
public double a1_0_1 = sa + sb;
}
public static VT_0_1_2_5_2 vtstatic_0_1_2_5_2 = new VT_0_1_2_5_2();
public static VT_0_1_2_4_3 vtstatic_0_1_2_4_3 = new VT_0_1_2_4_3();
public static CL_0_1_2_4_1 clstatic_0_1_2_4_1 = new CL_0_1_2_4_1();
public static VT_0_1_2_3_2 vtstatic_0_1_2_3_2 = new VT_0_1_2_3_2();
private static int s_a2_0_1_2_3_1 = sa / sb;
public static VT_0_1_2_3_1 vtstatic_0_1_2_3_1 = new VT_0_1_2_3_1();
private static double s_a1_0_1_2_2_2 = -sa * sb;
public static VT_0_1_2_2_1 vtstatic_0_1_2_2_1 = new VT_0_1_2_2_1();
public static CL_0_1_2_2_1 clstatic_0_1_2_2_1 = new CL_0_1_2_2_1();
public static VT_0_1_2_5 vtstatic_0_1_2_5 = new VT_0_1_2_5();
public static VT_0_1_2_2 vtstatic_0_1_2_2 = new VT_0_1_2_2();
public static VT_0_1 vtstatic_0_1 = new VT_0_1();
public static VT_0 vtstatic_0 = new VT_0();
public static double Func_0_1_2_5_2(CL_0_1_2_5_2 cl_0_1_2_5_2, double* a5_0_1_2_5_2)
{
double a2_0_1_2_5_2 = sa + sb;
double a3_0_1_2_5_2 = sa - sb;
vtstatic_0_1_2_5_2.a4_0_1_2_5_2 = sa + sb;
double retval_0_1_2_5_2 = Convert.ToDouble((a2_0_1_2_5_2 + ((sa + sb - ((sa - sb + cl_0_1_2_5_2.a0_0_1_2_5_2) / (*a5_0_1_2_5_2))) * (((*a5_0_1_2_5_2) / a3_0_1_2_5_2) + vtstatic_0_1_2_5_2.a4_0_1_2_5_2))));
Console.WriteLine("retval_0_1_2_5_2 is {0}", retval_0_1_2_5_2);
return retval_0_1_2_5_2;
}
public static double Func_0_1_2_5_1(CL_0_1_2_5_1 cl_0_1_2_5_1)
{
VT_0_1_2_5_1 vt_0_1_2_5_1 = new VT_0_1_2_5_1();
vt_0_1_2_5_1.a1_0_1_2_5_1 = sa * sb;
double retval_0_1_2_5_1 = Convert.ToDouble((((vt_0_1_2_5_1.a1_0_1_2_5_1 + -sa * sb) - vt_0_1_2_5_1.a1_0_1_2_5_1) * ((vt_0_1_2_5_1.a1_0_1_2_5_1 * 1.0) + ((vt_0_1_2_5_1.a1_0_1_2_5_1 + cl_0_1_2_5_1.arr3d_0_1_2_5_1[4, 0, 3]) - (-sa * sb)))));
Console.WriteLine("retval_0_1_2_5_1 is {0}", retval_0_1_2_5_1);
return retval_0_1_2_5_1;
}
public static double Func_0_1_2_4_3()
{
int[,] arr2d_0_1_2_4_3 = new int[3, 11];
vtstatic_0_1_2_4_3.a0_0_1_2_4_3 = -sa / sb;
arr2d_0_1_2_4_3[2, 1] = sa / sb;
double retval_0_1_2_4_3 = Convert.ToDouble(((((double)((long)(Convert.ToInt32(arr2d_0_1_2_4_3[2, 1]) + (long)(vtstatic_0_1_2_4_3.a0_0_1_2_4_3)) * 0.25)) + (arr2d_0_1_2_4_3[2, 1] * (0.25 - (-sa / sb)))) - (((-sa / sb + sa + sb) + (-sa + sb * sa * sb)))));
Console.WriteLine("retval_0_1_2_4_3 is {0}", retval_0_1_2_4_3);
return retval_0_1_2_4_3;
}
public static double Func_0_1_2_4_2(VT_0_1_2_4_2 vt_0_1_2_4_2, double a3_0_1_2_4_2)
{
double a0_0_1_2_4_2 = -sa / sb;
double retval_0_1_2_4_2 = Convert.ToDouble(((a0_0_1_2_4_2 + ((a0_0_1_2_4_2 - sa / sb) * a3_0_1_2_4_2)) + ((-sa / sb * ((a3_0_1_2_4_2 - sa / sb) - (vt_0_1_2_4_2.a2_0_1_2_4_2))) + (a0_0_1_2_4_2 + sa / sb))));
Console.WriteLine("retval_0_1_2_4_2 is {0}", retval_0_1_2_4_2);
return retval_0_1_2_4_2;
}
public static long Func_0_1_2_4_1(int[,,] arr3d_0_1_2_4_1)
{
CL_0_1_2_4_1 cl_0_1_2_4_1 = new CL_0_1_2_4_1();
clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3] = -sa % sb;
long retval_0_1_2_4_1 = Convert.ToInt64(((long)(Convert.ToInt32(arr3d_0_1_2_4_1[4, 2, 3]) - (long)((clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3] - cl_0_1_2_4_1.a1_0_1_2_4_1))) + clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3]));
Console.WriteLine("retval_0_1_2_4_1 is {0}", retval_0_1_2_4_1);
return retval_0_1_2_4_1;
}
public static long Func_0_1_2_3_2(int[,] arr2d_0_1_2_3_2, CL_0_1_2_3_2 cl_0_1_2_3_2)
{
vtstatic_0_1_2_3_2.a2_0_1_2_3_2 = -sa * sb;
cl_0_1_2_3_2.arr3d_0_1_2_3_2[4, 0, 3] = sa * sb;
long retval_0_1_2_3_2 = Convert.ToInt64((((long)(((long)(vtstatic_0_1_2_3_2.a2_0_1_2_3_2) * (long)(sa + sb)) / -sa * sb)) - (long)(Convert.ToInt32((Convert.ToInt32((Convert.ToInt32(cl_0_1_2_3_2.arr2d_0_1_2_3_2[2, 4])) % (Convert.ToInt32(arr2d_0_1_2_3_2[2, 1]))))) - (long)(((long)(vtstatic_0_1_2_3_2.a2_0_1_2_3_2 / (vtstatic_0_1_2_3_2.a2_0_1_2_3_2 - cl_0_1_2_3_2.arr3d_0_1_2_3_2[4, 0, 3])))))));
Console.WriteLine("retval_0_1_2_3_2 is {0}", retval_0_1_2_3_2);
return retval_0_1_2_3_2;
}
public static long Func_0_1_2_3_1(CL_0_1_2_3_1 cl_0_1_2_3_1)
{
VT_0_1_2_3_1 vt_0_1_2_3_1 = new VT_0_1_2_3_1();
vt_0_1_2_3_1.a1_0_1_2_3_1 = -sa / sb;
vt_0_1_2_3_1.a4_0_1_2_3_1 = sa + sb + sa / sb;
vtstatic_0_1_2_3_1.a1_0_1_2_3_1 = -sa / sb;
vtstatic_0_1_2_3_1.a4_0_1_2_3_1 = sa + sb;
cl_0_1_2_3_1.arr1d_0_1_2_3_1[0] = sa / sb;
long retval_0_1_2_3_1 = Convert.ToInt64((long)(Convert.ToInt32(((Convert.ToInt32((Convert.ToInt32(cl_0_1_2_3_1.arr3d_0_1_2_3_1[4, 3, 3])) % (Convert.ToInt32(s_a2_0_1_2_3_1)))) + cl_0_1_2_3_1.a5_0_1_2_3_1)) + (long)((long)(Convert.ToInt32(((cl_0_1_2_3_1.a5_0_1_2_3_1 + 0) - ((Convert.ToInt32((Convert.ToInt32(vt_0_1_2_3_1.a1_0_1_2_3_1)) % (Convert.ToInt32(sa + sb))))))) + (long)((vtstatic_0_1_2_3_1.a4_0_1_2_3_1 - cl_0_1_2_3_1.arr1d_0_1_2_3_1[0]))))));
Console.WriteLine("retval_0_1_2_3_1 is {0}", retval_0_1_2_3_1);
return retval_0_1_2_3_1;
}
public static double Func_0_1_2_2_2(int[,] arr2d_0_1_2_2_2, VT_0_1_2_2_2 vt_0_1_2_2_2, CL_0_1_2_2_2 cl_0_1_2_2_2)
{
double retval_0_1_2_2_2 = Convert.ToDouble(((-sa * sb * (cl_0_1_2_2_2.a4_0_1_2_2_2 + (cl_0_1_2_2_2.a4_0_1_2_2_2 - (vt_0_1_2_2_2.a3_0_1_2_2_2)))) - ((arr2d_0_1_2_2_2[2, 0] - (Convert.ToInt32(arr2d_0_1_2_2_2[2, 0] * sa * sb))) / (-sa * sb / s_a1_0_1_2_2_2))));
Console.WriteLine("retval_0_1_2_2_2 is {0}", retval_0_1_2_2_2);
return retval_0_1_2_2_2;
}
public static double Func_0_1_2_2_1(VT_0_1_2_2_1 vt_0_1_2_2_1)
{
vtstatic_0_1_2_2_1.a0_0_1_2_2_1 = -sa + sb;
vtstatic_0_1_2_2_1.a1_0_1_2_2_1 = sa + sb * sb;
vtstatic_0_1_2_2_1.a4_0_1_2_2_1 = sb * sa + sb * sa;
vtstatic_0_1_2_2_1.a5_0_1_2_2_1 = sa - sb * sb;
clstatic_0_1_2_2_1.arr2d_0_1_2_2_1[2, 3] = sa * sb - sb;
double retval_0_1_2_2_1 = Convert.ToDouble((((sa + sb * sb - vtstatic_0_1_2_2_1.a1_0_1_2_2_1) + ((vtstatic_0_1_2_2_1.a1_0_1_2_2_1 + 0.0) / (20.0 - (sb * sa + sb * sa)))) - (((double)(((long)(vtstatic_0_1_2_2_1.a0_0_1_2_2_1 / (vtstatic_0_1_2_2_1.a0_0_1_2_2_1 + vt_0_1_2_2_1.a5_0_1_2_2_1 + sa - sb))) * (clstatic_0_1_2_2_1.arr2d_0_1_2_2_1[2, 3] * vtstatic_0_1_2_2_1.a4_0_1_2_2_1))))));
Console.WriteLine("retval_0_1_2_2_1 is {0}", retval_0_1_2_2_1);
return retval_0_1_2_2_1;
}
public static double Func_0_1_2_1_2(VT_0_1_2_1_2 vt_0_1_2_1_2)
{
CL_0_1_2_1_2 cl_0_1_2_1_2 = new CL_0_1_2_1_2();
double retval_0_1_2_1_2 = Convert.ToDouble(((vt_0_1_2_1_2.a1_0_1_2_1_2 / (cl_0_1_2_1_2.a0_0_1_2_1_2 - (vt_0_1_2_1_2.a4_0_1_2_1_2))) - cl_0_1_2_1_2.a0_0_1_2_1_2));
Console.WriteLine("retval_0_1_2_1_2 is {0}", retval_0_1_2_1_2);
return retval_0_1_2_1_2;
}
public static double Func_0_1_2_1_1()
{
VT_0_1_2_1_1 vt_0_1_2_1_1 = new VT_0_1_2_1_1();
vt_0_1_2_1_1.a0_0_1_2_1_1 = (sa + sb) * (sa + sb);
vt_0_1_2_1_1.a3_0_1_2_1_1 = -(sa + sb) / (sa - sb);
vt_0_1_2_1_1.a4_0_1_2_1_1 = -(sa + sb) / (sa * sb);
double retval_0_1_2_1_1 = Convert.ToDouble((((vt_0_1_2_1_1.a3_0_1_2_1_1 - vt_0_1_2_1_1.a0_0_1_2_1_1) + vt_0_1_2_1_1.a3_0_1_2_1_1) - ((vt_0_1_2_1_1.a3_0_1_2_1_1 - vt_0_1_2_1_1.a0_0_1_2_1_1) - ((vt_0_1_2_1_1.a0_0_1_2_1_1 + vt_0_1_2_1_1.a4_0_1_2_1_1)))));
Console.WriteLine("retval_0_1_2_1_1 is {0}", retval_0_1_2_1_1);
return retval_0_1_2_1_1;
}
public static double Func_0_1_2_5(CL_0_1_2_5 cl_0_1_2_5)
{
VT_0_1_2_5 vt_0_1_2_5 = new VT_0_1_2_5();
vt_0_1_2_5.a1_0_1_2_5 = sa - sb;
vt_0_1_2_5.a2_0_1_2_5 = sa * sb;
vtstatic_0_1_2_5.a1_0_1_2_5 = sa - sb;
vtstatic_0_1_2_5.a2_0_1_2_5 = sa - sb;
CL_0_1_2_5_2 cl_0_1_2_5_2 = new CL_0_1_2_5_2();
double* a5_0_1_2_5_2 = stackalloc double[1];
*a5_0_1_2_5_2 = sa * sb;
double val_0_1_2_5_2 = Func_0_1_2_5_2(cl_0_1_2_5_2, a5_0_1_2_5_2);
CL_0_1_2_5_1 cl_0_1_2_5_1 = new CL_0_1_2_5_1();
cl_0_1_2_5_1.arr3d_0_1_2_5_1[4, 0, 3] = sa * sb;
double val_0_1_2_5_1 = Func_0_1_2_5_1(cl_0_1_2_5_1);
double retval_0_1_2_5 = Convert.ToDouble(((Convert.ToInt32((cl_0_1_2_5.arr2d_0_1_2_5[2, 0] * vt_0_1_2_5.a1_0_1_2_5) - (vtstatic_0_1_2_5.a2_0_1_2_5 + (vtstatic_0_1_2_5.a2_0_1_2_5 + (vtstatic_0_1_2_5.a2_0_1_2_5 + val_0_1_2_5_2))))) * val_0_1_2_5_1));
Console.WriteLine("retval_0_1_2_5 is {0}", retval_0_1_2_5);
return retval_0_1_2_5;
}
public static long Func_0_1_2_4(long* a0_0_1_2_4)
{
double val_0_1_2_4_3 = Func_0_1_2_4_3();
VT_0_1_2_4_2 vt_0_1_2_4_2 = new VT_0_1_2_4_2();
vt_0_1_2_4_2.a2_0_1_2_4_2 = -sa * sb;
double a3_0_1_2_4_2 = -sa * sb;
double val_0_1_2_4_2 = Func_0_1_2_4_2(vt_0_1_2_4_2, a3_0_1_2_4_2);
int[,,] arr3d_0_1_2_4_1 = new int[5, 11, 4];
arr3d_0_1_2_4_1[4, 2, 3] = sa * sb;
long val_0_1_2_4_1 = Func_0_1_2_4_1(arr3d_0_1_2_4_1);
long retval_0_1_2_4 = Convert.ToInt64((long)(Convert.ToInt32((Convert.ToInt32(((*a0_0_1_2_4) / val_0_1_2_4_3) + val_0_1_2_4_2))) - (long)(val_0_1_2_4_1)));
Console.WriteLine("retval_0_1_2_4 is {0}", retval_0_1_2_4);
return retval_0_1_2_4;
}
public static int Func_0_1_2_3()
{
VT_0_1_2_3 vt_0_1_2_3 = new VT_0_1_2_3();
vt_0_1_2_3.a1_0_1_2_3 = -sa - sb;
vt_0_1_2_3.a2_0_1_2_3 = sa + sb;
long[,] arr2d_0_1_2_3 = new long[3, 11];
int a3_0_1_2_3 = sa / sb;
arr2d_0_1_2_3[2, 0] = sa / sb;
CL_0_1_2_3_2 cl_0_1_2_3_2 = new CL_0_1_2_3_2();
int[,] arr2d_0_1_2_3_2 = new int[3, 11];
arr2d_0_1_2_3_2[2, 1] = sa + sb;
cl_0_1_2_3_2.arr2d_0_1_2_3_2[2, 4] = sa - sb;
long val_0_1_2_3_2 = Func_0_1_2_3_2(arr2d_0_1_2_3_2, cl_0_1_2_3_2);
CL_0_1_2_3_1 cl_0_1_2_3_1 = new CL_0_1_2_3_1();
cl_0_1_2_3_1.arr3d_0_1_2_3_1[4, 3, 3] = sa - sb;
long val_0_1_2_3_1 = Func_0_1_2_3_1(cl_0_1_2_3_1);
int retval_0_1_2_3 = Convert.ToInt32((Convert.ToInt32((long)((long)(Convert.ToInt32((a3_0_1_2_3 - (vt_0_1_2_3.a1_0_1_2_3))) + (long)((long)(Convert.ToInt32((Convert.ToInt32((long)(arr2d_0_1_2_3[2, 0]) - (long)(val_0_1_2_3_2)))) + (long)(arr2d_0_1_2_3[2, 0]))))) - (long)((long)(Convert.ToInt32(((sa + sb) / vt_0_1_2_3.a2_0_1_2_3)) - (long)(val_0_1_2_3_1))))));
Console.WriteLine("retval_0_1_2_3 is {0}", retval_0_1_2_3);
return retval_0_1_2_3;
}
public static long Func_0_1_2_2(long[,] arr2d_0_1_2_2)
{
vtstatic_0_1_2_2.a3_0_1_2_2 = -(sa - sb);
VT_0_1_2_2_2 vt_0_1_2_2_2 = new VT_0_1_2_2_2();
vt_0_1_2_2_2.a3_0_1_2_2_2 = -sa / sb;
CL_0_1_2_2_2 cl_0_1_2_2_2 = new CL_0_1_2_2_2();
int[,] arr2d_0_1_2_2_2 = new int[3, 11];
arr2d_0_1_2_2_2[2, 0] = sa - sb;
double val_0_1_2_2_2 = Func_0_1_2_2_2(arr2d_0_1_2_2_2, vt_0_1_2_2_2, cl_0_1_2_2_2);
VT_0_1_2_2_1 vt_0_1_2_2_1 = new VT_0_1_2_2_1();
vt_0_1_2_2_1.a0_0_1_2_2_1 = -sa / sb;
vt_0_1_2_2_1.a1_0_1_2_2_1 = sa / sb;
vt_0_1_2_2_1.a4_0_1_2_2_1 = sa - sb;
vt_0_1_2_2_1.a5_0_1_2_2_1 = sa - sb;
double val_0_1_2_2_1 = Func_0_1_2_2_1(vt_0_1_2_2_1);
long retval_0_1_2_2 = Convert.ToInt64(((long)(Convert.ToInt32((Convert.ToInt32((val_0_1_2_2_1 - (val_0_1_2_2_2)) + vtstatic_0_1_2_2.a3_0_1_2_2))) - (long)(arr2d_0_1_2_2[2, 0])) - arr2d_0_1_2_2[2, 1]));
Console.WriteLine("retval_0_1_2_2 is {0}", retval_0_1_2_2);
return retval_0_1_2_2;
}
public static double Func_0_1_2_1(CL_0_1_2_1 cl_0_1_2_1, VT_0_1_2_1 vt_0_1_2_1)
{
VT_0_1_2_1_2 vt_0_1_2_1_2 = new VT_0_1_2_1_2();
vt_0_1_2_1_2.a1_0_1_2_1_2 = 1;
vt_0_1_2_1_2.a4_0_1_2_1_2 = -(sa / sb);
double val_0_1_2_1_2 = Func_0_1_2_1_2(vt_0_1_2_1_2);
double val_0_1_2_1_1 = Func_0_1_2_1_1();
double retval_0_1_2_1 = Convert.ToDouble(((((vt_0_1_2_1.a1_0_1_2_1 + ((double)(cl_0_1_2_1.arr2d_0_1_2_1[2, 0] * (sa / sb)))) * vt_0_1_2_1.a1_0_1_2_1) + val_0_1_2_1_1) / (((double)(cl_0_1_2_1.arr2d_0_1_2_1[2, 0] * val_0_1_2_1_2)) - (vt_0_1_2_1.a3_0_1_2_1))));
Console.WriteLine("retval_0_1_2_1 is {0}", retval_0_1_2_1);
return retval_0_1_2_1;
}
public static long Func_0_1_2(VT_0_1_2 vt_0_1_2)
{
CL_0_1_2_5 cl_0_1_2_5 = new CL_0_1_2_5();
cl_0_1_2_5.arr2d_0_1_2_5[2, 0] = sa * sb;
double val_0_1_2_5 = Func_0_1_2_5(cl_0_1_2_5);
long* a0_0_1_2_4 = stackalloc long[1];
*a0_0_1_2_4 = sa + sb;
long val_0_1_2_4 = Func_0_1_2_4(a0_0_1_2_4);
int val_0_1_2_3 = Func_0_1_2_3();
long[,] arr2d_0_1_2_2 = new long[3, 11];
arr2d_0_1_2_2[2, 0] = -sa * sb;
arr2d_0_1_2_2[2, 1] = sa * (sa + sb);
long val_0_1_2_2 = Func_0_1_2_2(arr2d_0_1_2_2);
VT_0_1_2_1 vt_0_1_2_1 = new VT_0_1_2_1();
vt_0_1_2_1.a1_0_1_2_1 = -(sa * sb);
vt_0_1_2_1.a3_0_1_2_1 = -sa + sb;
CL_0_1_2_1 cl_0_1_2_1 = new CL_0_1_2_1();
cl_0_1_2_1.arr2d_0_1_2_1[2, 0] = 2L;
double val_0_1_2_1 = Func_0_1_2_1(cl_0_1_2_1, vt_0_1_2_1);
long retval_0_1_2 = Convert.ToInt64((long)(Convert.ToInt32((Convert.ToInt32(val_0_1_2_5 - ((val_0_1_2_3 * vt_0_1_2.a0_0_1_2))))) + (long)((((long)((long)(Convert.ToInt32(sa + sb) - (long)(val_0_1_2_2)) / val_0_1_2_1)) + val_0_1_2_4))));
Console.WriteLine("retval_0_1_2 is {0}", retval_0_1_2);
return retval_0_1_2;
}
public static double Func_0_1_1()
{
double[,] arr2d_0_1_1 = new double[3, 11];
arr2d_0_1_1[2, 0] = 0.0;
double retval_0_1_1 = Convert.ToDouble(arr2d_0_1_1[2, 0]);
Console.WriteLine("retval_0_1_1 is {0}", retval_0_1_1);
return retval_0_1_1;
}
public static double Func_0_1(long[] arr1d_0_1, VT_0_1 vt_0_1)
{
CL_0_1 cl_0_1 = new CL_0_1();
vtstatic_0_1.a2_0_1 = sa + sb;
vtstatic_0_1.a3_0_1 = sa + sb;
VT_0_1_2 vt_0_1_2 = new VT_0_1_2();
vt_0_1_2.a0_0_1_2 = -(sa + sb);
long val_0_1_2 = Func_0_1_2(vt_0_1_2);
double val_0_1_1 = Func_0_1_1();
double retval_0_1 = Convert.ToDouble((((((long)(val_0_1_2 / arr1d_0_1[0])) / (vtstatic_0_1.a3_0_1 * (sa + sb))) + val_0_1_1) * ((vt_0_1.a2_0_1 * (sa + sb)) * (cl_0_1.a1_0_1 - ((arr1d_0_1[0] / -(sa + sb)))))));
Console.WriteLine("retval_0_1 is {0}", retval_0_1);
return retval_0_1;
}
public static int Func_0(double[,] arr2d_0, VT_0 vt_0)
{
vtstatic_0.a2_0 = sa / sb;
vtstatic_0.a3_0 = sa - sb;
vtstatic_0.a4_0 = sa - sb;
VT_0_1 vt_0_1 = new VT_0_1();
vt_0_1.a2_0_1 = sa + sb;
vt_0_1.a3_0_1 = sa / sb;
long[] arr1d_0_1 = new long[11];
arr1d_0_1[0] = 2L;
double val_0_1 = Func_0_1(arr1d_0_1, vt_0_1);
int retval_0 = Convert.ToInt32((Convert.ToInt32((Convert.ToInt32((val_0_1 - vtstatic_0.a3_0) + (vtstatic_0.a3_0 + (sa * sb)))) * (vtstatic_0.a4_0 / (((vt_0.a2_0 - (sb - sa)) * (vtstatic_0.a4_0 * sa * sb)) - (arr2d_0[2, 0]))))));
Console.WriteLine("retval_0 is {0}", retval_0);
return retval_0;
}
public static int Main()
{
sa = 10;
sb = 5;
vtstatic_0.a2_0 = sa + sb;
vtstatic_0.a3_0 = sa * sb;
vtstatic_0.a4_0 = sa - sb;
VT_0 vt_0 = new VT_0();
vt_0.a2_0 = sa * sb;
vt_0.a3_0 = sa + sb;
vt_0.a4_0 = sa - sb;
double[,] arr2d_0 = new double[3, 11];
arr2d_0[2, 0] = sa * sb;
int retval;
retval = Func_0(arr2d_0, vt_0);
if (retval != 4858)
{
Console.WriteLine("FAILED");
return 1;
}
else
{
Console.WriteLine("PASSED");
return 100;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//Testing common sub-expression elimination in random code
using System;
internal unsafe class testout1
{
public static int sa = 2;
public static int sb = 1;
public struct VT_0_1_2_5_2
{
public double a4_0_1_2_5_2;
}
public struct VT_0_1_2_5_1
{
public double a1_0_1_2_5_1;
}
public struct VT_0_1_2_4_3
{
public long a0_0_1_2_4_3;
}
public struct VT_0_1_2_4_2
{
public double a2_0_1_2_4_2;
}
public struct VT_0_1_2_3_2
{
public long a2_0_1_2_3_2;
}
public struct VT_0_1_2_3_1
{
public int a1_0_1_2_3_1;
public long a4_0_1_2_3_1;
}
public struct VT_0_1_2_2_2
{
public double a3_0_1_2_2_2;
}
public struct VT_0_1_2_2_1
{
public long a0_0_1_2_2_1;
public double a1_0_1_2_2_1;
public double a4_0_1_2_2_1;
public long a5_0_1_2_2_1;
}
public struct VT_0_1_2_1_2
{
public int a1_0_1_2_1_2;
public double a4_0_1_2_1_2;
}
public struct VT_0_1_2_1_1
{
public double a0_0_1_2_1_1;
public double a3_0_1_2_1_1;
public double a4_0_1_2_1_1;
}
public struct VT_0_1_2_5
{
public double a1_0_1_2_5;
public double a2_0_1_2_5;
}
public struct VT_0_1_2_3
{
public int a1_0_1_2_3;
public long a2_0_1_2_3;
}
public struct VT_0_1_2_2
{
public double a3_0_1_2_2;
}
public struct VT_0_1_2_1
{
public double a1_0_1_2_1;
public double a3_0_1_2_1;
}
public struct VT_0_1_2
{
public double a0_0_1_2;
}
public struct VT_0_1
{
public float a2_0_1;
public int a3_0_1;
}
public struct VT_0
{
public float a2_0;
public double a3_0;
public double a4_0;
}
public class CL_0_1_2_5_2
{
public long a0_0_1_2_5_2 = -sa * sb;
}
public class CL_0_1_2_5_1
{
public double[,,] arr3d_0_1_2_5_1 = new double[5, 11, 4];
}
public class CL_0_1_2_4_1
{
public long[,,] arr3d_0_1_2_4_1 = new long[5, 11, 4];
public long a1_0_1_2_4_1 = sa + sb;
}
public class CL_0_1_2_3_2
{
public long[,,] arr3d_0_1_2_3_2 = new long[5, 11, 4];
public int[,] arr2d_0_1_2_3_2 = new int[3, 11];
}
public class CL_0_1_2_3_1
{
public long[] arr1d_0_1_2_3_1 = new long[11];
public int[,,] arr3d_0_1_2_3_1 = new int[5, 11, 4];
public int a5_0_1_2_3_1 = -sa / sb;
}
public class CL_0_1_2_2_2
{
public double a4_0_1_2_2_2 = sa - sb;
}
public class CL_0_1_2_2_1
{
public int[,] arr2d_0_1_2_2_1 = new int[3, 11];
}
public class CL_0_1_2_1_2
{
public double a0_0_1_2_1_2 = sa - sb;
}
public class CL_0_1_2_5
{
public int[,] arr2d_0_1_2_5 = new int[3, 11];
}
public class CL_0_1_2_1
{
public long[,] arr2d_0_1_2_1 = new long[3, 11];
}
public class CL_0_1
{
public double a1_0_1 = sa + sb;
}
public static VT_0_1_2_5_2 vtstatic_0_1_2_5_2 = new VT_0_1_2_5_2();
public static VT_0_1_2_4_3 vtstatic_0_1_2_4_3 = new VT_0_1_2_4_3();
public static CL_0_1_2_4_1 clstatic_0_1_2_4_1 = new CL_0_1_2_4_1();
public static VT_0_1_2_3_2 vtstatic_0_1_2_3_2 = new VT_0_1_2_3_2();
private static int s_a2_0_1_2_3_1 = sa / sb;
public static VT_0_1_2_3_1 vtstatic_0_1_2_3_1 = new VT_0_1_2_3_1();
private static double s_a1_0_1_2_2_2 = -sa * sb;
public static VT_0_1_2_2_1 vtstatic_0_1_2_2_1 = new VT_0_1_2_2_1();
public static CL_0_1_2_2_1 clstatic_0_1_2_2_1 = new CL_0_1_2_2_1();
public static VT_0_1_2_5 vtstatic_0_1_2_5 = new VT_0_1_2_5();
public static VT_0_1_2_2 vtstatic_0_1_2_2 = new VT_0_1_2_2();
public static VT_0_1 vtstatic_0_1 = new VT_0_1();
public static VT_0 vtstatic_0 = new VT_0();
public static double Func_0_1_2_5_2(CL_0_1_2_5_2 cl_0_1_2_5_2, double* a5_0_1_2_5_2)
{
double a2_0_1_2_5_2 = sa + sb;
double a3_0_1_2_5_2 = sa - sb;
vtstatic_0_1_2_5_2.a4_0_1_2_5_2 = sa + sb;
double retval_0_1_2_5_2 = Convert.ToDouble((a2_0_1_2_5_2 + ((sa + sb - ((sa - sb + cl_0_1_2_5_2.a0_0_1_2_5_2) / (*a5_0_1_2_5_2))) * (((*a5_0_1_2_5_2) / a3_0_1_2_5_2) + vtstatic_0_1_2_5_2.a4_0_1_2_5_2))));
Console.WriteLine("retval_0_1_2_5_2 is {0}", retval_0_1_2_5_2);
return retval_0_1_2_5_2;
}
public static double Func_0_1_2_5_1(CL_0_1_2_5_1 cl_0_1_2_5_1)
{
VT_0_1_2_5_1 vt_0_1_2_5_1 = new VT_0_1_2_5_1();
vt_0_1_2_5_1.a1_0_1_2_5_1 = sa * sb;
double retval_0_1_2_5_1 = Convert.ToDouble((((vt_0_1_2_5_1.a1_0_1_2_5_1 + -sa * sb) - vt_0_1_2_5_1.a1_0_1_2_5_1) * ((vt_0_1_2_5_1.a1_0_1_2_5_1 * 1.0) + ((vt_0_1_2_5_1.a1_0_1_2_5_1 + cl_0_1_2_5_1.arr3d_0_1_2_5_1[4, 0, 3]) - (-sa * sb)))));
Console.WriteLine("retval_0_1_2_5_1 is {0}", retval_0_1_2_5_1);
return retval_0_1_2_5_1;
}
public static double Func_0_1_2_4_3()
{
int[,] arr2d_0_1_2_4_3 = new int[3, 11];
vtstatic_0_1_2_4_3.a0_0_1_2_4_3 = -sa / sb;
arr2d_0_1_2_4_3[2, 1] = sa / sb;
double retval_0_1_2_4_3 = Convert.ToDouble(((((double)((long)(Convert.ToInt32(arr2d_0_1_2_4_3[2, 1]) + (long)(vtstatic_0_1_2_4_3.a0_0_1_2_4_3)) * 0.25)) + (arr2d_0_1_2_4_3[2, 1] * (0.25 - (-sa / sb)))) - (((-sa / sb + sa + sb) + (-sa + sb * sa * sb)))));
Console.WriteLine("retval_0_1_2_4_3 is {0}", retval_0_1_2_4_3);
return retval_0_1_2_4_3;
}
public static double Func_0_1_2_4_2(VT_0_1_2_4_2 vt_0_1_2_4_2, double a3_0_1_2_4_2)
{
double a0_0_1_2_4_2 = -sa / sb;
double retval_0_1_2_4_2 = Convert.ToDouble(((a0_0_1_2_4_2 + ((a0_0_1_2_4_2 - sa / sb) * a3_0_1_2_4_2)) + ((-sa / sb * ((a3_0_1_2_4_2 - sa / sb) - (vt_0_1_2_4_2.a2_0_1_2_4_2))) + (a0_0_1_2_4_2 + sa / sb))));
Console.WriteLine("retval_0_1_2_4_2 is {0}", retval_0_1_2_4_2);
return retval_0_1_2_4_2;
}
public static long Func_0_1_2_4_1(int[,,] arr3d_0_1_2_4_1)
{
CL_0_1_2_4_1 cl_0_1_2_4_1 = new CL_0_1_2_4_1();
clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3] = -sa % sb;
long retval_0_1_2_4_1 = Convert.ToInt64(((long)(Convert.ToInt32(arr3d_0_1_2_4_1[4, 2, 3]) - (long)((clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3] - cl_0_1_2_4_1.a1_0_1_2_4_1))) + clstatic_0_1_2_4_1.arr3d_0_1_2_4_1[4, 0, 3]));
Console.WriteLine("retval_0_1_2_4_1 is {0}", retval_0_1_2_4_1);
return retval_0_1_2_4_1;
}
public static long Func_0_1_2_3_2(int[,] arr2d_0_1_2_3_2, CL_0_1_2_3_2 cl_0_1_2_3_2)
{
vtstatic_0_1_2_3_2.a2_0_1_2_3_2 = -sa * sb;
cl_0_1_2_3_2.arr3d_0_1_2_3_2[4, 0, 3] = sa * sb;
long retval_0_1_2_3_2 = Convert.ToInt64((((long)(((long)(vtstatic_0_1_2_3_2.a2_0_1_2_3_2) * (long)(sa + sb)) / -sa * sb)) - (long)(Convert.ToInt32((Convert.ToInt32((Convert.ToInt32(cl_0_1_2_3_2.arr2d_0_1_2_3_2[2, 4])) % (Convert.ToInt32(arr2d_0_1_2_3_2[2, 1]))))) - (long)(((long)(vtstatic_0_1_2_3_2.a2_0_1_2_3_2 / (vtstatic_0_1_2_3_2.a2_0_1_2_3_2 - cl_0_1_2_3_2.arr3d_0_1_2_3_2[4, 0, 3])))))));
Console.WriteLine("retval_0_1_2_3_2 is {0}", retval_0_1_2_3_2);
return retval_0_1_2_3_2;
}
public static long Func_0_1_2_3_1(CL_0_1_2_3_1 cl_0_1_2_3_1)
{
VT_0_1_2_3_1 vt_0_1_2_3_1 = new VT_0_1_2_3_1();
vt_0_1_2_3_1.a1_0_1_2_3_1 = -sa / sb;
vt_0_1_2_3_1.a4_0_1_2_3_1 = sa + sb + sa / sb;
vtstatic_0_1_2_3_1.a1_0_1_2_3_1 = -sa / sb;
vtstatic_0_1_2_3_1.a4_0_1_2_3_1 = sa + sb;
cl_0_1_2_3_1.arr1d_0_1_2_3_1[0] = sa / sb;
long retval_0_1_2_3_1 = Convert.ToInt64((long)(Convert.ToInt32(((Convert.ToInt32((Convert.ToInt32(cl_0_1_2_3_1.arr3d_0_1_2_3_1[4, 3, 3])) % (Convert.ToInt32(s_a2_0_1_2_3_1)))) + cl_0_1_2_3_1.a5_0_1_2_3_1)) + (long)((long)(Convert.ToInt32(((cl_0_1_2_3_1.a5_0_1_2_3_1 + 0) - ((Convert.ToInt32((Convert.ToInt32(vt_0_1_2_3_1.a1_0_1_2_3_1)) % (Convert.ToInt32(sa + sb))))))) + (long)((vtstatic_0_1_2_3_1.a4_0_1_2_3_1 - cl_0_1_2_3_1.arr1d_0_1_2_3_1[0]))))));
Console.WriteLine("retval_0_1_2_3_1 is {0}", retval_0_1_2_3_1);
return retval_0_1_2_3_1;
}
public static double Func_0_1_2_2_2(int[,] arr2d_0_1_2_2_2, VT_0_1_2_2_2 vt_0_1_2_2_2, CL_0_1_2_2_2 cl_0_1_2_2_2)
{
double retval_0_1_2_2_2 = Convert.ToDouble(((-sa * sb * (cl_0_1_2_2_2.a4_0_1_2_2_2 + (cl_0_1_2_2_2.a4_0_1_2_2_2 - (vt_0_1_2_2_2.a3_0_1_2_2_2)))) - ((arr2d_0_1_2_2_2[2, 0] - (Convert.ToInt32(arr2d_0_1_2_2_2[2, 0] * sa * sb))) / (-sa * sb / s_a1_0_1_2_2_2))));
Console.WriteLine("retval_0_1_2_2_2 is {0}", retval_0_1_2_2_2);
return retval_0_1_2_2_2;
}
public static double Func_0_1_2_2_1(VT_0_1_2_2_1 vt_0_1_2_2_1)
{
vtstatic_0_1_2_2_1.a0_0_1_2_2_1 = -sa + sb;
vtstatic_0_1_2_2_1.a1_0_1_2_2_1 = sa + sb * sb;
vtstatic_0_1_2_2_1.a4_0_1_2_2_1 = sb * sa + sb * sa;
vtstatic_0_1_2_2_1.a5_0_1_2_2_1 = sa - sb * sb;
clstatic_0_1_2_2_1.arr2d_0_1_2_2_1[2, 3] = sa * sb - sb;
double retval_0_1_2_2_1 = Convert.ToDouble((((sa + sb * sb - vtstatic_0_1_2_2_1.a1_0_1_2_2_1) + ((vtstatic_0_1_2_2_1.a1_0_1_2_2_1 + 0.0) / (20.0 - (sb * sa + sb * sa)))) - (((double)(((long)(vtstatic_0_1_2_2_1.a0_0_1_2_2_1 / (vtstatic_0_1_2_2_1.a0_0_1_2_2_1 + vt_0_1_2_2_1.a5_0_1_2_2_1 + sa - sb))) * (clstatic_0_1_2_2_1.arr2d_0_1_2_2_1[2, 3] * vtstatic_0_1_2_2_1.a4_0_1_2_2_1))))));
Console.WriteLine("retval_0_1_2_2_1 is {0}", retval_0_1_2_2_1);
return retval_0_1_2_2_1;
}
public static double Func_0_1_2_1_2(VT_0_1_2_1_2 vt_0_1_2_1_2)
{
CL_0_1_2_1_2 cl_0_1_2_1_2 = new CL_0_1_2_1_2();
double retval_0_1_2_1_2 = Convert.ToDouble(((vt_0_1_2_1_2.a1_0_1_2_1_2 / (cl_0_1_2_1_2.a0_0_1_2_1_2 - (vt_0_1_2_1_2.a4_0_1_2_1_2))) - cl_0_1_2_1_2.a0_0_1_2_1_2));
Console.WriteLine("retval_0_1_2_1_2 is {0}", retval_0_1_2_1_2);
return retval_0_1_2_1_2;
}
public static double Func_0_1_2_1_1()
{
VT_0_1_2_1_1 vt_0_1_2_1_1 = new VT_0_1_2_1_1();
vt_0_1_2_1_1.a0_0_1_2_1_1 = (sa + sb) * (sa + sb);
vt_0_1_2_1_1.a3_0_1_2_1_1 = -(sa + sb) / (sa - sb);
vt_0_1_2_1_1.a4_0_1_2_1_1 = -(sa + sb) / (sa * sb);
double retval_0_1_2_1_1 = Convert.ToDouble((((vt_0_1_2_1_1.a3_0_1_2_1_1 - vt_0_1_2_1_1.a0_0_1_2_1_1) + vt_0_1_2_1_1.a3_0_1_2_1_1) - ((vt_0_1_2_1_1.a3_0_1_2_1_1 - vt_0_1_2_1_1.a0_0_1_2_1_1) - ((vt_0_1_2_1_1.a0_0_1_2_1_1 + vt_0_1_2_1_1.a4_0_1_2_1_1)))));
Console.WriteLine("retval_0_1_2_1_1 is {0}", retval_0_1_2_1_1);
return retval_0_1_2_1_1;
}
public static double Func_0_1_2_5(CL_0_1_2_5 cl_0_1_2_5)
{
VT_0_1_2_5 vt_0_1_2_5 = new VT_0_1_2_5();
vt_0_1_2_5.a1_0_1_2_5 = sa - sb;
vt_0_1_2_5.a2_0_1_2_5 = sa * sb;
vtstatic_0_1_2_5.a1_0_1_2_5 = sa - sb;
vtstatic_0_1_2_5.a2_0_1_2_5 = sa - sb;
CL_0_1_2_5_2 cl_0_1_2_5_2 = new CL_0_1_2_5_2();
double* a5_0_1_2_5_2 = stackalloc double[1];
*a5_0_1_2_5_2 = sa * sb;
double val_0_1_2_5_2 = Func_0_1_2_5_2(cl_0_1_2_5_2, a5_0_1_2_5_2);
CL_0_1_2_5_1 cl_0_1_2_5_1 = new CL_0_1_2_5_1();
cl_0_1_2_5_1.arr3d_0_1_2_5_1[4, 0, 3] = sa * sb;
double val_0_1_2_5_1 = Func_0_1_2_5_1(cl_0_1_2_5_1);
double retval_0_1_2_5 = Convert.ToDouble(((Convert.ToInt32((cl_0_1_2_5.arr2d_0_1_2_5[2, 0] * vt_0_1_2_5.a1_0_1_2_5) - (vtstatic_0_1_2_5.a2_0_1_2_5 + (vtstatic_0_1_2_5.a2_0_1_2_5 + (vtstatic_0_1_2_5.a2_0_1_2_5 + val_0_1_2_5_2))))) * val_0_1_2_5_1));
Console.WriteLine("retval_0_1_2_5 is {0}", retval_0_1_2_5);
return retval_0_1_2_5;
}
public static long Func_0_1_2_4(long* a0_0_1_2_4)
{
double val_0_1_2_4_3 = Func_0_1_2_4_3();
VT_0_1_2_4_2 vt_0_1_2_4_2 = new VT_0_1_2_4_2();
vt_0_1_2_4_2.a2_0_1_2_4_2 = -sa * sb;
double a3_0_1_2_4_2 = -sa * sb;
double val_0_1_2_4_2 = Func_0_1_2_4_2(vt_0_1_2_4_2, a3_0_1_2_4_2);
int[,,] arr3d_0_1_2_4_1 = new int[5, 11, 4];
arr3d_0_1_2_4_1[4, 2, 3] = sa * sb;
long val_0_1_2_4_1 = Func_0_1_2_4_1(arr3d_0_1_2_4_1);
long retval_0_1_2_4 = Convert.ToInt64((long)(Convert.ToInt32((Convert.ToInt32(((*a0_0_1_2_4) / val_0_1_2_4_3) + val_0_1_2_4_2))) - (long)(val_0_1_2_4_1)));
Console.WriteLine("retval_0_1_2_4 is {0}", retval_0_1_2_4);
return retval_0_1_2_4;
}
public static int Func_0_1_2_3()
{
VT_0_1_2_3 vt_0_1_2_3 = new VT_0_1_2_3();
vt_0_1_2_3.a1_0_1_2_3 = -sa - sb;
vt_0_1_2_3.a2_0_1_2_3 = sa + sb;
long[,] arr2d_0_1_2_3 = new long[3, 11];
int a3_0_1_2_3 = sa / sb;
arr2d_0_1_2_3[2, 0] = sa / sb;
CL_0_1_2_3_2 cl_0_1_2_3_2 = new CL_0_1_2_3_2();
int[,] arr2d_0_1_2_3_2 = new int[3, 11];
arr2d_0_1_2_3_2[2, 1] = sa + sb;
cl_0_1_2_3_2.arr2d_0_1_2_3_2[2, 4] = sa - sb;
long val_0_1_2_3_2 = Func_0_1_2_3_2(arr2d_0_1_2_3_2, cl_0_1_2_3_2);
CL_0_1_2_3_1 cl_0_1_2_3_1 = new CL_0_1_2_3_1();
cl_0_1_2_3_1.arr3d_0_1_2_3_1[4, 3, 3] = sa - sb;
long val_0_1_2_3_1 = Func_0_1_2_3_1(cl_0_1_2_3_1);
int retval_0_1_2_3 = Convert.ToInt32((Convert.ToInt32((long)((long)(Convert.ToInt32((a3_0_1_2_3 - (vt_0_1_2_3.a1_0_1_2_3))) + (long)((long)(Convert.ToInt32((Convert.ToInt32((long)(arr2d_0_1_2_3[2, 0]) - (long)(val_0_1_2_3_2)))) + (long)(arr2d_0_1_2_3[2, 0]))))) - (long)((long)(Convert.ToInt32(((sa + sb) / vt_0_1_2_3.a2_0_1_2_3)) - (long)(val_0_1_2_3_1))))));
Console.WriteLine("retval_0_1_2_3 is {0}", retval_0_1_2_3);
return retval_0_1_2_3;
}
public static long Func_0_1_2_2(long[,] arr2d_0_1_2_2)
{
vtstatic_0_1_2_2.a3_0_1_2_2 = -(sa - sb);
VT_0_1_2_2_2 vt_0_1_2_2_2 = new VT_0_1_2_2_2();
vt_0_1_2_2_2.a3_0_1_2_2_2 = -sa / sb;
CL_0_1_2_2_2 cl_0_1_2_2_2 = new CL_0_1_2_2_2();
int[,] arr2d_0_1_2_2_2 = new int[3, 11];
arr2d_0_1_2_2_2[2, 0] = sa - sb;
double val_0_1_2_2_2 = Func_0_1_2_2_2(arr2d_0_1_2_2_2, vt_0_1_2_2_2, cl_0_1_2_2_2);
VT_0_1_2_2_1 vt_0_1_2_2_1 = new VT_0_1_2_2_1();
vt_0_1_2_2_1.a0_0_1_2_2_1 = -sa / sb;
vt_0_1_2_2_1.a1_0_1_2_2_1 = sa / sb;
vt_0_1_2_2_1.a4_0_1_2_2_1 = sa - sb;
vt_0_1_2_2_1.a5_0_1_2_2_1 = sa - sb;
double val_0_1_2_2_1 = Func_0_1_2_2_1(vt_0_1_2_2_1);
long retval_0_1_2_2 = Convert.ToInt64(((long)(Convert.ToInt32((Convert.ToInt32((val_0_1_2_2_1 - (val_0_1_2_2_2)) + vtstatic_0_1_2_2.a3_0_1_2_2))) - (long)(arr2d_0_1_2_2[2, 0])) - arr2d_0_1_2_2[2, 1]));
Console.WriteLine("retval_0_1_2_2 is {0}", retval_0_1_2_2);
return retval_0_1_2_2;
}
public static double Func_0_1_2_1(CL_0_1_2_1 cl_0_1_2_1, VT_0_1_2_1 vt_0_1_2_1)
{
VT_0_1_2_1_2 vt_0_1_2_1_2 = new VT_0_1_2_1_2();
vt_0_1_2_1_2.a1_0_1_2_1_2 = 1;
vt_0_1_2_1_2.a4_0_1_2_1_2 = -(sa / sb);
double val_0_1_2_1_2 = Func_0_1_2_1_2(vt_0_1_2_1_2);
double val_0_1_2_1_1 = Func_0_1_2_1_1();
double retval_0_1_2_1 = Convert.ToDouble(((((vt_0_1_2_1.a1_0_1_2_1 + ((double)(cl_0_1_2_1.arr2d_0_1_2_1[2, 0] * (sa / sb)))) * vt_0_1_2_1.a1_0_1_2_1) + val_0_1_2_1_1) / (((double)(cl_0_1_2_1.arr2d_0_1_2_1[2, 0] * val_0_1_2_1_2)) - (vt_0_1_2_1.a3_0_1_2_1))));
Console.WriteLine("retval_0_1_2_1 is {0}", retval_0_1_2_1);
return retval_0_1_2_1;
}
public static long Func_0_1_2(VT_0_1_2 vt_0_1_2)
{
CL_0_1_2_5 cl_0_1_2_5 = new CL_0_1_2_5();
cl_0_1_2_5.arr2d_0_1_2_5[2, 0] = sa * sb;
double val_0_1_2_5 = Func_0_1_2_5(cl_0_1_2_5);
long* a0_0_1_2_4 = stackalloc long[1];
*a0_0_1_2_4 = sa + sb;
long val_0_1_2_4 = Func_0_1_2_4(a0_0_1_2_4);
int val_0_1_2_3 = Func_0_1_2_3();
long[,] arr2d_0_1_2_2 = new long[3, 11];
arr2d_0_1_2_2[2, 0] = -sa * sb;
arr2d_0_1_2_2[2, 1] = sa * (sa + sb);
long val_0_1_2_2 = Func_0_1_2_2(arr2d_0_1_2_2);
VT_0_1_2_1 vt_0_1_2_1 = new VT_0_1_2_1();
vt_0_1_2_1.a1_0_1_2_1 = -(sa * sb);
vt_0_1_2_1.a3_0_1_2_1 = -sa + sb;
CL_0_1_2_1 cl_0_1_2_1 = new CL_0_1_2_1();
cl_0_1_2_1.arr2d_0_1_2_1[2, 0] = 2L;
double val_0_1_2_1 = Func_0_1_2_1(cl_0_1_2_1, vt_0_1_2_1);
long retval_0_1_2 = Convert.ToInt64((long)(Convert.ToInt32((Convert.ToInt32(val_0_1_2_5 - ((val_0_1_2_3 * vt_0_1_2.a0_0_1_2))))) + (long)((((long)((long)(Convert.ToInt32(sa + sb) - (long)(val_0_1_2_2)) / val_0_1_2_1)) + val_0_1_2_4))));
Console.WriteLine("retval_0_1_2 is {0}", retval_0_1_2);
return retval_0_1_2;
}
public static double Func_0_1_1()
{
double[,] arr2d_0_1_1 = new double[3, 11];
arr2d_0_1_1[2, 0] = 0.0;
double retval_0_1_1 = Convert.ToDouble(arr2d_0_1_1[2, 0]);
Console.WriteLine("retval_0_1_1 is {0}", retval_0_1_1);
return retval_0_1_1;
}
public static double Func_0_1(long[] arr1d_0_1, VT_0_1 vt_0_1)
{
CL_0_1 cl_0_1 = new CL_0_1();
vtstatic_0_1.a2_0_1 = sa + sb;
vtstatic_0_1.a3_0_1 = sa + sb;
VT_0_1_2 vt_0_1_2 = new VT_0_1_2();
vt_0_1_2.a0_0_1_2 = -(sa + sb);
long val_0_1_2 = Func_0_1_2(vt_0_1_2);
double val_0_1_1 = Func_0_1_1();
double retval_0_1 = Convert.ToDouble((((((long)(val_0_1_2 / arr1d_0_1[0])) / (vtstatic_0_1.a3_0_1 * (sa + sb))) + val_0_1_1) * ((vt_0_1.a2_0_1 * (sa + sb)) * (cl_0_1.a1_0_1 - ((arr1d_0_1[0] / -(sa + sb)))))));
Console.WriteLine("retval_0_1 is {0}", retval_0_1);
return retval_0_1;
}
public static int Func_0(double[,] arr2d_0, VT_0 vt_0)
{
vtstatic_0.a2_0 = sa / sb;
vtstatic_0.a3_0 = sa - sb;
vtstatic_0.a4_0 = sa - sb;
VT_0_1 vt_0_1 = new VT_0_1();
vt_0_1.a2_0_1 = sa + sb;
vt_0_1.a3_0_1 = sa / sb;
long[] arr1d_0_1 = new long[11];
arr1d_0_1[0] = 2L;
double val_0_1 = Func_0_1(arr1d_0_1, vt_0_1);
int retval_0 = Convert.ToInt32((Convert.ToInt32((Convert.ToInt32((val_0_1 - vtstatic_0.a3_0) + (vtstatic_0.a3_0 + (sa * sb)))) * (vtstatic_0.a4_0 / (((vt_0.a2_0 - (sb - sa)) * (vtstatic_0.a4_0 * sa * sb)) - (arr2d_0[2, 0]))))));
Console.WriteLine("retval_0 is {0}", retval_0);
return retval_0;
}
public static int Main()
{
sa = 10;
sb = 5;
vtstatic_0.a2_0 = sa + sb;
vtstatic_0.a3_0 = sa * sb;
vtstatic_0.a4_0 = sa - sb;
VT_0 vt_0 = new VT_0();
vt_0.a2_0 = sa * sb;
vt_0.a3_0 = sa + sb;
vt_0.a4_0 = sa - sb;
double[,] arr2d_0 = new double[3, 11];
arr2d_0[2, 0] = sa * sb;
int retval;
retval = Func_0(arr2d_0, vt_0);
if (retval != 4858)
{
Console.WriteLine("FAILED");
return 1;
}
else
{
Console.WriteLine("PASSED");
return 100;
}
}
}
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/Interop/PInvoke/Generics/GenericsNative.VectorU.cpp
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include <stdio.h>
#include <stdint.h>
#include <xplatform.h>
#include <platformdefines.h>
typedef struct {
uint32_t e00;
uint32_t e01;
uint32_t e02;
uint32_t e03;
} VectorU128;
typedef struct {
uint32_t e00;
uint32_t e01;
uint32_t e02;
uint32_t e03;
uint32_t e04;
uint32_t e05;
uint32_t e06;
uint32_t e07;
} VectorU256;
static VectorU128 VectorU128Value = { };
static VectorU256 VectorU256Value = { };
extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE GetVectorU128(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03)
{
uint32_t value[4] = { e00, e01, e02, e03 };
return *reinterpret_cast<VectorU128*>(value);
}
extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX GetVectorU256(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07)
{
uint32_t value[8] = { e00, e01, e02, e03, e04, e05, e06, e07 };
return *reinterpret_cast<VectorU256*>(value);
}
extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorU128Out(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, VectorU128* pValue)
{
*pValue = GetVectorU128(e00, e01, e02, e03);
}
extern "C" DLL_EXPORT void STDMETHODCALLTYPE ENABLE_AVX GetVectorU256Out(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07, VectorU256* pValue)
{
*pValue = GetVectorU256(e00, e01, e02, e03, e04, e05, e06, e07);
}
extern "C" DLL_EXPORT const VectorU128* STDMETHODCALLTYPE GetVectorU128Ptr(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03)
{
GetVectorU128Out(e00, e01, e02, e03, &VectorU128Value);
return &VectorU128Value;
}
extern "C" DLL_EXPORT const VectorU256* STDMETHODCALLTYPE ENABLE_AVX GetVectorU256Ptr(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07)
{
GetVectorU256Out(e00, e01, e02, e03, e04, e05, e06, e07, &VectorU256Value);
return &VectorU256Value;
}
extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE AddVectorU128(VectorU128 lhs, VectorU128 rhs)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX AddVectorU256(VectorU256 lhs, VectorU256 rhs)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE AddVectorU128s(const VectorU128* pValues, uint32_t count)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX AddVectorU256s(const VectorU256* pValues, uint32_t count)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include <stdio.h>
#include <stdint.h>
#include <xplatform.h>
#include <platformdefines.h>
typedef struct {
uint32_t e00;
uint32_t e01;
uint32_t e02;
uint32_t e03;
} VectorU128;
typedef struct {
uint32_t e00;
uint32_t e01;
uint32_t e02;
uint32_t e03;
uint32_t e04;
uint32_t e05;
uint32_t e06;
uint32_t e07;
} VectorU256;
static VectorU128 VectorU128Value = { };
static VectorU256 VectorU256Value = { };
extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE GetVectorU128(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03)
{
uint32_t value[4] = { e00, e01, e02, e03 };
return *reinterpret_cast<VectorU128*>(value);
}
extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX GetVectorU256(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07)
{
uint32_t value[8] = { e00, e01, e02, e03, e04, e05, e06, e07 };
return *reinterpret_cast<VectorU256*>(value);
}
extern "C" DLL_EXPORT void STDMETHODCALLTYPE GetVectorU128Out(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, VectorU128* pValue)
{
*pValue = GetVectorU128(e00, e01, e02, e03);
}
extern "C" DLL_EXPORT void STDMETHODCALLTYPE ENABLE_AVX GetVectorU256Out(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07, VectorU256* pValue)
{
*pValue = GetVectorU256(e00, e01, e02, e03, e04, e05, e06, e07);
}
extern "C" DLL_EXPORT const VectorU128* STDMETHODCALLTYPE GetVectorU128Ptr(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03)
{
GetVectorU128Out(e00, e01, e02, e03, &VectorU128Value);
return &VectorU128Value;
}
extern "C" DLL_EXPORT const VectorU256* STDMETHODCALLTYPE ENABLE_AVX GetVectorU256Ptr(uint32_t e00, uint32_t e01, uint32_t e02, uint32_t e03, uint32_t e04, uint32_t e05, uint32_t e06, uint32_t e07)
{
GetVectorU256Out(e00, e01, e02, e03, e04, e05, e06, e07, &VectorU256Value);
return &VectorU256Value;
}
extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE AddVectorU128(VectorU128 lhs, VectorU128 rhs)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX AddVectorU256(VectorU256 lhs, VectorU256 rhs)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorU128 STDMETHODCALLTYPE AddVectorU128s(const VectorU128* pValues, uint32_t count)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
extern "C" DLL_EXPORT VectorU256 STDMETHODCALLTYPE ENABLE_AVX AddVectorU256s(const VectorU256* pValues, uint32_t count)
{
throw "P/Invoke for Vector<char> should be unsupported.";
}
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/tests/JIT/HardwareIntrinsics/General/NotSupported/Vector256BooleanAsUInt32.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void Vector256BooleanAsUInt32()
{
bool succeeded = false;
try
{
Vector256<uint> result = default(Vector256<bool>).AsUInt32();
}
catch (NotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"Vector256BooleanAsUInt32: RunNotSupportedScenario failed to throw NotSupportedException.");
TestLibrary.TestFramework.LogInformation(string.Empty);
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\General\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void Vector256BooleanAsUInt32()
{
bool succeeded = false;
try
{
Vector256<uint> result = default(Vector256<bool>).AsUInt32();
}
catch (NotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"Vector256BooleanAsUInt32: RunNotSupportedScenario failed to throw NotSupportedException.");
TestLibrary.TestFramework.LogInformation(string.Empty);
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
}
| -1 |
dotnet/runtime
| 66,375 |
Remove compiler warning suppression 2
|
Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
AaronRobinsonMSFT
| 2022-03-09T03:48:46Z | 2022-03-09T14:10:36Z |
cef825fd5425203ac28d073bf9fccc33c638f179
|
e32f3b61cd41e6a97ebe8f512ff673b63ff40640
|
Remove compiler warning suppression 2. Contributes to https://github.com/dotnet/runtime/issues/66154
Remove 4146 from coreclr
Remove 4302 from all code bases
/cc @GrabYourPitchforks @jkotas @janvorli
|
./src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/PoolingAsyncValueTaskMethodBuilderT.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Sources;
using Internal;
namespace System.Runtime.CompilerServices
{
/// <summary>Represents a builder for asynchronous methods that returns a <see cref="ValueTask{TResult}"/>.</summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
[StructLayout(LayoutKind.Auto)]
public struct PoolingAsyncValueTaskMethodBuilder<TResult>
{
/// <summary>Sentinel object used to indicate that the builder completed synchronously and successfully.</summary>
/// <remarks>
/// To avoid memory safety issues even in the face of invalid race conditions, we ensure that the type of this object
/// is valid for the mode in which we're operating. As such, it's cached on the generic builder per TResult
/// rather than having one sentinel instance for all types.
/// </remarks>
internal static readonly StateMachineBox s_syncSuccessSentinel = new SyncSuccessSentinelStateMachineBox();
/// <summary>The wrapped state machine or task. If the operation completed synchronously and successfully, this will be a sentinel object compared by reference identity.</summary>
private StateMachineBox? m_task; // Debugger depends on the exact name of this field.
/// <summary>The result for this builder if it's completed synchronously, in which case <see cref="m_task"/> will be <see cref="s_syncSuccessSentinel"/>.</summary>
private TResult _result;
/// <summary>Creates an instance of the <see cref="PoolingAsyncValueTaskMethodBuilder{TResult}"/> struct.</summary>
/// <returns>The initialized instance.</returns>
public static PoolingAsyncValueTaskMethodBuilder<TResult> Create() => default;
/// <summary>Begins running the builder with the associated state machine.</summary>
/// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
/// <param name="stateMachine">The state machine instance, passed by reference.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine =>
AsyncMethodBuilderCore.Start(ref stateMachine);
/// <summary>Associates the builder with the specified state machine.</summary>
/// <param name="stateMachine">The state machine instance to associate with the builder.</param>
public void SetStateMachine(IAsyncStateMachine stateMachine) =>
AsyncMethodBuilderCore.SetStateMachine(stateMachine, task: null);
/// <summary>Marks the value task as successfully completed.</summary>
/// <param name="result">The result to use to complete the value task.</param>
public void SetResult(TResult result)
{
if (m_task is null)
{
_result = result;
m_task = s_syncSuccessSentinel;
}
else
{
m_task.SetResult(result);
}
}
/// <summary>Marks the value task as failed and binds the specified exception to the value task.</summary>
/// <param name="exception">The exception to bind to the value task.</param>
public void SetException(Exception exception) =>
SetException(exception, ref m_task);
internal static void SetException(Exception exception, [NotNull] ref StateMachineBox? boxFieldRef)
{
if (exception is null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.exception);
}
(boxFieldRef ??= CreateWeaklyTypedStateMachineBox()).SetException(exception);
}
/// <summary>Gets the value task for this builder.</summary>
public ValueTask<TResult> Task
{
get
{
if (m_task == s_syncSuccessSentinel)
{
return new ValueTask<TResult>(_result);
}
// With normal access paterns, m_task should always be non-null here: the async method should have
// either completed synchronously, in which case SetResult would have set m_task to a non-null object,
// or it should be completing asynchronously, in which case AwaitUnsafeOnCompleted would have similarly
// initialized m_task to a state machine object. However, if the type is used manually (not via
// compiler-generated code) and accesses Task directly, we force it to be initialized. Things will then
// "work" but in a degraded mode, as we don't know the TStateMachine type here, and thus we use a box around
// the interface instead.
PoolingAsyncValueTaskMethodBuilder<TResult>.StateMachineBox? box = m_task ??= CreateWeaklyTypedStateMachineBox();
return new ValueTask<TResult>(box, box.Version);
}
}
/// <summary>Schedules the state machine to proceed to the next action when the specified awaiter completes.</summary>
/// <typeparam name="TAwaiter">The type of the awaiter.</typeparam>
/// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
/// <param name="awaiter">the awaiter</param>
/// <param name="stateMachine">The state machine.</param>
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : INotifyCompletion
where TStateMachine : IAsyncStateMachine =>
AwaitOnCompleted(ref awaiter, ref stateMachine, ref m_task);
internal static void AwaitOnCompleted<TAwaiter, TStateMachine>(
ref TAwaiter awaiter, ref TStateMachine stateMachine, ref StateMachineBox? box)
where TAwaiter : INotifyCompletion
where TStateMachine : IAsyncStateMachine
{
try
{
awaiter.OnCompleted(GetStateMachineBox(ref stateMachine, ref box).MoveNextAction);
}
catch (Exception e)
{
System.Threading.Tasks.Task.ThrowAsync(e, targetContext: null);
}
}
/// <summary>Schedules the state machine to proceed to the next action when the specified awaiter completes.</summary>
/// <typeparam name="TAwaiter">The type of the awaiter.</typeparam>
/// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
/// <param name="awaiter">the awaiter</param>
/// <param name="stateMachine">The state machine.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : ICriticalNotifyCompletion
where TStateMachine : IAsyncStateMachine =>
AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine, ref m_task);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(
ref TAwaiter awaiter, ref TStateMachine stateMachine, [NotNull] ref StateMachineBox? boxRef)
where TAwaiter : ICriticalNotifyCompletion
where TStateMachine : IAsyncStateMachine
{
IAsyncStateMachineBox box = GetStateMachineBox(ref stateMachine, ref boxRef);
AsyncTaskMethodBuilder<VoidTaskResult>.AwaitUnsafeOnCompleted(ref awaiter, box);
}
/// <summary>Gets the "boxed" state machine object.</summary>
/// <typeparam name="TStateMachine">Specifies the type of the async state machine.</typeparam>
/// <param name="stateMachine">The state machine.</param>
/// <param name="boxFieldRef">A reference to the field containing the initialized state machine box.</param>
/// <returns>The "boxed" state machine.</returns>
private static IAsyncStateMachineBox GetStateMachineBox<TStateMachine>(
ref TStateMachine stateMachine,
[NotNull] ref StateMachineBox? boxFieldRef)
where TStateMachine : IAsyncStateMachine
{
ExecutionContext? currentContext = ExecutionContext.Capture();
// Check first for the most common case: not the first yield in an async method.
// In this case, the first yield will have already "boxed" the state machine in
// a strongly-typed manner into an AsyncStateMachineBox. It will already contain
// the state machine as well as a MoveNextDelegate and a context. The only thing
// we might need to do is update the context if that's changed since it was stored.
if (boxFieldRef is StateMachineBox<TStateMachine> stronglyTypedBox)
{
if (stronglyTypedBox.Context != currentContext)
{
stronglyTypedBox.Context = currentContext;
}
return stronglyTypedBox;
}
// The least common case: we have a weakly-typed boxed. This results if the debugger
// or some other use of reflection accesses a property like ObjectIdForDebugger. In
// such situations, we need to get an object to represent the builder, but we don't yet
// know the type of the state machine, and thus can't use TStateMachine. Instead, we
// use the IAsyncStateMachine interface, which all TStateMachines implement. This will
// result in a boxing allocation when storing the TStateMachine if it's a struct, but
// this only happens in active debugging scenarios where such performance impact doesn't
// matter.
if (boxFieldRef is StateMachineBox<IAsyncStateMachine> weaklyTypedBox)
{
// If this is the first await, we won't yet have a state machine, so store it.
if (weaklyTypedBox.StateMachine is null)
{
Debugger.NotifyOfCrossThreadDependency(); // same explanation as with usage below
weaklyTypedBox.StateMachine = stateMachine;
}
// Update the context. This only happens with a debugger, so no need to spend
// extra IL checking for equality before doing the assignment.
weaklyTypedBox.Context = currentContext;
return weaklyTypedBox;
}
// Alert a listening debugger that we can't make forward progress unless it slips threads.
// If we don't do this, and a method that uses "await foo;" is invoked through funceval,
// we could end up hooking up a callback to push forward the async method's state machine,
// the debugger would then abort the funceval after it takes too long, and then continuing
// execution could result in another callback being hooked up. At that point we have
// multiple callbacks registered to push the state machine, which could result in bad behavior.
Debugger.NotifyOfCrossThreadDependency();
// At this point, m_task should really be null, in which case we want to create the box.
// However, in a variety of debugger-related (erroneous) situations, it might be non-null,
// e.g. if the Task property is examined in a Watch window, forcing it to be lazily-intialized
// as a Task<TResult> rather than as an ValueTaskStateMachineBox. The worst that happens in such
// cases is we lose the ability to properly step in the debugger, as the debugger uses that
// object's identity to track this specific builder/state machine. As such, we proceed to
// overwrite whatever's there anyway, even if it's non-null.
StateMachineBox<TStateMachine> box = StateMachineBox<TStateMachine>.RentFromCache();
boxFieldRef = box; // important: this must be done before storing stateMachine into box.StateMachine!
box.StateMachine = stateMachine;
box.Context = currentContext;
return box;
}
/// <summary>
/// Creates a box object for use when a non-standard access pattern is employed, e.g. when Task
/// is evaluated in the debugger prior to the async method yielding for the first time.
/// </summary>
internal static StateMachineBox CreateWeaklyTypedStateMachineBox() => new StateMachineBox<IAsyncStateMachine>();
/// <summary>
/// Gets an object that may be used to uniquely identify this builder to the debugger.
/// </summary>
/// <remarks>
/// This property lazily instantiates the ID in a non-thread-safe manner.
/// It must only be used by the debugger and tracing purposes, and only in a single-threaded manner
/// when no other threads are in the middle of accessing this or other members that lazily initialize the box.
/// </remarks>
internal object ObjectIdForDebugger => m_task ??= CreateWeaklyTypedStateMachineBox();
/// <summary>The base type for all value task box reusable box objects, regardless of state machine type.</summary>
internal abstract class StateMachineBox : IValueTaskSource<TResult>, IValueTaskSource
{
/// <summary>A delegate to the MoveNext method.</summary>
protected Action? _moveNextAction;
/// <summary>Captured ExecutionContext with which to invoke MoveNext.</summary>
public ExecutionContext? Context;
/// <summary>Implementation for IValueTaskSource interfaces.</summary>
protected ManualResetValueTaskSourceCore<TResult> _valueTaskSource;
/// <summary>Completes the box with a result.</summary>
/// <param name="result">The result.</param>
public void SetResult(TResult result) =>
_valueTaskSource.SetResult(result);
/// <summary>Completes the box with an error.</summary>
/// <param name="error">The exception.</param>
public void SetException(Exception error) =>
_valueTaskSource.SetException(error);
/// <summary>Gets the status of the box.</summary>
public ValueTaskSourceStatus GetStatus(short token) => _valueTaskSource.GetStatus(token);
/// <summary>Schedules the continuation action for this box.</summary>
public void OnCompleted(Action<object?> continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) =>
_valueTaskSource.OnCompleted(continuation, state, token, flags);
/// <summary>Gets the current version number of the box.</summary>
public short Version => _valueTaskSource.Version;
/// <summary>Implemented by derived type.</summary>
TResult IValueTaskSource<TResult>.GetResult(short token) => throw NotImplemented.ByDesign;
/// <summary>Implemented by derived type.</summary>
void IValueTaskSource.GetResult(short token) => throw NotImplemented.ByDesign;
}
/// <summary>Type used as a singleton to indicate synchronous success for an async method.</summary>
private sealed class SyncSuccessSentinelStateMachineBox : StateMachineBox
{
public SyncSuccessSentinelStateMachineBox() => SetResult(default!);
}
/// <summary>Provides a strongly-typed box object based on the specific state machine type in use.</summary>
private sealed class StateMachineBox<TStateMachine> :
StateMachineBox,
IValueTaskSource<TResult>, IValueTaskSource, IAsyncStateMachineBox, IThreadPoolWorkItem
where TStateMachine : IAsyncStateMachine
{
/// <summary>Delegate used to invoke on an ExecutionContext when passed an instance of this box type.</summary>
private static readonly ContextCallback s_callback = ExecutionContextCallback;
/// <summary>Per-core cache of boxes, with one box per core.</summary>
/// <remarks>Each element is padded to expected cache-line size so as to minimize false sharing.</remarks>
private static readonly PaddedReference[] s_perCoreCache = new PaddedReference[Environment.ProcessorCount];
/// <summary>Thread-local cache of boxes. This currently only ever stores one.</summary>
[ThreadStatic]
private static StateMachineBox<TStateMachine>? t_tlsCache;
/// <summary>The state machine itself.</summary>
public TStateMachine? StateMachine;
/// <summary>Gets a box object to use for an operation. This may be a reused, pooled object, or it may be new.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)] // only one caller
internal static StateMachineBox<TStateMachine> RentFromCache()
{
// First try to get a box from the per-thread cache.
StateMachineBox<TStateMachine>? box = t_tlsCache;
if (box is not null)
{
t_tlsCache = null;
}
else
{
// If we can't, then try to get a box from the per-core cache.
ref StateMachineBox<TStateMachine>? slot = ref PerCoreCacheSlot;
if (slot is null ||
(box = Interlocked.Exchange<StateMachineBox<TStateMachine>?>(ref slot, null)) is null)
{
// If we can't, just create a new one.
box = new StateMachineBox<TStateMachine>();
}
}
return box;
}
/// <summary>Returns this instance to the cache.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)] // only two callers
private void ReturnToCache()
{
// Clear out the state machine and associated context to avoid keeping arbitrary state referenced by
// lifted locals, and reset the instance for another await.
ClearStateUponCompletion();
_valueTaskSource.Reset();
// If the per-thread cache is empty, store this into it..
if (t_tlsCache is null)
{
t_tlsCache = this;
}
else
{
// Otherwise, store it into the per-core cache.
ref StateMachineBox<TStateMachine>? slot = ref PerCoreCacheSlot;
if (slot is null)
{
// Try to avoid the write if we know the slot isn't empty (we may still have a benign race condition and
// overwrite what's there if something arrived in the interim).
Volatile.Write(ref slot, this);
}
}
}
/// <summary>Gets the slot in <see cref="s_perCoreCache"/> for the current core.</summary>
private static ref StateMachineBox<TStateMachine>? PerCoreCacheSlot
{
[MethodImpl(MethodImplOptions.AggressiveInlining)] // only two callers are RentFrom/ReturnToCache
get
{
// Get the current processor ID. We need to ensure it fits within s_perCoreCache, so we
// could % by its length, but we can do so instead by Environment.ProcessorCount, which will be a const
// in tier 1, allowing better code gen, and then further use uints for even better code gen.
Debug.Assert(s_perCoreCache.Length == Environment.ProcessorCount, $"{s_perCoreCache.Length} != {Environment.ProcessorCount}");
int i = (int)((uint)Thread.GetCurrentProcessorId() % (uint)Environment.ProcessorCount);
// We want an array of StateMachineBox<> objects, each consuming its own cache line so that
// elements don't cause false sharing with each other. But we can't use StructLayout.Explicit
// with generics. So we use object fields, but always reinterpret them (for all reads and writes
// to avoid any safety issues) as StateMachineBox<> instances.
#if DEBUG
object? transientValue = s_perCoreCache[i].Object;
Debug.Assert(transientValue is null || transientValue is StateMachineBox<TStateMachine>,
$"Expected null or {nameof(StateMachineBox<TStateMachine>)}, got '{transientValue}'");
#endif
return ref Unsafe.As<object?, StateMachineBox<TStateMachine>?>(ref s_perCoreCache[i].Object);
}
}
/// <summary>
/// Clear out the state machine and associated context to avoid keeping arbitrary state referenced by lifted locals.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ClearStateUponCompletion()
{
StateMachine = default;
Context = default;
}
/// <summary>
/// Used to initialize s_callback above. We don't use a lambda for this on purpose: a lambda would
/// introduce a new generic type behind the scenes that comes with a hefty size penalty in AOT builds.
/// </summary>
private static void ExecutionContextCallback(object? s)
{
// Only used privately to pass directly to EC.Run
Debug.Assert(s is StateMachineBox<TStateMachine>, $"Expected {nameof(StateMachineBox<TStateMachine>)}, got '{s}'");
Unsafe.As<StateMachineBox<TStateMachine>>(s).StateMachine!.MoveNext();
}
/// <summary>A delegate to the <see cref="MoveNext()"/> method.</summary>
public Action MoveNextAction => _moveNextAction ??= new Action(MoveNext);
/// <summary>Invoked to run MoveNext when this instance is executed from the thread pool.</summary>
void IThreadPoolWorkItem.Execute() => MoveNext();
/// <summary>Calls MoveNext on <see cref="StateMachine"/></summary>
public void MoveNext()
{
ExecutionContext? context = Context;
if (context is null)
{
Debug.Assert(StateMachine is not null, $"Null {nameof(StateMachine)}");
StateMachine.MoveNext();
}
else
{
ExecutionContext.RunInternal(context, s_callback, this);
}
}
/// <summary>Get the result of the operation.</summary>
TResult IValueTaskSource<TResult>.GetResult(short token)
{
try
{
return _valueTaskSource.GetResult(token);
}
finally
{
ReturnToCache();
}
}
/// <summary>Get the result of the operation.</summary>
void IValueTaskSource.GetResult(short token)
{
try
{
_valueTaskSource.GetResult(token);
}
finally
{
ReturnToCache();
}
}
/// <summary>Gets the state machine as a boxed object. This should only be used for debugging purposes.</summary>
IAsyncStateMachine IAsyncStateMachineBox.GetStateMachineObject() => StateMachine!; // likely boxes, only use for debugging
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Sources;
using Internal;
namespace System.Runtime.CompilerServices
{
/// <summary>Represents a builder for asynchronous methods that returns a <see cref="ValueTask{TResult}"/>.</summary>
/// <typeparam name="TResult">The type of the result.</typeparam>
[StructLayout(LayoutKind.Auto)]
public struct PoolingAsyncValueTaskMethodBuilder<TResult>
{
/// <summary>Sentinel object used to indicate that the builder completed synchronously and successfully.</summary>
/// <remarks>
/// To avoid memory safety issues even in the face of invalid race conditions, we ensure that the type of this object
/// is valid for the mode in which we're operating. As such, it's cached on the generic builder per TResult
/// rather than having one sentinel instance for all types.
/// </remarks>
internal static readonly StateMachineBox s_syncSuccessSentinel = new SyncSuccessSentinelStateMachineBox();
/// <summary>The wrapped state machine or task. If the operation completed synchronously and successfully, this will be a sentinel object compared by reference identity.</summary>
private StateMachineBox? m_task; // Debugger depends on the exact name of this field.
/// <summary>The result for this builder if it's completed synchronously, in which case <see cref="m_task"/> will be <see cref="s_syncSuccessSentinel"/>.</summary>
private TResult _result;
/// <summary>Creates an instance of the <see cref="PoolingAsyncValueTaskMethodBuilder{TResult}"/> struct.</summary>
/// <returns>The initialized instance.</returns>
public static PoolingAsyncValueTaskMethodBuilder<TResult> Create() => default;
/// <summary>Begins running the builder with the associated state machine.</summary>
/// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
/// <param name="stateMachine">The state machine instance, passed by reference.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine =>
AsyncMethodBuilderCore.Start(ref stateMachine);
/// <summary>Associates the builder with the specified state machine.</summary>
/// <param name="stateMachine">The state machine instance to associate with the builder.</param>
public void SetStateMachine(IAsyncStateMachine stateMachine) =>
AsyncMethodBuilderCore.SetStateMachine(stateMachine, task: null);
/// <summary>Marks the value task as successfully completed.</summary>
/// <param name="result">The result to use to complete the value task.</param>
public void SetResult(TResult result)
{
if (m_task is null)
{
_result = result;
m_task = s_syncSuccessSentinel;
}
else
{
m_task.SetResult(result);
}
}
/// <summary>Marks the value task as failed and binds the specified exception to the value task.</summary>
/// <param name="exception">The exception to bind to the value task.</param>
public void SetException(Exception exception) =>
SetException(exception, ref m_task);
internal static void SetException(Exception exception, [NotNull] ref StateMachineBox? boxFieldRef)
{
if (exception is null)
{
ThrowHelper.ThrowArgumentNullException(ExceptionArgument.exception);
}
(boxFieldRef ??= CreateWeaklyTypedStateMachineBox()).SetException(exception);
}
/// <summary>Gets the value task for this builder.</summary>
public ValueTask<TResult> Task
{
get
{
if (m_task == s_syncSuccessSentinel)
{
return new ValueTask<TResult>(_result);
}
// With normal access paterns, m_task should always be non-null here: the async method should have
// either completed synchronously, in which case SetResult would have set m_task to a non-null object,
// or it should be completing asynchronously, in which case AwaitUnsafeOnCompleted would have similarly
// initialized m_task to a state machine object. However, if the type is used manually (not via
// compiler-generated code) and accesses Task directly, we force it to be initialized. Things will then
// "work" but in a degraded mode, as we don't know the TStateMachine type here, and thus we use a box around
// the interface instead.
PoolingAsyncValueTaskMethodBuilder<TResult>.StateMachineBox? box = m_task ??= CreateWeaklyTypedStateMachineBox();
return new ValueTask<TResult>(box, box.Version);
}
}
/// <summary>Schedules the state machine to proceed to the next action when the specified awaiter completes.</summary>
/// <typeparam name="TAwaiter">The type of the awaiter.</typeparam>
/// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
/// <param name="awaiter">the awaiter</param>
/// <param name="stateMachine">The state machine.</param>
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : INotifyCompletion
where TStateMachine : IAsyncStateMachine =>
AwaitOnCompleted(ref awaiter, ref stateMachine, ref m_task);
internal static void AwaitOnCompleted<TAwaiter, TStateMachine>(
ref TAwaiter awaiter, ref TStateMachine stateMachine, ref StateMachineBox? box)
where TAwaiter : INotifyCompletion
where TStateMachine : IAsyncStateMachine
{
try
{
awaiter.OnCompleted(GetStateMachineBox(ref stateMachine, ref box).MoveNextAction);
}
catch (Exception e)
{
System.Threading.Tasks.Task.ThrowAsync(e, targetContext: null);
}
}
/// <summary>Schedules the state machine to proceed to the next action when the specified awaiter completes.</summary>
/// <typeparam name="TAwaiter">The type of the awaiter.</typeparam>
/// <typeparam name="TStateMachine">The type of the state machine.</typeparam>
/// <param name="awaiter">the awaiter</param>
/// <param name="stateMachine">The state machine.</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine)
where TAwaiter : ICriticalNotifyCompletion
where TStateMachine : IAsyncStateMachine =>
AwaitUnsafeOnCompleted(ref awaiter, ref stateMachine, ref m_task);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(
ref TAwaiter awaiter, ref TStateMachine stateMachine, [NotNull] ref StateMachineBox? boxRef)
where TAwaiter : ICriticalNotifyCompletion
where TStateMachine : IAsyncStateMachine
{
IAsyncStateMachineBox box = GetStateMachineBox(ref stateMachine, ref boxRef);
AsyncTaskMethodBuilder<VoidTaskResult>.AwaitUnsafeOnCompleted(ref awaiter, box);
}
/// <summary>Gets the "boxed" state machine object.</summary>
/// <typeparam name="TStateMachine">Specifies the type of the async state machine.</typeparam>
/// <param name="stateMachine">The state machine.</param>
/// <param name="boxFieldRef">A reference to the field containing the initialized state machine box.</param>
/// <returns>The "boxed" state machine.</returns>
private static IAsyncStateMachineBox GetStateMachineBox<TStateMachine>(
ref TStateMachine stateMachine,
[NotNull] ref StateMachineBox? boxFieldRef)
where TStateMachine : IAsyncStateMachine
{
ExecutionContext? currentContext = ExecutionContext.Capture();
// Check first for the most common case: not the first yield in an async method.
// In this case, the first yield will have already "boxed" the state machine in
// a strongly-typed manner into an AsyncStateMachineBox. It will already contain
// the state machine as well as a MoveNextDelegate and a context. The only thing
// we might need to do is update the context if that's changed since it was stored.
if (boxFieldRef is StateMachineBox<TStateMachine> stronglyTypedBox)
{
if (stronglyTypedBox.Context != currentContext)
{
stronglyTypedBox.Context = currentContext;
}
return stronglyTypedBox;
}
// The least common case: we have a weakly-typed boxed. This results if the debugger
// or some other use of reflection accesses a property like ObjectIdForDebugger. In
// such situations, we need to get an object to represent the builder, but we don't yet
// know the type of the state machine, and thus can't use TStateMachine. Instead, we
// use the IAsyncStateMachine interface, which all TStateMachines implement. This will
// result in a boxing allocation when storing the TStateMachine if it's a struct, but
// this only happens in active debugging scenarios where such performance impact doesn't
// matter.
if (boxFieldRef is StateMachineBox<IAsyncStateMachine> weaklyTypedBox)
{
// If this is the first await, we won't yet have a state machine, so store it.
if (weaklyTypedBox.StateMachine is null)
{
Debugger.NotifyOfCrossThreadDependency(); // same explanation as with usage below
weaklyTypedBox.StateMachine = stateMachine;
}
// Update the context. This only happens with a debugger, so no need to spend
// extra IL checking for equality before doing the assignment.
weaklyTypedBox.Context = currentContext;
return weaklyTypedBox;
}
// Alert a listening debugger that we can't make forward progress unless it slips threads.
// If we don't do this, and a method that uses "await foo;" is invoked through funceval,
// we could end up hooking up a callback to push forward the async method's state machine,
// the debugger would then abort the funceval after it takes too long, and then continuing
// execution could result in another callback being hooked up. At that point we have
// multiple callbacks registered to push the state machine, which could result in bad behavior.
Debugger.NotifyOfCrossThreadDependency();
// At this point, m_task should really be null, in which case we want to create the box.
// However, in a variety of debugger-related (erroneous) situations, it might be non-null,
// e.g. if the Task property is examined in a Watch window, forcing it to be lazily-intialized
// as a Task<TResult> rather than as an ValueTaskStateMachineBox. The worst that happens in such
// cases is we lose the ability to properly step in the debugger, as the debugger uses that
// object's identity to track this specific builder/state machine. As such, we proceed to
// overwrite whatever's there anyway, even if it's non-null.
StateMachineBox<TStateMachine> box = StateMachineBox<TStateMachine>.RentFromCache();
boxFieldRef = box; // important: this must be done before storing stateMachine into box.StateMachine!
box.StateMachine = stateMachine;
box.Context = currentContext;
return box;
}
/// <summary>
/// Creates a box object for use when a non-standard access pattern is employed, e.g. when Task
/// is evaluated in the debugger prior to the async method yielding for the first time.
/// </summary>
internal static StateMachineBox CreateWeaklyTypedStateMachineBox() => new StateMachineBox<IAsyncStateMachine>();
/// <summary>
/// Gets an object that may be used to uniquely identify this builder to the debugger.
/// </summary>
/// <remarks>
/// This property lazily instantiates the ID in a non-thread-safe manner.
/// It must only be used by the debugger and tracing purposes, and only in a single-threaded manner
/// when no other threads are in the middle of accessing this or other members that lazily initialize the box.
/// </remarks>
internal object ObjectIdForDebugger => m_task ??= CreateWeaklyTypedStateMachineBox();
/// <summary>The base type for all value task box reusable box objects, regardless of state machine type.</summary>
internal abstract class StateMachineBox : IValueTaskSource<TResult>, IValueTaskSource
{
/// <summary>A delegate to the MoveNext method.</summary>
protected Action? _moveNextAction;
/// <summary>Captured ExecutionContext with which to invoke MoveNext.</summary>
public ExecutionContext? Context;
/// <summary>Implementation for IValueTaskSource interfaces.</summary>
protected ManualResetValueTaskSourceCore<TResult> _valueTaskSource;
/// <summary>Completes the box with a result.</summary>
/// <param name="result">The result.</param>
public void SetResult(TResult result) =>
_valueTaskSource.SetResult(result);
/// <summary>Completes the box with an error.</summary>
/// <param name="error">The exception.</param>
public void SetException(Exception error) =>
_valueTaskSource.SetException(error);
/// <summary>Gets the status of the box.</summary>
public ValueTaskSourceStatus GetStatus(short token) => _valueTaskSource.GetStatus(token);
/// <summary>Schedules the continuation action for this box.</summary>
public void OnCompleted(Action<object?> continuation, object? state, short token, ValueTaskSourceOnCompletedFlags flags) =>
_valueTaskSource.OnCompleted(continuation, state, token, flags);
/// <summary>Gets the current version number of the box.</summary>
public short Version => _valueTaskSource.Version;
/// <summary>Implemented by derived type.</summary>
TResult IValueTaskSource<TResult>.GetResult(short token) => throw NotImplemented.ByDesign;
/// <summary>Implemented by derived type.</summary>
void IValueTaskSource.GetResult(short token) => throw NotImplemented.ByDesign;
}
/// <summary>Type used as a singleton to indicate synchronous success for an async method.</summary>
private sealed class SyncSuccessSentinelStateMachineBox : StateMachineBox
{
public SyncSuccessSentinelStateMachineBox() => SetResult(default!);
}
/// <summary>Provides a strongly-typed box object based on the specific state machine type in use.</summary>
private sealed class StateMachineBox<TStateMachine> :
StateMachineBox,
IValueTaskSource<TResult>, IValueTaskSource, IAsyncStateMachineBox, IThreadPoolWorkItem
where TStateMachine : IAsyncStateMachine
{
/// <summary>Delegate used to invoke on an ExecutionContext when passed an instance of this box type.</summary>
private static readonly ContextCallback s_callback = ExecutionContextCallback;
/// <summary>Per-core cache of boxes, with one box per core.</summary>
/// <remarks>Each element is padded to expected cache-line size so as to minimize false sharing.</remarks>
private static readonly PaddedReference[] s_perCoreCache = new PaddedReference[Environment.ProcessorCount];
/// <summary>Thread-local cache of boxes. This currently only ever stores one.</summary>
[ThreadStatic]
private static StateMachineBox<TStateMachine>? t_tlsCache;
/// <summary>The state machine itself.</summary>
public TStateMachine? StateMachine;
/// <summary>Gets a box object to use for an operation. This may be a reused, pooled object, or it may be new.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)] // only one caller
internal static StateMachineBox<TStateMachine> RentFromCache()
{
// First try to get a box from the per-thread cache.
StateMachineBox<TStateMachine>? box = t_tlsCache;
if (box is not null)
{
t_tlsCache = null;
}
else
{
// If we can't, then try to get a box from the per-core cache.
ref StateMachineBox<TStateMachine>? slot = ref PerCoreCacheSlot;
if (slot is null ||
(box = Interlocked.Exchange<StateMachineBox<TStateMachine>?>(ref slot, null)) is null)
{
// If we can't, just create a new one.
box = new StateMachineBox<TStateMachine>();
}
}
return box;
}
/// <summary>Returns this instance to the cache.</summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)] // only two callers
private void ReturnToCache()
{
// Clear out the state machine and associated context to avoid keeping arbitrary state referenced by
// lifted locals, and reset the instance for another await.
ClearStateUponCompletion();
_valueTaskSource.Reset();
// If the per-thread cache is empty, store this into it..
if (t_tlsCache is null)
{
t_tlsCache = this;
}
else
{
// Otherwise, store it into the per-core cache.
ref StateMachineBox<TStateMachine>? slot = ref PerCoreCacheSlot;
if (slot is null)
{
// Try to avoid the write if we know the slot isn't empty (we may still have a benign race condition and
// overwrite what's there if something arrived in the interim).
Volatile.Write(ref slot, this);
}
}
}
/// <summary>Gets the slot in <see cref="s_perCoreCache"/> for the current core.</summary>
private static ref StateMachineBox<TStateMachine>? PerCoreCacheSlot
{
[MethodImpl(MethodImplOptions.AggressiveInlining)] // only two callers are RentFrom/ReturnToCache
get
{
// Get the current processor ID. We need to ensure it fits within s_perCoreCache, so we
// could % by its length, but we can do so instead by Environment.ProcessorCount, which will be a const
// in tier 1, allowing better code gen, and then further use uints for even better code gen.
Debug.Assert(s_perCoreCache.Length == Environment.ProcessorCount, $"{s_perCoreCache.Length} != {Environment.ProcessorCount}");
int i = (int)((uint)Thread.GetCurrentProcessorId() % (uint)Environment.ProcessorCount);
// We want an array of StateMachineBox<> objects, each consuming its own cache line so that
// elements don't cause false sharing with each other. But we can't use StructLayout.Explicit
// with generics. So we use object fields, but always reinterpret them (for all reads and writes
// to avoid any safety issues) as StateMachineBox<> instances.
#if DEBUG
object? transientValue = s_perCoreCache[i].Object;
Debug.Assert(transientValue is null || transientValue is StateMachineBox<TStateMachine>,
$"Expected null or {nameof(StateMachineBox<TStateMachine>)}, got '{transientValue}'");
#endif
return ref Unsafe.As<object?, StateMachineBox<TStateMachine>?>(ref s_perCoreCache[i].Object);
}
}
/// <summary>
/// Clear out the state machine and associated context to avoid keeping arbitrary state referenced by lifted locals.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public void ClearStateUponCompletion()
{
StateMachine = default;
Context = default;
}
/// <summary>
/// Used to initialize s_callback above. We don't use a lambda for this on purpose: a lambda would
/// introduce a new generic type behind the scenes that comes with a hefty size penalty in AOT builds.
/// </summary>
private static void ExecutionContextCallback(object? s)
{
// Only used privately to pass directly to EC.Run
Debug.Assert(s is StateMachineBox<TStateMachine>, $"Expected {nameof(StateMachineBox<TStateMachine>)}, got '{s}'");
Unsafe.As<StateMachineBox<TStateMachine>>(s).StateMachine!.MoveNext();
}
/// <summary>A delegate to the <see cref="MoveNext()"/> method.</summary>
public Action MoveNextAction => _moveNextAction ??= new Action(MoveNext);
/// <summary>Invoked to run MoveNext when this instance is executed from the thread pool.</summary>
void IThreadPoolWorkItem.Execute() => MoveNext();
/// <summary>Calls MoveNext on <see cref="StateMachine"/></summary>
public void MoveNext()
{
ExecutionContext? context = Context;
if (context is null)
{
Debug.Assert(StateMachine is not null, $"Null {nameof(StateMachine)}");
StateMachine.MoveNext();
}
else
{
ExecutionContext.RunInternal(context, s_callback, this);
}
}
/// <summary>Get the result of the operation.</summary>
TResult IValueTaskSource<TResult>.GetResult(short token)
{
try
{
return _valueTaskSource.GetResult(token);
}
finally
{
ReturnToCache();
}
}
/// <summary>Get the result of the operation.</summary>
void IValueTaskSource.GetResult(short token)
{
try
{
_valueTaskSource.GetResult(token);
}
finally
{
ReturnToCache();
}
}
/// <summary>Gets the state machine as a boxed object. This should only be used for debugging purposes.</summary>
IAsyncStateMachine IAsyncStateMachineBox.GetStateMachineObject() => StateMachine!; // likely boxes, only use for debugging
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<EnableDefaultItems>true</EnableDefaultItems>
<!-- Use targeting pack references instead of granular ones in the project file. -->
<DisableImplicitAssemblyReferences>false</DisableImplicitAssemblyReferences>
<IsPackable>true</IsPackable>
<Nullable>Annotations</Nullable>
<PackageDescription>The HttpClient factory is a pattern for configuring and retrieving named HttpClients in a composable way. The HttpClient factory provides extensibility to plug in DelegatingHandlers that address cross-cutting concerns such as service location, load balancing, and reliability. The default HttpClient factory provides built-in diagnostics and logging and manages the lifetimes of connections in a performant way.
Commonly Used Types:
System.Net.Http.IHttpClientFactory</PackageDescription>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonPath)Extensions\NonCapturingTimer\NonCapturingTimer.cs"
Link="Common\src\Extensions\NonCapturingTimer\NonCapturingTimer.cs" />
<Compile Include="$(CommonPath)Extensions\TypeNameHelper\TypeNameHelper.cs"
Link="Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs" />
<Compile Include="$(CommonPath)Extensions\ValueStopwatch\ValueStopwatch.cs"
Link="Common\src\Extensions\ValueStopwatch\ValueStopwatch.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMembersAttribute.cs" />
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMemberTypes.cs" />
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\UnconditionalSuppressMessageAttribute.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\src\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging\src\Microsoft.Extensions.Logging.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Abstractions\src\Microsoft.Extensions.Logging.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Options\src\Microsoft.Extensions.Options.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Reference Include="System.Net.Http" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<EnableDefaultItems>true</EnableDefaultItems>
<!-- Use targeting pack references instead of granular ones in the project file. -->
<DisableImplicitAssemblyReferences>false</DisableImplicitAssemblyReferences>
<IsPackable>true</IsPackable>
<Nullable>Annotations</Nullable>
<PackageDescription>The HttpClient factory is a pattern for configuring and retrieving named HttpClients in a composable way. The HttpClient factory provides extensibility to plug in DelegatingHandlers that address cross-cutting concerns such as service location, load balancing, and reliability. The default HttpClient factory provides built-in diagnostics and logging and manages the lifetimes of connections in a performant way.
Commonly Used Types:
System.Net.Http.IHttpClientFactory</PackageDescription>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(CommonPath)Extensions\NonCapturingTimer\NonCapturingTimer.cs"
Link="Common\src\Extensions\NonCapturingTimer\NonCapturingTimer.cs" />
<Compile Include="$(CommonPath)Extensions\TypeNameHelper\TypeNameHelper.cs"
Link="Common\src\Extensions\TypeNameHelper\TypeNameHelper.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMembersAttribute.cs" />
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\DynamicallyAccessedMemberTypes.cs" />
<Compile Include="$(CoreLibSharedDir)System\Diagnostics\CodeAnalysis\UnconditionalSuppressMessageAttribute.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.DependencyInjection.Abstractions\src\Microsoft.Extensions.DependencyInjection.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging\src\Microsoft.Extensions.Logging.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Abstractions\src\Microsoft.Extensions.Logging.Abstractions.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Options\src\Microsoft.Extensions.Options.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<Reference Include="System.Net.Http" />
</ItemGroup>
</Project>
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessWaitState.Unix.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace System.Diagnostics
{
// Overview
// --------
// We have a few constraints we're working under here:
// - waitid is used on Unix to get the exit status (including exit code) of a child process, but once a child
// process is reaped, it is no longer possible to get the status.
// - The Process design allows for multiple independent Process objects to be handed out, and each of those
// objects may be used concurrently with each other, even if they refer to the same underlying process.
// Same with ProcessWaitHandle objects. This is based on the Windows design where anyone with a handle to the
// process can retrieve completion information about that process.
// - There is no good Unix equivalent to asynchronously be notified of a non-child process' exit, which means such
// support needs to be layered on top of kill.
//
// As a result, we have the following scheme:
// - We maintain a static/shared table that maps process ID to ProcessWaitState objects.
// Access to this table requires taking a global lock, so we try to minimize the number of
// times we need to access the table, primarily just the first time a Process object needs
// access to process exit/wait information and subsequently when that Process object gets GC'd.
// - Each process holds a ProcessWaitState.Holder object; when that object is constructed,
// it ensures there's an appropriate entry in the mapping table and increments that entry's ref count.
// - When a Process object is dropped and its ProcessWaitState.Holder is finalized, it'll
// decrement the ref count, and when no more process objects exist for a particular process ID,
// that entry in the table will be cleaned up.
// - This approach effectively allows for multiple independent Process objects for the same process ID to all
// share the same ProcessWaitState. And since they are sharing the same wait state object,
// the wait state object uses its own lock to protect the per-process state. This includes
// caching exit / exit code / exit time information so that a Process object for a process that's already
// had waitpid called for it can get at its exit information.
// - When we detect a recycled pid, we remove that ProcessWaitState from the table and replace it with a new one
// that represents the new process. For child processes we know a pid is recycled when we see the pid of a new
// child is already in the table. For non-child processes, we assume that a pid may be recycled as soon as
// we've observed it has exited.
/// <summary>Exit information and waiting capabilities for a process.</summary>
internal sealed class ProcessWaitState : IDisposable
{
/// <summary>
/// Finalizable holder for a process wait state. Instantiating one
/// will ensure that a wait state object exists for a process, will
/// grab it, and will increment its ref count. Dropping or disposing
/// one will decrement the ref count and clean up after it if the ref
/// count hits zero.
/// </summary>
internal sealed class Holder : IDisposable
{
internal ProcessWaitState _state;
internal Holder(int processId, bool isNewChild = false, bool usesTerminal = false)
{
_state = ProcessWaitState.AddRef(processId, isNewChild, usesTerminal);
}
~Holder()
{
// Don't try to Dispose resources (like ManualResetEvents) if
// the process is shutting down.
if (_state != null && !Environment.HasShutdownStarted)
{
_state.ReleaseRef();
}
}
public void Dispose()
{
if (_state != null)
{
GC.SuppressFinalize(this);
_state.ReleaseRef();
_state = null!;
}
}
}
/// <summary>
/// Global table that maps process IDs of non-child Processes to the associated shared wait state information.
/// </summary>
private static readonly Dictionary<int, ProcessWaitState> s_processWaitStates =
new Dictionary<int, ProcessWaitState>();
/// <summary>
/// Global table that maps process IDs of child Processes to the associated shared wait state information.
/// </summary>
private static readonly Dictionary<int, ProcessWaitState> s_childProcessWaitStates =
new Dictionary<int, ProcessWaitState>();
/// <summary>
/// Ensures that the mapping table contains an entry for the process ID,
/// increments its ref count, and returns it.
/// </summary>
/// <param name="processId">The process ID for which we need wait state.</param>
/// <param name="isNewChild">Whether the wait state will represent a newly created child process.</param>
/// <param name="usesTerminal">Whether the wait state will represent a process that is expected to use the terminal.</param>
/// <returns>The wait state object.</returns>
internal static ProcessWaitState AddRef(int processId, bool isNewChild, bool usesTerminal)
{
lock (s_childProcessWaitStates)
{
ProcessWaitState? pws;
if (isNewChild)
{
// When the PID is recycled for a new child, we remove the old child.
s_childProcessWaitStates.Remove(processId);
pws = new ProcessWaitState(processId, isChild: true, usesTerminal);
s_childProcessWaitStates.Add(processId, pws);
pws._outstandingRefCount++; // For Holder
pws._outstandingRefCount++; // Decremented in CheckChildren
}
else
{
lock (s_processWaitStates)
{
DateTime exitTime = default;
// We are referencing an existing process.
// This may be a child process, so we check s_childProcessWaitStates too.
if (s_childProcessWaitStates.TryGetValue(processId, out pws))
{
// child process
}
else if (s_processWaitStates.TryGetValue(processId, out pws))
{
// This is best effort for dealing with recycled pids for non-child processes.
// As long as we haven't observed process exit, it's safe to share the ProcessWaitState.
// Once we've observed the exit, we'll create a new ProcessWaitState just in case
// this may be a recycled pid.
// If it wasn't, that ProcessWaitState will observe too that the process has exited.
// We pass the ExitTime so it can be the same, but we'll clear it when we see there
// is a live process with that pid.
if (pws.GetExited(out _, refresh: false))
{
s_processWaitStates.Remove(processId);
exitTime = pws.ExitTime;
pws = null;
}
}
if (pws == null)
{
pws = new ProcessWaitState(processId, isChild: false, usesTerminal: false, exitTime);
s_processWaitStates.Add(processId, pws);
}
pws._outstandingRefCount++;
}
}
return pws;
}
}
/// <summary>
/// Decrements the ref count on the wait state object, and if it's the last one,
/// removes it from the table.
/// </summary>
internal void ReleaseRef()
{
ProcessWaitState? pws;
Dictionary<int, ProcessWaitState> waitStates = _isChild ? s_childProcessWaitStates : s_processWaitStates;
lock (waitStates)
{
bool foundState = waitStates.TryGetValue(_processId, out pws);
Debug.Assert(foundState);
if (foundState)
{
--_outstandingRefCount;
if (_outstandingRefCount == 0)
{
// The dictionary may contain a different ProcessWaitState if the pid was recycled.
if (pws == this)
{
waitStates.Remove(_processId);
}
pws = this;
}
else
{
pws = null;
}
}
}
pws?.Dispose();
}
/// <summary>
/// Synchronization object used to protect all instance state. Any number of
/// Process and ProcessWaitHandle objects may be using a ProcessWaitState
/// instance concurrently.
/// </summary>
private readonly object _gate = new object();
/// <summary>ID of the associated process.</summary>
private readonly int _processId;
/// <summary>Associated process is a child process.</summary>
private readonly bool _isChild;
/// <summary>Associated process is a child that can use the terminal.</summary>
private readonly bool _usesTerminal;
/// <summary>If a wait operation is in progress, the Task that represents it; otherwise, null.</summary>
private Task? _waitInProgress;
/// <summary>The number of alive users of this object.</summary>
private int _outstandingRefCount;
/// <summary>Whether the associated process exited.</summary>
private bool _exited;
/// <summary>If the process exited, it's exit code, or null if we were unable to determine one.</summary>
private int? _exitCode;
/// <summary>
/// The approximate time the process exited. We do not have the ability to know exact time a process
/// exited, so we approximate it by storing the time that we discovered it exited.
/// </summary>
private DateTime _exitTime;
/// <summary>A lazily-initialized event set when the process exits.</summary>
private ManualResetEvent? _exitedEvent;
/// <summary>Initialize the wait state object.</summary>
/// <param name="processId">The associated process' ID.</param>
/// <param name="isChild">Whether the target process is a child of the current process.</param>
/// <param name="usesTerminal">Whether the target process is expected to use the terminal.</param>
/// <param name="exitTime">The approximate time the process exited.</param>
private ProcessWaitState(int processId, bool isChild, bool usesTerminal, DateTime exitTime = default)
{
Debug.Assert(processId >= 0);
_processId = processId;
_isChild = isChild;
_usesTerminal = usesTerminal;
_exitTime = exitTime;
}
/// <summary>Releases managed resources used by the ProcessWaitState.</summary>
public void Dispose()
{
Debug.Assert(!Monitor.IsEntered(_gate));
lock (_gate)
{
if (_exitedEvent != null)
{
_exitedEvent.Dispose();
_exitedEvent = null;
}
}
}
/// <summary>Notes that the process has exited.</summary>
private void SetExited()
{
Debug.Assert(Monitor.IsEntered(_gate));
_exited = true;
if (_exitTime == default)
{
_exitTime = DateTime.Now;
}
_exitedEvent?.Set();
}
/// <summary>Ensures an exited event has been initialized and returns it.</summary>
/// <returns></returns>
internal ManualResetEvent EnsureExitedEvent()
{
Debug.Assert(!Monitor.IsEntered(_gate));
lock (_gate)
{
// If we already have an initialized event, just return it.
if (_exitedEvent == null)
{
// If we don't, create one, and if the process hasn't yet exited,
// make sure we have a task that's actively monitoring the completion state.
_exitedEvent = new ManualResetEvent(initialState: _exited);
if (!_exited)
{
if (!_isChild)
{
// If we haven't exited, we need to spin up an asynchronous operation that
// will completed the exitedEvent when the other process exits. If there's already
// another operation underway, then we'll just tack ours onto the end of it.
_waitInProgress = _waitInProgress == null ?
WaitForExitAsync() :
_waitInProgress.ContinueWith((_, state) => ((ProcessWaitState)state!).WaitForExitAsync(),
this, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default).Unwrap();
}
}
}
return _exitedEvent;
}
}
internal DateTime ExitTime
{
get
{
lock (_gate)
{
Debug.Assert(_exited);
return _exitTime;
}
}
}
internal bool HasExited
{
get
{
return GetExited(out _, refresh: true);
}
}
internal bool GetExited(out int? exitCode, bool refresh)
{
lock (_gate)
{
// Have we already exited? If so, return the cached results.
if (_exited)
{
exitCode = _exitCode;
return true;
}
// Is another wait operation in progress? If so, then we haven't exited,
// and that task owns the right to call CheckForNonChildExit.
if (_waitInProgress != null)
{
exitCode = null;
return false;
}
if (refresh)
{
// We don't know if we've exited, but no one else is currently
// checking, so check.
CheckForNonChildExit();
}
// We now have an up-to-date snapshot for whether we've exited,
// and if we have, what the exit code is (if we were able to find out).
exitCode = _exitCode;
return _exited;
}
}
private void CheckForNonChildExit()
{
Debug.Assert(Monitor.IsEntered(_gate));
if (!_isChild)
{
bool exited;
// We won't be able to get an exit code, but we'll at least be able to determine if the process is
// still running.
int killResult = Interop.Sys.Kill(_processId, Interop.Sys.Signals.None); // None means don't send a signal
if (killResult == 0)
{
// Process is still running. This could also be a defunct process that has completed
// its work but still has an entry in the processes table due to its parent not yet
// having waited on it to clean it up.
exited = false;
}
else // error from kill
{
Interop.Error errno = Interop.Sys.GetLastError();
if (errno == Interop.Error.ESRCH)
{
// Couldn't find the process; assume it's exited
exited = true;
}
else if (errno == Interop.Error.EPERM)
{
// Don't have permissions to the process; assume it's alive
exited = false;
}
else
{
Debug.Fail("Unexpected errno value from kill");
exited = true;
}
}
if (exited)
{
SetExited();
}
else
{
_exitTime = default;
}
}
}
/// <summary>Waits for the associated process to exit.</summary>
/// <param name="millisecondsTimeout">The amount of time to wait, or -1 to wait indefinitely.</param>
/// <returns>true if the process exited; false if the timeout occurred.</returns>
internal bool WaitForExit(int millisecondsTimeout)
{
Debug.Assert(!Monitor.IsEntered(_gate));
if (_isChild)
{
lock (_gate)
{
// If we already know that the process exited, we're done.
if (_exited)
{
return true;
}
}
ManualResetEvent exitEvent = EnsureExitedEvent();
return exitEvent.WaitOne(millisecondsTimeout);
}
else
{
// Track the time the we start waiting.
long startTime = Stopwatch.GetTimestamp();
// Polling loop
while (true)
{
bool createdTask = false;
CancellationTokenSource? cts = null;
Task waitTask;
// We're in a polling loop... determine how much time remains
int remainingTimeout = millisecondsTimeout == Timeout.Infinite ?
Timeout.Infinite :
(int)Math.Max(millisecondsTimeout - ((Stopwatch.GetTimestamp() - startTime) / (double)Stopwatch.Frequency * 1000), 0);
lock (_gate)
{
// If we already know that the process exited, we're done.
if (_exited)
{
return true;
}
// If a timeout of 0 was supplied, then we simply need to poll
// to see if the process has already exited.
if (remainingTimeout == 0)
{
// If there's currently a wait-in-progress, then we know the other process
// hasn't exited (barring races and the polling interval).
if (_waitInProgress != null)
{
return false;
}
// No one else is checking for the process' exit... so check.
// We're currently holding the _gate lock, so we don't want to
// allow CheckForNonChildExit to block indefinitely.
CheckForNonChildExit();
return _exited;
}
// The process has not yet exited (or at least we don't know it yet)
// so we need to wait for it to exit, outside of the lock.
// If there's already a wait in progress, we'll do so later
// by waiting on that existing task. Otherwise, we'll spin up
// such a task.
if (_waitInProgress != null)
{
waitTask = _waitInProgress;
}
else
{
createdTask = true;
CancellationToken token = remainingTimeout == Timeout.Infinite ?
CancellationToken.None :
(cts = new CancellationTokenSource(remainingTimeout)).Token;
waitTask = WaitForExitAsync(token);
}
} // lock(_gate)
if (createdTask)
{
// We created this task, and it'll get canceled automatically after our timeout.
// This Wait should only wake up when either the process has exited or the timeout
// has expired. Either way, we'll loop around again; if the process exited, that'll
// be caught first thing in the loop where we check _exited, and if it didn't exit,
// our remaining time will be zero, so we'll do a quick remaining check and bail.
waitTask.Wait();
cts?.Dispose();
}
else
{
// It's someone else's task. We'll wait for it to complete. This could complete
// either because our remainingTimeout expired or because the task completed,
// which could happen because the process exited or because whoever created
// that task gave it a timeout. In any case, we'll loop around again, and the loop
// will catch these cases, potentially issuing another wait to make up any
// remaining time.
waitTask.Wait(remainingTimeout);
}
}
}
}
/// <summary>Spawns an asynchronous polling loop for process completion.</summary>
/// <param name="cancellationToken">A token to monitor to exit the polling loop.</param>
/// <returns>The task representing the loop.</returns>
private Task WaitForExitAsync(CancellationToken cancellationToken = default)
{
Debug.Assert(Monitor.IsEntered(_gate));
Debug.Assert(_waitInProgress == null);
Debug.Assert(!_isChild);
return _waitInProgress = Task.Run(async delegate // Task.Run used because of potential blocking in CheckForNonChildExit
{
// Arbitrary values chosen to balance delays with polling overhead. Start with fast polling
// to handle quickly completing processes, but fall back to longer polling to minimize
// overhead for those that take longer to complete.
const int StartingPollingIntervalMs = 1, MaxPollingIntervalMs = 100;
int pollingIntervalMs = StartingPollingIntervalMs;
try
{
// While we're not canceled
while (!cancellationToken.IsCancellationRequested)
{
// Poll
lock (_gate)
{
if (!_exited)
{
CheckForNonChildExit();
}
if (_exited) // may have been updated by CheckForNonChildExit
{
return;
}
}
// Wait
try
{
await Task.Delay(pollingIntervalMs, cancellationToken).ConfigureAwait(false);
pollingIntervalMs = Math.Min(pollingIntervalMs * 2, MaxPollingIntervalMs);
}
catch (OperationCanceledException) { }
}
}
finally
{
// Task is no longer active
lock (_gate)
{
_waitInProgress = null;
}
}
}, cancellationToken);
}
private bool TryReapChild(bool configureConsole)
{
lock (_gate)
{
if (_exited)
{
return false;
}
// Try to get the state of the child process
int exitCode;
int waitResult = Interop.Sys.WaitPidExitedNoHang(_processId, out exitCode);
if (waitResult == _processId)
{
_exitCode = exitCode;
if (_usesTerminal)
{
// Update terminal settings before calling SetExited.
Process.ConfigureTerminalForChildProcesses(-1, configureConsole);
}
SetExited();
return true;
}
else if (waitResult == 0)
{
// Process is still running
}
else
{
// Unexpected.
int errorCode = Marshal.GetLastWin32Error();
Environment.FailFast("Error while reaping child. errno = " + errorCode);
}
return false;
}
}
internal static void CheckChildren(bool reapAll, bool configureConsole)
{
// This is called on SIGCHLD from a native thread.
// A lock in Process ensures no new processes are spawned while we are checking.
lock (s_childProcessWaitStates)
{
bool checkAll = false;
// Check terminated processes.
int pid;
do
{
// Find a process that terminated without reaping it yet.
pid = Interop.Sys.WaitIdAnyExitedNoHangNoWait();
if (pid > 0)
{
if (s_childProcessWaitStates.TryGetValue(pid, out ProcessWaitState? pws))
{
// Known Process.
if (pws.TryReapChild(configureConsole))
{
pws.ReleaseRef();
}
}
else
{
// unlikely: This is not a managed Process, so we are not responsible for reaping.
// Fall back to checking all Processes.
checkAll = true;
break;
}
}
else if (pid == 0)
{
// No more terminated children.
}
else
{
// Unexpected.
int errorCode = Marshal.GetLastWin32Error();
Environment.FailFast("Error while checking for terminated children. errno = " + errorCode);
}
} while (pid > 0);
if (checkAll)
{
// We track things to unref so we don't invalidate our iterator by changing s_childProcessWaitStates.
ProcessWaitState? firstToRemove = null;
List<ProcessWaitState>? additionalToRemove = null;
foreach (KeyValuePair<int, ProcessWaitState> kv in s_childProcessWaitStates)
{
ProcessWaitState pws = kv.Value;
if (pws.TryReapChild(configureConsole))
{
if (firstToRemove == null)
{
firstToRemove = pws;
}
else
{
if (additionalToRemove == null)
{
additionalToRemove = new List<ProcessWaitState>();
}
additionalToRemove.Add(pws);
}
}
}
if (firstToRemove != null)
{
firstToRemove.ReleaseRef();
if (additionalToRemove != null)
{
foreach (ProcessWaitState pws in additionalToRemove)
{
pws.ReleaseRef();
}
}
}
}
if (reapAll)
{
do
{
pid = Interop.Sys.WaitPidExitedNoHang(-1, out _);
} while (pid > 0);
}
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace System.Diagnostics
{
// Overview
// --------
// We have a few constraints we're working under here:
// - waitid is used on Unix to get the exit status (including exit code) of a child process, but once a child
// process is reaped, it is no longer possible to get the status.
// - The Process design allows for multiple independent Process objects to be handed out, and each of those
// objects may be used concurrently with each other, even if they refer to the same underlying process.
// Same with ProcessWaitHandle objects. This is based on the Windows design where anyone with a handle to the
// process can retrieve completion information about that process.
// - There is no good Unix equivalent to asynchronously be notified of a non-child process' exit, which means such
// support needs to be layered on top of kill.
//
// As a result, we have the following scheme:
// - We maintain a static/shared table that maps process ID to ProcessWaitState objects.
// Access to this table requires taking a global lock, so we try to minimize the number of
// times we need to access the table, primarily just the first time a Process object needs
// access to process exit/wait information and subsequently when that Process object gets GC'd.
// - Each process holds a ProcessWaitState.Holder object; when that object is constructed,
// it ensures there's an appropriate entry in the mapping table and increments that entry's ref count.
// - When a Process object is dropped and its ProcessWaitState.Holder is finalized, it'll
// decrement the ref count, and when no more process objects exist for a particular process ID,
// that entry in the table will be cleaned up.
// - This approach effectively allows for multiple independent Process objects for the same process ID to all
// share the same ProcessWaitState. And since they are sharing the same wait state object,
// the wait state object uses its own lock to protect the per-process state. This includes
// caching exit / exit code / exit time information so that a Process object for a process that's already
// had waitpid called for it can get at its exit information.
// - When we detect a recycled pid, we remove that ProcessWaitState from the table and replace it with a new one
// that represents the new process. For child processes we know a pid is recycled when we see the pid of a new
// child is already in the table. For non-child processes, we assume that a pid may be recycled as soon as
// we've observed it has exited.
/// <summary>Exit information and waiting capabilities for a process.</summary>
internal sealed class ProcessWaitState : IDisposable
{
/// <summary>
/// Finalizable holder for a process wait state. Instantiating one
/// will ensure that a wait state object exists for a process, will
/// grab it, and will increment its ref count. Dropping or disposing
/// one will decrement the ref count and clean up after it if the ref
/// count hits zero.
/// </summary>
internal sealed class Holder : IDisposable
{
internal ProcessWaitState _state;
internal Holder(int processId, bool isNewChild = false, bool usesTerminal = false)
{
_state = ProcessWaitState.AddRef(processId, isNewChild, usesTerminal);
}
~Holder()
{
// Don't try to Dispose resources (like ManualResetEvents) if
// the process is shutting down.
if (_state != null && !Environment.HasShutdownStarted)
{
_state.ReleaseRef();
}
}
public void Dispose()
{
if (_state != null)
{
GC.SuppressFinalize(this);
_state.ReleaseRef();
_state = null!;
}
}
}
/// <summary>
/// Global table that maps process IDs of non-child Processes to the associated shared wait state information.
/// </summary>
private static readonly Dictionary<int, ProcessWaitState> s_processWaitStates =
new Dictionary<int, ProcessWaitState>();
/// <summary>
/// Global table that maps process IDs of child Processes to the associated shared wait state information.
/// </summary>
private static readonly Dictionary<int, ProcessWaitState> s_childProcessWaitStates =
new Dictionary<int, ProcessWaitState>();
/// <summary>
/// Ensures that the mapping table contains an entry for the process ID,
/// increments its ref count, and returns it.
/// </summary>
/// <param name="processId">The process ID for which we need wait state.</param>
/// <param name="isNewChild">Whether the wait state will represent a newly created child process.</param>
/// <param name="usesTerminal">Whether the wait state will represent a process that is expected to use the terminal.</param>
/// <returns>The wait state object.</returns>
internal static ProcessWaitState AddRef(int processId, bool isNewChild, bool usesTerminal)
{
lock (s_childProcessWaitStates)
{
ProcessWaitState? pws;
if (isNewChild)
{
// When the PID is recycled for a new child, we remove the old child.
s_childProcessWaitStates.Remove(processId);
pws = new ProcessWaitState(processId, isChild: true, usesTerminal);
s_childProcessWaitStates.Add(processId, pws);
pws._outstandingRefCount++; // For Holder
pws._outstandingRefCount++; // Decremented in CheckChildren
}
else
{
lock (s_processWaitStates)
{
DateTime exitTime = default;
// We are referencing an existing process.
// This may be a child process, so we check s_childProcessWaitStates too.
if (s_childProcessWaitStates.TryGetValue(processId, out pws))
{
// child process
}
else if (s_processWaitStates.TryGetValue(processId, out pws))
{
// This is best effort for dealing with recycled pids for non-child processes.
// As long as we haven't observed process exit, it's safe to share the ProcessWaitState.
// Once we've observed the exit, we'll create a new ProcessWaitState just in case
// this may be a recycled pid.
// If it wasn't, that ProcessWaitState will observe too that the process has exited.
// We pass the ExitTime so it can be the same, but we'll clear it when we see there
// is a live process with that pid.
if (pws.GetExited(out _, refresh: false))
{
s_processWaitStates.Remove(processId);
exitTime = pws.ExitTime;
pws = null;
}
}
if (pws == null)
{
pws = new ProcessWaitState(processId, isChild: false, usesTerminal: false, exitTime);
s_processWaitStates.Add(processId, pws);
}
pws._outstandingRefCount++;
}
}
return pws;
}
}
/// <summary>
/// Decrements the ref count on the wait state object, and if it's the last one,
/// removes it from the table.
/// </summary>
internal void ReleaseRef()
{
ProcessWaitState? pws;
Dictionary<int, ProcessWaitState> waitStates = _isChild ? s_childProcessWaitStates : s_processWaitStates;
lock (waitStates)
{
bool foundState = waitStates.TryGetValue(_processId, out pws);
Debug.Assert(foundState);
if (foundState)
{
--_outstandingRefCount;
if (_outstandingRefCount == 0)
{
// The dictionary may contain a different ProcessWaitState if the pid was recycled.
if (pws == this)
{
waitStates.Remove(_processId);
}
pws = this;
}
else
{
pws = null;
}
}
}
pws?.Dispose();
}
/// <summary>
/// Synchronization object used to protect all instance state. Any number of
/// Process and ProcessWaitHandle objects may be using a ProcessWaitState
/// instance concurrently.
/// </summary>
private readonly object _gate = new object();
/// <summary>ID of the associated process.</summary>
private readonly int _processId;
/// <summary>Associated process is a child process.</summary>
private readonly bool _isChild;
/// <summary>Associated process is a child that can use the terminal.</summary>
private readonly bool _usesTerminal;
/// <summary>If a wait operation is in progress, the Task that represents it; otherwise, null.</summary>
private Task? _waitInProgress;
/// <summary>The number of alive users of this object.</summary>
private int _outstandingRefCount;
/// <summary>Whether the associated process exited.</summary>
private bool _exited;
/// <summary>If the process exited, it's exit code, or null if we were unable to determine one.</summary>
private int? _exitCode;
/// <summary>
/// The approximate time the process exited. We do not have the ability to know exact time a process
/// exited, so we approximate it by storing the time that we discovered it exited.
/// </summary>
private DateTime _exitTime;
/// <summary>A lazily-initialized event set when the process exits.</summary>
private ManualResetEvent? _exitedEvent;
/// <summary>Initialize the wait state object.</summary>
/// <param name="processId">The associated process' ID.</param>
/// <param name="isChild">Whether the target process is a child of the current process.</param>
/// <param name="usesTerminal">Whether the target process is expected to use the terminal.</param>
/// <param name="exitTime">The approximate time the process exited.</param>
private ProcessWaitState(int processId, bool isChild, bool usesTerminal, DateTime exitTime = default)
{
Debug.Assert(processId >= 0);
_processId = processId;
_isChild = isChild;
_usesTerminal = usesTerminal;
_exitTime = exitTime;
}
/// <summary>Releases managed resources used by the ProcessWaitState.</summary>
public void Dispose()
{
Debug.Assert(!Monitor.IsEntered(_gate));
lock (_gate)
{
if (_exitedEvent != null)
{
_exitedEvent.Dispose();
_exitedEvent = null;
}
}
}
/// <summary>Notes that the process has exited.</summary>
private void SetExited()
{
Debug.Assert(Monitor.IsEntered(_gate));
_exited = true;
if (_exitTime == default)
{
_exitTime = DateTime.Now;
}
_exitedEvent?.Set();
}
/// <summary>Ensures an exited event has been initialized and returns it.</summary>
/// <returns></returns>
internal ManualResetEvent EnsureExitedEvent()
{
Debug.Assert(!Monitor.IsEntered(_gate));
lock (_gate)
{
// If we already have an initialized event, just return it.
if (_exitedEvent == null)
{
// If we don't, create one, and if the process hasn't yet exited,
// make sure we have a task that's actively monitoring the completion state.
_exitedEvent = new ManualResetEvent(initialState: _exited);
if (!_exited)
{
if (!_isChild)
{
// If we haven't exited, we need to spin up an asynchronous operation that
// will completed the exitedEvent when the other process exits. If there's already
// another operation underway, then we'll just tack ours onto the end of it.
_waitInProgress = _waitInProgress == null ?
WaitForExitAsync() :
_waitInProgress.ContinueWith((_, state) => ((ProcessWaitState)state!).WaitForExitAsync(),
this, CancellationToken.None, TaskContinuationOptions.None, TaskScheduler.Default).Unwrap();
}
}
}
return _exitedEvent;
}
}
internal DateTime ExitTime
{
get
{
lock (_gate)
{
Debug.Assert(_exited);
return _exitTime;
}
}
}
internal bool HasExited
{
get
{
return GetExited(out _, refresh: true);
}
}
internal bool GetExited(out int? exitCode, bool refresh)
{
lock (_gate)
{
// Have we already exited? If so, return the cached results.
if (_exited)
{
exitCode = _exitCode;
return true;
}
// Is another wait operation in progress? If so, then we haven't exited,
// and that task owns the right to call CheckForNonChildExit.
if (_waitInProgress != null)
{
exitCode = null;
return false;
}
if (refresh)
{
// We don't know if we've exited, but no one else is currently
// checking, so check.
CheckForNonChildExit();
}
// We now have an up-to-date snapshot for whether we've exited,
// and if we have, what the exit code is (if we were able to find out).
exitCode = _exitCode;
return _exited;
}
}
private void CheckForNonChildExit()
{
Debug.Assert(Monitor.IsEntered(_gate));
if (!_isChild)
{
bool exited;
// We won't be able to get an exit code, but we'll at least be able to determine if the process is
// still running.
int killResult = Interop.Sys.Kill(_processId, Interop.Sys.Signals.None); // None means don't send a signal
if (killResult == 0)
{
// Process is still running. This could also be a defunct process that has completed
// its work but still has an entry in the processes table due to its parent not yet
// having waited on it to clean it up.
exited = false;
}
else // error from kill
{
Interop.Error errno = Interop.Sys.GetLastError();
if (errno == Interop.Error.ESRCH)
{
// Couldn't find the process; assume it's exited
exited = true;
}
else if (errno == Interop.Error.EPERM)
{
// Don't have permissions to the process; assume it's alive
exited = false;
}
else
{
Debug.Fail("Unexpected errno value from kill");
exited = true;
}
}
if (exited)
{
SetExited();
}
else
{
_exitTime = default;
}
}
}
/// <summary>Waits for the associated process to exit.</summary>
/// <param name="millisecondsTimeout">The amount of time to wait, or -1 to wait indefinitely.</param>
/// <returns>true if the process exited; false if the timeout occurred.</returns>
internal bool WaitForExit(int millisecondsTimeout)
{
Debug.Assert(!Monitor.IsEntered(_gate));
if (_isChild)
{
lock (_gate)
{
// If we already know that the process exited, we're done.
if (_exited)
{
return true;
}
}
ManualResetEvent exitEvent = EnsureExitedEvent();
return exitEvent.WaitOne(millisecondsTimeout);
}
else
{
// Track the time the we start waiting.
long startTime = Stopwatch.GetTimestamp();
// Polling loop
while (true)
{
bool createdTask = false;
CancellationTokenSource? cts = null;
Task waitTask;
// We're in a polling loop... determine how much time remains
int remainingTimeout = millisecondsTimeout == Timeout.Infinite ?
Timeout.Infinite :
(int)Math.Max(millisecondsTimeout - Stopwatch.GetElapsedTime(startTime).TotalMilliseconds, 0);
lock (_gate)
{
// If we already know that the process exited, we're done.
if (_exited)
{
return true;
}
// If a timeout of 0 was supplied, then we simply need to poll
// to see if the process has already exited.
if (remainingTimeout == 0)
{
// If there's currently a wait-in-progress, then we know the other process
// hasn't exited (barring races and the polling interval).
if (_waitInProgress != null)
{
return false;
}
// No one else is checking for the process' exit... so check.
// We're currently holding the _gate lock, so we don't want to
// allow CheckForNonChildExit to block indefinitely.
CheckForNonChildExit();
return _exited;
}
// The process has not yet exited (or at least we don't know it yet)
// so we need to wait for it to exit, outside of the lock.
// If there's already a wait in progress, we'll do so later
// by waiting on that existing task. Otherwise, we'll spin up
// such a task.
if (_waitInProgress != null)
{
waitTask = _waitInProgress;
}
else
{
createdTask = true;
CancellationToken token = remainingTimeout == Timeout.Infinite ?
CancellationToken.None :
(cts = new CancellationTokenSource(remainingTimeout)).Token;
waitTask = WaitForExitAsync(token);
}
} // lock(_gate)
if (createdTask)
{
// We created this task, and it'll get canceled automatically after our timeout.
// This Wait should only wake up when either the process has exited or the timeout
// has expired. Either way, we'll loop around again; if the process exited, that'll
// be caught first thing in the loop where we check _exited, and if it didn't exit,
// our remaining time will be zero, so we'll do a quick remaining check and bail.
waitTask.Wait();
cts?.Dispose();
}
else
{
// It's someone else's task. We'll wait for it to complete. This could complete
// either because our remainingTimeout expired or because the task completed,
// which could happen because the process exited or because whoever created
// that task gave it a timeout. In any case, we'll loop around again, and the loop
// will catch these cases, potentially issuing another wait to make up any
// remaining time.
waitTask.Wait(remainingTimeout);
}
}
}
}
/// <summary>Spawns an asynchronous polling loop for process completion.</summary>
/// <param name="cancellationToken">A token to monitor to exit the polling loop.</param>
/// <returns>The task representing the loop.</returns>
private Task WaitForExitAsync(CancellationToken cancellationToken = default)
{
Debug.Assert(Monitor.IsEntered(_gate));
Debug.Assert(_waitInProgress == null);
Debug.Assert(!_isChild);
return _waitInProgress = Task.Run(async delegate // Task.Run used because of potential blocking in CheckForNonChildExit
{
// Arbitrary values chosen to balance delays with polling overhead. Start with fast polling
// to handle quickly completing processes, but fall back to longer polling to minimize
// overhead for those that take longer to complete.
const int StartingPollingIntervalMs = 1, MaxPollingIntervalMs = 100;
int pollingIntervalMs = StartingPollingIntervalMs;
try
{
// While we're not canceled
while (!cancellationToken.IsCancellationRequested)
{
// Poll
lock (_gate)
{
if (!_exited)
{
CheckForNonChildExit();
}
if (_exited) // may have been updated by CheckForNonChildExit
{
return;
}
}
// Wait
try
{
await Task.Delay(pollingIntervalMs, cancellationToken).ConfigureAwait(false);
pollingIntervalMs = Math.Min(pollingIntervalMs * 2, MaxPollingIntervalMs);
}
catch (OperationCanceledException) { }
}
}
finally
{
// Task is no longer active
lock (_gate)
{
_waitInProgress = null;
}
}
}, cancellationToken);
}
private bool TryReapChild(bool configureConsole)
{
lock (_gate)
{
if (_exited)
{
return false;
}
// Try to get the state of the child process
int exitCode;
int waitResult = Interop.Sys.WaitPidExitedNoHang(_processId, out exitCode);
if (waitResult == _processId)
{
_exitCode = exitCode;
if (_usesTerminal)
{
// Update terminal settings before calling SetExited.
Process.ConfigureTerminalForChildProcesses(-1, configureConsole);
}
SetExited();
return true;
}
else if (waitResult == 0)
{
// Process is still running
}
else
{
// Unexpected.
int errorCode = Marshal.GetLastWin32Error();
Environment.FailFast("Error while reaping child. errno = " + errorCode);
}
return false;
}
}
internal static void CheckChildren(bool reapAll, bool configureConsole)
{
// This is called on SIGCHLD from a native thread.
// A lock in Process ensures no new processes are spawned while we are checking.
lock (s_childProcessWaitStates)
{
bool checkAll = false;
// Check terminated processes.
int pid;
do
{
// Find a process that terminated without reaping it yet.
pid = Interop.Sys.WaitIdAnyExitedNoHangNoWait();
if (pid > 0)
{
if (s_childProcessWaitStates.TryGetValue(pid, out ProcessWaitState? pws))
{
// Known Process.
if (pws.TryReapChild(configureConsole))
{
pws.ReleaseRef();
}
}
else
{
// unlikely: This is not a managed Process, so we are not responsible for reaping.
// Fall back to checking all Processes.
checkAll = true;
break;
}
}
else if (pid == 0)
{
// No more terminated children.
}
else
{
// Unexpected.
int errorCode = Marshal.GetLastWin32Error();
Environment.FailFast("Error while checking for terminated children. errno = " + errorCode);
}
} while (pid > 0);
if (checkAll)
{
// We track things to unref so we don't invalidate our iterator by changing s_childProcessWaitStates.
ProcessWaitState? firstToRemove = null;
List<ProcessWaitState>? additionalToRemove = null;
foreach (KeyValuePair<int, ProcessWaitState> kv in s_childProcessWaitStates)
{
ProcessWaitState pws = kv.Value;
if (pws.TryReapChild(configureConsole))
{
if (firstToRemove == null)
{
firstToRemove = pws;
}
else
{
if (additionalToRemove == null)
{
additionalToRemove = new List<ProcessWaitState>();
}
additionalToRemove.Add(pws);
}
}
}
if (firstToRemove != null)
{
firstToRemove.ReleaseRef();
if (additionalToRemove != null)
{
foreach (ProcessWaitState pws in additionalToRemove)
{
pws.ReleaseRef();
}
}
}
}
if (reapAll)
{
do
{
pid = Interop.Sys.WaitPidExitedNoHang(-1, out _);
} while (pid > 0);
}
}
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Http/src/System.Net.Http.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WindowsRID>win</WindowsRID>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);HTTP_DLL</DefineConstants>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_NetHttp</GeneratePlatformNotSupportedAssemblyMessage>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst'">$(DefineConstants);SYSNETHTTP_NO_OPENSSL</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'">$(DefineConstants);TARGET_MOBILE</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'Android'">$(DefineConstants);TARGET_ANDROID</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'iOS'">$(DefineConstants);TARGET_IOS</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'MacCatalyst'">$(DefineConstants);TARGET_MACCATALYST</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'tvOS'">$(DefineConstants);TARGET_TVOS</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'Browser'">$(DefineConstants);TARGET_BROWSER</DefineConstants>
<!-- ILLinker settings -->
<ILLinkDirectory>$(MSBuildThisFileDirectory)ILLink\</ILLinkDirectory>
</PropertyGroup>
<ItemGroup>
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS' or '$(TargetPlatformIdentifier)' == 'Browser'">
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.mobile.xml" Condition="'$(TargetPlatformIdentifier)' != 'Browser'" />
<ILLinkSuppressionsXmls Include="$(ILLinkDirectory)ILLink.Suppressions.Mobile.LibraryBuild.xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\Http\ByteArrayContent.cs" />
<Compile Include="System\Net\Http\ByteArrayHelpers.cs" />
<Compile Include="System\Net\Http\CancellationHelper.cs" />
<Compile Include="System\Net\Http\ClientCertificateOption.cs" />
<Compile Include="System\Net\Http\DelegatingHandler.cs" />
<Compile Include="System\Net\Http\DiagnosticsHandler.cs" />
<Compile Include="System\Net\Http\DiagnosticsHandlerLoggingStrings.cs" />
<Compile Include="System\Net\Http\EmptyContent.cs" />
<Compile Include="System\Net\Http\EmptyReadStream.cs" />
<Compile Include="System\Net\Http\FormUrlEncodedContent.cs" />
<Compile Include="System\Net\Http\GlobalHttpSettings.cs" />
<Compile Include="System\Net\Http\HeaderEncodingSelector.cs" />
<Compile Include="System\Net\Http\Headers\KnownHeader.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaderType.cs" />
<Compile Include="System\Net\Http\Headers\KnownHeaders.cs" />
<Compile Include="System\Net\Http\HttpBaseStream.cs" />
<Compile Include="System\Net\Http\HttpClient.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'"
Include="System\Net\Http\HttpClientHandler.AnyMobile.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'"
Include="System\Net\Http\HttpClientHandler.AnyMobile.InvokeNativeHandler.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' != 'Android' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'MacCatalyst' and '$(TargetPlatformIdentifier)' != 'tvOS'"
Include="System\Net\Http\HttpClientHandler.cs" />
<Compile Include="System\Net\Http\HttpCompletionOption.cs" />
<Compile Include="System\Net\Http\HttpContent.cs" />
<Compile Include="System\Net\Http\HttpMessageHandler.cs" />
<Compile Include="System\Net\Http\HttpMessageInvoker.cs" />
<Compile Include="System\Net\Http\HttpMethod.cs" />
<Compile Include="System\Net\Http\HttpParseResult.cs" />
<Compile Include="System\Net\Http\HttpRequestException.cs" />
<Compile Include="System\Net\Http\HttpRequestMessage.cs" />
<Compile Include="System\Net\Http\HttpRequestOptions.cs" />
<Compile Include="System\Net\Http\HttpRequestOptionsKey.cs" />
<Compile Include="System\Net\Http\HttpResponseMessage.cs" />
<Compile Include="System\Net\Http\HttpRuleParser.cs" />
<Compile Include="System\Net\Http\HttpTelemetry.cs" />
<Compile Include="System\Net\Http\HttpVersionPolicy.cs" />
<Compile Include="System\Net\Http\MessageProcessingHandler.cs" />
<Compile Include="System\Net\Http\MultipartContent.cs" />
<Compile Include="System\Net\Http\MultipartFormDataContent.cs" />
<Compile Include="System\Net\Http\NetEventSource.Http.cs" />
<Compile Include="System\Net\Http\ReadOnlyMemoryContent.cs" />
<Compile Include="System\Net\Http\RequestRetryType.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpMessageHandlerStage.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\RuntimeSettingParser.cs" />
<Compile Include="System\Net\Http\StreamContent.cs" />
<Compile Include="System\Net\Http\StreamToStreamCopy.cs" />
<Compile Include="System\Net\Http\StringContent.cs" />
<Compile Include="System\Net\Http\Headers\AuthenticationHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\BaseHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\ByteArrayHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\CacheControlHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\CacheControlHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\ContentDispositionHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\ContentRangeHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\DateHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\EntityTagHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\GenericHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\HeaderDescriptor.cs" />
<Compile Include="System\Net\Http\Headers\HeaderStringValues.cs" />
<Compile Include="System\Net\Http\Headers\HeaderUtilities.cs" />
<Compile Include="System\Net\Http\Headers\HttpContentHeaders.cs" />
<Compile Include="System\Net\Http\Headers\HttpGeneralHeaders.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaders.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeadersNonValidated.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaderValueCollection.cs" />
<Compile Include="System\Net\Http\Headers\HttpRequestHeaders.cs" />
<Compile Include="System\Net\Http\Headers\HttpResponseHeaders.cs" />
<Compile Include="System\Net\Http\Headers\Int32NumberHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\Int64NumberHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\MediaTypeHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\MediaTypeHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\MediaTypeWithQualityHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\NameValueHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\NameValueWithParametersHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\ObjectCollection.cs" />
<Compile Include="System\Net\Http\Headers\ProductHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\ProductInfoHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\ProductInfoHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\QPackStaticTable.cs" />
<Compile Include="System\Net\Http\Headers\RangeConditionHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\RangeHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\RangeItemHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\RetryConditionHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\StringWithQualityHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\TimeSpanHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\TransferCodingHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\TransferCodingHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\TransferCodingWithQualityHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\UriHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\ViaHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\WarningHeaderValue.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpPlaintextStreamFilterContext.cs" />
<Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
Link="Common\DisableRuntimeMarshalling.cs" />
<Compile Include="$(CommonPath)System\IO\DelegatingStream.cs"
Link="Common\System\IO\DelegatingStream.cs" />
<Compile Include="$(CommonPath)System\IO\ReadOnlyMemoryStream.cs"
Link="Common\System\IO\ReadOnlyMemoryStream.cs" />
<Compile Include="$(CommonPath)System\Text\StringBuilderCache.cs"
Link="Common\System\Text\StringBuilderCache.cs" />
<Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
<Compile Include="$(CommonPath)System\Net\HttpDateParser.cs"
Link="Common\System\Net\HttpDateParser.cs" />
<Compile Include="$(CommonPath)System\Text\SimpleRegex.cs"
Link="Common\System\Text\SimpleRegex.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs"
Link="Common\System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs" />
<Compile Include="$(CommonPath)System\HexConverter.cs"
Link="Common\System\HexConverter.cs" />
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs"
Link="Common\System\Net\ArrayBuffer.cs"/>
<Compile Include="$(CommonPath)System\Net\MultiArrayBuffer.cs"
Link="Common\System\Net\MultiArrayBuffer.cs"/>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.cs"
Link="Common\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.cs" />
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs"
Link="Common\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs" />
</ItemGroup>
<!-- SocketsHttpHandler implementation -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'Browser'">
<Compile Include="System\Net\Http\HttpHandlerDefaults.cs" />
<Compile Include="System\Net\Http\HttpMethod.Http3.cs" />
<Compile Include="System\Net\Http\Headers\AltSvcHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\AltSvcHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\KnownHeader.Http2And3.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' != 'tvOS'" Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ChunkedEncodingWriteStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ConnectHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CookieHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CreditManager.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CreditWaiter.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\FailedProxyCache.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2Connection.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2ConnectionException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2ProtocolErrorCode.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2ProtocolException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2Stream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2StreamException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http3Connection.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http3ConnectionException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http3ProtocolException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpAuthenticatedConnectionHandler.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpAuthority.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnection.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionHandler.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionKind.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionResponseContent.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionSettings.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpContentStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpKeepAlivePingPolicy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpUtilities.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\IHttpTrace.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\IMultiWebProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\MultiProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\RedirectHandler.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpConnectionContext.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs" />
<Compile Include="System\Net\Http\HttpTelemetry.AnyOS.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocksHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocksException.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' != 'tvOS'" Include="$(CommonPath)System\Net\NTAuthentication.Common.cs"
Link="Common\System\Net\NTAuthentication.Common.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsPal.cs"
Link="Common\System\Net\ContextFlagsPal.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityStatusPal.cs"
Link="Common\System\Net\SecurityStatusPal.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SafeCredentialReference.cs"
Link="Common\System\Net\Security\SafeCredentialReference.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SSPIHandleCache.cs"
Link="Common\System\Net\Security\SSPIHandleCache.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SslClientAuthenticationOptionsExtensions.cs"
Link="Common\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NetEventSource.Security.cs"
Link="Common\System\Net\Security\NetEventSource.Security.cs" />
<Compile Include="$(CommonPath)System\Net\ExceptionCheck.cs"
Link="Common\System\Net\ExceptionCheck.cs" />
<Compile Include="$(CommonPath)System\Collections\Generic\BidirectionalDictionary.cs"
Link="Common\System\Collections\Generic\BidirectionalDictionary.cs" />
<Compile Include="$(CommonPath)System\NotImplemented.cs"
Link="Common\System\NotImplemented.cs" />
<Compile Include="$(CommonPath)System\Net\NegotiationInfoClass.cs"
Link="Common\System\Net\NegotiationInfoClass.cs" />
<Compile Include="$(CommonPath)System\Net\InternalException.cs"
Link="Common\System\Net\InternalException.cs" />
<Compile Include="$(CommonPath)System\Net\DebugSafeHandle.cs"
Link="Common\System\Net\DebugSafeHandle.cs" />
<Compile Include="$(CommonPath)System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs"
Link="Common\System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs" />
<Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
Link="Common\System\Text\ValueStringBuilder.cs" />
<Compile Include="$(CommonPath)Extensions\ValueStopwatch\ValueStopwatch.cs"
Link="Common\Extensions\ValueStopwatch\ValueStopwatch.cs" />
<!-- Header support -->
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\IHttpStreamHeadersHandler.cs">
<Link>Common\System\Net\Http\aspnetcore\IHttpStreamHeadersHandler.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HuffmanDecodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HuffmanDecodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.Http2.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.Http2.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Http3SettingType.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Http3SettingType.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Http3StreamType.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Http3StreamType.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Frames\Http3ErrorCode.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Frames\Http3ErrorCode.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Frames\Http3FrameType.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Frames\Http3FrameType.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\QPackDecodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\QPackDecodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\QPackEncodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\QPackEncodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.Http3.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.Http3.cs</Link>
</Compile>
</ItemGroup>
<!-- Linux specific files -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Linux' or '$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'Browser' ">
<Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs"
Link="Common\Interop\Linux\Interop.Libraries.cs" />
</ItemGroup>
<!-- FreeBSD specific files -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'FreeBSD' ">
<Compile Include="$(CommonPath)Interop\FreeBSD\Interop.Libraries.cs"
Link="Common\Interop\FreeBSD\Interop.Libraries.cs" />
</ItemGroup>
<!-- SocketsHttpHandler platform parts -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser'">
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.Unix.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CurrentUserIdentityProvider.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Unix.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeCredentials.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SecChannelBindings.cs"
Link="Common\System\Net\Security\Unix\SecChannelBindings.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.GssFlags.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.GssFlags.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Status.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Status.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteNegoContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteNegoContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeNegoCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeNegoCredentials.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.Unix.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'tvOS'">
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.tvOS.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.PlatformNotSupported.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.PlatformNotSupported.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'OSX' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.OSX.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\MacProxy.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFArray.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFArray.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFData.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFData.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFDictionary.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFDictionary.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFProxy.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFProxy.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFUrl.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFUrl.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFString.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFString.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFNumber.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFString.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFError.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFError.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.RunLoop.cs"
Link="Common\Interop\OSX\Interop.RunLoop.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs"
Link="Common\Interop\OSX\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<Compile Include="$(CommonPath)\System\Net\HttpStatusDescription.cs"
Link="Common\System\Net\HttpStatusDescription.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.Windows.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.Windows.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpWindowsProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CurrentUserIdentityProvider.Windows.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
Link="Common\Interop\Windows\Interop.BOOL.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.UNICODE_STRING.cs"
Link="Common\Interop\Windows\Interop.UNICODE_STRING.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_INFO.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_INFO.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CRYPT_ALGORITHM_IDENTIFIER.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CRYPT_ALGORITHM_IDENTIFIER.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CRYPT_BIT_BLOB.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.DATA_BLOB.cs"
Link="Common\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.MsgEncodingType.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.MsgEncodingType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CertFreeCertificateContext.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CertFreeCertificateContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FormatMessage.cs"
Link="Common\Interop\Windows\Kernel32\Interop.FormatMessage.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\Interop.HRESULT_FROM_WIN32.cs"
Link="Common\Interop\Windows\Interop.HRESULT_FROM_WIN32.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\WinHttp\Interop.SafeWinHttpHandle.cs"
Link="Common\Interop\Windows\WinHttp\Interop.SafeWinHttpHandle.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\WinHttp\Interop.winhttp_types.cs"
Link="Common\Interop\Windows\WinHttp\Interop.winhttp_types.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\WinHttp\Interop.winhttp.cs"
Link="Common\Interop\Windows\WinHttp\Interop.winhttp.cs" />
<Compile Include="$(CommonPath)\System\CharArrayHelpers.cs"
Link="Common\System\CharArrayHelpers.cs" />
<Compile Include="$(CommonPath)\System\StringExtensions.cs"
Link="Common\System\StringExtensions.cs" />
<Compile Include="$(CommonPath)\System\Net\HttpKnownHeaderNames.cs"
Link="Common\System\Net\HttpKnownHeaderNames.cs" />
<Compile Include="$(CommonPath)\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs"
Link="Common\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs" />
<Compile Include="$(CommonPath)\System\Net\SecurityProtocol.cs"
Link="Common\System\Net\SecurityProtocol.cs" />
<Compile Include="$(CommonPath)\System\Net\UriScheme.cs"
Link="Common\System\Net\UriScheme.cs" />
<Compile Include="$(CommonPath)\System\Net\Http\HttpHandlerDefaults.cs"
Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
<Compile Include="$(CommonPath)\System\Net\Http\WinInetProxyHelper.cs"
Link="Common\System\Net\Http\WinInetProxyHelper.cs" />
<Compile Include="$(CommonPath)\System\Net\Security\CertificateHelper.cs"
Link="Common\System\Net\Security\CertificateHelper.cs" />
<Compile Include="$(CommonPath)\System\Net\Security\CertificateHelper.Windows.cs"
Link="Common\System\Net\Security\CertificateHelper.Windows.cs" />
<Compile Include="$(CommonPath)\System\Runtime\ExceptionServices\ExceptionStackTrace.cs"
Link="Common\System\Runtime\ExceptionServices\ExceptionStackTrace.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityBuffer.Windows.cs"
Link="Common\System\Net\Security\SecurityBuffer.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityBufferType.Windows.cs"
Link="Common\System\Net\Security\SecurityBufferType.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityContextTokenHandle.cs"
Link="Common\System\Net\Security\SecurityContextTokenHandle.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityStatusAdapterPal.Windows.cs"
Link="Common\System\Net\SecurityStatusAdapterPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Windows.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.Windows.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NetEventSource.Security.Windows.cs"
Link="Common\System\Net\Security\NetEventSource.Security.Windows.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_Bindings.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_Bindings.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.SECURITY_STATUS.cs"
Link="Common\Interop\Windows\SChannel\Interop.SECURITY_STATUS.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CloseHandle.cs"
Link="Common\Interop\Windows\Kernel32\Interop.CloseHandle.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_NegotiationInfoW.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_NegotiationInfoW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\NegotiationInfoClass.cs"
Link="Common\Interop\Windows\SspiCli\NegotiationInfoClass.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\SecPkgContext_CipherInfo.cs"
Link="Common\Interop\Windows\SChannel\SecPkgContext_CipherInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPISecureChannelType.cs"
Link="Common\Interop\Windows\SspiCli\SSPISecureChannelType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\ISSPIInterface.cs"
Link="Common\Interop\Windows\SspiCli\ISSPIInterface.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIAuthType.cs"
Link="Common\Interop\Windows\SspiCli\SSPIAuthType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecurityPackageInfoClass.cs"
Link="Common\Interop\Windows\SspiCli\SecurityPackageInfoClass.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecurityPackageInfo.cs"
Link="Common\Interop\Windows\SspiCli\SecurityPackageInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_Sizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_Sizes.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SafeDeleteContext.cs"
Link="Common\Interop\Windows\SspiCli\SafeDeleteContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\GlobalSSPI.cs"
Link="Common\Interop\Windows\SspiCli\GlobalSSPI.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\Interop.SSPI.cs"
Link="Common\Interop\Windows\SspiCli\Interop.SSPI.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecuritySafeHandles.cs"
Link="Common\Interop\Windows\SspiCli\SecuritySafeHandles.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIWrapper.cs"
Link="Common\Interop\Windows\SspiCli\SSPIWrapper.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser'">
<Compile Include="$(CommonPath)System\StrongToWeakReference.cs"
Link="Common\Interop\Unix\StrongToWeakReference.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityProtocol.cs"
Link="Common\System\Net\SecurityProtocol.cs" />
<Compile Include="$(CommonPath)System\Net\UriScheme.cs"
Link="Common\System\Net\UriScheme.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Link="Common\Interop\Unix\Interop.Errors.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.IOErrors.cs"
Link="Common\Interop\Unix\Interop.IOErrors.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Close.cs"
Link="Common\Interop\Unix\System.Native\Interop.Close.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Open.cs"
Link="Common\Interop\Unix\System.Native\Interop.Open.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.OpenFlags.cs"
Link="Common\Interop\Unix\System.Native\Interop.OpenFlags.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Pipe.cs"
Link="Common\Interop\Unix\System.Native\Interop.Pipe.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Poll.cs"
Link="Common\Interop\Unix\libc\Interop.Poll.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Poll.Structs.cs"
Link="Common\Interop\Unix\Interop.Poll.Structs.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Read.cs"
Link="Common\Interop\Unix\libc\Interop.Read.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Write.cs"
Link="Common\Interop\Unix\libc\Interop.Write.cs" />
<Compile Include="$(CommonPath)System\CharArrayHelpers.cs"
Link="Common\System\CharArrayHelpers.cs" />
<Compile Include="$(CommonPath)System\StringExtensions.cs"
Link="Common\System\StringExtensions.cs" />
<Compile Include="$(CommonPath)System\Net\HttpKnownHeaderNames.cs"
Link="Common\System\Net\HttpKnownHeaderNames.cs" />
<Compile Include="$(CommonPath)System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs"
Link="Common\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs" />
<Compile Include="$(CommonPath)System\Net\HttpStatusDescription.cs"
Link="Common\System\Net\HttpStatusDescription.cs" />
<Compile Include="$(CommonPath)System\Net\Http\HttpHandlerDefaults.cs"
Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
<Compile Include="$(CommonPath)System\Net\Http\TlsCertificateExtensions.cs"
Link="Common\System\Net\Http\TlsCertificateExtensions" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateHelper.cs"
Link="Common\System\Net\Security\CertificateHelper.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateHelper.Unix.cs"
Link="Common\System\Net\Security\CertificateHelper.Unix.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'OSX' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSslVersion.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSslVersion.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtxOptions.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtxOptions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SetProtocolOptions.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SetProtocolOptions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Name.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Name.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Ext.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Ext.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.Initialization.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeHandleCache.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeHandleCache.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateValidation.Unix.cs"
Link="Common\System\Net\Security\CertificateValidation.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Browser'">
<Compile Include="$(CommonPath)\System\StringExtensions.cs"
Link="Common\System\StringExtensions.cs" />
<Compile Include="$(CommonPath)\System\Net\HttpStatusDescription.cs"
Link="Common\System\Net\HttpStatusDescription.cs" />
<Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
Link="Common\System\Text\ValueStringBuilder.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="System\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpKeepAlivePingPolicy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpConnectionContext.cs" />
<Compile Include="System\Net\Http\BrowserHttpHandler\SystemProxyInfo.Browser.cs" />
<Compile Include="System\Net\Http\BrowserHttpHandler\SocketsHttpHandler.cs" />
<Compile Include="System\Net\Http\BrowserHttpHandler\BrowserHttpHandler.cs" />
<Compile Include="System\Net\Http\BrowserHttpHandler\HttpTelemetry.Browser.cs" />
<Compile Include="$(CommonPath)System\Net\Http\HttpHandlerDefaults.cs"
Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Quic\src\System.Net.Quic.csproj" />
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Console" Condition="'$(Configuration)' == 'Debug'" />
<Reference Include="System.Diagnostics.DiagnosticSource" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.NameResolution" />
<Reference Include="System.Net.NetworkInformation" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Net.Security" />
<Reference Include="System.Net.Sockets" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.Claims" Condition="'$(TargetPlatformIdentifier)' == 'windows'" />
<Reference Include="System.Security.Cryptography" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Security.Cryptography.Csp" />
<Reference Include="System.Security.Cryptography.Encoding" />
<Reference Include="System.Security.Cryptography.OpenSsl" />
<Reference Include="System.Security.Cryptography.X509Certificates" />
<Reference Include="System.Security.Principal" Condition="'$(TargetPlatformIdentifier)' == 'windows'" />
<Reference Include="System.Security.Principal.Windows" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Channels" />
<Reference Include="System.IO.Compression.Brotli" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser'">
<Reference Include="System.Diagnostics.StackTrace" />
<Reference Include="System.IO.FileSystem" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Security.Cryptography.Encoding" />
<Reference Include="System.Security.Cryptography" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Browser'">
<ProjectReference Include="$(LibrariesProjectRoot)System.Private.Runtime.InteropServices.JavaScript\src\System.Private.Runtime.InteropServices.JavaScript.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\SR.resx" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<WindowsRID>win</WindowsRID>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);HTTP_DLL</DefineConstants>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-MacCatalyst;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.PlatformNotSupported_NetHttp</GeneratePlatformNotSupportedAssemblyMessage>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst'">$(DefineConstants);SYSNETHTTP_NO_OPENSSL</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'">$(DefineConstants);TARGET_MOBILE</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'Android'">$(DefineConstants);TARGET_ANDROID</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'iOS'">$(DefineConstants);TARGET_IOS</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'MacCatalyst'">$(DefineConstants);TARGET_MACCATALYST</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'tvOS'">$(DefineConstants);TARGET_TVOS</DefineConstants>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'Browser'">$(DefineConstants);TARGET_BROWSER</DefineConstants>
<!-- ILLinker settings -->
<ILLinkDirectory>$(MSBuildThisFileDirectory)ILLink\</ILLinkDirectory>
</PropertyGroup>
<ItemGroup>
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS' or '$(TargetPlatformIdentifier)' == 'Browser'">
<ILLinkSubstitutionsXmls Include="$(ILLinkDirectory)ILLink.Substitutions.mobile.xml" Condition="'$(TargetPlatformIdentifier)' != 'Browser'" />
<ILLinkSuppressionsXmls Include="$(ILLinkDirectory)ILLink.Suppressions.Mobile.LibraryBuild.xml" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\Http\ByteArrayContent.cs" />
<Compile Include="System\Net\Http\ByteArrayHelpers.cs" />
<Compile Include="System\Net\Http\CancellationHelper.cs" />
<Compile Include="System\Net\Http\ClientCertificateOption.cs" />
<Compile Include="System\Net\Http\DelegatingHandler.cs" />
<Compile Include="System\Net\Http\DiagnosticsHandler.cs" />
<Compile Include="System\Net\Http\DiagnosticsHandlerLoggingStrings.cs" />
<Compile Include="System\Net\Http\EmptyContent.cs" />
<Compile Include="System\Net\Http\EmptyReadStream.cs" />
<Compile Include="System\Net\Http\FormUrlEncodedContent.cs" />
<Compile Include="System\Net\Http\GlobalHttpSettings.cs" />
<Compile Include="System\Net\Http\HeaderEncodingSelector.cs" />
<Compile Include="System\Net\Http\Headers\KnownHeader.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaderType.cs" />
<Compile Include="System\Net\Http\Headers\KnownHeaders.cs" />
<Compile Include="System\Net\Http\HttpBaseStream.cs" />
<Compile Include="System\Net\Http\HttpClient.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'"
Include="System\Net\Http\HttpClientHandler.AnyMobile.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'MacCatalyst' or '$(TargetPlatformIdentifier)' == 'tvOS'"
Include="System\Net\Http\HttpClientHandler.AnyMobile.InvokeNativeHandler.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' != 'Android' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'MacCatalyst' and '$(TargetPlatformIdentifier)' != 'tvOS'"
Include="System\Net\Http\HttpClientHandler.cs" />
<Compile Include="System\Net\Http\HttpCompletionOption.cs" />
<Compile Include="System\Net\Http\HttpContent.cs" />
<Compile Include="System\Net\Http\HttpMessageHandler.cs" />
<Compile Include="System\Net\Http\HttpMessageInvoker.cs" />
<Compile Include="System\Net\Http\HttpMethod.cs" />
<Compile Include="System\Net\Http\HttpParseResult.cs" />
<Compile Include="System\Net\Http\HttpRequestException.cs" />
<Compile Include="System\Net\Http\HttpRequestMessage.cs" />
<Compile Include="System\Net\Http\HttpRequestOptions.cs" />
<Compile Include="System\Net\Http\HttpRequestOptionsKey.cs" />
<Compile Include="System\Net\Http\HttpResponseMessage.cs" />
<Compile Include="System\Net\Http\HttpRuleParser.cs" />
<Compile Include="System\Net\Http\HttpTelemetry.cs" />
<Compile Include="System\Net\Http\HttpVersionPolicy.cs" />
<Compile Include="System\Net\Http\MessageProcessingHandler.cs" />
<Compile Include="System\Net\Http\MultipartContent.cs" />
<Compile Include="System\Net\Http\MultipartFormDataContent.cs" />
<Compile Include="System\Net\Http\NetEventSource.Http.cs" />
<Compile Include="System\Net\Http\ReadOnlyMemoryContent.cs" />
<Compile Include="System\Net\Http\RequestRetryType.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpMessageHandlerStage.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\RuntimeSettingParser.cs" />
<Compile Include="System\Net\Http\StreamContent.cs" />
<Compile Include="System\Net\Http\StreamToStreamCopy.cs" />
<Compile Include="System\Net\Http\StringContent.cs" />
<Compile Include="System\Net\Http\Headers\AuthenticationHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\BaseHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\ByteArrayHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\CacheControlHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\CacheControlHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\ContentDispositionHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\ContentRangeHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\DateHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\EntityTagHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\GenericHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\HeaderDescriptor.cs" />
<Compile Include="System\Net\Http\Headers\HeaderStringValues.cs" />
<Compile Include="System\Net\Http\Headers\HeaderUtilities.cs" />
<Compile Include="System\Net\Http\Headers\HttpContentHeaders.cs" />
<Compile Include="System\Net\Http\Headers\HttpGeneralHeaders.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaders.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeadersNonValidated.cs" />
<Compile Include="System\Net\Http\Headers\HttpHeaderValueCollection.cs" />
<Compile Include="System\Net\Http\Headers\HttpRequestHeaders.cs" />
<Compile Include="System\Net\Http\Headers\HttpResponseHeaders.cs" />
<Compile Include="System\Net\Http\Headers\Int32NumberHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\Int64NumberHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\MediaTypeHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\MediaTypeHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\MediaTypeWithQualityHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\NameValueHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\NameValueWithParametersHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\ObjectCollection.cs" />
<Compile Include="System\Net\Http\Headers\ProductHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\ProductInfoHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\ProductInfoHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\QPackStaticTable.cs" />
<Compile Include="System\Net\Http\Headers\RangeConditionHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\RangeHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\RangeItemHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\RetryConditionHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\StringWithQualityHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\TimeSpanHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\TransferCodingHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\TransferCodingHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\TransferCodingWithQualityHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\UriHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\ViaHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\WarningHeaderValue.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpPlaintextStreamFilterContext.cs" />
<Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
Link="Common\DisableRuntimeMarshalling.cs" />
<Compile Include="$(CommonPath)System\IO\DelegatingStream.cs"
Link="Common\System\IO\DelegatingStream.cs" />
<Compile Include="$(CommonPath)System\IO\ReadOnlyMemoryStream.cs"
Link="Common\System\IO\ReadOnlyMemoryStream.cs" />
<Compile Include="$(CommonPath)System\Text\StringBuilderCache.cs"
Link="Common\System\Text\StringBuilderCache.cs" />
<Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
<Compile Include="$(CommonPath)System\Net\HttpDateParser.cs"
Link="Common\System\Net\HttpDateParser.cs" />
<Compile Include="$(CommonPath)System\Text\SimpleRegex.cs"
Link="Common\System\Text\SimpleRegex.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs"
Link="Common\System\Threading\Tasks\TaskCompletionSourceWithCancellation.cs" />
<Compile Include="$(CommonPath)System\HexConverter.cs"
Link="Common\System\HexConverter.cs" />
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs"
Link="Common\System\Net\ArrayBuffer.cs"/>
<Compile Include="$(CommonPath)System\Net\MultiArrayBuffer.cs"
Link="Common\System\Net\MultiArrayBuffer.cs"/>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.cs"
Link="Common\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.cs" />
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs"
Link="Common\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.cs" />
</ItemGroup>
<!-- SocketsHttpHandler implementation -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'Browser'">
<Compile Include="System\Net\Http\HttpHandlerDefaults.cs" />
<Compile Include="System\Net\Http\HttpMethod.Http3.cs" />
<Compile Include="System\Net\Http\Headers\AltSvcHeaderParser.cs" />
<Compile Include="System\Net\Http\Headers\AltSvcHeaderValue.cs" />
<Compile Include="System\Net\Http\Headers\KnownHeader.Http2And3.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' != 'tvOS'" Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ChunkedEncodingWriteStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ConnectHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ConnectionCloseReadStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CookieHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CreditManager.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CreditWaiter.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\FailedProxyCache.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2Connection.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2ConnectionException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2ProtocolErrorCode.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2ProtocolException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2Stream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2StreamException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http3Connection.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http3ConnectionException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http3ProtocolException.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpAuthenticatedConnectionHandler.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpAuthority.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnection.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionHandler.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionKind.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionPool.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionResponseContent.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpConnectionSettings.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpContentStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpKeepAlivePingPolicy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpUtilities.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\IHttpTrace.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\IMultiWebProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\MultiProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\RawConnectionStream.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\RedirectHandler.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpConnectionContext.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs" />
<Compile Include="System\Net\Http\HttpTelemetry.AnyOS.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocksHelper.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocksException.cs" />
<Compile Condition="'$(TargetPlatformIdentifier)' != 'tvOS'" Include="$(CommonPath)System\Net\NTAuthentication.Common.cs"
Link="Common\System\Net\NTAuthentication.Common.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsPal.cs"
Link="Common\System\Net\ContextFlagsPal.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityStatusPal.cs"
Link="Common\System\Net\SecurityStatusPal.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SafeCredentialReference.cs"
Link="Common\System\Net\Security\SafeCredentialReference.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SSPIHandleCache.cs"
Link="Common\System\Net\Security\SSPIHandleCache.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SslClientAuthenticationOptionsExtensions.cs"
Link="Common\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NetEventSource.Security.cs"
Link="Common\System\Net\Security\NetEventSource.Security.cs" />
<Compile Include="$(CommonPath)System\Net\ExceptionCheck.cs"
Link="Common\System\Net\ExceptionCheck.cs" />
<Compile Include="$(CommonPath)System\Collections\Generic\BidirectionalDictionary.cs"
Link="Common\System\Collections\Generic\BidirectionalDictionary.cs" />
<Compile Include="$(CommonPath)System\NotImplemented.cs"
Link="Common\System\NotImplemented.cs" />
<Compile Include="$(CommonPath)System\Net\NegotiationInfoClass.cs"
Link="Common\System\Net\NegotiationInfoClass.cs" />
<Compile Include="$(CommonPath)System\Net\InternalException.cs"
Link="Common\System\Net\InternalException.cs" />
<Compile Include="$(CommonPath)System\Net\DebugSafeHandle.cs"
Link="Common\System\Net\DebugSafeHandle.cs" />
<Compile Include="$(CommonPath)System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs"
Link="Common\System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs" />
<Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
Link="Common\System\Text\ValueStringBuilder.cs" />
<!-- Header support -->
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\IHttpStreamHeadersHandler.cs">
<Link>Common\System\Net\Http\aspnetcore\IHttpStreamHeadersHandler.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\HuffmanDecodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\HuffmanDecodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.Http2.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\H2StaticTable.Http2.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs">
<Link>Common\System\Net\Http\aspnetcore\Http2\Hpack\StatusCodes.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Http3SettingType.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Http3SettingType.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Http3StreamType.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Http3StreamType.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Frames\Http3ErrorCode.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Frames\Http3ErrorCode.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\Frames\Http3FrameType.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\Frames\Http3FrameType.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\QPackDecodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\QPackDecodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\QPackEncodingException.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\QPackEncodingException.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.Http3.cs">
<Link>Common\System\Net\Http\aspnetcore\Http3\QPack\H3StaticTable.Http3.cs</Link>
</Compile>
</ItemGroup>
<!-- Linux specific files -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Linux' or '$(TargetPlatformIdentifier)' == 'Android' or '$(TargetPlatformIdentifier)' == 'Browser' ">
<Compile Include="$(CommonPath)Interop\Linux\Interop.Libraries.cs"
Link="Common\Interop\Linux\Interop.Libraries.cs" />
</ItemGroup>
<!-- FreeBSD specific files -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'FreeBSD' ">
<Compile Include="$(CommonPath)Interop\FreeBSD\Interop.Libraries.cs"
Link="Common\Interop\FreeBSD\Interop.Libraries.cs" />
</ItemGroup>
<!-- SocketsHttpHandler platform parts -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser'">
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.Unix.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CurrentUserIdentityProvider.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Unix.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeCredentials.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SecChannelBindings.cs"
Link="Common\System\Net\Security\Unix\SecChannelBindings.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.GssFlags.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.GssFlags.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Status.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Status.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteNegoContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteNegoContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeNegoCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeNegoCredentials.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.Unix.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'tvOS'">
<Compile Include="System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.tvOS.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.PlatformNotSupported.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.PlatformNotSupported.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'OSX' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.OSX.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\MacProxy.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFArray.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFArray.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFData.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFData.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFDictionary.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFDictionary.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFProxy.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFProxy.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFUrl.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFUrl.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFString.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFString.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFNumber.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFString.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFError.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFError.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.RunLoop.cs"
Link="Common\Interop\OSX\Interop.RunLoop.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs"
Link="Common\Interop\OSX\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<Compile Include="$(CommonPath)\System\Net\HttpStatusDescription.cs"
Link="Common\System\Net\HttpStatusDescription.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SystemProxyInfo.Windows.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpEnvironmentProxy.Windows.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpWindowsProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\CurrentUserIdentityProvider.Windows.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
Link="Common\Interop\Windows\Interop.BOOL.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.UNICODE_STRING.cs"
Link="Common\Interop\Windows\Interop.UNICODE_STRING.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_INFO.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_INFO.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CRYPT_ALGORITHM_IDENTIFIER.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CRYPT_ALGORITHM_IDENTIFIER.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CRYPT_BIT_BLOB.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.DATA_BLOB.cs"
Link="Common\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.MsgEncodingType.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.MsgEncodingType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CertFreeCertificateContext.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CertFreeCertificateContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.FormatMessage.cs"
Link="Common\Interop\Windows\Kernel32\Interop.FormatMessage.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\Interop.HRESULT_FROM_WIN32.cs"
Link="Common\Interop\Windows\Interop.HRESULT_FROM_WIN32.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\WinHttp\Interop.SafeWinHttpHandle.cs"
Link="Common\Interop\Windows\WinHttp\Interop.SafeWinHttpHandle.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\WinHttp\Interop.winhttp_types.cs"
Link="Common\Interop\Windows\WinHttp\Interop.winhttp_types.cs" />
<Compile Include="$(CommonPath)\Interop\Windows\WinHttp\Interop.winhttp.cs"
Link="Common\Interop\Windows\WinHttp\Interop.winhttp.cs" />
<Compile Include="$(CommonPath)\System\CharArrayHelpers.cs"
Link="Common\System\CharArrayHelpers.cs" />
<Compile Include="$(CommonPath)\System\StringExtensions.cs"
Link="Common\System\StringExtensions.cs" />
<Compile Include="$(CommonPath)\System\Net\HttpKnownHeaderNames.cs"
Link="Common\System\Net\HttpKnownHeaderNames.cs" />
<Compile Include="$(CommonPath)\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs"
Link="Common\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs" />
<Compile Include="$(CommonPath)\System\Net\SecurityProtocol.cs"
Link="Common\System\Net\SecurityProtocol.cs" />
<Compile Include="$(CommonPath)\System\Net\UriScheme.cs"
Link="Common\System\Net\UriScheme.cs" />
<Compile Include="$(CommonPath)\System\Net\Http\HttpHandlerDefaults.cs"
Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
<Compile Include="$(CommonPath)\System\Net\Http\WinInetProxyHelper.cs"
Link="Common\System\Net\Http\WinInetProxyHelper.cs" />
<Compile Include="$(CommonPath)\System\Net\Security\CertificateHelper.cs"
Link="Common\System\Net\Security\CertificateHelper.cs" />
<Compile Include="$(CommonPath)\System\Net\Security\CertificateHelper.Windows.cs"
Link="Common\System\Net\Security\CertificateHelper.Windows.cs" />
<Compile Include="$(CommonPath)\System\Runtime\ExceptionServices\ExceptionStackTrace.cs"
Link="Common\System\Runtime\ExceptionServices\ExceptionStackTrace.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityBuffer.Windows.cs"
Link="Common\System\Net\Security\SecurityBuffer.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityBufferType.Windows.cs"
Link="Common\System\Net\Security\SecurityBufferType.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityContextTokenHandle.cs"
Link="Common\System\Net\Security\SecurityContextTokenHandle.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityStatusAdapterPal.Windows.cs"
Link="Common\System\Net\SecurityStatusAdapterPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Windows.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.Windows.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NetEventSource.Security.Windows.cs"
Link="Common\System\Net\Security\NetEventSource.Security.Windows.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_Bindings.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_Bindings.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.SECURITY_STATUS.cs"
Link="Common\Interop\Windows\SChannel\Interop.SECURITY_STATUS.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CloseHandle.cs"
Link="Common\Interop\Windows\Kernel32\Interop.CloseHandle.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_NegotiationInfoW.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_NegotiationInfoW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\NegotiationInfoClass.cs"
Link="Common\Interop\Windows\SspiCli\NegotiationInfoClass.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\SecPkgContext_CipherInfo.cs"
Link="Common\Interop\Windows\SChannel\SecPkgContext_CipherInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPISecureChannelType.cs"
Link="Common\Interop\Windows\SspiCli\SSPISecureChannelType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\ISSPIInterface.cs"
Link="Common\Interop\Windows\SspiCli\ISSPIInterface.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIAuthType.cs"
Link="Common\Interop\Windows\SspiCli\SSPIAuthType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecurityPackageInfoClass.cs"
Link="Common\Interop\Windows\SspiCli\SecurityPackageInfoClass.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecurityPackageInfo.cs"
Link="Common\Interop\Windows\SspiCli\SecurityPackageInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_Sizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_Sizes.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SafeDeleteContext.cs"
Link="Common\Interop\Windows\SspiCli\SafeDeleteContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\GlobalSSPI.cs"
Link="Common\Interop\Windows\SspiCli\GlobalSSPI.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\Interop.SSPI.cs"
Link="Common\Interop\Windows\SspiCli\Interop.SSPI.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecuritySafeHandles.cs"
Link="Common\Interop\Windows\SspiCli\SecuritySafeHandles.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIWrapper.cs"
Link="Common\Interop\Windows\SspiCli\SSPIWrapper.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser'">
<Compile Include="$(CommonPath)System\StrongToWeakReference.cs"
Link="Common\Interop\Unix\StrongToWeakReference.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityProtocol.cs"
Link="Common\System\Net\SecurityProtocol.cs" />
<Compile Include="$(CommonPath)System\Net\UriScheme.cs"
Link="Common\System\Net\UriScheme.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Link="Common\Interop\Unix\Interop.Errors.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.IOErrors.cs"
Link="Common\Interop\Unix\Interop.IOErrors.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Close.cs"
Link="Common\Interop\Unix\System.Native\Interop.Close.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Open.cs"
Link="Common\Interop\Unix\System.Native\Interop.Open.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.OpenFlags.cs"
Link="Common\Interop\Unix\System.Native\Interop.OpenFlags.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Pipe.cs"
Link="Common\Interop\Unix\System.Native\Interop.Pipe.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Poll.cs"
Link="Common\Interop\Unix\libc\Interop.Poll.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Poll.Structs.cs"
Link="Common\Interop\Unix\Interop.Poll.Structs.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Read.cs"
Link="Common\Interop\Unix\libc\Interop.Read.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Write.cs"
Link="Common\Interop\Unix\libc\Interop.Write.cs" />
<Compile Include="$(CommonPath)System\CharArrayHelpers.cs"
Link="Common\System\CharArrayHelpers.cs" />
<Compile Include="$(CommonPath)System\StringExtensions.cs"
Link="Common\System\StringExtensions.cs" />
<Compile Include="$(CommonPath)System\Net\HttpKnownHeaderNames.cs"
Link="Common\System\Net\HttpKnownHeaderNames.cs" />
<Compile Include="$(CommonPath)System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs"
Link="Common\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs" />
<Compile Include="$(CommonPath)System\Net\HttpStatusDescription.cs"
Link="Common\System\Net\HttpStatusDescription.cs" />
<Compile Include="$(CommonPath)System\Net\Http\HttpHandlerDefaults.cs"
Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
<Compile Include="$(CommonPath)System\Net\Http\TlsCertificateExtensions.cs"
Link="Common\System\Net\Http\TlsCertificateExtensions" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateHelper.cs"
Link="Common\System\Net\Security\CertificateHelper.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateHelper.Unix.cs"
Link="Common\System\Net\Security\CertificateHelper.Unix.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser' and '$(TargetPlatformIdentifier)' != 'OSX' and '$(TargetPlatformIdentifier)' != 'iOS' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSslVersion.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSslVersion.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtxOptions.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtxOptions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SetProtocolOptions.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SetProtocolOptions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Name.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Name.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Ext.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Ext.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.Initialization.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeHandleCache.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeHandleCache.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateValidation.Unix.cs"
Link="Common\System\Net\Security\CertificateValidation.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Browser'">
<Compile Include="$(CommonPath)\System\StringExtensions.cs"
Link="Common\System\StringExtensions.cs" />
<Compile Include="$(CommonPath)\System\Net\HttpStatusDescription.cs"
Link="Common\System\Net\HttpStatusDescription.cs" />
<Compile Include="$(CommonPath)System\Text\ValueStringBuilder.cs"
Link="Common\System\Text\ValueStringBuilder.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="System\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpKeepAlivePingPolicy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\HttpNoProxy.cs" />
<Compile Include="System\Net\Http\SocketsHttpHandler\SocketsHttpConnectionContext.cs" />
<Compile Include="System\Net\Http\BrowserHttpHandler\SystemProxyInfo.Browser.cs" />
<Compile Include="System\Net\Http\BrowserHttpHandler\SocketsHttpHandler.cs" />
<Compile Include="System\Net\Http\BrowserHttpHandler\BrowserHttpHandler.cs" />
<Compile Include="System\Net\Http\BrowserHttpHandler\HttpTelemetry.Browser.cs" />
<Compile Include="$(CommonPath)System\Net\Http\HttpHandlerDefaults.cs"
Link="Common\System\Net\Http\HttpHandlerDefaults.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(LibrariesProjectRoot)System.Net.Quic\src\System.Net.Quic.csproj" />
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Console" Condition="'$(Configuration)' == 'Debug'" />
<Reference Include="System.Diagnostics.DiagnosticSource" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.NameResolution" />
<Reference Include="System.Net.NetworkInformation" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Net.Security" />
<Reference Include="System.Net.Sockets" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.Claims" Condition="'$(TargetPlatformIdentifier)' == 'windows'" />
<Reference Include="System.Security.Cryptography" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Security.Cryptography.Csp" />
<Reference Include="System.Security.Cryptography.Encoding" />
<Reference Include="System.Security.Cryptography.OpenSsl" />
<Reference Include="System.Security.Cryptography.X509Certificates" />
<Reference Include="System.Security.Principal" Condition="'$(TargetPlatformIdentifier)' == 'windows'" />
<Reference Include="System.Security.Principal.Windows" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Channels" />
<Reference Include="System.IO.Compression.Brotli" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'Browser'">
<Reference Include="System.Diagnostics.StackTrace" />
<Reference Include="System.IO.FileSystem" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Security.Cryptography.Encoding" />
<Reference Include="System.Security.Cryptography" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Browser'">
<ProjectReference Include="$(LibrariesProjectRoot)System.Private.Runtime.InteropServices.JavaScript\src\System.Private.Runtime.InteropServices.JavaScript.csproj" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\SR.resx" />
</ItemGroup>
</Project>
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2StreamWindowManager.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.Http
{
internal sealed partial class Http2Connection
{
// Maintains a dynamically-sized stream receive window, and sends WINDOW_UPDATE frames to the server.
private struct Http2StreamWindowManager
{
private static readonly double StopWatchToTimesSpan = TimeSpan.TicksPerSecond / (double)Stopwatch.Frequency;
private static double WindowScaleThresholdMultiplier => GlobalHttpSettings.SocketsHttpHandler.Http2StreamWindowScaleThresholdMultiplier;
private static int MaxStreamWindowSize => GlobalHttpSettings.SocketsHttpHandler.MaxHttp2StreamWindowSize;
private static bool WindowScalingEnabled => !GlobalHttpSettings.SocketsHttpHandler.DisableDynamicHttp2WindowSizing;
private int _deliveredBytes;
private int _streamWindowSize;
private long _lastWindowUpdate;
public Http2StreamWindowManager(Http2Connection connection, Http2Stream stream)
{
HttpConnectionSettings settings = connection._pool.Settings;
_streamWindowSize = settings._initialHttp2StreamWindowSize;
_deliveredBytes = 0;
_lastWindowUpdate = default;
if (NetEventSource.Log.IsEnabled()) stream.Trace($"[FlowControl] InitialClientStreamWindowSize: {StreamWindowSize}, StreamWindowThreshold: {StreamWindowThreshold}, WindowScaleThresholdMultiplier: {WindowScaleThresholdMultiplier}");
}
// We hold off on sending WINDOW_UPDATE until we hit the minimum threshold.
// This value is somewhat arbitrary; the intent is to ensure it is much smaller than
// the window size itself, or we risk stalling the server because it runs out of window space.
public const int StreamWindowUpdateRatio = 8;
internal int StreamWindowThreshold => _streamWindowSize / StreamWindowUpdateRatio;
internal int StreamWindowSize => _streamWindowSize;
public void Start()
{
_lastWindowUpdate = Stopwatch.GetTimestamp();
}
public void AdjustWindow(int bytesConsumed, Http2Stream stream)
{
Debug.Assert(_lastWindowUpdate != default); // Make sure Start() has been invoked, otherwise we should not be receiving DATA.
Debug.Assert(bytesConsumed > 0);
Debug.Assert(_deliveredBytes < StreamWindowThreshold);
if (!stream.ExpectResponseData)
{
// We are not expecting any more data (because we've either completed or aborted).
// So no need to send any more WINDOW_UPDATEs.
return;
}
if (WindowScalingEnabled)
{
AdjustWindowDynamic(bytesConsumed, stream);
}
else
{
AjdustWindowStatic(bytesConsumed, stream);
}
}
private void AjdustWindowStatic(int bytesConsumed, Http2Stream stream)
{
_deliveredBytes += bytesConsumed;
if (_deliveredBytes < StreamWindowThreshold)
{
return;
}
int windowUpdateIncrement = _deliveredBytes;
_deliveredBytes = 0;
Http2Connection connection = stream.Connection;
Task sendWindowUpdateTask = connection.SendWindowUpdateAsync(stream.StreamId, windowUpdateIncrement);
connection.LogExceptions(sendWindowUpdateTask);
}
private void AdjustWindowDynamic(int bytesConsumed, Http2Stream stream)
{
_deliveredBytes += bytesConsumed;
if (_deliveredBytes < StreamWindowThreshold)
{
return;
}
int windowUpdateIncrement = _deliveredBytes;
long currentTime = Stopwatch.GetTimestamp();
Http2Connection connection = stream.Connection;
TimeSpan rtt = connection._rttEstimator.MinRtt;
if (rtt > TimeSpan.Zero && _streamWindowSize < MaxStreamWindowSize)
{
TimeSpan dt = StopwatchTicksToTimeSpan(currentTime - _lastWindowUpdate);
// We are detecting bursts in the amount of data consumed within a single 'dt' window update period.
// The value "_deliveredBytes / dt" correlates with the bandwidth of the connection.
// We need to extend the window, if the bandwidth-delay product grows over the current window size.
// To enable empirical fine tuning, we apply a configurable multiplier (_windowScaleThresholdMultiplier) to the window size, which defaults to 1.0
//
// The condition to extend the window is:
// (_deliveredBytes / dt) * rtt > _streamWindowSize * _windowScaleThresholdMultiplier
//
// Which is reordered into the form below, to avoid the division:
if (_deliveredBytes * (double)rtt.Ticks > _streamWindowSize * dt.Ticks * WindowScaleThresholdMultiplier)
{
int extendedWindowSize = Math.Min(MaxStreamWindowSize, _streamWindowSize * 2);
windowUpdateIncrement += extendedWindowSize - _streamWindowSize;
_streamWindowSize = extendedWindowSize;
if (NetEventSource.Log.IsEnabled()) stream.Trace($"[FlowControl] Updated Stream Window. StreamWindowSize: {StreamWindowSize}, StreamWindowThreshold: {StreamWindowThreshold}");
Debug.Assert(_streamWindowSize <= MaxStreamWindowSize);
if (_streamWindowSize == MaxStreamWindowSize)
{
if (NetEventSource.Log.IsEnabled()) stream.Trace($"[FlowControl] StreamWindowSize reached the configured maximum of {MaxStreamWindowSize}.");
}
}
}
_deliveredBytes = 0;
Task sendWindowUpdateTask = connection.SendWindowUpdateAsync(stream.StreamId, windowUpdateIncrement);
connection.LogExceptions(sendWindowUpdateTask);
_lastWindowUpdate = currentTime;
}
private static TimeSpan StopwatchTicksToTimeSpan(long stopwatchTicks)
{
long ticks = (long)(StopWatchToTimesSpan * stopwatchTicks);
return new TimeSpan(ticks);
}
}
// Estimates Round Trip Time between the client and the server by sending PING frames, and measuring the time interval until a PING ACK is received.
// Assuming that the network characteristics of the connection wouldn't change much within its lifetime, we are maintaining a running minimum value.
// The more PINGs we send, the more accurate is the estimation of MinRtt, however we should be careful not to send too many of them,
// to avoid triggering the server's PING flood protection which may result in an unexpected GOAWAY.
// With most servers we are fine to send PINGs, as long as we are reading their data, this rule is well formalized for gRPC:
// https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md
// As a rule of thumb, we can send send a PING whenever we receive DATA or HEADERS, however, there are some servers which allow receiving only
// a limited amount of PINGs within a given timeframe.
// To deal with the conflicting requirements:
// - We send an initial burst of 'InitialBurstCount' PINGs, to get a relatively good estimation fast
// - Afterwards, we send PINGs with the maximum frequency of 'PingIntervalInSeconds' PINGs per second
//
// Threading:
// OnInitialSettingsSent() is called during initialization, all other methods are triggered by HttpConnection.ProcessIncomingFramesAsync(),
// therefore the assumption is that the invocation of RttEstimator's methods is sequential, and there is no race beetween them.
// Http2StreamWindowManager is reading MinRtt from another concurrent thread, therefore its value has to be changed atomically.
private struct RttEstimator
{
private enum State
{
Disabled,
Init,
Waiting,
PingSent,
TerminatingMayReceivePingAck
}
private const double PingIntervalInSeconds = 2;
private const int InitialBurstCount = 4;
private static readonly long PingIntervalInTicks = (long)(PingIntervalInSeconds * Stopwatch.Frequency);
private State _state;
private long _pingSentTimestamp;
private long _pingCounter;
private int _initialBurst;
private long _minRtt;
public TimeSpan MinRtt => new TimeSpan(_minRtt);
public static RttEstimator Create()
{
RttEstimator e = default;
e._state = GlobalHttpSettings.SocketsHttpHandler.DisableDynamicHttp2WindowSizing ? State.Disabled : State.Init;
e._initialBurst = InitialBurstCount;
return e;
}
internal void OnInitialSettingsSent()
{
if (_state == State.Disabled) return;
_pingSentTimestamp = Stopwatch.GetTimestamp();
}
internal void OnInitialSettingsAckReceived(Http2Connection connection)
{
if (_state == State.Disabled) return;
RefreshRtt(connection);
_state = State.Waiting;
}
internal void OnDataOrHeadersReceived(Http2Connection connection)
{
if (_state != State.Waiting) return;
long now = Stopwatch.GetTimestamp();
bool initial = _initialBurst > 0;
if (initial || now - _pingSentTimestamp > PingIntervalInTicks)
{
if (initial) _initialBurst--;
// Send a PING
_pingCounter--;
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Sending RTT PING with payload {_pingCounter}");
connection.LogExceptions(connection.SendPingAsync(_pingCounter, isAck: false));
_pingSentTimestamp = now;
_state = State.PingSent;
}
}
internal void OnPingAckReceived(long payload, Http2Connection connection)
{
if (_state != State.PingSent && _state != State.TerminatingMayReceivePingAck)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Unexpected PING ACK in state {_state}");
ThrowProtocolError();
}
if (_state == State.TerminatingMayReceivePingAck)
{
_state = State.Disabled;
return;
}
// RTT PINGs always carry negative payload, positive values indicate a response to KeepAlive PING.
Debug.Assert(payload < 0);
if (_pingCounter != payload)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Unexpected RTT PING ACK payload {payload}, should be {_pingCounter}.");
ThrowProtocolError();
}
RefreshRtt(connection);
_state = State.Waiting;
}
internal void OnGoAwayReceived()
{
if (_state == State.PingSent)
{
// We may still receive a PING ACK, but we should not send anymore PING:
_state = State.TerminatingMayReceivePingAck;
}
else
{
_state = State.Disabled;
}
}
private void RefreshRtt(Http2Connection connection)
{
long elapsedTicks = Stopwatch.GetTimestamp() - _pingSentTimestamp;
long prevRtt = _minRtt == 0 ? long.MaxValue : _minRtt;
TimeSpan currentRtt = TimeSpan.FromSeconds(elapsedTicks / (double)Stopwatch.Frequency);
long minRtt = Math.Min(prevRtt, currentRtt.Ticks);
Interlocked.Exchange(ref _minRtt, minRtt); // MinRtt is being queried from another thread
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Updated MinRtt: {MinRtt.TotalMilliseconds} ms");
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.Http
{
internal sealed partial class Http2Connection
{
// Maintains a dynamically-sized stream receive window, and sends WINDOW_UPDATE frames to the server.
private struct Http2StreamWindowManager
{
private static double WindowScaleThresholdMultiplier => GlobalHttpSettings.SocketsHttpHandler.Http2StreamWindowScaleThresholdMultiplier;
private static int MaxStreamWindowSize => GlobalHttpSettings.SocketsHttpHandler.MaxHttp2StreamWindowSize;
private static bool WindowScalingEnabled => !GlobalHttpSettings.SocketsHttpHandler.DisableDynamicHttp2WindowSizing;
private int _deliveredBytes;
private int _streamWindowSize;
private long _lastWindowUpdate;
public Http2StreamWindowManager(Http2Connection connection, Http2Stream stream)
{
HttpConnectionSettings settings = connection._pool.Settings;
_streamWindowSize = settings._initialHttp2StreamWindowSize;
_deliveredBytes = 0;
_lastWindowUpdate = default;
if (NetEventSource.Log.IsEnabled()) stream.Trace($"[FlowControl] InitialClientStreamWindowSize: {StreamWindowSize}, StreamWindowThreshold: {StreamWindowThreshold}, WindowScaleThresholdMultiplier: {WindowScaleThresholdMultiplier}");
}
// We hold off on sending WINDOW_UPDATE until we hit the minimum threshold.
// This value is somewhat arbitrary; the intent is to ensure it is much smaller than
// the window size itself, or we risk stalling the server because it runs out of window space.
public const int StreamWindowUpdateRatio = 8;
internal int StreamWindowThreshold => _streamWindowSize / StreamWindowUpdateRatio;
internal int StreamWindowSize => _streamWindowSize;
public void Start()
{
_lastWindowUpdate = Stopwatch.GetTimestamp();
}
public void AdjustWindow(int bytesConsumed, Http2Stream stream)
{
Debug.Assert(_lastWindowUpdate != default); // Make sure Start() has been invoked, otherwise we should not be receiving DATA.
Debug.Assert(bytesConsumed > 0);
Debug.Assert(_deliveredBytes < StreamWindowThreshold);
if (!stream.ExpectResponseData)
{
// We are not expecting any more data (because we've either completed or aborted).
// So no need to send any more WINDOW_UPDATEs.
return;
}
if (WindowScalingEnabled)
{
AdjustWindowDynamic(bytesConsumed, stream);
}
else
{
AjdustWindowStatic(bytesConsumed, stream);
}
}
private void AjdustWindowStatic(int bytesConsumed, Http2Stream stream)
{
_deliveredBytes += bytesConsumed;
if (_deliveredBytes < StreamWindowThreshold)
{
return;
}
int windowUpdateIncrement = _deliveredBytes;
_deliveredBytes = 0;
Http2Connection connection = stream.Connection;
Task sendWindowUpdateTask = connection.SendWindowUpdateAsync(stream.StreamId, windowUpdateIncrement);
connection.LogExceptions(sendWindowUpdateTask);
}
private void AdjustWindowDynamic(int bytesConsumed, Http2Stream stream)
{
_deliveredBytes += bytesConsumed;
if (_deliveredBytes < StreamWindowThreshold)
{
return;
}
int windowUpdateIncrement = _deliveredBytes;
long currentTime = Stopwatch.GetTimestamp();
Http2Connection connection = stream.Connection;
TimeSpan rtt = connection._rttEstimator.MinRtt;
if (rtt > TimeSpan.Zero && _streamWindowSize < MaxStreamWindowSize)
{
TimeSpan dt = Stopwatch.GetElapsedTime(_lastWindowUpdate, currentTime);
// We are detecting bursts in the amount of data consumed within a single 'dt' window update period.
// The value "_deliveredBytes / dt" correlates with the bandwidth of the connection.
// We need to extend the window, if the bandwidth-delay product grows over the current window size.
// To enable empirical fine tuning, we apply a configurable multiplier (_windowScaleThresholdMultiplier) to the window size, which defaults to 1.0
//
// The condition to extend the window is:
// (_deliveredBytes / dt) * rtt > _streamWindowSize * _windowScaleThresholdMultiplier
//
// Which is reordered into the form below, to avoid the division:
if (_deliveredBytes * (double)rtt.Ticks > _streamWindowSize * dt.Ticks * WindowScaleThresholdMultiplier)
{
int extendedWindowSize = Math.Min(MaxStreamWindowSize, _streamWindowSize * 2);
windowUpdateIncrement += extendedWindowSize - _streamWindowSize;
_streamWindowSize = extendedWindowSize;
if (NetEventSource.Log.IsEnabled()) stream.Trace($"[FlowControl] Updated Stream Window. StreamWindowSize: {StreamWindowSize}, StreamWindowThreshold: {StreamWindowThreshold}");
Debug.Assert(_streamWindowSize <= MaxStreamWindowSize);
if (_streamWindowSize == MaxStreamWindowSize)
{
if (NetEventSource.Log.IsEnabled()) stream.Trace($"[FlowControl] StreamWindowSize reached the configured maximum of {MaxStreamWindowSize}.");
}
}
}
_deliveredBytes = 0;
Task sendWindowUpdateTask = connection.SendWindowUpdateAsync(stream.StreamId, windowUpdateIncrement);
connection.LogExceptions(sendWindowUpdateTask);
_lastWindowUpdate = currentTime;
}
}
// Estimates Round Trip Time between the client and the server by sending PING frames, and measuring the time interval until a PING ACK is received.
// Assuming that the network characteristics of the connection wouldn't change much within its lifetime, we are maintaining a running minimum value.
// The more PINGs we send, the more accurate is the estimation of MinRtt, however we should be careful not to send too many of them,
// to avoid triggering the server's PING flood protection which may result in an unexpected GOAWAY.
// With most servers we are fine to send PINGs, as long as we are reading their data, this rule is well formalized for gRPC:
// https://github.com/grpc/proposal/blob/master/A8-client-side-keepalive.md
// As a rule of thumb, we can send send a PING whenever we receive DATA or HEADERS, however, there are some servers which allow receiving only
// a limited amount of PINGs within a given timeframe.
// To deal with the conflicting requirements:
// - We send an initial burst of 'InitialBurstCount' PINGs, to get a relatively good estimation fast
// - Afterwards, we send PINGs with the maximum frequency of 'PingIntervalInSeconds' PINGs per second
//
// Threading:
// OnInitialSettingsSent() is called during initialization, all other methods are triggered by HttpConnection.ProcessIncomingFramesAsync(),
// therefore the assumption is that the invocation of RttEstimator's methods is sequential, and there is no race beetween them.
// Http2StreamWindowManager is reading MinRtt from another concurrent thread, therefore its value has to be changed atomically.
private struct RttEstimator
{
private enum State
{
Disabled,
Init,
Waiting,
PingSent,
TerminatingMayReceivePingAck
}
private const double PingIntervalInSeconds = 2;
private const int InitialBurstCount = 4;
private static readonly long PingIntervalInTicks = (long)(PingIntervalInSeconds * Stopwatch.Frequency);
private State _state;
private long _pingSentTimestamp;
private long _pingCounter;
private int _initialBurst;
private long _minRtt;
public TimeSpan MinRtt => new TimeSpan(_minRtt);
public static RttEstimator Create()
{
RttEstimator e = default;
e._state = GlobalHttpSettings.SocketsHttpHandler.DisableDynamicHttp2WindowSizing ? State.Disabled : State.Init;
e._initialBurst = InitialBurstCount;
return e;
}
internal void OnInitialSettingsSent()
{
if (_state == State.Disabled) return;
_pingSentTimestamp = Stopwatch.GetTimestamp();
}
internal void OnInitialSettingsAckReceived(Http2Connection connection)
{
if (_state == State.Disabled) return;
RefreshRtt(connection);
_state = State.Waiting;
}
internal void OnDataOrHeadersReceived(Http2Connection connection)
{
if (_state != State.Waiting) return;
long now = Stopwatch.GetTimestamp();
bool initial = _initialBurst > 0;
if (initial || now - _pingSentTimestamp > PingIntervalInTicks)
{
if (initial) _initialBurst--;
// Send a PING
_pingCounter--;
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Sending RTT PING with payload {_pingCounter}");
connection.LogExceptions(connection.SendPingAsync(_pingCounter, isAck: false));
_pingSentTimestamp = now;
_state = State.PingSent;
}
}
internal void OnPingAckReceived(long payload, Http2Connection connection)
{
if (_state != State.PingSent && _state != State.TerminatingMayReceivePingAck)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Unexpected PING ACK in state {_state}");
ThrowProtocolError();
}
if (_state == State.TerminatingMayReceivePingAck)
{
_state = State.Disabled;
return;
}
// RTT PINGs always carry negative payload, positive values indicate a response to KeepAlive PING.
Debug.Assert(payload < 0);
if (_pingCounter != payload)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Unexpected RTT PING ACK payload {payload}, should be {_pingCounter}.");
ThrowProtocolError();
}
RefreshRtt(connection);
_state = State.Waiting;
}
internal void OnGoAwayReceived()
{
if (_state == State.PingSent)
{
// We may still receive a PING ACK, but we should not send anymore PING:
_state = State.TerminatingMayReceivePingAck;
}
else
{
_state = State.Disabled;
}
}
private void RefreshRtt(Http2Connection connection)
{
long prevRtt = _minRtt == 0 ? long.MaxValue : _minRtt;
TimeSpan currentRtt = Stopwatch.GetElapsedTime(_pingSentTimestamp);
long minRtt = Math.Min(prevRtt, currentRtt.Ticks);
Interlocked.Exchange(ref _minRtt, minRtt); // MinRtt is being queried from another thread
if (NetEventSource.Log.IsEnabled()) connection.Trace($"[FlowControl] Updated MinRtt: {MinRtt.TotalMilliseconds} ms");
}
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http3Connection.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Threading;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Net.Quic;
using System.IO;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Net.Http.Headers;
using System.Net.Security;
using Microsoft.Extensions.Internal;
namespace System.Net.Http
{
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
internal sealed class Http3Connection : HttpConnectionBase
{
private readonly HttpConnectionPool _pool;
private readonly HttpAuthority? _origin;
private readonly HttpAuthority _authority;
private readonly byte[] _altUsedEncodedHeader;
private QuicConnection? _connection;
private Task? _connectionClosedTask;
// Keep a collection of requests around so we can process GOAWAY.
private readonly Dictionary<QuicStream, Http3RequestStream> _activeRequests = new Dictionary<QuicStream, Http3RequestStream>();
// Set when GOAWAY is being processed, when aborting, or when disposing.
private long _lastProcessedStreamId = -1;
// Our control stream.
private QuicStream? _clientControl;
// Current SETTINGS from the server.
private int _maximumHeadersLength = int.MaxValue; // TODO: this is not yet observed by Http3Stream when buffering headers.
// Once the server's streams are received, these are set to 1. Further receipt of these streams results in a connection error.
private int _haveServerControlStream;
private int _haveServerQpackDecodeStream;
private int _haveServerQpackEncodeStream;
// A connection-level error will abort any future operations.
private Exception? _abortException;
private const int TelemetryStatus_Opened = 1;
private const int TelemetryStatus_Closed = 2;
private int _markedByTelemetryStatus;
public HttpAuthority Authority => _authority;
public HttpConnectionPool Pool => _pool;
public int MaximumRequestHeadersLength => _maximumHeadersLength;
public byte[] AltUsedEncodedHeaderBytes => _altUsedEncodedHeader;
public Exception? AbortException => Volatile.Read(ref _abortException);
private object SyncObj => _activeRequests;
/// <summary>
/// If true, we've received GOAWAY, are aborting due to a connection-level error, or are disposing due to pool limits.
/// </summary>
private bool ShuttingDown
{
get
{
Debug.Assert(Monitor.IsEntered(SyncObj));
return _lastProcessedStreamId != -1;
}
}
public Http3Connection(HttpConnectionPool pool, HttpAuthority? origin, HttpAuthority authority, QuicConnection connection)
{
_pool = pool;
_origin = origin;
_authority = authority;
_connection = connection;
bool altUsedDefaultPort = pool.Kind == HttpConnectionKind.Http && authority.Port == HttpConnectionPool.DefaultHttpPort || pool.Kind == HttpConnectionKind.Https && authority.Port == HttpConnectionPool.DefaultHttpsPort;
string altUsedValue = altUsedDefaultPort ? authority.IdnHost : string.Create(CultureInfo.InvariantCulture, $"{authority.IdnHost}:{authority.Port}");
_altUsedEncodedHeader = QPack.QPackEncoder.EncodeLiteralHeaderFieldWithoutNameReferenceToArray(KnownHeaders.AltUsed.Name, altUsedValue);
if (HttpTelemetry.Log.IsEnabled())
{
HttpTelemetry.Log.Http30ConnectionEstablished();
_markedByTelemetryStatus = TelemetryStatus_Opened;
}
// Errors are observed via Abort().
_ = SendSettingsAsync();
// This process is cleaned up when _connection is disposed, and errors are observed via Abort().
_ = AcceptStreamsAsync();
}
/// <summary>
/// Starts shutting down the <see cref="Http3Connection"/>. Final cleanup will happen when there are no more active requests.
/// </summary>
public override void Dispose()
{
lock (SyncObj)
{
if (_lastProcessedStreamId == -1)
{
_lastProcessedStreamId = long.MaxValue;
CheckForShutdown();
}
}
}
/// <summary>
/// Called when shutting down, this checks for when shutdown is complete (no more active requests) and does actual disposal.
/// </summary>
/// <remarks>Requires <see cref="SyncObj"/> to be locked.</remarks>
private void CheckForShutdown()
{
Debug.Assert(Monitor.IsEntered(SyncObj));
Debug.Assert(ShuttingDown);
if (_activeRequests.Count != 0)
{
return;
}
if (_connection != null)
{
// Close the QuicConnection in the background.
if (_connectionClosedTask == null)
{
_connectionClosedTask = _connection.CloseAsync((long)Http3ErrorCode.NoError).AsTask();
}
QuicConnection connection = _connection;
_connection = null;
_ = _connectionClosedTask.ContinueWith(closeTask =>
{
if (closeTask.IsFaulted && NetEventSource.Log.IsEnabled())
{
Trace($"{nameof(QuicConnection)} failed to close: {closeTask.Exception!.InnerException}");
}
try
{
connection.Dispose();
}
catch (Exception ex)
{
Trace($"{nameof(QuicConnection)} failed to dispose: {ex}");
}
if (_clientControl != null)
{
_clientControl.Dispose();
_clientControl = null;
}
}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
if (HttpTelemetry.Log.IsEnabled())
{
if (Interlocked.Exchange(ref _markedByTelemetryStatus, TelemetryStatus_Closed) == TelemetryStatus_Opened)
{
HttpTelemetry.Log.Http30ConnectionClosed();
}
}
}
}
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, ValueStopwatch queueDuration, CancellationToken cancellationToken)
{
// Allocate an active request
QuicStream? quicStream = null;
Http3RequestStream? requestStream = null;
ValueTask waitTask = default;
try
{
try
{
while (true)
{
lock (SyncObj)
{
if (_connection == null)
{
break;
}
if (_connection.GetRemoteAvailableBidirectionalStreamCount() > 0)
{
quicStream = _connection.OpenBidirectionalStream();
requestStream = new Http3RequestStream(request, this, quicStream);
_activeRequests.Add(quicStream, requestStream);
break;
}
waitTask = _connection.WaitForAvailableBidirectionalStreamsAsync(cancellationToken);
}
if (HttpTelemetry.Log.IsEnabled() && !waitTask.IsCompleted && !queueDuration.IsActive)
{
// We avoid logging RequestLeftQueue if a stream was available immediately (synchronously)
queueDuration = ValueStopwatch.StartNew();
}
// Wait for an available stream (based on QUIC MAX_STREAMS) if there isn't one available yet.
await waitTask.ConfigureAwait(false);
}
}
finally
{
if (HttpTelemetry.Log.IsEnabled() && queueDuration.IsActive)
{
HttpTelemetry.Log.Http30RequestLeftQueue(queueDuration.GetElapsedTime().TotalMilliseconds);
}
}
if (quicStream == null)
{
throw new HttpRequestException(SR.net_http_request_aborted, null, RequestRetryType.RetryOnConnectionFailure);
}
requestStream!.StreamId = quicStream.StreamId;
bool goAway;
lock (SyncObj)
{
goAway = _lastProcessedStreamId != -1 && requestStream.StreamId > _lastProcessedStreamId;
}
if (goAway)
{
throw new HttpRequestException(SR.net_http_request_aborted, null, RequestRetryType.RetryOnConnectionFailure);
}
if (NetEventSource.Log.IsEnabled()) Trace($"Sending request: {request}");
Task<HttpResponseMessage> responseTask = requestStream.SendAsync(cancellationToken);
// null out requestStream to avoid disposing in finally block. It is now in charge of disposing itself.
requestStream = null;
return await responseTask.ConfigureAwait(false);
}
catch (QuicConnectionAbortedException ex)
{
// This will happen if we aborted _connection somewhere.
Abort(ex);
throw new HttpRequestException(SR.Format(SR.net_http_http3_connection_error, ex.ErrorCode), ex, RequestRetryType.RetryOnConnectionFailure);
}
finally
{
requestStream?.Dispose();
}
}
/// <summary>
/// Aborts the connection with an error.
/// </summary>
/// <remarks>
/// Used for e.g. I/O or connection-level frame parsing errors.
/// </remarks>
internal Exception Abort(Exception abortException)
{
// Only observe the first exception we get.
Exception? firstException = Interlocked.CompareExchange(ref _abortException, abortException, null);
if (firstException != null)
{
if (NetEventSource.Log.IsEnabled() && !ReferenceEquals(firstException, abortException))
{
// Lost the race to set the field to another exception, so just trace this one.
Trace($"{nameof(abortException)}=={abortException}");
}
return firstException;
}
// Stop sending requests to this connection.
_pool.InvalidateHttp3Connection(this);
Http3ErrorCode connectionResetErrorCode = (abortException as Http3ProtocolException)?.ErrorCode ?? Http3ErrorCode.InternalError;
lock (SyncObj)
{
// Set _lastProcessedStreamId != -1 to make ShuttingDown = true.
// It's possible GOAWAY is already being processed, in which case this would already be != -1.
if (_lastProcessedStreamId == -1)
{
_lastProcessedStreamId = long.MaxValue;
}
// Abort the connection. This will cause all of our streams to abort on their next I/O.
if (_connection != null && _connectionClosedTask == null)
{
_connectionClosedTask = _connection.CloseAsync((long)connectionResetErrorCode).AsTask();
}
CheckForShutdown();
}
return abortException;
}
private void OnServerGoAway(long lastProcessedStreamId)
{
// Stop sending requests to this connection.
_pool.InvalidateHttp3Connection(this);
var streamsToGoAway = new List<Http3RequestStream>();
lock (SyncObj)
{
if (_lastProcessedStreamId != -1 && lastProcessedStreamId > _lastProcessedStreamId)
{
// Server can send multiple GOAWAY frames.
// Spec says a server MUST NOT increase the stream ID in subsequent GOAWAYs,
// but doesn't specify what client should do if that is violated. Ignore for now.
if (NetEventSource.Log.IsEnabled())
{
Trace("HTTP/3 server sent GOAWAY with increasing stream ID. Retried requests may have been double-processed by server.");
}
return;
}
_lastProcessedStreamId = lastProcessedStreamId;
foreach (KeyValuePair<QuicStream, Http3RequestStream> request in _activeRequests)
{
if (request.Value.StreamId > lastProcessedStreamId)
{
streamsToGoAway.Add(request.Value);
}
}
CheckForShutdown();
}
// GOAWAY each stream outside of the lock, so they can acquire the lock to remove themselves from _activeRequests.
foreach (Http3RequestStream stream in streamsToGoAway)
{
stream.GoAway();
}
}
public void RemoveStream(QuicStream stream)
{
lock (SyncObj)
{
bool removed = _activeRequests.Remove(stream);
Debug.Assert(removed == true);
if (ShuttingDown)
{
CheckForShutdown();
}
}
}
public override long GetIdleTicks(long nowTicks) => throw new NotImplementedException("We aren't scavenging HTTP3 connections yet");
public override void Trace(string message, [CallerMemberName] string? memberName = null) =>
Trace(0, message, memberName);
internal void Trace(long streamId, string message, [CallerMemberName] string? memberName = null) =>
NetEventSource.Log.HandlerMessage(
_pool?.GetHashCode() ?? 0, // pool ID
GetHashCode(), // connection ID
(int)streamId, // stream ID
memberName, // method name
message); // message
private async Task SendSettingsAsync()
{
try
{
_clientControl = _connection!.OpenUnidirectionalStream();
await _clientControl.WriteAsync(_pool.Settings.Http3SettingsFrame, CancellationToken.None).ConfigureAwait(false);
}
catch (Exception ex)
{
Abort(ex);
}
}
public static byte[] BuildSettingsFrame(HttpConnectionSettings settings)
{
Span<byte> buffer = stackalloc byte[4 + VariableLengthIntegerHelper.MaximumEncodedLength];
int integerLength = VariableLengthIntegerHelper.WriteInteger(buffer.Slice(4), settings._maxResponseHeadersLength * 1024L);
int payloadLength = 1 + integerLength; // includes the setting ID and the integer value.
Debug.Assert(payloadLength <= VariableLengthIntegerHelper.OneByteLimit);
buffer[0] = (byte)Http3StreamType.Control;
buffer[1] = (byte)Http3FrameType.Settings;
buffer[2] = (byte)payloadLength;
buffer[3] = (byte)Http3SettingType.MaxHeaderListSize;
return buffer.Slice(0, 4 + integerLength).ToArray();
}
/// <summary>
/// Accepts unidirectional streams (control, QPack, ...) from the server.
/// </summary>
private async Task AcceptStreamsAsync()
{
try
{
while (true)
{
ValueTask<QuicStream> streamTask;
lock (SyncObj)
{
if (ShuttingDown)
{
return;
}
// No cancellation token is needed here; we expect the operation to cancel itself when _connection is disposed.
streamTask = _connection!.AcceptStreamAsync(CancellationToken.None);
}
QuicStream stream = await streamTask.ConfigureAwait(false);
// This process is cleaned up when _connection is disposed, and errors are observed via Abort().
_ = ProcessServerStreamAsync(stream);
}
}
catch (QuicOperationAbortedException)
{
// Shutdown initiated by us, no need to abort.
}
catch (Exception ex)
{
Abort(ex);
}
}
/// <summary>
/// Routes a stream to an appropriate stream-type-specific processor
/// </summary>
private async Task ProcessServerStreamAsync(QuicStream stream)
{
ArrayBuffer buffer = default;
try
{
await using (stream.ConfigureAwait(false))
{
if (stream.CanWrite)
{
// Server initiated bidirectional streams are either push streams or extensions, and we support neither.
throw new Http3ConnectionException(Http3ErrorCode.StreamCreationError);
}
buffer = new ArrayBuffer(initialSize: 32, usePool: true);
int bytesRead;
try
{
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
}
catch (QuicStreamAbortedException)
{
// Treat identical to receiving 0. See below comment.
bytesRead = 0;
}
if (bytesRead == 0)
{
// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#name-unidirectional-streams
// A sender can close or reset a unidirectional stream unless otherwise specified. A receiver MUST
// tolerate unidirectional streams being closed or reset prior to the reception of the unidirectional
// stream header.
return;
}
buffer.Commit(bytesRead);
// Stream type is a variable-length integer, but we only check the first byte. There is no known type requiring more than 1 byte.
switch (buffer.ActiveSpan[0])
{
case (byte)Http3StreamType.Control:
if (Interlocked.Exchange(ref _haveServerControlStream, 1) != 0)
{
// A second control stream has been received.
throw new Http3ConnectionException(Http3ErrorCode.StreamCreationError);
}
// Discard the stream type header.
buffer.Discard(1);
// Ownership of buffer is transferred to ProcessServerControlStreamAsync.
ArrayBuffer bufferCopy = buffer;
buffer = default;
await ProcessServerControlStreamAsync(stream, bufferCopy).ConfigureAwait(false);
return;
case (byte)Http3StreamType.QPackDecoder:
if (Interlocked.Exchange(ref _haveServerQpackDecodeStream, 1) != 0)
{
// A second QPack decode stream has been received.
throw new Http3ConnectionException(Http3ErrorCode.StreamCreationError);
}
// The stream must not be closed, but we aren't using QPACK right now -- ignore.
buffer.Dispose();
await stream.CopyToAsync(Stream.Null).ConfigureAwait(false);
return;
case (byte)Http3StreamType.QPackEncoder:
if (Interlocked.Exchange(ref _haveServerQpackEncodeStream, 1) != 0)
{
// A second QPack encode stream has been received.
throw new Http3ConnectionException(Http3ErrorCode.StreamCreationError);
}
// We haven't enabled QPack in our SETTINGS frame, so we shouldn't receive any meaningful data here.
// However, the standard says the stream must not be closed for the lifetime of the connection. Just ignore any data.
buffer.Dispose();
await stream.CopyToAsync(Stream.Null).ConfigureAwait(false);
return;
case (byte)Http3StreamType.Push:
// We don't support push streams.
// Because no maximum push stream ID was negotiated via a MAX_PUSH_ID frame, server should not have sent this. Abort the connection with H3_ID_ERROR.
throw new Http3ConnectionException(Http3ErrorCode.IdError);
default:
// Unknown stream type. Per spec, these must be ignored and aborted but not be considered a connection-level error.
if (NetEventSource.Log.IsEnabled())
{
// Read the rest of the integer, which might be more than 1 byte, so we can log it.
long unknownStreamType;
while (!VariableLengthIntegerHelper.TryRead(buffer.ActiveSpan, out unknownStreamType, out _))
{
buffer.EnsureAvailableSpace(VariableLengthIntegerHelper.MaximumEncodedLength);
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead == 0)
{
unknownStreamType = -1;
break;
}
buffer.Commit(bytesRead);
}
NetEventSource.Info(this, $"Ignoring server-initiated stream of unknown type {unknownStreamType}.");
}
stream.AbortWrite((long)Http3ErrorCode.StreamCreationError);
return;
}
}
}
catch (Exception ex)
{
Abort(ex);
}
finally
{
buffer.Dispose();
}
}
/// <summary>
/// Reads the server's control stream.
/// </summary>
private async Task ProcessServerControlStreamAsync(QuicStream stream, ArrayBuffer buffer)
{
using (buffer)
{
// Read the first frame of the control stream. Per spec:
// A SETTINGS frame MUST be sent as the first frame of each control stream.
(Http3FrameType? frameType, long payloadLength) = await ReadFrameEnvelopeAsync().ConfigureAwait(false);
if (frameType == null)
{
// Connection closed prematurely, expected SETTINGS frame.
throw new Http3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
}
if (frameType != Http3FrameType.Settings)
{
throw new Http3ConnectionException(Http3ErrorCode.MissingSettings);
}
await ProcessSettingsFrameAsync(payloadLength).ConfigureAwait(false);
// Read subsequent frames.
while (true)
{
(frameType, payloadLength) = await ReadFrameEnvelopeAsync().ConfigureAwait(false);
switch (frameType)
{
case Http3FrameType.GoAway:
await ProcessGoAwayFrameAsync(payloadLength).ConfigureAwait(false);
break;
case Http3FrameType.Settings:
// If an endpoint receives a second SETTINGS frame on the control stream, the endpoint MUST respond with a connection error of type H3_FRAME_UNEXPECTED.
throw new Http3ConnectionException(Http3ErrorCode.UnexpectedFrame);
case Http3FrameType.Headers: // Servers should not send these frames to a control stream.
case Http3FrameType.Data:
case Http3FrameType.MaxPushId:
case Http3FrameType.ReservedHttp2Priority: // These frames are explicitly reserved and must never be sent.
case Http3FrameType.ReservedHttp2Ping:
case Http3FrameType.ReservedHttp2WindowUpdate:
case Http3FrameType.ReservedHttp2Continuation:
throw new Http3ConnectionException(Http3ErrorCode.UnexpectedFrame);
case Http3FrameType.PushPromise:
case Http3FrameType.CancelPush:
// Because we haven't sent any MAX_PUSH_ID frame, it is invalid to receive any push-related frames as they will all reference a too-large ID.
throw new Http3ConnectionException(Http3ErrorCode.IdError);
case null:
// End of stream reached. If we're shutting down, stop looping. Otherwise, this is an error (this stream should not be closed for life of connection).
bool shuttingDown;
lock (SyncObj)
{
shuttingDown = ShuttingDown;
}
if (!shuttingDown)
{
throw new Http3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
}
return;
default:
await SkipUnknownPayloadAsync(frameType.GetValueOrDefault(), payloadLength).ConfigureAwait(false);
break;
}
}
}
async ValueTask<(Http3FrameType? frameType, long payloadLength)> ReadFrameEnvelopeAsync()
{
long frameType, payloadLength;
int bytesRead;
while (!Http3Frame.TryReadIntegerPair(buffer.ActiveSpan, out frameType, out payloadLength, out bytesRead))
{
buffer.EnsureAvailableSpace(VariableLengthIntegerHelper.MaximumEncodedLength * 2);
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead != 0)
{
buffer.Commit(bytesRead);
}
else if (buffer.ActiveLength == 0)
{
// End of stream.
return (null, 0);
}
else
{
// Our buffer has partial frame data in it but not enough to complete the read: bail out.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
}
buffer.Discard(bytesRead);
return ((Http3FrameType)frameType, payloadLength);
}
async ValueTask ProcessSettingsFrameAsync(long settingsPayloadLength)
{
while (settingsPayloadLength != 0)
{
long settingId, settingValue;
int bytesRead;
while (!Http3Frame.TryReadIntegerPair(buffer.ActiveSpan, out settingId, out settingValue, out bytesRead))
{
buffer.EnsureAvailableSpace(VariableLengthIntegerHelper.MaximumEncodedLength * 2);
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead != 0)
{
buffer.Commit(bytesRead);
}
else
{
// Our buffer has partial frame data in it but not enough to complete the read: bail out.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
}
settingsPayloadLength -= bytesRead;
if (settingsPayloadLength < 0)
{
// An integer was encoded past the payload length.
// A frame payload that contains additional bytes after the identified fields or a frame payload that terminates before the end of the identified fields MUST be treated as a connection error of type H3_FRAME_ERROR.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
buffer.Discard(bytesRead);
switch ((Http3SettingType)settingId)
{
case Http3SettingType.MaxHeaderListSize:
_maximumHeadersLength = (int)Math.Min(settingValue, int.MaxValue);
break;
case Http3SettingType.ReservedHttp2EnablePush:
case Http3SettingType.ReservedHttp2MaxConcurrentStreams:
case Http3SettingType.ReservedHttp2InitialWindowSize:
case Http3SettingType.ReservedHttp2MaxFrameSize:
// Per https://tools.ietf.org/html/draft-ietf-quic-http-31#section-7.2.4.1
// these settings IDs are reserved and must never be sent.
throw new Http3ConnectionException(Http3ErrorCode.SettingsError);
}
}
}
async ValueTask ProcessGoAwayFrameAsync(long goawayPayloadLength)
{
long lastStreamId;
int bytesRead;
while (!VariableLengthIntegerHelper.TryRead(buffer.ActiveSpan, out lastStreamId, out bytesRead))
{
buffer.EnsureAvailableSpace(VariableLengthIntegerHelper.MaximumEncodedLength);
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead != 0)
{
buffer.Commit(bytesRead);
}
else
{
// Our buffer has partial frame data in it but not enough to complete the read: bail out.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
}
buffer.Discard(bytesRead);
if (bytesRead != goawayPayloadLength)
{
// Frame contains unknown extra data after the integer.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
OnServerGoAway(lastStreamId);
}
async ValueTask SkipUnknownPayloadAsync(Http3FrameType frameType, long payloadLength)
{
while (payloadLength != 0)
{
if (buffer.ActiveLength == 0)
{
int bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead != 0)
{
buffer.Commit(bytesRead);
}
else
{
// Our buffer has partial frame data in it but not enough to complete the read: bail out.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
}
long readLength = Math.Min(payloadLength, buffer.ActiveLength);
buffer.Discard((int)readLength);
payloadLength -= readLength;
}
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Threading;
using System.Threading.Tasks;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Net.Quic;
using System.IO;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Net.Http.Headers;
using System.Net.Security;
namespace System.Net.Http
{
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
internal sealed class Http3Connection : HttpConnectionBase
{
private readonly HttpConnectionPool _pool;
private readonly HttpAuthority? _origin;
private readonly HttpAuthority _authority;
private readonly byte[] _altUsedEncodedHeader;
private QuicConnection? _connection;
private Task? _connectionClosedTask;
// Keep a collection of requests around so we can process GOAWAY.
private readonly Dictionary<QuicStream, Http3RequestStream> _activeRequests = new Dictionary<QuicStream, Http3RequestStream>();
// Set when GOAWAY is being processed, when aborting, or when disposing.
private long _lastProcessedStreamId = -1;
// Our control stream.
private QuicStream? _clientControl;
// Current SETTINGS from the server.
private int _maximumHeadersLength = int.MaxValue; // TODO: this is not yet observed by Http3Stream when buffering headers.
// Once the server's streams are received, these are set to 1. Further receipt of these streams results in a connection error.
private int _haveServerControlStream;
private int _haveServerQpackDecodeStream;
private int _haveServerQpackEncodeStream;
// A connection-level error will abort any future operations.
private Exception? _abortException;
private const int TelemetryStatus_Opened = 1;
private const int TelemetryStatus_Closed = 2;
private int _markedByTelemetryStatus;
public HttpAuthority Authority => _authority;
public HttpConnectionPool Pool => _pool;
public int MaximumRequestHeadersLength => _maximumHeadersLength;
public byte[] AltUsedEncodedHeaderBytes => _altUsedEncodedHeader;
public Exception? AbortException => Volatile.Read(ref _abortException);
private object SyncObj => _activeRequests;
/// <summary>
/// If true, we've received GOAWAY, are aborting due to a connection-level error, or are disposing due to pool limits.
/// </summary>
private bool ShuttingDown
{
get
{
Debug.Assert(Monitor.IsEntered(SyncObj));
return _lastProcessedStreamId != -1;
}
}
public Http3Connection(HttpConnectionPool pool, HttpAuthority? origin, HttpAuthority authority, QuicConnection connection)
{
_pool = pool;
_origin = origin;
_authority = authority;
_connection = connection;
bool altUsedDefaultPort = pool.Kind == HttpConnectionKind.Http && authority.Port == HttpConnectionPool.DefaultHttpPort || pool.Kind == HttpConnectionKind.Https && authority.Port == HttpConnectionPool.DefaultHttpsPort;
string altUsedValue = altUsedDefaultPort ? authority.IdnHost : string.Create(CultureInfo.InvariantCulture, $"{authority.IdnHost}:{authority.Port}");
_altUsedEncodedHeader = QPack.QPackEncoder.EncodeLiteralHeaderFieldWithoutNameReferenceToArray(KnownHeaders.AltUsed.Name, altUsedValue);
if (HttpTelemetry.Log.IsEnabled())
{
HttpTelemetry.Log.Http30ConnectionEstablished();
_markedByTelemetryStatus = TelemetryStatus_Opened;
}
// Errors are observed via Abort().
_ = SendSettingsAsync();
// This process is cleaned up when _connection is disposed, and errors are observed via Abort().
_ = AcceptStreamsAsync();
}
/// <summary>
/// Starts shutting down the <see cref="Http3Connection"/>. Final cleanup will happen when there are no more active requests.
/// </summary>
public override void Dispose()
{
lock (SyncObj)
{
if (_lastProcessedStreamId == -1)
{
_lastProcessedStreamId = long.MaxValue;
CheckForShutdown();
}
}
}
/// <summary>
/// Called when shutting down, this checks for when shutdown is complete (no more active requests) and does actual disposal.
/// </summary>
/// <remarks>Requires <see cref="SyncObj"/> to be locked.</remarks>
private void CheckForShutdown()
{
Debug.Assert(Monitor.IsEntered(SyncObj));
Debug.Assert(ShuttingDown);
if (_activeRequests.Count != 0)
{
return;
}
if (_connection != null)
{
// Close the QuicConnection in the background.
if (_connectionClosedTask == null)
{
_connectionClosedTask = _connection.CloseAsync((long)Http3ErrorCode.NoError).AsTask();
}
QuicConnection connection = _connection;
_connection = null;
_ = _connectionClosedTask.ContinueWith(closeTask =>
{
if (closeTask.IsFaulted && NetEventSource.Log.IsEnabled())
{
Trace($"{nameof(QuicConnection)} failed to close: {closeTask.Exception!.InnerException}");
}
try
{
connection.Dispose();
}
catch (Exception ex)
{
Trace($"{nameof(QuicConnection)} failed to dispose: {ex}");
}
if (_clientControl != null)
{
_clientControl.Dispose();
_clientControl = null;
}
}, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
if (HttpTelemetry.Log.IsEnabled())
{
if (Interlocked.Exchange(ref _markedByTelemetryStatus, TelemetryStatus_Closed) == TelemetryStatus_Opened)
{
HttpTelemetry.Log.Http30ConnectionClosed();
}
}
}
}
public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, long queueStartingTimestamp, CancellationToken cancellationToken)
{
// Allocate an active request
QuicStream? quicStream = null;
Http3RequestStream? requestStream = null;
ValueTask waitTask = default;
try
{
try
{
while (true)
{
lock (SyncObj)
{
if (_connection == null)
{
break;
}
if (_connection.GetRemoteAvailableBidirectionalStreamCount() > 0)
{
quicStream = _connection.OpenBidirectionalStream();
requestStream = new Http3RequestStream(request, this, quicStream);
_activeRequests.Add(quicStream, requestStream);
break;
}
waitTask = _connection.WaitForAvailableBidirectionalStreamsAsync(cancellationToken);
}
if (HttpTelemetry.Log.IsEnabled() && !waitTask.IsCompleted && queueStartingTimestamp == 0)
{
// We avoid logging RequestLeftQueue if a stream was available immediately (synchronously)
queueStartingTimestamp = Stopwatch.GetTimestamp();
}
// Wait for an available stream (based on QUIC MAX_STREAMS) if there isn't one available yet.
await waitTask.ConfigureAwait(false);
}
}
finally
{
if (HttpTelemetry.Log.IsEnabled() && queueStartingTimestamp != 0)
{
HttpTelemetry.Log.Http30RequestLeftQueue(Stopwatch.GetElapsedTime(queueStartingTimestamp).TotalMilliseconds);
}
}
if (quicStream == null)
{
throw new HttpRequestException(SR.net_http_request_aborted, null, RequestRetryType.RetryOnConnectionFailure);
}
requestStream!.StreamId = quicStream.StreamId;
bool goAway;
lock (SyncObj)
{
goAway = _lastProcessedStreamId != -1 && requestStream.StreamId > _lastProcessedStreamId;
}
if (goAway)
{
throw new HttpRequestException(SR.net_http_request_aborted, null, RequestRetryType.RetryOnConnectionFailure);
}
if (NetEventSource.Log.IsEnabled()) Trace($"Sending request: {request}");
Task<HttpResponseMessage> responseTask = requestStream.SendAsync(cancellationToken);
// null out requestStream to avoid disposing in finally block. It is now in charge of disposing itself.
requestStream = null;
return await responseTask.ConfigureAwait(false);
}
catch (QuicConnectionAbortedException ex)
{
// This will happen if we aborted _connection somewhere.
Abort(ex);
throw new HttpRequestException(SR.Format(SR.net_http_http3_connection_error, ex.ErrorCode), ex, RequestRetryType.RetryOnConnectionFailure);
}
finally
{
requestStream?.Dispose();
}
}
/// <summary>
/// Aborts the connection with an error.
/// </summary>
/// <remarks>
/// Used for e.g. I/O or connection-level frame parsing errors.
/// </remarks>
internal Exception Abort(Exception abortException)
{
// Only observe the first exception we get.
Exception? firstException = Interlocked.CompareExchange(ref _abortException, abortException, null);
if (firstException != null)
{
if (NetEventSource.Log.IsEnabled() && !ReferenceEquals(firstException, abortException))
{
// Lost the race to set the field to another exception, so just trace this one.
Trace($"{nameof(abortException)}=={abortException}");
}
return firstException;
}
// Stop sending requests to this connection.
_pool.InvalidateHttp3Connection(this);
Http3ErrorCode connectionResetErrorCode = (abortException as Http3ProtocolException)?.ErrorCode ?? Http3ErrorCode.InternalError;
lock (SyncObj)
{
// Set _lastProcessedStreamId != -1 to make ShuttingDown = true.
// It's possible GOAWAY is already being processed, in which case this would already be != -1.
if (_lastProcessedStreamId == -1)
{
_lastProcessedStreamId = long.MaxValue;
}
// Abort the connection. This will cause all of our streams to abort on their next I/O.
if (_connection != null && _connectionClosedTask == null)
{
_connectionClosedTask = _connection.CloseAsync((long)connectionResetErrorCode).AsTask();
}
CheckForShutdown();
}
return abortException;
}
private void OnServerGoAway(long lastProcessedStreamId)
{
// Stop sending requests to this connection.
_pool.InvalidateHttp3Connection(this);
var streamsToGoAway = new List<Http3RequestStream>();
lock (SyncObj)
{
if (_lastProcessedStreamId != -1 && lastProcessedStreamId > _lastProcessedStreamId)
{
// Server can send multiple GOAWAY frames.
// Spec says a server MUST NOT increase the stream ID in subsequent GOAWAYs,
// but doesn't specify what client should do if that is violated. Ignore for now.
if (NetEventSource.Log.IsEnabled())
{
Trace("HTTP/3 server sent GOAWAY with increasing stream ID. Retried requests may have been double-processed by server.");
}
return;
}
_lastProcessedStreamId = lastProcessedStreamId;
foreach (KeyValuePair<QuicStream, Http3RequestStream> request in _activeRequests)
{
if (request.Value.StreamId > lastProcessedStreamId)
{
streamsToGoAway.Add(request.Value);
}
}
CheckForShutdown();
}
// GOAWAY each stream outside of the lock, so they can acquire the lock to remove themselves from _activeRequests.
foreach (Http3RequestStream stream in streamsToGoAway)
{
stream.GoAway();
}
}
public void RemoveStream(QuicStream stream)
{
lock (SyncObj)
{
bool removed = _activeRequests.Remove(stream);
Debug.Assert(removed == true);
if (ShuttingDown)
{
CheckForShutdown();
}
}
}
public override long GetIdleTicks(long nowTicks) => throw new NotImplementedException("We aren't scavenging HTTP3 connections yet");
public override void Trace(string message, [CallerMemberName] string? memberName = null) =>
Trace(0, message, memberName);
internal void Trace(long streamId, string message, [CallerMemberName] string? memberName = null) =>
NetEventSource.Log.HandlerMessage(
_pool?.GetHashCode() ?? 0, // pool ID
GetHashCode(), // connection ID
(int)streamId, // stream ID
memberName, // method name
message); // message
private async Task SendSettingsAsync()
{
try
{
_clientControl = _connection!.OpenUnidirectionalStream();
await _clientControl.WriteAsync(_pool.Settings.Http3SettingsFrame, CancellationToken.None).ConfigureAwait(false);
}
catch (Exception ex)
{
Abort(ex);
}
}
public static byte[] BuildSettingsFrame(HttpConnectionSettings settings)
{
Span<byte> buffer = stackalloc byte[4 + VariableLengthIntegerHelper.MaximumEncodedLength];
int integerLength = VariableLengthIntegerHelper.WriteInteger(buffer.Slice(4), settings._maxResponseHeadersLength * 1024L);
int payloadLength = 1 + integerLength; // includes the setting ID and the integer value.
Debug.Assert(payloadLength <= VariableLengthIntegerHelper.OneByteLimit);
buffer[0] = (byte)Http3StreamType.Control;
buffer[1] = (byte)Http3FrameType.Settings;
buffer[2] = (byte)payloadLength;
buffer[3] = (byte)Http3SettingType.MaxHeaderListSize;
return buffer.Slice(0, 4 + integerLength).ToArray();
}
/// <summary>
/// Accepts unidirectional streams (control, QPack, ...) from the server.
/// </summary>
private async Task AcceptStreamsAsync()
{
try
{
while (true)
{
ValueTask<QuicStream> streamTask;
lock (SyncObj)
{
if (ShuttingDown)
{
return;
}
// No cancellation token is needed here; we expect the operation to cancel itself when _connection is disposed.
streamTask = _connection!.AcceptStreamAsync(CancellationToken.None);
}
QuicStream stream = await streamTask.ConfigureAwait(false);
// This process is cleaned up when _connection is disposed, and errors are observed via Abort().
_ = ProcessServerStreamAsync(stream);
}
}
catch (QuicOperationAbortedException)
{
// Shutdown initiated by us, no need to abort.
}
catch (Exception ex)
{
Abort(ex);
}
}
/// <summary>
/// Routes a stream to an appropriate stream-type-specific processor
/// </summary>
private async Task ProcessServerStreamAsync(QuicStream stream)
{
ArrayBuffer buffer = default;
try
{
await using (stream.ConfigureAwait(false))
{
if (stream.CanWrite)
{
// Server initiated bidirectional streams are either push streams or extensions, and we support neither.
throw new Http3ConnectionException(Http3ErrorCode.StreamCreationError);
}
buffer = new ArrayBuffer(initialSize: 32, usePool: true);
int bytesRead;
try
{
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
}
catch (QuicStreamAbortedException)
{
// Treat identical to receiving 0. See below comment.
bytesRead = 0;
}
if (bytesRead == 0)
{
// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#name-unidirectional-streams
// A sender can close or reset a unidirectional stream unless otherwise specified. A receiver MUST
// tolerate unidirectional streams being closed or reset prior to the reception of the unidirectional
// stream header.
return;
}
buffer.Commit(bytesRead);
// Stream type is a variable-length integer, but we only check the first byte. There is no known type requiring more than 1 byte.
switch (buffer.ActiveSpan[0])
{
case (byte)Http3StreamType.Control:
if (Interlocked.Exchange(ref _haveServerControlStream, 1) != 0)
{
// A second control stream has been received.
throw new Http3ConnectionException(Http3ErrorCode.StreamCreationError);
}
// Discard the stream type header.
buffer.Discard(1);
// Ownership of buffer is transferred to ProcessServerControlStreamAsync.
ArrayBuffer bufferCopy = buffer;
buffer = default;
await ProcessServerControlStreamAsync(stream, bufferCopy).ConfigureAwait(false);
return;
case (byte)Http3StreamType.QPackDecoder:
if (Interlocked.Exchange(ref _haveServerQpackDecodeStream, 1) != 0)
{
// A second QPack decode stream has been received.
throw new Http3ConnectionException(Http3ErrorCode.StreamCreationError);
}
// The stream must not be closed, but we aren't using QPACK right now -- ignore.
buffer.Dispose();
await stream.CopyToAsync(Stream.Null).ConfigureAwait(false);
return;
case (byte)Http3StreamType.QPackEncoder:
if (Interlocked.Exchange(ref _haveServerQpackEncodeStream, 1) != 0)
{
// A second QPack encode stream has been received.
throw new Http3ConnectionException(Http3ErrorCode.StreamCreationError);
}
// We haven't enabled QPack in our SETTINGS frame, so we shouldn't receive any meaningful data here.
// However, the standard says the stream must not be closed for the lifetime of the connection. Just ignore any data.
buffer.Dispose();
await stream.CopyToAsync(Stream.Null).ConfigureAwait(false);
return;
case (byte)Http3StreamType.Push:
// We don't support push streams.
// Because no maximum push stream ID was negotiated via a MAX_PUSH_ID frame, server should not have sent this. Abort the connection with H3_ID_ERROR.
throw new Http3ConnectionException(Http3ErrorCode.IdError);
default:
// Unknown stream type. Per spec, these must be ignored and aborted but not be considered a connection-level error.
if (NetEventSource.Log.IsEnabled())
{
// Read the rest of the integer, which might be more than 1 byte, so we can log it.
long unknownStreamType;
while (!VariableLengthIntegerHelper.TryRead(buffer.ActiveSpan, out unknownStreamType, out _))
{
buffer.EnsureAvailableSpace(VariableLengthIntegerHelper.MaximumEncodedLength);
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead == 0)
{
unknownStreamType = -1;
break;
}
buffer.Commit(bytesRead);
}
NetEventSource.Info(this, $"Ignoring server-initiated stream of unknown type {unknownStreamType}.");
}
stream.AbortWrite((long)Http3ErrorCode.StreamCreationError);
return;
}
}
}
catch (Exception ex)
{
Abort(ex);
}
finally
{
buffer.Dispose();
}
}
/// <summary>
/// Reads the server's control stream.
/// </summary>
private async Task ProcessServerControlStreamAsync(QuicStream stream, ArrayBuffer buffer)
{
using (buffer)
{
// Read the first frame of the control stream. Per spec:
// A SETTINGS frame MUST be sent as the first frame of each control stream.
(Http3FrameType? frameType, long payloadLength) = await ReadFrameEnvelopeAsync().ConfigureAwait(false);
if (frameType == null)
{
// Connection closed prematurely, expected SETTINGS frame.
throw new Http3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
}
if (frameType != Http3FrameType.Settings)
{
throw new Http3ConnectionException(Http3ErrorCode.MissingSettings);
}
await ProcessSettingsFrameAsync(payloadLength).ConfigureAwait(false);
// Read subsequent frames.
while (true)
{
(frameType, payloadLength) = await ReadFrameEnvelopeAsync().ConfigureAwait(false);
switch (frameType)
{
case Http3FrameType.GoAway:
await ProcessGoAwayFrameAsync(payloadLength).ConfigureAwait(false);
break;
case Http3FrameType.Settings:
// If an endpoint receives a second SETTINGS frame on the control stream, the endpoint MUST respond with a connection error of type H3_FRAME_UNEXPECTED.
throw new Http3ConnectionException(Http3ErrorCode.UnexpectedFrame);
case Http3FrameType.Headers: // Servers should not send these frames to a control stream.
case Http3FrameType.Data:
case Http3FrameType.MaxPushId:
case Http3FrameType.ReservedHttp2Priority: // These frames are explicitly reserved and must never be sent.
case Http3FrameType.ReservedHttp2Ping:
case Http3FrameType.ReservedHttp2WindowUpdate:
case Http3FrameType.ReservedHttp2Continuation:
throw new Http3ConnectionException(Http3ErrorCode.UnexpectedFrame);
case Http3FrameType.PushPromise:
case Http3FrameType.CancelPush:
// Because we haven't sent any MAX_PUSH_ID frame, it is invalid to receive any push-related frames as they will all reference a too-large ID.
throw new Http3ConnectionException(Http3ErrorCode.IdError);
case null:
// End of stream reached. If we're shutting down, stop looping. Otherwise, this is an error (this stream should not be closed for life of connection).
bool shuttingDown;
lock (SyncObj)
{
shuttingDown = ShuttingDown;
}
if (!shuttingDown)
{
throw new Http3ConnectionException(Http3ErrorCode.ClosedCriticalStream);
}
return;
default:
await SkipUnknownPayloadAsync(frameType.GetValueOrDefault(), payloadLength).ConfigureAwait(false);
break;
}
}
}
async ValueTask<(Http3FrameType? frameType, long payloadLength)> ReadFrameEnvelopeAsync()
{
long frameType, payloadLength;
int bytesRead;
while (!Http3Frame.TryReadIntegerPair(buffer.ActiveSpan, out frameType, out payloadLength, out bytesRead))
{
buffer.EnsureAvailableSpace(VariableLengthIntegerHelper.MaximumEncodedLength * 2);
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead != 0)
{
buffer.Commit(bytesRead);
}
else if (buffer.ActiveLength == 0)
{
// End of stream.
return (null, 0);
}
else
{
// Our buffer has partial frame data in it but not enough to complete the read: bail out.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
}
buffer.Discard(bytesRead);
return ((Http3FrameType)frameType, payloadLength);
}
async ValueTask ProcessSettingsFrameAsync(long settingsPayloadLength)
{
while (settingsPayloadLength != 0)
{
long settingId, settingValue;
int bytesRead;
while (!Http3Frame.TryReadIntegerPair(buffer.ActiveSpan, out settingId, out settingValue, out bytesRead))
{
buffer.EnsureAvailableSpace(VariableLengthIntegerHelper.MaximumEncodedLength * 2);
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead != 0)
{
buffer.Commit(bytesRead);
}
else
{
// Our buffer has partial frame data in it but not enough to complete the read: bail out.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
}
settingsPayloadLength -= bytesRead;
if (settingsPayloadLength < 0)
{
// An integer was encoded past the payload length.
// A frame payload that contains additional bytes after the identified fields or a frame payload that terminates before the end of the identified fields MUST be treated as a connection error of type H3_FRAME_ERROR.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
buffer.Discard(bytesRead);
switch ((Http3SettingType)settingId)
{
case Http3SettingType.MaxHeaderListSize:
_maximumHeadersLength = (int)Math.Min(settingValue, int.MaxValue);
break;
case Http3SettingType.ReservedHttp2EnablePush:
case Http3SettingType.ReservedHttp2MaxConcurrentStreams:
case Http3SettingType.ReservedHttp2InitialWindowSize:
case Http3SettingType.ReservedHttp2MaxFrameSize:
// Per https://tools.ietf.org/html/draft-ietf-quic-http-31#section-7.2.4.1
// these settings IDs are reserved and must never be sent.
throw new Http3ConnectionException(Http3ErrorCode.SettingsError);
}
}
}
async ValueTask ProcessGoAwayFrameAsync(long goawayPayloadLength)
{
long lastStreamId;
int bytesRead;
while (!VariableLengthIntegerHelper.TryRead(buffer.ActiveSpan, out lastStreamId, out bytesRead))
{
buffer.EnsureAvailableSpace(VariableLengthIntegerHelper.MaximumEncodedLength);
bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead != 0)
{
buffer.Commit(bytesRead);
}
else
{
// Our buffer has partial frame data in it but not enough to complete the read: bail out.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
}
buffer.Discard(bytesRead);
if (bytesRead != goawayPayloadLength)
{
// Frame contains unknown extra data after the integer.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
OnServerGoAway(lastStreamId);
}
async ValueTask SkipUnknownPayloadAsync(Http3FrameType frameType, long payloadLength)
{
while (payloadLength != 0)
{
if (buffer.ActiveLength == 0)
{
int bytesRead = await stream.ReadAsync(buffer.AvailableMemory, CancellationToken.None).ConfigureAwait(false);
if (bytesRead != 0)
{
buffer.Commit(bytesRead);
}
else
{
// Our buffer has partial frame data in it but not enough to complete the read: bail out.
throw new Http3ConnectionException(Http3ErrorCode.FrameError);
}
}
long readLength = Math.Min(payloadLength, buffer.ActiveLength);
buffer.Discard((int)readLength);
payloadLength -= readLength;
}
}
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Net.Http.Headers;
using System.Net.Http.HPack;
using System.Net.Http.QPack;
using System.Net.Quic;
using System.Net.Security;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.Versioning;
using System.Security.Authentication;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace System.Net.Http
{
/// <summary>Provides a pool of connections to the same endpoint.</summary>
internal sealed class HttpConnectionPool : IDisposable
{
private static readonly bool s_isWindows7Or2008R2 = GetIsWindows7Or2008R2();
private readonly HttpConnectionPoolManager _poolManager;
private readonly HttpConnectionKind _kind;
private readonly Uri? _proxyUri;
/// <summary>The origin authority used to construct the <see cref="HttpConnectionPool"/>.</summary>
private readonly HttpAuthority? _originAuthority;
/// <summary>Initially set to null, this can be set to enable HTTP/3 based on Alt-Svc.</summary>
private volatile HttpAuthority? _http3Authority;
/// <summary>A timer to expire <see cref="_http3Authority"/> and return the pool to <see cref="_originAuthority"/>. Initialized on first use.</summary>
private Timer? _authorityExpireTimer;
/// <summary>If true, the <see cref="_http3Authority"/> will persist across a network change. If false, it will be reset to <see cref="_originAuthority"/>.</summary>
private bool _persistAuthority;
/// <summary>
/// When an Alt-Svc authority fails due to 421 Misdirected Request, it is placed in the blocklist to be ignored
/// for <see cref="AltSvcBlocklistTimeoutInMilliseconds"/> milliseconds. Initialized on first use.
/// </summary>
private volatile HashSet<HttpAuthority>? _altSvcBlocklist;
private CancellationTokenSource? _altSvcBlocklistTimerCancellation;
private volatile bool _altSvcEnabled = true;
/// <summary>The maximum number of times to retry a request after a failure on an established connection.</summary>
private const int MaxConnectionFailureRetries = 3;
/// <summary>
/// If <see cref="_altSvcBlocklist"/> exceeds this size, Alt-Svc will be disabled entirely for <see cref="AltSvcBlocklistTimeoutInMilliseconds"/> milliseconds.
/// This is to prevent a failing server from bloating the dictionary beyond a reasonable value.
/// </summary>
private const int MaxAltSvcIgnoreListSize = 8;
/// <summary>The time, in milliseconds, that an authority should remain in <see cref="_altSvcBlocklist"/>.</summary>
private const int AltSvcBlocklistTimeoutInMilliseconds = 10 * 60 * 1000;
// HTTP/1.1 connection pool
/// <summary>List of available HTTP/1.1 connections stored in the pool.</summary>
private readonly List<HttpConnection> _availableHttp11Connections = new List<HttpConnection>();
/// <summary>The maximum number of HTTP/1.1 connections allowed to be associated with the pool.</summary>
private readonly int _maxHttp11Connections;
/// <summary>The number of HTTP/1.1 connections associated with the pool, including in use, available, and pending.</summary>
private int _associatedHttp11ConnectionCount;
/// <summary>The number of HTTP/1.1 connections that are in the process of being established.</summary>
private int _pendingHttp11ConnectionCount;
/// <summary>Queue of requests waiting for an HTTP/1.1 connection.</summary>
private RequestQueue<HttpConnection> _http11RequestQueue;
// HTTP/2 connection pool
/// <summary>List of available HTTP/2 connections stored in the pool.</summary>
private List<Http2Connection>? _availableHttp2Connections;
/// <summary>The number of HTTP/2 connections associated with the pool, including in use, available, and pending.</summary>
private int _associatedHttp2ConnectionCount;
/// <summary>Indicates whether an HTTP/2 connection is in the process of being established.</summary>
private bool _pendingHttp2Connection;
/// <summary>Queue of requests waiting for an HTTP/2 connection.</summary>
private RequestQueue<Http2Connection?> _http2RequestQueue;
private bool _http2Enabled;
private byte[]? _http2AltSvcOriginUri;
internal readonly byte[]? _http2EncodedAuthorityHostHeader;
private readonly bool _http3Enabled;
private Http3Connection? _http3Connection;
private SemaphoreSlim? _http3ConnectionCreateLock;
internal readonly byte[]? _http3EncodedAuthorityHostHeader;
/// <summary>For non-proxy connection pools, this is the host name in bytes; for proxies, null.</summary>
private readonly byte[]? _hostHeaderValueBytes;
/// <summary>Options specialized and cached for this pool and its key.</summary>
private readonly SslClientAuthenticationOptions? _sslOptionsHttp11;
private readonly SslClientAuthenticationOptions? _sslOptionsHttp2;
private readonly SslClientAuthenticationOptions? _sslOptionsHttp2Only;
private readonly SslClientAuthenticationOptions? _sslOptionsHttp3;
/// <summary>Whether the pool has been used since the last time a cleanup occurred.</summary>
private bool _usedSinceLastCleanup = true;
/// <summary>Whether the pool has been disposed.</summary>
private bool _disposed;
public const int DefaultHttpPort = 80;
public const int DefaultHttpsPort = 443;
/// <summary>Initializes the pool.</summary>
/// <param name="poolManager">The manager associated with this pool.</param>
/// <param name="kind">The kind of HTTP connections stored in this pool.</param>
/// <param name="host">The host with which this pool is associated.</param>
/// <param name="port">The port with which this pool is associated.</param>
/// <param name="sslHostName">The SSL host with which this pool is associated.</param>
/// <param name="proxyUri">The proxy this pool targets (optional).</param>
public HttpConnectionPool(HttpConnectionPoolManager poolManager, HttpConnectionKind kind, string? host, int port, string? sslHostName, Uri? proxyUri)
{
_poolManager = poolManager;
_kind = kind;
_proxyUri = proxyUri;
_maxHttp11Connections = Settings._maxConnectionsPerServer;
if (host != null)
{
_originAuthority = new HttpAuthority(host, port);
}
_http2Enabled = _poolManager.Settings._maxHttpVersion >= HttpVersion.Version20;
if (IsHttp3Supported())
{
_http3Enabled = _poolManager.Settings._maxHttpVersion >= HttpVersion.Version30 && (_poolManager.Settings._quicImplementationProvider ?? QuicImplementationProviders.Default).IsSupported;
}
switch (kind)
{
case HttpConnectionKind.Http:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName == null);
Debug.Assert(proxyUri == null);
_http3Enabled = false;
break;
case HttpConnectionKind.Https:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName != null);
Debug.Assert(proxyUri == null);
break;
case HttpConnectionKind.Proxy:
Debug.Assert(host == null);
Debug.Assert(port == 0);
Debug.Assert(sslHostName == null);
Debug.Assert(proxyUri != null);
_http2Enabled = false;
_http3Enabled = false;
break;
case HttpConnectionKind.ProxyTunnel:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName == null);
Debug.Assert(proxyUri != null);
_http2Enabled = false;
_http3Enabled = false;
break;
case HttpConnectionKind.SslProxyTunnel:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName != null);
Debug.Assert(proxyUri != null);
_http3Enabled = false; // TODO: how do we tunnel HTTP3?
break;
case HttpConnectionKind.ProxyConnect:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName == null);
Debug.Assert(proxyUri != null);
// Don't enforce the max connections limit on proxy tunnels; this would mean that connections to different origin servers
// would compete for the same limited number of connections.
// We will still enforce this limit on the user of the tunnel (i.e. ProxyTunnel or SslProxyTunnel).
_maxHttp11Connections = int.MaxValue;
_http2Enabled = false;
_http3Enabled = false;
break;
case HttpConnectionKind.SocksTunnel:
case HttpConnectionKind.SslSocksTunnel:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(proxyUri != null);
_http3Enabled = false; // TODO: SOCKS supports UDP and may be used for HTTP3
break;
default:
Debug.Fail("Unknown HttpConnectionKind in HttpConnectionPool.ctor");
break;
}
if (!_http3Enabled)
{
// Avoid parsing Alt-Svc headers if they won't be used.
_altSvcEnabled = false;
}
string? hostHeader = null;
if (_originAuthority != null)
{
// Precalculate ASCII bytes for Host header
// Note that if _host is null, this is a (non-tunneled) proxy connection, and we can't cache the hostname.
hostHeader =
(_originAuthority.Port != (sslHostName == null ? DefaultHttpPort : DefaultHttpsPort)) ?
$"{_originAuthority.IdnHost}:{_originAuthority.Port}" :
_originAuthority.IdnHost;
// Note the IDN hostname should always be ASCII, since it's already been IDNA encoded.
_hostHeaderValueBytes = Encoding.ASCII.GetBytes(hostHeader);
Debug.Assert(Encoding.ASCII.GetString(_hostHeaderValueBytes) == hostHeader);
if (sslHostName == null)
{
_http2EncodedAuthorityHostHeader = HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(H2StaticTable.Authority, hostHeader);
_http3EncodedAuthorityHostHeader = QPackEncoder.EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(H3StaticTable.Authority, hostHeader);
}
}
if (sslHostName != null)
{
_sslOptionsHttp11 = ConstructSslOptions(poolManager, sslHostName);
_sslOptionsHttp11.ApplicationProtocols = null;
if (_http2Enabled)
{
_sslOptionsHttp2 = ConstructSslOptions(poolManager, sslHostName);
_sslOptionsHttp2.ApplicationProtocols = s_http2ApplicationProtocols;
_sslOptionsHttp2Only = ConstructSslOptions(poolManager, sslHostName);
_sslOptionsHttp2Only.ApplicationProtocols = s_http2OnlyApplicationProtocols;
// Note:
// The HTTP/2 specification states:
// "A deployment of HTTP/2 over TLS 1.2 MUST disable renegotiation.
// An endpoint MUST treat a TLS renegotiation as a connection error (Section 5.4.1)
// of type PROTOCOL_ERROR."
// which suggests we should do:
// _sslOptionsHttp2.AllowRenegotiation = false;
// However, if AllowRenegotiation is set to false, that will also prevent
// renegotation if the server denies the HTTP/2 request and causes a
// downgrade to HTTP/1.1, and the current APIs don't provide a mechanism
// by which AllowRenegotiation could be set back to true in that case.
// For now, if an HTTP/2 server erroneously issues a renegotiation, we'll
// allow it.
Debug.Assert(hostHeader != null);
_http2EncodedAuthorityHostHeader = HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(H2StaticTable.Authority, hostHeader);
_http3EncodedAuthorityHostHeader = QPackEncoder.EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(H3StaticTable.Authority, hostHeader);
}
if (IsHttp3Supported())
{
if (_http3Enabled)
{
_sslOptionsHttp3 = ConstructSslOptions(poolManager, sslHostName);
_sslOptionsHttp3.ApplicationProtocols = s_http3ApplicationProtocols;
}
}
}
// Set up for PreAuthenticate. Access to this cache is guarded by a lock on the cache itself.
if (_poolManager.Settings._preAuthenticate)
{
PreAuthCredentials = new CredentialCache();
}
if (NetEventSource.Log.IsEnabled()) Trace($"{this}");
}
[SupportedOSPlatformGuard("linux")]
[SupportedOSPlatformGuard("macOS")]
[SupportedOSPlatformGuard("Windows")]
internal static bool IsHttp3Supported() => (OperatingSystem.IsLinux() && !OperatingSystem.IsAndroid()) || OperatingSystem.IsWindows() || OperatingSystem.IsMacOS();
private static readonly List<SslApplicationProtocol> s_http3ApplicationProtocols = new List<SslApplicationProtocol>() { SslApplicationProtocol.Http3 };
private static readonly List<SslApplicationProtocol> s_http2ApplicationProtocols = new List<SslApplicationProtocol>() { SslApplicationProtocol.Http2, SslApplicationProtocol.Http11 };
private static readonly List<SslApplicationProtocol> s_http2OnlyApplicationProtocols = new List<SslApplicationProtocol>() { SslApplicationProtocol.Http2 };
private static SslClientAuthenticationOptions ConstructSslOptions(HttpConnectionPoolManager poolManager, string sslHostName)
{
Debug.Assert(sslHostName != null);
SslClientAuthenticationOptions sslOptions = poolManager.Settings._sslOptions?.ShallowClone() ?? new SslClientAuthenticationOptions();
// Set TargetHost for SNI
sslOptions.TargetHost = sslHostName;
// Windows 7 and Windows 2008 R2 support TLS 1.1 and 1.2, but for legacy reasons by default those protocols
// are not enabled when a developer elects to use the system default. However, in .NET Core 2.0 and earlier,
// HttpClientHandler would enable them, due to being a wrapper for WinHTTP, which enabled them. Both for
// compatibility and because we prefer those higher protocols whenever possible, SocketsHttpHandler also
// pretends they're part of the default when running on Win7/2008R2.
if (s_isWindows7Or2008R2 && sslOptions.EnabledSslProtocols == SslProtocols.None)
{
if (NetEventSource.Log.IsEnabled())
{
NetEventSource.Info(poolManager, $"Win7OrWin2K8R2 platform, Changing default TLS protocols to {SecurityProtocol.DefaultSecurityProtocols}");
}
sslOptions.EnabledSslProtocols = SecurityProtocol.DefaultSecurityProtocols;
}
return sslOptions;
}
public HttpAuthority? OriginAuthority => _originAuthority;
public HttpConnectionSettings Settings => _poolManager.Settings;
public HttpConnectionKind Kind => _kind;
public bool IsSecure => _kind == HttpConnectionKind.Https || _kind == HttpConnectionKind.SslProxyTunnel || _kind == HttpConnectionKind.SslSocksTunnel;
public Uri? ProxyUri => _proxyUri;
public ICredentials? ProxyCredentials => _poolManager.ProxyCredentials;
public byte[]? HostHeaderValueBytes => _hostHeaderValueBytes;
public CredentialCache? PreAuthCredentials { get; }
/// <summary>
/// An ASCII origin string per RFC 6454 Section 6.2, in format <scheme>://<host>[:<port>]
/// </summary>
/// <remarks>
/// Used by <see cref="Http2Connection"/> to test ALTSVC frames for our origin.
/// </remarks>
public byte[] Http2AltSvcOriginUri
{
get
{
if (_http2AltSvcOriginUri == null)
{
var sb = new StringBuilder();
Debug.Assert(_originAuthority != null);
sb.Append(IsSecure ? "https://" : "http://")
.Append(_originAuthority.IdnHost);
if (_originAuthority.Port != (IsSecure ? DefaultHttpsPort : DefaultHttpPort))
{
sb.Append(CultureInfo.InvariantCulture, $":{_originAuthority.Port}");
}
_http2AltSvcOriginUri = Encoding.ASCII.GetBytes(sb.ToString());
}
return _http2AltSvcOriginUri;
}
}
private bool EnableMultipleHttp2Connections => _poolManager.Settings.EnableMultipleHttp2Connections;
/// <summary>Object used to synchronize access to state in the pool.</summary>
private object SyncObj
{
get
{
Debug.Assert(!Monitor.IsEntered(_availableHttp11Connections));
return _availableHttp11Connections;
}
}
private bool HasSyncObjLock => Monitor.IsEntered(_availableHttp11Connections);
// Overview of connection management (mostly HTTP version independent):
//
// Each version of HTTP (1.1, 2, 3) has its own connection pool, and each of these work in a similar manner,
// allowing for differences between the versions (most notably, HTTP/1.1 is not multiplexed.)
//
// When a request is submitted for a particular version (e.g. HTTP/1.1), we first look in the pool for available connections.
// An "available" connection is one that is (hopefully) usable for a new request.
// For HTTP/1.1, this is just an idle connection.
// For HTTP2/3, this is a connection that (hopefully) has available streams to use for new requests.
// If we find an available connection, we will attempt to validate it and then use it.
// We check the lifetime of the connection and discard it if the lifetime is exceeded.
// We check that the connection has not shut down; if so we discard it.
// For HTTP2/3, we reserve a stream on the connection. If this fails, we cannot use the connection right now.
// If validation fails, we will attempt to find a different available connection.
//
// Once we have found a usable connection, we use it to process the request.
// For HTTP/1.1, a connection can handle only a single request at a time, thus it is immediately removed from the list of available connections.
// For HTTP2/3, a connection is only removed from the available list when it has no more available streams.
// In either case, the connection still counts against the total associated connection count for the pool.
//
// If we cannot find a usable available connection, then the request is added the to the request queue for the appropriate version.
//
// Whenever a request is queued, or an existing connection shuts down, we will check to see if we should inject a new connection.
// Injection policy depends on both user settings and some simple heuristics.
// See comments on the relevant routines for details on connection injection policy.
//
// When a new connection is successfully created, or an existing unavailable connection becomes available again,
// we will attempt to use this connection to handle any queued requests (subject to lifetime restrictions on existing connections).
// This may result in the connection becoming unavailable again, because it cannot handle any more requests at the moment.
// If not, we will return the connection to the pool as an available connection for use by new requests.
//
// When a connection shuts down, either gracefully (e.g. GOAWAY) or abortively (e.g. IOException),
// we will remove it from the list of available connections, if it is present there.
// If not, then it must be unavailable at the moment; we will detect this and ensure it is not added back to the available pool.
[DoesNotReturn]
private static void ThrowGetVersionException(HttpRequestMessage request, int desiredVersion)
{
Debug.Assert(desiredVersion == 2 || desiredVersion == 3);
throw new HttpRequestException(SR.Format(SR.net_http_requested_version_cannot_establish, request.Version, request.VersionPolicy, desiredVersion));
}
private bool CheckExpirationOnGet(HttpConnectionBase connection)
{
TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime;
if (pooledConnectionLifetime != Timeout.InfiniteTimeSpan)
{
return connection.GetLifetimeTicks(Environment.TickCount64) > pooledConnectionLifetime.TotalMilliseconds;
}
return false;
}
private static Exception CreateConnectTimeoutException(OperationCanceledException oce)
{
// The pattern for request timeouts (on HttpClient) is to throw an OCE with an inner exception of TimeoutException.
// Do the same for ConnectTimeout-based timeouts.
TimeoutException te = new TimeoutException(SR.net_http_connect_timedout, oce.InnerException);
Exception newException = CancellationHelper.CreateOperationCanceledException(te, oce.CancellationToken);
ExceptionDispatchInfo.SetCurrentStackTrace(newException);
return newException;
}
private async Task AddHttp11ConnectionAsync(HttpRequestMessage request)
{
if (NetEventSource.Log.IsEnabled()) Trace("Creating new HTTP/1.1 connection for pool.");
HttpConnection connection;
using (CancellationTokenSource cts = GetConnectTimeoutCancellationTokenSource())
{
try
{
connection = await CreateHttp11ConnectionAsync(request, true, cts.Token).ConfigureAwait(false);
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cts.Token)
{
HandleHttp11ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
HandleHttp11ConnectionFailure(request, e);
return;
}
}
// Add the established connection to the pool.
ReturnHttp11Connection(connection, isNewConnection: true);
}
private void CheckForHttp11ConnectionInjection()
{
Debug.Assert(HasSyncObjLock);
if (!_http11RequestQueue.TryPeekRequest(out HttpRequestMessage? request))
{
return;
}
// Determine if we can and should add a new connection to the pool.
if (_availableHttp11Connections.Count == 0 && // No available connections
_http11RequestQueue.Count > _pendingHttp11ConnectionCount && // More requests queued than pending connections
_associatedHttp11ConnectionCount < _maxHttp11Connections) // Under the connection limit
{
_associatedHttp11ConnectionCount++;
_pendingHttp11ConnectionCount++;
Task.Run(() => AddHttp11ConnectionAsync(request));
}
}
private async ValueTask<HttpConnection> GetHttp11ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
// Look for a usable idle connection.
TaskCompletionSourceWithCancellation<HttpConnection> waiter;
while (true)
{
HttpConnection? connection = null;
lock (SyncObj)
{
_usedSinceLastCleanup = true;
int availableConnectionCount = _availableHttp11Connections.Count;
if (availableConnectionCount > 0)
{
// We have a connection that we can attempt to use.
// Validate it below outside the lock, to avoid doing expensive operations while holding the lock.
connection = _availableHttp11Connections[availableConnectionCount - 1];
_availableHttp11Connections.RemoveAt(availableConnectionCount - 1);
}
else
{
// No available connections. Add to the request queue.
waiter = _http11RequestQueue.EnqueueRequest(request);
CheckForHttp11ConnectionInjection();
// Break out of the loop and continue processing below.
break;
}
}
if (CheckExpirationOnGet(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found expired HTTP/1.1 connection in pool.");
connection.Dispose();
continue;
}
if (!connection.PrepareForReuse(async))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found invalid HTTP/1.1 connection in pool.");
connection.Dispose();
continue;
}
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found usable HTTP/1.1 connection in pool.");
return connection;
}
// There were no available idle connections. This request has been added to the request queue.
if (NetEventSource.Log.IsEnabled()) Trace($"No available HTTP/1.1 connections; request queued.");
ValueStopwatch stopwatch = ValueStopwatch.StartNew();
try
{
return await waiter.WaitWithCancellationAsync(async, cancellationToken).ConfigureAwait(false);
}
finally
{
if (HttpTelemetry.Log.IsEnabled())
{
HttpTelemetry.Log.Http11RequestLeftQueue(stopwatch.GetElapsedTime().TotalMilliseconds);
}
}
}
private async Task HandleHttp11Downgrade(HttpRequestMessage request, Socket? socket, Stream stream, TransportContext? transportContext, CancellationToken cancellationToken)
{
if (NetEventSource.Log.IsEnabled()) Trace("Server does not support HTTP2; disabling HTTP2 use and proceeding with HTTP/1.1 connection");
bool canUse = true;
TaskCompletionSourceWithCancellation<Http2Connection?>? waiter = null;
lock (SyncObj)
{
Debug.Assert(_pendingHttp2Connection);
Debug.Assert(_associatedHttp2ConnectionCount > 0);
// Server does not support HTTP2. Disable further HTTP2 attempts.
_http2Enabled = false;
_associatedHttp2ConnectionCount--;
_pendingHttp2Connection = false;
if (_associatedHttp11ConnectionCount < _maxHttp11Connections)
{
_associatedHttp11ConnectionCount++;
_pendingHttp11ConnectionCount++;
}
else
{
// We are already at the limit for HTTP/1.1 connections, so do not proceed with this connection.
canUse = false;
}
_http2RequestQueue.TryDequeueWaiter(out waiter);
}
// Signal to any queued HTTP2 requests that they must downgrade.
while (waiter is not null)
{
if (NetEventSource.Log.IsEnabled()) Trace("Downgrading queued HTTP2 request to HTTP/1.1");
// We don't care if this fails; that means the request was previously canceled.
bool success = waiter.TrySetResult(null);
Debug.Assert(success || waiter.Task.IsCanceled);
lock (SyncObj)
{
_http2RequestQueue.TryDequeueWaiter(out waiter);
}
}
if (!canUse)
{
if (NetEventSource.Log.IsEnabled()) Trace("Discarding downgraded HTTP/1.1 connection because HTTP/1.1 connection limit is exceeded");
stream.Dispose();
}
HttpConnection http11Connection;
try
{
// Note, the same CancellationToken from the original HTTP2 connection establishment still applies here.
http11Connection = await ConstructHttp11ConnectionAsync(true, socket, stream, transportContext, request, cancellationToken).ConfigureAwait(false);
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cancellationToken)
{
HandleHttp11ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
HandleHttp11ConnectionFailure(request, e);
return;
}
ReturnHttp11Connection(http11Connection, isNewConnection: true);
}
private async Task AddHttp2ConnectionAsync(HttpRequestMessage request)
{
if (NetEventSource.Log.IsEnabled()) Trace("Creating new HTTP/2 connection for pool.");
Http2Connection connection;
using (CancellationTokenSource cts = GetConnectTimeoutCancellationTokenSource())
{
try
{
(Socket? socket, Stream stream, TransportContext? transportContext) = await ConnectAsync(request, true, cts.Token).ConfigureAwait(false);
if (IsSecure)
{
SslStream sslStream = (SslStream)stream;
if (sslStream.NegotiatedApplicationProtocol == SslApplicationProtocol.Http2)
{
// The server accepted our request for HTTP2.
if (sslStream.SslProtocol < SslProtocols.Tls12)
{
stream.Dispose();
throw new HttpRequestException(SR.Format(SR.net_ssl_http2_requires_tls12, sslStream.SslProtocol));
}
connection = await ConstructHttp2ConnectionAsync(stream, request, cts.Token).ConfigureAwait(false);
}
else
{
// We established an SSL connection, but the server denied our request for HTTP2.
await HandleHttp11Downgrade(request, socket, stream, transportContext, cts.Token).ConfigureAwait(false);
return;
}
}
else
{
connection = await ConstructHttp2ConnectionAsync(stream, request, cts.Token).ConfigureAwait(false);
}
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cts.Token)
{
HandleHttp2ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
HandleHttp2ConnectionFailure(request, e);
return;
}
}
// Register for shutdown notification.
// Do this before we return the connection to the pool, because that may result in it being disposed.
ValueTask shutdownTask = connection.WaitForShutdownAsync();
// Add the new connection to the pool.
ReturnHttp2Connection(connection, request, isNewConnection: true);
// Wait for connection shutdown.
await shutdownTask.ConfigureAwait(false);
InvalidateHttp2Connection(connection);
}
private void CheckForHttp2ConnectionInjection()
{
Debug.Assert(HasSyncObjLock);
if (!_http2RequestQueue.TryPeekRequest(out HttpRequestMessage? request))
{
return;
}
// Determine if we can and should add a new connection to the pool.
if ((_availableHttp2Connections?.Count ?? 0) == 0 && // No available connections
!_pendingHttp2Connection && // Only allow one pending HTTP2 connection at a time
(_associatedHttp2ConnectionCount == 0 || EnableMultipleHttp2Connections)) // We allow multiple connections, or don't have a connection currently
{
_associatedHttp2ConnectionCount++;
_pendingHttp2Connection = true;
Task.Run(() => AddHttp2ConnectionAsync(request));
}
}
private async ValueTask<Http2Connection?> GetHttp2ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
Debug.Assert(_kind == HttpConnectionKind.Https || _kind == HttpConnectionKind.SslProxyTunnel || _kind == HttpConnectionKind.Http || _kind == HttpConnectionKind.SocksTunnel || _kind == HttpConnectionKind.SslSocksTunnel);
// Look for a usable connection.
TaskCompletionSourceWithCancellation<Http2Connection?> waiter;
while (true)
{
Http2Connection connection;
lock (SyncObj)
{
_usedSinceLastCleanup = true;
if (!_http2Enabled)
{
return null;
}
int availableConnectionCount = _availableHttp2Connections?.Count ?? 0;
if (availableConnectionCount > 0)
{
// We have a connection that we can attempt to use.
// Validate it below outside the lock, to avoid doing expensive operations while holding the lock.
connection = _availableHttp2Connections![availableConnectionCount - 1];
}
else
{
// No available connections. Add to the request queue.
waiter = _http2RequestQueue.EnqueueRequest(request);
CheckForHttp2ConnectionInjection();
// Break out of the loop and continue processing below.
break;
}
}
if (CheckExpirationOnGet(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found expired HTTP/2 connection in pool.");
InvalidateHttp2Connection(connection);
continue;
}
if (!connection.TryReserveStream())
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found HTTP/2 connection in pool without available streams.");
bool found = false;
lock (SyncObj)
{
int index = _availableHttp2Connections.IndexOf(connection);
if (index != -1)
{
found = true;
_availableHttp2Connections.RemoveAt(index);
}
}
// If we didn't find the connection, then someone beat us to removing it (or it shut down)
if (found)
{
DisableHttp2Connection(connection);
}
continue;
}
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found usable HTTP/2 connection in pool.");
return connection;
}
// There were no available connections. This request has been added to the request queue.
if (NetEventSource.Log.IsEnabled()) Trace($"No available HTTP/2 connections; request queued.");
ValueStopwatch stopwatch = ValueStopwatch.StartNew();
try
{
return await waiter.WaitWithCancellationAsync(async, cancellationToken).ConfigureAwait(false);
}
finally
{
if (HttpTelemetry.Log.IsEnabled())
{
HttpTelemetry.Log.Http20RequestLeftQueue(stopwatch.GetElapsedTime().TotalMilliseconds);
}
}
}
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
private async ValueTask<Http3Connection> GetHttp3ConnectionAsync(HttpRequestMessage request, HttpAuthority authority, CancellationToken cancellationToken)
{
Debug.Assert(_kind == HttpConnectionKind.Https);
Debug.Assert(_http3Enabled == true);
Http3Connection? http3Connection = Volatile.Read(ref _http3Connection);
if (http3Connection != null)
{
if (CheckExpirationOnGet(http3Connection) || http3Connection.Authority != authority)
{
// Connection expired.
if (NetEventSource.Log.IsEnabled()) http3Connection.Trace("Found expired HTTP3 connection.");
http3Connection.Dispose();
InvalidateHttp3Connection(http3Connection);
}
else
{
// Connection exists and it is still good to use.
if (NetEventSource.Log.IsEnabled()) Trace("Using existing HTTP3 connection.");
_usedSinceLastCleanup = true;
return http3Connection;
}
}
// Ensure that the connection creation semaphore is created
if (_http3ConnectionCreateLock == null)
{
lock (SyncObj)
{
if (_http3ConnectionCreateLock == null)
{
_http3ConnectionCreateLock = new SemaphoreSlim(1);
}
}
}
await _http3ConnectionCreateLock.WaitAsync(cancellationToken).ConfigureAwait(false);
try
{
if (_http3Connection != null)
{
// Someone beat us to creating the connection.
if (NetEventSource.Log.IsEnabled())
{
Trace("Using existing HTTP3 connection.");
}
return _http3Connection;
}
if (NetEventSource.Log.IsEnabled())
{
Trace("Attempting new HTTP3 connection.");
}
QuicConnection quicConnection;
try
{
quicConnection = await ConnectHelper.ConnectQuicAsync(request, Settings._quicImplementationProvider ?? QuicImplementationProviders.Default, new DnsEndPoint(authority.IdnHost, authority.Port), _sslOptionsHttp3!, cancellationToken).ConfigureAwait(false);
}
catch
{
// Disables HTTP/3 until server announces it can handle it via Alt-Svc.
BlocklistAuthority(authority);
throw;
}
//TODO: NegotiatedApplicationProtocol not yet implemented.
#if false
if (quicConnection.NegotiatedApplicationProtocol != SslApplicationProtocol.Http3)
{
BlocklistAuthority(authority);
throw new HttpRequestException("QUIC connected but no HTTP/3 indicated via ALPN.", null, RequestRetryType.RetryOnSameOrNextProxy);
}
#endif
http3Connection = new Http3Connection(this, _originAuthority, authority, quicConnection);
_http3Connection = http3Connection;
if (NetEventSource.Log.IsEnabled())
{
Trace("New HTTP3 connection established.");
}
return http3Connection;
}
finally
{
_http3ConnectionCreateLock.Release();
}
}
// Returns null if HTTP3 cannot be used.
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
private async ValueTask<HttpResponseMessage?> TrySendUsingHttp3Async(HttpRequestMessage request, CancellationToken cancellationToken)
{
// Loop in case we get a 421 and need to send the request to a different authority.
while (true)
{
HttpAuthority? authority = _http3Authority;
// If H3 is explicitly requested, assume prenegotiated H3.
if (request.Version.Major >= 3 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
authority ??= _originAuthority;
}
if (authority == null)
{
return null;
}
if (IsAltSvcBlocked(authority))
{
ThrowGetVersionException(request, 3);
}
ValueStopwatch queueDuration = HttpTelemetry.Log.IsEnabled() ? ValueStopwatch.StartNew() : default;
ValueTask<Http3Connection> connectionTask = GetHttp3ConnectionAsync(request, authority, cancellationToken);
if (HttpTelemetry.Log.IsEnabled() && connectionTask.IsCompleted)
{
// We avoid logging RequestLeftQueue if a stream was available immediately (synchronously)
queueDuration = default;
}
Http3Connection connection = await connectionTask.ConfigureAwait(false);
HttpResponseMessage response = await connection.SendAsync(request, queueDuration, cancellationToken).ConfigureAwait(false);
// If an Alt-Svc authority returns 421, it means it can't actually handle the request.
// An authority is supposed to be able to handle ALL requests to the origin, so this is a server bug.
// In this case, we blocklist the authority and retry the request at the origin.
if (response.StatusCode == HttpStatusCode.MisdirectedRequest && connection.Authority != _originAuthority)
{
response.Dispose();
BlocklistAuthority(connection.Authority);
continue;
}
return response;
}
}
/// <summary>Check for the Alt-Svc header, to upgrade to HTTP/3.</summary>
private void ProcessAltSvc(HttpResponseMessage response)
{
if (_altSvcEnabled && response.Headers.TryGetValues(KnownHeaders.AltSvc.Descriptor, out IEnumerable<string>? altSvcHeaderValues))
{
HandleAltSvc(altSvcHeaderValues, response.Headers.Age);
}
}
public async ValueTask<HttpResponseMessage> SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
{
// Loop on connection failures (or other problems like version downgrade) and retry if possible.
int retryCount = 0;
while (true)
{
try
{
HttpResponseMessage? response = null;
// Use HTTP/3 if possible.
if (IsHttp3Supported() && // guard to enable trimming HTTP/3 support
_http3Enabled &&
(request.Version.Major >= 3 || (request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher && IsSecure)))
{
Debug.Assert(async);
response = await TrySendUsingHttp3Async(request, cancellationToken).ConfigureAwait(false);
}
if (response is null)
{
// We could not use HTTP/3. Do not continue if downgrade is not allowed.
if (request.Version.Major >= 3 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
ThrowGetVersionException(request, 3);
}
// Use HTTP/2 if possible.
if (_http2Enabled &&
(request.Version.Major >= 2 || (request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher && IsSecure)) &&
(request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower || IsSecure)) // prefer HTTP/1.1 if connection is not secured and downgrade is possible
{
Http2Connection? connection = await GetHttp2ConnectionAsync(request, async, cancellationToken).ConfigureAwait(false);
Debug.Assert(connection is not null || !_http2Enabled);
if (connection is not null)
{
response = await connection.SendAsync(request, async, cancellationToken).ConfigureAwait(false);
}
}
if (response is null)
{
// We could not use HTTP/2. Do not continue if downgrade is not allowed.
if (request.Version.Major >= 2 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
ThrowGetVersionException(request, 2);
}
// Use HTTP/1.x.
HttpConnection connection = await GetHttp11ConnectionAsync(request, async, cancellationToken).ConfigureAwait(false);
connection.Acquire(); // In case we are doing Windows (i.e. connection-based) auth, we need to ensure that we hold on to this specific connection while auth is underway.
try
{
response = await SendWithNtConnectionAuthAsync(connection, request, async, doRequestAuth, cancellationToken).ConfigureAwait(false);
}
finally
{
connection.Release();
}
}
}
ProcessAltSvc(response);
return response;
}
catch (HttpRequestException e) when (e.AllowRetry == RequestRetryType.RetryOnConnectionFailure)
{
Debug.Assert(retryCount >= 0 && retryCount <= MaxConnectionFailureRetries);
if (retryCount == MaxConnectionFailureRetries)
{
if (NetEventSource.Log.IsEnabled())
{
Trace($"MaxConnectionFailureRetries limit of {MaxConnectionFailureRetries} hit. Retryable request will not be retried. Exception: {e}");
}
throw;
}
retryCount++;
if (NetEventSource.Log.IsEnabled())
{
Trace($"Retry attempt {retryCount} after connection failure. Connection exception: {e}");
}
// Eat exception and try again.
}
catch (HttpRequestException e) when (e.AllowRetry == RequestRetryType.RetryOnLowerHttpVersion)
{
// Throw if fallback is not allowed by the version policy.
if (request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
throw new HttpRequestException(SR.Format(SR.net_http_requested_version_server_refused, request.Version, request.VersionPolicy), e);
}
if (NetEventSource.Log.IsEnabled())
{
Trace($"Retrying request because server requested version fallback: {e}");
}
// Eat exception and try again on a lower protocol version.
request.Version = HttpVersion.Version11;
}
catch (HttpRequestException e) when (e.AllowRetry == RequestRetryType.RetryOnStreamLimitReached)
{
if (NetEventSource.Log.IsEnabled())
{
Trace($"Retrying request on another HTTP/2 connection after active streams limit is reached on existing one: {e}");
}
// Eat exception and try again.
}
}
}
/// <summary>
/// Inspects a collection of Alt-Svc headers to find the first eligible upgrade path.
/// </summary>
/// <remarks>TODO: common case will likely be a single value. Optimize for that.</remarks>
internal void HandleAltSvc(IEnumerable<string> altSvcHeaderValues, TimeSpan? responseAge)
{
HttpAuthority? nextAuthority = null;
TimeSpan nextAuthorityMaxAge = default;
bool nextAuthorityPersist = false;
foreach (string altSvcHeaderValue in altSvcHeaderValues)
{
int parseIdx = 0;
if (AltSvcHeaderParser.Parser.TryParseValue(altSvcHeaderValue, null, ref parseIdx, out object? parsedValue))
{
var value = (AltSvcHeaderValue?)parsedValue;
// 'clear' should be the only value present.
if (value == AltSvcHeaderValue.Clear)
{
ExpireAltSvcAuthority();
Debug.Assert(_authorityExpireTimer != null);
_authorityExpireTimer.Change(Timeout.Infinite, Timeout.Infinite);
break;
}
if (nextAuthority == null && value != null && value.AlpnProtocolName == "h3")
{
var authority = new HttpAuthority(value.Host ?? _originAuthority!.IdnHost, value.Port);
if (IsAltSvcBlocked(authority))
{
// Skip authorities in our blocklist.
continue;
}
TimeSpan authorityMaxAge = value.MaxAge;
if (responseAge != null)
{
authorityMaxAge -= responseAge.GetValueOrDefault();
}
if (authorityMaxAge > TimeSpan.Zero)
{
nextAuthority = authority;
nextAuthorityMaxAge = authorityMaxAge;
nextAuthorityPersist = value.Persist;
}
}
}
}
// There's a race here in checking _http3Authority outside of the lock,
// but there's really no bad behavior if _http3Authority changes in the mean time.
if (nextAuthority != null && !nextAuthority.Equals(_http3Authority))
{
// Clamp the max age to 30 days... this is arbitrary but prevents passing a too-large TimeSpan to the Timer.
if (nextAuthorityMaxAge.Ticks > (30 * TimeSpan.TicksPerDay))
{
nextAuthorityMaxAge = TimeSpan.FromTicks(30 * TimeSpan.TicksPerDay);
}
lock (SyncObj)
{
if (_authorityExpireTimer == null)
{
var thisRef = new WeakReference<HttpConnectionPool>(this);
bool restoreFlow = false;
try
{
if (!ExecutionContext.IsFlowSuppressed())
{
ExecutionContext.SuppressFlow();
restoreFlow = true;
}
_authorityExpireTimer = new Timer(static o =>
{
var wr = (WeakReference<HttpConnectionPool>)o!;
if (wr.TryGetTarget(out HttpConnectionPool? @this))
{
@this.ExpireAltSvcAuthority();
}
}, thisRef, nextAuthorityMaxAge, Timeout.InfiniteTimeSpan);
}
finally
{
if (restoreFlow) ExecutionContext.RestoreFlow();
}
}
else
{
_authorityExpireTimer.Change(nextAuthorityMaxAge, Timeout.InfiniteTimeSpan);
}
_http3Authority = nextAuthority;
_persistAuthority = nextAuthorityPersist;
}
if (!nextAuthorityPersist)
{
_poolManager.StartMonitoringNetworkChanges();
}
}
}
/// <summary>
/// Expires the current Alt-Svc authority, resetting the connection back to origin.
/// </summary>
private void ExpireAltSvcAuthority()
{
// If we ever support prenegotiated HTTP/3, this should be set to origin, not nulled out.
_http3Authority = null;
}
/// <summary>
/// Checks whether the given <paramref name="authority"/> is on the currext Alt-Svc blocklist.
/// </summary>
/// <seealso cref="BlocklistAuthority" />
private bool IsAltSvcBlocked(HttpAuthority authority)
{
if (_altSvcBlocklist != null)
{
lock (_altSvcBlocklist)
{
return _altSvcBlocklist.Contains(authority);
}
}
return false;
}
/// <summary>
/// Blocklists an authority and resets the current authority back to origin.
/// If the number of blocklisted authorities exceeds <see cref="MaxAltSvcIgnoreListSize"/>,
/// Alt-Svc will be disabled entirely for a period of time.
/// </summary>
/// <remarks>
/// This is called when we get a "421 Misdirected Request" from an alternate authority.
/// A future strategy would be to retry the individual request on an older protocol, we'd want to have
/// some logic to blocklist after some number of failures to avoid doubling our request latency.
///
/// For now, the spec states alternate authorities should be able to handle ALL requests, so this
/// is treated as an exceptional error by immediately blocklisting the authority.
/// </remarks>
internal void BlocklistAuthority(HttpAuthority badAuthority)
{
Debug.Assert(badAuthority != null);
HashSet<HttpAuthority>? altSvcBlocklist = _altSvcBlocklist;
if (altSvcBlocklist == null)
{
lock (SyncObj)
{
altSvcBlocklist = _altSvcBlocklist;
if (altSvcBlocklist == null)
{
altSvcBlocklist = new HashSet<HttpAuthority>();
_altSvcBlocklistTimerCancellation = new CancellationTokenSource();
_altSvcBlocklist = altSvcBlocklist;
}
}
}
bool added, disabled = false;
lock (altSvcBlocklist)
{
added = altSvcBlocklist.Add(badAuthority);
if (added && altSvcBlocklist.Count >= MaxAltSvcIgnoreListSize && _altSvcEnabled)
{
_altSvcEnabled = false;
disabled = true;
}
}
lock (SyncObj)
{
if (_http3Authority == badAuthority)
{
ExpireAltSvcAuthority();
Debug.Assert(_authorityExpireTimer != null);
_authorityExpireTimer.Change(Timeout.Infinite, Timeout.Infinite);
}
}
Debug.Assert(_altSvcBlocklistTimerCancellation != null);
if (added)
{
_ = Task.Delay(AltSvcBlocklistTimeoutInMilliseconds)
.ContinueWith(t =>
{
lock (altSvcBlocklist)
{
altSvcBlocklist.Remove(badAuthority);
}
}, _altSvcBlocklistTimerCancellation.Token, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}
if (disabled)
{
_ = Task.Delay(AltSvcBlocklistTimeoutInMilliseconds)
.ContinueWith(t =>
{
_altSvcEnabled = true;
}, _altSvcBlocklistTimerCancellation.Token, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}
}
public void OnNetworkChanged()
{
lock (SyncObj)
{
if (_http3Authority != null && _persistAuthority == false)
{
ExpireAltSvcAuthority();
Debug.Assert(_authorityExpireTimer != null);
_authorityExpireTimer.Change(Timeout.Infinite, Timeout.Infinite);
}
}
}
public Task<HttpResponseMessage> SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
{
if (doRequestAuth && Settings._credentials != null)
{
return AuthenticationHelper.SendWithNtConnectionAuthAsync(request, async, Settings._credentials, connection, this, cancellationToken);
}
return SendWithNtProxyAuthAsync(connection, request, async, cancellationToken);
}
private bool DoProxyAuth => (_kind == HttpConnectionKind.Proxy || _kind == HttpConnectionKind.ProxyConnect);
public Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpConnection connection, HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
if (DoProxyAuth && ProxyCredentials is not null)
{
return AuthenticationHelper.SendWithNtProxyAuthAsync(request, ProxyUri!, async, ProxyCredentials, connection, this, cancellationToken);
}
return connection.SendAsync(request, async, cancellationToken);
}
public ValueTask<HttpResponseMessage> SendWithProxyAuthAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
{
if (DoProxyAuth && ProxyCredentials is not null)
{
return AuthenticationHelper.SendWithProxyAuthAsync(request, _proxyUri!, async, ProxyCredentials, doRequestAuth, this, cancellationToken);
}
return SendWithVersionDetectionAndRetryAsync(request, async, doRequestAuth, cancellationToken);
}
public ValueTask<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
{
if (doRequestAuth && Settings._credentials != null)
{
return AuthenticationHelper.SendWithRequestAuthAsync(request, async, Settings._credentials, Settings._preAuthenticate, this, cancellationToken);
}
return SendWithProxyAuthAsync(request, async, doRequestAuth, cancellationToken);
}
private CancellationTokenSource GetConnectTimeoutCancellationTokenSource() => new CancellationTokenSource(Settings._connectTimeout);
private async ValueTask<(Socket?, Stream, TransportContext?)> ConnectAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
Stream? stream = null;
Socket? socket = null;
switch (_kind)
{
case HttpConnectionKind.Http:
case HttpConnectionKind.Https:
case HttpConnectionKind.ProxyConnect:
Debug.Assert(_originAuthority != null);
(socket, stream) = await ConnectToTcpHostAsync(_originAuthority.IdnHost, _originAuthority.Port, request, async, cancellationToken).ConfigureAwait(false);
break;
case HttpConnectionKind.Proxy:
(socket, stream) = await ConnectToTcpHostAsync(_proxyUri!.IdnHost, _proxyUri.Port, request, async, cancellationToken).ConfigureAwait(false);
break;
case HttpConnectionKind.ProxyTunnel:
case HttpConnectionKind.SslProxyTunnel:
stream = await EstablishProxyTunnelAsync(async, request.HasHeaders ? request.Headers : null, cancellationToken).ConfigureAwait(false);
break;
case HttpConnectionKind.SocksTunnel:
case HttpConnectionKind.SslSocksTunnel:
(socket, stream) = await EstablishSocksTunnel(request, async, cancellationToken).ConfigureAwait(false);
break;
}
Debug.Assert(stream != null);
if (socket is null && stream is NetworkStream ns)
{
// We weren't handed a socket directly. But if we're able to extract one, do so.
// Most likely case here is a ConnectCallback was used and returned a NetworkStream.
socket = ns.Socket;
}
TransportContext? transportContext = null;
if (IsSecure)
{
SslStream? sslStream = stream as SslStream;
if (sslStream == null)
{
sslStream = await ConnectHelper.EstablishSslConnectionAsync(GetSslOptionsForRequest(request), request, async, stream, cancellationToken).ConfigureAwait(false);
}
else
{
if (NetEventSource.Log.IsEnabled())
{
Trace($"Connected with custom SslStream: alpn='${sslStream.NegotiatedApplicationProtocol.ToString()}'");
}
}
transportContext = sslStream.TransportContext;
stream = sslStream;
}
return (socket, stream, transportContext);
}
private async ValueTask<(Socket?, Stream)> ConnectToTcpHostAsync(string host, int port, HttpRequestMessage initialRequest, bool async, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var endPoint = new DnsEndPoint(host, port);
Socket? socket = null;
Stream? stream = null;
try
{
// If a ConnectCallback was supplied, use that to establish the connection.
if (Settings._connectCallback != null)
{
ValueTask<Stream> streamTask = Settings._connectCallback(new SocketsHttpConnectionContext(endPoint, initialRequest), cancellationToken);
if (!async && !streamTask.IsCompleted)
{
// User-provided ConnectCallback is completing asynchronously but the user is making a synchronous request; if the user cares, they should
// set it up so that synchronous requests are made on a handler with a synchronously-completing ConnectCallback supplied. If in the future,
// we could add a Boolean to SocketsHttpConnectionContext (https://github.com/dotnet/runtime/issues/44876) to let the callback know whether
// this request is sync or async.
Trace($"{nameof(SocketsHttpHandler.ConnectCallback)} completing asynchronously for a synchronous request.");
}
stream = await streamTask.ConfigureAwait(false) ?? throw new HttpRequestException(SR.net_http_null_from_connect_callback);
}
else
{
// Otherwise, create and connect a socket using default settings.
socket = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true };
if (async)
{
await socket.ConnectAsync(endPoint, cancellationToken).ConfigureAwait(false);
}
else
{
using (cancellationToken.UnsafeRegister(static s => ((Socket)s!).Dispose(), socket))
{
socket.Connect(endPoint);
}
}
stream = new NetworkStream(socket, ownsSocket: true);
}
return (socket, stream);
}
catch (Exception ex)
{
socket?.Dispose();
throw ex is OperationCanceledException oce && oce.CancellationToken == cancellationToken ?
CancellationHelper.CreateOperationCanceledException(innerException: null, cancellationToken) :
ConnectHelper.CreateWrappedException(ex, endPoint.Host, endPoint.Port, cancellationToken);
}
}
internal async ValueTask<HttpConnection> CreateHttp11ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
(Socket? socket, Stream stream, TransportContext? transportContext) = await ConnectAsync(request, async, cancellationToken).ConfigureAwait(false);
return await ConstructHttp11ConnectionAsync(async, socket, stream!, transportContext, request, cancellationToken).ConfigureAwait(false);
}
private SslClientAuthenticationOptions GetSslOptionsForRequest(HttpRequestMessage request)
{
if (_http2Enabled)
{
if (request.Version.Major >= 2 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
return _sslOptionsHttp2Only!;
}
if (request.Version.Major >= 2 || request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher)
{
return _sslOptionsHttp2!;
}
}
return _sslOptionsHttp11!;
}
private async ValueTask<Stream> ApplyPlaintextFilterAsync(bool async, Stream stream, Version httpVersion, HttpRequestMessage request, CancellationToken cancellationToken)
{
if (Settings._plaintextStreamFilter is null)
{
return stream;
}
Stream newStream;
try
{
ValueTask<Stream> streamTask = Settings._plaintextStreamFilter(new SocketsHttpPlaintextStreamFilterContext(stream, httpVersion, request), cancellationToken);
if (!async && !streamTask.IsCompleted)
{
// User-provided PlaintextStreamFilter is completing asynchronously but the user is making a synchronous request; if the user cares, they should
// set it up so that synchronous requests are made on a handler with a synchronously-completing PlaintextStreamFilter supplied. If in the future,
// we could add a Boolean to SocketsHttpPlaintextStreamFilterContext (https://github.com/dotnet/runtime/issues/44876) to let the callback know whether
// this request is sync or async.
Trace($"{nameof(SocketsHttpHandler.PlaintextStreamFilter)} completing asynchronously for a synchronous request.");
}
newStream = await streamTask.ConfigureAwait(false);
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cancellationToken)
{
stream.Dispose();
throw;
}
catch (Exception e)
{
stream.Dispose();
throw new HttpRequestException(SR.net_http_exception_during_plaintext_filter, e);
}
if (newStream == null)
{
stream.Dispose();
throw new HttpRequestException(SR.net_http_null_from_plaintext_filter);
}
return newStream;
}
private async ValueTask<HttpConnection> ConstructHttp11ConnectionAsync(bool async, Socket? socket, Stream stream, TransportContext? transportContext, HttpRequestMessage request, CancellationToken cancellationToken)
{
Stream newStream = await ApplyPlaintextFilterAsync(async, stream, HttpVersion.Version11, request, cancellationToken).ConfigureAwait(false);
if (newStream != stream)
{
// If a plaintext filter created a new stream, we can't trust that the socket is still applicable.
socket = null;
}
return new HttpConnection(this, socket, newStream, transportContext);
}
private async ValueTask<Http2Connection> ConstructHttp2ConnectionAsync(Stream stream, HttpRequestMessage request, CancellationToken cancellationToken)
{
stream = await ApplyPlaintextFilterAsync(async: true, stream, HttpVersion.Version20, request, cancellationToken).ConfigureAwait(false);
Http2Connection http2Connection = new Http2Connection(this, stream);
try
{
await http2Connection.SetupAsync().ConfigureAwait(false);
}
catch (Exception e)
{
// Note, SetupAsync will dispose the connection if there is an exception.
throw new HttpRequestException(SR.net_http_client_execution_error, e);
}
return http2Connection;
}
private async ValueTask<Stream> EstablishProxyTunnelAsync(bool async, HttpRequestHeaders? headers, CancellationToken cancellationToken)
{
Debug.Assert(_originAuthority != null);
// Send a CONNECT request to the proxy server to establish a tunnel.
HttpRequestMessage tunnelRequest = new HttpRequestMessage(HttpMethod.Connect, _proxyUri);
tunnelRequest.Headers.Host = $"{_originAuthority.IdnHost}:{_originAuthority.Port}"; // This specifies destination host/port to connect to
if (headers != null && headers.TryGetValues(HttpKnownHeaderNames.UserAgent, out IEnumerable<string>? values))
{
tunnelRequest.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.UserAgent, values);
}
HttpResponseMessage tunnelResponse = await _poolManager.SendProxyConnectAsync(tunnelRequest, _proxyUri!, async, cancellationToken).ConfigureAwait(false);
if (tunnelResponse.StatusCode != HttpStatusCode.OK)
{
tunnelResponse.Dispose();
throw new HttpRequestException(SR.Format(SR.net_http_proxy_tunnel_returned_failure_status_code, _proxyUri, (int)tunnelResponse.StatusCode));
}
try
{
return tunnelResponse.Content.ReadAsStream(cancellationToken);
}
catch
{
tunnelResponse.Dispose();
throw;
}
}
private async ValueTask<(Socket? socket, Stream stream)> EstablishSocksTunnel(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
Debug.Assert(_originAuthority != null);
Debug.Assert(_proxyUri != null);
(Socket? socket, Stream stream) = await ConnectToTcpHostAsync(_proxyUri.IdnHost, _proxyUri.Port, request, async, cancellationToken).ConfigureAwait(false);
try
{
await SocksHelper.EstablishSocksTunnelAsync(stream, _originAuthority.IdnHost, _originAuthority.Port, _proxyUri, ProxyCredentials, async, cancellationToken).ConfigureAwait(false);
}
catch (Exception e) when (!(e is OperationCanceledException))
{
Debug.Assert(!(e is HttpRequestException));
throw new HttpRequestException(SR.net_http_request_aborted, e);
}
return (socket, stream);
}
private void HandleHttp11ConnectionFailure(HttpRequestMessage request, Exception e)
{
if (NetEventSource.Log.IsEnabled()) Trace("HTTP/1.1 connection failed");
bool failRequest;
TaskCompletionSourceWithCancellation<HttpConnection>? waiter;
lock (SyncObj)
{
Debug.Assert(_associatedHttp11ConnectionCount > 0);
Debug.Assert(_pendingHttp11ConnectionCount > 0);
_associatedHttp11ConnectionCount--;
_pendingHttp11ConnectionCount--;
// If the request that caused this connection attempt is still pending, fail it.
// Otherwise, the request must have been canceled or satisfied by another connection already.
failRequest = _http11RequestQueue.TryDequeueWaiterForSpecificRequest(request, out waiter);
CheckForHttp11ConnectionInjection();
}
if (failRequest)
{
// This may fail if the request was already canceled, but we don't care.
Debug.Assert(waiter is not null);
bool succeeded = waiter.TrySetException(e);
Debug.Assert(succeeded || waiter.Task.IsCanceled);
}
}
private void HandleHttp2ConnectionFailure(HttpRequestMessage request, Exception e)
{
if (NetEventSource.Log.IsEnabled()) Trace("HTTP2 connection failed");
bool failRequest;
TaskCompletionSourceWithCancellation<Http2Connection?>? waiter;
lock (SyncObj)
{
Debug.Assert(_associatedHttp2ConnectionCount > 0);
Debug.Assert(_pendingHttp2Connection);
_associatedHttp2ConnectionCount--;
_pendingHttp2Connection = false;
// If the request that caused this connection attempt is still pending, fail it.
// Otherwise, the request must have been canceled or satisfied by another connection already.
failRequest = _http2RequestQueue.TryDequeueWaiterForSpecificRequest(request, out waiter);
CheckForHttp2ConnectionInjection();
}
if (failRequest)
{
// This may fail if the request was already canceled, but we don't care.
Debug.Assert(waiter is not null);
bool succeeded = waiter.TrySetException(e);
Debug.Assert(succeeded || waiter.Task.IsCanceled);
}
}
/// <summary>
/// Called when an HttpConnection from this pool is no longer usable.
/// Note, this is always called from HttpConnection.Dispose, which is a bit different than how HTTP2 works.
/// </summary>
public void InvalidateHttp11Connection(HttpConnection connection, bool disposing = true)
{
lock (SyncObj)
{
Debug.Assert(_associatedHttp11ConnectionCount > 0);
Debug.Assert(!disposing || !_availableHttp11Connections.Contains(connection));
_associatedHttp11ConnectionCount--;
CheckForHttp11ConnectionInjection();
}
}
/// <summary>
/// Called when an Http2Connection from this pool is no longer usable.
/// </summary>
public void InvalidateHttp2Connection(Http2Connection connection)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("");
bool found = false;
lock (SyncObj)
{
if (_availableHttp2Connections is not null)
{
Debug.Assert(_associatedHttp2ConnectionCount >= _availableHttp2Connections.Count);
int index = _availableHttp2Connections.IndexOf(connection);
if (index != -1)
{
found = true;
_availableHttp2Connections.RemoveAt(index);
_associatedHttp2ConnectionCount--;
}
}
CheckForHttp2ConnectionInjection();
}
// If we found the connection in the available list, then dispose it now.
// Otherwise, when we try to put it back in the pool, we will see it is shut down and dispose it (and adjust connection counts).
if (found)
{
connection.Dispose();
}
}
private bool CheckExpirationOnReturn(HttpConnectionBase connection)
{
TimeSpan lifetime = _poolManager.Settings._pooledConnectionLifetime;
if (lifetime != Timeout.InfiniteTimeSpan)
{
return lifetime == TimeSpan.Zero || connection.GetLifetimeTicks(Environment.TickCount64) > lifetime.TotalMilliseconds;
}
return false;
}
public void ReturnHttp11Connection(HttpConnection connection, bool isNewConnection = false)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"{nameof(isNewConnection)}={isNewConnection}");
if (!isNewConnection && CheckExpirationOnReturn(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP/1.1 connection return to pool. Connection lifetime expired.");
connection.Dispose();
return;
}
// Loop in case we get a cancelled request.
while (true)
{
TaskCompletionSourceWithCancellation<HttpConnection>? waiter = null;
bool added = false;
lock (SyncObj)
{
Debug.Assert(!_availableHttp11Connections.Contains(connection), $"Connection already in available list");
Debug.Assert(_associatedHttp11ConnectionCount > _availableHttp11Connections.Count,
$"Expected _associatedHttp11ConnectionCount={_associatedHttp11ConnectionCount} > _availableHttp11Connections.Count={_availableHttp11Connections.Count}");
Debug.Assert(_associatedHttp11ConnectionCount <= _maxHttp11Connections,
$"Expected _associatedHttp11ConnectionCount={_associatedHttp11ConnectionCount} <= _maxHttp11Connections={_maxHttp11Connections}");
if (isNewConnection)
{
Debug.Assert(_pendingHttp11ConnectionCount > 0);
_pendingHttp11ConnectionCount--;
isNewConnection = false;
}
if (_http11RequestQueue.TryDequeueWaiter(out waiter))
{
Debug.Assert(_availableHttp11Connections.Count == 0, $"With {_availableHttp11Connections.Count} available HTTP/1.1 connections, we shouldn't have a waiter.");
}
else if (!_disposed)
{
// Add connection to the pool.
added = true;
_availableHttp11Connections.Add(connection);
}
// If the pool has been disposed of, we will dispose the connection below outside the lock.
// We do this after processing the queue above so that any queued requests will be handled by existing connections if possible.
}
if (waiter is not null)
{
Debug.Assert(!added);
if (waiter.TrySetResult(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Dequeued waiting HTTP/1.1 request.");
return;
}
else
{
Debug.Assert(waiter.Task.IsCanceled);
if (NetEventSource.Log.IsEnabled()) connection.Trace("Discarding canceled HTTP/1.1 request from queue.");
// Loop and process the queue again
}
}
else if (added)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Put HTTP/1.1 connection in pool.");
return;
}
else
{
Debug.Assert(_disposed);
if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP/1.1 connection returned to pool. Pool was disposed.");
connection.Dispose();
return;
}
}
}
public void ReturnHttp2Connection(Http2Connection connection, HttpRequestMessage? request = null, bool isNewConnection = false)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"{nameof(isNewConnection)}={isNewConnection}");
Debug.Assert(isNewConnection || request is null, "Shouldn't have a request unless the connection is new");
if (!isNewConnection && CheckExpirationOnReturn(connection))
{
lock (SyncObj)
{
Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection));
Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0));
_associatedHttp2ConnectionCount--;
}
if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP2 connection return to pool. Connection lifetime expired.");
connection.Dispose();
return;
}
while (connection.TryReserveStream())
{
// Loop in case we get a cancelled request.
while (true)
{
TaskCompletionSourceWithCancellation<Http2Connection?>? waiter = null;
bool added = false;
lock (SyncObj)
{
Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection), $"HTTP2 connection already in available list");
Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0),
$"Expected _associatedHttp2ConnectionCount={_associatedHttp2ConnectionCount} > _availableHttp2Connections.Count={(_availableHttp2Connections?.Count ?? 0)}");
if (isNewConnection)
{
Debug.Assert(_pendingHttp2Connection);
_pendingHttp2Connection = false;
isNewConnection = false;
}
if (_http2RequestQueue.TryDequeueWaiter(out waiter))
{
Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"With {(_availableHttp2Connections?.Count ?? 0)} available HTTP2 connections, we shouldn't have a waiter.");
}
else if (_disposed)
{
// The pool has been disposed. We will dispose this connection below outside the lock.
// We do this check after processing the request queue so that any queued requests will be handled by existing connections if possible.
_associatedHttp2ConnectionCount--;
}
else
{
// Add connection to the pool.
added = true;
_availableHttp2Connections ??= new List<Http2Connection>();
_availableHttp2Connections.Add(connection);
}
}
if (waiter is not null)
{
Debug.Assert(!added);
if (waiter.TrySetResult(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Dequeued waiting HTTP2 request.");
break;
}
else
{
Debug.Assert(waiter.Task.IsCanceled);
if (NetEventSource.Log.IsEnabled()) connection.Trace("Discarding canceled HTTP2 request from queue.");
// Loop and process the queue again
}
}
else
{
connection.ReleaseStream();
if (added)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Put HTTP2 connection in pool.");
return;
}
else
{
Debug.Assert(_disposed);
if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP2 connection returned to pool. Pool was disposed.");
connection.Dispose();
return;
}
}
}
}
if (isNewConnection)
{
Debug.Assert(request is not null, "Expect request for a new connection");
// The new connection could not handle even one request, either because it shut down before we could use it for any requests,
// or because it immediately set the max concurrent streams limit to 0.
// We don't want to get stuck in a loop where we keep trying to create new connections for the same request.
// So, treat this as a connection failure.
if (NetEventSource.Log.IsEnabled()) connection.Trace("New HTTP2 connection is unusable due to no available streams.");
connection.Dispose();
HttpRequestException hre = new HttpRequestException(SR.net_http_http2_connection_not_established);
ExceptionDispatchInfo.SetCurrentStackTrace(hre);
HandleHttp2ConnectionFailure(request, hre);
}
else
{
// Since we only inject one connection at a time, we may want to inject another now.
lock (SyncObj)
{
CheckForHttp2ConnectionInjection();
}
// We need to wait until the connection is usable again.
DisableHttp2Connection(connection);
}
}
/// <summary>
/// Disable usage of the specified connection because it cannot handle any more streams at the moment.
/// We will register to be notified when it can handle more streams (or becomes permanently unusable).
/// </summary>
private void DisableHttp2Connection(Http2Connection connection)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("");
Task.Run(async () =>
{
bool usable = await connection.WaitForAvailableStreamsAsync().ConfigureAwait(false);
if (NetEventSource.Log.IsEnabled()) connection.Trace($"WaitForAvailableStreamsAsync completed, {nameof(usable)}={usable}");
if (usable)
{
ReturnHttp2Connection(connection, isNewConnection: false);
}
else
{
// Connection has shut down.
lock (SyncObj)
{
Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection));
Debug.Assert(_associatedHttp2ConnectionCount > 0);
_associatedHttp2ConnectionCount--;
CheckForHttp2ConnectionInjection();
}
if (NetEventSource.Log.IsEnabled()) connection.Trace("HTTP2 connection no longer usable");
connection.Dispose();
}
});
}
public void InvalidateHttp3Connection(Http3Connection connection)
{
lock (SyncObj)
{
if (_http3Connection == connection)
{
_http3Connection = null;
}
}
}
/// <summary>
/// Disposes the connection pool. This is only needed when the pool currently contains
/// or has associated connections.
/// </summary>
public void Dispose()
{
List<HttpConnectionBase>? toDispose = null;
lock (SyncObj)
{
if (!_disposed)
{
if (NetEventSource.Log.IsEnabled()) Trace("Disposing pool.");
_disposed = true;
toDispose = new List<HttpConnectionBase>(_availableHttp11Connections.Count + (_availableHttp2Connections?.Count ?? 0));
toDispose.AddRange(_availableHttp11Connections);
if (_availableHttp2Connections is not null)
{
toDispose.AddRange(_availableHttp2Connections);
}
// Note: Http11 connections will decrement the _associatedHttp11ConnectionCount when disposed.
// Http2 connections will not, hence the difference in handing _associatedHttp2ConnectionCount.
Debug.Assert(_associatedHttp11ConnectionCount >= _availableHttp11Connections.Count,
$"Expected {nameof(_associatedHttp11ConnectionCount)}={_associatedHttp11ConnectionCount} >= {nameof(_availableHttp11Connections)}.Count={_availableHttp11Connections.Count}");
_availableHttp11Connections.Clear();
Debug.Assert(_associatedHttp2ConnectionCount >= (_availableHttp2Connections?.Count ?? 0));
_associatedHttp2ConnectionCount -= (_availableHttp2Connections?.Count ?? 0);
_availableHttp2Connections?.Clear();
if (_http3Connection is not null)
{
toDispose.Add(_http3Connection);
_http3Connection = null;
}
if (_authorityExpireTimer != null)
{
_authorityExpireTimer.Dispose();
_authorityExpireTimer = null;
}
if (_altSvcBlocklistTimerCancellation != null)
{
_altSvcBlocklistTimerCancellation.Cancel();
_altSvcBlocklistTimerCancellation.Dispose();
_altSvcBlocklistTimerCancellation = null;
}
}
Debug.Assert(_availableHttp11Connections.Count == 0, $"Expected {nameof(_availableHttp11Connections)}.{nameof(_availableHttp11Connections.Count)} == 0");
Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0");
}
// Dispose outside the lock to avoid lock re-entrancy issues.
toDispose?.ForEach(c => c.Dispose());
}
/// <summary>
/// Removes any unusable connections from the pool, and if the pool
/// is then empty and stale, disposes of it.
/// </summary>
/// <returns>
/// true if the pool disposes of itself; otherwise, false.
/// </returns>
public bool CleanCacheAndDisposeIfUnused()
{
TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime;
TimeSpan pooledConnectionIdleTimeout = _poolManager.Settings._pooledConnectionIdleTimeout;
long nowTicks = Environment.TickCount64;
List<HttpConnectionBase>? toDispose = null;
lock (SyncObj)
{
// If there are now no connections associated with this pool, we can dispose of it. We
// avoid aggressively cleaning up pools that have recently been used but currently aren't;
// if a pool was used since the last time we cleaned up, give it another chance. New pools
// start out saying they've recently been used, to give them a bit of breathing room and time
// for the initial collection to be added to it.
if (!_usedSinceLastCleanup && _associatedHttp11ConnectionCount == 0 && _associatedHttp2ConnectionCount == 0)
{
_disposed = true;
return true; // Pool is disposed of. It should be removed.
}
// Reset the cleanup flag. Any pools that are empty and not used since the last cleanup
// will be purged next time around.
_usedSinceLastCleanup = false;
ScavengeConnectionList(_availableHttp11Connections, ref toDispose, nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout);
if (_availableHttp2Connections is not null)
{
int removed = ScavengeConnectionList(_availableHttp2Connections, ref toDispose, nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout);
_associatedHttp2ConnectionCount -= removed;
// Note: Http11 connections will decrement the _associatedHttp11ConnectionCount when disposed.
// Http2 connections will not, hence the difference in handing _associatedHttp2ConnectionCount.
}
}
// Dispose the stale connections outside the pool lock, to avoid holding the lock too long.
// Dispose them asynchronously to not to block the caller on closing the SslStream or NetworkStream.
if (toDispose is not null)
{
Task.Factory.StartNew(static s => ((List<HttpConnectionBase>)s!).ForEach(c => c.Dispose()), toDispose,
CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
}
// Pool is active. Should not be removed.
return false;
static int ScavengeConnectionList<T>(List<T> list, ref List<HttpConnectionBase>? toDispose, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout)
where T : HttpConnectionBase
{
int freeIndex = 0;
while (freeIndex < list.Count && IsUsableConnection(list[freeIndex], nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout))
{
freeIndex++;
}
// If freeIndex == list.Count, nothing needs to be removed.
// But if it's < list.Count, at least one connection needs to be purged.
int removed = 0;
if (freeIndex < list.Count)
{
// We know the connection at freeIndex is unusable, so dispose of it.
toDispose ??= new List<HttpConnectionBase>();
toDispose.Add(list[freeIndex]);
// Find the first item after the one to be removed that should be kept.
int current = freeIndex + 1;
while (current < list.Count)
{
// Look for the first item to be kept. Along the way, any
// that shouldn't be kept are disposed of.
while (current < list.Count && !IsUsableConnection(list[current], nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout))
{
toDispose.Add(list[current]);
current++;
}
// If we found something to keep, copy it down to the known free slot.
if (current < list.Count)
{
// copy item to the free slot
list[freeIndex++] = list[current++];
}
// Keep going until there are no more good items.
}
// At this point, good connections have been moved below freeIndex, and garbage connections have
// been added to the dispose list, so clear the end of the list past freeIndex.
removed = list.Count - freeIndex;
list.RemoveRange(freeIndex, removed);
}
return removed;
}
static bool IsUsableConnection(HttpConnectionBase connection, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout)
{
// Validate that the connection hasn't been idle in the pool for longer than is allowed.
if (pooledConnectionIdleTimeout != Timeout.InfiniteTimeSpan)
{
long idleTicks = connection.GetIdleTicks(nowTicks);
if (idleTicks > pooledConnectionIdleTimeout.TotalMilliseconds)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"Scavenging connection. Idle {TimeSpan.FromMilliseconds(idleTicks)} > {pooledConnectionIdleTimeout}.");
return false;
}
}
// Validate that the connection lifetime has not been exceeded.
if (pooledConnectionLifetime != Timeout.InfiniteTimeSpan)
{
long lifetimeTicks = connection.GetLifetimeTicks(nowTicks);
if (lifetimeTicks > pooledConnectionLifetime.TotalMilliseconds)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"Scavenging connection. Lifetime {TimeSpan.FromMilliseconds(lifetimeTicks)} > {pooledConnectionLifetime}.");
return false;
}
}
if (!connection.CheckUsabilityOnScavenge())
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"Scavenging connection. Unexpected data or EOF received.");
return false;
}
return true;
}
}
/// <summary>Gets whether we're running on Windows 7 or Windows 2008 R2.</summary>
private static bool GetIsWindows7Or2008R2()
{
OperatingSystem os = Environment.OSVersion;
if (os.Platform == PlatformID.Win32NT)
{
// Both Windows 7 and Windows 2008 R2 report version 6.1.
Version v = os.Version;
return v.Major == 6 && v.Minor == 1;
}
return false;
}
internal void HeartBeat()
{
Http2Connection[]? localHttp2Connections;
lock (SyncObj)
{
localHttp2Connections = _availableHttp2Connections?.ToArray();
}
if (localHttp2Connections is not null)
{
foreach (Http2Connection http2Connection in localHttp2Connections)
{
http2Connection.HeartBeat();
}
}
}
// For diagnostic purposes
public override string ToString() =>
$"{nameof(HttpConnectionPool)} " +
(_proxyUri == null ?
(_sslOptionsHttp11 == null ?
$"http://{_originAuthority}" :
$"https://{_originAuthority}" + (_sslOptionsHttp11.TargetHost != _originAuthority!.IdnHost ? $", SSL TargetHost={_sslOptionsHttp11.TargetHost}" : null)) :
(_sslOptionsHttp11 == null ?
$"Proxy {_proxyUri}" :
$"https://{_originAuthority}/ tunnelled via Proxy {_proxyUri}" + (_sslOptionsHttp11.TargetHost != _originAuthority!.IdnHost ? $", SSL TargetHost={_sslOptionsHttp11.TargetHost}" : null)));
private void Trace(string? message, [CallerMemberName] string? memberName = null) =>
NetEventSource.Log.HandlerMessage(
GetHashCode(), // pool ID
0, // connection ID
0, // request ID
memberName, // method name
message); // message
private struct RequestQueue<T>
{
private struct QueueItem
{
public HttpRequestMessage Request;
public TaskCompletionSourceWithCancellation<T> Waiter;
}
private Queue<QueueItem>? _queue;
public TaskCompletionSourceWithCancellation<T> EnqueueRequest(HttpRequestMessage request)
{
if (_queue is null)
{
_queue = new Queue<QueueItem>();
}
TaskCompletionSourceWithCancellation<T> waiter = new TaskCompletionSourceWithCancellation<T>();
_queue.Enqueue(new QueueItem { Request = request, Waiter = waiter });
return waiter;
}
public bool TryDequeueWaiterForSpecificRequest(HttpRequestMessage request, [MaybeNullWhen(false)] out TaskCompletionSourceWithCancellation<T> waiter)
{
if (_queue is not null && _queue.TryPeek(out QueueItem item) && item.Request == request)
{
_queue.Dequeue();
waiter = item.Waiter;
return true;
}
waiter = null;
return false;
}
public bool TryDequeueWaiter([MaybeNullWhen(false)] out TaskCompletionSourceWithCancellation<T> waiter)
{
if (_queue is not null && _queue.TryDequeue(out QueueItem item))
{
waiter = item.Waiter;
return true;
}
waiter = null;
return false;
}
public bool TryPeekRequest([MaybeNullWhen(false)] out HttpRequestMessage request)
{
if (_queue is not null && _queue.TryPeek(out QueueItem item))
{
request = item.Request;
return true;
}
request = null;
return false;
}
public int Count => (_queue?.Count ?? 0);
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Net.Http.Headers;
using System.Net.Http.HPack;
using System.Net.Http.QPack;
using System.Net.Quic;
using System.Net.Security;
using System.Net.Sockets;
using System.Runtime.CompilerServices;
using System.Runtime.ExceptionServices;
using System.Runtime.Versioning;
using System.Security.Authentication;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.Http
{
/// <summary>Provides a pool of connections to the same endpoint.</summary>
internal sealed class HttpConnectionPool : IDisposable
{
private static readonly bool s_isWindows7Or2008R2 = GetIsWindows7Or2008R2();
private readonly HttpConnectionPoolManager _poolManager;
private readonly HttpConnectionKind _kind;
private readonly Uri? _proxyUri;
/// <summary>The origin authority used to construct the <see cref="HttpConnectionPool"/>.</summary>
private readonly HttpAuthority? _originAuthority;
/// <summary>Initially set to null, this can be set to enable HTTP/3 based on Alt-Svc.</summary>
private volatile HttpAuthority? _http3Authority;
/// <summary>A timer to expire <see cref="_http3Authority"/> and return the pool to <see cref="_originAuthority"/>. Initialized on first use.</summary>
private Timer? _authorityExpireTimer;
/// <summary>If true, the <see cref="_http3Authority"/> will persist across a network change. If false, it will be reset to <see cref="_originAuthority"/>.</summary>
private bool _persistAuthority;
/// <summary>
/// When an Alt-Svc authority fails due to 421 Misdirected Request, it is placed in the blocklist to be ignored
/// for <see cref="AltSvcBlocklistTimeoutInMilliseconds"/> milliseconds. Initialized on first use.
/// </summary>
private volatile HashSet<HttpAuthority>? _altSvcBlocklist;
private CancellationTokenSource? _altSvcBlocklistTimerCancellation;
private volatile bool _altSvcEnabled = true;
/// <summary>The maximum number of times to retry a request after a failure on an established connection.</summary>
private const int MaxConnectionFailureRetries = 3;
/// <summary>
/// If <see cref="_altSvcBlocklist"/> exceeds this size, Alt-Svc will be disabled entirely for <see cref="AltSvcBlocklistTimeoutInMilliseconds"/> milliseconds.
/// This is to prevent a failing server from bloating the dictionary beyond a reasonable value.
/// </summary>
private const int MaxAltSvcIgnoreListSize = 8;
/// <summary>The time, in milliseconds, that an authority should remain in <see cref="_altSvcBlocklist"/>.</summary>
private const int AltSvcBlocklistTimeoutInMilliseconds = 10 * 60 * 1000;
// HTTP/1.1 connection pool
/// <summary>List of available HTTP/1.1 connections stored in the pool.</summary>
private readonly List<HttpConnection> _availableHttp11Connections = new List<HttpConnection>();
/// <summary>The maximum number of HTTP/1.1 connections allowed to be associated with the pool.</summary>
private readonly int _maxHttp11Connections;
/// <summary>The number of HTTP/1.1 connections associated with the pool, including in use, available, and pending.</summary>
private int _associatedHttp11ConnectionCount;
/// <summary>The number of HTTP/1.1 connections that are in the process of being established.</summary>
private int _pendingHttp11ConnectionCount;
/// <summary>Queue of requests waiting for an HTTP/1.1 connection.</summary>
private RequestQueue<HttpConnection> _http11RequestQueue;
// HTTP/2 connection pool
/// <summary>List of available HTTP/2 connections stored in the pool.</summary>
private List<Http2Connection>? _availableHttp2Connections;
/// <summary>The number of HTTP/2 connections associated with the pool, including in use, available, and pending.</summary>
private int _associatedHttp2ConnectionCount;
/// <summary>Indicates whether an HTTP/2 connection is in the process of being established.</summary>
private bool _pendingHttp2Connection;
/// <summary>Queue of requests waiting for an HTTP/2 connection.</summary>
private RequestQueue<Http2Connection?> _http2RequestQueue;
private bool _http2Enabled;
private byte[]? _http2AltSvcOriginUri;
internal readonly byte[]? _http2EncodedAuthorityHostHeader;
private readonly bool _http3Enabled;
private Http3Connection? _http3Connection;
private SemaphoreSlim? _http3ConnectionCreateLock;
internal readonly byte[]? _http3EncodedAuthorityHostHeader;
/// <summary>For non-proxy connection pools, this is the host name in bytes; for proxies, null.</summary>
private readonly byte[]? _hostHeaderValueBytes;
/// <summary>Options specialized and cached for this pool and its key.</summary>
private readonly SslClientAuthenticationOptions? _sslOptionsHttp11;
private readonly SslClientAuthenticationOptions? _sslOptionsHttp2;
private readonly SslClientAuthenticationOptions? _sslOptionsHttp2Only;
private readonly SslClientAuthenticationOptions? _sslOptionsHttp3;
/// <summary>Whether the pool has been used since the last time a cleanup occurred.</summary>
private bool _usedSinceLastCleanup = true;
/// <summary>Whether the pool has been disposed.</summary>
private bool _disposed;
public const int DefaultHttpPort = 80;
public const int DefaultHttpsPort = 443;
/// <summary>Initializes the pool.</summary>
/// <param name="poolManager">The manager associated with this pool.</param>
/// <param name="kind">The kind of HTTP connections stored in this pool.</param>
/// <param name="host">The host with which this pool is associated.</param>
/// <param name="port">The port with which this pool is associated.</param>
/// <param name="sslHostName">The SSL host with which this pool is associated.</param>
/// <param name="proxyUri">The proxy this pool targets (optional).</param>
public HttpConnectionPool(HttpConnectionPoolManager poolManager, HttpConnectionKind kind, string? host, int port, string? sslHostName, Uri? proxyUri)
{
_poolManager = poolManager;
_kind = kind;
_proxyUri = proxyUri;
_maxHttp11Connections = Settings._maxConnectionsPerServer;
if (host != null)
{
_originAuthority = new HttpAuthority(host, port);
}
_http2Enabled = _poolManager.Settings._maxHttpVersion >= HttpVersion.Version20;
if (IsHttp3Supported())
{
_http3Enabled = _poolManager.Settings._maxHttpVersion >= HttpVersion.Version30 && (_poolManager.Settings._quicImplementationProvider ?? QuicImplementationProviders.Default).IsSupported;
}
switch (kind)
{
case HttpConnectionKind.Http:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName == null);
Debug.Assert(proxyUri == null);
_http3Enabled = false;
break;
case HttpConnectionKind.Https:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName != null);
Debug.Assert(proxyUri == null);
break;
case HttpConnectionKind.Proxy:
Debug.Assert(host == null);
Debug.Assert(port == 0);
Debug.Assert(sslHostName == null);
Debug.Assert(proxyUri != null);
_http2Enabled = false;
_http3Enabled = false;
break;
case HttpConnectionKind.ProxyTunnel:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName == null);
Debug.Assert(proxyUri != null);
_http2Enabled = false;
_http3Enabled = false;
break;
case HttpConnectionKind.SslProxyTunnel:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName != null);
Debug.Assert(proxyUri != null);
_http3Enabled = false; // TODO: how do we tunnel HTTP3?
break;
case HttpConnectionKind.ProxyConnect:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(sslHostName == null);
Debug.Assert(proxyUri != null);
// Don't enforce the max connections limit on proxy tunnels; this would mean that connections to different origin servers
// would compete for the same limited number of connections.
// We will still enforce this limit on the user of the tunnel (i.e. ProxyTunnel or SslProxyTunnel).
_maxHttp11Connections = int.MaxValue;
_http2Enabled = false;
_http3Enabled = false;
break;
case HttpConnectionKind.SocksTunnel:
case HttpConnectionKind.SslSocksTunnel:
Debug.Assert(host != null);
Debug.Assert(port != 0);
Debug.Assert(proxyUri != null);
_http3Enabled = false; // TODO: SOCKS supports UDP and may be used for HTTP3
break;
default:
Debug.Fail("Unknown HttpConnectionKind in HttpConnectionPool.ctor");
break;
}
if (!_http3Enabled)
{
// Avoid parsing Alt-Svc headers if they won't be used.
_altSvcEnabled = false;
}
string? hostHeader = null;
if (_originAuthority != null)
{
// Precalculate ASCII bytes for Host header
// Note that if _host is null, this is a (non-tunneled) proxy connection, and we can't cache the hostname.
hostHeader =
(_originAuthority.Port != (sslHostName == null ? DefaultHttpPort : DefaultHttpsPort)) ?
$"{_originAuthority.IdnHost}:{_originAuthority.Port}" :
_originAuthority.IdnHost;
// Note the IDN hostname should always be ASCII, since it's already been IDNA encoded.
_hostHeaderValueBytes = Encoding.ASCII.GetBytes(hostHeader);
Debug.Assert(Encoding.ASCII.GetString(_hostHeaderValueBytes) == hostHeader);
if (sslHostName == null)
{
_http2EncodedAuthorityHostHeader = HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(H2StaticTable.Authority, hostHeader);
_http3EncodedAuthorityHostHeader = QPackEncoder.EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(H3StaticTable.Authority, hostHeader);
}
}
if (sslHostName != null)
{
_sslOptionsHttp11 = ConstructSslOptions(poolManager, sslHostName);
_sslOptionsHttp11.ApplicationProtocols = null;
if (_http2Enabled)
{
_sslOptionsHttp2 = ConstructSslOptions(poolManager, sslHostName);
_sslOptionsHttp2.ApplicationProtocols = s_http2ApplicationProtocols;
_sslOptionsHttp2Only = ConstructSslOptions(poolManager, sslHostName);
_sslOptionsHttp2Only.ApplicationProtocols = s_http2OnlyApplicationProtocols;
// Note:
// The HTTP/2 specification states:
// "A deployment of HTTP/2 over TLS 1.2 MUST disable renegotiation.
// An endpoint MUST treat a TLS renegotiation as a connection error (Section 5.4.1)
// of type PROTOCOL_ERROR."
// which suggests we should do:
// _sslOptionsHttp2.AllowRenegotiation = false;
// However, if AllowRenegotiation is set to false, that will also prevent
// renegotation if the server denies the HTTP/2 request and causes a
// downgrade to HTTP/1.1, and the current APIs don't provide a mechanism
// by which AllowRenegotiation could be set back to true in that case.
// For now, if an HTTP/2 server erroneously issues a renegotiation, we'll
// allow it.
Debug.Assert(hostHeader != null);
_http2EncodedAuthorityHostHeader = HPackEncoder.EncodeLiteralHeaderFieldWithoutIndexingToAllocatedArray(H2StaticTable.Authority, hostHeader);
_http3EncodedAuthorityHostHeader = QPackEncoder.EncodeLiteralHeaderFieldWithStaticNameReferenceToArray(H3StaticTable.Authority, hostHeader);
}
if (IsHttp3Supported())
{
if (_http3Enabled)
{
_sslOptionsHttp3 = ConstructSslOptions(poolManager, sslHostName);
_sslOptionsHttp3.ApplicationProtocols = s_http3ApplicationProtocols;
}
}
}
// Set up for PreAuthenticate. Access to this cache is guarded by a lock on the cache itself.
if (_poolManager.Settings._preAuthenticate)
{
PreAuthCredentials = new CredentialCache();
}
if (NetEventSource.Log.IsEnabled()) Trace($"{this}");
}
[SupportedOSPlatformGuard("linux")]
[SupportedOSPlatformGuard("macOS")]
[SupportedOSPlatformGuard("Windows")]
internal static bool IsHttp3Supported() => (OperatingSystem.IsLinux() && !OperatingSystem.IsAndroid()) || OperatingSystem.IsWindows() || OperatingSystem.IsMacOS();
private static readonly List<SslApplicationProtocol> s_http3ApplicationProtocols = new List<SslApplicationProtocol>() { SslApplicationProtocol.Http3 };
private static readonly List<SslApplicationProtocol> s_http2ApplicationProtocols = new List<SslApplicationProtocol>() { SslApplicationProtocol.Http2, SslApplicationProtocol.Http11 };
private static readonly List<SslApplicationProtocol> s_http2OnlyApplicationProtocols = new List<SslApplicationProtocol>() { SslApplicationProtocol.Http2 };
private static SslClientAuthenticationOptions ConstructSslOptions(HttpConnectionPoolManager poolManager, string sslHostName)
{
Debug.Assert(sslHostName != null);
SslClientAuthenticationOptions sslOptions = poolManager.Settings._sslOptions?.ShallowClone() ?? new SslClientAuthenticationOptions();
// Set TargetHost for SNI
sslOptions.TargetHost = sslHostName;
// Windows 7 and Windows 2008 R2 support TLS 1.1 and 1.2, but for legacy reasons by default those protocols
// are not enabled when a developer elects to use the system default. However, in .NET Core 2.0 and earlier,
// HttpClientHandler would enable them, due to being a wrapper for WinHTTP, which enabled them. Both for
// compatibility and because we prefer those higher protocols whenever possible, SocketsHttpHandler also
// pretends they're part of the default when running on Win7/2008R2.
if (s_isWindows7Or2008R2 && sslOptions.EnabledSslProtocols == SslProtocols.None)
{
if (NetEventSource.Log.IsEnabled())
{
NetEventSource.Info(poolManager, $"Win7OrWin2K8R2 platform, Changing default TLS protocols to {SecurityProtocol.DefaultSecurityProtocols}");
}
sslOptions.EnabledSslProtocols = SecurityProtocol.DefaultSecurityProtocols;
}
return sslOptions;
}
public HttpAuthority? OriginAuthority => _originAuthority;
public HttpConnectionSettings Settings => _poolManager.Settings;
public HttpConnectionKind Kind => _kind;
public bool IsSecure => _kind == HttpConnectionKind.Https || _kind == HttpConnectionKind.SslProxyTunnel || _kind == HttpConnectionKind.SslSocksTunnel;
public Uri? ProxyUri => _proxyUri;
public ICredentials? ProxyCredentials => _poolManager.ProxyCredentials;
public byte[]? HostHeaderValueBytes => _hostHeaderValueBytes;
public CredentialCache? PreAuthCredentials { get; }
/// <summary>
/// An ASCII origin string per RFC 6454 Section 6.2, in format <scheme>://<host>[:<port>]
/// </summary>
/// <remarks>
/// Used by <see cref="Http2Connection"/> to test ALTSVC frames for our origin.
/// </remarks>
public byte[] Http2AltSvcOriginUri
{
get
{
if (_http2AltSvcOriginUri == null)
{
var sb = new StringBuilder();
Debug.Assert(_originAuthority != null);
sb.Append(IsSecure ? "https://" : "http://")
.Append(_originAuthority.IdnHost);
if (_originAuthority.Port != (IsSecure ? DefaultHttpsPort : DefaultHttpPort))
{
sb.Append(CultureInfo.InvariantCulture, $":{_originAuthority.Port}");
}
_http2AltSvcOriginUri = Encoding.ASCII.GetBytes(sb.ToString());
}
return _http2AltSvcOriginUri;
}
}
private bool EnableMultipleHttp2Connections => _poolManager.Settings.EnableMultipleHttp2Connections;
/// <summary>Object used to synchronize access to state in the pool.</summary>
private object SyncObj
{
get
{
Debug.Assert(!Monitor.IsEntered(_availableHttp11Connections));
return _availableHttp11Connections;
}
}
private bool HasSyncObjLock => Monitor.IsEntered(_availableHttp11Connections);
// Overview of connection management (mostly HTTP version independent):
//
// Each version of HTTP (1.1, 2, 3) has its own connection pool, and each of these work in a similar manner,
// allowing for differences between the versions (most notably, HTTP/1.1 is not multiplexed.)
//
// When a request is submitted for a particular version (e.g. HTTP/1.1), we first look in the pool for available connections.
// An "available" connection is one that is (hopefully) usable for a new request.
// For HTTP/1.1, this is just an idle connection.
// For HTTP2/3, this is a connection that (hopefully) has available streams to use for new requests.
// If we find an available connection, we will attempt to validate it and then use it.
// We check the lifetime of the connection and discard it if the lifetime is exceeded.
// We check that the connection has not shut down; if so we discard it.
// For HTTP2/3, we reserve a stream on the connection. If this fails, we cannot use the connection right now.
// If validation fails, we will attempt to find a different available connection.
//
// Once we have found a usable connection, we use it to process the request.
// For HTTP/1.1, a connection can handle only a single request at a time, thus it is immediately removed from the list of available connections.
// For HTTP2/3, a connection is only removed from the available list when it has no more available streams.
// In either case, the connection still counts against the total associated connection count for the pool.
//
// If we cannot find a usable available connection, then the request is added the to the request queue for the appropriate version.
//
// Whenever a request is queued, or an existing connection shuts down, we will check to see if we should inject a new connection.
// Injection policy depends on both user settings and some simple heuristics.
// See comments on the relevant routines for details on connection injection policy.
//
// When a new connection is successfully created, or an existing unavailable connection becomes available again,
// we will attempt to use this connection to handle any queued requests (subject to lifetime restrictions on existing connections).
// This may result in the connection becoming unavailable again, because it cannot handle any more requests at the moment.
// If not, we will return the connection to the pool as an available connection for use by new requests.
//
// When a connection shuts down, either gracefully (e.g. GOAWAY) or abortively (e.g. IOException),
// we will remove it from the list of available connections, if it is present there.
// If not, then it must be unavailable at the moment; we will detect this and ensure it is not added back to the available pool.
[DoesNotReturn]
private static void ThrowGetVersionException(HttpRequestMessage request, int desiredVersion)
{
Debug.Assert(desiredVersion == 2 || desiredVersion == 3);
throw new HttpRequestException(SR.Format(SR.net_http_requested_version_cannot_establish, request.Version, request.VersionPolicy, desiredVersion));
}
private bool CheckExpirationOnGet(HttpConnectionBase connection)
{
TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime;
if (pooledConnectionLifetime != Timeout.InfiniteTimeSpan)
{
return connection.GetLifetimeTicks(Environment.TickCount64) > pooledConnectionLifetime.TotalMilliseconds;
}
return false;
}
private static Exception CreateConnectTimeoutException(OperationCanceledException oce)
{
// The pattern for request timeouts (on HttpClient) is to throw an OCE with an inner exception of TimeoutException.
// Do the same for ConnectTimeout-based timeouts.
TimeoutException te = new TimeoutException(SR.net_http_connect_timedout, oce.InnerException);
Exception newException = CancellationHelper.CreateOperationCanceledException(te, oce.CancellationToken);
ExceptionDispatchInfo.SetCurrentStackTrace(newException);
return newException;
}
private async Task AddHttp11ConnectionAsync(HttpRequestMessage request)
{
if (NetEventSource.Log.IsEnabled()) Trace("Creating new HTTP/1.1 connection for pool.");
HttpConnection connection;
using (CancellationTokenSource cts = GetConnectTimeoutCancellationTokenSource())
{
try
{
connection = await CreateHttp11ConnectionAsync(request, true, cts.Token).ConfigureAwait(false);
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cts.Token)
{
HandleHttp11ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
HandleHttp11ConnectionFailure(request, e);
return;
}
}
// Add the established connection to the pool.
ReturnHttp11Connection(connection, isNewConnection: true);
}
private void CheckForHttp11ConnectionInjection()
{
Debug.Assert(HasSyncObjLock);
if (!_http11RequestQueue.TryPeekRequest(out HttpRequestMessage? request))
{
return;
}
// Determine if we can and should add a new connection to the pool.
if (_availableHttp11Connections.Count == 0 && // No available connections
_http11RequestQueue.Count > _pendingHttp11ConnectionCount && // More requests queued than pending connections
_associatedHttp11ConnectionCount < _maxHttp11Connections) // Under the connection limit
{
_associatedHttp11ConnectionCount++;
_pendingHttp11ConnectionCount++;
Task.Run(() => AddHttp11ConnectionAsync(request));
}
}
private async ValueTask<HttpConnection> GetHttp11ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
// Look for a usable idle connection.
TaskCompletionSourceWithCancellation<HttpConnection> waiter;
while (true)
{
HttpConnection? connection = null;
lock (SyncObj)
{
_usedSinceLastCleanup = true;
int availableConnectionCount = _availableHttp11Connections.Count;
if (availableConnectionCount > 0)
{
// We have a connection that we can attempt to use.
// Validate it below outside the lock, to avoid doing expensive operations while holding the lock.
connection = _availableHttp11Connections[availableConnectionCount - 1];
_availableHttp11Connections.RemoveAt(availableConnectionCount - 1);
}
else
{
// No available connections. Add to the request queue.
waiter = _http11RequestQueue.EnqueueRequest(request);
CheckForHttp11ConnectionInjection();
// Break out of the loop and continue processing below.
break;
}
}
if (CheckExpirationOnGet(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found expired HTTP/1.1 connection in pool.");
connection.Dispose();
continue;
}
if (!connection.PrepareForReuse(async))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found invalid HTTP/1.1 connection in pool.");
connection.Dispose();
continue;
}
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found usable HTTP/1.1 connection in pool.");
return connection;
}
// There were no available idle connections. This request has been added to the request queue.
if (NetEventSource.Log.IsEnabled()) Trace($"No available HTTP/1.1 connections; request queued.");
long startingTimestamp = Stopwatch.GetTimestamp();
try
{
return await waiter.WaitWithCancellationAsync(async, cancellationToken).ConfigureAwait(false);
}
finally
{
if (HttpTelemetry.Log.IsEnabled())
{
HttpTelemetry.Log.Http11RequestLeftQueue(Stopwatch.GetElapsedTime(startingTimestamp).TotalMilliseconds);
}
}
}
private async Task HandleHttp11Downgrade(HttpRequestMessage request, Socket? socket, Stream stream, TransportContext? transportContext, CancellationToken cancellationToken)
{
if (NetEventSource.Log.IsEnabled()) Trace("Server does not support HTTP2; disabling HTTP2 use and proceeding with HTTP/1.1 connection");
bool canUse = true;
TaskCompletionSourceWithCancellation<Http2Connection?>? waiter = null;
lock (SyncObj)
{
Debug.Assert(_pendingHttp2Connection);
Debug.Assert(_associatedHttp2ConnectionCount > 0);
// Server does not support HTTP2. Disable further HTTP2 attempts.
_http2Enabled = false;
_associatedHttp2ConnectionCount--;
_pendingHttp2Connection = false;
if (_associatedHttp11ConnectionCount < _maxHttp11Connections)
{
_associatedHttp11ConnectionCount++;
_pendingHttp11ConnectionCount++;
}
else
{
// We are already at the limit for HTTP/1.1 connections, so do not proceed with this connection.
canUse = false;
}
_http2RequestQueue.TryDequeueWaiter(out waiter);
}
// Signal to any queued HTTP2 requests that they must downgrade.
while (waiter is not null)
{
if (NetEventSource.Log.IsEnabled()) Trace("Downgrading queued HTTP2 request to HTTP/1.1");
// We don't care if this fails; that means the request was previously canceled.
bool success = waiter.TrySetResult(null);
Debug.Assert(success || waiter.Task.IsCanceled);
lock (SyncObj)
{
_http2RequestQueue.TryDequeueWaiter(out waiter);
}
}
if (!canUse)
{
if (NetEventSource.Log.IsEnabled()) Trace("Discarding downgraded HTTP/1.1 connection because HTTP/1.1 connection limit is exceeded");
stream.Dispose();
}
HttpConnection http11Connection;
try
{
// Note, the same CancellationToken from the original HTTP2 connection establishment still applies here.
http11Connection = await ConstructHttp11ConnectionAsync(true, socket, stream, transportContext, request, cancellationToken).ConfigureAwait(false);
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cancellationToken)
{
HandleHttp11ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
HandleHttp11ConnectionFailure(request, e);
return;
}
ReturnHttp11Connection(http11Connection, isNewConnection: true);
}
private async Task AddHttp2ConnectionAsync(HttpRequestMessage request)
{
if (NetEventSource.Log.IsEnabled()) Trace("Creating new HTTP/2 connection for pool.");
Http2Connection connection;
using (CancellationTokenSource cts = GetConnectTimeoutCancellationTokenSource())
{
try
{
(Socket? socket, Stream stream, TransportContext? transportContext) = await ConnectAsync(request, true, cts.Token).ConfigureAwait(false);
if (IsSecure)
{
SslStream sslStream = (SslStream)stream;
if (sslStream.NegotiatedApplicationProtocol == SslApplicationProtocol.Http2)
{
// The server accepted our request for HTTP2.
if (sslStream.SslProtocol < SslProtocols.Tls12)
{
stream.Dispose();
throw new HttpRequestException(SR.Format(SR.net_ssl_http2_requires_tls12, sslStream.SslProtocol));
}
connection = await ConstructHttp2ConnectionAsync(stream, request, cts.Token).ConfigureAwait(false);
}
else
{
// We established an SSL connection, but the server denied our request for HTTP2.
await HandleHttp11Downgrade(request, socket, stream, transportContext, cts.Token).ConfigureAwait(false);
return;
}
}
else
{
connection = await ConstructHttp2ConnectionAsync(stream, request, cts.Token).ConfigureAwait(false);
}
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cts.Token)
{
HandleHttp2ConnectionFailure(request, CreateConnectTimeoutException(oce));
return;
}
catch (Exception e)
{
HandleHttp2ConnectionFailure(request, e);
return;
}
}
// Register for shutdown notification.
// Do this before we return the connection to the pool, because that may result in it being disposed.
ValueTask shutdownTask = connection.WaitForShutdownAsync();
// Add the new connection to the pool.
ReturnHttp2Connection(connection, request, isNewConnection: true);
// Wait for connection shutdown.
await shutdownTask.ConfigureAwait(false);
InvalidateHttp2Connection(connection);
}
private void CheckForHttp2ConnectionInjection()
{
Debug.Assert(HasSyncObjLock);
if (!_http2RequestQueue.TryPeekRequest(out HttpRequestMessage? request))
{
return;
}
// Determine if we can and should add a new connection to the pool.
if ((_availableHttp2Connections?.Count ?? 0) == 0 && // No available connections
!_pendingHttp2Connection && // Only allow one pending HTTP2 connection at a time
(_associatedHttp2ConnectionCount == 0 || EnableMultipleHttp2Connections)) // We allow multiple connections, or don't have a connection currently
{
_associatedHttp2ConnectionCount++;
_pendingHttp2Connection = true;
Task.Run(() => AddHttp2ConnectionAsync(request));
}
}
private async ValueTask<Http2Connection?> GetHttp2ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
Debug.Assert(_kind == HttpConnectionKind.Https || _kind == HttpConnectionKind.SslProxyTunnel || _kind == HttpConnectionKind.Http || _kind == HttpConnectionKind.SocksTunnel || _kind == HttpConnectionKind.SslSocksTunnel);
// Look for a usable connection.
TaskCompletionSourceWithCancellation<Http2Connection?> waiter;
while (true)
{
Http2Connection connection;
lock (SyncObj)
{
_usedSinceLastCleanup = true;
if (!_http2Enabled)
{
return null;
}
int availableConnectionCount = _availableHttp2Connections?.Count ?? 0;
if (availableConnectionCount > 0)
{
// We have a connection that we can attempt to use.
// Validate it below outside the lock, to avoid doing expensive operations while holding the lock.
connection = _availableHttp2Connections![availableConnectionCount - 1];
}
else
{
// No available connections. Add to the request queue.
waiter = _http2RequestQueue.EnqueueRequest(request);
CheckForHttp2ConnectionInjection();
// Break out of the loop and continue processing below.
break;
}
}
if (CheckExpirationOnGet(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found expired HTTP/2 connection in pool.");
InvalidateHttp2Connection(connection);
continue;
}
if (!connection.TryReserveStream())
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found HTTP/2 connection in pool without available streams.");
bool found = false;
lock (SyncObj)
{
int index = _availableHttp2Connections.IndexOf(connection);
if (index != -1)
{
found = true;
_availableHttp2Connections.RemoveAt(index);
}
}
// If we didn't find the connection, then someone beat us to removing it (or it shut down)
if (found)
{
DisableHttp2Connection(connection);
}
continue;
}
if (NetEventSource.Log.IsEnabled()) connection.Trace("Found usable HTTP/2 connection in pool.");
return connection;
}
// There were no available connections. This request has been added to the request queue.
if (NetEventSource.Log.IsEnabled()) Trace($"No available HTTP/2 connections; request queued.");
long startingTimestamp = Stopwatch.GetTimestamp();
try
{
return await waiter.WaitWithCancellationAsync(async, cancellationToken).ConfigureAwait(false);
}
finally
{
if (HttpTelemetry.Log.IsEnabled())
{
HttpTelemetry.Log.Http20RequestLeftQueue(Stopwatch.GetElapsedTime(startingTimestamp).TotalMilliseconds);
}
}
}
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
private async ValueTask<Http3Connection> GetHttp3ConnectionAsync(HttpRequestMessage request, HttpAuthority authority, CancellationToken cancellationToken)
{
Debug.Assert(_kind == HttpConnectionKind.Https);
Debug.Assert(_http3Enabled == true);
Http3Connection? http3Connection = Volatile.Read(ref _http3Connection);
if (http3Connection != null)
{
if (CheckExpirationOnGet(http3Connection) || http3Connection.Authority != authority)
{
// Connection expired.
if (NetEventSource.Log.IsEnabled()) http3Connection.Trace("Found expired HTTP3 connection.");
http3Connection.Dispose();
InvalidateHttp3Connection(http3Connection);
}
else
{
// Connection exists and it is still good to use.
if (NetEventSource.Log.IsEnabled()) Trace("Using existing HTTP3 connection.");
_usedSinceLastCleanup = true;
return http3Connection;
}
}
// Ensure that the connection creation semaphore is created
if (_http3ConnectionCreateLock == null)
{
lock (SyncObj)
{
if (_http3ConnectionCreateLock == null)
{
_http3ConnectionCreateLock = new SemaphoreSlim(1);
}
}
}
await _http3ConnectionCreateLock.WaitAsync(cancellationToken).ConfigureAwait(false);
try
{
if (_http3Connection != null)
{
// Someone beat us to creating the connection.
if (NetEventSource.Log.IsEnabled())
{
Trace("Using existing HTTP3 connection.");
}
return _http3Connection;
}
if (NetEventSource.Log.IsEnabled())
{
Trace("Attempting new HTTP3 connection.");
}
QuicConnection quicConnection;
try
{
quicConnection = await ConnectHelper.ConnectQuicAsync(request, Settings._quicImplementationProvider ?? QuicImplementationProviders.Default, new DnsEndPoint(authority.IdnHost, authority.Port), _sslOptionsHttp3!, cancellationToken).ConfigureAwait(false);
}
catch
{
// Disables HTTP/3 until server announces it can handle it via Alt-Svc.
BlocklistAuthority(authority);
throw;
}
//TODO: NegotiatedApplicationProtocol not yet implemented.
#if false
if (quicConnection.NegotiatedApplicationProtocol != SslApplicationProtocol.Http3)
{
BlocklistAuthority(authority);
throw new HttpRequestException("QUIC connected but no HTTP/3 indicated via ALPN.", null, RequestRetryType.RetryOnSameOrNextProxy);
}
#endif
http3Connection = new Http3Connection(this, _originAuthority, authority, quicConnection);
_http3Connection = http3Connection;
if (NetEventSource.Log.IsEnabled())
{
Trace("New HTTP3 connection established.");
}
return http3Connection;
}
finally
{
_http3ConnectionCreateLock.Release();
}
}
// Returns null if HTTP3 cannot be used.
[SupportedOSPlatform("windows")]
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
private async ValueTask<HttpResponseMessage?> TrySendUsingHttp3Async(HttpRequestMessage request, CancellationToken cancellationToken)
{
// Loop in case we get a 421 and need to send the request to a different authority.
while (true)
{
HttpAuthority? authority = _http3Authority;
// If H3 is explicitly requested, assume prenegotiated H3.
if (request.Version.Major >= 3 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
authority ??= _originAuthority;
}
if (authority == null)
{
return null;
}
if (IsAltSvcBlocked(authority))
{
ThrowGetVersionException(request, 3);
}
long queueStartingTimestamp = HttpTelemetry.Log.IsEnabled() ? Stopwatch.GetTimestamp() : 0;
ValueTask<Http3Connection> connectionTask = GetHttp3ConnectionAsync(request, authority, cancellationToken);
if (HttpTelemetry.Log.IsEnabled() && connectionTask.IsCompleted)
{
// We avoid logging RequestLeftQueue if a stream was available immediately (synchronously)
queueStartingTimestamp = 0;
}
Http3Connection connection = await connectionTask.ConfigureAwait(false);
HttpResponseMessage response = await connection.SendAsync(request, queueStartingTimestamp, cancellationToken).ConfigureAwait(false);
// If an Alt-Svc authority returns 421, it means it can't actually handle the request.
// An authority is supposed to be able to handle ALL requests to the origin, so this is a server bug.
// In this case, we blocklist the authority and retry the request at the origin.
if (response.StatusCode == HttpStatusCode.MisdirectedRequest && connection.Authority != _originAuthority)
{
response.Dispose();
BlocklistAuthority(connection.Authority);
continue;
}
return response;
}
}
/// <summary>Check for the Alt-Svc header, to upgrade to HTTP/3.</summary>
private void ProcessAltSvc(HttpResponseMessage response)
{
if (_altSvcEnabled && response.Headers.TryGetValues(KnownHeaders.AltSvc.Descriptor, out IEnumerable<string>? altSvcHeaderValues))
{
HandleAltSvc(altSvcHeaderValues, response.Headers.Age);
}
}
public async ValueTask<HttpResponseMessage> SendWithVersionDetectionAndRetryAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
{
// Loop on connection failures (or other problems like version downgrade) and retry if possible.
int retryCount = 0;
while (true)
{
try
{
HttpResponseMessage? response = null;
// Use HTTP/3 if possible.
if (IsHttp3Supported() && // guard to enable trimming HTTP/3 support
_http3Enabled &&
(request.Version.Major >= 3 || (request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher && IsSecure)))
{
Debug.Assert(async);
response = await TrySendUsingHttp3Async(request, cancellationToken).ConfigureAwait(false);
}
if (response is null)
{
// We could not use HTTP/3. Do not continue if downgrade is not allowed.
if (request.Version.Major >= 3 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
ThrowGetVersionException(request, 3);
}
// Use HTTP/2 if possible.
if (_http2Enabled &&
(request.Version.Major >= 2 || (request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher && IsSecure)) &&
(request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower || IsSecure)) // prefer HTTP/1.1 if connection is not secured and downgrade is possible
{
Http2Connection? connection = await GetHttp2ConnectionAsync(request, async, cancellationToken).ConfigureAwait(false);
Debug.Assert(connection is not null || !_http2Enabled);
if (connection is not null)
{
response = await connection.SendAsync(request, async, cancellationToken).ConfigureAwait(false);
}
}
if (response is null)
{
// We could not use HTTP/2. Do not continue if downgrade is not allowed.
if (request.Version.Major >= 2 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
ThrowGetVersionException(request, 2);
}
// Use HTTP/1.x.
HttpConnection connection = await GetHttp11ConnectionAsync(request, async, cancellationToken).ConfigureAwait(false);
connection.Acquire(); // In case we are doing Windows (i.e. connection-based) auth, we need to ensure that we hold on to this specific connection while auth is underway.
try
{
response = await SendWithNtConnectionAuthAsync(connection, request, async, doRequestAuth, cancellationToken).ConfigureAwait(false);
}
finally
{
connection.Release();
}
}
}
ProcessAltSvc(response);
return response;
}
catch (HttpRequestException e) when (e.AllowRetry == RequestRetryType.RetryOnConnectionFailure)
{
Debug.Assert(retryCount >= 0 && retryCount <= MaxConnectionFailureRetries);
if (retryCount == MaxConnectionFailureRetries)
{
if (NetEventSource.Log.IsEnabled())
{
Trace($"MaxConnectionFailureRetries limit of {MaxConnectionFailureRetries} hit. Retryable request will not be retried. Exception: {e}");
}
throw;
}
retryCount++;
if (NetEventSource.Log.IsEnabled())
{
Trace($"Retry attempt {retryCount} after connection failure. Connection exception: {e}");
}
// Eat exception and try again.
}
catch (HttpRequestException e) when (e.AllowRetry == RequestRetryType.RetryOnLowerHttpVersion)
{
// Throw if fallback is not allowed by the version policy.
if (request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
throw new HttpRequestException(SR.Format(SR.net_http_requested_version_server_refused, request.Version, request.VersionPolicy), e);
}
if (NetEventSource.Log.IsEnabled())
{
Trace($"Retrying request because server requested version fallback: {e}");
}
// Eat exception and try again on a lower protocol version.
request.Version = HttpVersion.Version11;
}
catch (HttpRequestException e) when (e.AllowRetry == RequestRetryType.RetryOnStreamLimitReached)
{
if (NetEventSource.Log.IsEnabled())
{
Trace($"Retrying request on another HTTP/2 connection after active streams limit is reached on existing one: {e}");
}
// Eat exception and try again.
}
}
}
/// <summary>
/// Inspects a collection of Alt-Svc headers to find the first eligible upgrade path.
/// </summary>
/// <remarks>TODO: common case will likely be a single value. Optimize for that.</remarks>
internal void HandleAltSvc(IEnumerable<string> altSvcHeaderValues, TimeSpan? responseAge)
{
HttpAuthority? nextAuthority = null;
TimeSpan nextAuthorityMaxAge = default;
bool nextAuthorityPersist = false;
foreach (string altSvcHeaderValue in altSvcHeaderValues)
{
int parseIdx = 0;
if (AltSvcHeaderParser.Parser.TryParseValue(altSvcHeaderValue, null, ref parseIdx, out object? parsedValue))
{
var value = (AltSvcHeaderValue?)parsedValue;
// 'clear' should be the only value present.
if (value == AltSvcHeaderValue.Clear)
{
ExpireAltSvcAuthority();
Debug.Assert(_authorityExpireTimer != null);
_authorityExpireTimer.Change(Timeout.Infinite, Timeout.Infinite);
break;
}
if (nextAuthority == null && value != null && value.AlpnProtocolName == "h3")
{
var authority = new HttpAuthority(value.Host ?? _originAuthority!.IdnHost, value.Port);
if (IsAltSvcBlocked(authority))
{
// Skip authorities in our blocklist.
continue;
}
TimeSpan authorityMaxAge = value.MaxAge;
if (responseAge != null)
{
authorityMaxAge -= responseAge.GetValueOrDefault();
}
if (authorityMaxAge > TimeSpan.Zero)
{
nextAuthority = authority;
nextAuthorityMaxAge = authorityMaxAge;
nextAuthorityPersist = value.Persist;
}
}
}
}
// There's a race here in checking _http3Authority outside of the lock,
// but there's really no bad behavior if _http3Authority changes in the mean time.
if (nextAuthority != null && !nextAuthority.Equals(_http3Authority))
{
// Clamp the max age to 30 days... this is arbitrary but prevents passing a too-large TimeSpan to the Timer.
if (nextAuthorityMaxAge.Ticks > (30 * TimeSpan.TicksPerDay))
{
nextAuthorityMaxAge = TimeSpan.FromTicks(30 * TimeSpan.TicksPerDay);
}
lock (SyncObj)
{
if (_authorityExpireTimer == null)
{
var thisRef = new WeakReference<HttpConnectionPool>(this);
bool restoreFlow = false;
try
{
if (!ExecutionContext.IsFlowSuppressed())
{
ExecutionContext.SuppressFlow();
restoreFlow = true;
}
_authorityExpireTimer = new Timer(static o =>
{
var wr = (WeakReference<HttpConnectionPool>)o!;
if (wr.TryGetTarget(out HttpConnectionPool? @this))
{
@this.ExpireAltSvcAuthority();
}
}, thisRef, nextAuthorityMaxAge, Timeout.InfiniteTimeSpan);
}
finally
{
if (restoreFlow) ExecutionContext.RestoreFlow();
}
}
else
{
_authorityExpireTimer.Change(nextAuthorityMaxAge, Timeout.InfiniteTimeSpan);
}
_http3Authority = nextAuthority;
_persistAuthority = nextAuthorityPersist;
}
if (!nextAuthorityPersist)
{
_poolManager.StartMonitoringNetworkChanges();
}
}
}
/// <summary>
/// Expires the current Alt-Svc authority, resetting the connection back to origin.
/// </summary>
private void ExpireAltSvcAuthority()
{
// If we ever support prenegotiated HTTP/3, this should be set to origin, not nulled out.
_http3Authority = null;
}
/// <summary>
/// Checks whether the given <paramref name="authority"/> is on the currext Alt-Svc blocklist.
/// </summary>
/// <seealso cref="BlocklistAuthority" />
private bool IsAltSvcBlocked(HttpAuthority authority)
{
if (_altSvcBlocklist != null)
{
lock (_altSvcBlocklist)
{
return _altSvcBlocklist.Contains(authority);
}
}
return false;
}
/// <summary>
/// Blocklists an authority and resets the current authority back to origin.
/// If the number of blocklisted authorities exceeds <see cref="MaxAltSvcIgnoreListSize"/>,
/// Alt-Svc will be disabled entirely for a period of time.
/// </summary>
/// <remarks>
/// This is called when we get a "421 Misdirected Request" from an alternate authority.
/// A future strategy would be to retry the individual request on an older protocol, we'd want to have
/// some logic to blocklist after some number of failures to avoid doubling our request latency.
///
/// For now, the spec states alternate authorities should be able to handle ALL requests, so this
/// is treated as an exceptional error by immediately blocklisting the authority.
/// </remarks>
internal void BlocklistAuthority(HttpAuthority badAuthority)
{
Debug.Assert(badAuthority != null);
HashSet<HttpAuthority>? altSvcBlocklist = _altSvcBlocklist;
if (altSvcBlocklist == null)
{
lock (SyncObj)
{
altSvcBlocklist = _altSvcBlocklist;
if (altSvcBlocklist == null)
{
altSvcBlocklist = new HashSet<HttpAuthority>();
_altSvcBlocklistTimerCancellation = new CancellationTokenSource();
_altSvcBlocklist = altSvcBlocklist;
}
}
}
bool added, disabled = false;
lock (altSvcBlocklist)
{
added = altSvcBlocklist.Add(badAuthority);
if (added && altSvcBlocklist.Count >= MaxAltSvcIgnoreListSize && _altSvcEnabled)
{
_altSvcEnabled = false;
disabled = true;
}
}
lock (SyncObj)
{
if (_http3Authority == badAuthority)
{
ExpireAltSvcAuthority();
Debug.Assert(_authorityExpireTimer != null);
_authorityExpireTimer.Change(Timeout.Infinite, Timeout.Infinite);
}
}
Debug.Assert(_altSvcBlocklistTimerCancellation != null);
if (added)
{
_ = Task.Delay(AltSvcBlocklistTimeoutInMilliseconds)
.ContinueWith(t =>
{
lock (altSvcBlocklist)
{
altSvcBlocklist.Remove(badAuthority);
}
}, _altSvcBlocklistTimerCancellation.Token, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}
if (disabled)
{
_ = Task.Delay(AltSvcBlocklistTimeoutInMilliseconds)
.ContinueWith(t =>
{
_altSvcEnabled = true;
}, _altSvcBlocklistTimerCancellation.Token, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}
}
public void OnNetworkChanged()
{
lock (SyncObj)
{
if (_http3Authority != null && _persistAuthority == false)
{
ExpireAltSvcAuthority();
Debug.Assert(_authorityExpireTimer != null);
_authorityExpireTimer.Change(Timeout.Infinite, Timeout.Infinite);
}
}
}
public Task<HttpResponseMessage> SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
{
if (doRequestAuth && Settings._credentials != null)
{
return AuthenticationHelper.SendWithNtConnectionAuthAsync(request, async, Settings._credentials, connection, this, cancellationToken);
}
return SendWithNtProxyAuthAsync(connection, request, async, cancellationToken);
}
private bool DoProxyAuth => (_kind == HttpConnectionKind.Proxy || _kind == HttpConnectionKind.ProxyConnect);
public Task<HttpResponseMessage> SendWithNtProxyAuthAsync(HttpConnection connection, HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
if (DoProxyAuth && ProxyCredentials is not null)
{
return AuthenticationHelper.SendWithNtProxyAuthAsync(request, ProxyUri!, async, ProxyCredentials, connection, this, cancellationToken);
}
return connection.SendAsync(request, async, cancellationToken);
}
public ValueTask<HttpResponseMessage> SendWithProxyAuthAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
{
if (DoProxyAuth && ProxyCredentials is not null)
{
return AuthenticationHelper.SendWithProxyAuthAsync(request, _proxyUri!, async, ProxyCredentials, doRequestAuth, this, cancellationToken);
}
return SendWithVersionDetectionAndRetryAsync(request, async, doRequestAuth, cancellationToken);
}
public ValueTask<HttpResponseMessage> SendAsync(HttpRequestMessage request, bool async, bool doRequestAuth, CancellationToken cancellationToken)
{
if (doRequestAuth && Settings._credentials != null)
{
return AuthenticationHelper.SendWithRequestAuthAsync(request, async, Settings._credentials, Settings._preAuthenticate, this, cancellationToken);
}
return SendWithProxyAuthAsync(request, async, doRequestAuth, cancellationToken);
}
private CancellationTokenSource GetConnectTimeoutCancellationTokenSource() => new CancellationTokenSource(Settings._connectTimeout);
private async ValueTask<(Socket?, Stream, TransportContext?)> ConnectAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
Stream? stream = null;
Socket? socket = null;
switch (_kind)
{
case HttpConnectionKind.Http:
case HttpConnectionKind.Https:
case HttpConnectionKind.ProxyConnect:
Debug.Assert(_originAuthority != null);
(socket, stream) = await ConnectToTcpHostAsync(_originAuthority.IdnHost, _originAuthority.Port, request, async, cancellationToken).ConfigureAwait(false);
break;
case HttpConnectionKind.Proxy:
(socket, stream) = await ConnectToTcpHostAsync(_proxyUri!.IdnHost, _proxyUri.Port, request, async, cancellationToken).ConfigureAwait(false);
break;
case HttpConnectionKind.ProxyTunnel:
case HttpConnectionKind.SslProxyTunnel:
stream = await EstablishProxyTunnelAsync(async, request.HasHeaders ? request.Headers : null, cancellationToken).ConfigureAwait(false);
break;
case HttpConnectionKind.SocksTunnel:
case HttpConnectionKind.SslSocksTunnel:
(socket, stream) = await EstablishSocksTunnel(request, async, cancellationToken).ConfigureAwait(false);
break;
}
Debug.Assert(stream != null);
if (socket is null && stream is NetworkStream ns)
{
// We weren't handed a socket directly. But if we're able to extract one, do so.
// Most likely case here is a ConnectCallback was used and returned a NetworkStream.
socket = ns.Socket;
}
TransportContext? transportContext = null;
if (IsSecure)
{
SslStream? sslStream = stream as SslStream;
if (sslStream == null)
{
sslStream = await ConnectHelper.EstablishSslConnectionAsync(GetSslOptionsForRequest(request), request, async, stream, cancellationToken).ConfigureAwait(false);
}
else
{
if (NetEventSource.Log.IsEnabled())
{
Trace($"Connected with custom SslStream: alpn='${sslStream.NegotiatedApplicationProtocol.ToString()}'");
}
}
transportContext = sslStream.TransportContext;
stream = sslStream;
}
return (socket, stream, transportContext);
}
private async ValueTask<(Socket?, Stream)> ConnectToTcpHostAsync(string host, int port, HttpRequestMessage initialRequest, bool async, CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
var endPoint = new DnsEndPoint(host, port);
Socket? socket = null;
Stream? stream = null;
try
{
// If a ConnectCallback was supplied, use that to establish the connection.
if (Settings._connectCallback != null)
{
ValueTask<Stream> streamTask = Settings._connectCallback(new SocketsHttpConnectionContext(endPoint, initialRequest), cancellationToken);
if (!async && !streamTask.IsCompleted)
{
// User-provided ConnectCallback is completing asynchronously but the user is making a synchronous request; if the user cares, they should
// set it up so that synchronous requests are made on a handler with a synchronously-completing ConnectCallback supplied. If in the future,
// we could add a Boolean to SocketsHttpConnectionContext (https://github.com/dotnet/runtime/issues/44876) to let the callback know whether
// this request is sync or async.
Trace($"{nameof(SocketsHttpHandler.ConnectCallback)} completing asynchronously for a synchronous request.");
}
stream = await streamTask.ConfigureAwait(false) ?? throw new HttpRequestException(SR.net_http_null_from_connect_callback);
}
else
{
// Otherwise, create and connect a socket using default settings.
socket = new Socket(SocketType.Stream, ProtocolType.Tcp) { NoDelay = true };
if (async)
{
await socket.ConnectAsync(endPoint, cancellationToken).ConfigureAwait(false);
}
else
{
using (cancellationToken.UnsafeRegister(static s => ((Socket)s!).Dispose(), socket))
{
socket.Connect(endPoint);
}
}
stream = new NetworkStream(socket, ownsSocket: true);
}
return (socket, stream);
}
catch (Exception ex)
{
socket?.Dispose();
throw ex is OperationCanceledException oce && oce.CancellationToken == cancellationToken ?
CancellationHelper.CreateOperationCanceledException(innerException: null, cancellationToken) :
ConnectHelper.CreateWrappedException(ex, endPoint.Host, endPoint.Port, cancellationToken);
}
}
internal async ValueTask<HttpConnection> CreateHttp11ConnectionAsync(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
(Socket? socket, Stream stream, TransportContext? transportContext) = await ConnectAsync(request, async, cancellationToken).ConfigureAwait(false);
return await ConstructHttp11ConnectionAsync(async, socket, stream!, transportContext, request, cancellationToken).ConfigureAwait(false);
}
private SslClientAuthenticationOptions GetSslOptionsForRequest(HttpRequestMessage request)
{
if (_http2Enabled)
{
if (request.Version.Major >= 2 && request.VersionPolicy != HttpVersionPolicy.RequestVersionOrLower)
{
return _sslOptionsHttp2Only!;
}
if (request.Version.Major >= 2 || request.VersionPolicy == HttpVersionPolicy.RequestVersionOrHigher)
{
return _sslOptionsHttp2!;
}
}
return _sslOptionsHttp11!;
}
private async ValueTask<Stream> ApplyPlaintextFilterAsync(bool async, Stream stream, Version httpVersion, HttpRequestMessage request, CancellationToken cancellationToken)
{
if (Settings._plaintextStreamFilter is null)
{
return stream;
}
Stream newStream;
try
{
ValueTask<Stream> streamTask = Settings._plaintextStreamFilter(new SocketsHttpPlaintextStreamFilterContext(stream, httpVersion, request), cancellationToken);
if (!async && !streamTask.IsCompleted)
{
// User-provided PlaintextStreamFilter is completing asynchronously but the user is making a synchronous request; if the user cares, they should
// set it up so that synchronous requests are made on a handler with a synchronously-completing PlaintextStreamFilter supplied. If in the future,
// we could add a Boolean to SocketsHttpPlaintextStreamFilterContext (https://github.com/dotnet/runtime/issues/44876) to let the callback know whether
// this request is sync or async.
Trace($"{nameof(SocketsHttpHandler.PlaintextStreamFilter)} completing asynchronously for a synchronous request.");
}
newStream = await streamTask.ConfigureAwait(false);
}
catch (OperationCanceledException oce) when (oce.CancellationToken == cancellationToken)
{
stream.Dispose();
throw;
}
catch (Exception e)
{
stream.Dispose();
throw new HttpRequestException(SR.net_http_exception_during_plaintext_filter, e);
}
if (newStream == null)
{
stream.Dispose();
throw new HttpRequestException(SR.net_http_null_from_plaintext_filter);
}
return newStream;
}
private async ValueTask<HttpConnection> ConstructHttp11ConnectionAsync(bool async, Socket? socket, Stream stream, TransportContext? transportContext, HttpRequestMessage request, CancellationToken cancellationToken)
{
Stream newStream = await ApplyPlaintextFilterAsync(async, stream, HttpVersion.Version11, request, cancellationToken).ConfigureAwait(false);
if (newStream != stream)
{
// If a plaintext filter created a new stream, we can't trust that the socket is still applicable.
socket = null;
}
return new HttpConnection(this, socket, newStream, transportContext);
}
private async ValueTask<Http2Connection> ConstructHttp2ConnectionAsync(Stream stream, HttpRequestMessage request, CancellationToken cancellationToken)
{
stream = await ApplyPlaintextFilterAsync(async: true, stream, HttpVersion.Version20, request, cancellationToken).ConfigureAwait(false);
Http2Connection http2Connection = new Http2Connection(this, stream);
try
{
await http2Connection.SetupAsync().ConfigureAwait(false);
}
catch (Exception e)
{
// Note, SetupAsync will dispose the connection if there is an exception.
throw new HttpRequestException(SR.net_http_client_execution_error, e);
}
return http2Connection;
}
private async ValueTask<Stream> EstablishProxyTunnelAsync(bool async, HttpRequestHeaders? headers, CancellationToken cancellationToken)
{
Debug.Assert(_originAuthority != null);
// Send a CONNECT request to the proxy server to establish a tunnel.
HttpRequestMessage tunnelRequest = new HttpRequestMessage(HttpMethod.Connect, _proxyUri);
tunnelRequest.Headers.Host = $"{_originAuthority.IdnHost}:{_originAuthority.Port}"; // This specifies destination host/port to connect to
if (headers != null && headers.TryGetValues(HttpKnownHeaderNames.UserAgent, out IEnumerable<string>? values))
{
tunnelRequest.Headers.TryAddWithoutValidation(HttpKnownHeaderNames.UserAgent, values);
}
HttpResponseMessage tunnelResponse = await _poolManager.SendProxyConnectAsync(tunnelRequest, _proxyUri!, async, cancellationToken).ConfigureAwait(false);
if (tunnelResponse.StatusCode != HttpStatusCode.OK)
{
tunnelResponse.Dispose();
throw new HttpRequestException(SR.Format(SR.net_http_proxy_tunnel_returned_failure_status_code, _proxyUri, (int)tunnelResponse.StatusCode));
}
try
{
return tunnelResponse.Content.ReadAsStream(cancellationToken);
}
catch
{
tunnelResponse.Dispose();
throw;
}
}
private async ValueTask<(Socket? socket, Stream stream)> EstablishSocksTunnel(HttpRequestMessage request, bool async, CancellationToken cancellationToken)
{
Debug.Assert(_originAuthority != null);
Debug.Assert(_proxyUri != null);
(Socket? socket, Stream stream) = await ConnectToTcpHostAsync(_proxyUri.IdnHost, _proxyUri.Port, request, async, cancellationToken).ConfigureAwait(false);
try
{
await SocksHelper.EstablishSocksTunnelAsync(stream, _originAuthority.IdnHost, _originAuthority.Port, _proxyUri, ProxyCredentials, async, cancellationToken).ConfigureAwait(false);
}
catch (Exception e) when (!(e is OperationCanceledException))
{
Debug.Assert(!(e is HttpRequestException));
throw new HttpRequestException(SR.net_http_request_aborted, e);
}
return (socket, stream);
}
private void HandleHttp11ConnectionFailure(HttpRequestMessage request, Exception e)
{
if (NetEventSource.Log.IsEnabled()) Trace("HTTP/1.1 connection failed");
bool failRequest;
TaskCompletionSourceWithCancellation<HttpConnection>? waiter;
lock (SyncObj)
{
Debug.Assert(_associatedHttp11ConnectionCount > 0);
Debug.Assert(_pendingHttp11ConnectionCount > 0);
_associatedHttp11ConnectionCount--;
_pendingHttp11ConnectionCount--;
// If the request that caused this connection attempt is still pending, fail it.
// Otherwise, the request must have been canceled or satisfied by another connection already.
failRequest = _http11RequestQueue.TryDequeueWaiterForSpecificRequest(request, out waiter);
CheckForHttp11ConnectionInjection();
}
if (failRequest)
{
// This may fail if the request was already canceled, but we don't care.
Debug.Assert(waiter is not null);
bool succeeded = waiter.TrySetException(e);
Debug.Assert(succeeded || waiter.Task.IsCanceled);
}
}
private void HandleHttp2ConnectionFailure(HttpRequestMessage request, Exception e)
{
if (NetEventSource.Log.IsEnabled()) Trace("HTTP2 connection failed");
bool failRequest;
TaskCompletionSourceWithCancellation<Http2Connection?>? waiter;
lock (SyncObj)
{
Debug.Assert(_associatedHttp2ConnectionCount > 0);
Debug.Assert(_pendingHttp2Connection);
_associatedHttp2ConnectionCount--;
_pendingHttp2Connection = false;
// If the request that caused this connection attempt is still pending, fail it.
// Otherwise, the request must have been canceled or satisfied by another connection already.
failRequest = _http2RequestQueue.TryDequeueWaiterForSpecificRequest(request, out waiter);
CheckForHttp2ConnectionInjection();
}
if (failRequest)
{
// This may fail if the request was already canceled, but we don't care.
Debug.Assert(waiter is not null);
bool succeeded = waiter.TrySetException(e);
Debug.Assert(succeeded || waiter.Task.IsCanceled);
}
}
/// <summary>
/// Called when an HttpConnection from this pool is no longer usable.
/// Note, this is always called from HttpConnection.Dispose, which is a bit different than how HTTP2 works.
/// </summary>
public void InvalidateHttp11Connection(HttpConnection connection, bool disposing = true)
{
lock (SyncObj)
{
Debug.Assert(_associatedHttp11ConnectionCount > 0);
Debug.Assert(!disposing || !_availableHttp11Connections.Contains(connection));
_associatedHttp11ConnectionCount--;
CheckForHttp11ConnectionInjection();
}
}
/// <summary>
/// Called when an Http2Connection from this pool is no longer usable.
/// </summary>
public void InvalidateHttp2Connection(Http2Connection connection)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("");
bool found = false;
lock (SyncObj)
{
if (_availableHttp2Connections is not null)
{
Debug.Assert(_associatedHttp2ConnectionCount >= _availableHttp2Connections.Count);
int index = _availableHttp2Connections.IndexOf(connection);
if (index != -1)
{
found = true;
_availableHttp2Connections.RemoveAt(index);
_associatedHttp2ConnectionCount--;
}
}
CheckForHttp2ConnectionInjection();
}
// If we found the connection in the available list, then dispose it now.
// Otherwise, when we try to put it back in the pool, we will see it is shut down and dispose it (and adjust connection counts).
if (found)
{
connection.Dispose();
}
}
private bool CheckExpirationOnReturn(HttpConnectionBase connection)
{
TimeSpan lifetime = _poolManager.Settings._pooledConnectionLifetime;
if (lifetime != Timeout.InfiniteTimeSpan)
{
return lifetime == TimeSpan.Zero || connection.GetLifetimeTicks(Environment.TickCount64) > lifetime.TotalMilliseconds;
}
return false;
}
public void ReturnHttp11Connection(HttpConnection connection, bool isNewConnection = false)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"{nameof(isNewConnection)}={isNewConnection}");
if (!isNewConnection && CheckExpirationOnReturn(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP/1.1 connection return to pool. Connection lifetime expired.");
connection.Dispose();
return;
}
// Loop in case we get a cancelled request.
while (true)
{
TaskCompletionSourceWithCancellation<HttpConnection>? waiter = null;
bool added = false;
lock (SyncObj)
{
Debug.Assert(!_availableHttp11Connections.Contains(connection), $"Connection already in available list");
Debug.Assert(_associatedHttp11ConnectionCount > _availableHttp11Connections.Count,
$"Expected _associatedHttp11ConnectionCount={_associatedHttp11ConnectionCount} > _availableHttp11Connections.Count={_availableHttp11Connections.Count}");
Debug.Assert(_associatedHttp11ConnectionCount <= _maxHttp11Connections,
$"Expected _associatedHttp11ConnectionCount={_associatedHttp11ConnectionCount} <= _maxHttp11Connections={_maxHttp11Connections}");
if (isNewConnection)
{
Debug.Assert(_pendingHttp11ConnectionCount > 0);
_pendingHttp11ConnectionCount--;
isNewConnection = false;
}
if (_http11RequestQueue.TryDequeueWaiter(out waiter))
{
Debug.Assert(_availableHttp11Connections.Count == 0, $"With {_availableHttp11Connections.Count} available HTTP/1.1 connections, we shouldn't have a waiter.");
}
else if (!_disposed)
{
// Add connection to the pool.
added = true;
_availableHttp11Connections.Add(connection);
}
// If the pool has been disposed of, we will dispose the connection below outside the lock.
// We do this after processing the queue above so that any queued requests will be handled by existing connections if possible.
}
if (waiter is not null)
{
Debug.Assert(!added);
if (waiter.TrySetResult(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Dequeued waiting HTTP/1.1 request.");
return;
}
else
{
Debug.Assert(waiter.Task.IsCanceled);
if (NetEventSource.Log.IsEnabled()) connection.Trace("Discarding canceled HTTP/1.1 request from queue.");
// Loop and process the queue again
}
}
else if (added)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Put HTTP/1.1 connection in pool.");
return;
}
else
{
Debug.Assert(_disposed);
if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP/1.1 connection returned to pool. Pool was disposed.");
connection.Dispose();
return;
}
}
}
public void ReturnHttp2Connection(Http2Connection connection, HttpRequestMessage? request = null, bool isNewConnection = false)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"{nameof(isNewConnection)}={isNewConnection}");
Debug.Assert(isNewConnection || request is null, "Shouldn't have a request unless the connection is new");
if (!isNewConnection && CheckExpirationOnReturn(connection))
{
lock (SyncObj)
{
Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection));
Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0));
_associatedHttp2ConnectionCount--;
}
if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP2 connection return to pool. Connection lifetime expired.");
connection.Dispose();
return;
}
while (connection.TryReserveStream())
{
// Loop in case we get a cancelled request.
while (true)
{
TaskCompletionSourceWithCancellation<Http2Connection?>? waiter = null;
bool added = false;
lock (SyncObj)
{
Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection), $"HTTP2 connection already in available list");
Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0),
$"Expected _associatedHttp2ConnectionCount={_associatedHttp2ConnectionCount} > _availableHttp2Connections.Count={(_availableHttp2Connections?.Count ?? 0)}");
if (isNewConnection)
{
Debug.Assert(_pendingHttp2Connection);
_pendingHttp2Connection = false;
isNewConnection = false;
}
if (_http2RequestQueue.TryDequeueWaiter(out waiter))
{
Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"With {(_availableHttp2Connections?.Count ?? 0)} available HTTP2 connections, we shouldn't have a waiter.");
}
else if (_disposed)
{
// The pool has been disposed. We will dispose this connection below outside the lock.
// We do this check after processing the request queue so that any queued requests will be handled by existing connections if possible.
_associatedHttp2ConnectionCount--;
}
else
{
// Add connection to the pool.
added = true;
_availableHttp2Connections ??= new List<Http2Connection>();
_availableHttp2Connections.Add(connection);
}
}
if (waiter is not null)
{
Debug.Assert(!added);
if (waiter.TrySetResult(connection))
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Dequeued waiting HTTP2 request.");
break;
}
else
{
Debug.Assert(waiter.Task.IsCanceled);
if (NetEventSource.Log.IsEnabled()) connection.Trace("Discarding canceled HTTP2 request from queue.");
// Loop and process the queue again
}
}
else
{
connection.ReleaseStream();
if (added)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("Put HTTP2 connection in pool.");
return;
}
else
{
Debug.Assert(_disposed);
if (NetEventSource.Log.IsEnabled()) connection.Trace("Disposing HTTP2 connection returned to pool. Pool was disposed.");
connection.Dispose();
return;
}
}
}
}
if (isNewConnection)
{
Debug.Assert(request is not null, "Expect request for a new connection");
// The new connection could not handle even one request, either because it shut down before we could use it for any requests,
// or because it immediately set the max concurrent streams limit to 0.
// We don't want to get stuck in a loop where we keep trying to create new connections for the same request.
// So, treat this as a connection failure.
if (NetEventSource.Log.IsEnabled()) connection.Trace("New HTTP2 connection is unusable due to no available streams.");
connection.Dispose();
HttpRequestException hre = new HttpRequestException(SR.net_http_http2_connection_not_established);
ExceptionDispatchInfo.SetCurrentStackTrace(hre);
HandleHttp2ConnectionFailure(request, hre);
}
else
{
// Since we only inject one connection at a time, we may want to inject another now.
lock (SyncObj)
{
CheckForHttp2ConnectionInjection();
}
// We need to wait until the connection is usable again.
DisableHttp2Connection(connection);
}
}
/// <summary>
/// Disable usage of the specified connection because it cannot handle any more streams at the moment.
/// We will register to be notified when it can handle more streams (or becomes permanently unusable).
/// </summary>
private void DisableHttp2Connection(Http2Connection connection)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace("");
Task.Run(async () =>
{
bool usable = await connection.WaitForAvailableStreamsAsync().ConfigureAwait(false);
if (NetEventSource.Log.IsEnabled()) connection.Trace($"WaitForAvailableStreamsAsync completed, {nameof(usable)}={usable}");
if (usable)
{
ReturnHttp2Connection(connection, isNewConnection: false);
}
else
{
// Connection has shut down.
lock (SyncObj)
{
Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection));
Debug.Assert(_associatedHttp2ConnectionCount > 0);
_associatedHttp2ConnectionCount--;
CheckForHttp2ConnectionInjection();
}
if (NetEventSource.Log.IsEnabled()) connection.Trace("HTTP2 connection no longer usable");
connection.Dispose();
}
});
}
public void InvalidateHttp3Connection(Http3Connection connection)
{
lock (SyncObj)
{
if (_http3Connection == connection)
{
_http3Connection = null;
}
}
}
/// <summary>
/// Disposes the connection pool. This is only needed when the pool currently contains
/// or has associated connections.
/// </summary>
public void Dispose()
{
List<HttpConnectionBase>? toDispose = null;
lock (SyncObj)
{
if (!_disposed)
{
if (NetEventSource.Log.IsEnabled()) Trace("Disposing pool.");
_disposed = true;
toDispose = new List<HttpConnectionBase>(_availableHttp11Connections.Count + (_availableHttp2Connections?.Count ?? 0));
toDispose.AddRange(_availableHttp11Connections);
if (_availableHttp2Connections is not null)
{
toDispose.AddRange(_availableHttp2Connections);
}
// Note: Http11 connections will decrement the _associatedHttp11ConnectionCount when disposed.
// Http2 connections will not, hence the difference in handing _associatedHttp2ConnectionCount.
Debug.Assert(_associatedHttp11ConnectionCount >= _availableHttp11Connections.Count,
$"Expected {nameof(_associatedHttp11ConnectionCount)}={_associatedHttp11ConnectionCount} >= {nameof(_availableHttp11Connections)}.Count={_availableHttp11Connections.Count}");
_availableHttp11Connections.Clear();
Debug.Assert(_associatedHttp2ConnectionCount >= (_availableHttp2Connections?.Count ?? 0));
_associatedHttp2ConnectionCount -= (_availableHttp2Connections?.Count ?? 0);
_availableHttp2Connections?.Clear();
if (_http3Connection is not null)
{
toDispose.Add(_http3Connection);
_http3Connection = null;
}
if (_authorityExpireTimer != null)
{
_authorityExpireTimer.Dispose();
_authorityExpireTimer = null;
}
if (_altSvcBlocklistTimerCancellation != null)
{
_altSvcBlocklistTimerCancellation.Cancel();
_altSvcBlocklistTimerCancellation.Dispose();
_altSvcBlocklistTimerCancellation = null;
}
}
Debug.Assert(_availableHttp11Connections.Count == 0, $"Expected {nameof(_availableHttp11Connections)}.{nameof(_availableHttp11Connections.Count)} == 0");
Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0");
}
// Dispose outside the lock to avoid lock re-entrancy issues.
toDispose?.ForEach(c => c.Dispose());
}
/// <summary>
/// Removes any unusable connections from the pool, and if the pool
/// is then empty and stale, disposes of it.
/// </summary>
/// <returns>
/// true if the pool disposes of itself; otherwise, false.
/// </returns>
public bool CleanCacheAndDisposeIfUnused()
{
TimeSpan pooledConnectionLifetime = _poolManager.Settings._pooledConnectionLifetime;
TimeSpan pooledConnectionIdleTimeout = _poolManager.Settings._pooledConnectionIdleTimeout;
long nowTicks = Environment.TickCount64;
List<HttpConnectionBase>? toDispose = null;
lock (SyncObj)
{
// If there are now no connections associated with this pool, we can dispose of it. We
// avoid aggressively cleaning up pools that have recently been used but currently aren't;
// if a pool was used since the last time we cleaned up, give it another chance. New pools
// start out saying they've recently been used, to give them a bit of breathing room and time
// for the initial collection to be added to it.
if (!_usedSinceLastCleanup && _associatedHttp11ConnectionCount == 0 && _associatedHttp2ConnectionCount == 0)
{
_disposed = true;
return true; // Pool is disposed of. It should be removed.
}
// Reset the cleanup flag. Any pools that are empty and not used since the last cleanup
// will be purged next time around.
_usedSinceLastCleanup = false;
ScavengeConnectionList(_availableHttp11Connections, ref toDispose, nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout);
if (_availableHttp2Connections is not null)
{
int removed = ScavengeConnectionList(_availableHttp2Connections, ref toDispose, nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout);
_associatedHttp2ConnectionCount -= removed;
// Note: Http11 connections will decrement the _associatedHttp11ConnectionCount when disposed.
// Http2 connections will not, hence the difference in handing _associatedHttp2ConnectionCount.
}
}
// Dispose the stale connections outside the pool lock, to avoid holding the lock too long.
// Dispose them asynchronously to not to block the caller on closing the SslStream or NetworkStream.
if (toDispose is not null)
{
Task.Factory.StartNew(static s => ((List<HttpConnectionBase>)s!).ForEach(c => c.Dispose()), toDispose,
CancellationToken.None, TaskCreationOptions.DenyChildAttach, TaskScheduler.Default);
}
// Pool is active. Should not be removed.
return false;
static int ScavengeConnectionList<T>(List<T> list, ref List<HttpConnectionBase>? toDispose, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout)
where T : HttpConnectionBase
{
int freeIndex = 0;
while (freeIndex < list.Count && IsUsableConnection(list[freeIndex], nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout))
{
freeIndex++;
}
// If freeIndex == list.Count, nothing needs to be removed.
// But if it's < list.Count, at least one connection needs to be purged.
int removed = 0;
if (freeIndex < list.Count)
{
// We know the connection at freeIndex is unusable, so dispose of it.
toDispose ??= new List<HttpConnectionBase>();
toDispose.Add(list[freeIndex]);
// Find the first item after the one to be removed that should be kept.
int current = freeIndex + 1;
while (current < list.Count)
{
// Look for the first item to be kept. Along the way, any
// that shouldn't be kept are disposed of.
while (current < list.Count && !IsUsableConnection(list[current], nowTicks, pooledConnectionLifetime, pooledConnectionIdleTimeout))
{
toDispose.Add(list[current]);
current++;
}
// If we found something to keep, copy it down to the known free slot.
if (current < list.Count)
{
// copy item to the free slot
list[freeIndex++] = list[current++];
}
// Keep going until there are no more good items.
}
// At this point, good connections have been moved below freeIndex, and garbage connections have
// been added to the dispose list, so clear the end of the list past freeIndex.
removed = list.Count - freeIndex;
list.RemoveRange(freeIndex, removed);
}
return removed;
}
static bool IsUsableConnection(HttpConnectionBase connection, long nowTicks, TimeSpan pooledConnectionLifetime, TimeSpan pooledConnectionIdleTimeout)
{
// Validate that the connection hasn't been idle in the pool for longer than is allowed.
if (pooledConnectionIdleTimeout != Timeout.InfiniteTimeSpan)
{
long idleTicks = connection.GetIdleTicks(nowTicks);
if (idleTicks > pooledConnectionIdleTimeout.TotalMilliseconds)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"Scavenging connection. Idle {TimeSpan.FromMilliseconds(idleTicks)} > {pooledConnectionIdleTimeout}.");
return false;
}
}
// Validate that the connection lifetime has not been exceeded.
if (pooledConnectionLifetime != Timeout.InfiniteTimeSpan)
{
long lifetimeTicks = connection.GetLifetimeTicks(nowTicks);
if (lifetimeTicks > pooledConnectionLifetime.TotalMilliseconds)
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"Scavenging connection. Lifetime {TimeSpan.FromMilliseconds(lifetimeTicks)} > {pooledConnectionLifetime}.");
return false;
}
}
if (!connection.CheckUsabilityOnScavenge())
{
if (NetEventSource.Log.IsEnabled()) connection.Trace($"Scavenging connection. Unexpected data or EOF received.");
return false;
}
return true;
}
}
/// <summary>Gets whether we're running on Windows 7 or Windows 2008 R2.</summary>
private static bool GetIsWindows7Or2008R2()
{
OperatingSystem os = Environment.OSVersion;
if (os.Platform == PlatformID.Win32NT)
{
// Both Windows 7 and Windows 2008 R2 report version 6.1.
Version v = os.Version;
return v.Major == 6 && v.Minor == 1;
}
return false;
}
internal void HeartBeat()
{
Http2Connection[]? localHttp2Connections;
lock (SyncObj)
{
localHttp2Connections = _availableHttp2Connections?.ToArray();
}
if (localHttp2Connections is not null)
{
foreach (Http2Connection http2Connection in localHttp2Connections)
{
http2Connection.HeartBeat();
}
}
}
// For diagnostic purposes
public override string ToString() =>
$"{nameof(HttpConnectionPool)} " +
(_proxyUri == null ?
(_sslOptionsHttp11 == null ?
$"http://{_originAuthority}" :
$"https://{_originAuthority}" + (_sslOptionsHttp11.TargetHost != _originAuthority!.IdnHost ? $", SSL TargetHost={_sslOptionsHttp11.TargetHost}" : null)) :
(_sslOptionsHttp11 == null ?
$"Proxy {_proxyUri}" :
$"https://{_originAuthority}/ tunnelled via Proxy {_proxyUri}" + (_sslOptionsHttp11.TargetHost != _originAuthority!.IdnHost ? $", SSL TargetHost={_sslOptionsHttp11.TargetHost}" : null)));
private void Trace(string? message, [CallerMemberName] string? memberName = null) =>
NetEventSource.Log.HandlerMessage(
GetHashCode(), // pool ID
0, // connection ID
0, // request ID
memberName, // method name
message); // message
private struct RequestQueue<T>
{
private struct QueueItem
{
public HttpRequestMessage Request;
public TaskCompletionSourceWithCancellation<T> Waiter;
}
private Queue<QueueItem>? _queue;
public TaskCompletionSourceWithCancellation<T> EnqueueRequest(HttpRequestMessage request)
{
if (_queue is null)
{
_queue = new Queue<QueueItem>();
}
TaskCompletionSourceWithCancellation<T> waiter = new TaskCompletionSourceWithCancellation<T>();
_queue.Enqueue(new QueueItem { Request = request, Waiter = waiter });
return waiter;
}
public bool TryDequeueWaiterForSpecificRequest(HttpRequestMessage request, [MaybeNullWhen(false)] out TaskCompletionSourceWithCancellation<T> waiter)
{
if (_queue is not null && _queue.TryPeek(out QueueItem item) && item.Request == request)
{
_queue.Dequeue();
waiter = item.Waiter;
return true;
}
waiter = null;
return false;
}
public bool TryDequeueWaiter([MaybeNullWhen(false)] out TaskCompletionSourceWithCancellation<T> waiter)
{
if (_queue is not null && _queue.TryDequeue(out QueueItem item))
{
waiter = item.Waiter;
return true;
}
waiter = null;
return false;
}
public bool TryPeekRequest([MaybeNullWhen(false)] out HttpRequestMessage request)
{
if (_queue is not null && _queue.TryPeek(out QueueItem item))
{
request = item.Request;
return true;
}
request = null;
return false;
}
public int Count => (_queue?.Count ?? 0);
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.HttpListener/src/System/Net/Windows/WebSockets/WebSocketBase.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.WebSockets
{
internal abstract class WebSocketBase : WebSocket, IDisposable
{
private readonly OutstandingOperationHelper _closeOutstandingOperationHelper;
private readonly OutstandingOperationHelper _closeOutputOutstandingOperationHelper;
private readonly OutstandingOperationHelper _receiveOutstandingOperationHelper;
private readonly OutstandingOperationHelper _sendOutstandingOperationHelper;
private readonly Stream _innerStream;
private readonly IWebSocketStream? _innerStreamAsWebSocketStream;
private readonly string? _subProtocol;
// We are not calling Dispose method on this object in Cleanup method to avoid a race condition while one thread is calling disposing on
// this object and another one is still using WaitAsync. According to Dev11 358715, this should be fine as long as we are not accessing the
// AvailableWaitHandle on this SemaphoreSlim object.
private readonly SemaphoreSlim _sendFrameThrottle;
// locking _ThisLock protects access to
// - State
// - _closeAsyncStartedReceive
// - _closeReceivedTaskCompletionSource
// - _closeNetworkConnectionTask
private readonly object _thisLock;
private readonly WebSocketBuffer _internalBuffer;
private readonly KeepAliveTracker _keepAliveTracker;
private volatile bool _cleanedUp;
private volatile TaskCompletionSource? _closeReceivedTaskCompletionSource;
private volatile Task? _closeOutputTask;
private volatile bool _isDisposed;
private volatile Task? _closeNetworkConnectionTask;
private volatile bool _closeAsyncStartedReceive;
private volatile WebSocketState _state;
private volatile Task? _keepAliveTask;
private volatile WebSocketOperation.ReceiveOperation? _receiveOperation;
private volatile WebSocketOperation.SendOperation? _sendOperation;
private volatile WebSocketOperation.SendOperation? _keepAliveOperation;
private volatile WebSocketOperation.CloseOutputOperation? _closeOutputOperation;
private Nullable<WebSocketCloseStatus> _closeStatus;
private string? _closeStatusDescription;
private int _receiveState;
private Exception? _pendingException;
protected WebSocketBase(Stream innerStream,
string? subProtocol,
TimeSpan keepAliveInterval,
WebSocketBuffer internalBuffer)
{
Debug.Assert(internalBuffer != null, "'internalBuffer' MUST NOT be NULL.");
HttpWebSocket.ValidateInnerStream(innerStream);
HttpWebSocket.ValidateOptions(subProtocol, internalBuffer.ReceiveBufferSize,
internalBuffer.SendBufferSize, keepAliveInterval);
_thisLock = new object();
_innerStream = innerStream;
_internalBuffer = internalBuffer;
if (NetEventSource.Log.IsEnabled())
{
NetEventSource.Associate(this, _innerStream);
NetEventSource.Associate(this, _internalBuffer);
}
_closeOutstandingOperationHelper = new OutstandingOperationHelper();
_closeOutputOutstandingOperationHelper = new OutstandingOperationHelper();
_receiveOutstandingOperationHelper = new OutstandingOperationHelper();
_sendOutstandingOperationHelper = new OutstandingOperationHelper();
_state = WebSocketState.Open;
_subProtocol = subProtocol;
_sendFrameThrottle = new SemaphoreSlim(1, 1);
_closeStatus = null;
_closeStatusDescription = null;
_innerStreamAsWebSocketStream = innerStream as IWebSocketStream;
if (_innerStreamAsWebSocketStream != null)
{
_innerStreamAsWebSocketStream.SwitchToOpaqueMode(this);
}
_keepAliveTracker = KeepAliveTracker.Create(keepAliveInterval);
}
public override WebSocketState State
{
get
{
Debug.Assert(_state != WebSocketState.None, "'_state' MUST NOT be 'WebSocketState.None'.");
return _state;
}
}
public override string? SubProtocol
{
get
{
return _subProtocol;
}
}
public override WebSocketCloseStatus? CloseStatus
{
get
{
return _closeStatus;
}
}
public override string? CloseStatusDescription
{
get
{
return _closeStatusDescription;
}
}
internal WebSocketBuffer InternalBuffer
{
get
{
Debug.Assert(_internalBuffer != null, "'_internalBuffer' MUST NOT be NULL.");
return _internalBuffer;
}
}
protected void StartKeepAliveTimer()
{
_keepAliveTracker.StartTimer(this);
}
// locking SessionHandle protects access to
// - WSPC (WebSocketProtocolComponent)
// - _KeepAliveTask
// - _closeOutputTask
// - _LastSendActivity
internal abstract SafeHandle SessionHandle { get; }
// MultiThreading: ThreadSafe; At most one outstanding call to ReceiveAsync is allowed
public override Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer,
CancellationToken cancellationToken)
{
WebSocketValidate.ValidateArraySegment(buffer, nameof(buffer));
return ReceiveAsyncCore(buffer, cancellationToken);
}
private async Task<WebSocketReceiveResult> ReceiveAsyncCore(ArraySegment<byte> buffer,
CancellationToken cancellationToken)
{
WebSocketReceiveResult receiveResult;
ThrowIfPendingException();
ThrowIfDisposed();
ThrowOnInvalidState(State, WebSocketState.Open, WebSocketState.CloseSent);
bool ownsCancellationTokenSource = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
ownsCancellationTokenSource = _receiveOutstandingOperationHelper.TryStartOperation(cancellationToken,
out linkedCancellationToken);
if (!ownsCancellationTokenSource)
{
lock (_thisLock)
{
if (_closeAsyncStartedReceive)
{
throw new InvalidOperationException(
SR.Format(SR.net_WebSockets_ReceiveAsyncDisallowedAfterCloseAsync, nameof(CloseAsync), nameof(CloseOutputAsync)));
}
throw new InvalidOperationException(
SR.Format(SR.net_Websockets_AlreadyOneOutstandingOperation, nameof(ReceiveAsync)));
}
}
EnsureReceiveOperation();
receiveResult = (await _receiveOperation!.Process(buffer, linkedCancellationToken).SuppressContextFlow())!;
if (NetEventSource.Log.IsEnabled() && receiveResult.Count > 0)
{
NetEventSource.DumpBuffer(this, buffer.Array!, buffer.Offset, receiveResult.Count);
}
}
catch (Exception exception)
{
bool aborted = linkedCancellationToken.IsCancellationRequested;
Abort();
ThrowIfConvertibleException(nameof(ReceiveAsync), exception, cancellationToken, aborted);
throw;
}
finally
{
_receiveOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
}
return receiveResult;
}
// MultiThreading: ThreadSafe; At most one outstanding call to SendAsync is allowed
public override Task SendAsync(ArraySegment<byte> buffer,
WebSocketMessageType messageType,
bool endOfMessage,
CancellationToken cancellationToken)
{
if (messageType != WebSocketMessageType.Binary &&
messageType != WebSocketMessageType.Text)
{
throw new ArgumentException(SR.Format(SR.net_WebSockets_Argument_InvalidMessageType,
messageType,
nameof(SendAsync),
WebSocketMessageType.Binary,
WebSocketMessageType.Text,
nameof(CloseOutputAsync)),
nameof(messageType));
}
WebSocketValidate.ValidateArraySegment(buffer, nameof(buffer));
return SendAsyncCore(buffer, messageType, endOfMessage, cancellationToken);
}
private async Task SendAsyncCore(ArraySegment<byte> buffer,
WebSocketMessageType messageType,
bool endOfMessage,
CancellationToken cancellationToken)
{
Debug.Assert(messageType == WebSocketMessageType.Binary || messageType == WebSocketMessageType.Text,
"'messageType' MUST be either 'WebSocketMessageType.Binary' or 'WebSocketMessageType.Text'.");
Debug.Assert(buffer.Array != null);
ThrowIfPendingException();
ThrowIfDisposed();
ThrowOnInvalidState(State, WebSocketState.Open, WebSocketState.CloseReceived);
bool ownsCancellationTokenSource = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
while (!(ownsCancellationTokenSource = _sendOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken)))
{
Task? keepAliveTask;
lock (SessionHandle)
{
keepAliveTask = _keepAliveTask;
if (keepAliveTask == null)
{
// Check whether there is still another outstanding send operation
// Potentially the keepAlive operation has completed before this thread
// was able to enter the SessionHandle-lock.
_sendOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
if (ownsCancellationTokenSource = _sendOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken))
{
break;
}
else
{
throw new InvalidOperationException(
SR.Format(SR.net_Websockets_AlreadyOneOutstandingOperation, nameof(SendAsync)));
}
}
}
await keepAliveTask.SuppressContextFlow();
ThrowIfPendingException();
_sendOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
}
if (NetEventSource.Log.IsEnabled() && buffer.Count > 0)
{
NetEventSource.DumpBuffer(this, buffer.Array, buffer.Offset, buffer.Count);
}
EnsureSendOperation();
_sendOperation!.BufferType = GetBufferType(messageType, endOfMessage);
await _sendOperation.Process(buffer, linkedCancellationToken).SuppressContextFlow();
}
catch (Exception exception)
{
bool aborted = linkedCancellationToken.IsCancellationRequested;
Abort();
ThrowIfConvertibleException(nameof(SendAsync), exception, cancellationToken, aborted);
throw;
}
finally
{
_sendOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
}
}
private async Task SendFrameAsync(IList<ArraySegment<byte>> sendBuffers, CancellationToken cancellationToken)
{
bool sendFrameLockTaken = false;
try
{
await _sendFrameThrottle.WaitAsync(cancellationToken).SuppressContextFlow();
sendFrameLockTaken = true;
if (sendBuffers.Count > 1 &&
_innerStreamAsWebSocketStream != null &&
_innerStreamAsWebSocketStream.SupportsMultipleWrite)
{
await _innerStreamAsWebSocketStream.MultipleWriteAsync(sendBuffers,
cancellationToken).SuppressContextFlow();
}
else
{
foreach (ArraySegment<byte> buffer in sendBuffers)
{
await _innerStream.WriteAsync(buffer.Array!,
buffer.Offset,
buffer.Count,
cancellationToken).SuppressContextFlow();
}
}
}
catch (ObjectDisposedException objectDisposedException)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, objectDisposedException);
}
catch (NotSupportedException notSupportedException)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, notSupportedException);
}
finally
{
if (sendFrameLockTaken)
{
_sendFrameThrottle.Release();
}
}
}
// MultiThreading: ThreadSafe; No-op if already in a terminal state
public override void Abort()
{
bool thisLockTaken = false;
bool sessionHandleLockTaken = false;
try
{
if (IsStateTerminal(State))
{
return;
}
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
if (IsStateTerminal(State))
{
return;
}
_state = WebSocketState.Aborted;
// Abort any outstanding IO operations.
if (SessionHandle != null && !SessionHandle.IsClosed && !SessionHandle.IsInvalid)
{
WebSocketProtocolComponent.WebSocketAbortHandle(SessionHandle);
}
_receiveOutstandingOperationHelper.CancelIO();
_sendOutstandingOperationHelper.CancelIO();
_closeOutputOutstandingOperationHelper.CancelIO();
_closeOutstandingOperationHelper.CancelIO();
if (_innerStreamAsWebSocketStream != null)
{
_innerStreamAsWebSocketStream.Abort();
}
CleanUp();
}
finally
{
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
}
// MultiThreading: ThreadSafe; No-op if already in a terminal state
public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus,
string? statusDescription,
CancellationToken cancellationToken)
{
WebSocketValidate.ValidateCloseStatus(closeStatus, statusDescription);
return CloseOutputAsyncCore(closeStatus, statusDescription!, cancellationToken);
}
private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus,
string statusDescription,
CancellationToken cancellationToken)
{
ThrowIfPendingException();
if (IsStateTerminal(State))
{
return;
}
ThrowIfDisposed();
bool thisLockTaken = false;
bool sessionHandleLockTaken = false;
bool needToCompleteSendOperation = false;
bool ownsCloseOutputCancellationTokenSource = false;
bool ownsSendCancellationTokenSource = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
ThrowIfPendingException();
ThrowIfDisposed();
if (IsStateTerminal(State))
{
return;
}
ThrowOnInvalidState(State, WebSocketState.Open, WebSocketState.CloseReceived);
ownsCloseOutputCancellationTokenSource = _closeOutputOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken);
if (!ownsCloseOutputCancellationTokenSource)
{
Task? closeOutputTask = _closeOutputTask;
if (closeOutputTask != null)
{
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
await closeOutputTask.SuppressContextFlow();
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
}
else
{
needToCompleteSendOperation = true;
while (!(ownsSendCancellationTokenSource =
_sendOutstandingOperationHelper.TryStartOperation(cancellationToken,
out linkedCancellationToken)))
{
if (_keepAliveTask != null)
{
Task keepAliveTask = _keepAliveTask;
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
await keepAliveTask.SuppressContextFlow();
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
ThrowIfPendingException();
}
else
{
throw new InvalidOperationException(
SR.Format(SR.net_Websockets_AlreadyOneOutstandingOperation, nameof(SendAsync)));
}
_sendOutstandingOperationHelper.CompleteOperation(ownsSendCancellationTokenSource);
}
EnsureCloseOutputOperation();
_closeOutputOperation!.CloseStatus = closeStatus;
_closeOutputOperation!.CloseReason = statusDescription;
_closeOutputTask = _closeOutputOperation!.Process(null, linkedCancellationToken);
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
await _closeOutputTask.SuppressContextFlow();
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
if (OnCloseOutputCompleted())
{
bool callCompleteOnCloseCompleted = false;
try
{
callCompleteOnCloseCompleted = await StartOnCloseCompleted(
thisLockTaken, sessionHandleLockTaken, linkedCancellationToken).SuppressContextFlow();
}
catch (Exception)
{
// If an exception is thrown we know that the locks have been released,
// because we enforce IWebSocketStream.CloseNetworkConnectionAsync to yield
ResetFlagsAndTakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
throw;
}
if (callCompleteOnCloseCompleted)
{
ResetFlagsAndTakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
FinishOnCloseCompleted();
}
}
}
}
catch (Exception exception)
{
bool aborted = linkedCancellationToken.IsCancellationRequested;
Abort();
ThrowIfConvertibleException(nameof(CloseOutputAsync), exception, cancellationToken, aborted);
throw;
}
finally
{
_closeOutputOutstandingOperationHelper.CompleteOperation(ownsCloseOutputCancellationTokenSource);
if (needToCompleteSendOperation)
{
_sendOutstandingOperationHelper.CompleteOperation(ownsSendCancellationTokenSource);
}
_closeOutputTask = null;
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
}
// returns TRUE if the caller should also call StartOnCloseCompleted
private bool OnCloseOutputCompleted()
{
if (IsStateTerminal(State))
{
return false;
}
switch (State)
{
case WebSocketState.Open:
_state = WebSocketState.CloseSent;
return false;
case WebSocketState.CloseReceived:
return true;
default:
return false;
}
}
// MultiThreading: This method has to be called under a _ThisLock-lock
// ReturnValue: This method returns true only if CompleteOnCloseCompleted needs to be called
// If this method returns true all locks were released before starting the IO operation
// and they have to be retaken by the caller before calling CompleteOnCloseCompleted
// Exception handling: If an exception is thrown from await StartOnCloseCompleted
// it always means the locks have been released already - so the caller has to retake the
// locks in the catch-block.
// This is ensured by enforcing a Task.Yield for IWebSocketStream.CloseNetowrkConnectionAsync
private async Task<bool> StartOnCloseCompleted(bool thisLockTakenSnapshot,
bool sessionHandleLockTakenSnapshot,
CancellationToken cancellationToken)
{
Debug.Assert(thisLockTakenSnapshot, "'thisLockTakenSnapshot' MUST be 'true' at this point.");
if (IsStateTerminal(_state))
{
return false;
}
_state = WebSocketState.Closed;
if (_innerStreamAsWebSocketStream != null)
{
bool thisLockTaken = thisLockTakenSnapshot;
bool sessionHandleLockTaken = sessionHandleLockTakenSnapshot;
try
{
if (_closeNetworkConnectionTask == null)
{
_closeNetworkConnectionTask =
_innerStreamAsWebSocketStream.CloseNetworkConnectionAsync(cancellationToken);
}
if (thisLockTaken && sessionHandleLockTaken)
{
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
else if (thisLockTaken)
{
ReleaseLock(_thisLock, ref thisLockTaken);
}
await _closeNetworkConnectionTask.SuppressContextFlow();
}
catch (Exception closeNetworkConnectionTaskException)
{
if (!CanHandleExceptionDuringClose(closeNetworkConnectionTaskException))
{
ThrowIfConvertibleException(nameof(StartOnCloseCompleted),
closeNetworkConnectionTaskException,
cancellationToken,
cancellationToken.IsCancellationRequested);
throw;
}
}
}
return true;
}
// MultiThreading: This method has to be called under a thisLock-lock
private void FinishOnCloseCompleted()
{
CleanUp();
}
// MultiThreading: ThreadSafe; No-op if already in a terminal state
public override Task CloseAsync(WebSocketCloseStatus closeStatus,
string? statusDescription,
CancellationToken cancellationToken)
{
WebSocketValidate.ValidateCloseStatus(closeStatus, statusDescription);
return CloseAsyncCore(closeStatus, statusDescription, cancellationToken);
}
private async Task CloseAsyncCore(WebSocketCloseStatus closeStatus,
string? statusDescription,
CancellationToken cancellationToken)
{
ThrowIfPendingException();
if (IsStateTerminal(State))
{
return;
}
ThrowIfDisposed();
bool lockTaken = false;
Monitor.Enter(_thisLock, ref lockTaken);
bool ownsCloseCancellationTokenSource = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
ThrowIfPendingException();
if (IsStateTerminal(State))
{
return;
}
ThrowIfDisposed();
ThrowOnInvalidState(State,
WebSocketState.Open, WebSocketState.CloseReceived, WebSocketState.CloseSent);
Task? closeOutputTask;
ownsCloseCancellationTokenSource = _closeOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken);
if (ownsCloseCancellationTokenSource)
{
closeOutputTask = _closeOutputTask;
if (closeOutputTask == null && State != WebSocketState.CloseSent)
{
_closeReceivedTaskCompletionSource ??= new TaskCompletionSource();
closeOutputTask = CloseOutputAsync(closeStatus,
statusDescription,
linkedCancellationToken);
}
}
else
{
Debug.Assert(_closeReceivedTaskCompletionSource != null, "'_closeReceivedTaskCompletionSource' MUST NOT be NULL.");
closeOutputTask = _closeReceivedTaskCompletionSource.Task;
}
if (closeOutputTask != null)
{
ReleaseLock(_thisLock, ref lockTaken);
try
{
await closeOutputTask.SuppressContextFlow();
}
catch (Exception closeOutputError)
{
Monitor.Enter(_thisLock, ref lockTaken);
if (!CanHandleExceptionDuringClose(closeOutputError))
{
ThrowIfConvertibleException(nameof(CloseOutputAsync),
closeOutputError,
cancellationToken,
linkedCancellationToken.IsCancellationRequested);
throw;
}
}
// When closeOutputTask != null and an exception thrown from await closeOutputTask is handled,
// the lock will be taken in the catch-block. So the logic here avoids taking the lock twice.
if (!lockTaken)
{
Monitor.Enter(_thisLock, ref lockTaken);
}
}
if (OnCloseOutputCompleted())
{
bool callCompleteOnCloseCompleted = false;
try
{
// linkedCancellationToken can be CancellationToken.None if ownsCloseCancellationTokenSource==false
// This is still ok because OnCloseOutputCompleted won't start any IO operation in this case
callCompleteOnCloseCompleted = await StartOnCloseCompleted(
lockTaken, false, linkedCancellationToken).SuppressContextFlow();
}
catch (Exception)
{
// If an exception is thrown we know that the locks have been released,
// because we enforce IWebSocketStream.CloseNetworkConnectionAsync to yield
ResetFlagAndTakeLock(_thisLock, ref lockTaken);
throw;
}
if (callCompleteOnCloseCompleted)
{
ResetFlagAndTakeLock(_thisLock, ref lockTaken);
FinishOnCloseCompleted();
}
}
if (IsStateTerminal(State))
{
return;
}
linkedCancellationToken = CancellationToken.None;
bool ownsReceiveCancellationTokenSource = _receiveOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken);
if (ownsReceiveCancellationTokenSource)
{
_closeAsyncStartedReceive = true;
ArraySegment<byte> closeMessageBuffer =
new ArraySegment<byte>(new byte[HttpWebSocket.MinReceiveBufferSize]);
EnsureReceiveOperation();
Task<WebSocketReceiveResult?> receiveAsyncTask = _receiveOperation!.Process(closeMessageBuffer,
linkedCancellationToken);
ReleaseLock(_thisLock, ref lockTaken);
WebSocketReceiveResult? receiveResult = null;
try
{
receiveResult = await receiveAsyncTask.SuppressContextFlow();
}
catch (Exception receiveException)
{
Monitor.Enter(_thisLock, ref lockTaken);
if (!CanHandleExceptionDuringClose(receiveException))
{
ThrowIfConvertibleException(nameof(CloseAsync),
receiveException,
cancellationToken,
linkedCancellationToken.IsCancellationRequested);
throw;
}
}
// receiveResult is NEVER NULL if WebSocketBase.ReceiveOperation.Process completes successfully
// - but in the close code path we handle some exception if another thread was able to tranistion
// the state into Closed successfully. In this case receiveResult can be NULL and it is safe to
// skip the statements in the if-block.
if (receiveResult != null)
{
if (NetEventSource.Log.IsEnabled() && receiveResult.Count > 0)
{
NetEventSource.DumpBuffer(this, closeMessageBuffer.Array!, closeMessageBuffer.Offset, receiveResult.Count);
}
if (receiveResult.MessageType != WebSocketMessageType.Close)
{
throw new WebSocketException(WebSocketError.InvalidMessageType,
SR.Format(SR.net_WebSockets_InvalidMessageType,
nameof(WebSocket) + "." + nameof(CloseAsync),
nameof(WebSocket) + "." + nameof(CloseOutputAsync),
receiveResult.MessageType));
}
}
}
else
{
_receiveOutstandingOperationHelper.CompleteOperation(ownsReceiveCancellationTokenSource);
ReleaseLock(_thisLock, ref lockTaken);
await _closeReceivedTaskCompletionSource!.Task.SuppressContextFlow();
}
// When ownsReceiveCancellationTokenSource is true and an exception is thrown, the lock will be taken.
// So this logic here is to avoid taking the lock twice.
if (!lockTaken)
{
Monitor.Enter(_thisLock, ref lockTaken);
}
if (!IsStateTerminal(State))
{
bool ownsSendCancellationSource = false;
try
{
// We know that the CloseFrame has been sent at this point. So no Send-operation is allowed anymore and we
// can hijack the _SendOutstandingOperationHelper to create a linkedCancellationToken
ownsSendCancellationSource = _sendOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken);
Debug.Assert(ownsSendCancellationSource, "'ownsSendCancellationSource' MUST be 'true' at this point.");
bool callCompleteOnCloseCompleted = false;
try
{
// linkedCancellationToken can be CancellationToken.None if ownsCloseCancellationTokenSource==false
// This is still ok because OnCloseOutputCompleted won't start any IO operation in this case
callCompleteOnCloseCompleted = await StartOnCloseCompleted(
lockTaken, false, linkedCancellationToken).SuppressContextFlow();
}
catch (Exception)
{
// If an exception is thrown we know that the locks have been released,
// because we enforce IWebSocketStream.CloseNetworkConnectionAsync to yield
ResetFlagAndTakeLock(_thisLock, ref lockTaken);
throw;
}
if (callCompleteOnCloseCompleted)
{
ResetFlagAndTakeLock(_thisLock, ref lockTaken);
FinishOnCloseCompleted();
}
}
finally
{
_sendOutstandingOperationHelper.CompleteOperation(ownsSendCancellationSource);
}
}
}
catch (Exception exception)
{
bool aborted = linkedCancellationToken.IsCancellationRequested;
Abort();
ThrowIfConvertibleException(nameof(CloseAsync), exception, cancellationToken, aborted);
throw;
}
finally
{
_closeOutstandingOperationHelper.CompleteOperation(ownsCloseCancellationTokenSource);
ReleaseLock(_thisLock, ref lockTaken);
}
}
// MultiThreading: ThreadSafe; No-op if already in a terminal state
public override void Dispose()
{
if (_isDisposed)
{
return;
}
bool thisLockTaken = false;
bool sessionHandleLockTaken = false;
try
{
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
if (_isDisposed)
{
return;
}
if (!IsStateTerminal(State))
{
Abort();
}
else
{
CleanUp();
}
_isDisposed = true;
}
finally
{
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
}
private void ResetFlagAndTakeLock(object lockObject, ref bool thisLockTaken)
{
Debug.Assert(lockObject != null, "'lockObject' MUST NOT be NULL.");
thisLockTaken = false;
Monitor.Enter(lockObject, ref thisLockTaken);
}
private void ResetFlagsAndTakeLocks(ref bool thisLockTaken, ref bool sessionHandleLockTaken)
{
thisLockTaken = false;
sessionHandleLockTaken = false;
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
private void TakeLocks(ref bool thisLockTaken, ref bool sessionHandleLockTaken)
{
Debug.Assert(_thisLock != null, "'_thisLock' MUST NOT be NULL.");
Debug.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL.");
Monitor.Enter(SessionHandle, ref sessionHandleLockTaken);
Monitor.Enter(_thisLock, ref thisLockTaken);
}
private void ReleaseLocks(ref bool thisLockTaken, ref bool sessionHandleLockTaken)
{
Debug.Assert(_thisLock != null, "'_thisLock' MUST NOT be NULL.");
Debug.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL.");
if (thisLockTaken)
{
Monitor.Exit(_thisLock);
thisLockTaken = false;
}
if (sessionHandleLockTaken)
{
Monitor.Exit(SessionHandle);
sessionHandleLockTaken = false;
}
}
private void EnsureReceiveOperation()
{
if (_receiveOperation == null)
{
lock (_thisLock)
{
if (_receiveOperation == null)
{
_receiveOperation = new WebSocketOperation.ReceiveOperation(this);
}
}
}
}
private void EnsureSendOperation()
{
if (_sendOperation == null)
{
lock (_thisLock)
{
if (_sendOperation == null)
{
_sendOperation = new WebSocketOperation.SendOperation(this);
}
}
}
}
private void EnsureKeepAliveOperation()
{
if (_keepAliveOperation == null)
{
lock (_thisLock)
{
if (_keepAliveOperation == null)
{
WebSocketOperation.SendOperation keepAliveOperation = new WebSocketOperation.SendOperation(this);
keepAliveOperation.BufferType = WebSocketProtocolComponent.BufferType.UnsolicitedPong;
_keepAliveOperation = keepAliveOperation;
}
}
}
}
private void EnsureCloseOutputOperation()
{
if (_closeOutputOperation == null)
{
lock (_thisLock)
{
if (_closeOutputOperation == null)
{
_closeOutputOperation = new WebSocketOperation.CloseOutputOperation(this);
}
}
}
}
private static void ReleaseLock(object lockObject, ref bool lockTaken)
{
Debug.Assert(lockObject != null, "'lockObject' MUST NOT be NULL.");
if (lockTaken)
{
Monitor.Exit(lockObject);
lockTaken = false;
}
}
private static WebSocketProtocolComponent.BufferType GetBufferType(WebSocketMessageType messageType,
bool endOfMessage)
{
Debug.Assert(messageType == WebSocketMessageType.Binary || messageType == WebSocketMessageType.Text,
$"The value of 'messageType' ({messageType}) is invalid. Valid message types: '{WebSocketMessageType.Binary}, {WebSocketMessageType.Text}'");
if (messageType == WebSocketMessageType.Text)
{
if (endOfMessage)
{
return WebSocketProtocolComponent.BufferType.UTF8Message;
}
return WebSocketProtocolComponent.BufferType.UTF8Fragment;
}
else
{
if (endOfMessage)
{
return WebSocketProtocolComponent.BufferType.BinaryMessage;
}
return WebSocketProtocolComponent.BufferType.BinaryFragment;
}
}
private static WebSocketMessageType GetMessageType(WebSocketProtocolComponent.BufferType bufferType)
{
switch (bufferType)
{
case WebSocketProtocolComponent.BufferType.Close:
return WebSocketMessageType.Close;
case WebSocketProtocolComponent.BufferType.BinaryFragment:
case WebSocketProtocolComponent.BufferType.BinaryMessage:
return WebSocketMessageType.Binary;
case WebSocketProtocolComponent.BufferType.UTF8Fragment:
case WebSocketProtocolComponent.BufferType.UTF8Message:
return WebSocketMessageType.Text;
default:
// This indicates a contract violation of the websocket protocol component,
// because we currently don't support any WebSocket extensions and would
// not accept a Websocket handshake requesting extensions
Debug.Fail($"The value of 'bufferType' ({bufferType}) is invalid.");
throw new WebSocketException(WebSocketError.NativeError,
SR.Format(SR.net_WebSockets_InvalidBufferType,
bufferType,
WebSocketProtocolComponent.BufferType.Close,
WebSocketProtocolComponent.BufferType.BinaryFragment,
WebSocketProtocolComponent.BufferType.BinaryMessage,
WebSocketProtocolComponent.BufferType.UTF8Fragment,
WebSocketProtocolComponent.BufferType.UTF8Message));
}
}
internal void ValidateNativeBuffers(WebSocketProtocolComponent.Action action,
WebSocketProtocolComponent.BufferType bufferType,
Interop.WebSocket.Buffer[] dataBuffers,
uint dataBufferCount)
{
_internalBuffer.ValidateNativeBuffers(action, bufferType, dataBuffers, dataBufferCount);
}
private void ThrowIfAborted(bool aborted, Exception innerException)
{
if (aborted)
{
throw new WebSocketException(WebSocketError.InvalidState,
SR.Format(SR.net_WebSockets_InvalidState_ClosedOrAborted, GetType().FullName, WebSocketState.Aborted),
innerException);
}
}
private bool CanHandleExceptionDuringClose(Exception error)
{
Debug.Assert(error != null, "'error' MUST NOT be NULL.");
if (State != WebSocketState.Closed)
{
return false;
}
return error is OperationCanceledException ||
error is WebSocketException ||
error is SocketException ||
error is HttpListenerException ||
error is IOException;
}
// We only want to throw an OperationCanceledException if the CancellationToken passed
// down from the caller is canceled - not when Abort is called on another thread and
// the linkedCancellationToken is canceled.
private void ThrowIfConvertibleException(string? methodName,
Exception exception,
CancellationToken cancellationToken,
bool aborted)
{
Debug.Assert(exception != null, "'exception' MUST NOT be NULL.");
if (NetEventSource.Log.IsEnabled() && !string.IsNullOrEmpty(methodName))
{
NetEventSource.Error(this, $"methodName: {methodName}, exception: {exception}");
}
OperationCanceledException? operationCanceledException = exception as OperationCanceledException;
if (operationCanceledException != null)
{
if (cancellationToken.IsCancellationRequested ||
!aborted)
{
return;
}
ThrowIfAborted(aborted, exception);
}
WebSocketException? convertedException = exception as WebSocketException;
if (convertedException != null)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfAborted(aborted, convertedException);
return;
}
SocketException? socketException = exception as SocketException;
if (socketException != null)
{
convertedException = new WebSocketException(socketException.NativeErrorCode, socketException);
}
HttpListenerException? httpListenerException = exception as HttpListenerException;
if (httpListenerException != null)
{
convertedException = new WebSocketException(httpListenerException.ErrorCode, httpListenerException);
}
IOException? ioException = exception as IOException;
if (ioException != null)
{
socketException = exception.InnerException as SocketException;
if (socketException != null)
{
convertedException = new WebSocketException(socketException.NativeErrorCode, ioException);
}
}
if (convertedException != null)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfAborted(aborted, convertedException);
throw convertedException;
}
AggregateException? aggregateException = exception as AggregateException;
if (aggregateException != null)
{
// Collapse possibly nested graph into a flat list.
// Empty inner exception list is unlikely but possible via public api.
ReadOnlyCollection<Exception> unwrappedExceptions = aggregateException.Flatten().InnerExceptions;
if (unwrappedExceptions.Count == 0)
{
return;
}
foreach (Exception unwrappedException in unwrappedExceptions)
{
ThrowIfConvertibleException(null, unwrappedException, cancellationToken, aborted);
}
}
}
private void CleanUp()
{
// Multithreading: This method is always called under the _ThisLock lock
if (_cleanedUp)
{
return;
}
_cleanedUp = true;
if (SessionHandle != null)
{
SessionHandle.Dispose();
}
if (_internalBuffer != null)
{
_internalBuffer.Dispose(this.State);
}
if (_receiveOutstandingOperationHelper != null)
{
_receiveOutstandingOperationHelper.Dispose();
}
if (_sendOutstandingOperationHelper != null)
{
_sendOutstandingOperationHelper.Dispose();
}
if (_closeOutputOutstandingOperationHelper != null)
{
_closeOutputOutstandingOperationHelper.Dispose();
}
if (_closeOutstandingOperationHelper != null)
{
_closeOutstandingOperationHelper.Dispose();
}
if (_innerStream != null)
{
try
{
_innerStream.Close();
}
catch (ObjectDisposedException)
{
}
catch (IOException)
{
}
catch (SocketException)
{
}
catch (HttpListenerException)
{
}
}
_keepAliveTracker.Dispose();
}
private void OnBackgroundTaskException(Exception exception)
{
if (Interlocked.CompareExchange<Exception>(ref _pendingException!, exception, null!) == null)
{
if (NetEventSource.Log.IsEnabled())
{
NetEventSource.Error(this, exception.ToString());
}
Abort();
}
}
private void ThrowIfPendingException()
{
Exception pendingException = Interlocked.Exchange<Exception>(ref _pendingException!, null!);
if (pendingException != null)
{
throw new WebSocketException(WebSocketError.Faulted, pendingException);
}
}
private void ThrowIfDisposed()
{
ObjectDisposedException.ThrowIf(_isDisposed, this);
}
private void UpdateReceiveState(int newReceiveState, int expectedReceiveState)
{
int receiveState;
if ((receiveState = Interlocked.Exchange(ref _receiveState, newReceiveState)) != expectedReceiveState)
{
Debug.Fail($"'_receiveState' had an invalid value '{receiveState}'. The expected value was '{expectedReceiveState}'.");
}
}
private bool StartOnCloseReceived(ref bool thisLockTaken)
{
ThrowIfDisposed();
if (IsStateTerminal(State) || State == WebSocketState.CloseReceived)
{
return false;
}
Monitor.Enter(_thisLock, ref thisLockTaken);
if (IsStateTerminal(State) || State == WebSocketState.CloseReceived)
{
return false;
}
if (State == WebSocketState.Open)
{
_state = WebSocketState.CloseReceived;
_closeReceivedTaskCompletionSource ??= new TaskCompletionSource();
return false;
}
return true;
}
private void FinishOnCloseReceived(WebSocketCloseStatus closeStatus,
string? closeStatusDescription)
{
_closeReceivedTaskCompletionSource?.TrySetResult();
_closeStatus = closeStatus;
_closeStatusDescription = closeStatusDescription;
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, $"closeStatus: {closeStatus}, closeStatusDescription: {closeStatusDescription}, _State: {_state}");
}
private static async void OnKeepAlive(object? sender)
{
Debug.Assert(sender != null, "'sender' MUST NOT be NULL.");
Debug.Assert((sender as WebSocketBase) != null, "'sender as WebSocketBase' MUST NOT be NULL.");
WebSocketBase? thisPtr = (sender as WebSocketBase)!;
bool lockTaken = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
Monitor.Enter(thisPtr.SessionHandle, ref lockTaken);
if (thisPtr._isDisposed ||
thisPtr._state != WebSocketState.Open ||
thisPtr._closeOutputTask != null)
{
return;
}
if (thisPtr._keepAliveTracker.ShouldSendKeepAlive())
{
bool ownsCancellationTokenSource = false;
try
{
ownsCancellationTokenSource = thisPtr._sendOutstandingOperationHelper.TryStartOperation(CancellationToken.None, out linkedCancellationToken);
if (ownsCancellationTokenSource)
{
thisPtr.EnsureKeepAliveOperation();
thisPtr._keepAliveTask = thisPtr._keepAliveOperation!.Process(null, linkedCancellationToken);
ReleaseLock(thisPtr.SessionHandle, ref lockTaken);
await thisPtr._keepAliveTask!.SuppressContextFlow();
}
}
finally
{
if (!lockTaken)
{
Monitor.Enter(thisPtr.SessionHandle, ref lockTaken);
}
thisPtr._sendOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
thisPtr._keepAliveTask = null;
}
thisPtr._keepAliveTracker.ResetTimer();
}
}
catch (Exception exception)
{
try
{
thisPtr.ThrowIfConvertibleException(nameof(OnKeepAlive),
exception,
CancellationToken.None,
linkedCancellationToken.IsCancellationRequested);
throw;
}
catch (Exception backgroundException)
{
thisPtr.OnBackgroundTaskException(backgroundException);
}
}
finally
{
ReleaseLock(thisPtr.SessionHandle, ref lockTaken);
}
}
private abstract class WebSocketOperation
{
protected bool AsyncOperationCompleted { get; set; }
private readonly WebSocketBase _webSocket;
internal WebSocketOperation(WebSocketBase webSocket)
{
Debug.Assert(webSocket != null, "'webSocket' MUST NOT be NULL.");
_webSocket = webSocket;
AsyncOperationCompleted = false;
}
public WebSocketReceiveResult? ReceiveResult { get; protected set; }
protected abstract int BufferCount { get; }
protected abstract WebSocketProtocolComponent.ActionQueue ActionQueue { get; }
protected abstract void Initialize(Nullable<ArraySegment<byte>> buffer, CancellationToken cancellationToken);
protected abstract bool ShouldContinue(CancellationToken cancellationToken);
// Multi-Threading: This method has to be called under a SessionHandle-lock. It returns true if a
// close frame was received. Handling the received close frame might involve IO - to make the locking
// strategy easier and reduce one level in the await-hierarchy the IO is kicked off by the caller.
protected abstract bool ProcessAction_NoAction();
protected virtual void ProcessAction_IndicateReceiveComplete(
Nullable<ArraySegment<byte>> buffer,
WebSocketProtocolComponent.BufferType bufferType,
WebSocketProtocolComponent.Action action,
Interop.WebSocket.Buffer[] dataBuffers,
uint dataBufferCount,
IntPtr actionContext)
{
throw new NotImplementedException();
}
protected abstract void Cleanup();
internal async Task<WebSocketReceiveResult?> Process(Nullable<ArraySegment<byte>> buffer,
CancellationToken cancellationToken)
{
Debug.Assert(BufferCount >= 1 && BufferCount <= 2, "'bufferCount' MUST ONLY BE '1' or '2'.");
bool sessionHandleLockTaken = false;
AsyncOperationCompleted = false;
ReceiveResult = null;
try
{
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
_webSocket.ThrowIfPendingException();
Initialize(buffer, cancellationToken);
while (ShouldContinue(cancellationToken))
{
WebSocketProtocolComponent.Action action;
WebSocketProtocolComponent.BufferType bufferType;
bool completed = false;
while (!completed)
{
Interop.WebSocket.Buffer[] dataBuffers =
new Interop.WebSocket.Buffer[BufferCount];
uint dataBufferCount = (uint)BufferCount;
IntPtr actionContext;
_webSocket.ThrowIfDisposed();
WebSocketProtocolComponent.WebSocketGetAction(_webSocket,
ActionQueue,
dataBuffers,
ref dataBufferCount,
out action,
out bufferType,
out actionContext);
switch (action)
{
case WebSocketProtocolComponent.Action.NoAction:
if (ProcessAction_NoAction())
{
// A close frame was received
Debug.Assert(ReceiveResult!.Count == 0, "'receiveResult.Count' MUST be 0.");
Debug.Assert(ReceiveResult.CloseStatus != null, "'receiveResult.CloseStatus' MUST NOT be NULL for message type 'Close'.");
bool thisLockTaken = false;
try
{
if (_webSocket.StartOnCloseReceived(ref thisLockTaken))
{
// If StartOnCloseReceived returns true the WebSocket close handshake has been completed
// so there is no need to retake the SessionHandle-lock.
// _ThisLock lock is guaranteed to be taken by StartOnCloseReceived when returning true
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
bool callCompleteOnCloseCompleted = false;
try
{
callCompleteOnCloseCompleted = await _webSocket.StartOnCloseCompleted(
thisLockTaken, sessionHandleLockTaken, cancellationToken).SuppressContextFlow();
}
catch (Exception)
{
// If an exception is thrown we know that the locks have been released,
// because we enforce IWebSocketStream.CloseNetworkConnectionAsync to yield
_webSocket.ResetFlagAndTakeLock(_webSocket._thisLock, ref thisLockTaken);
throw;
}
if (callCompleteOnCloseCompleted)
{
_webSocket.ResetFlagAndTakeLock(_webSocket._thisLock, ref thisLockTaken);
_webSocket.FinishOnCloseCompleted();
}
}
_webSocket.FinishOnCloseReceived(ReceiveResult.CloseStatus.Value, ReceiveResult.CloseStatusDescription);
}
finally
{
if (thisLockTaken)
{
ReleaseLock(_webSocket._thisLock, ref thisLockTaken);
}
}
}
completed = true;
break;
case WebSocketProtocolComponent.Action.IndicateReceiveComplete:
ProcessAction_IndicateReceiveComplete(buffer,
bufferType,
action,
dataBuffers,
dataBufferCount,
actionContext);
break;
case WebSocketProtocolComponent.Action.ReceiveFromNetwork:
int count = 0;
try
{
ArraySegment<byte> payload = _webSocket._internalBuffer.ConvertNativeBuffer(action, dataBuffers[0], bufferType);
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
HttpWebSocket.ThrowIfConnectionAborted(_webSocket._innerStream, true);
try
{
Task<int> readTask = _webSocket._innerStream.ReadAsync(payload.Array!,
payload.Offset,
payload.Count,
cancellationToken);
count = await readTask.SuppressContextFlow();
_webSocket._keepAliveTracker.OnDataReceived();
}
catch (ObjectDisposedException objectDisposedException)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, objectDisposedException);
}
catch (NotSupportedException notSupportedException)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, notSupportedException);
}
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
_webSocket.ThrowIfPendingException();
// If the client unexpectedly closed the socket we throw an exception as we didn't get any close message
if (count == 0)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely);
}
}
finally
{
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket,
actionContext,
count);
}
break;
case WebSocketProtocolComponent.Action.IndicateSendComplete:
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket, actionContext, 0);
AsyncOperationCompleted = true;
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
await _webSocket._innerStream.FlushAsync(cancellationToken).SuppressContextFlow();
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
break;
case WebSocketProtocolComponent.Action.SendToNetwork:
int bytesSent = 0;
try
{
if (_webSocket.State != WebSocketState.CloseSent ||
(bufferType != WebSocketProtocolComponent.BufferType.PingPong &&
bufferType != WebSocketProtocolComponent.BufferType.UnsolicitedPong))
{
if (dataBufferCount == 0)
{
break;
}
List<ArraySegment<byte>> sendBuffers = new List<ArraySegment<byte>>((int)dataBufferCount);
int sendBufferSize = 0;
ArraySegment<byte> framingBuffer = _webSocket._internalBuffer.ConvertNativeBuffer(action, dataBuffers[0], bufferType);
sendBuffers.Add(framingBuffer);
sendBufferSize += framingBuffer.Count;
// There can be at most 2 dataBuffers
// - one for the framing header and one for the payload
if (dataBufferCount == 2)
{
ArraySegment<byte> payload;
// The second buffer might be from the pinned send payload buffer (1) or from the
// internal native buffer (2). In the case of a PONG response being generated, the buffer
// would be from (2). Even if the payload is from a WebSocketSend operation, the buffer
// might be (1) only if no buffer copies were needed (in the case of no masking, for example).
// Or it might be (2). So, we need to check.
if (_webSocket._internalBuffer.IsPinnedSendPayloadBuffer(dataBuffers[1], bufferType))
{
payload = _webSocket._internalBuffer.ConvertPinnedSendPayloadFromNative(dataBuffers[1], bufferType);
}
else
{
payload = _webSocket._internalBuffer.ConvertNativeBuffer(action, dataBuffers[1], bufferType);
}
sendBuffers.Add(payload);
sendBufferSize += payload.Count;
}
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
HttpWebSocket.ThrowIfConnectionAborted(_webSocket._innerStream, false);
await _webSocket.SendFrameAsync(sendBuffers, cancellationToken).SuppressContextFlow();
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
_webSocket.ThrowIfPendingException();
bytesSent += sendBufferSize;
_webSocket._keepAliveTracker.OnDataSent();
}
}
finally
{
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket,
actionContext,
bytesSent);
}
break;
default:
Debug.Fail($"Invalid action '{action}' returned from WebSocketGetAction.");
throw new InvalidOperationException();
}
}
// WebSocketGetAction has returned NO_ACTION. In general, WebSocketGetAction will return
// NO_ACTION if there is no work item available to process at the current moment. But
// there could be work items on the queue still. Those work items can't be returned back
// until the current work item (being done by another thread) is complete.
//
// It's possible that another thread might be finishing up an async operation and needs
// to call WebSocketCompleteAction. Once that happens, calling WebSocketGetAction on this
// thread might return something else to do. This happens, for example, if the RECEIVE thread
// ends up having to begin sending out a PONG response (due to it receiving a PING) and the
// current SEND thread has posted a WebSocketSend but it can't be processed yet until the
// RECEIVE thread has finished sending out the PONG response.
//
// So, we need to release the lock briefly to give the other thread a chance to finish
// processing. We won't actually exit this outter loop and return from this async method
// until the caller's async operation has been fully completed.
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
}
}
finally
{
Cleanup();
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
}
return ReceiveResult;
}
public sealed class ReceiveOperation : WebSocketOperation
{
private int _receiveState;
private bool _pongReceived;
private bool _receiveCompleted;
public ReceiveOperation(WebSocketBase webSocket)
: base(webSocket)
{
}
protected override WebSocketProtocolComponent.ActionQueue ActionQueue
{
get { return WebSocketProtocolComponent.ActionQueue.Receive; }
}
protected override int BufferCount
{
get { return 1; }
}
protected override void Initialize(Nullable<ArraySegment<byte>> buffer, CancellationToken cancellationToken)
{
Debug.Assert(buffer != null, "'buffer' MUST NOT be NULL.");
_pongReceived = false;
_receiveCompleted = false;
_webSocket.ThrowIfDisposed();
int originalReceiveState = Interlocked.CompareExchange(ref _webSocket._receiveState,
ReceiveState.Application, ReceiveState.Idle);
switch (originalReceiveState)
{
case ReceiveState.Idle:
_receiveState = ReceiveState.Application;
break;
case ReceiveState.Application:
Debug.Fail("'originalReceiveState' MUST NEVER be ReceiveState.Application at this point.");
break;
case ReceiveState.PayloadAvailable:
WebSocketReceiveResult receiveResult;
if (!_webSocket._internalBuffer.ReceiveFromBufferedPayload(buffer.Value, out receiveResult))
{
_webSocket.UpdateReceiveState(ReceiveState.Idle, ReceiveState.PayloadAvailable);
}
ReceiveResult = receiveResult;
_receiveCompleted = true;
break;
default:
Debug.Fail($"Invalid ReceiveState '{originalReceiveState}'.");
break;
}
}
protected override void Cleanup()
{
}
protected override bool ShouldContinue(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
if (_receiveCompleted)
{
return false;
}
_webSocket.ThrowIfDisposed();
_webSocket.ThrowIfPendingException();
WebSocketProtocolComponent.WebSocketReceive(_webSocket);
return true;
}
protected override bool ProcessAction_NoAction()
{
if (_pongReceived)
{
_receiveCompleted = false;
_pongReceived = false;
return false;
}
Debug.Assert(ReceiveResult != null,
"'ReceiveResult' MUST NOT be NULL.");
_receiveCompleted = true;
if (ReceiveResult.MessageType == WebSocketMessageType.Close)
{
return true;
}
return false;
}
protected override void ProcessAction_IndicateReceiveComplete(
Nullable<ArraySegment<byte>> buffer,
WebSocketProtocolComponent.BufferType bufferType,
WebSocketProtocolComponent.Action action,
Interop.WebSocket.Buffer[] dataBuffers,
uint dataBufferCount,
IntPtr actionContext)
{
Debug.Assert(buffer != null, "'buffer MUST NOT be NULL.");
int bytesTransferred = 0;
_pongReceived = false;
if (bufferType == WebSocketProtocolComponent.BufferType.PingPong)
{
// ignoring received pong frame
_pongReceived = true;
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket,
actionContext,
bytesTransferred);
return;
}
WebSocketReceiveResult receiveResult;
try
{
ArraySegment<byte> payload;
WebSocketMessageType messageType = GetMessageType(bufferType);
int newReceiveState = ReceiveState.Idle;
if (bufferType == WebSocketProtocolComponent.BufferType.Close)
{
payload = ArraySegment<byte>.Empty;
_webSocket._internalBuffer.ConvertCloseBuffer(action, dataBuffers[0], out WebSocketCloseStatus closeStatus, out string? reason);
receiveResult = new WebSocketReceiveResult(bytesTransferred,
messageType, true, closeStatus, reason);
}
else
{
payload = _webSocket._internalBuffer.ConvertNativeBuffer(action, dataBuffers[0], bufferType);
bool endOfMessage = bufferType ==
WebSocketProtocolComponent.BufferType.BinaryMessage ||
bufferType == WebSocketProtocolComponent.BufferType.UTF8Message ||
bufferType == WebSocketProtocolComponent.BufferType.Close;
if (payload.Count > buffer.Value.Count)
{
_webSocket._internalBuffer.BufferPayload(payload, buffer.Value.Count, messageType, endOfMessage);
newReceiveState = ReceiveState.PayloadAvailable;
endOfMessage = false;
}
bytesTransferred = Math.Min(payload.Count, (int)buffer.Value.Count);
if (bytesTransferred > 0)
{
Buffer.BlockCopy(payload.Array!,
payload.Offset,
buffer.Value.Array!,
buffer.Value.Offset,
bytesTransferred);
}
receiveResult = new WebSocketReceiveResult(bytesTransferred, messageType, endOfMessage);
}
_webSocket.UpdateReceiveState(newReceiveState, _receiveState);
}
finally
{
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket,
actionContext,
bytesTransferred);
}
ReceiveResult = receiveResult;
}
}
public class SendOperation : WebSocketOperation
{
protected bool _BufferHasBeenPinned;
public SendOperation(WebSocketBase webSocket)
: base(webSocket)
{
}
protected override WebSocketProtocolComponent.ActionQueue ActionQueue
{
get { return WebSocketProtocolComponent.ActionQueue.Send; }
}
protected override int BufferCount
{
get { return 2; }
}
protected virtual Nullable<Interop.WebSocket.Buffer> CreateBuffer(Nullable<ArraySegment<byte>> buffer)
{
if (buffer == null)
{
return null;
}
Interop.WebSocket.Buffer payloadBuffer;
payloadBuffer = default;
_webSocket._internalBuffer.PinSendBuffer(buffer.Value, out _BufferHasBeenPinned);
payloadBuffer.Data.BufferData = _webSocket._internalBuffer.ConvertPinnedSendPayloadToNative(buffer.Value);
payloadBuffer.Data.BufferLength = (uint)buffer.Value.Count;
return payloadBuffer;
}
protected override bool ProcessAction_NoAction()
{
return false;
}
protected override void Cleanup()
{
if (_BufferHasBeenPinned)
{
_BufferHasBeenPinned = false;
_webSocket._internalBuffer.ReleasePinnedSendBuffer();
}
}
internal WebSocketProtocolComponent.BufferType BufferType { get; set; }
protected override void Initialize(Nullable<ArraySegment<byte>> buffer,
CancellationToken cancellationToken)
{
Debug.Assert(!_BufferHasBeenPinned, "'_BufferHasBeenPinned' MUST NOT be pinned at this point.");
_webSocket.ThrowIfDisposed();
_webSocket.ThrowIfPendingException();
Nullable<Interop.WebSocket.Buffer> payloadBuffer = CreateBuffer(buffer);
if (payloadBuffer != null)
{
WebSocketProtocolComponent.WebSocketSend(_webSocket, BufferType, payloadBuffer.Value);
}
else
{
WebSocketProtocolComponent.WebSocketSendWithoutBody(_webSocket, BufferType);
}
}
protected override bool ShouldContinue(CancellationToken cancellationToken)
{
Debug.Assert(ReceiveResult == null, "'ReceiveResult' MUST be NULL.");
if (AsyncOperationCompleted)
{
return false;
}
cancellationToken.ThrowIfCancellationRequested();
return true;
}
}
public sealed class CloseOutputOperation : SendOperation
{
public CloseOutputOperation(WebSocketBase webSocket)
: base(webSocket)
{
BufferType = WebSocketProtocolComponent.BufferType.Close;
}
internal WebSocketCloseStatus CloseStatus { get; set; }
internal string? CloseReason { get; set; }
protected override Nullable<Interop.WebSocket.Buffer> CreateBuffer(Nullable<ArraySegment<byte>> buffer)
{
Debug.Assert(buffer == null, "'buffer' MUST BE NULL.");
_webSocket.ThrowIfDisposed();
_webSocket.ThrowIfPendingException();
if (CloseStatus == WebSocketCloseStatus.Empty)
{
return null;
}
Interop.WebSocket.Buffer payloadBuffer = default;
if (CloseReason != null)
{
byte[] blob = Encoding.UTF8.GetBytes(CloseReason);
Debug.Assert(blob.Length <= WebSocketValidate.MaxControlFramePayloadLength,
"The close reason is too long.");
ArraySegment<byte> closeBuffer = new ArraySegment<byte>(blob, 0, Math.Min(WebSocketValidate.MaxControlFramePayloadLength, blob.Length));
_webSocket._internalBuffer.PinSendBuffer(closeBuffer, out _BufferHasBeenPinned);
payloadBuffer.CloseStatus.ReasonData = _webSocket._internalBuffer.ConvertPinnedSendPayloadToNative(closeBuffer);
payloadBuffer.CloseStatus.ReasonLength = (uint)closeBuffer.Count;
}
payloadBuffer.CloseStatus.CloseStatus = (ushort)CloseStatus;
return payloadBuffer;
}
}
}
private abstract class KeepAliveTracker : IDisposable
{
// Multi-Threading: only one thread at a time is allowed to call OnDataReceived or OnDataSent
// - but both methods can be called from different threads at the same time.
public abstract void OnDataReceived();
public abstract void OnDataSent();
public abstract void Dispose();
public abstract void StartTimer(WebSocketBase webSocket);
public abstract void ResetTimer();
public abstract bool ShouldSendKeepAlive();
public static KeepAliveTracker Create(TimeSpan keepAliveInterval)
{
if ((int)keepAliveInterval.TotalMilliseconds > 0)
{
return new DefaultKeepAliveTracker(keepAliveInterval);
}
return new DisabledKeepAliveTracker();
}
private sealed class DisabledKeepAliveTracker : KeepAliveTracker
{
public override void OnDataReceived()
{
}
public override void OnDataSent()
{
}
public override void ResetTimer()
{
}
public override void StartTimer(WebSocketBase webSocket)
{
}
public override bool ShouldSendKeepAlive()
{
return false;
}
public override void Dispose()
{
}
}
private sealed class DefaultKeepAliveTracker : KeepAliveTracker
{
private static readonly TimerCallback s_KeepAliveTimerElapsedCallback = new TimerCallback(OnKeepAlive);
private readonly TimeSpan _keepAliveInterval;
private readonly Stopwatch _lastSendActivity;
private readonly Stopwatch _lastReceiveActivity;
private Timer? _keepAliveTimer;
public DefaultKeepAliveTracker(TimeSpan keepAliveInterval)
{
_keepAliveInterval = keepAliveInterval;
_lastSendActivity = new Stopwatch();
_lastReceiveActivity = new Stopwatch();
}
public override void OnDataReceived()
{
_lastReceiveActivity.Restart();
}
public override void OnDataSent()
{
_lastSendActivity.Restart();
}
public override void ResetTimer()
{
ResetTimer((int)_keepAliveInterval.TotalMilliseconds);
}
public override void StartTimer(WebSocketBase webSocket)
{
Debug.Assert(webSocket != null, "'webSocket' MUST NOT be NULL.");
Debug.Assert(webSocket._keepAliveTracker != null,
"'webSocket._KeepAliveTracker' MUST NOT be NULL at this point.");
int keepAliveIntervalMilliseconds = (int)_keepAliveInterval.TotalMilliseconds;
Debug.Assert(keepAliveIntervalMilliseconds > 0, "'keepAliveIntervalMilliseconds' MUST be POSITIVE.");
// The correct pattern is to first initialize the Timer object, assign it to the member variable
// and only afterwards enable the Timer. This is required because the constructor, together with
// the assignment are not guaranteed to be an atomic operation, which creates a race between the
// assignment and the Timer callback.
_keepAliveTimer = new Timer(s_KeepAliveTimerElapsedCallback, webSocket, Timeout.Infinite,
Timeout.Infinite);
_keepAliveTimer.Change(keepAliveIntervalMilliseconds, Timeout.Infinite);
}
public override bool ShouldSendKeepAlive()
{
TimeSpan idleTime = GetIdleTime();
if (idleTime >= _keepAliveInterval)
{
return true;
}
ResetTimer((int)(_keepAliveInterval - idleTime).TotalMilliseconds);
return false;
}
public override void Dispose()
{
_keepAliveTimer!.Dispose();
}
private void ResetTimer(int dueInMilliseconds)
{
_keepAliveTimer!.Change(dueInMilliseconds, Timeout.Infinite);
}
private TimeSpan GetIdleTime()
{
TimeSpan sinceLastSendActivity = GetTimeElapsed(_lastSendActivity);
TimeSpan sinceLastReceiveActivity = GetTimeElapsed(_lastReceiveActivity);
if (sinceLastReceiveActivity < sinceLastSendActivity)
{
return sinceLastReceiveActivity;
}
return sinceLastSendActivity;
}
private TimeSpan GetTimeElapsed(Stopwatch watch)
{
if (watch.IsRunning)
{
return watch.Elapsed;
}
return _keepAliveInterval;
}
}
}
private sealed class OutstandingOperationHelper : IDisposable
{
private volatile int _operationsOutstanding;
private volatile CancellationTokenSource? _cancellationTokenSource;
private volatile bool _isDisposed;
private readonly object _thisLock = new object();
public bool TryStartOperation(CancellationToken userCancellationToken, out CancellationToken linkedCancellationToken)
{
linkedCancellationToken = CancellationToken.None;
ThrowIfDisposed();
lock (_thisLock)
{
int operationsOutstanding = ++_operationsOutstanding;
if (operationsOutstanding == 1)
{
linkedCancellationToken = CreateLinkedCancellationToken(userCancellationToken);
return true;
}
Debug.Assert(operationsOutstanding >= 1, "'operationsOutstanding' must never be smaller than 1.");
return false;
}
}
public void CompleteOperation(bool ownsCancellationTokenSource)
{
if (_isDisposed)
{
// no-op if the WebSocket is already aborted
return;
}
CancellationTokenSource? snapshot = null;
lock (_thisLock)
{
--_operationsOutstanding;
Debug.Assert(_operationsOutstanding >= 0, "'_OperationsOutstanding' must never be smaller than 0.");
if (ownsCancellationTokenSource)
{
snapshot = _cancellationTokenSource;
_cancellationTokenSource = null;
}
}
if (snapshot != null)
{
snapshot.Dispose();
}
}
// Has to be called under _ThisLock lock
private CancellationToken CreateLinkedCancellationToken(CancellationToken cancellationToken)
{
var linkedCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
Debug.Assert(_cancellationTokenSource == null, "'_cancellationTokenSource' MUST be NULL.");
_cancellationTokenSource = linkedCancellationTokenSource;
return linkedCancellationTokenSource.Token;
}
public void CancelIO()
{
CancellationTokenSource? cancellationTokenSourceSnapshot = null;
lock (_thisLock)
{
if (_operationsOutstanding == 0)
{
return;
}
cancellationTokenSourceSnapshot = _cancellationTokenSource;
}
if (cancellationTokenSourceSnapshot != null)
{
try
{
cancellationTokenSourceSnapshot.Cancel();
}
catch (ObjectDisposedException)
{
// Simply ignore this exception - There is apparently a rare race condition
// where the cancellationTokensource is disposed before the Cancel method call completed.
}
}
}
public void Dispose()
{
if (_isDisposed)
{
return;
}
CancellationTokenSource? snapshot = null;
lock (_thisLock)
{
if (_isDisposed)
{
return;
}
_isDisposed = true;
snapshot = _cancellationTokenSource;
_cancellationTokenSource = null;
}
if (snapshot != null)
{
snapshot.Dispose();
}
}
private void ThrowIfDisposed()
{
ObjectDisposedException.ThrowIf(_isDisposed, this);
}
}
internal interface IWebSocketStream
{
// Switching to opaque mode will change the behavior to use the knowledge that the WebSocketBase class
// is pinning all payloads already and that we will have at most one outstanding send and receive at any
// given time. This allows us to avoid creation of OverlappedData and pinning for each operation.
void SwitchToOpaqueMode(WebSocketBase webSocket);
void Abort();
bool SupportsMultipleWrite { get; }
Task MultipleWriteAsync(IList<ArraySegment<byte>> buffers, CancellationToken cancellationToken);
// Any implementation has to guarantee that no exception is thrown synchronously
// for example by enforcing a Task.Yield at the beginning of the method
// This is necessary to enforce an API contract (for WebSocketBase.StartOnCloseCompleted) that ensures
// that all locks have been released whenever an exception is thrown from it.
Task CloseNetworkConnectionAsync(CancellationToken cancellationToken);
}
private static class ReceiveState
{
internal const int SendOperation = -1;
internal const int Idle = 0;
internal const int Application = 1;
internal const int PayloadAvailable = 2;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.WebSockets
{
internal abstract class WebSocketBase : WebSocket, IDisposable
{
private readonly OutstandingOperationHelper _closeOutstandingOperationHelper;
private readonly OutstandingOperationHelper _closeOutputOutstandingOperationHelper;
private readonly OutstandingOperationHelper _receiveOutstandingOperationHelper;
private readonly OutstandingOperationHelper _sendOutstandingOperationHelper;
private readonly Stream _innerStream;
private readonly IWebSocketStream? _innerStreamAsWebSocketStream;
private readonly string? _subProtocol;
// We are not calling Dispose method on this object in Cleanup method to avoid a race condition while one thread is calling disposing on
// this object and another one is still using WaitAsync. According to Dev11 358715, this should be fine as long as we are not accessing the
// AvailableWaitHandle on this SemaphoreSlim object.
private readonly SemaphoreSlim _sendFrameThrottle;
// locking _ThisLock protects access to
// - State
// - _closeAsyncStartedReceive
// - _closeReceivedTaskCompletionSource
// - _closeNetworkConnectionTask
private readonly object _thisLock;
private readonly WebSocketBuffer _internalBuffer;
private readonly KeepAliveTracker _keepAliveTracker;
private volatile bool _cleanedUp;
private volatile TaskCompletionSource? _closeReceivedTaskCompletionSource;
private volatile Task? _closeOutputTask;
private volatile bool _isDisposed;
private volatile Task? _closeNetworkConnectionTask;
private volatile bool _closeAsyncStartedReceive;
private volatile WebSocketState _state;
private volatile Task? _keepAliveTask;
private volatile WebSocketOperation.ReceiveOperation? _receiveOperation;
private volatile WebSocketOperation.SendOperation? _sendOperation;
private volatile WebSocketOperation.SendOperation? _keepAliveOperation;
private volatile WebSocketOperation.CloseOutputOperation? _closeOutputOperation;
private Nullable<WebSocketCloseStatus> _closeStatus;
private string? _closeStatusDescription;
private int _receiveState;
private Exception? _pendingException;
protected WebSocketBase(Stream innerStream,
string? subProtocol,
TimeSpan keepAliveInterval,
WebSocketBuffer internalBuffer)
{
Debug.Assert(internalBuffer != null, "'internalBuffer' MUST NOT be NULL.");
HttpWebSocket.ValidateInnerStream(innerStream);
HttpWebSocket.ValidateOptions(subProtocol, internalBuffer.ReceiveBufferSize,
internalBuffer.SendBufferSize, keepAliveInterval);
_thisLock = new object();
_innerStream = innerStream;
_internalBuffer = internalBuffer;
if (NetEventSource.Log.IsEnabled())
{
NetEventSource.Associate(this, _innerStream);
NetEventSource.Associate(this, _internalBuffer);
}
_closeOutstandingOperationHelper = new OutstandingOperationHelper();
_closeOutputOutstandingOperationHelper = new OutstandingOperationHelper();
_receiveOutstandingOperationHelper = new OutstandingOperationHelper();
_sendOutstandingOperationHelper = new OutstandingOperationHelper();
_state = WebSocketState.Open;
_subProtocol = subProtocol;
_sendFrameThrottle = new SemaphoreSlim(1, 1);
_closeStatus = null;
_closeStatusDescription = null;
_innerStreamAsWebSocketStream = innerStream as IWebSocketStream;
if (_innerStreamAsWebSocketStream != null)
{
_innerStreamAsWebSocketStream.SwitchToOpaqueMode(this);
}
_keepAliveTracker = KeepAliveTracker.Create(keepAliveInterval);
}
public override WebSocketState State
{
get
{
Debug.Assert(_state != WebSocketState.None, "'_state' MUST NOT be 'WebSocketState.None'.");
return _state;
}
}
public override string? SubProtocol
{
get
{
return _subProtocol;
}
}
public override WebSocketCloseStatus? CloseStatus
{
get
{
return _closeStatus;
}
}
public override string? CloseStatusDescription
{
get
{
return _closeStatusDescription;
}
}
internal WebSocketBuffer InternalBuffer
{
get
{
Debug.Assert(_internalBuffer != null, "'_internalBuffer' MUST NOT be NULL.");
return _internalBuffer;
}
}
protected void StartKeepAliveTimer()
{
_keepAliveTracker.StartTimer(this);
}
// locking SessionHandle protects access to
// - WSPC (WebSocketProtocolComponent)
// - _KeepAliveTask
// - _closeOutputTask
// - _LastSendActivity
internal abstract SafeHandle SessionHandle { get; }
// MultiThreading: ThreadSafe; At most one outstanding call to ReceiveAsync is allowed
public override Task<WebSocketReceiveResult> ReceiveAsync(ArraySegment<byte> buffer,
CancellationToken cancellationToken)
{
WebSocketValidate.ValidateArraySegment(buffer, nameof(buffer));
return ReceiveAsyncCore(buffer, cancellationToken);
}
private async Task<WebSocketReceiveResult> ReceiveAsyncCore(ArraySegment<byte> buffer,
CancellationToken cancellationToken)
{
WebSocketReceiveResult receiveResult;
ThrowIfPendingException();
ThrowIfDisposed();
ThrowOnInvalidState(State, WebSocketState.Open, WebSocketState.CloseSent);
bool ownsCancellationTokenSource = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
ownsCancellationTokenSource = _receiveOutstandingOperationHelper.TryStartOperation(cancellationToken,
out linkedCancellationToken);
if (!ownsCancellationTokenSource)
{
lock (_thisLock)
{
if (_closeAsyncStartedReceive)
{
throw new InvalidOperationException(
SR.Format(SR.net_WebSockets_ReceiveAsyncDisallowedAfterCloseAsync, nameof(CloseAsync), nameof(CloseOutputAsync)));
}
throw new InvalidOperationException(
SR.Format(SR.net_Websockets_AlreadyOneOutstandingOperation, nameof(ReceiveAsync)));
}
}
EnsureReceiveOperation();
receiveResult = (await _receiveOperation!.Process(buffer, linkedCancellationToken).SuppressContextFlow())!;
if (NetEventSource.Log.IsEnabled() && receiveResult.Count > 0)
{
NetEventSource.DumpBuffer(this, buffer.Array!, buffer.Offset, receiveResult.Count);
}
}
catch (Exception exception)
{
bool aborted = linkedCancellationToken.IsCancellationRequested;
Abort();
ThrowIfConvertibleException(nameof(ReceiveAsync), exception, cancellationToken, aborted);
throw;
}
finally
{
_receiveOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
}
return receiveResult;
}
// MultiThreading: ThreadSafe; At most one outstanding call to SendAsync is allowed
public override Task SendAsync(ArraySegment<byte> buffer,
WebSocketMessageType messageType,
bool endOfMessage,
CancellationToken cancellationToken)
{
if (messageType != WebSocketMessageType.Binary &&
messageType != WebSocketMessageType.Text)
{
throw new ArgumentException(SR.Format(SR.net_WebSockets_Argument_InvalidMessageType,
messageType,
nameof(SendAsync),
WebSocketMessageType.Binary,
WebSocketMessageType.Text,
nameof(CloseOutputAsync)),
nameof(messageType));
}
WebSocketValidate.ValidateArraySegment(buffer, nameof(buffer));
return SendAsyncCore(buffer, messageType, endOfMessage, cancellationToken);
}
private async Task SendAsyncCore(ArraySegment<byte> buffer,
WebSocketMessageType messageType,
bool endOfMessage,
CancellationToken cancellationToken)
{
Debug.Assert(messageType == WebSocketMessageType.Binary || messageType == WebSocketMessageType.Text,
"'messageType' MUST be either 'WebSocketMessageType.Binary' or 'WebSocketMessageType.Text'.");
Debug.Assert(buffer.Array != null);
ThrowIfPendingException();
ThrowIfDisposed();
ThrowOnInvalidState(State, WebSocketState.Open, WebSocketState.CloseReceived);
bool ownsCancellationTokenSource = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
while (!(ownsCancellationTokenSource = _sendOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken)))
{
Task? keepAliveTask;
lock (SessionHandle)
{
keepAliveTask = _keepAliveTask;
if (keepAliveTask == null)
{
// Check whether there is still another outstanding send operation
// Potentially the keepAlive operation has completed before this thread
// was able to enter the SessionHandle-lock.
_sendOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
if (ownsCancellationTokenSource = _sendOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken))
{
break;
}
else
{
throw new InvalidOperationException(
SR.Format(SR.net_Websockets_AlreadyOneOutstandingOperation, nameof(SendAsync)));
}
}
}
await keepAliveTask.SuppressContextFlow();
ThrowIfPendingException();
_sendOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
}
if (NetEventSource.Log.IsEnabled() && buffer.Count > 0)
{
NetEventSource.DumpBuffer(this, buffer.Array, buffer.Offset, buffer.Count);
}
EnsureSendOperation();
_sendOperation!.BufferType = GetBufferType(messageType, endOfMessage);
await _sendOperation.Process(buffer, linkedCancellationToken).SuppressContextFlow();
}
catch (Exception exception)
{
bool aborted = linkedCancellationToken.IsCancellationRequested;
Abort();
ThrowIfConvertibleException(nameof(SendAsync), exception, cancellationToken, aborted);
throw;
}
finally
{
_sendOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
}
}
private async Task SendFrameAsync(IList<ArraySegment<byte>> sendBuffers, CancellationToken cancellationToken)
{
bool sendFrameLockTaken = false;
try
{
await _sendFrameThrottle.WaitAsync(cancellationToken).SuppressContextFlow();
sendFrameLockTaken = true;
if (sendBuffers.Count > 1 &&
_innerStreamAsWebSocketStream != null &&
_innerStreamAsWebSocketStream.SupportsMultipleWrite)
{
await _innerStreamAsWebSocketStream.MultipleWriteAsync(sendBuffers,
cancellationToken).SuppressContextFlow();
}
else
{
foreach (ArraySegment<byte> buffer in sendBuffers)
{
await _innerStream.WriteAsync(buffer.Array!,
buffer.Offset,
buffer.Count,
cancellationToken).SuppressContextFlow();
}
}
}
catch (ObjectDisposedException objectDisposedException)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, objectDisposedException);
}
catch (NotSupportedException notSupportedException)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, notSupportedException);
}
finally
{
if (sendFrameLockTaken)
{
_sendFrameThrottle.Release();
}
}
}
// MultiThreading: ThreadSafe; No-op if already in a terminal state
public override void Abort()
{
bool thisLockTaken = false;
bool sessionHandleLockTaken = false;
try
{
if (IsStateTerminal(State))
{
return;
}
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
if (IsStateTerminal(State))
{
return;
}
_state = WebSocketState.Aborted;
// Abort any outstanding IO operations.
if (SessionHandle != null && !SessionHandle.IsClosed && !SessionHandle.IsInvalid)
{
WebSocketProtocolComponent.WebSocketAbortHandle(SessionHandle);
}
_receiveOutstandingOperationHelper.CancelIO();
_sendOutstandingOperationHelper.CancelIO();
_closeOutputOutstandingOperationHelper.CancelIO();
_closeOutstandingOperationHelper.CancelIO();
if (_innerStreamAsWebSocketStream != null)
{
_innerStreamAsWebSocketStream.Abort();
}
CleanUp();
}
finally
{
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
}
// MultiThreading: ThreadSafe; No-op if already in a terminal state
public override Task CloseOutputAsync(WebSocketCloseStatus closeStatus,
string? statusDescription,
CancellationToken cancellationToken)
{
WebSocketValidate.ValidateCloseStatus(closeStatus, statusDescription);
return CloseOutputAsyncCore(closeStatus, statusDescription!, cancellationToken);
}
private async Task CloseOutputAsyncCore(WebSocketCloseStatus closeStatus,
string statusDescription,
CancellationToken cancellationToken)
{
ThrowIfPendingException();
if (IsStateTerminal(State))
{
return;
}
ThrowIfDisposed();
bool thisLockTaken = false;
bool sessionHandleLockTaken = false;
bool needToCompleteSendOperation = false;
bool ownsCloseOutputCancellationTokenSource = false;
bool ownsSendCancellationTokenSource = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
ThrowIfPendingException();
ThrowIfDisposed();
if (IsStateTerminal(State))
{
return;
}
ThrowOnInvalidState(State, WebSocketState.Open, WebSocketState.CloseReceived);
ownsCloseOutputCancellationTokenSource = _closeOutputOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken);
if (!ownsCloseOutputCancellationTokenSource)
{
Task? closeOutputTask = _closeOutputTask;
if (closeOutputTask != null)
{
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
await closeOutputTask.SuppressContextFlow();
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
}
else
{
needToCompleteSendOperation = true;
while (!(ownsSendCancellationTokenSource =
_sendOutstandingOperationHelper.TryStartOperation(cancellationToken,
out linkedCancellationToken)))
{
if (_keepAliveTask != null)
{
Task keepAliveTask = _keepAliveTask;
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
await keepAliveTask.SuppressContextFlow();
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
ThrowIfPendingException();
}
else
{
throw new InvalidOperationException(
SR.Format(SR.net_Websockets_AlreadyOneOutstandingOperation, nameof(SendAsync)));
}
_sendOutstandingOperationHelper.CompleteOperation(ownsSendCancellationTokenSource);
}
EnsureCloseOutputOperation();
_closeOutputOperation!.CloseStatus = closeStatus;
_closeOutputOperation!.CloseReason = statusDescription;
_closeOutputTask = _closeOutputOperation!.Process(null, linkedCancellationToken);
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
await _closeOutputTask.SuppressContextFlow();
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
if (OnCloseOutputCompleted())
{
bool callCompleteOnCloseCompleted = false;
try
{
callCompleteOnCloseCompleted = await StartOnCloseCompleted(
thisLockTaken, sessionHandleLockTaken, linkedCancellationToken).SuppressContextFlow();
}
catch (Exception)
{
// If an exception is thrown we know that the locks have been released,
// because we enforce IWebSocketStream.CloseNetworkConnectionAsync to yield
ResetFlagsAndTakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
throw;
}
if (callCompleteOnCloseCompleted)
{
ResetFlagsAndTakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
FinishOnCloseCompleted();
}
}
}
}
catch (Exception exception)
{
bool aborted = linkedCancellationToken.IsCancellationRequested;
Abort();
ThrowIfConvertibleException(nameof(CloseOutputAsync), exception, cancellationToken, aborted);
throw;
}
finally
{
_closeOutputOutstandingOperationHelper.CompleteOperation(ownsCloseOutputCancellationTokenSource);
if (needToCompleteSendOperation)
{
_sendOutstandingOperationHelper.CompleteOperation(ownsSendCancellationTokenSource);
}
_closeOutputTask = null;
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
}
// returns TRUE if the caller should also call StartOnCloseCompleted
private bool OnCloseOutputCompleted()
{
if (IsStateTerminal(State))
{
return false;
}
switch (State)
{
case WebSocketState.Open:
_state = WebSocketState.CloseSent;
return false;
case WebSocketState.CloseReceived:
return true;
default:
return false;
}
}
// MultiThreading: This method has to be called under a _ThisLock-lock
// ReturnValue: This method returns true only if CompleteOnCloseCompleted needs to be called
// If this method returns true all locks were released before starting the IO operation
// and they have to be retaken by the caller before calling CompleteOnCloseCompleted
// Exception handling: If an exception is thrown from await StartOnCloseCompleted
// it always means the locks have been released already - so the caller has to retake the
// locks in the catch-block.
// This is ensured by enforcing a Task.Yield for IWebSocketStream.CloseNetowrkConnectionAsync
private async Task<bool> StartOnCloseCompleted(bool thisLockTakenSnapshot,
bool sessionHandleLockTakenSnapshot,
CancellationToken cancellationToken)
{
Debug.Assert(thisLockTakenSnapshot, "'thisLockTakenSnapshot' MUST be 'true' at this point.");
if (IsStateTerminal(_state))
{
return false;
}
_state = WebSocketState.Closed;
if (_innerStreamAsWebSocketStream != null)
{
bool thisLockTaken = thisLockTakenSnapshot;
bool sessionHandleLockTaken = sessionHandleLockTakenSnapshot;
try
{
if (_closeNetworkConnectionTask == null)
{
_closeNetworkConnectionTask =
_innerStreamAsWebSocketStream.CloseNetworkConnectionAsync(cancellationToken);
}
if (thisLockTaken && sessionHandleLockTaken)
{
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
else if (thisLockTaken)
{
ReleaseLock(_thisLock, ref thisLockTaken);
}
await _closeNetworkConnectionTask.SuppressContextFlow();
}
catch (Exception closeNetworkConnectionTaskException)
{
if (!CanHandleExceptionDuringClose(closeNetworkConnectionTaskException))
{
ThrowIfConvertibleException(nameof(StartOnCloseCompleted),
closeNetworkConnectionTaskException,
cancellationToken,
cancellationToken.IsCancellationRequested);
throw;
}
}
}
return true;
}
// MultiThreading: This method has to be called under a thisLock-lock
private void FinishOnCloseCompleted()
{
CleanUp();
}
// MultiThreading: ThreadSafe; No-op if already in a terminal state
public override Task CloseAsync(WebSocketCloseStatus closeStatus,
string? statusDescription,
CancellationToken cancellationToken)
{
WebSocketValidate.ValidateCloseStatus(closeStatus, statusDescription);
return CloseAsyncCore(closeStatus, statusDescription, cancellationToken);
}
private async Task CloseAsyncCore(WebSocketCloseStatus closeStatus,
string? statusDescription,
CancellationToken cancellationToken)
{
ThrowIfPendingException();
if (IsStateTerminal(State))
{
return;
}
ThrowIfDisposed();
bool lockTaken = false;
Monitor.Enter(_thisLock, ref lockTaken);
bool ownsCloseCancellationTokenSource = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
ThrowIfPendingException();
if (IsStateTerminal(State))
{
return;
}
ThrowIfDisposed();
ThrowOnInvalidState(State,
WebSocketState.Open, WebSocketState.CloseReceived, WebSocketState.CloseSent);
Task? closeOutputTask;
ownsCloseCancellationTokenSource = _closeOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken);
if (ownsCloseCancellationTokenSource)
{
closeOutputTask = _closeOutputTask;
if (closeOutputTask == null && State != WebSocketState.CloseSent)
{
_closeReceivedTaskCompletionSource ??= new TaskCompletionSource();
closeOutputTask = CloseOutputAsync(closeStatus,
statusDescription,
linkedCancellationToken);
}
}
else
{
Debug.Assert(_closeReceivedTaskCompletionSource != null, "'_closeReceivedTaskCompletionSource' MUST NOT be NULL.");
closeOutputTask = _closeReceivedTaskCompletionSource.Task;
}
if (closeOutputTask != null)
{
ReleaseLock(_thisLock, ref lockTaken);
try
{
await closeOutputTask.SuppressContextFlow();
}
catch (Exception closeOutputError)
{
Monitor.Enter(_thisLock, ref lockTaken);
if (!CanHandleExceptionDuringClose(closeOutputError))
{
ThrowIfConvertibleException(nameof(CloseOutputAsync),
closeOutputError,
cancellationToken,
linkedCancellationToken.IsCancellationRequested);
throw;
}
}
// When closeOutputTask != null and an exception thrown from await closeOutputTask is handled,
// the lock will be taken in the catch-block. So the logic here avoids taking the lock twice.
if (!lockTaken)
{
Monitor.Enter(_thisLock, ref lockTaken);
}
}
if (OnCloseOutputCompleted())
{
bool callCompleteOnCloseCompleted = false;
try
{
// linkedCancellationToken can be CancellationToken.None if ownsCloseCancellationTokenSource==false
// This is still ok because OnCloseOutputCompleted won't start any IO operation in this case
callCompleteOnCloseCompleted = await StartOnCloseCompleted(
lockTaken, false, linkedCancellationToken).SuppressContextFlow();
}
catch (Exception)
{
// If an exception is thrown we know that the locks have been released,
// because we enforce IWebSocketStream.CloseNetworkConnectionAsync to yield
ResetFlagAndTakeLock(_thisLock, ref lockTaken);
throw;
}
if (callCompleteOnCloseCompleted)
{
ResetFlagAndTakeLock(_thisLock, ref lockTaken);
FinishOnCloseCompleted();
}
}
if (IsStateTerminal(State))
{
return;
}
linkedCancellationToken = CancellationToken.None;
bool ownsReceiveCancellationTokenSource = _receiveOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken);
if (ownsReceiveCancellationTokenSource)
{
_closeAsyncStartedReceive = true;
ArraySegment<byte> closeMessageBuffer =
new ArraySegment<byte>(new byte[HttpWebSocket.MinReceiveBufferSize]);
EnsureReceiveOperation();
Task<WebSocketReceiveResult?> receiveAsyncTask = _receiveOperation!.Process(closeMessageBuffer,
linkedCancellationToken);
ReleaseLock(_thisLock, ref lockTaken);
WebSocketReceiveResult? receiveResult = null;
try
{
receiveResult = await receiveAsyncTask.SuppressContextFlow();
}
catch (Exception receiveException)
{
Monitor.Enter(_thisLock, ref lockTaken);
if (!CanHandleExceptionDuringClose(receiveException))
{
ThrowIfConvertibleException(nameof(CloseAsync),
receiveException,
cancellationToken,
linkedCancellationToken.IsCancellationRequested);
throw;
}
}
// receiveResult is NEVER NULL if WebSocketBase.ReceiveOperation.Process completes successfully
// - but in the close code path we handle some exception if another thread was able to tranistion
// the state into Closed successfully. In this case receiveResult can be NULL and it is safe to
// skip the statements in the if-block.
if (receiveResult != null)
{
if (NetEventSource.Log.IsEnabled() && receiveResult.Count > 0)
{
NetEventSource.DumpBuffer(this, closeMessageBuffer.Array!, closeMessageBuffer.Offset, receiveResult.Count);
}
if (receiveResult.MessageType != WebSocketMessageType.Close)
{
throw new WebSocketException(WebSocketError.InvalidMessageType,
SR.Format(SR.net_WebSockets_InvalidMessageType,
nameof(WebSocket) + "." + nameof(CloseAsync),
nameof(WebSocket) + "." + nameof(CloseOutputAsync),
receiveResult.MessageType));
}
}
}
else
{
_receiveOutstandingOperationHelper.CompleteOperation(ownsReceiveCancellationTokenSource);
ReleaseLock(_thisLock, ref lockTaken);
await _closeReceivedTaskCompletionSource!.Task.SuppressContextFlow();
}
// When ownsReceiveCancellationTokenSource is true and an exception is thrown, the lock will be taken.
// So this logic here is to avoid taking the lock twice.
if (!lockTaken)
{
Monitor.Enter(_thisLock, ref lockTaken);
}
if (!IsStateTerminal(State))
{
bool ownsSendCancellationSource = false;
try
{
// We know that the CloseFrame has been sent at this point. So no Send-operation is allowed anymore and we
// can hijack the _SendOutstandingOperationHelper to create a linkedCancellationToken
ownsSendCancellationSource = _sendOutstandingOperationHelper.TryStartOperation(cancellationToken, out linkedCancellationToken);
Debug.Assert(ownsSendCancellationSource, "'ownsSendCancellationSource' MUST be 'true' at this point.");
bool callCompleteOnCloseCompleted = false;
try
{
// linkedCancellationToken can be CancellationToken.None if ownsCloseCancellationTokenSource==false
// This is still ok because OnCloseOutputCompleted won't start any IO operation in this case
callCompleteOnCloseCompleted = await StartOnCloseCompleted(
lockTaken, false, linkedCancellationToken).SuppressContextFlow();
}
catch (Exception)
{
// If an exception is thrown we know that the locks have been released,
// because we enforce IWebSocketStream.CloseNetworkConnectionAsync to yield
ResetFlagAndTakeLock(_thisLock, ref lockTaken);
throw;
}
if (callCompleteOnCloseCompleted)
{
ResetFlagAndTakeLock(_thisLock, ref lockTaken);
FinishOnCloseCompleted();
}
}
finally
{
_sendOutstandingOperationHelper.CompleteOperation(ownsSendCancellationSource);
}
}
}
catch (Exception exception)
{
bool aborted = linkedCancellationToken.IsCancellationRequested;
Abort();
ThrowIfConvertibleException(nameof(CloseAsync), exception, cancellationToken, aborted);
throw;
}
finally
{
_closeOutstandingOperationHelper.CompleteOperation(ownsCloseCancellationTokenSource);
ReleaseLock(_thisLock, ref lockTaken);
}
}
// MultiThreading: ThreadSafe; No-op if already in a terminal state
public override void Dispose()
{
if (_isDisposed)
{
return;
}
bool thisLockTaken = false;
bool sessionHandleLockTaken = false;
try
{
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
if (_isDisposed)
{
return;
}
if (!IsStateTerminal(State))
{
Abort();
}
else
{
CleanUp();
}
_isDisposed = true;
}
finally
{
ReleaseLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
}
private void ResetFlagAndTakeLock(object lockObject, ref bool thisLockTaken)
{
Debug.Assert(lockObject != null, "'lockObject' MUST NOT be NULL.");
thisLockTaken = false;
Monitor.Enter(lockObject, ref thisLockTaken);
}
private void ResetFlagsAndTakeLocks(ref bool thisLockTaken, ref bool sessionHandleLockTaken)
{
thisLockTaken = false;
sessionHandleLockTaken = false;
TakeLocks(ref thisLockTaken, ref sessionHandleLockTaken);
}
private void TakeLocks(ref bool thisLockTaken, ref bool sessionHandleLockTaken)
{
Debug.Assert(_thisLock != null, "'_thisLock' MUST NOT be NULL.");
Debug.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL.");
Monitor.Enter(SessionHandle, ref sessionHandleLockTaken);
Monitor.Enter(_thisLock, ref thisLockTaken);
}
private void ReleaseLocks(ref bool thisLockTaken, ref bool sessionHandleLockTaken)
{
Debug.Assert(_thisLock != null, "'_thisLock' MUST NOT be NULL.");
Debug.Assert(SessionHandle != null, "'SessionHandle' MUST NOT be NULL.");
if (thisLockTaken)
{
Monitor.Exit(_thisLock);
thisLockTaken = false;
}
if (sessionHandleLockTaken)
{
Monitor.Exit(SessionHandle);
sessionHandleLockTaken = false;
}
}
private void EnsureReceiveOperation()
{
if (_receiveOperation == null)
{
lock (_thisLock)
{
if (_receiveOperation == null)
{
_receiveOperation = new WebSocketOperation.ReceiveOperation(this);
}
}
}
}
private void EnsureSendOperation()
{
if (_sendOperation == null)
{
lock (_thisLock)
{
if (_sendOperation == null)
{
_sendOperation = new WebSocketOperation.SendOperation(this);
}
}
}
}
private void EnsureKeepAliveOperation()
{
if (_keepAliveOperation == null)
{
lock (_thisLock)
{
if (_keepAliveOperation == null)
{
WebSocketOperation.SendOperation keepAliveOperation = new WebSocketOperation.SendOperation(this);
keepAliveOperation.BufferType = WebSocketProtocolComponent.BufferType.UnsolicitedPong;
_keepAliveOperation = keepAliveOperation;
}
}
}
}
private void EnsureCloseOutputOperation()
{
if (_closeOutputOperation == null)
{
lock (_thisLock)
{
if (_closeOutputOperation == null)
{
_closeOutputOperation = new WebSocketOperation.CloseOutputOperation(this);
}
}
}
}
private static void ReleaseLock(object lockObject, ref bool lockTaken)
{
Debug.Assert(lockObject != null, "'lockObject' MUST NOT be NULL.");
if (lockTaken)
{
Monitor.Exit(lockObject);
lockTaken = false;
}
}
private static WebSocketProtocolComponent.BufferType GetBufferType(WebSocketMessageType messageType,
bool endOfMessage)
{
Debug.Assert(messageType == WebSocketMessageType.Binary || messageType == WebSocketMessageType.Text,
$"The value of 'messageType' ({messageType}) is invalid. Valid message types: '{WebSocketMessageType.Binary}, {WebSocketMessageType.Text}'");
if (messageType == WebSocketMessageType.Text)
{
if (endOfMessage)
{
return WebSocketProtocolComponent.BufferType.UTF8Message;
}
return WebSocketProtocolComponent.BufferType.UTF8Fragment;
}
else
{
if (endOfMessage)
{
return WebSocketProtocolComponent.BufferType.BinaryMessage;
}
return WebSocketProtocolComponent.BufferType.BinaryFragment;
}
}
private static WebSocketMessageType GetMessageType(WebSocketProtocolComponent.BufferType bufferType)
{
switch (bufferType)
{
case WebSocketProtocolComponent.BufferType.Close:
return WebSocketMessageType.Close;
case WebSocketProtocolComponent.BufferType.BinaryFragment:
case WebSocketProtocolComponent.BufferType.BinaryMessage:
return WebSocketMessageType.Binary;
case WebSocketProtocolComponent.BufferType.UTF8Fragment:
case WebSocketProtocolComponent.BufferType.UTF8Message:
return WebSocketMessageType.Text;
default:
// This indicates a contract violation of the websocket protocol component,
// because we currently don't support any WebSocket extensions and would
// not accept a Websocket handshake requesting extensions
Debug.Fail($"The value of 'bufferType' ({bufferType}) is invalid.");
throw new WebSocketException(WebSocketError.NativeError,
SR.Format(SR.net_WebSockets_InvalidBufferType,
bufferType,
WebSocketProtocolComponent.BufferType.Close,
WebSocketProtocolComponent.BufferType.BinaryFragment,
WebSocketProtocolComponent.BufferType.BinaryMessage,
WebSocketProtocolComponent.BufferType.UTF8Fragment,
WebSocketProtocolComponent.BufferType.UTF8Message));
}
}
internal void ValidateNativeBuffers(WebSocketProtocolComponent.Action action,
WebSocketProtocolComponent.BufferType bufferType,
Interop.WebSocket.Buffer[] dataBuffers,
uint dataBufferCount)
{
_internalBuffer.ValidateNativeBuffers(action, bufferType, dataBuffers, dataBufferCount);
}
private void ThrowIfAborted(bool aborted, Exception innerException)
{
if (aborted)
{
throw new WebSocketException(WebSocketError.InvalidState,
SR.Format(SR.net_WebSockets_InvalidState_ClosedOrAborted, GetType().FullName, WebSocketState.Aborted),
innerException);
}
}
private bool CanHandleExceptionDuringClose(Exception error)
{
Debug.Assert(error != null, "'error' MUST NOT be NULL.");
if (State != WebSocketState.Closed)
{
return false;
}
return error is OperationCanceledException ||
error is WebSocketException ||
error is SocketException ||
error is HttpListenerException ||
error is IOException;
}
// We only want to throw an OperationCanceledException if the CancellationToken passed
// down from the caller is canceled - not when Abort is called on another thread and
// the linkedCancellationToken is canceled.
private void ThrowIfConvertibleException(string? methodName,
Exception exception,
CancellationToken cancellationToken,
bool aborted)
{
Debug.Assert(exception != null, "'exception' MUST NOT be NULL.");
if (NetEventSource.Log.IsEnabled() && !string.IsNullOrEmpty(methodName))
{
NetEventSource.Error(this, $"methodName: {methodName}, exception: {exception}");
}
OperationCanceledException? operationCanceledException = exception as OperationCanceledException;
if (operationCanceledException != null)
{
if (cancellationToken.IsCancellationRequested ||
!aborted)
{
return;
}
ThrowIfAborted(aborted, exception);
}
WebSocketException? convertedException = exception as WebSocketException;
if (convertedException != null)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfAborted(aborted, convertedException);
return;
}
SocketException? socketException = exception as SocketException;
if (socketException != null)
{
convertedException = new WebSocketException(socketException.NativeErrorCode, socketException);
}
HttpListenerException? httpListenerException = exception as HttpListenerException;
if (httpListenerException != null)
{
convertedException = new WebSocketException(httpListenerException.ErrorCode, httpListenerException);
}
IOException? ioException = exception as IOException;
if (ioException != null)
{
socketException = exception.InnerException as SocketException;
if (socketException != null)
{
convertedException = new WebSocketException(socketException.NativeErrorCode, ioException);
}
}
if (convertedException != null)
{
cancellationToken.ThrowIfCancellationRequested();
ThrowIfAborted(aborted, convertedException);
throw convertedException;
}
AggregateException? aggregateException = exception as AggregateException;
if (aggregateException != null)
{
// Collapse possibly nested graph into a flat list.
// Empty inner exception list is unlikely but possible via public api.
ReadOnlyCollection<Exception> unwrappedExceptions = aggregateException.Flatten().InnerExceptions;
if (unwrappedExceptions.Count == 0)
{
return;
}
foreach (Exception unwrappedException in unwrappedExceptions)
{
ThrowIfConvertibleException(null, unwrappedException, cancellationToken, aborted);
}
}
}
private void CleanUp()
{
// Multithreading: This method is always called under the _ThisLock lock
if (_cleanedUp)
{
return;
}
_cleanedUp = true;
if (SessionHandle != null)
{
SessionHandle.Dispose();
}
if (_internalBuffer != null)
{
_internalBuffer.Dispose(this.State);
}
if (_receiveOutstandingOperationHelper != null)
{
_receiveOutstandingOperationHelper.Dispose();
}
if (_sendOutstandingOperationHelper != null)
{
_sendOutstandingOperationHelper.Dispose();
}
if (_closeOutputOutstandingOperationHelper != null)
{
_closeOutputOutstandingOperationHelper.Dispose();
}
if (_closeOutstandingOperationHelper != null)
{
_closeOutstandingOperationHelper.Dispose();
}
if (_innerStream != null)
{
try
{
_innerStream.Close();
}
catch (ObjectDisposedException)
{
}
catch (IOException)
{
}
catch (SocketException)
{
}
catch (HttpListenerException)
{
}
}
_keepAliveTracker.Dispose();
}
private void OnBackgroundTaskException(Exception exception)
{
if (Interlocked.CompareExchange<Exception>(ref _pendingException!, exception, null!) == null)
{
if (NetEventSource.Log.IsEnabled())
{
NetEventSource.Error(this, exception.ToString());
}
Abort();
}
}
private void ThrowIfPendingException()
{
Exception pendingException = Interlocked.Exchange<Exception>(ref _pendingException!, null!);
if (pendingException != null)
{
throw new WebSocketException(WebSocketError.Faulted, pendingException);
}
}
private void ThrowIfDisposed()
{
ObjectDisposedException.ThrowIf(_isDisposed, this);
}
private void UpdateReceiveState(int newReceiveState, int expectedReceiveState)
{
int receiveState;
if ((receiveState = Interlocked.Exchange(ref _receiveState, newReceiveState)) != expectedReceiveState)
{
Debug.Fail($"'_receiveState' had an invalid value '{receiveState}'. The expected value was '{expectedReceiveState}'.");
}
}
private bool StartOnCloseReceived(ref bool thisLockTaken)
{
ThrowIfDisposed();
if (IsStateTerminal(State) || State == WebSocketState.CloseReceived)
{
return false;
}
Monitor.Enter(_thisLock, ref thisLockTaken);
if (IsStateTerminal(State) || State == WebSocketState.CloseReceived)
{
return false;
}
if (State == WebSocketState.Open)
{
_state = WebSocketState.CloseReceived;
_closeReceivedTaskCompletionSource ??= new TaskCompletionSource();
return false;
}
return true;
}
private void FinishOnCloseReceived(WebSocketCloseStatus closeStatus,
string? closeStatusDescription)
{
_closeReceivedTaskCompletionSource?.TrySetResult();
_closeStatus = closeStatus;
_closeStatusDescription = closeStatusDescription;
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(this, $"closeStatus: {closeStatus}, closeStatusDescription: {closeStatusDescription}, _State: {_state}");
}
private static async void OnKeepAlive(object? sender)
{
Debug.Assert(sender != null, "'sender' MUST NOT be NULL.");
Debug.Assert((sender as WebSocketBase) != null, "'sender as WebSocketBase' MUST NOT be NULL.");
WebSocketBase? thisPtr = (sender as WebSocketBase)!;
bool lockTaken = false;
CancellationToken linkedCancellationToken = CancellationToken.None;
try
{
Monitor.Enter(thisPtr.SessionHandle, ref lockTaken);
if (thisPtr._isDisposed ||
thisPtr._state != WebSocketState.Open ||
thisPtr._closeOutputTask != null)
{
return;
}
if (thisPtr._keepAliveTracker.ShouldSendKeepAlive())
{
bool ownsCancellationTokenSource = false;
try
{
ownsCancellationTokenSource = thisPtr._sendOutstandingOperationHelper.TryStartOperation(CancellationToken.None, out linkedCancellationToken);
if (ownsCancellationTokenSource)
{
thisPtr.EnsureKeepAliveOperation();
thisPtr._keepAliveTask = thisPtr._keepAliveOperation!.Process(null, linkedCancellationToken);
ReleaseLock(thisPtr.SessionHandle, ref lockTaken);
await thisPtr._keepAliveTask!.SuppressContextFlow();
}
}
finally
{
if (!lockTaken)
{
Monitor.Enter(thisPtr.SessionHandle, ref lockTaken);
}
thisPtr._sendOutstandingOperationHelper.CompleteOperation(ownsCancellationTokenSource);
thisPtr._keepAliveTask = null;
}
thisPtr._keepAliveTracker.ResetTimer();
}
}
catch (Exception exception)
{
try
{
thisPtr.ThrowIfConvertibleException(nameof(OnKeepAlive),
exception,
CancellationToken.None,
linkedCancellationToken.IsCancellationRequested);
throw;
}
catch (Exception backgroundException)
{
thisPtr.OnBackgroundTaskException(backgroundException);
}
}
finally
{
ReleaseLock(thisPtr.SessionHandle, ref lockTaken);
}
}
private abstract class WebSocketOperation
{
protected bool AsyncOperationCompleted { get; set; }
private readonly WebSocketBase _webSocket;
internal WebSocketOperation(WebSocketBase webSocket)
{
Debug.Assert(webSocket != null, "'webSocket' MUST NOT be NULL.");
_webSocket = webSocket;
AsyncOperationCompleted = false;
}
public WebSocketReceiveResult? ReceiveResult { get; protected set; }
protected abstract int BufferCount { get; }
protected abstract WebSocketProtocolComponent.ActionQueue ActionQueue { get; }
protected abstract void Initialize(Nullable<ArraySegment<byte>> buffer, CancellationToken cancellationToken);
protected abstract bool ShouldContinue(CancellationToken cancellationToken);
// Multi-Threading: This method has to be called under a SessionHandle-lock. It returns true if a
// close frame was received. Handling the received close frame might involve IO - to make the locking
// strategy easier and reduce one level in the await-hierarchy the IO is kicked off by the caller.
protected abstract bool ProcessAction_NoAction();
protected virtual void ProcessAction_IndicateReceiveComplete(
Nullable<ArraySegment<byte>> buffer,
WebSocketProtocolComponent.BufferType bufferType,
WebSocketProtocolComponent.Action action,
Interop.WebSocket.Buffer[] dataBuffers,
uint dataBufferCount,
IntPtr actionContext)
{
throw new NotImplementedException();
}
protected abstract void Cleanup();
internal async Task<WebSocketReceiveResult?> Process(Nullable<ArraySegment<byte>> buffer,
CancellationToken cancellationToken)
{
Debug.Assert(BufferCount >= 1 && BufferCount <= 2, "'bufferCount' MUST ONLY BE '1' or '2'.");
bool sessionHandleLockTaken = false;
AsyncOperationCompleted = false;
ReceiveResult = null;
try
{
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
_webSocket.ThrowIfPendingException();
Initialize(buffer, cancellationToken);
while (ShouldContinue(cancellationToken))
{
WebSocketProtocolComponent.Action action;
WebSocketProtocolComponent.BufferType bufferType;
bool completed = false;
while (!completed)
{
Interop.WebSocket.Buffer[] dataBuffers =
new Interop.WebSocket.Buffer[BufferCount];
uint dataBufferCount = (uint)BufferCount;
IntPtr actionContext;
_webSocket.ThrowIfDisposed();
WebSocketProtocolComponent.WebSocketGetAction(_webSocket,
ActionQueue,
dataBuffers,
ref dataBufferCount,
out action,
out bufferType,
out actionContext);
switch (action)
{
case WebSocketProtocolComponent.Action.NoAction:
if (ProcessAction_NoAction())
{
// A close frame was received
Debug.Assert(ReceiveResult!.Count == 0, "'receiveResult.Count' MUST be 0.");
Debug.Assert(ReceiveResult.CloseStatus != null, "'receiveResult.CloseStatus' MUST NOT be NULL for message type 'Close'.");
bool thisLockTaken = false;
try
{
if (_webSocket.StartOnCloseReceived(ref thisLockTaken))
{
// If StartOnCloseReceived returns true the WebSocket close handshake has been completed
// so there is no need to retake the SessionHandle-lock.
// _ThisLock lock is guaranteed to be taken by StartOnCloseReceived when returning true
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
bool callCompleteOnCloseCompleted = false;
try
{
callCompleteOnCloseCompleted = await _webSocket.StartOnCloseCompleted(
thisLockTaken, sessionHandleLockTaken, cancellationToken).SuppressContextFlow();
}
catch (Exception)
{
// If an exception is thrown we know that the locks have been released,
// because we enforce IWebSocketStream.CloseNetworkConnectionAsync to yield
_webSocket.ResetFlagAndTakeLock(_webSocket._thisLock, ref thisLockTaken);
throw;
}
if (callCompleteOnCloseCompleted)
{
_webSocket.ResetFlagAndTakeLock(_webSocket._thisLock, ref thisLockTaken);
_webSocket.FinishOnCloseCompleted();
}
}
_webSocket.FinishOnCloseReceived(ReceiveResult.CloseStatus.Value, ReceiveResult.CloseStatusDescription);
}
finally
{
if (thisLockTaken)
{
ReleaseLock(_webSocket._thisLock, ref thisLockTaken);
}
}
}
completed = true;
break;
case WebSocketProtocolComponent.Action.IndicateReceiveComplete:
ProcessAction_IndicateReceiveComplete(buffer,
bufferType,
action,
dataBuffers,
dataBufferCount,
actionContext);
break;
case WebSocketProtocolComponent.Action.ReceiveFromNetwork:
int count = 0;
try
{
ArraySegment<byte> payload = _webSocket._internalBuffer.ConvertNativeBuffer(action, dataBuffers[0], bufferType);
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
HttpWebSocket.ThrowIfConnectionAborted(_webSocket._innerStream, true);
try
{
Task<int> readTask = _webSocket._innerStream.ReadAsync(payload.Array!,
payload.Offset,
payload.Count,
cancellationToken);
count = await readTask.SuppressContextFlow();
_webSocket._keepAliveTracker.OnDataReceived();
}
catch (ObjectDisposedException objectDisposedException)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, objectDisposedException);
}
catch (NotSupportedException notSupportedException)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely, notSupportedException);
}
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
_webSocket.ThrowIfPendingException();
// If the client unexpectedly closed the socket we throw an exception as we didn't get any close message
if (count == 0)
{
throw new WebSocketException(WebSocketError.ConnectionClosedPrematurely);
}
}
finally
{
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket,
actionContext,
count);
}
break;
case WebSocketProtocolComponent.Action.IndicateSendComplete:
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket, actionContext, 0);
AsyncOperationCompleted = true;
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
await _webSocket._innerStream.FlushAsync(cancellationToken).SuppressContextFlow();
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
break;
case WebSocketProtocolComponent.Action.SendToNetwork:
int bytesSent = 0;
try
{
if (_webSocket.State != WebSocketState.CloseSent ||
(bufferType != WebSocketProtocolComponent.BufferType.PingPong &&
bufferType != WebSocketProtocolComponent.BufferType.UnsolicitedPong))
{
if (dataBufferCount == 0)
{
break;
}
List<ArraySegment<byte>> sendBuffers = new List<ArraySegment<byte>>((int)dataBufferCount);
int sendBufferSize = 0;
ArraySegment<byte> framingBuffer = _webSocket._internalBuffer.ConvertNativeBuffer(action, dataBuffers[0], bufferType);
sendBuffers.Add(framingBuffer);
sendBufferSize += framingBuffer.Count;
// There can be at most 2 dataBuffers
// - one for the framing header and one for the payload
if (dataBufferCount == 2)
{
ArraySegment<byte> payload;
// The second buffer might be from the pinned send payload buffer (1) or from the
// internal native buffer (2). In the case of a PONG response being generated, the buffer
// would be from (2). Even if the payload is from a WebSocketSend operation, the buffer
// might be (1) only if no buffer copies were needed (in the case of no masking, for example).
// Or it might be (2). So, we need to check.
if (_webSocket._internalBuffer.IsPinnedSendPayloadBuffer(dataBuffers[1], bufferType))
{
payload = _webSocket._internalBuffer.ConvertPinnedSendPayloadFromNative(dataBuffers[1], bufferType);
}
else
{
payload = _webSocket._internalBuffer.ConvertNativeBuffer(action, dataBuffers[1], bufferType);
}
sendBuffers.Add(payload);
sendBufferSize += payload.Count;
}
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
HttpWebSocket.ThrowIfConnectionAborted(_webSocket._innerStream, false);
await _webSocket.SendFrameAsync(sendBuffers, cancellationToken).SuppressContextFlow();
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
_webSocket.ThrowIfPendingException();
bytesSent += sendBufferSize;
_webSocket._keepAliveTracker.OnDataSent();
}
}
finally
{
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket,
actionContext,
bytesSent);
}
break;
default:
Debug.Fail($"Invalid action '{action}' returned from WebSocketGetAction.");
throw new InvalidOperationException();
}
}
// WebSocketGetAction has returned NO_ACTION. In general, WebSocketGetAction will return
// NO_ACTION if there is no work item available to process at the current moment. But
// there could be work items on the queue still. Those work items can't be returned back
// until the current work item (being done by another thread) is complete.
//
// It's possible that another thread might be finishing up an async operation and needs
// to call WebSocketCompleteAction. Once that happens, calling WebSocketGetAction on this
// thread might return something else to do. This happens, for example, if the RECEIVE thread
// ends up having to begin sending out a PONG response (due to it receiving a PING) and the
// current SEND thread has posted a WebSocketSend but it can't be processed yet until the
// RECEIVE thread has finished sending out the PONG response.
//
// So, we need to release the lock briefly to give the other thread a chance to finish
// processing. We won't actually exit this outter loop and return from this async method
// until the caller's async operation has been fully completed.
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
Monitor.Enter(_webSocket.SessionHandle, ref sessionHandleLockTaken);
}
}
finally
{
Cleanup();
ReleaseLock(_webSocket.SessionHandle, ref sessionHandleLockTaken);
}
return ReceiveResult;
}
public sealed class ReceiveOperation : WebSocketOperation
{
private int _receiveState;
private bool _pongReceived;
private bool _receiveCompleted;
public ReceiveOperation(WebSocketBase webSocket)
: base(webSocket)
{
}
protected override WebSocketProtocolComponent.ActionQueue ActionQueue
{
get { return WebSocketProtocolComponent.ActionQueue.Receive; }
}
protected override int BufferCount
{
get { return 1; }
}
protected override void Initialize(Nullable<ArraySegment<byte>> buffer, CancellationToken cancellationToken)
{
Debug.Assert(buffer != null, "'buffer' MUST NOT be NULL.");
_pongReceived = false;
_receiveCompleted = false;
_webSocket.ThrowIfDisposed();
int originalReceiveState = Interlocked.CompareExchange(ref _webSocket._receiveState,
ReceiveState.Application, ReceiveState.Idle);
switch (originalReceiveState)
{
case ReceiveState.Idle:
_receiveState = ReceiveState.Application;
break;
case ReceiveState.Application:
Debug.Fail("'originalReceiveState' MUST NEVER be ReceiveState.Application at this point.");
break;
case ReceiveState.PayloadAvailable:
WebSocketReceiveResult receiveResult;
if (!_webSocket._internalBuffer.ReceiveFromBufferedPayload(buffer.Value, out receiveResult))
{
_webSocket.UpdateReceiveState(ReceiveState.Idle, ReceiveState.PayloadAvailable);
}
ReceiveResult = receiveResult;
_receiveCompleted = true;
break;
default:
Debug.Fail($"Invalid ReceiveState '{originalReceiveState}'.");
break;
}
}
protected override void Cleanup()
{
}
protected override bool ShouldContinue(CancellationToken cancellationToken)
{
cancellationToken.ThrowIfCancellationRequested();
if (_receiveCompleted)
{
return false;
}
_webSocket.ThrowIfDisposed();
_webSocket.ThrowIfPendingException();
WebSocketProtocolComponent.WebSocketReceive(_webSocket);
return true;
}
protected override bool ProcessAction_NoAction()
{
if (_pongReceived)
{
_receiveCompleted = false;
_pongReceived = false;
return false;
}
Debug.Assert(ReceiveResult != null,
"'ReceiveResult' MUST NOT be NULL.");
_receiveCompleted = true;
if (ReceiveResult.MessageType == WebSocketMessageType.Close)
{
return true;
}
return false;
}
protected override void ProcessAction_IndicateReceiveComplete(
Nullable<ArraySegment<byte>> buffer,
WebSocketProtocolComponent.BufferType bufferType,
WebSocketProtocolComponent.Action action,
Interop.WebSocket.Buffer[] dataBuffers,
uint dataBufferCount,
IntPtr actionContext)
{
Debug.Assert(buffer != null, "'buffer MUST NOT be NULL.");
int bytesTransferred = 0;
_pongReceived = false;
if (bufferType == WebSocketProtocolComponent.BufferType.PingPong)
{
// ignoring received pong frame
_pongReceived = true;
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket,
actionContext,
bytesTransferred);
return;
}
WebSocketReceiveResult receiveResult;
try
{
ArraySegment<byte> payload;
WebSocketMessageType messageType = GetMessageType(bufferType);
int newReceiveState = ReceiveState.Idle;
if (bufferType == WebSocketProtocolComponent.BufferType.Close)
{
payload = ArraySegment<byte>.Empty;
_webSocket._internalBuffer.ConvertCloseBuffer(action, dataBuffers[0], out WebSocketCloseStatus closeStatus, out string? reason);
receiveResult = new WebSocketReceiveResult(bytesTransferred,
messageType, true, closeStatus, reason);
}
else
{
payload = _webSocket._internalBuffer.ConvertNativeBuffer(action, dataBuffers[0], bufferType);
bool endOfMessage = bufferType ==
WebSocketProtocolComponent.BufferType.BinaryMessage ||
bufferType == WebSocketProtocolComponent.BufferType.UTF8Message ||
bufferType == WebSocketProtocolComponent.BufferType.Close;
if (payload.Count > buffer.Value.Count)
{
_webSocket._internalBuffer.BufferPayload(payload, buffer.Value.Count, messageType, endOfMessage);
newReceiveState = ReceiveState.PayloadAvailable;
endOfMessage = false;
}
bytesTransferred = Math.Min(payload.Count, (int)buffer.Value.Count);
if (bytesTransferred > 0)
{
Buffer.BlockCopy(payload.Array!,
payload.Offset,
buffer.Value.Array!,
buffer.Value.Offset,
bytesTransferred);
}
receiveResult = new WebSocketReceiveResult(bytesTransferred, messageType, endOfMessage);
}
_webSocket.UpdateReceiveState(newReceiveState, _receiveState);
}
finally
{
WebSocketProtocolComponent.WebSocketCompleteAction(_webSocket,
actionContext,
bytesTransferred);
}
ReceiveResult = receiveResult;
}
}
public class SendOperation : WebSocketOperation
{
protected bool _BufferHasBeenPinned;
public SendOperation(WebSocketBase webSocket)
: base(webSocket)
{
}
protected override WebSocketProtocolComponent.ActionQueue ActionQueue
{
get { return WebSocketProtocolComponent.ActionQueue.Send; }
}
protected override int BufferCount
{
get { return 2; }
}
protected virtual Nullable<Interop.WebSocket.Buffer> CreateBuffer(Nullable<ArraySegment<byte>> buffer)
{
if (buffer == null)
{
return null;
}
Interop.WebSocket.Buffer payloadBuffer;
payloadBuffer = default;
_webSocket._internalBuffer.PinSendBuffer(buffer.Value, out _BufferHasBeenPinned);
payloadBuffer.Data.BufferData = _webSocket._internalBuffer.ConvertPinnedSendPayloadToNative(buffer.Value);
payloadBuffer.Data.BufferLength = (uint)buffer.Value.Count;
return payloadBuffer;
}
protected override bool ProcessAction_NoAction()
{
return false;
}
protected override void Cleanup()
{
if (_BufferHasBeenPinned)
{
_BufferHasBeenPinned = false;
_webSocket._internalBuffer.ReleasePinnedSendBuffer();
}
}
internal WebSocketProtocolComponent.BufferType BufferType { get; set; }
protected override void Initialize(Nullable<ArraySegment<byte>> buffer,
CancellationToken cancellationToken)
{
Debug.Assert(!_BufferHasBeenPinned, "'_BufferHasBeenPinned' MUST NOT be pinned at this point.");
_webSocket.ThrowIfDisposed();
_webSocket.ThrowIfPendingException();
Nullable<Interop.WebSocket.Buffer> payloadBuffer = CreateBuffer(buffer);
if (payloadBuffer != null)
{
WebSocketProtocolComponent.WebSocketSend(_webSocket, BufferType, payloadBuffer.Value);
}
else
{
WebSocketProtocolComponent.WebSocketSendWithoutBody(_webSocket, BufferType);
}
}
protected override bool ShouldContinue(CancellationToken cancellationToken)
{
Debug.Assert(ReceiveResult == null, "'ReceiveResult' MUST be NULL.");
if (AsyncOperationCompleted)
{
return false;
}
cancellationToken.ThrowIfCancellationRequested();
return true;
}
}
public sealed class CloseOutputOperation : SendOperation
{
public CloseOutputOperation(WebSocketBase webSocket)
: base(webSocket)
{
BufferType = WebSocketProtocolComponent.BufferType.Close;
}
internal WebSocketCloseStatus CloseStatus { get; set; }
internal string? CloseReason { get; set; }
protected override Nullable<Interop.WebSocket.Buffer> CreateBuffer(Nullable<ArraySegment<byte>> buffer)
{
Debug.Assert(buffer == null, "'buffer' MUST BE NULL.");
_webSocket.ThrowIfDisposed();
_webSocket.ThrowIfPendingException();
if (CloseStatus == WebSocketCloseStatus.Empty)
{
return null;
}
Interop.WebSocket.Buffer payloadBuffer = default;
if (CloseReason != null)
{
byte[] blob = Encoding.UTF8.GetBytes(CloseReason);
Debug.Assert(blob.Length <= WebSocketValidate.MaxControlFramePayloadLength,
"The close reason is too long.");
ArraySegment<byte> closeBuffer = new ArraySegment<byte>(blob, 0, Math.Min(WebSocketValidate.MaxControlFramePayloadLength, blob.Length));
_webSocket._internalBuffer.PinSendBuffer(closeBuffer, out _BufferHasBeenPinned);
payloadBuffer.CloseStatus.ReasonData = _webSocket._internalBuffer.ConvertPinnedSendPayloadToNative(closeBuffer);
payloadBuffer.CloseStatus.ReasonLength = (uint)closeBuffer.Count;
}
payloadBuffer.CloseStatus.CloseStatus = (ushort)CloseStatus;
return payloadBuffer;
}
}
}
private abstract class KeepAliveTracker : IDisposable
{
// Multi-Threading: only one thread at a time is allowed to call OnDataReceived or OnDataSent
// - but both methods can be called from different threads at the same time.
public abstract void OnDataReceived();
public abstract void OnDataSent();
public abstract void Dispose();
public abstract void StartTimer(WebSocketBase webSocket);
public abstract void ResetTimer();
public abstract bool ShouldSendKeepAlive();
public static KeepAliveTracker Create(TimeSpan keepAliveInterval)
{
if ((int)keepAliveInterval.TotalMilliseconds > 0)
{
return new DefaultKeepAliveTracker(keepAliveInterval);
}
return new DisabledKeepAliveTracker();
}
private sealed class DisabledKeepAliveTracker : KeepAliveTracker
{
public override void OnDataReceived()
{
}
public override void OnDataSent()
{
}
public override void ResetTimer()
{
}
public override void StartTimer(WebSocketBase webSocket)
{
}
public override bool ShouldSendKeepAlive()
{
return false;
}
public override void Dispose()
{
}
}
private sealed class DefaultKeepAliveTracker : KeepAliveTracker
{
private static readonly TimerCallback s_KeepAliveTimerElapsedCallback = new TimerCallback(OnKeepAlive);
private readonly TimeSpan _keepAliveInterval;
private long _lastSendActivityTimestamp;
private long _lastReceiveActivityTimestamp;
private Timer? _keepAliveTimer;
public DefaultKeepAliveTracker(TimeSpan keepAliveInterval)
{
_keepAliveInterval = keepAliveInterval;
}
public override void OnDataReceived()
{
_lastReceiveActivityTimestamp = Stopwatch.GetTimestamp();
}
public override void OnDataSent()
{
_lastSendActivityTimestamp = Stopwatch.GetTimestamp();
}
public override void ResetTimer()
{
ResetTimer((int)_keepAliveInterval.TotalMilliseconds);
}
public override void StartTimer(WebSocketBase webSocket)
{
Debug.Assert(webSocket != null, "'webSocket' MUST NOT be NULL.");
Debug.Assert(webSocket._keepAliveTracker != null,
"'webSocket._KeepAliveTracker' MUST NOT be NULL at this point.");
int keepAliveIntervalMilliseconds = (int)_keepAliveInterval.TotalMilliseconds;
Debug.Assert(keepAliveIntervalMilliseconds > 0, "'keepAliveIntervalMilliseconds' MUST be POSITIVE.");
// The correct pattern is to first initialize the Timer object, assign it to the member variable
// and only afterwards enable the Timer. This is required because the constructor, together with
// the assignment are not guaranteed to be an atomic operation, which creates a race between the
// assignment and the Timer callback.
_keepAliveTimer = new Timer(s_KeepAliveTimerElapsedCallback, webSocket, Timeout.Infinite,
Timeout.Infinite);
_keepAliveTimer.Change(keepAliveIntervalMilliseconds, Timeout.Infinite);
}
public override bool ShouldSendKeepAlive()
{
TimeSpan idleTime = GetIdleTime();
if (idleTime >= _keepAliveInterval)
{
return true;
}
ResetTimer((int)(_keepAliveInterval - idleTime).TotalMilliseconds);
return false;
}
public override void Dispose()
{
_keepAliveTimer!.Dispose();
}
private void ResetTimer(int dueInMilliseconds)
{
_keepAliveTimer!.Change(dueInMilliseconds, Timeout.Infinite);
}
private TimeSpan GetIdleTime()
{
TimeSpan sinceLastSendActivity = GetTimeElapsed(_lastSendActivityTimestamp);
TimeSpan sinceLastReceiveActivity = GetTimeElapsed(_lastReceiveActivityTimestamp);
if (sinceLastReceiveActivity < sinceLastSendActivity)
{
return sinceLastReceiveActivity;
}
return sinceLastSendActivity;
}
private TimeSpan GetTimeElapsed(long timestamp) => timestamp != 0 ?
Stopwatch.GetElapsedTime(timestamp) :
_keepAliveInterval;
}
}
private sealed class OutstandingOperationHelper : IDisposable
{
private volatile int _operationsOutstanding;
private volatile CancellationTokenSource? _cancellationTokenSource;
private volatile bool _isDisposed;
private readonly object _thisLock = new object();
public bool TryStartOperation(CancellationToken userCancellationToken, out CancellationToken linkedCancellationToken)
{
linkedCancellationToken = CancellationToken.None;
ThrowIfDisposed();
lock (_thisLock)
{
int operationsOutstanding = ++_operationsOutstanding;
if (operationsOutstanding == 1)
{
linkedCancellationToken = CreateLinkedCancellationToken(userCancellationToken);
return true;
}
Debug.Assert(operationsOutstanding >= 1, "'operationsOutstanding' must never be smaller than 1.");
return false;
}
}
public void CompleteOperation(bool ownsCancellationTokenSource)
{
if (_isDisposed)
{
// no-op if the WebSocket is already aborted
return;
}
CancellationTokenSource? snapshot = null;
lock (_thisLock)
{
--_operationsOutstanding;
Debug.Assert(_operationsOutstanding >= 0, "'_OperationsOutstanding' must never be smaller than 0.");
if (ownsCancellationTokenSource)
{
snapshot = _cancellationTokenSource;
_cancellationTokenSource = null;
}
}
if (snapshot != null)
{
snapshot.Dispose();
}
}
// Has to be called under _ThisLock lock
private CancellationToken CreateLinkedCancellationToken(CancellationToken cancellationToken)
{
var linkedCancellationTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken);
Debug.Assert(_cancellationTokenSource == null, "'_cancellationTokenSource' MUST be NULL.");
_cancellationTokenSource = linkedCancellationTokenSource;
return linkedCancellationTokenSource.Token;
}
public void CancelIO()
{
CancellationTokenSource? cancellationTokenSourceSnapshot = null;
lock (_thisLock)
{
if (_operationsOutstanding == 0)
{
return;
}
cancellationTokenSourceSnapshot = _cancellationTokenSource;
}
if (cancellationTokenSourceSnapshot != null)
{
try
{
cancellationTokenSourceSnapshot.Cancel();
}
catch (ObjectDisposedException)
{
// Simply ignore this exception - There is apparently a rare race condition
// where the cancellationTokensource is disposed before the Cancel method call completed.
}
}
}
public void Dispose()
{
if (_isDisposed)
{
return;
}
CancellationTokenSource? snapshot = null;
lock (_thisLock)
{
if (_isDisposed)
{
return;
}
_isDisposed = true;
snapshot = _cancellationTokenSource;
_cancellationTokenSource = null;
}
if (snapshot != null)
{
snapshot.Dispose();
}
}
private void ThrowIfDisposed()
{
ObjectDisposedException.ThrowIf(_isDisposed, this);
}
}
internal interface IWebSocketStream
{
// Switching to opaque mode will change the behavior to use the knowledge that the WebSocketBase class
// is pinning all payloads already and that we will have at most one outstanding send and receive at any
// given time. This allows us to avoid creation of OverlappedData and pinning for each operation.
void SwitchToOpaqueMode(WebSocketBase webSocket);
void Abort();
bool SupportsMultipleWrite { get; }
Task MultipleWriteAsync(IList<ArraySegment<byte>> buffers, CancellationToken cancellationToken);
// Any implementation has to guarantee that no exception is thrown synchronously
// for example by enforcing a Task.Yield at the beginning of the method
// This is necessary to enforce an API contract (for WebSocketBase.StartOnCloseCompleted) that ensures
// that all locks have been released whenever an exception is thrown from it.
Task CloseNetworkConnectionAsync(CancellationToken cancellationToken);
}
private static class ReceiveState
{
internal const int SendOperation = -1;
internal const int Idle = 0;
internal const int Application = 1;
internal const int PayloadAvailable = 2;
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.NameResolution/src/System.Net.NameResolution.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == 'Browser' or '$(TargetPlatformIdentifier)' == ''">SR.SystemNetNameResolution_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<ApiExclusionListPath Condition="'$(TargetPlatformIdentifier)' == 'Browser'">ExcludeApiList.PNSE.Browser.txt</ApiExclusionListPath>
</PropertyGroup>
<ItemGroup Condition="'$(GeneratePlatformNotSupportedAssemblyMessage)' == ''">
<Compile Include="System\Net\Dns.cs" />
<Compile Include="System\Net\IPHostEntry.cs" />
<Compile Include="System\Net\NetEventSource.NameResolution.cs" />
<Compile Include="System\Net\NameResolutionTelemetry.cs" />
<!-- Logging -->
<Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
<Compile Include="$(CommonPath)System\Net\InternalException.cs"
Link="Common\System\Net\InternalException.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="$(CommonPath)Extensions\ValueStopwatch\ValueStopwatch.cs"
Link="Common\Extensions\ValueStopwatch\ValueStopwatch.cs" />
<!-- System.Net common -->
<Compile Include="$(CommonPath)System\Net\Sockets\ProtocolType.cs"
Link="Common\System\Net\Sockets\ProtocolType.cs" />
<Compile Include="$(CommonPath)System\Net\Sockets\SocketType.cs"
Link="Common\System\Net\Sockets\SocketType.cs" />
<Compile Include="$(CommonPath)System\Net\IPAddressParserStatics.cs"
Link="Common\System\Net\IPAddressParserStatics.cs" />
<Compile Include="$(CommonPath)System\Net\IPEndPointStatics.cs"
Link="Common\System\Net\IPEndPointStatics.cs" />
<Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.cs"
Link="Common\System\Net\SocketProtocolSupportPal.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<Compile Include="System\Net\NameResolutionPal.Windows.cs" />
<!-- Debug only -->
<Compile Include="$(CommonPath)System\Net\DebugSafeHandle.cs"
Link="Common\System\Net\DebugSafeHandle.cs" />
<!-- System.Net.Internals -->
<Compile Include="$(CommonPath)System\Net\Internals\IPAddressExtensions.cs"
Link="Common\System\Net\Internals\IPAddressExtensions.cs" />
<Compile Include="$(CommonPath)System\Net\Internals\SocketExceptionFactory.Windows.cs"
Link="Common\System\Net\Internals\SocketExceptionFactory.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.Windows.cs"
Link="Common\System\Net\SocketProtocolSupportPal.Windows" />
<Compile Include="$(CommonPath)System\Net\SocketAddressPal.Windows.cs"
Link="Common\System\Net\SocketAddressPal.Windows" />
<!-- Interop -->
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.LoadLibraryEx_IntPtr.cs"
Link="Common\Interop\Windows\Kernel32\Interop.LoadLibraryEx_IntPtr.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\AddressInfoHints.cs"
Link="Common\Interop\Windows\WinSock\AddressInfoHints.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.closesocket.cs"
Link="Common\Interop\Windows\WinSock\Interop.closesocket.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.gethostname.cs"
Link="Common\Interop\Windows\WinSock\Interop.gethostname.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetNameInfoW.cs"
Link="Common\Interop\Windows\WinSock\Interop.GetNameInfoW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetAddrInfoW.cs"
Link="Common\Interop\Windows\WinSock\Interop.GetAddrInfoW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.WSAStartup.cs"
Link="Common\Interop\Windows\WinSock\Interop.WSAStartup.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.WSASocketW.cs"
Link="Common\Interop\Windows\WinSock\Interop.WSASocketW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.SocketConstructorFlags.cs"
Link="Common\Interop\Windows\WinSock\Interop.SocketConstructorFlags.cs" />
<Compile Include="$(CommonPath)System\Net\Sockets\ProtocolFamily.cs"
Link="Common\System\Net\Sockets\ProtocolFamily.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetAddrInfoExW.cs"
Link="Common\Interop\Windows\WinSock\Interop.GetAddrInfoExW.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Unix'">
<Compile Include="System\Net\NameResolutionPal.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\InteropIPAddressExtensions.Unix.cs"
Link="Common\System\Net\InteropIPAddressExtensions.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\SocketAddressPal.Unix.cs"
Link="Common\System\Net\Internals\SocketAddressPal.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.Unix.cs"
Link="Common\System\Net\SocketProtocolSupportPal.Unix" />
<Compile Include="$(CommonPath)System\Net\Internals\SocketExceptionFactory.cs"
Link="Common\System\Net\Internals\SocketExceptionFactory.cs" />
<Compile Include="$(CommonPath)System\Net\Internals\SocketExceptionFactory.Unix.cs"
Link="Common\System\Net\Internals\SocketExceptionFactory.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Interop.CheckedAccess.cs"
Link="Common\System\Net\Internals\Interop.CheckedAccess.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Link="Common\Interop\CoreLib\Unix\Interop.Errors.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Close.cs"
Link="Common\Interop\Unix\System.Native\Interop.Close.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetHostName.cs"
Link="Common\Interop\Unix\System.Native\Interop.GetHostName.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetNameInfo.cs"
Link="Common\Interop\Unix\System.Native\Interop.GetNameInfo.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.HostEntry.cs"
Link="Common\Interop\Unix\System.Native\Interop.HostEntries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.IPAddress.cs"
Link="Common\Interop\Unix\System.Native\Interop.IPAddress.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Socket.cs"
Link="Common\Interop\Unix\System.Native\Interop.Socket.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.SocketAddress.cs"
Link="Common\Interop\Unix\System.Native\Interop.SocketAddress.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Browser'">
<Compile Include="System\Net\Dns.Browser.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.Handles" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.Claims" />
<Reference Include="System.Security.Principal.Windows" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Overlapped" />
<Reference Include="System.Threading.ThreadPool" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == 'Browser' or '$(TargetPlatformIdentifier)' == ''">SR.SystemNetNameResolution_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<ApiExclusionListPath Condition="'$(TargetPlatformIdentifier)' == 'Browser'">ExcludeApiList.PNSE.Browser.txt</ApiExclusionListPath>
</PropertyGroup>
<ItemGroup Condition="'$(GeneratePlatformNotSupportedAssemblyMessage)' == ''">
<Compile Include="System\Net\Dns.cs" />
<Compile Include="System\Net\IPHostEntry.cs" />
<Compile Include="System\Net\NetEventSource.NameResolution.cs" />
<Compile Include="System\Net\NameResolutionTelemetry.cs" />
<!-- Logging -->
<Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
<Compile Include="$(CommonPath)System\Net\InternalException.cs"
Link="Common\System\Net\InternalException.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<!-- System.Net common -->
<Compile Include="$(CommonPath)System\Net\Sockets\ProtocolType.cs"
Link="Common\System\Net\Sockets\ProtocolType.cs" />
<Compile Include="$(CommonPath)System\Net\Sockets\SocketType.cs"
Link="Common\System\Net\Sockets\SocketType.cs" />
<Compile Include="$(CommonPath)System\Net\IPAddressParserStatics.cs"
Link="Common\System\Net\IPAddressParserStatics.cs" />
<Compile Include="$(CommonPath)System\Net\IPEndPointStatics.cs"
Link="Common\System\Net\IPEndPointStatics.cs" />
<Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.cs"
Link="Common\System\Net\SocketProtocolSupportPal.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<Compile Include="System\Net\NameResolutionPal.Windows.cs" />
<!-- Debug only -->
<Compile Include="$(CommonPath)System\Net\DebugSafeHandle.cs"
Link="Common\System\Net\DebugSafeHandle.cs" />
<!-- System.Net.Internals -->
<Compile Include="$(CommonPath)System\Net\Internals\IPAddressExtensions.cs"
Link="Common\System\Net\Internals\IPAddressExtensions.cs" />
<Compile Include="$(CommonPath)System\Net\Internals\SocketExceptionFactory.Windows.cs"
Link="Common\System\Net\Internals\SocketExceptionFactory.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.Windows.cs"
Link="Common\System\Net\SocketProtocolSupportPal.Windows" />
<Compile Include="$(CommonPath)System\Net\SocketAddressPal.Windows.cs"
Link="Common\System\Net\SocketAddressPal.Windows" />
<!-- Interop -->
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.LoadLibraryEx_IntPtr.cs"
Link="Common\Interop\Windows\Kernel32\Interop.LoadLibraryEx_IntPtr.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\AddressInfoHints.cs"
Link="Common\Interop\Windows\WinSock\AddressInfoHints.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.closesocket.cs"
Link="Common\Interop\Windows\WinSock\Interop.closesocket.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.gethostname.cs"
Link="Common\Interop\Windows\WinSock\Interop.gethostname.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetNameInfoW.cs"
Link="Common\Interop\Windows\WinSock\Interop.GetNameInfoW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetAddrInfoW.cs"
Link="Common\Interop\Windows\WinSock\Interop.GetAddrInfoW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.WSAStartup.cs"
Link="Common\Interop\Windows\WinSock\Interop.WSAStartup.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.WSASocketW.cs"
Link="Common\Interop\Windows\WinSock\Interop.WSASocketW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.SocketConstructorFlags.cs"
Link="Common\Interop\Windows\WinSock\Interop.SocketConstructorFlags.cs" />
<Compile Include="$(CommonPath)System\Net\Sockets\ProtocolFamily.cs"
Link="Common\System\Net\Sockets\ProtocolFamily.cs" />
<Compile Include="$(CommonPath)Interop\Windows\WinSock\Interop.GetAddrInfoExW.cs"
Link="Common\Interop\Windows\WinSock\Interop.GetAddrInfoExW.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Unix'">
<Compile Include="System\Net\NameResolutionPal.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\InteropIPAddressExtensions.Unix.cs"
Link="Common\System\Net\InteropIPAddressExtensions.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\SocketAddressPal.Unix.cs"
Link="Common\System\Net\Internals\SocketAddressPal.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\SocketProtocolSupportPal.Unix.cs"
Link="Common\System\Net\SocketProtocolSupportPal.Unix" />
<Compile Include="$(CommonPath)System\Net\Internals\SocketExceptionFactory.cs"
Link="Common\System\Net\Internals\SocketExceptionFactory.cs" />
<Compile Include="$(CommonPath)System\Net\Internals\SocketExceptionFactory.Unix.cs"
Link="Common\System\Net\Internals\SocketExceptionFactory.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Interop.CheckedAccess.cs"
Link="Common\System\Net\Internals\Interop.CheckedAccess.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Link="Common\Interop\CoreLib\Unix\Interop.Errors.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Close.cs"
Link="Common\Interop\Unix\System.Native\Interop.Close.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetHostName.cs"
Link="Common\Interop\Unix\System.Native\Interop.GetHostName.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.GetNameInfo.cs"
Link="Common\Interop\Unix\System.Native\Interop.GetNameInfo.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.HostEntry.cs"
Link="Common\Interop\Unix\System.Native\Interop.HostEntries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.IPAddress.cs"
Link="Common\Interop\Unix\System.Native\Interop.IPAddress.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.Socket.cs"
Link="Common\Interop\Unix\System.Native\Interop.Socket.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Native\Interop.SocketAddress.cs"
Link="Common\Interop\Unix\System.Native\Interop.SocketAddress.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'Browser'">
<Compile Include="System\Net\Dns.Browser.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Collections" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.Handles" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.Claims" />
<Reference Include="System.Security.Principal.Windows" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Overlapped" />
<Reference Include="System.Threading.ThreadPool" />
</ItemGroup>
</Project>
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.NameResolution/src/System/Net/Dns.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Net.Internals;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace System.Net
{
/// <summary>Provides simple domain name resolution functionality.</summary>
public static class Dns
{
/// <summary>Gets the host name of the local machine.</summary>
public static string GetHostName()
{
ValueStopwatch stopwatch = NameResolutionTelemetry.Log.BeforeResolution(string.Empty);
string name;
try
{
name = NameResolutionPal.GetHostName();
}
catch when (LogFailure(stopwatch))
{
Debug.Fail("LogFailure should return false");
throw;
}
NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, name);
return name;
}
public static IPHostEntry GetHostEntry(IPAddress address!!)
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"Invalid address '{address}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(address));
}
IPHostEntry ipHostEntry = GetHostEntryCore(address, AddressFamily.Unspecified);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries");
return ipHostEntry;
}
public static IPHostEntry GetHostEntry(string hostNameOrAddress) =>
GetHostEntry(hostNameOrAddress, AddressFamily.Unspecified);
/// <summary>
/// Resolves a host name or IP address to an <see cref="IPHostEntry"/> instance.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="family">The address family for which IPs should be retrieved. If <see cref="AddressFamily.Unspecified"/>, retrieve all IPs regardless of address family.</param>
/// <returns>
/// An <see cref="IPHostEntry"/> instance that contains the address information about the host specified in <paramref name="hostNameOrAddress"/>.
/// </returns>
public static IPHostEntry GetHostEntry(string hostNameOrAddress!!, AddressFamily family)
{
// See if it's an IP Address.
IPHostEntry ipHostEntry;
if (IPAddress.TryParse(hostNameOrAddress, out IPAddress? address))
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"Invalid address '{address}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(hostNameOrAddress));
}
ipHostEntry = GetHostEntryCore(address, family);
}
else
{
ipHostEntry = GetHostEntryCore(hostNameOrAddress, family);
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostNameOrAddress, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries");
return ipHostEntry;
}
public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress) =>
GetHostEntryAsync(hostNameOrAddress, AddressFamily.Unspecified, CancellationToken.None);
/// <summary>
/// Resolves a host name or IP address to an <see cref="IPHostEntry"/> instance as an asynchronous operation.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="cancellationToken">A cancellation token that can be used to signal the asynchronous operation should be canceled.</param>
/// <returns>
/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns
/// an <see cref="IPHostEntry"/> instance that contains the address information about the host specified in <paramref name="hostNameOrAddress"/>.
/// </returns>
public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress, CancellationToken cancellationToken) =>
GetHostEntryAsync(hostNameOrAddress, AddressFamily.Unspecified, cancellationToken);
/// <summary>
/// Resolves a host name or IP address to an <see cref="IPHostEntry"/> instance as an asynchronous operation.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="family">The address family for which IPs should be retrieved. If <see cref="AddressFamily.Unspecified"/>, retrieve all IPs regardless of address family.</param>
/// <param name="cancellationToken">A cancellation token that can be used to signal the asynchronous operation should be canceled.</param>
/// <returns>
/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns
/// an <see cref="IPHostEntry"/> instance that contains the address information about the host specified in <paramref name="hostNameOrAddress"/>.
/// </returns>
public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress, AddressFamily family, CancellationToken cancellationToken = default)
{
if (NetEventSource.Log.IsEnabled())
{
Task<IPHostEntry> t = GetHostEntryCoreAsync(hostNameOrAddress, justReturnParsedIp: false, throwOnIIPAny: true, family, cancellationToken);
t.ContinueWith(static (t, s) =>
{
string hostNameOrAddress = (string)s!;
if (t.Status == TaskStatus.RanToCompletion)
{
NetEventSource.Info(hostNameOrAddress, $"{t.Result} with {t.Result.AddressList.Length} entries");
}
Exception? ex = t.Exception?.InnerException;
if (ex is SocketException soex)
{
NetEventSource.Error(hostNameOrAddress, $"{hostNameOrAddress} DNS lookup failed with {soex.ErrorCode}");
}
else if (ex is OperationCanceledException)
{
NetEventSource.Error(hostNameOrAddress, $"{hostNameOrAddress} DNS lookup was canceled");
}
}, hostNameOrAddress, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
return t;
}
else
{
return GetHostEntryCoreAsync(hostNameOrAddress, justReturnParsedIp: false, throwOnIIPAny: true, family, cancellationToken);
}
}
public static Task<IPHostEntry> GetHostEntryAsync(IPAddress address!!)
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"Invalid address '{address}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(address));
}
return RunAsync(static (s, stopwatch) => {
IPHostEntry ipHostEntry = GetHostEntryCore((IPAddress)s, AddressFamily.Unspecified, stopwatch);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info((IPAddress)s, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries");
return ipHostEntry;
}, address, CancellationToken.None);
}
public static IAsyncResult BeginGetHostEntry(IPAddress address, AsyncCallback? requestCallback, object? stateObject) =>
TaskToApm.Begin(GetHostEntryAsync(address), requestCallback, stateObject);
public static IAsyncResult BeginGetHostEntry(string hostNameOrAddress, AsyncCallback? requestCallback, object? stateObject) =>
TaskToApm.Begin(GetHostEntryAsync(hostNameOrAddress), requestCallback, stateObject);
public static IPHostEntry EndGetHostEntry(IAsyncResult asyncResult!!) =>
TaskToApm.End<IPHostEntry>(asyncResult);
public static IPAddress[] GetHostAddresses(string hostNameOrAddress)
=> GetHostAddresses(hostNameOrAddress, AddressFamily.Unspecified);
/// <summary>
/// Returns the Internet Protocol (IP) addresses for the specified host.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="family">The address family for which IPs should be retrieved. If <see cref="AddressFamily.Unspecified"/>, retrieve all IPs regardless of address family.</param>
/// <returns>
/// An array of type <see cref="IPAddress"/> that holds the IP addresses for the host that is specified by the <paramref name="hostNameOrAddress"/> parameter.
/// </returns>
public static IPAddress[] GetHostAddresses(string hostNameOrAddress!!, AddressFamily family)
{
// See if it's an IP Address.
IPAddress[] addresses;
if (IPAddress.TryParse(hostNameOrAddress, out IPAddress? address))
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"Invalid address '{address}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(hostNameOrAddress));
}
addresses = (family == AddressFamily.Unspecified || address.AddressFamily == family) ? new IPAddress[] { address } : Array.Empty<IPAddress>();
}
else
{
addresses = GetHostAddressesCore(hostNameOrAddress, family);
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostNameOrAddress, addresses);
return addresses;
}
public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress) =>
(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, AddressFamily.Unspecified, CancellationToken.None);
/// <summary>
/// Returns the Internet Protocol (IP) addresses for the specified host as an asynchronous operation.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="cancellationToken">A cancellation token that can be used to signal the asynchronous operation should be canceled.</param>
/// <returns>
/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns an array of
/// type <see cref="IPAddress"/> that holds the IP addresses for the host that is specified by the <paramref name="hostNameOrAddress"/> parameter.
/// </returns>
public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress, CancellationToken cancellationToken) =>
(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, AddressFamily.Unspecified, cancellationToken);
/// <summary>
/// Returns the Internet Protocol (IP) addresses for the specified host as an asynchronous operation.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="family">The address family for which IPs should be retrieved. If <see cref="AddressFamily.Unspecified"/>, retrieve all IPs regardless of address family.</param>
/// <param name="cancellationToken">A cancellation token that can be used to signal the asynchronous operation should be canceled.</param>
/// <returns>
/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns an array of
/// type <see cref="IPAddress"/> that holds the IP addresses for the host that is specified by the <paramref name="hostNameOrAddress"/> parameter.
/// </returns>
public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress, AddressFamily family, CancellationToken cancellationToken = default) =>
(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, family, cancellationToken);
public static IAsyncResult BeginGetHostAddresses(string hostNameOrAddress, AsyncCallback? requestCallback, object? state) =>
TaskToApm.Begin(GetHostAddressesAsync(hostNameOrAddress), requestCallback, state);
public static IPAddress[] EndGetHostAddresses(IAsyncResult asyncResult!!) =>
TaskToApm.End<IPAddress[]>(asyncResult);
[Obsolete("GetHostByName has been deprecated. Use GetHostEntry instead.")]
public static IPHostEntry GetHostByName(string hostName!!)
{
if (IPAddress.TryParse(hostName, out IPAddress? address))
{
return CreateHostEntryForAddress(address);
}
return GetHostEntryCore(hostName, AddressFamily.Unspecified);
}
[Obsolete("BeginGetHostByName has been deprecated. Use BeginGetHostEntry instead.")]
public static IAsyncResult BeginGetHostByName(string hostName, AsyncCallback? requestCallback, object? stateObject) =>
TaskToApm.Begin(GetHostEntryCoreAsync(hostName, justReturnParsedIp: true, throwOnIIPAny: true, AddressFamily.Unspecified, CancellationToken.None), requestCallback, stateObject);
[Obsolete("EndGetHostByName has been deprecated. Use EndGetHostEntry instead.")]
public static IPHostEntry EndGetHostByName(IAsyncResult asyncResult!!) =>
TaskToApm.End<IPHostEntry>(asyncResult);
[Obsolete("GetHostByAddress has been deprecated. Use GetHostEntry instead.")]
public static IPHostEntry GetHostByAddress(string address!!)
{
IPHostEntry ipHostEntry = GetHostEntryCore(IPAddress.Parse(address), AddressFamily.Unspecified);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, ipHostEntry);
return ipHostEntry;
}
[Obsolete("GetHostByAddress has been deprecated. Use GetHostEntry instead.")]
public static IPHostEntry GetHostByAddress(IPAddress address!!)
{
IPHostEntry ipHostEntry = GetHostEntryCore(address, AddressFamily.Unspecified);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, ipHostEntry);
return ipHostEntry;
}
[Obsolete("Resolve has been deprecated. Use GetHostEntry instead.")]
public static IPHostEntry Resolve(string hostName!!)
{
// See if it's an IP Address.
IPHostEntry ipHostEntry;
if (IPAddress.TryParse(hostName, out IPAddress? address) &&
(address.AddressFamily != AddressFamily.InterNetworkV6 || SocketProtocolSupportPal.OSSupportsIPv6))
{
try
{
ipHostEntry = GetHostEntryCore(address, AddressFamily.Unspecified);
}
catch (SocketException ex)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(hostName, ex);
ipHostEntry = CreateHostEntryForAddress(address);
}
}
else
{
ipHostEntry = GetHostEntryCore(hostName, AddressFamily.Unspecified);
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostName, ipHostEntry);
return ipHostEntry;
}
[Obsolete("BeginResolve has been deprecated. Use BeginGetHostEntry instead.")]
public static IAsyncResult BeginResolve(string hostName, AsyncCallback? requestCallback, object? stateObject) =>
TaskToApm.Begin(GetHostEntryCoreAsync(hostName, justReturnParsedIp: false, throwOnIIPAny: false, AddressFamily.Unspecified, CancellationToken.None), requestCallback, stateObject);
[Obsolete("EndResolve has been deprecated. Use EndGetHostEntry instead.")]
public static IPHostEntry EndResolve(IAsyncResult asyncResult)
{
IPHostEntry ipHostEntry;
try
{
ipHostEntry = TaskToApm.End<IPHostEntry>(asyncResult);
}
catch (SocketException ex)
{
object? asyncState = asyncResult switch
{
Task t => t.AsyncState,
TaskToApm.TaskAsyncResult twar => twar._task.AsyncState,
_ => null
};
IPAddress? address = asyncState switch
{
IPAddress a => a,
KeyValuePair<IPAddress, AddressFamily> t => t.Key,
_ => null
};
if (address is null)
throw; // BeginResolve was called with a HostName, not an IPAddress
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(null, ex);
ipHostEntry = CreateHostEntryForAddress(address);
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, ipHostEntry);
return ipHostEntry;
}
private static IPHostEntry GetHostEntryCore(string hostName, AddressFamily addressFamily, ValueStopwatch stopwatch = default) =>
(IPHostEntry)GetHostEntryOrAddressesCore(hostName, justAddresses: false, addressFamily, stopwatch);
private static IPAddress[] GetHostAddressesCore(string hostName, AddressFamily addressFamily, ValueStopwatch stopwatch = default) =>
(IPAddress[])GetHostEntryOrAddressesCore(hostName, justAddresses: true, addressFamily, stopwatch);
private static object GetHostEntryOrAddressesCore(string hostName, bool justAddresses, AddressFamily addressFamily, ValueStopwatch stopwatch)
{
ValidateHostName(hostName);
if (!stopwatch.IsActive)
{
stopwatch = NameResolutionTelemetry.Log.BeforeResolution(hostName);
}
object result;
try
{
SocketError errorCode = NameResolutionPal.TryGetAddrInfo(hostName, justAddresses, addressFamily, out string? newHostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode);
if (errorCode != SocketError.Success)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(hostName, $"{hostName} DNS lookup failed with {errorCode}");
throw SocketExceptionFactory.CreateSocketException(errorCode, nativeErrorCode);
}
result = justAddresses ? (object)
addresses :
new IPHostEntry
{
AddressList = addresses,
HostName = newHostName!,
Aliases = aliases
};
}
catch when (LogFailure(stopwatch))
{
Debug.Fail("LogFailure should return false");
throw;
}
NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true);
return result;
}
private static IPHostEntry GetHostEntryCore(IPAddress address, AddressFamily addressFamily, ValueStopwatch stopwatch = default) =>
(IPHostEntry)GetHostEntryOrAddressesCore(address, justAddresses: false, addressFamily, stopwatch);
private static IPAddress[] GetHostAddressesCore(IPAddress address, AddressFamily addressFamily, ValueStopwatch stopwatch) =>
(IPAddress[])GetHostEntryOrAddressesCore(address, justAddresses: true, addressFamily, stopwatch);
// Does internal IPAddress reverse and then forward lookups (for Legacy and current public methods).
private static object GetHostEntryOrAddressesCore(IPAddress address, bool justAddresses, AddressFamily addressFamily, ValueStopwatch stopwatch)
{
// Try to get the data for the host from its address.
// We need to call getnameinfo first, because getaddrinfo w/ the ipaddress string
// will only return that address and not the full list.
// Do a reverse lookup to get the host name.
if (!stopwatch.IsActive)
{
stopwatch = NameResolutionTelemetry.Log.BeforeResolution(address);
}
SocketError errorCode;
string? name;
try
{
name = NameResolutionPal.TryGetNameInfo(address, out errorCode, out int nativeErrorCode);
if (errorCode != SocketError.Success)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"{address} DNS lookup failed with {errorCode}");
throw SocketExceptionFactory.CreateSocketException(errorCode, nativeErrorCode);
}
Debug.Assert(name != null);
}
catch when (LogFailure(stopwatch))
{
Debug.Fail("LogFailure should return false");
throw;
}
NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true);
// Do the forward lookup to get the IPs for that host name
stopwatch = NameResolutionTelemetry.Log.BeforeResolution(name);
object result;
try
{
errorCode = NameResolutionPal.TryGetAddrInfo(name, justAddresses, addressFamily, out string? hostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode);
if (errorCode != SocketError.Success)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"forward lookup for '{name}' failed with {errorCode}");
}
result = justAddresses ?
(object)addresses :
new IPHostEntry
{
HostName = hostName!,
Aliases = aliases,
AddressList = addresses
};
}
catch when (LogFailure(stopwatch))
{
Debug.Fail("LogFailure should return false");
throw;
}
NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: true);
// One of three things happened:
// 1. Success.
// 2. There was a ptr record in dns, but not a corollary A/AAA record.
// 3. The IP was a local (non-loopback) IP that resolved to a connection specific dns suffix.
// - Workaround, Check "Use this connection's dns suffix in dns registration" on that network
// adapter's advanced dns settings.
// Return whatever we got.
return result;
}
private static Task<IPHostEntry> GetHostEntryCoreAsync(string hostName, bool justReturnParsedIp, bool throwOnIIPAny, AddressFamily family, CancellationToken cancellationToken) =>
(Task<IPHostEntry>)GetHostEntryOrAddressesCoreAsync(hostName, justReturnParsedIp, throwOnIIPAny, justAddresses: false, family, cancellationToken);
// If hostName is an IPString and justReturnParsedIP==true then no reverse lookup will be attempted, but the original address is returned.
private static Task GetHostEntryOrAddressesCoreAsync(string hostName!!, bool justReturnParsedIp, bool throwOnIIPAny, bool justAddresses, AddressFamily family, CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
{
return justAddresses ? (Task)
Task.FromCanceled<IPAddress[]>(cancellationToken) :
Task.FromCanceled<IPHostEntry>(cancellationToken);
}
object asyncState;
// See if it's an IP Address.
if (IPAddress.TryParse(hostName, out IPAddress? ipAddress))
{
if (throwOnIIPAny && (ipAddress.Equals(IPAddress.Any) || ipAddress.Equals(IPAddress.IPv6Any)))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(hostName, $"Invalid address '{ipAddress}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(hostName));
}
if (justReturnParsedIp)
{
return justAddresses ? (Task)
Task.FromResult(family == AddressFamily.Unspecified || ipAddress.AddressFamily == family ? new[] { ipAddress } : Array.Empty<IPAddress>()) :
Task.FromResult(CreateHostEntryForAddress(ipAddress));
}
asyncState = family == AddressFamily.Unspecified ? (object)ipAddress : new KeyValuePair<IPAddress, AddressFamily>(ipAddress, family);
}
else
{
if (NameResolutionPal.SupportsGetAddrInfoAsync)
{
#pragma warning disable CS0162 // Unreachable code detected -- SupportsGetAddrInfoAsync is a constant on *nix.
// If the OS supports it and 'hostName' is not an IP Address, resolve the name asynchronously
// instead of calling the synchronous version in the ThreadPool.
// If it fails, we will fall back to ThreadPool as well.
ValidateHostName(hostName);
Task? t;
if (NameResolutionTelemetry.Log.IsEnabled())
{
t = justAddresses
? GetAddrInfoWithTelemetryAsync<IPAddress[]>(hostName, justAddresses, family, cancellationToken)
: GetAddrInfoWithTelemetryAsync<IPHostEntry>(hostName, justAddresses, family, cancellationToken);
}
else
{
t = NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses, family, cancellationToken);
}
// If async resolution started, return task to user, otherwise fall back to sync API on threadpool.
if (t != null)
{
return t;
}
#pragma warning restore CS0162
}
asyncState = family == AddressFamily.Unspecified ? (object)hostName : new KeyValuePair<string, AddressFamily>(hostName, family);
}
if (justAddresses)
{
return RunAsync(static (s, stopwatch) => s switch
{
string h => GetHostAddressesCore(h, AddressFamily.Unspecified, stopwatch),
KeyValuePair<string, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, stopwatch),
IPAddress a => GetHostAddressesCore(a, AddressFamily.Unspecified, stopwatch),
KeyValuePair<IPAddress, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, stopwatch),
_ => null
}, asyncState, cancellationToken);
}
else
{
return RunAsync(static (s, stopwatch) => s switch
{
string h => GetHostEntryCore(h, AddressFamily.Unspecified, stopwatch),
KeyValuePair<string, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, stopwatch),
IPAddress a => GetHostEntryCore(a, AddressFamily.Unspecified, stopwatch),
KeyValuePair<IPAddress, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, stopwatch),
_ => null
}, asyncState, cancellationToken);
}
}
private static Task<T>? GetAddrInfoWithTelemetryAsync<T>(string hostName, bool justAddresses, AddressFamily addressFamily, CancellationToken cancellationToken)
where T : class
{
ValueStopwatch stopwatch = ValueStopwatch.StartNew();
Task? task = NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses, addressFamily, cancellationToken);
if (task != null)
{
return CompleteAsync(task, hostName, stopwatch);
}
// If resolution even did not start don't bother with telemetry.
// We will retry on thread-pool.
return null;
static async Task<T> CompleteAsync(Task task, string hostName, ValueStopwatch stopwatch)
{
_ = NameResolutionTelemetry.Log.BeforeResolution(hostName);
T? result = null;
try
{
result = await ((Task<T>)task).ConfigureAwait(false);
return result;
}
finally
{
NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: result is not null);
}
}
}
private static IPHostEntry CreateHostEntryForAddress(IPAddress address) =>
new IPHostEntry
{
HostName = address.ToString(),
Aliases = Array.Empty<string>(),
AddressList = new IPAddress[] { address }
};
private static void ValidateHostName(string hostName)
{
const int MaxHostName = 255;
if (hostName.Length > MaxHostName ||
(hostName.Length == MaxHostName && hostName[MaxHostName - 1] != '.')) // If 255 chars, the last one must be a dot.
{
throw new ArgumentOutOfRangeException(nameof(hostName),
SR.Format(SR.net_toolong, nameof(hostName), MaxHostName.ToString(NumberFormatInfo.CurrentInfo)));
}
}
private static bool LogFailure(ValueStopwatch stopwatch)
{
NameResolutionTelemetry.Log.AfterResolution(stopwatch, successful: false);
return false;
}
/// <summary>Mapping from key to current task in flight for that key.</summary>
private static readonly Dictionary<object, Task> s_tasks = new Dictionary<object, Task>();
/// <summary>Queue the function to be invoked asynchronously.</summary>
/// <remarks>
/// Since this is doing synchronous work on a thread pool thread, we want to limit how many threads end up being
/// blocked. We could employ a semaphore to limit overall usage, but a common case is that DNS requests are made
/// for only a handful of endpoints, and a reasonable compromise is to ensure that requests for a given host are
/// serialized. Once the data for that host is cached locally by the OS, the subsequent requests should all complete
/// very quickly, and if the head-of-line request is taking a long time due to the connection to the server, we won't
/// block lots of threads all getting data for that one host. We also still want to issue the request to the OS, rather
/// than having all concurrent requests for the same host share the exact same task, so that any shuffling of the results
/// by the OS to enable round robin is still perceived.
/// </remarks>
private static Task<TResult> RunAsync<TResult>(Func<object, ValueStopwatch, TResult> func, object key, CancellationToken cancellationToken)
{
ValueStopwatch stopwatch = NameResolutionTelemetry.Log.BeforeResolution(key);
Task<TResult>? task = null;
lock (s_tasks)
{
// Get the previous task for this key, if there is one.
s_tasks.TryGetValue(key, out Task? prevTask);
prevTask ??= Task.CompletedTask;
// Invoke the function in a queued work item when the previous task completes. Note that some callers expect the
// returned task to have the key as the task's AsyncState.
task = prevTask.ContinueWith(delegate
{
Debug.Assert(!Monitor.IsEntered(s_tasks));
try
{
return func(key, stopwatch);
}
finally
{
// When the work is done, remove this key/task pair from the dictionary if this is still the current task.
// Because the work item is created and stored into both the local and the dictionary while the lock is
// held, and since we take the same lock here, inside this lock it's guaranteed to see the changes
// made by the call site.
lock (s_tasks)
{
((ICollection<KeyValuePair<object, Task>>)s_tasks).Remove(new KeyValuePair<object, Task>(key!, task!));
}
}
}, key, cancellationToken, TaskContinuationOptions.DenyChildAttach, TaskScheduler.Default);
// If it's possible the task may end up getting canceled, it won't have a chance to remove itself from
// the dictionary if it is canceled, so use a separate continuation to do so.
if (cancellationToken.CanBeCanceled)
{
task.ContinueWith((task, key) =>
{
lock (s_tasks)
{
((ICollection<KeyValuePair<object, Task>>)s_tasks).Remove(new KeyValuePair<object, Task>(key!, task));
}
}, key, CancellationToken.None, TaskContinuationOptions.OnlyOnCanceled | TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}
// Finally, store the task into the dictionary as the current task for this key.
s_tasks[key] = task;
}
return task;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Net.Internals;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net
{
/// <summary>Provides simple domain name resolution functionality.</summary>
public static class Dns
{
/// <summary>Gets the host name of the local machine.</summary>
public static string GetHostName()
{
long startingTimestamp = NameResolutionTelemetry.Log.BeforeResolution(string.Empty);
string name;
try
{
name = NameResolutionPal.GetHostName();
}
catch when (LogFailure(startingTimestamp))
{
Debug.Fail("LogFailure should return false");
throw;
}
NameResolutionTelemetry.Log.AfterResolution(startingTimestamp, successful: true);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, name);
return name;
}
public static IPHostEntry GetHostEntry(IPAddress address!!)
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"Invalid address '{address}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(address));
}
IPHostEntry ipHostEntry = GetHostEntryCore(address, AddressFamily.Unspecified);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries");
return ipHostEntry;
}
public static IPHostEntry GetHostEntry(string hostNameOrAddress) =>
GetHostEntry(hostNameOrAddress, AddressFamily.Unspecified);
/// <summary>
/// Resolves a host name or IP address to an <see cref="IPHostEntry"/> instance.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="family">The address family for which IPs should be retrieved. If <see cref="AddressFamily.Unspecified"/>, retrieve all IPs regardless of address family.</param>
/// <returns>
/// An <see cref="IPHostEntry"/> instance that contains the address information about the host specified in <paramref name="hostNameOrAddress"/>.
/// </returns>
public static IPHostEntry GetHostEntry(string hostNameOrAddress!!, AddressFamily family)
{
// See if it's an IP Address.
IPHostEntry ipHostEntry;
if (IPAddress.TryParse(hostNameOrAddress, out IPAddress? address))
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"Invalid address '{address}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(hostNameOrAddress));
}
ipHostEntry = GetHostEntryCore(address, family);
}
else
{
ipHostEntry = GetHostEntryCore(hostNameOrAddress, family);
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostNameOrAddress, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries");
return ipHostEntry;
}
public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress) =>
GetHostEntryAsync(hostNameOrAddress, AddressFamily.Unspecified, CancellationToken.None);
/// <summary>
/// Resolves a host name or IP address to an <see cref="IPHostEntry"/> instance as an asynchronous operation.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="cancellationToken">A cancellation token that can be used to signal the asynchronous operation should be canceled.</param>
/// <returns>
/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns
/// an <see cref="IPHostEntry"/> instance that contains the address information about the host specified in <paramref name="hostNameOrAddress"/>.
/// </returns>
public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress, CancellationToken cancellationToken) =>
GetHostEntryAsync(hostNameOrAddress, AddressFamily.Unspecified, cancellationToken);
/// <summary>
/// Resolves a host name or IP address to an <see cref="IPHostEntry"/> instance as an asynchronous operation.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="family">The address family for which IPs should be retrieved. If <see cref="AddressFamily.Unspecified"/>, retrieve all IPs regardless of address family.</param>
/// <param name="cancellationToken">A cancellation token that can be used to signal the asynchronous operation should be canceled.</param>
/// <returns>
/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns
/// an <see cref="IPHostEntry"/> instance that contains the address information about the host specified in <paramref name="hostNameOrAddress"/>.
/// </returns>
public static Task<IPHostEntry> GetHostEntryAsync(string hostNameOrAddress, AddressFamily family, CancellationToken cancellationToken = default)
{
if (NetEventSource.Log.IsEnabled())
{
Task<IPHostEntry> t = GetHostEntryCoreAsync(hostNameOrAddress, justReturnParsedIp: false, throwOnIIPAny: true, family, cancellationToken);
t.ContinueWith(static (t, s) =>
{
string hostNameOrAddress = (string)s!;
if (t.Status == TaskStatus.RanToCompletion)
{
NetEventSource.Info(hostNameOrAddress, $"{t.Result} with {t.Result.AddressList.Length} entries");
}
Exception? ex = t.Exception?.InnerException;
if (ex is SocketException soex)
{
NetEventSource.Error(hostNameOrAddress, $"{hostNameOrAddress} DNS lookup failed with {soex.ErrorCode}");
}
else if (ex is OperationCanceledException)
{
NetEventSource.Error(hostNameOrAddress, $"{hostNameOrAddress} DNS lookup was canceled");
}
}, hostNameOrAddress, CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
return t;
}
else
{
return GetHostEntryCoreAsync(hostNameOrAddress, justReturnParsedIp: false, throwOnIIPAny: true, family, cancellationToken);
}
}
public static Task<IPHostEntry> GetHostEntryAsync(IPAddress address!!)
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"Invalid address '{address}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(address));
}
return RunAsync(static (s, stopwatch) => {
IPHostEntry ipHostEntry = GetHostEntryCore((IPAddress)s, AddressFamily.Unspecified, stopwatch);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info((IPAddress)s, $"{ipHostEntry} with {ipHostEntry.AddressList.Length} entries");
return ipHostEntry;
}, address, CancellationToken.None);
}
public static IAsyncResult BeginGetHostEntry(IPAddress address, AsyncCallback? requestCallback, object? stateObject) =>
TaskToApm.Begin(GetHostEntryAsync(address), requestCallback, stateObject);
public static IAsyncResult BeginGetHostEntry(string hostNameOrAddress, AsyncCallback? requestCallback, object? stateObject) =>
TaskToApm.Begin(GetHostEntryAsync(hostNameOrAddress), requestCallback, stateObject);
public static IPHostEntry EndGetHostEntry(IAsyncResult asyncResult!!) =>
TaskToApm.End<IPHostEntry>(asyncResult);
public static IPAddress[] GetHostAddresses(string hostNameOrAddress)
=> GetHostAddresses(hostNameOrAddress, AddressFamily.Unspecified);
/// <summary>
/// Returns the Internet Protocol (IP) addresses for the specified host.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="family">The address family for which IPs should be retrieved. If <see cref="AddressFamily.Unspecified"/>, retrieve all IPs regardless of address family.</param>
/// <returns>
/// An array of type <see cref="IPAddress"/> that holds the IP addresses for the host that is specified by the <paramref name="hostNameOrAddress"/> parameter.
/// </returns>
public static IPAddress[] GetHostAddresses(string hostNameOrAddress!!, AddressFamily family)
{
// See if it's an IP Address.
IPAddress[] addresses;
if (IPAddress.TryParse(hostNameOrAddress, out IPAddress? address))
{
if (address.Equals(IPAddress.Any) || address.Equals(IPAddress.IPv6Any))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"Invalid address '{address}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(hostNameOrAddress));
}
addresses = (family == AddressFamily.Unspecified || address.AddressFamily == family) ? new IPAddress[] { address } : Array.Empty<IPAddress>();
}
else
{
addresses = GetHostAddressesCore(hostNameOrAddress, family);
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostNameOrAddress, addresses);
return addresses;
}
public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress) =>
(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, AddressFamily.Unspecified, CancellationToken.None);
/// <summary>
/// Returns the Internet Protocol (IP) addresses for the specified host as an asynchronous operation.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="cancellationToken">A cancellation token that can be used to signal the asynchronous operation should be canceled.</param>
/// <returns>
/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns an array of
/// type <see cref="IPAddress"/> that holds the IP addresses for the host that is specified by the <paramref name="hostNameOrAddress"/> parameter.
/// </returns>
public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress, CancellationToken cancellationToken) =>
(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, AddressFamily.Unspecified, cancellationToken);
/// <summary>
/// Returns the Internet Protocol (IP) addresses for the specified host as an asynchronous operation.
/// </summary>
/// <param name="hostNameOrAddress">The host name or IP address to resolve.</param>
/// <param name="family">The address family for which IPs should be retrieved. If <see cref="AddressFamily.Unspecified"/>, retrieve all IPs regardless of address family.</param>
/// <param name="cancellationToken">A cancellation token that can be used to signal the asynchronous operation should be canceled.</param>
/// <returns>
/// The task object representing the asynchronous operation. The <see cref="Task{TResult}.Result"/> property on the task object returns an array of
/// type <see cref="IPAddress"/> that holds the IP addresses for the host that is specified by the <paramref name="hostNameOrAddress"/> parameter.
/// </returns>
public static Task<IPAddress[]> GetHostAddressesAsync(string hostNameOrAddress, AddressFamily family, CancellationToken cancellationToken = default) =>
(Task<IPAddress[]>)GetHostEntryOrAddressesCoreAsync(hostNameOrAddress, justReturnParsedIp: true, throwOnIIPAny: true, justAddresses: true, family, cancellationToken);
public static IAsyncResult BeginGetHostAddresses(string hostNameOrAddress, AsyncCallback? requestCallback, object? state) =>
TaskToApm.Begin(GetHostAddressesAsync(hostNameOrAddress), requestCallback, state);
public static IPAddress[] EndGetHostAddresses(IAsyncResult asyncResult!!) =>
TaskToApm.End<IPAddress[]>(asyncResult);
[Obsolete("GetHostByName has been deprecated. Use GetHostEntry instead.")]
public static IPHostEntry GetHostByName(string hostName!!)
{
if (IPAddress.TryParse(hostName, out IPAddress? address))
{
return CreateHostEntryForAddress(address);
}
return GetHostEntryCore(hostName, AddressFamily.Unspecified);
}
[Obsolete("BeginGetHostByName has been deprecated. Use BeginGetHostEntry instead.")]
public static IAsyncResult BeginGetHostByName(string hostName, AsyncCallback? requestCallback, object? stateObject) =>
TaskToApm.Begin(GetHostEntryCoreAsync(hostName, justReturnParsedIp: true, throwOnIIPAny: true, AddressFamily.Unspecified, CancellationToken.None), requestCallback, stateObject);
[Obsolete("EndGetHostByName has been deprecated. Use EndGetHostEntry instead.")]
public static IPHostEntry EndGetHostByName(IAsyncResult asyncResult!!) =>
TaskToApm.End<IPHostEntry>(asyncResult);
[Obsolete("GetHostByAddress has been deprecated. Use GetHostEntry instead.")]
public static IPHostEntry GetHostByAddress(string address!!)
{
IPHostEntry ipHostEntry = GetHostEntryCore(IPAddress.Parse(address), AddressFamily.Unspecified);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, ipHostEntry);
return ipHostEntry;
}
[Obsolete("GetHostByAddress has been deprecated. Use GetHostEntry instead.")]
public static IPHostEntry GetHostByAddress(IPAddress address!!)
{
IPHostEntry ipHostEntry = GetHostEntryCore(address, AddressFamily.Unspecified);
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(address, ipHostEntry);
return ipHostEntry;
}
[Obsolete("Resolve has been deprecated. Use GetHostEntry instead.")]
public static IPHostEntry Resolve(string hostName!!)
{
// See if it's an IP Address.
IPHostEntry ipHostEntry;
if (IPAddress.TryParse(hostName, out IPAddress? address) &&
(address.AddressFamily != AddressFamily.InterNetworkV6 || SocketProtocolSupportPal.OSSupportsIPv6))
{
try
{
ipHostEntry = GetHostEntryCore(address, AddressFamily.Unspecified);
}
catch (SocketException ex)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(hostName, ex);
ipHostEntry = CreateHostEntryForAddress(address);
}
}
else
{
ipHostEntry = GetHostEntryCore(hostName, AddressFamily.Unspecified);
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(hostName, ipHostEntry);
return ipHostEntry;
}
[Obsolete("BeginResolve has been deprecated. Use BeginGetHostEntry instead.")]
public static IAsyncResult BeginResolve(string hostName, AsyncCallback? requestCallback, object? stateObject) =>
TaskToApm.Begin(GetHostEntryCoreAsync(hostName, justReturnParsedIp: false, throwOnIIPAny: false, AddressFamily.Unspecified, CancellationToken.None), requestCallback, stateObject);
[Obsolete("EndResolve has been deprecated. Use EndGetHostEntry instead.")]
public static IPHostEntry EndResolve(IAsyncResult asyncResult)
{
IPHostEntry ipHostEntry;
try
{
ipHostEntry = TaskToApm.End<IPHostEntry>(asyncResult);
}
catch (SocketException ex)
{
object? asyncState = asyncResult switch
{
Task t => t.AsyncState,
TaskToApm.TaskAsyncResult twar => twar._task.AsyncState,
_ => null
};
IPAddress? address = asyncState switch
{
IPAddress a => a,
KeyValuePair<IPAddress, AddressFamily> t => t.Key,
_ => null
};
if (address is null)
throw; // BeginResolve was called with a HostName, not an IPAddress
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(null, ex);
ipHostEntry = CreateHostEntryForAddress(address);
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, ipHostEntry);
return ipHostEntry;
}
private static IPHostEntry GetHostEntryCore(string hostName, AddressFamily addressFamily, long startingTimestamp = 0) =>
(IPHostEntry)GetHostEntryOrAddressesCore(hostName, justAddresses: false, addressFamily, startingTimestamp);
private static IPAddress[] GetHostAddressesCore(string hostName, AddressFamily addressFamily, long startingTimestamp = 0) =>
(IPAddress[])GetHostEntryOrAddressesCore(hostName, justAddresses: true, addressFamily, startingTimestamp);
private static object GetHostEntryOrAddressesCore(string hostName, bool justAddresses, AddressFamily addressFamily, long startingTimestamp = 0)
{
ValidateHostName(hostName);
if (startingTimestamp == 0)
{
startingTimestamp = NameResolutionTelemetry.Log.BeforeResolution(hostName);
}
object result;
try
{
SocketError errorCode = NameResolutionPal.TryGetAddrInfo(hostName, justAddresses, addressFamily, out string? newHostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode);
if (errorCode != SocketError.Success)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(hostName, $"{hostName} DNS lookup failed with {errorCode}");
throw SocketExceptionFactory.CreateSocketException(errorCode, nativeErrorCode);
}
result = justAddresses ? (object)
addresses :
new IPHostEntry
{
AddressList = addresses,
HostName = newHostName!,
Aliases = aliases
};
}
catch when (LogFailure(startingTimestamp))
{
Debug.Fail("LogFailure should return false");
throw;
}
NameResolutionTelemetry.Log.AfterResolution(startingTimestamp, successful: true);
return result;
}
private static IPHostEntry GetHostEntryCore(IPAddress address, AddressFamily addressFamily, long startingTimestamp = 0) =>
(IPHostEntry)GetHostEntryOrAddressesCore(address, justAddresses: false, addressFamily, startingTimestamp);
private static IPAddress[] GetHostAddressesCore(IPAddress address, AddressFamily addressFamily, long startingTimestamp) =>
(IPAddress[])GetHostEntryOrAddressesCore(address, justAddresses: true, addressFamily, startingTimestamp);
// Does internal IPAddress reverse and then forward lookups (for Legacy and current public methods).
private static object GetHostEntryOrAddressesCore(IPAddress address, bool justAddresses, AddressFamily addressFamily, long startingTimestamp)
{
// Try to get the data for the host from its address.
// We need to call getnameinfo first, because getaddrinfo w/ the ipaddress string
// will only return that address and not the full list.
// Do a reverse lookup to get the host name.
if (startingTimestamp == 0)
{
startingTimestamp = NameResolutionTelemetry.Log.BeforeResolution(address);
}
SocketError errorCode;
string? name;
try
{
name = NameResolutionPal.TryGetNameInfo(address, out errorCode, out int nativeErrorCode);
if (errorCode != SocketError.Success)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"{address} DNS lookup failed with {errorCode}");
throw SocketExceptionFactory.CreateSocketException(errorCode, nativeErrorCode);
}
Debug.Assert(name != null);
}
catch when (LogFailure(startingTimestamp))
{
Debug.Fail("LogFailure should return false");
throw;
}
NameResolutionTelemetry.Log.AfterResolution(startingTimestamp, successful: true);
// Do the forward lookup to get the IPs for that host name
startingTimestamp = NameResolutionTelemetry.Log.BeforeResolution(name);
object result;
try
{
errorCode = NameResolutionPal.TryGetAddrInfo(name, justAddresses, addressFamily, out string? hostName, out string[] aliases, out IPAddress[] addresses, out int nativeErrorCode);
if (errorCode != SocketError.Success)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(address, $"forward lookup for '{name}' failed with {errorCode}");
}
result = justAddresses ?
(object)addresses :
new IPHostEntry
{
HostName = hostName!,
Aliases = aliases,
AddressList = addresses
};
}
catch when (LogFailure(startingTimestamp))
{
Debug.Fail("LogFailure should return false");
throw;
}
NameResolutionTelemetry.Log.AfterResolution(startingTimestamp, successful: true);
// One of three things happened:
// 1. Success.
// 2. There was a ptr record in dns, but not a corollary A/AAA record.
// 3. The IP was a local (non-loopback) IP that resolved to a connection specific dns suffix.
// - Workaround, Check "Use this connection's dns suffix in dns registration" on that network
// adapter's advanced dns settings.
// Return whatever we got.
return result;
}
private static Task<IPHostEntry> GetHostEntryCoreAsync(string hostName, bool justReturnParsedIp, bool throwOnIIPAny, AddressFamily family, CancellationToken cancellationToken) =>
(Task<IPHostEntry>)GetHostEntryOrAddressesCoreAsync(hostName, justReturnParsedIp, throwOnIIPAny, justAddresses: false, family, cancellationToken);
// If hostName is an IPString and justReturnParsedIP==true then no reverse lookup will be attempted, but the original address is returned.
private static Task GetHostEntryOrAddressesCoreAsync(string hostName!!, bool justReturnParsedIp, bool throwOnIIPAny, bool justAddresses, AddressFamily family, CancellationToken cancellationToken)
{
if (cancellationToken.IsCancellationRequested)
{
return justAddresses ? (Task)
Task.FromCanceled<IPAddress[]>(cancellationToken) :
Task.FromCanceled<IPHostEntry>(cancellationToken);
}
object asyncState;
// See if it's an IP Address.
if (IPAddress.TryParse(hostName, out IPAddress? ipAddress))
{
if (throwOnIIPAny && (ipAddress.Equals(IPAddress.Any) || ipAddress.Equals(IPAddress.IPv6Any)))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(hostName, $"Invalid address '{ipAddress}'");
throw new ArgumentException(SR.net_invalid_ip_addr, nameof(hostName));
}
if (justReturnParsedIp)
{
return justAddresses ? (Task)
Task.FromResult(family == AddressFamily.Unspecified || ipAddress.AddressFamily == family ? new[] { ipAddress } : Array.Empty<IPAddress>()) :
Task.FromResult(CreateHostEntryForAddress(ipAddress));
}
asyncState = family == AddressFamily.Unspecified ? (object)ipAddress : new KeyValuePair<IPAddress, AddressFamily>(ipAddress, family);
}
else
{
if (NameResolutionPal.SupportsGetAddrInfoAsync)
{
#pragma warning disable CS0162 // Unreachable code detected -- SupportsGetAddrInfoAsync is a constant on *nix.
// If the OS supports it and 'hostName' is not an IP Address, resolve the name asynchronously
// instead of calling the synchronous version in the ThreadPool.
// If it fails, we will fall back to ThreadPool as well.
ValidateHostName(hostName);
Task? t;
if (NameResolutionTelemetry.Log.IsEnabled())
{
t = justAddresses
? GetAddrInfoWithTelemetryAsync<IPAddress[]>(hostName, justAddresses, family, cancellationToken)
: GetAddrInfoWithTelemetryAsync<IPHostEntry>(hostName, justAddresses, family, cancellationToken);
}
else
{
t = NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses, family, cancellationToken);
}
// If async resolution started, return task to user, otherwise fall back to sync API on threadpool.
if (t != null)
{
return t;
}
#pragma warning restore CS0162
}
asyncState = family == AddressFamily.Unspecified ? (object)hostName : new KeyValuePair<string, AddressFamily>(hostName, family);
}
if (justAddresses)
{
return RunAsync(static (s, startingTimestamp) => s switch
{
string h => GetHostAddressesCore(h, AddressFamily.Unspecified, startingTimestamp),
KeyValuePair<string, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, startingTimestamp),
IPAddress a => GetHostAddressesCore(a, AddressFamily.Unspecified, startingTimestamp),
KeyValuePair<IPAddress, AddressFamily> t => GetHostAddressesCore(t.Key, t.Value, startingTimestamp),
_ => null
}, asyncState, cancellationToken);
}
else
{
return RunAsync(static (s, startingTimestamp) => s switch
{
string h => GetHostEntryCore(h, AddressFamily.Unspecified, startingTimestamp),
KeyValuePair<string, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, startingTimestamp),
IPAddress a => GetHostEntryCore(a, AddressFamily.Unspecified, startingTimestamp),
KeyValuePair<IPAddress, AddressFamily> t => GetHostEntryCore(t.Key, t.Value, startingTimestamp),
_ => null
}, asyncState, cancellationToken);
}
}
private static Task<T>? GetAddrInfoWithTelemetryAsync<T>(string hostName, bool justAddresses, AddressFamily addressFamily, CancellationToken cancellationToken)
where T : class
{
long startingTimestamp = Stopwatch.GetTimestamp();
Task? task = NameResolutionPal.GetAddrInfoAsync(hostName, justAddresses, addressFamily, cancellationToken);
if (task != null)
{
return CompleteAsync(task, hostName, startingTimestamp);
}
// If resolution even did not start don't bother with telemetry.
// We will retry on thread-pool.
return null;
static async Task<T> CompleteAsync(Task task, string hostName, long startingTimestamp)
{
_ = NameResolutionTelemetry.Log.BeforeResolution(hostName);
T? result = null;
try
{
result = await ((Task<T>)task).ConfigureAwait(false);
return result;
}
finally
{
NameResolutionTelemetry.Log.AfterResolution(startingTimestamp, successful: result is not null);
}
}
}
private static IPHostEntry CreateHostEntryForAddress(IPAddress address) =>
new IPHostEntry
{
HostName = address.ToString(),
Aliases = Array.Empty<string>(),
AddressList = new IPAddress[] { address }
};
private static void ValidateHostName(string hostName)
{
const int MaxHostName = 255;
if (hostName.Length > MaxHostName ||
(hostName.Length == MaxHostName && hostName[MaxHostName - 1] != '.')) // If 255 chars, the last one must be a dot.
{
throw new ArgumentOutOfRangeException(nameof(hostName),
SR.Format(SR.net_toolong, nameof(hostName), MaxHostName.ToString(NumberFormatInfo.CurrentInfo)));
}
}
private static bool LogFailure(long startingTimestamp)
{
NameResolutionTelemetry.Log.AfterResolution(startingTimestamp, successful: false);
return false;
}
/// <summary>Mapping from key to current task in flight for that key.</summary>
private static readonly Dictionary<object, Task> s_tasks = new Dictionary<object, Task>();
/// <summary>Queue the function to be invoked asynchronously.</summary>
/// <remarks>
/// Since this is doing synchronous work on a thread pool thread, we want to limit how many threads end up being
/// blocked. We could employ a semaphore to limit overall usage, but a common case is that DNS requests are made
/// for only a handful of endpoints, and a reasonable compromise is to ensure that requests for a given host are
/// serialized. Once the data for that host is cached locally by the OS, the subsequent requests should all complete
/// very quickly, and if the head-of-line request is taking a long time due to the connection to the server, we won't
/// block lots of threads all getting data for that one host. We also still want to issue the request to the OS, rather
/// than having all concurrent requests for the same host share the exact same task, so that any shuffling of the results
/// by the OS to enable round robin is still perceived.
/// </remarks>
private static Task<TResult> RunAsync<TResult>(Func<object, long, TResult> func, object key, CancellationToken cancellationToken)
{
long startingTimestamp = NameResolutionTelemetry.Log.BeforeResolution(key);
Task<TResult>? task = null;
lock (s_tasks)
{
// Get the previous task for this key, if there is one.
s_tasks.TryGetValue(key, out Task? prevTask);
prevTask ??= Task.CompletedTask;
// Invoke the function in a queued work item when the previous task completes. Note that some callers expect the
// returned task to have the key as the task's AsyncState.
task = prevTask.ContinueWith(delegate
{
Debug.Assert(!Monitor.IsEntered(s_tasks));
try
{
return func(key, startingTimestamp);
}
finally
{
// When the work is done, remove this key/task pair from the dictionary if this is still the current task.
// Because the work item is created and stored into both the local and the dictionary while the lock is
// held, and since we take the same lock here, inside this lock it's guaranteed to see the changes
// made by the call site.
lock (s_tasks)
{
((ICollection<KeyValuePair<object, Task>>)s_tasks).Remove(new KeyValuePair<object, Task>(key!, task!));
}
}
}, key, cancellationToken, TaskContinuationOptions.DenyChildAttach, TaskScheduler.Default);
// If it's possible the task may end up getting canceled, it won't have a chance to remove itself from
// the dictionary if it is canceled, so use a separate continuation to do so.
if (cancellationToken.CanBeCanceled)
{
task.ContinueWith((task, key) =>
{
lock (s_tasks)
{
((ICollection<KeyValuePair<object, Task>>)s_tasks).Remove(new KeyValuePair<object, Task>(key!, task));
}
}, key, CancellationToken.None, TaskContinuationOptions.OnlyOnCanceled | TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
}
// Finally, store the task into the dictionary as the current task for this key.
s_tasks[key] = task;
}
return task;
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.NameResolution/src/System/Net/NameResolutionTelemetry.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Net.Sockets;
using System.Threading;
using Microsoft.Extensions.Internal;
namespace System.Net
{
[EventSource(Name = "System.Net.NameResolution")]
internal sealed class NameResolutionTelemetry : EventSource
{
public static readonly NameResolutionTelemetry Log = new NameResolutionTelemetry();
private const int ResolutionStartEventId = 1;
private const int ResolutionStopEventId = 2;
private const int ResolutionFailedEventId = 3;
private PollingCounter? _lookupsRequestedCounter;
private PollingCounter? _currentLookupsCounter;
private EventCounter? _lookupsDuration;
private long _lookupsRequested;
private long _currentLookups;
protected override void OnEventCommand(EventCommandEventArgs command)
{
if (command.Command == EventCommand.Enable)
{
// The cumulative number of name resolution requests started since events were enabled
_lookupsRequestedCounter ??= new PollingCounter("dns-lookups-requested", this, () => Interlocked.Read(ref _lookupsRequested))
{
DisplayName = "DNS Lookups Requested"
};
// Current number of DNS requests pending
_currentLookupsCounter ??= new PollingCounter("current-dns-lookups", this, () => Interlocked.Read(ref _currentLookups))
{
DisplayName = "Current DNS Lookups"
};
_lookupsDuration ??= new EventCounter("dns-lookups-duration", this)
{
DisplayName = "Average DNS Lookup Duration",
DisplayUnits = "ms"
};
}
}
[Event(ResolutionStartEventId, Level = EventLevel.Informational)]
private void ResolutionStart(string hostNameOrAddress) => WriteEvent(ResolutionStartEventId, hostNameOrAddress);
[Event(ResolutionStopEventId, Level = EventLevel.Informational)]
private void ResolutionStop() => WriteEvent(ResolutionStopEventId);
[Event(ResolutionFailedEventId, Level = EventLevel.Informational)]
private void ResolutionFailed() => WriteEvent(ResolutionFailedEventId);
[NonEvent]
public ValueStopwatch BeforeResolution(object hostNameOrAddress)
{
Debug.Assert(hostNameOrAddress != null);
Debug.Assert(
hostNameOrAddress is string ||
hostNameOrAddress is IPAddress ||
hostNameOrAddress is KeyValuePair<string, AddressFamily> ||
hostNameOrAddress is KeyValuePair<IPAddress, AddressFamily>,
$"Unknown hostNameOrAddress type: {hostNameOrAddress.GetType().Name}");
if (IsEnabled())
{
Interlocked.Increment(ref _lookupsRequested);
Interlocked.Increment(ref _currentLookups);
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
{
string host = hostNameOrAddress switch
{
string h => h,
KeyValuePair<string, AddressFamily> t => t.Key,
IPAddress a => a.ToString(),
KeyValuePair<IPAddress, AddressFamily> t => t.Key.ToString(),
_ => null!
};
ResolutionStart(host);
}
return ValueStopwatch.StartNew();
}
return default;
}
[NonEvent]
public void AfterResolution(ValueStopwatch stopwatch, bool successful)
{
if (stopwatch.IsActive)
{
Interlocked.Decrement(ref _currentLookups);
_lookupsDuration!.WriteMetric(stopwatch.GetElapsedTime().TotalMilliseconds);
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
{
if (!successful)
{
ResolutionFailed();
}
ResolutionStop();
}
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Net.Sockets;
using System.Threading;
namespace System.Net
{
[EventSource(Name = "System.Net.NameResolution")]
internal sealed class NameResolutionTelemetry : EventSource
{
public static readonly NameResolutionTelemetry Log = new NameResolutionTelemetry();
private const int ResolutionStartEventId = 1;
private const int ResolutionStopEventId = 2;
private const int ResolutionFailedEventId = 3;
private PollingCounter? _lookupsRequestedCounter;
private PollingCounter? _currentLookupsCounter;
private EventCounter? _lookupsDuration;
private long _lookupsRequested;
private long _currentLookups;
protected override void OnEventCommand(EventCommandEventArgs command)
{
if (command.Command == EventCommand.Enable)
{
// The cumulative number of name resolution requests started since events were enabled
_lookupsRequestedCounter ??= new PollingCounter("dns-lookups-requested", this, () => Interlocked.Read(ref _lookupsRequested))
{
DisplayName = "DNS Lookups Requested"
};
// Current number of DNS requests pending
_currentLookupsCounter ??= new PollingCounter("current-dns-lookups", this, () => Interlocked.Read(ref _currentLookups))
{
DisplayName = "Current DNS Lookups"
};
_lookupsDuration ??= new EventCounter("dns-lookups-duration", this)
{
DisplayName = "Average DNS Lookup Duration",
DisplayUnits = "ms"
};
}
}
[Event(ResolutionStartEventId, Level = EventLevel.Informational)]
private void ResolutionStart(string hostNameOrAddress) => WriteEvent(ResolutionStartEventId, hostNameOrAddress);
[Event(ResolutionStopEventId, Level = EventLevel.Informational)]
private void ResolutionStop() => WriteEvent(ResolutionStopEventId);
[Event(ResolutionFailedEventId, Level = EventLevel.Informational)]
private void ResolutionFailed() => WriteEvent(ResolutionFailedEventId);
[NonEvent]
public long BeforeResolution(object hostNameOrAddress)
{
Debug.Assert(hostNameOrAddress != null);
Debug.Assert(
hostNameOrAddress is string ||
hostNameOrAddress is IPAddress ||
hostNameOrAddress is KeyValuePair<string, AddressFamily> ||
hostNameOrAddress is KeyValuePair<IPAddress, AddressFamily>,
$"Unknown hostNameOrAddress type: {hostNameOrAddress.GetType().Name}");
if (IsEnabled())
{
Interlocked.Increment(ref _lookupsRequested);
Interlocked.Increment(ref _currentLookups);
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
{
string host = hostNameOrAddress switch
{
string h => h,
KeyValuePair<string, AddressFamily> t => t.Key,
IPAddress a => a.ToString(),
KeyValuePair<IPAddress, AddressFamily> t => t.Key.ToString(),
_ => null!
};
ResolutionStart(host);
}
return Stopwatch.GetTimestamp();
}
return 0;
}
[NonEvent]
public void AfterResolution(long startingTimestamp, bool successful)
{
if (startingTimestamp != 0)
{
Interlocked.Decrement(ref _currentLookups);
_lookupsDuration!.WriteMetric(Stopwatch.GetElapsedTime(startingTimestamp).TotalMilliseconds);
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
{
if (!successful)
{
ResolutionFailed();
}
ResolutionStop();
}
}
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Ping/src/System/Net/NetworkInformation/Ping.RawSocket.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.NetworkInformation
{
public partial class Ping
{
private const int IcmpHeaderLengthInBytes = 8;
private const int MinIpHeaderLengthInBytes = 20;
private const int MaxIpHeaderLengthInBytes = 60;
private const int IpV6HeaderLengthInBytes = 40;
private static ushort DontFragment = OperatingSystem.IsFreeBSD() ? (ushort)IPAddress.HostToNetworkOrder((short)0x4000) : (ushort)0x4000;
private unsafe SocketConfig GetSocketConfig(IPAddress address, byte[] buffer, int timeout, PingOptions? options)
{
// Use a random value as the identifier. This doesn't need to be perfectly random
// or very unpredictable, rather just good enough to avoid unexpected conflicts.
ushort id = (ushort)Random.Shared.Next(ushort.MaxValue + 1);
IpHeader iph = default;
bool ipv4 = address.AddressFamily == AddressFamily.InterNetwork;
bool sendIpHeader = ipv4 && options != null && SendIpHeader;
int totalLength = 0;
if (sendIpHeader)
{
iph.VersionAndLength = 0x45;
totalLength = sizeof(IpHeader) + checked(sizeof(IcmpHeader) + buffer.Length);
// On OSX this strangely must be host byte order.
iph.TotalLength = OperatingSystem.IsFreeBSD() ? (ushort)IPAddress.HostToNetworkOrder((short)totalLength) : (ushort)totalLength;
iph.Protocol = 1; // ICMP
iph.Ttl = (byte)options!.Ttl;
iph.Flags = (ushort)(options.DontFragment ? DontFragment : 0);
#pragma warning disable 618
iph.DestinationAddress = (uint)address.Address;
#pragma warning restore 618
// No need to fill in SourceAddress or checksum.
// If left blank, kernel will fill it in - at least on OSX.
}
return new SocketConfig(
new IPEndPoint(address, 0), timeout, options,
ipv4, ipv4 ? ProtocolType.Icmp : ProtocolType.IcmpV6, id,
CreateSendMessageBuffer(iph, new IcmpHeader()
{
Type = ipv4 ? (byte)IcmpV4MessageType.EchoRequest : (byte)IcmpV6MessageType.EchoRequest,
Identifier = id,
}, buffer, totalLength));
}
private Socket GetRawSocket(SocketConfig socketConfig)
{
IPEndPoint ep = (IPEndPoint)socketConfig.EndPoint;
AddressFamily addrFamily = ep.Address.AddressFamily;
SocketType socketType = RawSocketPermissions.CanUseRawSockets(addrFamily) ?
SocketType.Raw :
SocketType.Dgram; // macOS/iOS has ability to send ICMP echo without RAW
Socket socket = new Socket(addrFamily, socketType, socketConfig.ProtocolType);
socket.ReceiveTimeout = socketConfig.Timeout;
socket.SendTimeout = socketConfig.Timeout;
if (addrFamily == AddressFamily.InterNetworkV6 && !SupportsDualMode)
{
socket.DualMode = false;
}
if (socketConfig.Options != null)
{
if (socketConfig.Options.Ttl > 0)
{
socket.Ttl = (short)socketConfig.Options.Ttl;
}
if (addrFamily == AddressFamily.InterNetwork)
{
if (SendIpHeader)
{
// some platforms like OSX don't support DontFragment so we construct IP header instead.
socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, 1);
}
else
{
socket.DontFragment = socketConfig.Options.DontFragment;
}
}
}
#pragma warning disable 618
// Disable warning about obsolete property. We could use GetAddressBytes but that allocates.
// IPv4 multicast address starts with 1110 bits so mask rest and test if we get correct value e.g. 0xe0.
if (NeedsConnect && !ep.Address.IsIPv6Multicast && !(addrFamily == AddressFamily.InterNetwork && (ep.Address.Address & 0xf0) == 0xe0))
{
// If it is not multicast, use Connect to scope responses only to the target address.
socket.Connect(socketConfig.EndPoint);
}
#pragma warning restore 618
return socket;
}
private bool TryGetPingReply(
SocketConfig socketConfig, byte[] receiveBuffer, int bytesReceived, Stopwatch sw, ref int ipHeaderLength,
[NotNullWhen(true)] out PingReply? reply)
{
byte type, code;
reply = null;
if (socketConfig.IsIpv4)
{
// Determine actual size of IP header
byte ihl = (byte)(receiveBuffer[0] & 0x0f); // Internet Header Length
ipHeaderLength = 4 * ihl;
if (bytesReceived - ipHeaderLength < IcmpHeaderLengthInBytes)
{
return false; // Not enough bytes to reconstruct actual IP header + ICMP header.
}
}
int icmpHeaderOffset = ipHeaderLength;
int dataOffset = ipHeaderLength + IcmpHeaderLengthInBytes;
// Skip IP header.
IcmpHeader receivedHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(icmpHeaderOffset));
ushort identifier;
type = receivedHeader.Type;
code = receivedHeader.Code;
// Validate the ICMP header and get the identifier
if (socketConfig.IsIpv4)
{
if (type == (byte)IcmpV4MessageType.EchoReply)
{
// Reply packet has the identifier in the ICMP header.
identifier = receivedHeader.Identifier;
}
else if (type == (byte)IcmpV4MessageType.DestinationUnreachable ||
type == (byte)IcmpV4MessageType.TimeExceeded ||
type == (byte)IcmpV4MessageType.ParameterProblemBadIPHeader ||
type == (byte)IcmpV4MessageType.SourceQuench ||
type == (byte)IcmpV4MessageType.RedirectMessage)
{
// Original IP+ICMP request is in the payload. Read the ICMP header from
// the payload to get identifier.
if (dataOffset + MinIpHeaderLengthInBytes + IcmpHeaderLengthInBytes > bytesReceived)
{
return false;
}
byte ihl = (byte)(receiveBuffer[dataOffset] & 0x0f); // Internet Header Length
int payloadIpHeaderLength = 4 * ihl;
if (bytesReceived - dataOffset - payloadIpHeaderLength < IcmpHeaderLengthInBytes)
{
return false; // Not enough bytes to reconstruct actual IP header + ICMP header.
}
IcmpHeader originalRequestHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(dataOffset + payloadIpHeaderLength));
identifier = originalRequestHeader.Identifier;
// Update the date offset to point past the payload IP+ICMP headers. While the specification
// doesn't indicate there should be any additional data the reality is that we often get the
// original packet data back.
dataOffset += payloadIpHeaderLength + IcmpHeaderLengthInBytes;
}
else
{
return false;
}
}
else
{
if (type == (byte)IcmpV6MessageType.EchoReply)
{
// Reply packet has the identifier in the ICMP header.
identifier = receivedHeader.Identifier;
}
else if (type == (byte)IcmpV6MessageType.DestinationUnreachable ||
type == (byte)IcmpV6MessageType.TimeExceeded ||
type == (byte)IcmpV6MessageType.ParameterProblem ||
type == (byte)IcmpV6MessageType.PacketTooBig)
{
// Original IP+ICMP request is in the payload. Read the ICMP header from
// the payload to get identifier.
if (bytesReceived - dataOffset < IpV6HeaderLengthInBytes + IcmpHeaderLengthInBytes)
{
return false; // Not enough bytes to reconstruct actual IP header + ICMP header.
}
IcmpHeader originalRequestHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(dataOffset + IpV6HeaderLengthInBytes));
identifier = originalRequestHeader.Identifier;
// Update the date offset to point past the payload IP+ICMP headers. While the specification
// doesn't indicate there should be any additional data the reality is that we often get the
// original packet data back.
dataOffset += IpV6HeaderLengthInBytes + IcmpHeaderLengthInBytes;
}
else
{
return false;
}
}
if (socketConfig.Identifier != identifier)
{
return false;
}
sw.Stop();
long roundTripTime = sw.ElapsedMilliseconds;
// We want to return a buffer with the actual data we sent out, not including the header data.
byte[] dataBuffer = new byte[bytesReceived - dataOffset];
Buffer.BlockCopy(receiveBuffer, dataOffset, dataBuffer, 0, dataBuffer.Length);
IPStatus status = socketConfig.IsIpv4
? IcmpV4MessageConstants.MapV4TypeToIPStatus(type, code)
: IcmpV6MessageConstants.MapV6TypeToIPStatus(type, code);
IPAddress address = ((IPEndPoint)socketConfig.EndPoint).Address;
reply = new PingReply(address, socketConfig.Options, status, roundTripTime, dataBuffer);
return true;
}
private PingReply SendIcmpEchoRequestOverRawSocket(IPAddress address, byte[] buffer, int timeout, PingOptions? options)
{
SocketConfig socketConfig = GetSocketConfig(address, buffer, timeout, options);
using (Socket socket = GetRawSocket(socketConfig))
{
int ipHeaderLength = socketConfig.IsIpv4 ? MinIpHeaderLengthInBytes : 0;
try
{
socket.SendTo(socketConfig.SendBuffer, SocketFlags.None, socketConfig.EndPoint);
byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length];
long elapsed;
Stopwatch sw = Stopwatch.StartNew();
// Read from the socket in a loop. We may receive messages that are not echo replies, or that are not in response
// to the echo request we just sent. We need to filter such messages out, and continue reading until our timeout.
// For example, when pinging the local host, we need to filter out our own echo requests that the socket reads.
while ((elapsed = sw.ElapsedMilliseconds) < timeout)
{
int bytesReceived = socket.ReceiveFrom(receiveBuffer, SocketFlags.None, ref socketConfig.EndPoint);
if (bytesReceived - ipHeaderLength < IcmpHeaderLengthInBytes)
{
continue; // Not enough bytes to reconstruct IP header + ICMP header.
}
if (TryGetPingReply(socketConfig, receiveBuffer, bytesReceived, sw, ref ipHeaderLength, out PingReply? reply))
{
return reply;
}
}
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.TimedOut)
{
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.MessageSize)
{
return CreatePingReply(IPStatus.PacketTooBig);
}
// We have exceeded our timeout duration, and no reply has been received.
return CreatePingReply(IPStatus.TimedOut);
}
}
private async Task<PingReply> SendIcmpEchoRequestOverRawSocketAsync(IPAddress address, byte[] buffer, int timeout, PingOptions? options)
{
SocketConfig socketConfig = GetSocketConfig(address, buffer, timeout, options);
using (Socket socket = GetRawSocket(socketConfig))
{
int ipHeaderLength = socketConfig.IsIpv4 ? MinIpHeaderLengthInBytes : 0;
CancellationTokenSource timeoutTokenSource = new CancellationTokenSource(timeout);
try
{
await socket.SendToAsync(
new ArraySegment<byte>(socketConfig.SendBuffer),
SocketFlags.None, socketConfig.EndPoint,
timeoutTokenSource.Token)
.ConfigureAwait(false);
byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length];
Stopwatch sw = Stopwatch.StartNew();
// Read from the socket in a loop. We may receive messages that are not echo replies, or that are not in response
// to the echo request we just sent. We need to filter such messages out, and continue reading until our timeout.
// For example, when pinging the local host, we need to filter out our own echo requests that the socket reads.
while (!timeoutTokenSource.IsCancellationRequested)
{
SocketReceiveFromResult receiveResult = await socket.ReceiveFromAsync(
new ArraySegment<byte>(receiveBuffer),
SocketFlags.None,
socketConfig.EndPoint,
timeoutTokenSource.Token)
.ConfigureAwait(false);
int bytesReceived = receiveResult.ReceivedBytes;
if (bytesReceived - ipHeaderLength < IcmpHeaderLengthInBytes)
{
continue; // Not enough bytes to reconstruct IP header + ICMP header.
}
if (TryGetPingReply(socketConfig, receiveBuffer, bytesReceived, sw, ref ipHeaderLength, out PingReply? reply))
{
return reply;
}
}
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.TimedOut)
{
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.MessageSize)
{
return CreatePingReply(IPStatus.PacketTooBig);
}
catch (OperationCanceledException)
{
}
finally
{
timeoutTokenSource.Dispose();
}
// We have exceeded our timeout duration, and no reply has been received.
return CreatePingReply(IPStatus.TimedOut);
}
}
private static PingReply CreatePingReply(IPStatus status, IPAddress? address = null, long rtt = 0)
{
// Documentation indicates that you should only pay attention to the IPStatus value when
// its value is not "Success", but the rest of these values match that of the Windows implementation.
return new PingReply(address ?? new IPAddress(0), null, status, rtt, Array.Empty<byte>());
}
#if DEBUG
static Ping()
{
Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes.");
}
#endif
[StructLayout(LayoutKind.Sequential)]
internal struct IpHeader
{
internal byte VersionAndLength;
internal byte Tos;
internal ushort TotalLength;
internal ushort Identifier;
internal ushort Flags;
internal byte Ttl;
internal byte Protocol;
internal ushort HeaderChecksum;
internal uint SourceAddress;
internal uint DestinationAddress;
};
// Must be 8 bytes total.
[StructLayout(LayoutKind.Sequential)]
internal struct IcmpHeader
{
public byte Type;
public byte Code;
public ushort HeaderChecksum;
public ushort Identifier;
public ushort SequenceNumber;
}
// Since this is private should be safe to trust that the calling code
// will behave. To get a little performance boost raw fields are exposed
// and no validation is performed.
private sealed class SocketConfig
{
public SocketConfig(EndPoint endPoint, int timeout, PingOptions? options, bool isIPv4, ProtocolType protocolType, ushort id, byte[] sendBuffer)
{
EndPoint = endPoint;
Timeout = timeout;
Options = options;
IsIpv4 = isIPv4;
ProtocolType = protocolType;
Identifier = id;
SendBuffer = sendBuffer;
}
public EndPoint EndPoint;
public readonly int Timeout;
public readonly PingOptions? Options;
public readonly ushort Identifier;
public readonly bool IsIpv4;
public readonly ProtocolType ProtocolType;
public readonly byte[] SendBuffer;
}
private static unsafe byte[] CreateSendMessageBuffer(IpHeader ipHeader, IcmpHeader icmpHeader, byte[] payload, int totalLength = 0)
{
int icmpHeaderSize = sizeof(IcmpHeader);
int offset = 0;
int packetSize = totalLength != 0 ? totalLength : checked(icmpHeaderSize + payload.Length);
byte[] result = new byte[packetSize];
if (totalLength != 0)
{
int ipHeaderSize = sizeof(IpHeader);
new Span<byte>(&ipHeader, sizeof(IpHeader)).CopyTo(result);
offset = ipHeaderSize;
}
//byte[] result = new byte[headerSize + payload.Length];
Marshal.Copy(new IntPtr(&icmpHeader), result, offset, icmpHeaderSize);
payload.CopyTo(result, offset + icmpHeaderSize);
// offset now still points to beginning of ICMP header.
ushort checksum = ComputeBufferChecksum(result.AsSpan(offset));
// Jam the checksum into the buffer.
result[offset + 2] = (byte)(checksum >> 8);
result[offset + 3] = (byte)(checksum & (0xFF));
return result;
}
private static ushort ComputeBufferChecksum(ReadOnlySpan<byte> buffer)
{
// This is using the "deferred carries" approach outlined in RFC 1071.
uint sum = 0;
for (int i = 0; i < buffer.Length; i += 2)
{
// Combine each pair of bytes into a 16-bit number and add it to the sum
ushort element0 = (ushort)((buffer[i] << 8) & 0xFF00);
ushort element1 = (i + 1 < buffer.Length)
? (ushort)(buffer[i + 1] & 0x00FF)
: (ushort)0; // If there's an odd number of bytes, pad by one octet of zeros.
ushort combined = (ushort)(element0 | element1);
sum += (uint)combined;
}
// Add back the "carry bits" which have risen to the upper 16 bits of the sum.
while ((sum >> 16) != 0)
{
var partialSum = sum & 0xFFFF;
var carries = sum >> 16;
sum = partialSum + carries;
}
return unchecked((ushort)~sum);
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.ComponentModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.NetworkInformation
{
public partial class Ping
{
private const int IcmpHeaderLengthInBytes = 8;
private const int MinIpHeaderLengthInBytes = 20;
private const int MaxIpHeaderLengthInBytes = 60;
private const int IpV6HeaderLengthInBytes = 40;
private static ushort DontFragment = OperatingSystem.IsFreeBSD() ? (ushort)IPAddress.HostToNetworkOrder((short)0x4000) : (ushort)0x4000;
private unsafe SocketConfig GetSocketConfig(IPAddress address, byte[] buffer, int timeout, PingOptions? options)
{
// Use a random value as the identifier. This doesn't need to be perfectly random
// or very unpredictable, rather just good enough to avoid unexpected conflicts.
ushort id = (ushort)Random.Shared.Next(ushort.MaxValue + 1);
IpHeader iph = default;
bool ipv4 = address.AddressFamily == AddressFamily.InterNetwork;
bool sendIpHeader = ipv4 && options != null && SendIpHeader;
int totalLength = 0;
if (sendIpHeader)
{
iph.VersionAndLength = 0x45;
totalLength = sizeof(IpHeader) + checked(sizeof(IcmpHeader) + buffer.Length);
// On OSX this strangely must be host byte order.
iph.TotalLength = OperatingSystem.IsFreeBSD() ? (ushort)IPAddress.HostToNetworkOrder((short)totalLength) : (ushort)totalLength;
iph.Protocol = 1; // ICMP
iph.Ttl = (byte)options!.Ttl;
iph.Flags = (ushort)(options.DontFragment ? DontFragment : 0);
#pragma warning disable 618
iph.DestinationAddress = (uint)address.Address;
#pragma warning restore 618
// No need to fill in SourceAddress or checksum.
// If left blank, kernel will fill it in - at least on OSX.
}
return new SocketConfig(
new IPEndPoint(address, 0), timeout, options,
ipv4, ipv4 ? ProtocolType.Icmp : ProtocolType.IcmpV6, id,
CreateSendMessageBuffer(iph, new IcmpHeader()
{
Type = ipv4 ? (byte)IcmpV4MessageType.EchoRequest : (byte)IcmpV6MessageType.EchoRequest,
Identifier = id,
}, buffer, totalLength));
}
private Socket GetRawSocket(SocketConfig socketConfig)
{
IPEndPoint ep = (IPEndPoint)socketConfig.EndPoint;
AddressFamily addrFamily = ep.Address.AddressFamily;
SocketType socketType = RawSocketPermissions.CanUseRawSockets(addrFamily) ?
SocketType.Raw :
SocketType.Dgram; // macOS/iOS has ability to send ICMP echo without RAW
Socket socket = new Socket(addrFamily, socketType, socketConfig.ProtocolType);
socket.ReceiveTimeout = socketConfig.Timeout;
socket.SendTimeout = socketConfig.Timeout;
if (addrFamily == AddressFamily.InterNetworkV6 && !SupportsDualMode)
{
socket.DualMode = false;
}
if (socketConfig.Options != null)
{
if (socketConfig.Options.Ttl > 0)
{
socket.Ttl = (short)socketConfig.Options.Ttl;
}
if (addrFamily == AddressFamily.InterNetwork)
{
if (SendIpHeader)
{
// some platforms like OSX don't support DontFragment so we construct IP header instead.
socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, 1);
}
else
{
socket.DontFragment = socketConfig.Options.DontFragment;
}
}
}
#pragma warning disable 618
// Disable warning about obsolete property. We could use GetAddressBytes but that allocates.
// IPv4 multicast address starts with 1110 bits so mask rest and test if we get correct value e.g. 0xe0.
if (NeedsConnect && !ep.Address.IsIPv6Multicast && !(addrFamily == AddressFamily.InterNetwork && (ep.Address.Address & 0xf0) == 0xe0))
{
// If it is not multicast, use Connect to scope responses only to the target address.
socket.Connect(socketConfig.EndPoint);
}
#pragma warning restore 618
return socket;
}
private bool TryGetPingReply(
SocketConfig socketConfig, byte[] receiveBuffer, int bytesReceived, long startingTimestamp, ref int ipHeaderLength,
[NotNullWhen(true)] out PingReply? reply)
{
byte type, code;
reply = null;
if (socketConfig.IsIpv4)
{
// Determine actual size of IP header
byte ihl = (byte)(receiveBuffer[0] & 0x0f); // Internet Header Length
ipHeaderLength = 4 * ihl;
if (bytesReceived - ipHeaderLength < IcmpHeaderLengthInBytes)
{
return false; // Not enough bytes to reconstruct actual IP header + ICMP header.
}
}
int icmpHeaderOffset = ipHeaderLength;
int dataOffset = ipHeaderLength + IcmpHeaderLengthInBytes;
// Skip IP header.
IcmpHeader receivedHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(icmpHeaderOffset));
ushort identifier;
type = receivedHeader.Type;
code = receivedHeader.Code;
// Validate the ICMP header and get the identifier
if (socketConfig.IsIpv4)
{
if (type == (byte)IcmpV4MessageType.EchoReply)
{
// Reply packet has the identifier in the ICMP header.
identifier = receivedHeader.Identifier;
}
else if (type == (byte)IcmpV4MessageType.DestinationUnreachable ||
type == (byte)IcmpV4MessageType.TimeExceeded ||
type == (byte)IcmpV4MessageType.ParameterProblemBadIPHeader ||
type == (byte)IcmpV4MessageType.SourceQuench ||
type == (byte)IcmpV4MessageType.RedirectMessage)
{
// Original IP+ICMP request is in the payload. Read the ICMP header from
// the payload to get identifier.
if (dataOffset + MinIpHeaderLengthInBytes + IcmpHeaderLengthInBytes > bytesReceived)
{
return false;
}
byte ihl = (byte)(receiveBuffer[dataOffset] & 0x0f); // Internet Header Length
int payloadIpHeaderLength = 4 * ihl;
if (bytesReceived - dataOffset - payloadIpHeaderLength < IcmpHeaderLengthInBytes)
{
return false; // Not enough bytes to reconstruct actual IP header + ICMP header.
}
IcmpHeader originalRequestHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(dataOffset + payloadIpHeaderLength));
identifier = originalRequestHeader.Identifier;
// Update the date offset to point past the payload IP+ICMP headers. While the specification
// doesn't indicate there should be any additional data the reality is that we often get the
// original packet data back.
dataOffset += payloadIpHeaderLength + IcmpHeaderLengthInBytes;
}
else
{
return false;
}
}
else
{
if (type == (byte)IcmpV6MessageType.EchoReply)
{
// Reply packet has the identifier in the ICMP header.
identifier = receivedHeader.Identifier;
}
else if (type == (byte)IcmpV6MessageType.DestinationUnreachable ||
type == (byte)IcmpV6MessageType.TimeExceeded ||
type == (byte)IcmpV6MessageType.ParameterProblem ||
type == (byte)IcmpV6MessageType.PacketTooBig)
{
// Original IP+ICMP request is in the payload. Read the ICMP header from
// the payload to get identifier.
if (bytesReceived - dataOffset < IpV6HeaderLengthInBytes + IcmpHeaderLengthInBytes)
{
return false; // Not enough bytes to reconstruct actual IP header + ICMP header.
}
IcmpHeader originalRequestHeader = MemoryMarshal.Read<IcmpHeader>(receiveBuffer.AsSpan(dataOffset + IpV6HeaderLengthInBytes));
identifier = originalRequestHeader.Identifier;
// Update the date offset to point past the payload IP+ICMP headers. While the specification
// doesn't indicate there should be any additional data the reality is that we often get the
// original packet data back.
dataOffset += IpV6HeaderLengthInBytes + IcmpHeaderLengthInBytes;
}
else
{
return false;
}
}
if (socketConfig.Identifier != identifier)
{
return false;
}
long roundTripTime = (long)Stopwatch.GetElapsedTime(startingTimestamp).TotalMilliseconds;
// We want to return a buffer with the actual data we sent out, not including the header data.
byte[] dataBuffer = new byte[bytesReceived - dataOffset];
Buffer.BlockCopy(receiveBuffer, dataOffset, dataBuffer, 0, dataBuffer.Length);
IPStatus status = socketConfig.IsIpv4
? IcmpV4MessageConstants.MapV4TypeToIPStatus(type, code)
: IcmpV6MessageConstants.MapV6TypeToIPStatus(type, code);
IPAddress address = ((IPEndPoint)socketConfig.EndPoint).Address;
reply = new PingReply(address, socketConfig.Options, status, roundTripTime, dataBuffer);
return true;
}
private PingReply SendIcmpEchoRequestOverRawSocket(IPAddress address, byte[] buffer, int timeout, PingOptions? options)
{
SocketConfig socketConfig = GetSocketConfig(address, buffer, timeout, options);
using (Socket socket = GetRawSocket(socketConfig))
{
int ipHeaderLength = socketConfig.IsIpv4 ? MinIpHeaderLengthInBytes : 0;
try
{
socket.SendTo(socketConfig.SendBuffer, SocketFlags.None, socketConfig.EndPoint);
byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length];
// Read from the socket in a loop. We may receive messages that are not echo replies, or that are not in response
// to the echo request we just sent. We need to filter such messages out, and continue reading until our timeout.
// For example, when pinging the local host, we need to filter out our own echo requests that the socket reads.
long startingTimestamp = Stopwatch.GetTimestamp();
while (Stopwatch.GetElapsedTime(startingTimestamp).TotalMilliseconds < timeout)
{
int bytesReceived = socket.ReceiveFrom(receiveBuffer, SocketFlags.None, ref socketConfig.EndPoint);
if (bytesReceived - ipHeaderLength < IcmpHeaderLengthInBytes)
{
continue; // Not enough bytes to reconstruct IP header + ICMP header.
}
if (TryGetPingReply(socketConfig, receiveBuffer, bytesReceived, startingTimestamp, ref ipHeaderLength, out PingReply? reply))
{
return reply;
}
}
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.TimedOut)
{
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.MessageSize)
{
return CreatePingReply(IPStatus.PacketTooBig);
}
// We have exceeded our timeout duration, and no reply has been received.
return CreatePingReply(IPStatus.TimedOut);
}
}
private async Task<PingReply> SendIcmpEchoRequestOverRawSocketAsync(IPAddress address, byte[] buffer, int timeout, PingOptions? options)
{
SocketConfig socketConfig = GetSocketConfig(address, buffer, timeout, options);
using (Socket socket = GetRawSocket(socketConfig))
{
int ipHeaderLength = socketConfig.IsIpv4 ? MinIpHeaderLengthInBytes : 0;
CancellationTokenSource timeoutTokenSource = new CancellationTokenSource(timeout);
try
{
await socket.SendToAsync(
new ArraySegment<byte>(socketConfig.SendBuffer),
SocketFlags.None, socketConfig.EndPoint,
timeoutTokenSource.Token)
.ConfigureAwait(false);
byte[] receiveBuffer = new byte[2 * (MaxIpHeaderLengthInBytes + IcmpHeaderLengthInBytes) + buffer.Length];
// Read from the socket in a loop. We may receive messages that are not echo replies, or that are not in response
// to the echo request we just sent. We need to filter such messages out, and continue reading until our timeout.
// For example, when pinging the local host, we need to filter out our own echo requests that the socket reads.
long startingTimestamp = Stopwatch.GetTimestamp();
while (!timeoutTokenSource.IsCancellationRequested)
{
SocketReceiveFromResult receiveResult = await socket.ReceiveFromAsync(
new ArraySegment<byte>(receiveBuffer),
SocketFlags.None,
socketConfig.EndPoint,
timeoutTokenSource.Token)
.ConfigureAwait(false);
int bytesReceived = receiveResult.ReceivedBytes;
if (bytesReceived - ipHeaderLength < IcmpHeaderLengthInBytes)
{
continue; // Not enough bytes to reconstruct IP header + ICMP header.
}
if (TryGetPingReply(socketConfig, receiveBuffer, bytesReceived, startingTimestamp, ref ipHeaderLength, out PingReply? reply))
{
return reply;
}
}
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.TimedOut)
{
}
catch (SocketException ex) when (ex.SocketErrorCode == SocketError.MessageSize)
{
return CreatePingReply(IPStatus.PacketTooBig);
}
catch (OperationCanceledException)
{
}
finally
{
timeoutTokenSource.Dispose();
}
// We have exceeded our timeout duration, and no reply has been received.
return CreatePingReply(IPStatus.TimedOut);
}
}
private static PingReply CreatePingReply(IPStatus status, IPAddress? address = null, long rtt = 0)
{
// Documentation indicates that you should only pay attention to the IPStatus value when
// its value is not "Success", but the rest of these values match that of the Windows implementation.
return new PingReply(address ?? new IPAddress(0), null, status, rtt, Array.Empty<byte>());
}
#if DEBUG
static Ping()
{
Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes.");
}
#endif
[StructLayout(LayoutKind.Sequential)]
internal struct IpHeader
{
internal byte VersionAndLength;
internal byte Tos;
internal ushort TotalLength;
internal ushort Identifier;
internal ushort Flags;
internal byte Ttl;
internal byte Protocol;
internal ushort HeaderChecksum;
internal uint SourceAddress;
internal uint DestinationAddress;
};
// Must be 8 bytes total.
[StructLayout(LayoutKind.Sequential)]
internal struct IcmpHeader
{
public byte Type;
public byte Code;
public ushort HeaderChecksum;
public ushort Identifier;
public ushort SequenceNumber;
}
// Since this is private should be safe to trust that the calling code
// will behave. To get a little performance boost raw fields are exposed
// and no validation is performed.
private sealed class SocketConfig
{
public SocketConfig(EndPoint endPoint, int timeout, PingOptions? options, bool isIPv4, ProtocolType protocolType, ushort id, byte[] sendBuffer)
{
EndPoint = endPoint;
Timeout = timeout;
Options = options;
IsIpv4 = isIPv4;
ProtocolType = protocolType;
Identifier = id;
SendBuffer = sendBuffer;
}
public EndPoint EndPoint;
public readonly int Timeout;
public readonly PingOptions? Options;
public readonly ushort Identifier;
public readonly bool IsIpv4;
public readonly ProtocolType ProtocolType;
public readonly byte[] SendBuffer;
}
private static unsafe byte[] CreateSendMessageBuffer(IpHeader ipHeader, IcmpHeader icmpHeader, byte[] payload, int totalLength = 0)
{
int icmpHeaderSize = sizeof(IcmpHeader);
int offset = 0;
int packetSize = totalLength != 0 ? totalLength : checked(icmpHeaderSize + payload.Length);
byte[] result = new byte[packetSize];
if (totalLength != 0)
{
int ipHeaderSize = sizeof(IpHeader);
new Span<byte>(&ipHeader, sizeof(IpHeader)).CopyTo(result);
offset = ipHeaderSize;
}
//byte[] result = new byte[headerSize + payload.Length];
Marshal.Copy(new IntPtr(&icmpHeader), result, offset, icmpHeaderSize);
payload.CopyTo(result, offset + icmpHeaderSize);
// offset now still points to beginning of ICMP header.
ushort checksum = ComputeBufferChecksum(result.AsSpan(offset));
// Jam the checksum into the buffer.
result[offset + 2] = (byte)(checksum >> 8);
result[offset + 3] = (byte)(checksum & (0xFF));
return result;
}
private static ushort ComputeBufferChecksum(ReadOnlySpan<byte> buffer)
{
// This is using the "deferred carries" approach outlined in RFC 1071.
uint sum = 0;
for (int i = 0; i < buffer.Length; i += 2)
{
// Combine each pair of bytes into a 16-bit number and add it to the sum
ushort element0 = (ushort)((buffer[i] << 8) & 0xFF00);
ushort element1 = (i + 1 < buffer.Length)
? (ushort)(buffer[i + 1] & 0x00FF)
: (ushort)0; // If there's an odd number of bytes, pad by one octet of zeros.
ushort combined = (ushort)(element0 | element1);
sum += (uint)combined;
}
// Add back the "carry bits" which have risen to the upper 16 bits of the sum.
while ((sum >> 16) != 0)
{
var partialSum = sum & 0xFFFF;
var carries = sum >> 16;
sum = partialSum + carries;
}
return unchecked((ushort)~sum);
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Security/src/System.Net.Security.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)</TargetFrameworks>
<!-- This is needed so that code for TlsCipherSuite will have no namespace (causes compile errors) when used within T4 template -->
<DefineConstants>$(DefineConstants);PRODUCT</DefineConstants>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.SystemNetSecurity_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'windows'">$(DefineConstants);TARGET_WINDOWS</DefineConstants>
<UseAndroidCrypto Condition="'$(TargetPlatformIdentifier)' == 'Android'">true</UseAndroidCrypto>
<UseAppleCrypto Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">true</UseAppleCrypto>
<DefineConstants Condition="'$(UseAndroidCrypto)' == 'true' or '$(UseAppleCrypto)' == 'true'">$(DefineConstants);SYSNETSECURITY_NO_OPENSSL</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\CertificateValidationPal.cs" />
<Compile Include="System\Net\Logging\NetEventSource.cs" />
<Compile Include="System\Net\SslStreamContext.cs" />
<Compile Include="System\Net\Security\AuthenticatedStream.cs" />
<Compile Include="System\Security\Authentication\AuthenticationException.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicy.cs" />
<Compile Include="System\Net\Security\NetEventSource.Security.cs" />
<Compile Include="System\Net\Security\NetSecurityTelemetry.cs" />
<Compile Include="System\Net\Security\ReadWriteAdapter.cs" />
<Compile Include="System\Net\Security\ProtectionLevel.cs" />
<Compile Include="System\Net\Security\SslApplicationProtocol.cs" />
<Compile Include="System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="System\Net\Security\SslCertificateTrust.cs" />
<Compile Include="System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="System\Net\Security\SslClientHelloInfo.cs" />
<Compile Include="System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="System\Net\Security\SecureChannel.cs" />
<Compile Include="System\Net\Security\SslSessionsCache.cs" />
<Compile Include="System\Net\Security\SslStream.cs" />
<Compile Include="System\Net\Security\SslStream.Implementation.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.cs" />
<Compile Include="System\Net\Security\StreamSizes.cs" />
<Compile Include="System\Net\Security\TlsAlertType.cs" />
<Compile Include="System\Net\Security\TlsAlertMessage.cs" />
<Compile Include="System\Net\Security\TlsFrameHelper.cs" />
<!-- NegotiateStream -->
<Compile Include="System\Net\NTAuthentication.cs" />
<Compile Include="System\Net\StreamFramer.cs" />
<Compile Include="System\Net\Security\NegotiateStream.cs" />
<Compile Include="System\Security\Authentication\ExtendedProtection\ExtendedProtectionPolicy.cs" />
<Compile Include="System\Security\Authentication\ExtendedProtection\PolicyEnforcement.cs" />
<Compile Include="System\Security\Authentication\ExtendedProtection\ProtectionScenario.cs" />
<Compile Include="System\Security\Authentication\ExtendedProtection\ServiceNameCollection.cs" />
<!-- Common sources -->
<Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
Link="Common\DisableRuntimeMarshalling.cs" />
<!-- Logging -->
<Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
<Compile Include="$(CommonPath)System\Net\InternalException.cs"
Link="Common\System\Net\InternalException.cs" />
<Compile Include="$(CommonPath)Extensions\ValueStopwatch\ValueStopwatch.cs"
Link="Common\Extensions\ValueStopwatch\ValueStopwatch.cs" />
<!-- Debug only -->
<Compile Include="$(CommonPath)System\Net\DebugSafeHandle.cs"
Link="Common\System\Net\DebugSafeHandle.cs" />
<Compile Include="$(CommonPath)System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs"
Link="Common\System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs" />
<!-- System.Net common -->
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs">
<Link>Common\System\Net\ArrayBuffer.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\ExceptionCheck.cs"
Link="Common\System\Net\ExceptionCheck.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityProtocol.cs"
Link="Common\System\Net\SecurityProtocol.cs" />
<Compile Include="$(CommonPath)System\Net\UriScheme.cs"
Link="Common\System\Net\UriScheme.cs" />
<!-- Common -->
<Compile Include="$(CommonPath)System\NotImplemented.cs"
Link="Common\System\NotImplemented.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SafeCredentialReference.cs"
Link="Common\System\Net\Security\SafeCredentialReference.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SSPIHandleCache.cs"
Link="Common\System\Net\Security\SSPIHandleCache.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsPal.cs"
Link="Common\System\Net\ContextFlagsPal.cs" />
<Compile Include="$(CommonPath)System\Net\NegotiationInfoClass.cs"
Link="Common\System\Net\NegotiationInfoClass.cs" />
<Compile Include="$(CommonPath)System\Net\NTAuthentication.Common.cs"
Link="Common\System\Net\NTAuthentication.Common.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityStatusPal.cs"
Link="Common\System\Net\SecurityStatusPal.cs" />
<Compile Include="$(CommonPath)System\HexConverter.cs"
Link="Common\System\HexConverter.cs" />
<Compile Include="$(CommonPath)System\Obsoletions.cs"
Link="Common\System\Obsoletions.cs" />
</ItemGroup>
<!-- This file depends on IANA registry. We do not want anyone's build to break after the update -->
<!-- or if they don't have internet connection - explicit opt-in required -->
<!-- To expose newly generated APIs, generated file have to be deliberately copied -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\Security\TlsCipherSuite.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuite.tt</DependentUpon>
</Compile>
<None Include="System\Net\Security\TlsCipherSuiteNameParser.ttinclude" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
<Compile Include="System\Net\Security\TlsCipherSuiteData.Lookup.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuiteData.Lookup.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<None Include="System\Net\Security\TlsCipherSuiteData.Lookup.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuiteData.Lookup.tt</DependentUpon>
</None>
</ItemGroup>
<ItemGroup Condition="'$(AllowTlsCipherSuiteGeneration)' == 'true'">
<None Include="System\Net\Security\TlsCipherSuite.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>TlsCipherSuite.cs</LastGenOutput>
</None>
<None Include="System\Net\Security\TlsCipherSuiteData.Lookup.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>TlsCipherSuiteData.Lookup.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup Condition="'$(AllowTlsCipherSuiteGeneration)' != 'true'">
<None Include="System\Net\Security\TlsCipherSuite.tt" />
<None Include="System\Net\Security\TlsCipherSuiteData.Lookup.tt" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<Compile Include="System\Net\CertificateValidationPal.Windows.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.Windows.cs" />
<Compile Include="System\Net\Security\NegotiateStreamPal.Windows.cs" />
<Compile Include="System\Net\Security\NetEventSource.Security.Windows.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.Windows.cs" />
<Compile Include="System\Net\Security\SslStreamPal.Windows.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Windows.cs" />
<Compile Include="System\Net\Security\StreamSizes.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateValidation.Windows.cs"
Link="Common\System\Net\Security\CertificateValidation.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityBuffer.Windows.cs"
Link="Common\System\Net\Security\SecurityBuffer.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityBufferType.Windows.cs"
Link="Common\System\Net\Security\SecurityBufferType.Windows.cs" />
<!-- NegotiateStream -->
<Compile Include="$(CommonPath)System\Net\SecurityStatusAdapterPal.Windows.cs"
Link="Common\System\Net\SecurityStatusAdapterPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Windows.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.Windows.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityContextTokenHandle.cs"
Link="Common\System\Net\Security\SecurityContextTokenHandle.cs" />
<!-- Interop -->
<Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
Link="Common\Interop\Windows\Interop.BOOL.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.UNICODE_STRING.cs"
Link="Common\Interop\Windows\Interop.UNICODE_STRING.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_INFO.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_INFO.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CRYPT_ALGORITHM_IDENTIFIER.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CRYPT_ALGORITHM_IDENTIFIER.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CRYPT_BIT_BLOB.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.DATA_BLOB.cs"
Link="Common\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.certificates.cs"
Link="Common\Interop\Windows\Crypt32\Interop.certificates.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.certificates_types.cs"
Link="Common\Interop\Windows\Crypt32\Interop.certificates_types.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CertEnumCertificatesInStore.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CertEnumCertificatesInStore.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.MsgEncodingType.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.MsgEncodingType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CloseHandle.cs"
Link="Common\Interop\Windows\Kernel32\Interop.CloseHandle.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.Alerts.cs"
Link="Common\Interop\Windows\SChannel\Interop.Alerts.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.SchProtocols.cs"
Link="Common\Interop\Windows\SChannel\Interop.SchProtocols.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.SECURITY_STATUS.cs"
Link="Common\Interop\Windows\SChannel\Interop.SECURITY_STATUS.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\SecPkgContext_ConnectionInfo.cs"
Link="Common\Interop\Windows\SChannel\SecPkgContext_ConnectionInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\SecPkgContext_CipherInfo.cs"
Link="Common\Interop\Windows\SChannel\SecPkgContext_CipherInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.SecPkgContext_ApplicationProtocol.cs"
Link="Common\Interop\Windows\SChannel\Interop.SecPkgContext_ApplicationProtocol.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.Sec_Application_Protocols.cs"
Link="Common\Interop\Windows\SChannel\Interop.Sec_Application_Protocols.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\UnmanagedCertificateContext.cs"
Link="Common\Interop\Windows\SChannel\UnmanagedCertificateContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\UnmanagedCertificateContext.IntPtr.cs"
Link="Common\Interop\Windows\SChannel\UnmanagedCertificateContext.IntPtr.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_Bindings.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_Bindings.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\GlobalSSPI.cs"
Link="Common\Interop\Windows\SspiCli\GlobalSSPI.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\Interop.SSPI.cs"
Link="Common\Interop\Windows\SspiCli\Interop.SSPI.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_NegotiationInfoW.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_NegotiationInfoW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\NegotiationInfoClass.cs"
Link="Common\Interop\Windows\SspiCli\NegotiationInfoClass.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_Sizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_Sizes.cs" />
<Compile Include="$(CommonPath)System\Collections\Generic\BidirectionalDictionary.cs"
Link="Common\System\Collections\Generic\BidirectionalDictionary.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SafeDeleteContext.cs"
Link="Common\Interop\Windows\SspiCli\SafeDeleteContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecurityPackageInfo.cs"
Link="Common\Interop\Windows\SspiCli\SecurityPackageInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecurityPackageInfoClass.cs"
Link="Common\Interop\Windows\SspiCli\SecurityPackageInfoClass.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecuritySafeHandles.cs"
Link="Common\Interop\Windows\SspiCli\SecuritySafeHandles.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIAuthType.cs"
Link="Common\Interop\Windows\SspiCli\SSPIAuthType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\ISSPIInterface.cs"
Link="Common\Interop\Windows\SspiCli\ISSPIInterface.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPISecureChannelType.cs"
Link="Common\Interop\Windows\SspiCli\SSPISecureChannelType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIWrapper.cs"
Link="Common\Interop\Windows\SspiCli\SSPIWrapper.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Link="Common\Interop\Unix\Interop.Errors.cs" />
<Compile Include="$(CommonPath)System\Net\Http\TlsCertificateExtensions.cs"
Link="Common\System\Net\Http\TlsCertificateExtensions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.GssFlags.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.GssFlags.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Status.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Status.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeCredentials.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SecChannelBindings.cs"
Link="Common\System\Net\Security\Unix\SecChannelBindings.cs" />
<Compile Include="System\Net\Security\Pal.Managed\EndpointChannelBindingToken.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Unix.cs" />
<Compile Include="System\Net\Security\TlsCipherSuiteData.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteNegoContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteNegoContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeNegoCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeNegoCredentials.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Unix.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.Initialization.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.Unix.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.Unix.cs" />
<Compile Include="System\Net\Security\NegotiateStreamPal.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'tvOS'">
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.PlatformNotSupported.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.PlatformNotSupported.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.PlatformNotSupported.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.PlatformNotSupported.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs" />
<Compile Include="System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(UseAndroidCrypto)' != 'true' and '$(UseAppleCrypto)' != 'true'">
<Compile Include="System\Net\CertificateValidationPal.Unix.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.Linux.cs" />
<Compile Include="System\Net\Security\SslStreamPal.Unix.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Linux.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.Linux.cs" />
<Compile Include="System\Net\Security\StreamSizes.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateValidation.Unix.cs"
Link="Common\System\Net\Security\CertificateValidation.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SetProtocolOptions.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SetProtocolOptions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtxOptions.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtxOptions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Name.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Name.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Ext.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Ext.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeHandleCache.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeHandleCache.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteSslContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteSslContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeCertContext.cs"
Link="Common\System\Net\Security\Unix\SafeFreeCertContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeSslCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeSslCredentials.cs" />
</ItemGroup>
<ItemGroup Condition="'$(UseAndroidCrypto)' == 'true'">
<Compile Include="$(CommonPath)Interop\Android\Interop.Libraries.cs"
Link="Common\Interop\Android\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Android\Interop.JObjectLifetime.cs"
Link="Common\Interop\Android\Interop.JObjectLifetime.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.cs"
Link="Common\Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.ProtocolSupport.cs"
Link="Common\Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.ProtocolSupport.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.X509.cs"
Link="Common\Interop\Android\System.Security.Cryptography.Native.Android\Interop.X509.cs" />
<Compile Include="System\Net\CertificateValidationPal.Android.cs" />
<Compile Include="System\Net\Security\MD4.cs" />
<Compile Include="System\Net\Security\Pal.Android\SafeDeleteSslContext.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SafeFreeSslCredentials.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SslProtocolsValidation.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Android.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.Android.cs" />
<Compile Include="System\Net\Security\SslStreamPal.Android.cs" />
<Compile Include="System\Net\Security\StreamSizes.Unix.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.Android.cs" />
</ItemGroup>
<ItemGroup Condition="'$(UseAppleCrypto)' == 'true'">
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFArray.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFArray.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFData.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFData.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFDate.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFDate.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFError.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFError.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFString.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFString.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs"
Link="Common\Interop\OSX\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.SecErrMessage.cs"
Link="Common\Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.SecErrMessage.cs" />
<Compile Include="$(CommonPath)Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.SslErr.cs"
Link="Common\Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.SslErr.cs" />
<Compile Include="$(CommonPath)Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.Ssl.cs"
Link="Common\Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.Ssl.cs" />
<Compile Include="$(CommonPath)Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.X509Chain.cs"
Link="Common\Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.X509Chain.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs" />
<Compile Include="System\Net\CertificateValidationPal.OSX.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SafeFreeSslCredentials.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SslProtocolsValidation.cs" />
<Compile Include="System\Net\Security\Pal.OSX\SafeDeleteSslContext.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.OSX.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.OSX.cs" />
<Compile Include="System\Net\Security\SslStreamPal.OSX.cs" />
<Compile Include="System\Net\Security\StreamSizes.OSX.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.OSX.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Console" Condition="'$(Configuration)' == 'Debug'" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.Linq" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Net.Sockets" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.Claims" />
<Reference Include="System.Security.Cryptography" />
<Reference Include="System.Security.Cryptography.OpenSsl" />
<Reference Include="System.Security.Cryptography.X509Certificates" />
<Reference Include="System.Security.Principal" />
<Reference Include="System.Security.Principal.Windows" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.ThreadPool" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
<Reference Include="System.Diagnostics.StackTrace" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Security.Cryptography" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)</TargetFrameworks>
<!-- This is needed so that code for TlsCipherSuite will have no namespace (causes compile errors) when used within T4 template -->
<DefineConstants>$(DefineConstants);PRODUCT</DefineConstants>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- DesignTimeBuild requires all the TargetFramework Derived Properties to not be present in the first property group. -->
<PropertyGroup>
<TargetPlatformIdentifier>$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)'))</TargetPlatformIdentifier>
<GeneratePlatformNotSupportedAssemblyMessage Condition="'$(TargetPlatformIdentifier)' == ''">SR.SystemNetSecurity_PlatformNotSupported</GeneratePlatformNotSupportedAssemblyMessage>
<DefineConstants Condition="'$(TargetPlatformIdentifier)' == 'windows'">$(DefineConstants);TARGET_WINDOWS</DefineConstants>
<UseAndroidCrypto Condition="'$(TargetPlatformIdentifier)' == 'Android'">true</UseAndroidCrypto>
<UseAppleCrypto Condition="'$(TargetPlatformIdentifier)' == 'OSX' or '$(TargetPlatformIdentifier)' == 'iOS' or '$(TargetPlatformIdentifier)' == 'tvOS'">true</UseAppleCrypto>
<DefineConstants Condition="'$(UseAndroidCrypto)' == 'true' or '$(UseAppleCrypto)' == 'true'">$(DefineConstants);SYSNETSECURITY_NO_OPENSSL</DefineConstants>
</PropertyGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\CertificateValidationPal.cs" />
<Compile Include="System\Net\Logging\NetEventSource.cs" />
<Compile Include="System\Net\SslStreamContext.cs" />
<Compile Include="System\Net\Security\AuthenticatedStream.cs" />
<Compile Include="System\Security\Authentication\AuthenticationException.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicy.cs" />
<Compile Include="System\Net\Security\NetEventSource.Security.cs" />
<Compile Include="System\Net\Security\NetSecurityTelemetry.cs" />
<Compile Include="System\Net\Security\ReadWriteAdapter.cs" />
<Compile Include="System\Net\Security\ProtectionLevel.cs" />
<Compile Include="System\Net\Security\SslApplicationProtocol.cs" />
<Compile Include="System\Net\Security\SslAuthenticationOptions.cs" />
<Compile Include="System\Net\Security\SslCertificateTrust.cs" />
<Compile Include="System\Net\Security\SslClientAuthenticationOptions.cs" />
<Compile Include="System\Net\Security\SslClientHelloInfo.cs" />
<Compile Include="System\Net\Security\SslServerAuthenticationOptions.cs" />
<Compile Include="System\Net\Security\SecureChannel.cs" />
<Compile Include="System\Net\Security\SslSessionsCache.cs" />
<Compile Include="System\Net\Security\SslStream.cs" />
<Compile Include="System\Net\Security\SslStream.Implementation.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.cs" />
<Compile Include="System\Net\Security\StreamSizes.cs" />
<Compile Include="System\Net\Security\TlsAlertType.cs" />
<Compile Include="System\Net\Security\TlsAlertMessage.cs" />
<Compile Include="System\Net\Security\TlsFrameHelper.cs" />
<!-- NegotiateStream -->
<Compile Include="System\Net\NTAuthentication.cs" />
<Compile Include="System\Net\StreamFramer.cs" />
<Compile Include="System\Net\Security\NegotiateStream.cs" />
<Compile Include="System\Security\Authentication\ExtendedProtection\ExtendedProtectionPolicy.cs" />
<Compile Include="System\Security\Authentication\ExtendedProtection\PolicyEnforcement.cs" />
<Compile Include="System\Security\Authentication\ExtendedProtection\ProtectionScenario.cs" />
<Compile Include="System\Security\Authentication\ExtendedProtection\ServiceNameCollection.cs" />
<!-- Common sources -->
<Compile Include="$(CommonPath)DisableRuntimeMarshalling.cs"
Link="Common\DisableRuntimeMarshalling.cs" />
<!-- Logging -->
<Compile Include="$(CommonPath)System\Net\Logging\NetEventSource.Common.cs"
Link="Common\System\Net\Logging\NetEventSource.Common.cs" />
<Compile Include="$(CommonPath)System\Net\InternalException.cs"
Link="Common\System\Net\InternalException.cs" />
<!-- Debug only -->
<Compile Include="$(CommonPath)System\Net\DebugSafeHandle.cs"
Link="Common\System\Net\DebugSafeHandle.cs" />
<Compile Include="$(CommonPath)System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs"
Link="Common\System\Net\DebugSafeHandleZeroOrMinusOneIsInvalid.cs" />
<!-- System.Net common -->
<Compile Include="$(CommonPath)System\Net\ArrayBuffer.cs">
<Link>Common\System\Net\ArrayBuffer.cs</Link>
</Compile>
<Compile Include="$(CommonPath)System\Net\ExceptionCheck.cs"
Link="Common\System\Net\ExceptionCheck.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityProtocol.cs"
Link="Common\System\Net\SecurityProtocol.cs" />
<Compile Include="$(CommonPath)System\Net\UriScheme.cs"
Link="Common\System\Net\UriScheme.cs" />
<!-- Common -->
<Compile Include="$(CommonPath)System\NotImplemented.cs"
Link="Common\System\NotImplemented.cs" />
<Compile Include="$(CommonPath)System\Threading\Tasks\TaskToApm.cs"
Link="Common\System\Threading\Tasks\TaskToApm.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SafeCredentialReference.cs"
Link="Common\System\Net\Security\SafeCredentialReference.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SSPIHandleCache.cs"
Link="Common\System\Net\Security\SSPIHandleCache.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsPal.cs"
Link="Common\System\Net\ContextFlagsPal.cs" />
<Compile Include="$(CommonPath)System\Net\NegotiationInfoClass.cs"
Link="Common\System\Net\NegotiationInfoClass.cs" />
<Compile Include="$(CommonPath)System\Net\NTAuthentication.Common.cs"
Link="Common\System\Net\NTAuthentication.Common.cs" />
<Compile Include="$(CommonPath)System\Net\SecurityStatusPal.cs"
Link="Common\System\Net\SecurityStatusPal.cs" />
<Compile Include="$(CommonPath)System\HexConverter.cs"
Link="Common\System\HexConverter.cs" />
<Compile Include="$(CommonPath)System\Obsoletions.cs"
Link="Common\System\Obsoletions.cs" />
</ItemGroup>
<!-- This file depends on IANA registry. We do not want anyone's build to break after the update -->
<!-- or if they don't have internet connection - explicit opt-in required -->
<!-- To expose newly generated APIs, generated file have to be deliberately copied -->
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != ''">
<Compile Include="System\Net\Security\TlsCipherSuite.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuite.tt</DependentUpon>
</Compile>
<None Include="System\Net\Security\TlsCipherSuiteNameParser.ttinclude" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
<Compile Include="System\Net\Security\TlsCipherSuiteData.Lookup.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuiteData.Lookup.tt</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<None Include="System\Net\Security\TlsCipherSuiteData.Lookup.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TlsCipherSuiteData.Lookup.tt</DependentUpon>
</None>
</ItemGroup>
<ItemGroup Condition="'$(AllowTlsCipherSuiteGeneration)' == 'true'">
<None Include="System\Net\Security\TlsCipherSuite.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>TlsCipherSuite.cs</LastGenOutput>
</None>
<None Include="System\Net\Security\TlsCipherSuiteData.Lookup.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>TlsCipherSuiteData.Lookup.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup Condition="'$(AllowTlsCipherSuiteGeneration)' != 'true'">
<None Include="System\Net\Security\TlsCipherSuite.tt" />
<None Include="System\Net\Security\TlsCipherSuiteData.Lookup.tt" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'windows'">
<Compile Include="System\Net\CertificateValidationPal.Windows.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.Windows.cs" />
<Compile Include="System\Net\Security\NegotiateStreamPal.Windows.cs" />
<Compile Include="System\Net\Security\NetEventSource.Security.Windows.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.Windows.cs" />
<Compile Include="System\Net\Security\SslStreamPal.Windows.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Windows.cs" />
<Compile Include="System\Net\Security\StreamSizes.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateValidation.Windows.cs"
Link="Common\System\Net\Security\CertificateValidation.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityBuffer.Windows.cs"
Link="Common\System\Net\Security\SecurityBuffer.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityBufferType.Windows.cs"
Link="Common\System\Net\Security\SecurityBufferType.Windows.cs" />
<!-- NegotiateStream -->
<Compile Include="$(CommonPath)System\Net\SecurityStatusAdapterPal.Windows.cs"
Link="Common\System\Net\SecurityStatusAdapterPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Windows.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.Windows.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.Windows.cs" />
<Compile Include="$(CommonPath)System\Net\Security\SecurityContextTokenHandle.cs"
Link="Common\System\Net\Security\SecurityContextTokenHandle.cs" />
<!-- Interop -->
<Compile Include="$(CommonPath)Interop\Windows\Interop.BOOL.cs"
Link="Common\Interop\Windows\Interop.BOOL.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.UNICODE_STRING.cs"
Link="Common\Interop\Windows\Interop.UNICODE_STRING.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_CONTEXT.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_INFO.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_INFO.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CERT_PUBLIC_KEY_INFO.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CRYPT_ALGORITHM_IDENTIFIER.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CRYPT_ALGORITHM_IDENTIFIER.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CRYPT_BIT_BLOB.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.CRYPT_BIT_BLOB.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.DATA_BLOB.cs"
Link="Common\Interop\Windows\Crypt32\Interop.DATA_BLOB.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.certificates.cs"
Link="Common\Interop\Windows\Crypt32\Interop.certificates.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.certificates_types.cs"
Link="Common\Interop\Windows\Crypt32\Interop.certificates_types.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.CertEnumCertificatesInStore.cs"
Link="Common\Interop\Windows\Crypt32\Interop.CertEnumCertificatesInStore.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Crypt32\Interop.MsgEncodingType.cs"
Link="Common\Interop\Windows\Crypt32\Interop.Interop.MsgEncodingType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Kernel32\Interop.CloseHandle.cs"
Link="Common\Interop\Windows\Kernel32\Interop.CloseHandle.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.Alerts.cs"
Link="Common\Interop\Windows\SChannel\Interop.Alerts.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.SchProtocols.cs"
Link="Common\Interop\Windows\SChannel\Interop.SchProtocols.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.SECURITY_STATUS.cs"
Link="Common\Interop\Windows\SChannel\Interop.SECURITY_STATUS.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\SecPkgContext_ConnectionInfo.cs"
Link="Common\Interop\Windows\SChannel\SecPkgContext_ConnectionInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\SecPkgContext_CipherInfo.cs"
Link="Common\Interop\Windows\SChannel\SecPkgContext_CipherInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.SecPkgContext_ApplicationProtocol.cs"
Link="Common\Interop\Windows\SChannel\Interop.SecPkgContext_ApplicationProtocol.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\Interop.Sec_Application_Protocols.cs"
Link="Common\Interop\Windows\SChannel\Interop.Sec_Application_Protocols.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\UnmanagedCertificateContext.cs"
Link="Common\Interop\Windows\SChannel\UnmanagedCertificateContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SChannel\UnmanagedCertificateContext.IntPtr.cs"
Link="Common\Interop\Windows\SChannel\UnmanagedCertificateContext.IntPtr.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_Bindings.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_Bindings.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\GlobalSSPI.cs"
Link="Common\Interop\Windows\SspiCli\GlobalSSPI.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\Interop.SSPI.cs"
Link="Common\Interop\Windows\SspiCli\Interop.SSPI.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_NegotiationInfoW.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_NegotiationInfoW.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\NegotiationInfoClass.cs"
Link="Common\Interop\Windows\SspiCli\NegotiationInfoClass.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_Sizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_Sizes.cs" />
<Compile Include="$(CommonPath)System\Collections\Generic\BidirectionalDictionary.cs"
Link="Common\System\Collections\Generic\BidirectionalDictionary.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SafeDeleteContext.cs"
Link="Common\Interop\Windows\SspiCli\SafeDeleteContext.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecurityPackageInfo.cs"
Link="Common\Interop\Windows\SspiCli\SecurityPackageInfo.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecurityPackageInfoClass.cs"
Link="Common\Interop\Windows\SspiCli\SecurityPackageInfoClass.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecuritySafeHandles.cs"
Link="Common\Interop\Windows\SspiCli\SecuritySafeHandles.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIAuthType.cs"
Link="Common\Interop\Windows\SspiCli\SSPIAuthType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\ISSPIInterface.cs"
Link="Common\Interop\Windows\SspiCli\ISSPIInterface.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPISecureChannelType.cs"
Link="Common\Interop\Windows\SspiCli\SSPISecureChannelType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SSPIWrapper.cs"
Link="Common\Interop\Windows\SspiCli\SSPIWrapper.cs" />
<Compile Include="$(CommonPath)Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs"
Link="Common\Interop\Windows\SspiCli\SecPkgContext_StreamSizes.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
<Compile Include="$(CommonPath)Interop\Unix\Interop.Libraries.cs"
Link="Common\Interop\Unix\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Unix\Interop.Errors.cs"
Link="Common\Interop\Unix\Interop.Errors.cs" />
<Compile Include="$(CommonPath)System\Net\Http\TlsCertificateExtensions.cs"
Link="Common\System\Net\Http\TlsCertificateExtensions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.GssFlags.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.GssFlags.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Status.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.Status.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeCredentials.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SecChannelBindings.cs"
Link="Common\System\Net\Security\Unix\SecChannelBindings.cs" />
<Compile Include="System\Net\Security\Pal.Managed\EndpointChannelBindingToken.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Unix.cs" />
<Compile Include="System\Net\Security\TlsCipherSuiteData.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(TargetPlatformIdentifier)' != 'tvOS'">
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteNegoContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteNegoContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeNegoCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeNegoCredentials.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.Unix.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.Initialization.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs"
Link="Common\Interop\Unix\System.Net.Security.Native\Interop.NetSecurityNative.IsNtlmInstalled.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.Unix.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.Unix.cs" />
<Compile Include="System\Net\Security\NegotiateStreamPal.Unix.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' == 'tvOS'">
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\GssSafeHandles.PlatformNotSupported.cs"
Link="Common\Microsoft\Win32\SafeHandles\GssSafeHandles.PlatformNotSupported.cs" />
<Compile Include="$(CommonPath)System\Net\ContextFlagsAdapterPal.PlatformNotSupported.cs"
Link="Common\System\Net\ContextFlagsAdapterPal.PlatformNotSupported.cs" />
<Compile Include="$(CommonPath)System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs"
Link="Common\System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs" />
<Compile Include="System\Net\Security\NegotiateStreamPal.PlatformNotSupported.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows' and '$(UseAndroidCrypto)' != 'true' and '$(UseAppleCrypto)' != 'true'">
<Compile Include="System\Net\CertificateValidationPal.Unix.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.Linux.cs" />
<Compile Include="System\Net\Security\SslStreamPal.Unix.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Linux.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.Linux.cs" />
<Compile Include="System\Net\Security\StreamSizes.Unix.cs" />
<Compile Include="$(CommonPath)System\Net\Security\CertificateValidation.Unix.cs"
Link="Common\System\Net\Security\CertificateValidation.Unix.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.BIO.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Initialization.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SetProtocolOptions.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SetProtocolOptions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtxOptions.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtxOptions.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Name.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Name.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Ext.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Ext.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509Stack.cs" />
<Compile Include="$(CommonPath)Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs"
Link="Common\Interop\Unix\System.Security.Cryptography.Native\Interop.X509StoreCtx.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeX509Handles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\X509ExtensionSafeHandles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs"
Link="Common\Microsoft\Win32\SafeHandles\Asn1SafeHandles.Unix.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeHandleCache.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeHandleCache.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeDeleteSslContext.cs"
Link="Common\System\Net\Security\Unix\SafeDeleteSslContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeCertContext.cs"
Link="Common\System\Net\Security\Unix\SafeFreeCertContext.cs" />
<Compile Include="$(CommonPath)System\Net\Security\Unix\SafeFreeSslCredentials.cs"
Link="Common\System\Net\Security\Unix\SafeFreeSslCredentials.cs" />
</ItemGroup>
<ItemGroup Condition="'$(UseAndroidCrypto)' == 'true'">
<Compile Include="$(CommonPath)Interop\Android\Interop.Libraries.cs"
Link="Common\Interop\Android\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\Android\Interop.JObjectLifetime.cs"
Link="Common\Interop\Android\Interop.JObjectLifetime.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.cs"
Link="Common\Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.ProtocolSupport.cs"
Link="Common\Interop\Android\System.Security.Cryptography.Native.Android\Interop.Ssl.ProtocolSupport.cs" />
<Compile Include="$(CommonPath)Interop\Android\System.Security.Cryptography.Native.Android\Interop.X509.cs"
Link="Common\Interop\Android\System.Security.Cryptography.Native.Android\Interop.X509.cs" />
<Compile Include="System\Net\CertificateValidationPal.Android.cs" />
<Compile Include="System\Net\Security\MD4.cs" />
<Compile Include="System\Net\Security\Pal.Android\SafeDeleteSslContext.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SafeFreeSslCredentials.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SslProtocolsValidation.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.Android.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.Android.cs" />
<Compile Include="System\Net\Security\SslStreamPal.Android.cs" />
<Compile Include="System\Net\Security\StreamSizes.Unix.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.Android.cs" />
</ItemGroup>
<ItemGroup Condition="'$(UseAppleCrypto)' == 'true'">
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFArray.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFArray.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFData.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFData.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFDate.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFDate.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFError.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFError.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.CoreFoundation.CFString.cs"
Link="Common\Interop\OSX\Interop.CoreFoundation.CFString.cs" />
<Compile Include="$(CommonPath)Interop\OSX\Interop.Libraries.cs"
Link="Common\Interop\OSX\Interop.Libraries.cs" />
<Compile Include="$(CommonPath)Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.SecErrMessage.cs"
Link="Common\Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.SecErrMessage.cs" />
<Compile Include="$(CommonPath)Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.SslErr.cs"
Link="Common\Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.SslErr.cs" />
<Compile Include="$(CommonPath)Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.Ssl.cs"
Link="Common\Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.Ssl.cs" />
<Compile Include="$(CommonPath)Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.X509Chain.cs"
Link="Common\Interop\OSX\System.Security.Cryptography.Native.Apple\Interop.X509Chain.cs" />
<Compile Include="$(CommonPath)Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs"
Link="Common\Microsoft\Win32\SafeHandles\SafeCreateHandle.OSX.cs" />
<Compile Include="System\Net\CertificateValidationPal.OSX.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SafeFreeSslCredentials.cs" />
<Compile Include="System\Net\Security\Pal.Managed\SslProtocolsValidation.cs" />
<Compile Include="System\Net\Security\Pal.OSX\SafeDeleteSslContext.cs" />
<Compile Include="System\Net\Security\SslConnectionInfo.OSX.cs" />
<Compile Include="System\Net\Security\SslStreamCertificateContext.OSX.cs" />
<Compile Include="System\Net\Security\SslStreamPal.OSX.cs" />
<Compile Include="System\Net\Security\StreamSizes.OSX.cs" />
<Compile Include="System\Net\Security\CipherSuitesPolicyPal.OSX.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.Win32.Primitives" />
<Reference Include="System.Collections" />
<Reference Include="System.Collections.Concurrent" />
<Reference Include="System.Collections.NonGeneric" />
<Reference Include="System.Console" Condition="'$(Configuration)' == 'Debug'" />
<Reference Include="System.Diagnostics.Tracing" />
<Reference Include="System.Linq" />
<Reference Include="System.Memory" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.Net.Sockets" />
<Reference Include="System.Runtime" />
<Reference Include="System.Runtime.Extensions" />
<Reference Include="System.Runtime.CompilerServices.Unsafe" />
<Reference Include="System.Runtime.InteropServices" />
<Reference Include="System.Security.Claims" />
<Reference Include="System.Security.Cryptography" />
<Reference Include="System.Security.Cryptography.OpenSsl" />
<Reference Include="System.Security.Cryptography.X509Certificates" />
<Reference Include="System.Security.Principal" />
<Reference Include="System.Security.Principal.Windows" />
<Reference Include="System.Threading" />
<Reference Include="System.Threading.ThreadPool" />
</ItemGroup>
<ItemGroup Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetPlatformIdentifier)' != 'windows'">
<Reference Include="System.Diagnostics.StackTrace" />
<Reference Include="System.Security.Cryptography.Algorithms" />
<Reference Include="System.Security.Cryptography" />
</ItemGroup>
</Project>
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Security/src/System/Net/Security/NetSecurityTelemetry.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Diagnostics.CodeAnalysis;
using System.Security.Authentication;
using System.Threading;
using Microsoft.Extensions.Internal;
namespace System.Net.Security
{
[EventSource(Name = "System.Net.Security")]
internal sealed class NetSecurityTelemetry : EventSource
{
#if !ES_BUILD_STANDALONE
private const string EventSourceSuppressMessage = "Parameters to this method are primitive and are trimmer safe";
#endif
public static readonly NetSecurityTelemetry Log = new NetSecurityTelemetry();
private IncrementingPollingCounter? _tlsHandshakeRateCounter;
private PollingCounter? _totalTlsHandshakesCounter;
private PollingCounter? _currentTlsHandshakesCounter;
private PollingCounter? _failedTlsHandshakesCounter;
private PollingCounter? _sessionsOpenCounter;
private PollingCounter? _sessionsOpenTls10Counter;
private PollingCounter? _sessionsOpenTls11Counter;
private PollingCounter? _sessionsOpenTls12Counter;
private PollingCounter? _sessionsOpenTls13Counter;
private EventCounter? _handshakeDurationCounter;
private EventCounter? _handshakeDurationTls10Counter;
private EventCounter? _handshakeDurationTls11Counter;
private EventCounter? _handshakeDurationTls12Counter;
private EventCounter? _handshakeDurationTls13Counter;
private long _finishedTlsHandshakes; // Successfully and failed
private long _startedTlsHandshakes;
private long _failedTlsHandshakes;
private long _sessionsOpen;
private long _sessionsOpenTls10;
private long _sessionsOpenTls11;
private long _sessionsOpenTls12;
private long _sessionsOpenTls13;
protected override void OnEventCommand(EventCommandEventArgs command)
{
if (command.Command == EventCommand.Enable)
{
_tlsHandshakeRateCounter ??= new IncrementingPollingCounter("tls-handshake-rate", this, () => Interlocked.Read(ref _finishedTlsHandshakes))
{
DisplayName = "TLS handshakes completed",
DisplayRateTimeScale = TimeSpan.FromSeconds(1)
};
_totalTlsHandshakesCounter ??= new PollingCounter("total-tls-handshakes", this, () => Interlocked.Read(ref _finishedTlsHandshakes))
{
DisplayName = "Total TLS handshakes completed"
};
_currentTlsHandshakesCounter ??= new PollingCounter("current-tls-handshakes", this, () => -Interlocked.Read(ref _finishedTlsHandshakes) + Interlocked.Read(ref _startedTlsHandshakes))
{
DisplayName = "Current TLS handshakes"
};
_failedTlsHandshakesCounter ??= new PollingCounter("failed-tls-handshakes", this, () => Interlocked.Read(ref _failedTlsHandshakes))
{
DisplayName = "Total TLS handshakes failed"
};
_sessionsOpenCounter ??= new PollingCounter("all-tls-sessions-open", this, () => Interlocked.Read(ref _sessionsOpen))
{
DisplayName = "All TLS Sessions Active"
};
_sessionsOpenTls10Counter ??= new PollingCounter("tls10-sessions-open", this, () => Interlocked.Read(ref _sessionsOpenTls10))
{
DisplayName = "TLS 1.0 Sessions Active"
};
_sessionsOpenTls11Counter ??= new PollingCounter("tls11-sessions-open", this, () => Interlocked.Read(ref _sessionsOpenTls11))
{
DisplayName = "TLS 1.1 Sessions Active"
};
_sessionsOpenTls12Counter ??= new PollingCounter("tls12-sessions-open", this, () => Interlocked.Read(ref _sessionsOpenTls12))
{
DisplayName = "TLS 1.2 Sessions Active"
};
_sessionsOpenTls13Counter ??= new PollingCounter("tls13-sessions-open", this, () => Interlocked.Read(ref _sessionsOpenTls13))
{
DisplayName = "TLS 1.3 Sessions Active"
};
_handshakeDurationCounter ??= new EventCounter("all-tls-handshake-duration", this)
{
DisplayName = "TLS Handshake Duration",
DisplayUnits = "ms"
};
_handshakeDurationTls10Counter ??= new EventCounter("tls10-handshake-duration", this)
{
DisplayName = "TLS 1.0 Handshake Duration",
DisplayUnits = "ms"
};
_handshakeDurationTls11Counter ??= new EventCounter("tls11-handshake-duration", this)
{
DisplayName = "TLS 1.1 Handshake Duration",
DisplayUnits = "ms"
};
_handshakeDurationTls12Counter ??= new EventCounter("tls12-handshake-duration", this)
{
DisplayName = "TLS 1.2 Handshake Duration",
DisplayUnits = "ms"
};
_handshakeDurationTls13Counter ??= new EventCounter("tls13-handshake-duration", this)
{
DisplayName = "TLS 1.3 Handshake Duration",
DisplayUnits = "ms"
};
}
}
[Event(1, Level = EventLevel.Informational)]
public void HandshakeStart(bool isServer, string targetHost)
{
Interlocked.Increment(ref _startedTlsHandshakes);
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
{
WriteEvent(eventId: 1, isServer, targetHost);
}
}
[Event(2, Level = EventLevel.Informational)]
private void HandshakeStop(SslProtocols protocol)
{
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
{
WriteEvent(eventId: 2, protocol);
}
}
[Event(3, Level = EventLevel.Error)]
private void HandshakeFailed(bool isServer, double elapsedMilliseconds, string exceptionMessage)
{
WriteEvent(eventId: 3, isServer, elapsedMilliseconds, exceptionMessage);
}
[NonEvent]
public void HandshakeFailed(bool isServer, ValueStopwatch stopwatch, string exceptionMessage)
{
Interlocked.Increment(ref _finishedTlsHandshakes);
Interlocked.Increment(ref _failedTlsHandshakes);
if (IsEnabled(EventLevel.Error, EventKeywords.None))
{
HandshakeFailed(isServer, stopwatch.GetElapsedTime().TotalMilliseconds, exceptionMessage);
}
HandshakeStop(SslProtocols.None);
}
[NonEvent]
public void HandshakeCompleted(SslProtocols protocol, ValueStopwatch stopwatch, bool connectionOpen)
{
Interlocked.Increment(ref _finishedTlsHandshakes);
long dummy = 0;
ref long protocolSessionsOpen = ref dummy;
EventCounter? handshakeDurationCounter = null;
Debug.Assert(Enum.GetValues<SslProtocols>()[^1] == SslProtocols.Tls13, "Make sure to add a counter for new SslProtocols");
switch (protocol)
{
#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete
case SslProtocols.Tls:
protocolSessionsOpen = ref _sessionsOpenTls10;
handshakeDurationCounter = _handshakeDurationTls10Counter;
break;
case SslProtocols.Tls11:
protocolSessionsOpen = ref _sessionsOpenTls11;
handshakeDurationCounter = _handshakeDurationTls11Counter;
break;
#pragma warning restore SYSLIB0039
case SslProtocols.Tls12:
protocolSessionsOpen = ref _sessionsOpenTls12;
handshakeDurationCounter = _handshakeDurationTls12Counter;
break;
case SslProtocols.Tls13:
protocolSessionsOpen = ref _sessionsOpenTls13;
handshakeDurationCounter = _handshakeDurationTls13Counter;
break;
}
if (connectionOpen)
{
Interlocked.Increment(ref protocolSessionsOpen);
Interlocked.Increment(ref _sessionsOpen);
}
double duration = stopwatch.GetElapsedTime().TotalMilliseconds;
handshakeDurationCounter?.WriteMetric(duration);
_handshakeDurationCounter!.WriteMetric(duration);
HandshakeStop(protocol);
}
[NonEvent]
public void ConnectionClosed(SslProtocols protocol)
{
long count = 0;
switch (protocol)
{
#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete
case SslProtocols.Tls:
count = Interlocked.Decrement(ref _sessionsOpenTls10);
break;
case SslProtocols.Tls11:
count = Interlocked.Decrement(ref _sessionsOpenTls11);
break;
#pragma warning restore SYSLIB0039
case SslProtocols.Tls12:
count = Interlocked.Decrement(ref _sessionsOpenTls12);
break;
case SslProtocols.Tls13:
count = Interlocked.Decrement(ref _sessionsOpenTls13);
break;
}
Debug.Assert(count >= 0);
count = Interlocked.Decrement(ref _sessionsOpen);
Debug.Assert(count >= 0);
}
#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, bool arg1, string? arg2)
{
if (IsEnabled())
{
arg2 ??= string.Empty;
fixed (char* arg2Ptr = arg2)
{
const int NumEventDatas = 2;
EventData* descrs = stackalloc EventData[NumEventDatas];
descrs[0] = new EventData
{
DataPointer = (IntPtr)(&arg1),
Size = sizeof(int) // EventSource defines bool as a 32-bit type
};
descrs[1] = new EventData
{
DataPointer = (IntPtr)(arg2Ptr),
Size = (arg2.Length + 1) * sizeof(char)
};
WriteEventCore(eventId, NumEventDatas, descrs);
}
}
}
#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, SslProtocols arg1)
{
if (IsEnabled())
{
var data = new EventData
{
DataPointer = (IntPtr)(&arg1),
Size = sizeof(SslProtocols)
};
WriteEventCore(eventId, eventDataCount: 1, &data);
}
}
#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, bool arg1, double arg2, string? arg3)
{
if (IsEnabled())
{
arg3 ??= string.Empty;
fixed (char* arg3Ptr = arg3)
{
const int NumEventDatas = 3;
EventData* descrs = stackalloc EventData[NumEventDatas];
descrs[0] = new EventData
{
DataPointer = (IntPtr)(&arg1),
Size = sizeof(int) // EventSource defines bool as a 32-bit type
};
descrs[1] = new EventData
{
DataPointer = (IntPtr)(&arg2),
Size = sizeof(double)
};
descrs[2] = new EventData
{
DataPointer = (IntPtr)(arg3Ptr),
Size = (arg3.Length + 1) * sizeof(char)
};
WriteEventCore(eventId, NumEventDatas, descrs);
}
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Diagnostics.Tracing;
using System.Diagnostics.CodeAnalysis;
using System.Security.Authentication;
using System.Threading;
namespace System.Net.Security
{
[EventSource(Name = "System.Net.Security")]
internal sealed class NetSecurityTelemetry : EventSource
{
#if !ES_BUILD_STANDALONE
private const string EventSourceSuppressMessage = "Parameters to this method are primitive and are trimmer safe";
#endif
public static readonly NetSecurityTelemetry Log = new NetSecurityTelemetry();
private IncrementingPollingCounter? _tlsHandshakeRateCounter;
private PollingCounter? _totalTlsHandshakesCounter;
private PollingCounter? _currentTlsHandshakesCounter;
private PollingCounter? _failedTlsHandshakesCounter;
private PollingCounter? _sessionsOpenCounter;
private PollingCounter? _sessionsOpenTls10Counter;
private PollingCounter? _sessionsOpenTls11Counter;
private PollingCounter? _sessionsOpenTls12Counter;
private PollingCounter? _sessionsOpenTls13Counter;
private EventCounter? _handshakeDurationCounter;
private EventCounter? _handshakeDurationTls10Counter;
private EventCounter? _handshakeDurationTls11Counter;
private EventCounter? _handshakeDurationTls12Counter;
private EventCounter? _handshakeDurationTls13Counter;
private long _finishedTlsHandshakes; // Successfully and failed
private long _startedTlsHandshakes;
private long _failedTlsHandshakes;
private long _sessionsOpen;
private long _sessionsOpenTls10;
private long _sessionsOpenTls11;
private long _sessionsOpenTls12;
private long _sessionsOpenTls13;
protected override void OnEventCommand(EventCommandEventArgs command)
{
if (command.Command == EventCommand.Enable)
{
_tlsHandshakeRateCounter ??= new IncrementingPollingCounter("tls-handshake-rate", this, () => Interlocked.Read(ref _finishedTlsHandshakes))
{
DisplayName = "TLS handshakes completed",
DisplayRateTimeScale = TimeSpan.FromSeconds(1)
};
_totalTlsHandshakesCounter ??= new PollingCounter("total-tls-handshakes", this, () => Interlocked.Read(ref _finishedTlsHandshakes))
{
DisplayName = "Total TLS handshakes completed"
};
_currentTlsHandshakesCounter ??= new PollingCounter("current-tls-handshakes", this, () => -Interlocked.Read(ref _finishedTlsHandshakes) + Interlocked.Read(ref _startedTlsHandshakes))
{
DisplayName = "Current TLS handshakes"
};
_failedTlsHandshakesCounter ??= new PollingCounter("failed-tls-handshakes", this, () => Interlocked.Read(ref _failedTlsHandshakes))
{
DisplayName = "Total TLS handshakes failed"
};
_sessionsOpenCounter ??= new PollingCounter("all-tls-sessions-open", this, () => Interlocked.Read(ref _sessionsOpen))
{
DisplayName = "All TLS Sessions Active"
};
_sessionsOpenTls10Counter ??= new PollingCounter("tls10-sessions-open", this, () => Interlocked.Read(ref _sessionsOpenTls10))
{
DisplayName = "TLS 1.0 Sessions Active"
};
_sessionsOpenTls11Counter ??= new PollingCounter("tls11-sessions-open", this, () => Interlocked.Read(ref _sessionsOpenTls11))
{
DisplayName = "TLS 1.1 Sessions Active"
};
_sessionsOpenTls12Counter ??= new PollingCounter("tls12-sessions-open", this, () => Interlocked.Read(ref _sessionsOpenTls12))
{
DisplayName = "TLS 1.2 Sessions Active"
};
_sessionsOpenTls13Counter ??= new PollingCounter("tls13-sessions-open", this, () => Interlocked.Read(ref _sessionsOpenTls13))
{
DisplayName = "TLS 1.3 Sessions Active"
};
_handshakeDurationCounter ??= new EventCounter("all-tls-handshake-duration", this)
{
DisplayName = "TLS Handshake Duration",
DisplayUnits = "ms"
};
_handshakeDurationTls10Counter ??= new EventCounter("tls10-handshake-duration", this)
{
DisplayName = "TLS 1.0 Handshake Duration",
DisplayUnits = "ms"
};
_handshakeDurationTls11Counter ??= new EventCounter("tls11-handshake-duration", this)
{
DisplayName = "TLS 1.1 Handshake Duration",
DisplayUnits = "ms"
};
_handshakeDurationTls12Counter ??= new EventCounter("tls12-handshake-duration", this)
{
DisplayName = "TLS 1.2 Handshake Duration",
DisplayUnits = "ms"
};
_handshakeDurationTls13Counter ??= new EventCounter("tls13-handshake-duration", this)
{
DisplayName = "TLS 1.3 Handshake Duration",
DisplayUnits = "ms"
};
}
}
[Event(1, Level = EventLevel.Informational)]
public void HandshakeStart(bool isServer, string targetHost)
{
Interlocked.Increment(ref _startedTlsHandshakes);
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
{
WriteEvent(eventId: 1, isServer, targetHost);
}
}
[Event(2, Level = EventLevel.Informational)]
private void HandshakeStop(SslProtocols protocol)
{
if (IsEnabled(EventLevel.Informational, EventKeywords.None))
{
WriteEvent(eventId: 2, protocol);
}
}
[Event(3, Level = EventLevel.Error)]
private void HandshakeFailed(bool isServer, double elapsedMilliseconds, string exceptionMessage)
{
WriteEvent(eventId: 3, isServer, elapsedMilliseconds, exceptionMessage);
}
[NonEvent]
public void HandshakeFailed(bool isServer, long startingTimestamp, string exceptionMessage)
{
Interlocked.Increment(ref _finishedTlsHandshakes);
Interlocked.Increment(ref _failedTlsHandshakes);
if (IsEnabled(EventLevel.Error, EventKeywords.None))
{
HandshakeFailed(isServer, Stopwatch.GetElapsedTime(startingTimestamp).TotalMilliseconds, exceptionMessage);
}
HandshakeStop(SslProtocols.None);
}
[NonEvent]
public void HandshakeCompleted(SslProtocols protocol, long startingTimestamp, bool connectionOpen)
{
Interlocked.Increment(ref _finishedTlsHandshakes);
long dummy = 0;
ref long protocolSessionsOpen = ref dummy;
EventCounter? handshakeDurationCounter = null;
Debug.Assert(Enum.GetValues<SslProtocols>()[^1] == SslProtocols.Tls13, "Make sure to add a counter for new SslProtocols");
switch (protocol)
{
#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete
case SslProtocols.Tls:
protocolSessionsOpen = ref _sessionsOpenTls10;
handshakeDurationCounter = _handshakeDurationTls10Counter;
break;
case SslProtocols.Tls11:
protocolSessionsOpen = ref _sessionsOpenTls11;
handshakeDurationCounter = _handshakeDurationTls11Counter;
break;
#pragma warning restore SYSLIB0039
case SslProtocols.Tls12:
protocolSessionsOpen = ref _sessionsOpenTls12;
handshakeDurationCounter = _handshakeDurationTls12Counter;
break;
case SslProtocols.Tls13:
protocolSessionsOpen = ref _sessionsOpenTls13;
handshakeDurationCounter = _handshakeDurationTls13Counter;
break;
}
if (connectionOpen)
{
Interlocked.Increment(ref protocolSessionsOpen);
Interlocked.Increment(ref _sessionsOpen);
}
double duration = Stopwatch.GetElapsedTime(startingTimestamp).TotalMilliseconds;
handshakeDurationCounter?.WriteMetric(duration);
_handshakeDurationCounter!.WriteMetric(duration);
HandshakeStop(protocol);
}
[NonEvent]
public void ConnectionClosed(SslProtocols protocol)
{
long count = 0;
switch (protocol)
{
#pragma warning disable SYSLIB0039 // TLS 1.0 and 1.1 are obsolete
case SslProtocols.Tls:
count = Interlocked.Decrement(ref _sessionsOpenTls10);
break;
case SslProtocols.Tls11:
count = Interlocked.Decrement(ref _sessionsOpenTls11);
break;
#pragma warning restore SYSLIB0039
case SslProtocols.Tls12:
count = Interlocked.Decrement(ref _sessionsOpenTls12);
break;
case SslProtocols.Tls13:
count = Interlocked.Decrement(ref _sessionsOpenTls13);
break;
}
Debug.Assert(count >= 0);
count = Interlocked.Decrement(ref _sessionsOpen);
Debug.Assert(count >= 0);
}
#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, bool arg1, string? arg2)
{
if (IsEnabled())
{
arg2 ??= string.Empty;
fixed (char* arg2Ptr = arg2)
{
const int NumEventDatas = 2;
EventData* descrs = stackalloc EventData[NumEventDatas];
descrs[0] = new EventData
{
DataPointer = (IntPtr)(&arg1),
Size = sizeof(int) // EventSource defines bool as a 32-bit type
};
descrs[1] = new EventData
{
DataPointer = (IntPtr)(arg2Ptr),
Size = (arg2.Length + 1) * sizeof(char)
};
WriteEventCore(eventId, NumEventDatas, descrs);
}
}
}
#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, SslProtocols arg1)
{
if (IsEnabled())
{
var data = new EventData
{
DataPointer = (IntPtr)(&arg1),
Size = sizeof(SslProtocols)
};
WriteEventCore(eventId, eventDataCount: 1, &data);
}
}
#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, bool arg1, double arg2, string? arg3)
{
if (IsEnabled())
{
arg3 ??= string.Empty;
fixed (char* arg3Ptr = arg3)
{
const int NumEventDatas = 3;
EventData* descrs = stackalloc EventData[NumEventDatas];
descrs[0] = new EventData
{
DataPointer = (IntPtr)(&arg1),
Size = sizeof(int) // EventSource defines bool as a 32-bit type
};
descrs[1] = new EventData
{
DataPointer = (IntPtr)(&arg2),
Size = sizeof(double)
};
descrs[2] = new EventData
{
DataPointer = (IntPtr)(arg3Ptr),
Size = (arg3.Length + 1) * sizeof(char)
};
WriteEventCore(eventId, NumEventDatas, descrs);
}
}
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Security/src/System/Net/Security/SslStream.Implementation.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Buffers;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.ExceptionServices;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace System.Net.Security
{
public partial class SslStream
{
private SslAuthenticationOptions? _sslAuthenticationOptions;
private int _nestedAuth;
private bool _isRenego;
private TlsFrameHelper.TlsFrameInfo _lastFrame;
private object _handshakeLock => _sslAuthenticationOptions!;
private volatile TaskCompletionSource<bool>? _handshakeWaiter;
private bool _receivedEOF;
// Used by Telemetry to ensure we log connection close exactly once
// 0 = no handshake
// 1 = handshake completed, connection opened
// 2 = SslStream disposed, connection closed
private int _connectionOpenedStatus;
private void ValidateCreateContext(SslClientAuthenticationOptions sslClientAuthenticationOptions, RemoteCertificateValidationCallback? remoteCallback, LocalCertSelectionCallback? localCallback)
{
ThrowIfExceptional();
if (_context != null && _context.IsValidContext)
{
throw new InvalidOperationException(SR.net_auth_reauth);
}
if (_context != null && IsServer)
{
throw new InvalidOperationException(SR.net_auth_client_server);
}
ArgumentNullException.ThrowIfNull(sslClientAuthenticationOptions.TargetHost, nameof(sslClientAuthenticationOptions.TargetHost));
_exception = null;
try
{
_sslAuthenticationOptions = new SslAuthenticationOptions(sslClientAuthenticationOptions, remoteCallback, localCallback);
_context = new SecureChannel(_sslAuthenticationOptions, this);
}
catch (Win32Exception e)
{
throw new AuthenticationException(SR.net_auth_SSPI, e);
}
}
private void ValidateCreateContext(SslAuthenticationOptions sslAuthenticationOptions)
{
ThrowIfExceptional();
if (_context != null && _context.IsValidContext)
{
throw new InvalidOperationException(SR.net_auth_reauth);
}
if (_context != null && !IsServer)
{
throw new InvalidOperationException(SR.net_auth_client_server);
}
_exception = null;
_sslAuthenticationOptions = sslAuthenticationOptions;
try
{
_context = new SecureChannel(_sslAuthenticationOptions, this);
}
catch (Win32Exception e)
{
throw new AuthenticationException(SR.net_auth_SSPI, e);
}
}
private bool RemoteCertRequired => _context == null || _context.RemoteCertRequired;
private object? SyncLock => _context;
private int MaxDataSize => _context!.MaxDataSize;
private void SetException(Exception e)
{
Debug.Assert(e != null, $"Expected non-null Exception to be passed to {nameof(SetException)}");
if (_exception == null)
{
_exception = ExceptionDispatchInfo.Capture(e);
}
_context?.Close();
}
//
// This is to not depend on GC&SafeHandle class if the context is not needed anymore.
//
private void CloseInternal()
{
_exception = s_disposedSentinel;
_context?.Close();
// Ensure a Read operation is not in progress,
// block potential reads since SslStream is disposing.
// This leaves the _nestedRead = 1, but that's ok, since
// subsequent Reads first check if the context is still available.
if (Interlocked.CompareExchange(ref _nestedRead, 1, 0) == 0)
{
_buffer.ReturnBuffer();
}
if (!_buffer.IsValid)
{
// Suppress finalizer since the read buffer was returned.
GC.SuppressFinalize(this);
}
if (NetSecurityTelemetry.Log.IsEnabled())
{
// Set the status to disposed. If it was opened before, log ConnectionClosed
if (Interlocked.Exchange(ref _connectionOpenedStatus, 2) == 1)
{
NetSecurityTelemetry.Log.ConnectionClosed(GetSslProtocolInternal());
}
}
}
private SecurityStatusPal EncryptData(ReadOnlyMemory<byte> buffer, ref byte[] outBuffer, out int outSize)
{
ThrowIfExceptionalOrNotAuthenticated();
lock (_handshakeLock)
{
if (_handshakeWaiter != null)
{
outSize = 0;
// avoid waiting under lock.
return new SecurityStatusPal(SecurityStatusPalErrorCode.TryAgain);
}
return _context!.Encrypt(buffer, ref outBuffer, out outSize);
}
}
//
// This method assumes that a SSPI context is already in a good shape.
// For example it is either a fresh context or already authenticated context that needs renegotiation.
//
private Task ProcessAuthenticationAsync(bool isAsync = false, CancellationToken cancellationToken = default)
{
ThrowIfExceptional();
if (NetSecurityTelemetry.Log.IsEnabled())
{
return ProcessAuthenticationWithTelemetryAsync(isAsync, cancellationToken);
}
else
{
return isAsync ?
ForceAuthenticationAsync<AsyncReadWriteAdapter>(_context!.IsServer, null, cancellationToken) :
ForceAuthenticationAsync<SyncReadWriteAdapter>(_context!.IsServer, null, cancellationToken);
}
}
private async Task ProcessAuthenticationWithTelemetryAsync(bool isAsync, CancellationToken cancellationToken)
{
NetSecurityTelemetry.Log.HandshakeStart(_context!.IsServer, _sslAuthenticationOptions!.TargetHost);
ValueStopwatch stopwatch = ValueStopwatch.StartNew();
try
{
Task task = isAsync?
ForceAuthenticationAsync<AsyncReadWriteAdapter>(_context!.IsServer, null, cancellationToken) :
ForceAuthenticationAsync<SyncReadWriteAdapter>(_context!.IsServer, null, cancellationToken);
await task.ConfigureAwait(false);
// SslStream could already have been disposed at this point, in which case _connectionOpenedStatus == 2
// Make sure that we increment the open connection counter only if it is guaranteed to be decremented in dispose/finalize
bool connectionOpen = Interlocked.CompareExchange(ref _connectionOpenedStatus, 1, 0) == 0;
NetSecurityTelemetry.Log.HandshakeCompleted(GetSslProtocolInternal(), stopwatch, connectionOpen);
}
catch (Exception ex)
{
NetSecurityTelemetry.Log.HandshakeFailed(_context.IsServer, stopwatch, ex.Message);
throw;
}
}
//
// This is used to reply on re-handshake when received SEC_I_RENEGOTIATE on Read().
//
private async Task ReplyOnReAuthenticationAsync<TIOAdapter>(byte[]? buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
try
{
await ForceAuthenticationAsync<TIOAdapter>(receiveFirst: false, buffer, cancellationToken).ConfigureAwait(false);
}
finally
{
_handshakeWaiter!.SetResult(true);
_handshakeWaiter = null;
}
}
// This will initiate renegotiation or PHA for Tls1.3
private async Task RenegotiateAsync<TIOAdapter>(CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
if (Interlocked.Exchange(ref _nestedAuth, 1) == 1)
{
throw new InvalidOperationException(SR.Format(SR.net_io_invalidnestedcall, "authenticate"));
}
if (Interlocked.Exchange(ref _nestedRead, 1) == 1)
{
throw new NotSupportedException(SR.Format(SR.net_io_invalidnestedcall, "read"));
}
if (Interlocked.Exchange(ref _nestedWrite, 1) == 1)
{
_nestedRead = 0;
throw new NotSupportedException(SR.Format(SR.net_io_invalidnestedcall, "write"));
}
try
{
if (_buffer.ActiveLength > 0)
{
throw new InvalidOperationException(SR.net_ssl_renegotiate_buffer);
}
_sslAuthenticationOptions!.RemoteCertRequired = true;
_isRenego = true;
SecurityStatusPal status = _context!.Renegotiate(out byte[]? nextmsg);
if (nextmsg is { Length: > 0 })
{
await TIOAdapter.WriteAsync(InnerStream, nextmsg, 0, nextmsg.Length, cancellationToken).ConfigureAwait(false);
await TIOAdapter.FlushAsync(InnerStream, cancellationToken).ConfigureAwait(false);
}
if (status.ErrorCode != SecurityStatusPalErrorCode.OK)
{
if (status.ErrorCode == SecurityStatusPalErrorCode.NoRenegotiation)
{
// Peer does not want to renegotiate. That should keep session usable.
return;
}
throw SslStreamPal.GetException(status);
}
_buffer.EnsureAvailableSpace(InitialHandshakeBufferSize);
ProtocolToken message;
do
{
message = await ReceiveBlobAsync<TIOAdapter>(cancellationToken).ConfigureAwait(false);
if (message.Size > 0)
{
await TIOAdapter.WriteAsync(InnerStream, message.Payload!, 0, message.Size, cancellationToken).ConfigureAwait(false);
await TIOAdapter.FlushAsync(InnerStream, cancellationToken).ConfigureAwait(false);
}
}
while (message.Status.ErrorCode == SecurityStatusPalErrorCode.ContinueNeeded);
CompleteHandshake(_sslAuthenticationOptions!);
}
finally
{
if (_buffer.ActiveLength == 0)
{
_buffer.ReturnBuffer();
}
_nestedRead = 0;
_nestedWrite = 0;
_isRenego = false;
// We will not release _nestedAuth at this point to prevent another renegotiation attempt.
}
}
// reAuthenticationData is only used on Windows in case of renegotiation.
private async Task ForceAuthenticationAsync<TIOAdapter>(bool receiveFirst, byte[]? reAuthenticationData, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
ProtocolToken message;
bool handshakeCompleted = false;
if (reAuthenticationData == null)
{
// prevent nesting only when authentication functions are called explicitly. e.g. handle renegotiation transparently.
if (Interlocked.Exchange(ref _nestedAuth, 1) == 1)
{
throw new InvalidOperationException(SR.Format(SR.net_io_invalidnestedcall, "authenticate"));
}
}
try
{
if (!receiveFirst)
{
message = _context!.NextMessage(reAuthenticationData);
if (message.Size > 0)
{
await TIOAdapter.WriteAsync(InnerStream, message.Payload!, 0, message.Size, cancellationToken).ConfigureAwait(false);
await TIOAdapter.FlushAsync(InnerStream, cancellationToken).ConfigureAwait(false);
if (NetEventSource.Log.IsEnabled())
NetEventSource.Log.SentFrame(this, message.Payload);
}
if (message.Failed)
{
// tracing done in NextMessage()
throw new AuthenticationException(SR.net_auth_SSPI, message.GetException());
}
else if (message.Status.ErrorCode == SecurityStatusPalErrorCode.OK)
{
// We can finish renegotiation without doing any read.
handshakeCompleted = true;
}
}
if (!handshakeCompleted)
{
_buffer.EnsureAvailableSpace(InitialHandshakeBufferSize);
}
while (!handshakeCompleted)
{
message = await ReceiveBlobAsync<TIOAdapter>(cancellationToken).ConfigureAwait(false);
byte[]? payload = null;
int size = 0;
if (message.Size > 0)
{
payload = message.Payload;
size = message.Size;
}
else if (message.Failed && (_lastFrame.Header.Type == TlsContentType.Handshake || _lastFrame.Header.Type == TlsContentType.ChangeCipherSpec))
{
// If we failed without OS sending out alert, inject one here to be consistent across platforms.
payload = TlsFrameHelper.CreateAlertFrame(_lastFrame.Header.Version, TlsAlertDescription.ProtocolVersion);
size = payload.Length;
}
if (payload != null && size > 0)
{
// If there is message send it out even if call failed. It may contain TLS Alert.
await TIOAdapter.WriteAsync(InnerStream, payload!, 0, size, cancellationToken).ConfigureAwait(false);
await TIOAdapter.FlushAsync(InnerStream, cancellationToken).ConfigureAwait(false);
if (NetEventSource.Log.IsEnabled())
NetEventSource.Log.SentFrame(this, payload);
}
if (message.Failed)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, message.Status);
if (_lastFrame.Header.Type == TlsContentType.Alert && _lastFrame.AlertDescription != TlsAlertDescription.CloseNotify &&
message.Status.ErrorCode == SecurityStatusPalErrorCode.IllegalMessage)
{
// Improve generic message and show details if we failed because of TLS Alert.
throw new AuthenticationException(SR.Format(SR.net_auth_tls_alert, _lastFrame.AlertDescription.ToString()), message.GetException());
}
throw new AuthenticationException(SR.net_auth_SSPI, message.GetException());
}
else if (message.Status.ErrorCode == SecurityStatusPalErrorCode.OK)
{
// We can finish renegotiation without doing any read.
handshakeCompleted = true;
}
}
CompleteHandshake(_sslAuthenticationOptions!);
}
finally
{
if (reAuthenticationData == null)
{
_nestedAuth = 0;
_isRenego = false;
}
}
if (NetEventSource.Log.IsEnabled())
NetEventSource.Log.SspiSelectedCipherSuite(nameof(ForceAuthenticationAsync),
SslProtocol,
CipherAlgorithm,
CipherStrength,
HashAlgorithm,
HashStrength,
KeyExchangeAlgorithm,
KeyExchangeStrength);
}
private async ValueTask<ProtocolToken> ReceiveBlobAsync<TIOAdapter>(CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
int frameSize = await EnsureFullTlsFrameAsync<TIOAdapter>(cancellationToken).ConfigureAwait(false);
if (frameSize == 0)
{
// We expect to receive at least one frame
throw new IOException(SR.net_io_eof);
}
// At this point, we have at least one TLS frame.
switch (_lastFrame.Header.Type)
{
case TlsContentType.Alert:
if (TlsFrameHelper.TryGetFrameInfo(_buffer.EncryptedReadOnlySpan, ref _lastFrame))
{
if (NetEventSource.Log.IsEnabled() && _lastFrame.AlertDescription != TlsAlertDescription.CloseNotify) NetEventSource.Error(this, $"Received TLS alert {_lastFrame.AlertDescription}");
}
break;
case TlsContentType.Handshake:
if (!_isRenego && _buffer.EncryptedReadOnlySpan[TlsFrameHelper.HeaderSize] == (byte)TlsHandshakeType.ClientHello &&
_sslAuthenticationOptions!.IsServer) // guard against malicious endpoints. We should not see ClientHello on client.
{
TlsFrameHelper.ProcessingOptions options = NetEventSource.Log.IsEnabled() ?
TlsFrameHelper.ProcessingOptions.All :
TlsFrameHelper.ProcessingOptions.ServerName;
// Process SNI from Client Hello message
if (!TlsFrameHelper.TryGetFrameInfo(_buffer.EncryptedReadOnlySpan, ref _lastFrame, options))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, $"Failed to parse TLS hello.");
}
if (_lastFrame.HandshakeType == TlsHandshakeType.ClientHello)
{
// SNI if it exist. Even if we could not parse the hello, we can fall-back to default certificate.
if (_lastFrame.TargetName != null)
{
_sslAuthenticationOptions!.TargetHost = _lastFrame.TargetName;
}
if (_sslAuthenticationOptions.ServerOptionDelegate != null)
{
SslServerAuthenticationOptions userOptions =
await _sslAuthenticationOptions.ServerOptionDelegate(this, new SslClientHelloInfo(_sslAuthenticationOptions.TargetHost, _lastFrame.SupportedVersions),
_sslAuthenticationOptions.UserState, cancellationToken).ConfigureAwait(false);
_sslAuthenticationOptions.UpdateOptions(userOptions);
}
}
if (NetEventSource.Log.IsEnabled())
{
NetEventSource.Log.ReceivedFrame(this, _lastFrame);
}
}
break;
case TlsContentType.AppData:
// TLS1.3 it is not possible to distinguish between late Handshake and Application Data
if (_isRenego && SslProtocol != SslProtocols.Tls13)
{
throw new InvalidOperationException(SR.net_ssl_renegotiate_data);
}
break;
}
return ProcessBlob(frameSize);
}
// Calls crypto on received data. No IO inside.
private ProtocolToken ProcessBlob(int frameSize)
{
int chunkSize = frameSize;
ReadOnlySpan<byte> availableData = _buffer.EncryptedReadOnlySpan;
// DiscardEncrypted() does not touch data, it just increases start index so next
// EncryptedSpan will exclude the "discarded" data.
_buffer.DiscardEncrypted(frameSize);
// Often more TLS messages fit into same packet. Get as many complete frames as we can.
while (_buffer.EncryptedLength > TlsFrameHelper.HeaderSize)
{
TlsFrameHeader nextHeader = default;
if (!TlsFrameHelper.TryGetFrameHeader(_buffer.EncryptedReadOnlySpan, ref nextHeader))
{
break;
}
frameSize = nextHeader.Length + TlsFrameHelper.HeaderSize;
// Can process more handshake frames in single step or during TLS1.3 post-handshake auth, but we should
// avoid processing too much so as to preserve API boundary between handshake and I/O.
if ((nextHeader.Type != TlsContentType.Handshake && nextHeader.Type != TlsContentType.ChangeCipherSpec) && !_isRenego || frameSize > _buffer.EncryptedLength)
{
// We don't have full frame left or we already have app data which needs to be processed by decrypt.
break;
}
chunkSize += frameSize;
_buffer.DiscardEncrypted(frameSize);
}
return _context!.NextMessage(availableData.Slice(0, chunkSize));
}
//
// This is to reset auth state on remote side.
// If this write succeeds we will allow auth retrying.
//
private void SendAuthResetSignal(ProtocolToken? message, ExceptionDispatchInfo exception)
{
SetException(exception.SourceException);
if (message == null || message.Size == 0)
{
//
// We don't have an alert to send so cannot retry and fail prematurely.
//
exception.Throw();
}
InnerStream.Write(message.Payload!, 0, message.Size);
exception.Throw();
}
// - Loads the channel parameters
// - Optionally verifies the Remote Certificate
// - Sets HandshakeCompleted flag
// - Sets the guarding event if other thread is waiting for
// handshake completion
//
// - Returns false if failed to verify the Remote Cert
//
private bool CompleteHandshake(ref ProtocolToken? alertToken, out SslPolicyErrors sslPolicyErrors, out X509ChainStatusFlags chainStatus)
{
_context!.ProcessHandshakeSuccess();
if (_nestedAuth != 1)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, $"Ignoring unsolicited renegotiated certificate.");
// ignore certificates received outside of handshake or requested renegotiation.
sslPolicyErrors = SslPolicyErrors.None;
chainStatus = X509ChainStatusFlags.NoError;
return true;
}
if (!_context.VerifyRemoteCertificate(_sslAuthenticationOptions!.CertValidationDelegate, _sslAuthenticationOptions!.CertificateContext?.Trust, ref alertToken, out sslPolicyErrors, out chainStatus))
{
_handshakeCompleted = false;
return false;
}
_handshakeCompleted = true;
return true;
}
private void CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)
{
ProtocolToken? alertToken = null;
if (!CompleteHandshake(ref alertToken, out SslPolicyErrors sslPolicyErrors, out X509ChainStatusFlags chainStatus))
{
if (sslAuthenticationOptions!.CertValidationDelegate != null)
{
// there may be some chain errors but the decision was made by custom callback. Details should be tracing if enabled.
SendAuthResetSignal(alertToken, ExceptionDispatchInfo.Capture(new AuthenticationException(SR.net_ssl_io_cert_custom_validation, null)));
}
else if (sslPolicyErrors == SslPolicyErrors.RemoteCertificateChainErrors && chainStatus != X509ChainStatusFlags.NoError)
{
// We failed only because of chain and we have some insight.
SendAuthResetSignal(alertToken, ExceptionDispatchInfo.Capture(new AuthenticationException(SR.Format(SR.net_ssl_io_cert_chain_validation, chainStatus), null)));
}
else
{
// Simple add sslPolicyErrors as crude info.
SendAuthResetSignal(alertToken, ExceptionDispatchInfo.Capture(new AuthenticationException(SR.Format(SR.net_ssl_io_cert_validation, sslPolicyErrors), null)));
}
}
}
private async ValueTask WriteAsyncChunked<TIOAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
do
{
int chunkBytes = Math.Min(buffer.Length, MaxDataSize);
await WriteSingleChunk<TIOAdapter>(buffer.Slice(0, chunkBytes), cancellationToken).ConfigureAwait(false);
buffer = buffer.Slice(chunkBytes);
} while (buffer.Length != 0);
}
private ValueTask WriteSingleChunk<TIOAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
byte[] rentedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length + FrameOverhead);
byte[] outBuffer = rentedBuffer;
SecurityStatusPal status;
int encryptedBytes;
while (true)
{
status = EncryptData(buffer, ref outBuffer, out encryptedBytes);
// TryAgain should be rare, when renegotiation happens exactly when we want to write.
if (status.ErrorCode != SecurityStatusPalErrorCode.TryAgain)
{
break;
}
TaskCompletionSource<bool>? waiter = _handshakeWaiter;
if (waiter != null)
{
Task waiterTask = TIOAdapter.WaitAsync(waiter);
// We finished synchronously waiting for renegotiation. We can try again immediately.
if (waiterTask.IsCompletedSuccessfully)
{
continue;
}
// We need to wait asynchronously as well as for the write when EncryptData is finished.
return WaitAndWriteAsync(buffer, waiterTask, rentedBuffer, cancellationToken);
}
}
if (status.ErrorCode != SecurityStatusPalErrorCode.OK)
{
ArrayPool<byte>.Shared.Return(rentedBuffer);
return ValueTask.FromException(ExceptionDispatchInfo.SetCurrentStackTrace(new IOException(SR.net_io_encrypt, SslStreamPal.GetException(status))));
}
ValueTask t = TIOAdapter.WriteAsync(InnerStream, outBuffer, 0, encryptedBytes, cancellationToken);
if (t.IsCompletedSuccessfully)
{
ArrayPool<byte>.Shared.Return(rentedBuffer);
return t;
}
else
{
return CompleteWriteAsync(t, rentedBuffer);
}
async ValueTask WaitAndWriteAsync(ReadOnlyMemory<byte> buffer, Task waitTask, byte[] rentedBuffer, CancellationToken cancellationToken)
{
byte[]? bufferToReturn = rentedBuffer;
byte[] outBuffer = rentedBuffer;
try
{
// Wait for renegotiation to finish.
await waitTask.ConfigureAwait(false);
SecurityStatusPal status = EncryptData(buffer, ref outBuffer, out int encryptedBytes);
if (status.ErrorCode == SecurityStatusPalErrorCode.TryAgain)
{
// No need to hold on the buffer any more.
byte[] tmp = bufferToReturn;
bufferToReturn = null;
ArrayPool<byte>.Shared.Return(tmp);
// Call WriteSingleChunk() recursively to avoid code duplication.
// This should be extremely rare in cases when second renegotiation happens concurrently with Write.
await WriteSingleChunk<TIOAdapter>(buffer, cancellationToken).ConfigureAwait(false);
}
else if (status.ErrorCode == SecurityStatusPalErrorCode.OK)
{
await TIOAdapter.WriteAsync(InnerStream, outBuffer, 0, encryptedBytes, cancellationToken).ConfigureAwait(false);
}
else
{
throw new IOException(SR.net_io_encrypt, SslStreamPal.GetException(status));
}
}
finally
{
if (bufferToReturn != null)
{
ArrayPool<byte>.Shared.Return(bufferToReturn);
}
}
}
static async ValueTask CompleteWriteAsync(ValueTask writeTask, byte[] bufferToReturn)
{
try
{
await writeTask.ConfigureAwait(false);
}
finally
{
ArrayPool<byte>.Shared.Return(bufferToReturn);
}
}
}
~SslStream()
{
Dispose(disposing: false);
}
private void ReturnReadBufferIfEmpty()
{
if (_buffer.ActiveLength == 0)
{
_buffer.ReturnBuffer();
}
}
private bool HaveFullTlsFrame(out int frameSize)
{
if (_buffer.EncryptedLength < TlsFrameHelper.HeaderSize)
{
frameSize = int.MaxValue;
return false;
}
frameSize = GetFrameSize(_buffer.EncryptedReadOnlySpan);
return _buffer.EncryptedLength >= frameSize;
}
private async ValueTask<int> EnsureFullTlsFrameAsync<TIOAdapter>(CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
int frameSize;
if (HaveFullTlsFrame(out frameSize))
{
return frameSize;
}
if (frameSize < int.MaxValue)
{
_buffer.EnsureAvailableSpace(frameSize - _buffer.EncryptedLength);
}
while (_buffer.EncryptedLength < frameSize)
{
// there should be space left to read into
Debug.Assert(_buffer.AvailableLength > 0, "_buffer.AvailableBytes > 0");
// We either don't have full frame or we don't have enough data to even determine the size.
int bytesRead = await TIOAdapter.ReadAsync(InnerStream, _buffer.AvailableMemory, cancellationToken).ConfigureAwait(false);
if (bytesRead == 0)
{
if (_buffer.EncryptedLength != 0)
{
// we got EOF in middle of TLS frame. Treat that as error.
throw new IOException(SR.net_io_eof);
}
return 0;
}
_buffer.Commit(bytesRead);
if (frameSize == int.MaxValue && _buffer.EncryptedLength > TlsFrameHelper.HeaderSize)
{
// recalculate frame size if needed e.g. we could not get it before.
frameSize = GetFrameSize(_buffer.EncryptedReadOnlySpan);
_buffer.EnsureAvailableSpace(frameSize - _buffer.EncryptedLength);
}
}
return frameSize;
}
private SecurityStatusPal DecryptData(int frameSize)
{
SecurityStatusPal status;
lock (_handshakeLock)
{
ThrowIfExceptionalOrNotAuthenticated();
// Decrypt will decrypt in-place and modify these to point to the actual decrypted data, which may be smaller.
status = _context!.Decrypt(_buffer.EncryptedSpanSliced(frameSize), out int decryptedOffset, out int decryptedCount);
_buffer.OnDecrypted(decryptedOffset, decryptedCount, frameSize);
if (status.ErrorCode == SecurityStatusPalErrorCode.Renegotiate)
{
// The status indicates that peer wants to renegotiate. (Windows only)
// In practice, there can be some other reasons too - like TLS1.3 session creation
// of alert handling. We need to pass the data to lsass and it is not safe to do parallel
// write any more as that can change TLS state and the EncryptData() can fail in strange ways.
// To handle this we call DecryptData() under lock and we create TCS waiter.
// EncryptData() checks that under same lock and if it exist it will not call low-level crypto.
// Instead it will wait synchronously or asynchronously and it will try again after the wait.
// The result will be set when ReplyOnReAuthenticationAsync() is finished e.g. lsass business is over.
// If that happen before EncryptData() runs, _handshakeWaiter will be set to null
// and EncryptData() will work normally e.g. no waiting, just exclusion with DecryptData()
if (_sslAuthenticationOptions!.AllowRenegotiation || SslProtocol == SslProtocols.Tls13 || _nestedAuth != 0)
{
// create TCS only if we plan to proceed. If not, we will throw later outside of the lock.
// Tls1.3 does not have renegotiation. However on Windows this error code is used
// for session management e.g. anything lsass needs to see.
// We also allow it when explicitly requested using RenegotiateAsync().
_handshakeWaiter = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
}
}
}
return status;
}
private async ValueTask<int> ReadAsyncInternal<TIOAdapter>(Memory<byte> buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
if (Interlocked.Exchange(ref _nestedRead, 1) == 1)
{
throw new NotSupportedException(SR.Format(SR.net_io_invalidnestedcall, "read"));
}
ThrowIfExceptionalOrNotAuthenticated();
try
{
int processedLength = 0;
if (_buffer.DecryptedLength != 0)
{
processedLength = CopyDecryptedData(buffer);
if (processedLength == buffer.Length || !HaveFullTlsFrame(out _))
{
// We either filled whole buffer or used all buffered frames.
return processedLength;
}
buffer = buffer.Slice(processedLength);
}
if (_receivedEOF)
{
Debug.Assert(_buffer.EncryptedLength == 0);
// We received EOF during previous read but had buffered data to return.
return 0;
}
if (buffer.Length == 0 && _buffer.ActiveLength == 0)
{
// User requested a zero-byte read, and we have no data available in the buffer for processing.
// This zero-byte read indicates their desire to trade off the extra cost of a zero-byte read
// for reduced memory consumption when data is not immediately available.
// So, we will issue our own zero-byte read against the underlying stream and defer buffer allocation
// until data is actually available from the underlying stream.
// Note that if the underlying stream does not supporting blocking on zero byte reads, then this will
// complete immediately and won't save any memory, but will still function correctly.
await TIOAdapter.ReadAsync(InnerStream, Memory<byte>.Empty, cancellationToken).ConfigureAwait(false);
}
Debug.Assert(_buffer.DecryptedLength == 0);
_buffer.EnsureAvailableSpace(ReadBufferSize - _buffer.ActiveLength);
while (true)
{
int payloadBytes = await EnsureFullTlsFrameAsync<TIOAdapter>(cancellationToken).ConfigureAwait(false);
if (payloadBytes == 0)
{
_receivedEOF = true;
break;
}
SecurityStatusPal status = DecryptData(payloadBytes);
if (status.ErrorCode != SecurityStatusPalErrorCode.OK)
{
byte[]? extraBuffer = null;
if (_buffer.DecryptedLength != 0)
{
extraBuffer = new byte[_buffer.DecryptedLength];
_buffer.DecryptedSpan.CopyTo(extraBuffer);
_buffer.Discard(_buffer.DecryptedLength);
}
if (NetEventSource.Log.IsEnabled())
NetEventSource.Info(null, $"***Processing an error Status = {status}");
if (status.ErrorCode == SecurityStatusPalErrorCode.Renegotiate)
{
// We determined above that we will not process it.
if (_handshakeWaiter == null)
{
throw new IOException(SR.net_ssl_io_renego);
}
await ReplyOnReAuthenticationAsync<TIOAdapter>(extraBuffer, cancellationToken).ConfigureAwait(false);
// Loop on read.
continue;
}
if (status.ErrorCode == SecurityStatusPalErrorCode.ContextExpired)
{
_receivedEOF = true;
break;
}
throw new IOException(SR.net_io_decrypt, SslStreamPal.GetException(status));
}
if (_buffer.DecryptedLength > 0)
{
// This will either copy data from rented buffer or adjust final buffer as needed.
// In both cases _decryptedBytesOffset and _decryptedBytesCount will be updated as needed.
int copyLength = CopyDecryptedData(buffer);
processedLength += copyLength;
if (copyLength == buffer.Length)
{
// We have more decrypted data after we filled provided buffer.
break;
}
buffer = buffer.Slice(copyLength);
}
if (processedLength == 0)
{
// We did not get any real data so far.
continue;
}
if (!HaveFullTlsFrame(out payloadBytes))
{
// We don't have another frame to process but we have some data to return to caller.
break;
}
TlsFrameHelper.TryGetFrameHeader(_buffer.EncryptedReadOnlySpan, ref _lastFrame.Header);
if (_lastFrame.Header.Type != TlsContentType.AppData)
{
// Alerts, handshake and anything else will be processed separately.
// This may not be necessary but it improves compatibility with older versions.
break;
}
}
return processedLength;
}
catch (Exception e)
{
if (e is IOException || (e is OperationCanceledException && cancellationToken.IsCancellationRequested))
{
throw;
}
throw new IOException(SR.net_io_read, e);
}
finally
{
ReturnReadBufferIfEmpty();
_nestedRead = 0;
}
}
private async ValueTask WriteAsyncInternal<TIOAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
ThrowIfExceptionalOrNotAuthenticatedOrShutdown();
if (buffer.Length == 0 && !SslStreamPal.CanEncryptEmptyMessage)
{
// If it's an empty message and the PAL doesn't support that, we're done.
return;
}
if (Interlocked.Exchange(ref _nestedWrite, 1) == 1)
{
throw new NotSupportedException(SR.Format(SR.net_io_invalidnestedcall, "write"));
}
try
{
ValueTask t = buffer.Length < MaxDataSize ?
WriteSingleChunk<TIOAdapter>(buffer, cancellationToken) :
WriteAsyncChunked<TIOAdapter>(buffer, cancellationToken);
await t.ConfigureAwait(false);
}
catch (Exception e)
{
if (e is IOException || (e is OperationCanceledException && cancellationToken.IsCancellationRequested))
{
throw;
}
throw new IOException(SR.net_io_write, e);
}
finally
{
_nestedWrite = 0;
}
}
private int CopyDecryptedData(Memory<byte> buffer)
{
Debug.Assert(_buffer.DecryptedLength > 0);
int copyBytes = Math.Min(_buffer.DecryptedLength, buffer.Length);
if (copyBytes != 0)
{
_buffer.DecryptedReadOnlySpanSliced(copyBytes).CopyTo(buffer.Span);
_buffer.Discard(copyBytes);
}
return copyBytes;
}
// Returns TLS Frame size including header size.
private int GetFrameSize(ReadOnlySpan<byte> buffer)
{
if (!TlsFrameHelper.TryGetFrameHeader(buffer, ref _lastFrame.Header))
{
throw new IOException(SR.net_ssl_io_frame);
}
if (_lastFrame.Header.Length < 0)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, "invalid TLS frame size");
throw new AuthenticationException(SR.net_frame_read_size);
}
return _lastFrame.Header.Length + TlsFrameHelper.HeaderSize;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Buffers;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.ExceptionServices;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
using System.Threading;
using System.Threading.Tasks;
namespace System.Net.Security
{
public partial class SslStream
{
private SslAuthenticationOptions? _sslAuthenticationOptions;
private int _nestedAuth;
private bool _isRenego;
private TlsFrameHelper.TlsFrameInfo _lastFrame;
private object _handshakeLock => _sslAuthenticationOptions!;
private volatile TaskCompletionSource<bool>? _handshakeWaiter;
private bool _receivedEOF;
// Used by Telemetry to ensure we log connection close exactly once
// 0 = no handshake
// 1 = handshake completed, connection opened
// 2 = SslStream disposed, connection closed
private int _connectionOpenedStatus;
private void ValidateCreateContext(SslClientAuthenticationOptions sslClientAuthenticationOptions, RemoteCertificateValidationCallback? remoteCallback, LocalCertSelectionCallback? localCallback)
{
ThrowIfExceptional();
if (_context != null && _context.IsValidContext)
{
throw new InvalidOperationException(SR.net_auth_reauth);
}
if (_context != null && IsServer)
{
throw new InvalidOperationException(SR.net_auth_client_server);
}
ArgumentNullException.ThrowIfNull(sslClientAuthenticationOptions.TargetHost, nameof(sslClientAuthenticationOptions.TargetHost));
_exception = null;
try
{
_sslAuthenticationOptions = new SslAuthenticationOptions(sslClientAuthenticationOptions, remoteCallback, localCallback);
_context = new SecureChannel(_sslAuthenticationOptions, this);
}
catch (Win32Exception e)
{
throw new AuthenticationException(SR.net_auth_SSPI, e);
}
}
private void ValidateCreateContext(SslAuthenticationOptions sslAuthenticationOptions)
{
ThrowIfExceptional();
if (_context != null && _context.IsValidContext)
{
throw new InvalidOperationException(SR.net_auth_reauth);
}
if (_context != null && !IsServer)
{
throw new InvalidOperationException(SR.net_auth_client_server);
}
_exception = null;
_sslAuthenticationOptions = sslAuthenticationOptions;
try
{
_context = new SecureChannel(_sslAuthenticationOptions, this);
}
catch (Win32Exception e)
{
throw new AuthenticationException(SR.net_auth_SSPI, e);
}
}
private bool RemoteCertRequired => _context == null || _context.RemoteCertRequired;
private object? SyncLock => _context;
private int MaxDataSize => _context!.MaxDataSize;
private void SetException(Exception e)
{
Debug.Assert(e != null, $"Expected non-null Exception to be passed to {nameof(SetException)}");
if (_exception == null)
{
_exception = ExceptionDispatchInfo.Capture(e);
}
_context?.Close();
}
//
// This is to not depend on GC&SafeHandle class if the context is not needed anymore.
//
private void CloseInternal()
{
_exception = s_disposedSentinel;
_context?.Close();
// Ensure a Read operation is not in progress,
// block potential reads since SslStream is disposing.
// This leaves the _nestedRead = 1, but that's ok, since
// subsequent Reads first check if the context is still available.
if (Interlocked.CompareExchange(ref _nestedRead, 1, 0) == 0)
{
_buffer.ReturnBuffer();
}
if (!_buffer.IsValid)
{
// Suppress finalizer since the read buffer was returned.
GC.SuppressFinalize(this);
}
if (NetSecurityTelemetry.Log.IsEnabled())
{
// Set the status to disposed. If it was opened before, log ConnectionClosed
if (Interlocked.Exchange(ref _connectionOpenedStatus, 2) == 1)
{
NetSecurityTelemetry.Log.ConnectionClosed(GetSslProtocolInternal());
}
}
}
private SecurityStatusPal EncryptData(ReadOnlyMemory<byte> buffer, ref byte[] outBuffer, out int outSize)
{
ThrowIfExceptionalOrNotAuthenticated();
lock (_handshakeLock)
{
if (_handshakeWaiter != null)
{
outSize = 0;
// avoid waiting under lock.
return new SecurityStatusPal(SecurityStatusPalErrorCode.TryAgain);
}
return _context!.Encrypt(buffer, ref outBuffer, out outSize);
}
}
//
// This method assumes that a SSPI context is already in a good shape.
// For example it is either a fresh context or already authenticated context that needs renegotiation.
//
private Task ProcessAuthenticationAsync(bool isAsync = false, CancellationToken cancellationToken = default)
{
ThrowIfExceptional();
if (NetSecurityTelemetry.Log.IsEnabled())
{
return ProcessAuthenticationWithTelemetryAsync(isAsync, cancellationToken);
}
else
{
return isAsync ?
ForceAuthenticationAsync<AsyncReadWriteAdapter>(_context!.IsServer, null, cancellationToken) :
ForceAuthenticationAsync<SyncReadWriteAdapter>(_context!.IsServer, null, cancellationToken);
}
}
private async Task ProcessAuthenticationWithTelemetryAsync(bool isAsync, CancellationToken cancellationToken)
{
NetSecurityTelemetry.Log.HandshakeStart(_context!.IsServer, _sslAuthenticationOptions!.TargetHost);
long startingTimestamp = Stopwatch.GetTimestamp();
try
{
Task task = isAsync?
ForceAuthenticationAsync<AsyncReadWriteAdapter>(_context!.IsServer, null, cancellationToken) :
ForceAuthenticationAsync<SyncReadWriteAdapter>(_context!.IsServer, null, cancellationToken);
await task.ConfigureAwait(false);
// SslStream could already have been disposed at this point, in which case _connectionOpenedStatus == 2
// Make sure that we increment the open connection counter only if it is guaranteed to be decremented in dispose/finalize
bool connectionOpen = Interlocked.CompareExchange(ref _connectionOpenedStatus, 1, 0) == 0;
NetSecurityTelemetry.Log.HandshakeCompleted(GetSslProtocolInternal(), startingTimestamp, connectionOpen);
}
catch (Exception ex)
{
NetSecurityTelemetry.Log.HandshakeFailed(_context.IsServer, startingTimestamp, ex.Message);
throw;
}
}
//
// This is used to reply on re-handshake when received SEC_I_RENEGOTIATE on Read().
//
private async Task ReplyOnReAuthenticationAsync<TIOAdapter>(byte[]? buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
try
{
await ForceAuthenticationAsync<TIOAdapter>(receiveFirst: false, buffer, cancellationToken).ConfigureAwait(false);
}
finally
{
_handshakeWaiter!.SetResult(true);
_handshakeWaiter = null;
}
}
// This will initiate renegotiation or PHA for Tls1.3
private async Task RenegotiateAsync<TIOAdapter>(CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
if (Interlocked.Exchange(ref _nestedAuth, 1) == 1)
{
throw new InvalidOperationException(SR.Format(SR.net_io_invalidnestedcall, "authenticate"));
}
if (Interlocked.Exchange(ref _nestedRead, 1) == 1)
{
throw new NotSupportedException(SR.Format(SR.net_io_invalidnestedcall, "read"));
}
if (Interlocked.Exchange(ref _nestedWrite, 1) == 1)
{
_nestedRead = 0;
throw new NotSupportedException(SR.Format(SR.net_io_invalidnestedcall, "write"));
}
try
{
if (_buffer.ActiveLength > 0)
{
throw new InvalidOperationException(SR.net_ssl_renegotiate_buffer);
}
_sslAuthenticationOptions!.RemoteCertRequired = true;
_isRenego = true;
SecurityStatusPal status = _context!.Renegotiate(out byte[]? nextmsg);
if (nextmsg is { Length: > 0 })
{
await TIOAdapter.WriteAsync(InnerStream, nextmsg, 0, nextmsg.Length, cancellationToken).ConfigureAwait(false);
await TIOAdapter.FlushAsync(InnerStream, cancellationToken).ConfigureAwait(false);
}
if (status.ErrorCode != SecurityStatusPalErrorCode.OK)
{
if (status.ErrorCode == SecurityStatusPalErrorCode.NoRenegotiation)
{
// Peer does not want to renegotiate. That should keep session usable.
return;
}
throw SslStreamPal.GetException(status);
}
_buffer.EnsureAvailableSpace(InitialHandshakeBufferSize);
ProtocolToken message;
do
{
message = await ReceiveBlobAsync<TIOAdapter>(cancellationToken).ConfigureAwait(false);
if (message.Size > 0)
{
await TIOAdapter.WriteAsync(InnerStream, message.Payload!, 0, message.Size, cancellationToken).ConfigureAwait(false);
await TIOAdapter.FlushAsync(InnerStream, cancellationToken).ConfigureAwait(false);
}
}
while (message.Status.ErrorCode == SecurityStatusPalErrorCode.ContinueNeeded);
CompleteHandshake(_sslAuthenticationOptions!);
}
finally
{
if (_buffer.ActiveLength == 0)
{
_buffer.ReturnBuffer();
}
_nestedRead = 0;
_nestedWrite = 0;
_isRenego = false;
// We will not release _nestedAuth at this point to prevent another renegotiation attempt.
}
}
// reAuthenticationData is only used on Windows in case of renegotiation.
private async Task ForceAuthenticationAsync<TIOAdapter>(bool receiveFirst, byte[]? reAuthenticationData, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
ProtocolToken message;
bool handshakeCompleted = false;
if (reAuthenticationData == null)
{
// prevent nesting only when authentication functions are called explicitly. e.g. handle renegotiation transparently.
if (Interlocked.Exchange(ref _nestedAuth, 1) == 1)
{
throw new InvalidOperationException(SR.Format(SR.net_io_invalidnestedcall, "authenticate"));
}
}
try
{
if (!receiveFirst)
{
message = _context!.NextMessage(reAuthenticationData);
if (message.Size > 0)
{
await TIOAdapter.WriteAsync(InnerStream, message.Payload!, 0, message.Size, cancellationToken).ConfigureAwait(false);
await TIOAdapter.FlushAsync(InnerStream, cancellationToken).ConfigureAwait(false);
if (NetEventSource.Log.IsEnabled())
NetEventSource.Log.SentFrame(this, message.Payload);
}
if (message.Failed)
{
// tracing done in NextMessage()
throw new AuthenticationException(SR.net_auth_SSPI, message.GetException());
}
else if (message.Status.ErrorCode == SecurityStatusPalErrorCode.OK)
{
// We can finish renegotiation without doing any read.
handshakeCompleted = true;
}
}
if (!handshakeCompleted)
{
_buffer.EnsureAvailableSpace(InitialHandshakeBufferSize);
}
while (!handshakeCompleted)
{
message = await ReceiveBlobAsync<TIOAdapter>(cancellationToken).ConfigureAwait(false);
byte[]? payload = null;
int size = 0;
if (message.Size > 0)
{
payload = message.Payload;
size = message.Size;
}
else if (message.Failed && (_lastFrame.Header.Type == TlsContentType.Handshake || _lastFrame.Header.Type == TlsContentType.ChangeCipherSpec))
{
// If we failed without OS sending out alert, inject one here to be consistent across platforms.
payload = TlsFrameHelper.CreateAlertFrame(_lastFrame.Header.Version, TlsAlertDescription.ProtocolVersion);
size = payload.Length;
}
if (payload != null && size > 0)
{
// If there is message send it out even if call failed. It may contain TLS Alert.
await TIOAdapter.WriteAsync(InnerStream, payload!, 0, size, cancellationToken).ConfigureAwait(false);
await TIOAdapter.FlushAsync(InnerStream, cancellationToken).ConfigureAwait(false);
if (NetEventSource.Log.IsEnabled())
NetEventSource.Log.SentFrame(this, payload);
}
if (message.Failed)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, message.Status);
if (_lastFrame.Header.Type == TlsContentType.Alert && _lastFrame.AlertDescription != TlsAlertDescription.CloseNotify &&
message.Status.ErrorCode == SecurityStatusPalErrorCode.IllegalMessage)
{
// Improve generic message and show details if we failed because of TLS Alert.
throw new AuthenticationException(SR.Format(SR.net_auth_tls_alert, _lastFrame.AlertDescription.ToString()), message.GetException());
}
throw new AuthenticationException(SR.net_auth_SSPI, message.GetException());
}
else if (message.Status.ErrorCode == SecurityStatusPalErrorCode.OK)
{
// We can finish renegotiation without doing any read.
handshakeCompleted = true;
}
}
CompleteHandshake(_sslAuthenticationOptions!);
}
finally
{
if (reAuthenticationData == null)
{
_nestedAuth = 0;
_isRenego = false;
}
}
if (NetEventSource.Log.IsEnabled())
NetEventSource.Log.SspiSelectedCipherSuite(nameof(ForceAuthenticationAsync),
SslProtocol,
CipherAlgorithm,
CipherStrength,
HashAlgorithm,
HashStrength,
KeyExchangeAlgorithm,
KeyExchangeStrength);
}
private async ValueTask<ProtocolToken> ReceiveBlobAsync<TIOAdapter>(CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
int frameSize = await EnsureFullTlsFrameAsync<TIOAdapter>(cancellationToken).ConfigureAwait(false);
if (frameSize == 0)
{
// We expect to receive at least one frame
throw new IOException(SR.net_io_eof);
}
// At this point, we have at least one TLS frame.
switch (_lastFrame.Header.Type)
{
case TlsContentType.Alert:
if (TlsFrameHelper.TryGetFrameInfo(_buffer.EncryptedReadOnlySpan, ref _lastFrame))
{
if (NetEventSource.Log.IsEnabled() && _lastFrame.AlertDescription != TlsAlertDescription.CloseNotify) NetEventSource.Error(this, $"Received TLS alert {_lastFrame.AlertDescription}");
}
break;
case TlsContentType.Handshake:
if (!_isRenego && _buffer.EncryptedReadOnlySpan[TlsFrameHelper.HeaderSize] == (byte)TlsHandshakeType.ClientHello &&
_sslAuthenticationOptions!.IsServer) // guard against malicious endpoints. We should not see ClientHello on client.
{
TlsFrameHelper.ProcessingOptions options = NetEventSource.Log.IsEnabled() ?
TlsFrameHelper.ProcessingOptions.All :
TlsFrameHelper.ProcessingOptions.ServerName;
// Process SNI from Client Hello message
if (!TlsFrameHelper.TryGetFrameInfo(_buffer.EncryptedReadOnlySpan, ref _lastFrame, options))
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, $"Failed to parse TLS hello.");
}
if (_lastFrame.HandshakeType == TlsHandshakeType.ClientHello)
{
// SNI if it exist. Even if we could not parse the hello, we can fall-back to default certificate.
if (_lastFrame.TargetName != null)
{
_sslAuthenticationOptions!.TargetHost = _lastFrame.TargetName;
}
if (_sslAuthenticationOptions.ServerOptionDelegate != null)
{
SslServerAuthenticationOptions userOptions =
await _sslAuthenticationOptions.ServerOptionDelegate(this, new SslClientHelloInfo(_sslAuthenticationOptions.TargetHost, _lastFrame.SupportedVersions),
_sslAuthenticationOptions.UserState, cancellationToken).ConfigureAwait(false);
_sslAuthenticationOptions.UpdateOptions(userOptions);
}
}
if (NetEventSource.Log.IsEnabled())
{
NetEventSource.Log.ReceivedFrame(this, _lastFrame);
}
}
break;
case TlsContentType.AppData:
// TLS1.3 it is not possible to distinguish between late Handshake and Application Data
if (_isRenego && SslProtocol != SslProtocols.Tls13)
{
throw new InvalidOperationException(SR.net_ssl_renegotiate_data);
}
break;
}
return ProcessBlob(frameSize);
}
// Calls crypto on received data. No IO inside.
private ProtocolToken ProcessBlob(int frameSize)
{
int chunkSize = frameSize;
ReadOnlySpan<byte> availableData = _buffer.EncryptedReadOnlySpan;
// DiscardEncrypted() does not touch data, it just increases start index so next
// EncryptedSpan will exclude the "discarded" data.
_buffer.DiscardEncrypted(frameSize);
// Often more TLS messages fit into same packet. Get as many complete frames as we can.
while (_buffer.EncryptedLength > TlsFrameHelper.HeaderSize)
{
TlsFrameHeader nextHeader = default;
if (!TlsFrameHelper.TryGetFrameHeader(_buffer.EncryptedReadOnlySpan, ref nextHeader))
{
break;
}
frameSize = nextHeader.Length + TlsFrameHelper.HeaderSize;
// Can process more handshake frames in single step or during TLS1.3 post-handshake auth, but we should
// avoid processing too much so as to preserve API boundary between handshake and I/O.
if ((nextHeader.Type != TlsContentType.Handshake && nextHeader.Type != TlsContentType.ChangeCipherSpec) && !_isRenego || frameSize > _buffer.EncryptedLength)
{
// We don't have full frame left or we already have app data which needs to be processed by decrypt.
break;
}
chunkSize += frameSize;
_buffer.DiscardEncrypted(frameSize);
}
return _context!.NextMessage(availableData.Slice(0, chunkSize));
}
//
// This is to reset auth state on remote side.
// If this write succeeds we will allow auth retrying.
//
private void SendAuthResetSignal(ProtocolToken? message, ExceptionDispatchInfo exception)
{
SetException(exception.SourceException);
if (message == null || message.Size == 0)
{
//
// We don't have an alert to send so cannot retry and fail prematurely.
//
exception.Throw();
}
InnerStream.Write(message.Payload!, 0, message.Size);
exception.Throw();
}
// - Loads the channel parameters
// - Optionally verifies the Remote Certificate
// - Sets HandshakeCompleted flag
// - Sets the guarding event if other thread is waiting for
// handshake completion
//
// - Returns false if failed to verify the Remote Cert
//
private bool CompleteHandshake(ref ProtocolToken? alertToken, out SslPolicyErrors sslPolicyErrors, out X509ChainStatusFlags chainStatus)
{
_context!.ProcessHandshakeSuccess();
if (_nestedAuth != 1)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, $"Ignoring unsolicited renegotiated certificate.");
// ignore certificates received outside of handshake or requested renegotiation.
sslPolicyErrors = SslPolicyErrors.None;
chainStatus = X509ChainStatusFlags.NoError;
return true;
}
if (!_context.VerifyRemoteCertificate(_sslAuthenticationOptions!.CertValidationDelegate, _sslAuthenticationOptions!.CertificateContext?.Trust, ref alertToken, out sslPolicyErrors, out chainStatus))
{
_handshakeCompleted = false;
return false;
}
_handshakeCompleted = true;
return true;
}
private void CompleteHandshake(SslAuthenticationOptions sslAuthenticationOptions)
{
ProtocolToken? alertToken = null;
if (!CompleteHandshake(ref alertToken, out SslPolicyErrors sslPolicyErrors, out X509ChainStatusFlags chainStatus))
{
if (sslAuthenticationOptions!.CertValidationDelegate != null)
{
// there may be some chain errors but the decision was made by custom callback. Details should be tracing if enabled.
SendAuthResetSignal(alertToken, ExceptionDispatchInfo.Capture(new AuthenticationException(SR.net_ssl_io_cert_custom_validation, null)));
}
else if (sslPolicyErrors == SslPolicyErrors.RemoteCertificateChainErrors && chainStatus != X509ChainStatusFlags.NoError)
{
// We failed only because of chain and we have some insight.
SendAuthResetSignal(alertToken, ExceptionDispatchInfo.Capture(new AuthenticationException(SR.Format(SR.net_ssl_io_cert_chain_validation, chainStatus), null)));
}
else
{
// Simple add sslPolicyErrors as crude info.
SendAuthResetSignal(alertToken, ExceptionDispatchInfo.Capture(new AuthenticationException(SR.Format(SR.net_ssl_io_cert_validation, sslPolicyErrors), null)));
}
}
}
private async ValueTask WriteAsyncChunked<TIOAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
do
{
int chunkBytes = Math.Min(buffer.Length, MaxDataSize);
await WriteSingleChunk<TIOAdapter>(buffer.Slice(0, chunkBytes), cancellationToken).ConfigureAwait(false);
buffer = buffer.Slice(chunkBytes);
} while (buffer.Length != 0);
}
private ValueTask WriteSingleChunk<TIOAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
byte[] rentedBuffer = ArrayPool<byte>.Shared.Rent(buffer.Length + FrameOverhead);
byte[] outBuffer = rentedBuffer;
SecurityStatusPal status;
int encryptedBytes;
while (true)
{
status = EncryptData(buffer, ref outBuffer, out encryptedBytes);
// TryAgain should be rare, when renegotiation happens exactly when we want to write.
if (status.ErrorCode != SecurityStatusPalErrorCode.TryAgain)
{
break;
}
TaskCompletionSource<bool>? waiter = _handshakeWaiter;
if (waiter != null)
{
Task waiterTask = TIOAdapter.WaitAsync(waiter);
// We finished synchronously waiting for renegotiation. We can try again immediately.
if (waiterTask.IsCompletedSuccessfully)
{
continue;
}
// We need to wait asynchronously as well as for the write when EncryptData is finished.
return WaitAndWriteAsync(buffer, waiterTask, rentedBuffer, cancellationToken);
}
}
if (status.ErrorCode != SecurityStatusPalErrorCode.OK)
{
ArrayPool<byte>.Shared.Return(rentedBuffer);
return ValueTask.FromException(ExceptionDispatchInfo.SetCurrentStackTrace(new IOException(SR.net_io_encrypt, SslStreamPal.GetException(status))));
}
ValueTask t = TIOAdapter.WriteAsync(InnerStream, outBuffer, 0, encryptedBytes, cancellationToken);
if (t.IsCompletedSuccessfully)
{
ArrayPool<byte>.Shared.Return(rentedBuffer);
return t;
}
else
{
return CompleteWriteAsync(t, rentedBuffer);
}
async ValueTask WaitAndWriteAsync(ReadOnlyMemory<byte> buffer, Task waitTask, byte[] rentedBuffer, CancellationToken cancellationToken)
{
byte[]? bufferToReturn = rentedBuffer;
byte[] outBuffer = rentedBuffer;
try
{
// Wait for renegotiation to finish.
await waitTask.ConfigureAwait(false);
SecurityStatusPal status = EncryptData(buffer, ref outBuffer, out int encryptedBytes);
if (status.ErrorCode == SecurityStatusPalErrorCode.TryAgain)
{
// No need to hold on the buffer any more.
byte[] tmp = bufferToReturn;
bufferToReturn = null;
ArrayPool<byte>.Shared.Return(tmp);
// Call WriteSingleChunk() recursively to avoid code duplication.
// This should be extremely rare in cases when second renegotiation happens concurrently with Write.
await WriteSingleChunk<TIOAdapter>(buffer, cancellationToken).ConfigureAwait(false);
}
else if (status.ErrorCode == SecurityStatusPalErrorCode.OK)
{
await TIOAdapter.WriteAsync(InnerStream, outBuffer, 0, encryptedBytes, cancellationToken).ConfigureAwait(false);
}
else
{
throw new IOException(SR.net_io_encrypt, SslStreamPal.GetException(status));
}
}
finally
{
if (bufferToReturn != null)
{
ArrayPool<byte>.Shared.Return(bufferToReturn);
}
}
}
static async ValueTask CompleteWriteAsync(ValueTask writeTask, byte[] bufferToReturn)
{
try
{
await writeTask.ConfigureAwait(false);
}
finally
{
ArrayPool<byte>.Shared.Return(bufferToReturn);
}
}
}
~SslStream()
{
Dispose(disposing: false);
}
private void ReturnReadBufferIfEmpty()
{
if (_buffer.ActiveLength == 0)
{
_buffer.ReturnBuffer();
}
}
private bool HaveFullTlsFrame(out int frameSize)
{
if (_buffer.EncryptedLength < TlsFrameHelper.HeaderSize)
{
frameSize = int.MaxValue;
return false;
}
frameSize = GetFrameSize(_buffer.EncryptedReadOnlySpan);
return _buffer.EncryptedLength >= frameSize;
}
private async ValueTask<int> EnsureFullTlsFrameAsync<TIOAdapter>(CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
int frameSize;
if (HaveFullTlsFrame(out frameSize))
{
return frameSize;
}
if (frameSize < int.MaxValue)
{
_buffer.EnsureAvailableSpace(frameSize - _buffer.EncryptedLength);
}
while (_buffer.EncryptedLength < frameSize)
{
// there should be space left to read into
Debug.Assert(_buffer.AvailableLength > 0, "_buffer.AvailableBytes > 0");
// We either don't have full frame or we don't have enough data to even determine the size.
int bytesRead = await TIOAdapter.ReadAsync(InnerStream, _buffer.AvailableMemory, cancellationToken).ConfigureAwait(false);
if (bytesRead == 0)
{
if (_buffer.EncryptedLength != 0)
{
// we got EOF in middle of TLS frame. Treat that as error.
throw new IOException(SR.net_io_eof);
}
return 0;
}
_buffer.Commit(bytesRead);
if (frameSize == int.MaxValue && _buffer.EncryptedLength > TlsFrameHelper.HeaderSize)
{
// recalculate frame size if needed e.g. we could not get it before.
frameSize = GetFrameSize(_buffer.EncryptedReadOnlySpan);
_buffer.EnsureAvailableSpace(frameSize - _buffer.EncryptedLength);
}
}
return frameSize;
}
private SecurityStatusPal DecryptData(int frameSize)
{
SecurityStatusPal status;
lock (_handshakeLock)
{
ThrowIfExceptionalOrNotAuthenticated();
// Decrypt will decrypt in-place and modify these to point to the actual decrypted data, which may be smaller.
status = _context!.Decrypt(_buffer.EncryptedSpanSliced(frameSize), out int decryptedOffset, out int decryptedCount);
_buffer.OnDecrypted(decryptedOffset, decryptedCount, frameSize);
if (status.ErrorCode == SecurityStatusPalErrorCode.Renegotiate)
{
// The status indicates that peer wants to renegotiate. (Windows only)
// In practice, there can be some other reasons too - like TLS1.3 session creation
// of alert handling. We need to pass the data to lsass and it is not safe to do parallel
// write any more as that can change TLS state and the EncryptData() can fail in strange ways.
// To handle this we call DecryptData() under lock and we create TCS waiter.
// EncryptData() checks that under same lock and if it exist it will not call low-level crypto.
// Instead it will wait synchronously or asynchronously and it will try again after the wait.
// The result will be set when ReplyOnReAuthenticationAsync() is finished e.g. lsass business is over.
// If that happen before EncryptData() runs, _handshakeWaiter will be set to null
// and EncryptData() will work normally e.g. no waiting, just exclusion with DecryptData()
if (_sslAuthenticationOptions!.AllowRenegotiation || SslProtocol == SslProtocols.Tls13 || _nestedAuth != 0)
{
// create TCS only if we plan to proceed. If not, we will throw later outside of the lock.
// Tls1.3 does not have renegotiation. However on Windows this error code is used
// for session management e.g. anything lsass needs to see.
// We also allow it when explicitly requested using RenegotiateAsync().
_handshakeWaiter = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);
}
}
}
return status;
}
private async ValueTask<int> ReadAsyncInternal<TIOAdapter>(Memory<byte> buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
if (Interlocked.Exchange(ref _nestedRead, 1) == 1)
{
throw new NotSupportedException(SR.Format(SR.net_io_invalidnestedcall, "read"));
}
ThrowIfExceptionalOrNotAuthenticated();
try
{
int processedLength = 0;
if (_buffer.DecryptedLength != 0)
{
processedLength = CopyDecryptedData(buffer);
if (processedLength == buffer.Length || !HaveFullTlsFrame(out _))
{
// We either filled whole buffer or used all buffered frames.
return processedLength;
}
buffer = buffer.Slice(processedLength);
}
if (_receivedEOF)
{
Debug.Assert(_buffer.EncryptedLength == 0);
// We received EOF during previous read but had buffered data to return.
return 0;
}
if (buffer.Length == 0 && _buffer.ActiveLength == 0)
{
// User requested a zero-byte read, and we have no data available in the buffer for processing.
// This zero-byte read indicates their desire to trade off the extra cost of a zero-byte read
// for reduced memory consumption when data is not immediately available.
// So, we will issue our own zero-byte read against the underlying stream and defer buffer allocation
// until data is actually available from the underlying stream.
// Note that if the underlying stream does not supporting blocking on zero byte reads, then this will
// complete immediately and won't save any memory, but will still function correctly.
await TIOAdapter.ReadAsync(InnerStream, Memory<byte>.Empty, cancellationToken).ConfigureAwait(false);
}
Debug.Assert(_buffer.DecryptedLength == 0);
_buffer.EnsureAvailableSpace(ReadBufferSize - _buffer.ActiveLength);
while (true)
{
int payloadBytes = await EnsureFullTlsFrameAsync<TIOAdapter>(cancellationToken).ConfigureAwait(false);
if (payloadBytes == 0)
{
_receivedEOF = true;
break;
}
SecurityStatusPal status = DecryptData(payloadBytes);
if (status.ErrorCode != SecurityStatusPalErrorCode.OK)
{
byte[]? extraBuffer = null;
if (_buffer.DecryptedLength != 0)
{
extraBuffer = new byte[_buffer.DecryptedLength];
_buffer.DecryptedSpan.CopyTo(extraBuffer);
_buffer.Discard(_buffer.DecryptedLength);
}
if (NetEventSource.Log.IsEnabled())
NetEventSource.Info(null, $"***Processing an error Status = {status}");
if (status.ErrorCode == SecurityStatusPalErrorCode.Renegotiate)
{
// We determined above that we will not process it.
if (_handshakeWaiter == null)
{
throw new IOException(SR.net_ssl_io_renego);
}
await ReplyOnReAuthenticationAsync<TIOAdapter>(extraBuffer, cancellationToken).ConfigureAwait(false);
// Loop on read.
continue;
}
if (status.ErrorCode == SecurityStatusPalErrorCode.ContextExpired)
{
_receivedEOF = true;
break;
}
throw new IOException(SR.net_io_decrypt, SslStreamPal.GetException(status));
}
if (_buffer.DecryptedLength > 0)
{
// This will either copy data from rented buffer or adjust final buffer as needed.
// In both cases _decryptedBytesOffset and _decryptedBytesCount will be updated as needed.
int copyLength = CopyDecryptedData(buffer);
processedLength += copyLength;
if (copyLength == buffer.Length)
{
// We have more decrypted data after we filled provided buffer.
break;
}
buffer = buffer.Slice(copyLength);
}
if (processedLength == 0)
{
// We did not get any real data so far.
continue;
}
if (!HaveFullTlsFrame(out payloadBytes))
{
// We don't have another frame to process but we have some data to return to caller.
break;
}
TlsFrameHelper.TryGetFrameHeader(_buffer.EncryptedReadOnlySpan, ref _lastFrame.Header);
if (_lastFrame.Header.Type != TlsContentType.AppData)
{
// Alerts, handshake and anything else will be processed separately.
// This may not be necessary but it improves compatibility with older versions.
break;
}
}
return processedLength;
}
catch (Exception e)
{
if (e is IOException || (e is OperationCanceledException && cancellationToken.IsCancellationRequested))
{
throw;
}
throw new IOException(SR.net_io_read, e);
}
finally
{
ReturnReadBufferIfEmpty();
_nestedRead = 0;
}
}
private async ValueTask WriteAsyncInternal<TIOAdapter>(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken)
where TIOAdapter : IReadWriteAdapter
{
ThrowIfExceptionalOrNotAuthenticatedOrShutdown();
if (buffer.Length == 0 && !SslStreamPal.CanEncryptEmptyMessage)
{
// If it's an empty message and the PAL doesn't support that, we're done.
return;
}
if (Interlocked.Exchange(ref _nestedWrite, 1) == 1)
{
throw new NotSupportedException(SR.Format(SR.net_io_invalidnestedcall, "write"));
}
try
{
ValueTask t = buffer.Length < MaxDataSize ?
WriteSingleChunk<TIOAdapter>(buffer, cancellationToken) :
WriteAsyncChunked<TIOAdapter>(buffer, cancellationToken);
await t.ConfigureAwait(false);
}
catch (Exception e)
{
if (e is IOException || (e is OperationCanceledException && cancellationToken.IsCancellationRequested))
{
throw;
}
throw new IOException(SR.net_io_write, e);
}
finally
{
_nestedWrite = 0;
}
}
private int CopyDecryptedData(Memory<byte> buffer)
{
Debug.Assert(_buffer.DecryptedLength > 0);
int copyBytes = Math.Min(_buffer.DecryptedLength, buffer.Length);
if (copyBytes != 0)
{
_buffer.DecryptedReadOnlySpanSliced(copyBytes).CopyTo(buffer.Span);
_buffer.Discard(copyBytes);
}
return copyBytes;
}
// Returns TLS Frame size including header size.
private int GetFrameSize(ReadOnlySpan<byte> buffer)
{
if (!TlsFrameHelper.TryGetFrameHeader(buffer, ref _lastFrame.Header))
{
throw new IOException(SR.net_ssl_io_frame);
}
if (_lastFrame.Header.Length < 0)
{
if (NetEventSource.Log.IsEnabled()) NetEventSource.Error(this, "invalid TLS frame size");
throw new AuthenticationException(SR.net_frame_read_size);
}
return _lastFrame.Header.Length + TlsFrameHelper.HeaderSize;
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Diagnostics
{
// This class uses high-resolution performance counter if the installed
// hardware supports it. Otherwise, the class will fall back to DateTime
// and uses ticks as a measurement.
public partial class Stopwatch
{
private const long TicksPerMillisecond = 10000;
private const long TicksPerSecond = TicksPerMillisecond * 1000;
private long _elapsed;
private long _startTimeStamp;
private bool _isRunning;
// "Frequency" stores the frequency of the high-resolution performance counter,
// if one exists. Otherwise it will store TicksPerSecond.
// The frequency cannot change while the system is running,
// so we only need to initialize it once.
public static readonly long Frequency = QueryPerformanceFrequency();
public static readonly bool IsHighResolution = true;
// performance-counter frequency, in counts per ticks.
// This can speed up conversion from high frequency performance-counter
// to ticks.
private static readonly double s_tickFrequency = (double)TicksPerSecond / Frequency;
public Stopwatch()
{
Reset();
}
public void Start()
{
// Calling start on a running Stopwatch is a no-op.
if (!_isRunning)
{
_startTimeStamp = GetTimestamp();
_isRunning = true;
}
}
public static Stopwatch StartNew()
{
Stopwatch s = new Stopwatch();
s.Start();
return s;
}
public void Stop()
{
// Calling stop on a stopped Stopwatch is a no-op.
if (_isRunning)
{
long endTimeStamp = GetTimestamp();
long elapsedThisPeriod = endTimeStamp - _startTimeStamp;
_elapsed += elapsedThisPeriod;
_isRunning = false;
if (_elapsed < 0)
{
// When measuring small time periods the Stopwatch.Elapsed*
// properties can return negative values. This is due to
// bugs in the basic input/output system (BIOS) or the hardware
// abstraction layer (HAL) on machines with variable-speed CPUs
// (e.g. Intel SpeedStep).
_elapsed = 0;
}
}
}
public void Reset()
{
_elapsed = 0;
_isRunning = false;
_startTimeStamp = 0;
}
// Convenience method for replacing {sw.Reset(); sw.Start();} with a single sw.Restart()
public void Restart()
{
_elapsed = 0;
_startTimeStamp = GetTimestamp();
_isRunning = true;
}
public bool IsRunning
{
get { return _isRunning; }
}
public TimeSpan Elapsed
{
get { return new TimeSpan(GetElapsedDateTimeTicks()); }
}
public long ElapsedMilliseconds
{
get { return GetElapsedDateTimeTicks() / TicksPerMillisecond; }
}
public long ElapsedTicks
{
get { return GetRawElapsedTicks(); }
}
public static long GetTimestamp()
{
Debug.Assert(IsHighResolution);
return QueryPerformanceCounter();
}
// Get the elapsed ticks.
private long GetRawElapsedTicks()
{
long timeElapsed = _elapsed;
if (_isRunning)
{
// If the Stopwatch is running, add elapsed time since
// the Stopwatch is started last time.
long currentTimeStamp = GetTimestamp();
long elapsedUntilNow = currentTimeStamp - _startTimeStamp;
timeElapsed += elapsedUntilNow;
}
return timeElapsed;
}
// Get the elapsed ticks.
private long GetElapsedDateTimeTicks()
{
Debug.Assert(IsHighResolution);
// convert high resolution perf counter to DateTime ticks
return unchecked((long)(GetRawElapsedTicks() * s_tickFrequency));
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Diagnostics
{
// This class uses high-resolution performance counter if the installed
// hardware supports it. Otherwise, the class will fall back to DateTime
// and uses ticks as a measurement.
public partial class Stopwatch
{
private const long TicksPerMillisecond = 10000;
private const long TicksPerSecond = TicksPerMillisecond * 1000;
private long _elapsed;
private long _startTimeStamp;
private bool _isRunning;
// "Frequency" stores the frequency of the high-resolution performance counter,
// if one exists. Otherwise it will store TicksPerSecond.
// The frequency cannot change while the system is running,
// so we only need to initialize it once.
public static readonly long Frequency = QueryPerformanceFrequency();
public static readonly bool IsHighResolution = true;
// performance-counter frequency, in counts per ticks.
// This can speed up conversion from high frequency performance-counter
// to ticks.
private static readonly double s_tickFrequency = (double)TicksPerSecond / Frequency;
public Stopwatch()
{
Reset();
}
public void Start()
{
// Calling start on a running Stopwatch is a no-op.
if (!_isRunning)
{
_startTimeStamp = GetTimestamp();
_isRunning = true;
}
}
public static Stopwatch StartNew()
{
Stopwatch s = new Stopwatch();
s.Start();
return s;
}
public void Stop()
{
// Calling stop on a stopped Stopwatch is a no-op.
if (_isRunning)
{
long endTimeStamp = GetTimestamp();
long elapsedThisPeriod = endTimeStamp - _startTimeStamp;
_elapsed += elapsedThisPeriod;
_isRunning = false;
if (_elapsed < 0)
{
// When measuring small time periods the Stopwatch.Elapsed*
// properties can return negative values. This is due to
// bugs in the basic input/output system (BIOS) or the hardware
// abstraction layer (HAL) on machines with variable-speed CPUs
// (e.g. Intel SpeedStep).
_elapsed = 0;
}
}
}
public void Reset()
{
_elapsed = 0;
_isRunning = false;
_startTimeStamp = 0;
}
// Convenience method for replacing {sw.Reset(); sw.Start();} with a single sw.Restart()
public void Restart()
{
_elapsed = 0;
_startTimeStamp = GetTimestamp();
_isRunning = true;
}
public bool IsRunning
{
get { return _isRunning; }
}
public TimeSpan Elapsed
{
get { return new TimeSpan(GetElapsedDateTimeTicks()); }
}
public long ElapsedMilliseconds
{
get { return GetElapsedDateTimeTicks() / TicksPerMillisecond; }
}
public long ElapsedTicks
{
get { return GetRawElapsedTicks(); }
}
public static long GetTimestamp()
{
Debug.Assert(IsHighResolution);
return QueryPerformanceCounter();
}
/// <summary>Gets the elapsed time since the <paramref name="startingTimestamp"/> value retrieved using <see cref="GetTimestamp"/>.</summary>
/// <param name="startingTimestamp">The timestamp marking the beginning of the time period.</param>
/// <returns>A <see cref="TimeSpan"/> for the elapsed time between the starting timestamp and the time of this call.</returns>
public static TimeSpan GetElapsedTime(long startingTimestamp) =>
GetElapsedTime(startingTimestamp, GetTimestamp());
/// <summary>Gets the elapsed time between two timestamps retrieved using <see cref="GetTimestamp"/>.</summary>
/// <param name="startingTimestamp">The timestamp marking the beginning of the time period.</param>
/// <param name="endingTimestamp">The timestamp marking the end of the time period.</param>
/// <returns>A <see cref="TimeSpan"/> for the elapsed time between the starting and ending timestamps.</returns>
public static TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) =>
new TimeSpan((long)((endingTimestamp - startingTimestamp) * s_tickFrequency));
// Get the elapsed ticks.
private long GetRawElapsedTicks()
{
long timeElapsed = _elapsed;
if (_isRunning)
{
// If the Stopwatch is running, add elapsed time since
// the Stopwatch is started last time.
long currentTimeStamp = GetTimestamp();
long elapsedUntilNow = currentTimeStamp - _startTimeStamp;
timeElapsed += elapsedUntilNow;
}
return timeElapsed;
}
// Get the elapsed ticks.
private long GetElapsedDateTimeTicks()
{
Debug.Assert(IsHighResolution);
// convert high resolution perf counter to DateTime ticks
return unchecked((long)(GetRawElapsedTicks() * s_tickFrequency));
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Threading
{
/// <summary>
/// A thread-pool run and managed on the CLR.
/// </summary>
internal sealed partial class PortableThreadPool
{
private const int ThreadPoolThreadTimeoutMs = 20 * 1000; // If you change this make sure to change the timeout times in the tests.
private const int SmallStackSizeBytes = 256 * 1024;
private const short MaxPossibleThreadCount = short.MaxValue;
#if TARGET_64BIT
private const short DefaultMaxWorkerThreadCount = MaxPossibleThreadCount;
#elif TARGET_32BIT
private const short DefaultMaxWorkerThreadCount = 1023;
#else
#error Unknown platform
#endif
private const int CpuUtilizationHigh = 95;
private const int CpuUtilizationLow = 80;
private static readonly short ForcedMinWorkerThreads =
AppContextConfigHelper.GetInt16Config("System.Threading.ThreadPool.MinThreads", 0, false);
private static readonly short ForcedMaxWorkerThreads =
AppContextConfigHelper.GetInt16Config("System.Threading.ThreadPool.MaxThreads", 0, false);
[ThreadStatic]
private static object? t_completionCountObject;
#pragma warning disable IDE1006 // Naming Styles
// The singleton must be initialized after the static variables above, as the constructor may be dependent on them.
// SOS's ThreadPool command depends on this name.
public static readonly PortableThreadPool ThreadPoolInstance = new PortableThreadPool();
#pragma warning restore IDE1006 // Naming Styles
private int _cpuUtilization; // SOS's ThreadPool command depends on this name
private short _minThreads;
private short _maxThreads;
private short _legacy_minIOCompletionThreads;
private short _legacy_maxIOCompletionThreads;
[StructLayout(LayoutKind.Explicit, Size = Internal.PaddingHelpers.CACHE_LINE_SIZE * 6)]
private struct CacheLineSeparated
{
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 1)]
public ThreadCounts counts; // SOS's ThreadPool command depends on this name
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 2)]
public int lastDequeueTime;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 3)]
public int priorCompletionCount;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 3 + sizeof(int))]
public int priorCompletedWorkRequestsTime;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 3 + sizeof(int) * 2)]
public int nextCompletedWorkRequestsTime;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 4)]
public volatile int numRequestedWorkers;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 4 + sizeof(int))]
public int gateThreadRunningState;
}
private long _currentSampleStartTime;
private readonly ThreadInt64PersistentCounter _completionCounter = new ThreadInt64PersistentCounter();
private int _threadAdjustmentIntervalMs;
private short _numBlockedThreads;
private short _numThreadsAddedDueToBlocking;
private PendingBlockingAdjustment _pendingBlockingAdjustment;
private long _memoryUsageBytes;
private long _memoryLimitBytes;
#if TARGET_WINDOWS
private readonly nint _ioPort;
private IOCompletionPoller[]? _ioCompletionPollers;
#endif
private readonly LowLevelLock _threadAdjustmentLock = new LowLevelLock();
private CacheLineSeparated _separated; // SOS's ThreadPool command depends on this name
private PortableThreadPool()
{
_minThreads = HasForcedMinThreads ? ForcedMinWorkerThreads : (short)Environment.ProcessorCount;
if (_minThreads > MaxPossibleThreadCount)
{
_minThreads = MaxPossibleThreadCount;
}
_maxThreads = HasForcedMaxThreads ? ForcedMaxWorkerThreads : DefaultMaxWorkerThreadCount;
if (_maxThreads > MaxPossibleThreadCount)
{
_maxThreads = MaxPossibleThreadCount;
}
else if (_maxThreads < _minThreads)
{
_maxThreads = _minThreads;
}
_legacy_minIOCompletionThreads = 1;
_legacy_maxIOCompletionThreads = 1000;
_separated.counts.NumThreadsGoal = _minThreads;
#if TARGET_WINDOWS
_ioPort = CreateIOCompletionPort();
#endif
}
private static bool HasForcedMinThreads =>
ForcedMinWorkerThreads > 0 && (ForcedMaxWorkerThreads <= 0 || ForcedMinWorkerThreads <= ForcedMaxWorkerThreads);
private static bool HasForcedMaxThreads =>
ForcedMaxWorkerThreads > 0 && (ForcedMinWorkerThreads <= 0 || ForcedMinWorkerThreads <= ForcedMaxWorkerThreads);
public bool SetMinThreads(int workerThreads, int ioCompletionThreads)
{
if (workerThreads < 0 || ioCompletionThreads < 0)
{
return false;
}
bool addWorker = false;
bool wakeGateThread = false;
_threadAdjustmentLock.Acquire();
try
{
if (workerThreads > _maxThreads)
{
return false;
}
if (ThreadPool.UsePortableThreadPoolForIO
? ioCompletionThreads > _legacy_maxIOCompletionThreads
: !ThreadPool.CanSetMinIOCompletionThreads(ioCompletionThreads))
{
return false;
}
if (HasForcedMinThreads && workerThreads != ForcedMinWorkerThreads)
{
return false;
}
if (ThreadPool.UsePortableThreadPoolForIO)
{
_legacy_minIOCompletionThreads = (short)Math.Max(1, ioCompletionThreads);
}
else
{
ThreadPool.SetMinIOCompletionThreads(ioCompletionThreads);
}
short newMinThreads = (short)Math.Max(1, workerThreads);
if (newMinThreads == _minThreads)
{
return true;
}
_minThreads = newMinThreads;
if (_numBlockedThreads > 0)
{
// Blocking adjustment will adjust the goal according to its heuristics
if (_pendingBlockingAdjustment != PendingBlockingAdjustment.Immediately)
{
_pendingBlockingAdjustment = PendingBlockingAdjustment.Immediately;
wakeGateThread = true;
}
}
else if (_separated.counts.NumThreadsGoal < newMinThreads)
{
_separated.counts.InterlockedSetNumThreadsGoal(newMinThreads);
if (_separated.numRequestedWorkers > 0)
{
addWorker = true;
}
}
}
finally
{
_threadAdjustmentLock.Release();
}
if (addWorker)
{
WorkerThread.MaybeAddWorkingWorker(this);
}
else if (wakeGateThread)
{
GateThread.Wake(this);
}
return true;
}
public void GetMinThreads(out int workerThreads, out int ioCompletionThreads)
{
workerThreads = Volatile.Read(ref _minThreads);
ioCompletionThreads = _legacy_minIOCompletionThreads;
}
public bool SetMaxThreads(int workerThreads, int ioCompletionThreads)
{
if (workerThreads <= 0 || ioCompletionThreads <= 0)
{
return false;
}
_threadAdjustmentLock.Acquire();
try
{
if (workerThreads < _minThreads)
{
return false;
}
if (ThreadPool.UsePortableThreadPoolForIO
? ioCompletionThreads < _legacy_minIOCompletionThreads
: !ThreadPool.CanSetMaxIOCompletionThreads(ioCompletionThreads))
{
return false;
}
if (HasForcedMaxThreads && workerThreads != ForcedMaxWorkerThreads)
{
return false;
}
if (ThreadPool.UsePortableThreadPoolForIO)
{
_legacy_maxIOCompletionThreads = (short)Math.Min(ioCompletionThreads, MaxPossibleThreadCount);
}
else
{
ThreadPool.SetMaxIOCompletionThreads(ioCompletionThreads);
}
short newMaxThreads = (short)Math.Min(workerThreads, MaxPossibleThreadCount);
if (newMaxThreads == _maxThreads)
{
return true;
}
_maxThreads = newMaxThreads;
if (_separated.counts.NumThreadsGoal > newMaxThreads)
{
_separated.counts.InterlockedSetNumThreadsGoal(newMaxThreads);
}
return true;
}
finally
{
_threadAdjustmentLock.Release();
}
}
public void GetMaxThreads(out int workerThreads, out int ioCompletionThreads)
{
workerThreads = Volatile.Read(ref _maxThreads);
ioCompletionThreads = _legacy_maxIOCompletionThreads;
}
public void GetAvailableThreads(out int workerThreads, out int ioCompletionThreads)
{
ThreadCounts counts = _separated.counts.VolatileRead();
workerThreads = Math.Max(0, _maxThreads - counts.NumProcessingWork);
ioCompletionThreads = _legacy_maxIOCompletionThreads;
}
public int ThreadCount => _separated.counts.VolatileRead().NumExistingThreads;
public long CompletedWorkItemCount => _completionCounter.Count;
public object GetOrCreateThreadLocalCompletionCountObject() =>
t_completionCountObject ?? CreateThreadLocalCompletionCountObject();
[MethodImpl(MethodImplOptions.NoInlining)]
private object CreateThreadLocalCompletionCountObject()
{
Debug.Assert(t_completionCountObject == null);
object threadLocalCompletionCountObject = _completionCounter.CreateThreadLocalCountObject();
t_completionCountObject = threadLocalCompletionCountObject;
return threadLocalCompletionCountObject;
}
private void NotifyWorkItemProgress(object threadLocalCompletionCountObject, int currentTimeMs)
{
ThreadInt64PersistentCounter.Increment(threadLocalCompletionCountObject);
_separated.lastDequeueTime = currentTimeMs;
if (ShouldAdjustMaxWorkersActive(currentTimeMs))
{
AdjustMaxWorkersActive();
}
}
internal void NotifyWorkItemProgress() =>
NotifyWorkItemProgress(GetOrCreateThreadLocalCompletionCountObject(), Environment.TickCount);
internal bool NotifyWorkItemComplete(object? threadLocalCompletionCountObject, int currentTimeMs)
{
Debug.Assert(threadLocalCompletionCountObject != null);
NotifyWorkItemProgress(threadLocalCompletionCountObject!, currentTimeMs);
return !WorkerThread.ShouldStopProcessingWorkNow(this);
}
//
// This method must only be called if ShouldAdjustMaxWorkersActive has returned true, *and*
// _hillClimbingThreadAdjustmentLock is held.
//
private void AdjustMaxWorkersActive()
{
LowLevelLock threadAdjustmentLock = _threadAdjustmentLock;
if (!threadAdjustmentLock.TryAcquire())
{
// The lock is held by someone else, they will take care of this for us
return;
}
bool addWorker = false;
try
{
// Repeated checks from ShouldAdjustMaxWorkersActive() inside the lock
ThreadCounts counts = _separated.counts;
if (counts.NumProcessingWork > counts.NumThreadsGoal ||
_pendingBlockingAdjustment != PendingBlockingAdjustment.None)
{
return;
}
long startTime = _currentSampleStartTime;
long endTime = Stopwatch.GetTimestamp();
long freq = Stopwatch.Frequency;
double elapsedSeconds = (double)(endTime - startTime) / freq;
if (elapsedSeconds * 1000 >= _threadAdjustmentIntervalMs / 2)
{
int currentTicks = Environment.TickCount;
int totalNumCompletions = (int)_completionCounter.Count;
int numCompletions = totalNumCompletions - _separated.priorCompletionCount;
short oldNumThreadsGoal = counts.NumThreadsGoal;
int newNumThreadsGoal;
(newNumThreadsGoal, _threadAdjustmentIntervalMs) =
HillClimbing.ThreadPoolHillClimber.Update(oldNumThreadsGoal, elapsedSeconds, numCompletions);
if (oldNumThreadsGoal != (short)newNumThreadsGoal)
{
_separated.counts.InterlockedSetNumThreadsGoal((short)newNumThreadsGoal);
//
// If we're increasing the goal, inject a thread. If that thread finds work, it will inject
// another thread, etc., until nobody finds work or we reach the new goal.
//
// If we're reducing the goal, whichever threads notice this first will sleep and timeout themselves.
//
if (newNumThreadsGoal > oldNumThreadsGoal)
{
addWorker = true;
}
}
_separated.priorCompletionCount = totalNumCompletions;
_separated.nextCompletedWorkRequestsTime = currentTicks + _threadAdjustmentIntervalMs;
Volatile.Write(ref _separated.priorCompletedWorkRequestsTime, currentTicks);
_currentSampleStartTime = endTime;
}
}
finally
{
threadAdjustmentLock.Release();
}
if (addWorker)
{
WorkerThread.MaybeAddWorkingWorker(this);
}
}
private bool ShouldAdjustMaxWorkersActive(int currentTimeMs)
{
if (HillClimbing.IsDisabled)
{
return false;
}
// We need to subtract by prior time because Environment.TickCount can wrap around, making a comparison of absolute
// times unreliable. Intervals are unsigned to avoid wrapping around on the subtract after enough time elapses, and
// this also prevents the initial elapsed interval from being negative due to the prior and next times being
// initialized to zero.
int priorTime = Volatile.Read(ref _separated.priorCompletedWorkRequestsTime);
uint requiredInterval = (uint)(_separated.nextCompletedWorkRequestsTime - priorTime);
uint elapsedInterval = (uint)(currentTimeMs - priorTime);
if (elapsedInterval < requiredInterval)
{
return false;
}
// Avoid trying to adjust the thread count goal if there are already more threads than the thread count goal.
// In that situation, hill climbing must have previously decided to decrease the thread count goal, so let's
// wait until the system responds to that change before calling into hill climbing again. This condition should
// be the opposite of the condition in WorkerThread.ShouldStopProcessingWorkNow that causes
// threads processing work to stop in response to a decreased thread count goal. The logic here is a bit
// different from the original CoreCLR code from which this implementation was ported because in this
// implementation there are no retired threads, so only the count of threads processing work is considered.
ThreadCounts counts = _separated.counts;
if (counts.NumProcessingWork > counts.NumThreadsGoal)
{
return false;
}
// Skip hill climbing when there is a pending blocking adjustment. Hill climbing may otherwise bypass the
// blocking adjustment heuristics and increase the thread count too quickly.
return _pendingBlockingAdjustment == PendingBlockingAdjustment.None;
}
internal void RequestWorker()
{
// The order of operations here is important. MaybeAddWorkingWorker() and EnsureRunning() use speculative checks to
// do their work and the memory barrier from the interlocked operation is necessary in this case for correctness.
Interlocked.Increment(ref _separated.numRequestedWorkers);
WorkerThread.MaybeAddWorkingWorker(this);
GateThread.EnsureRunning(this);
}
private bool OnGen2GCCallback()
{
// Gen 2 GCs may be very infrequent in some cases. If it becomes an issue, consider updating the memory usage more
// frequently. The memory usage is only used for fallback purposes in blocking adjustment, so an artifically higher
// memory usage may cause blocking adjustment to fall back to slower adjustments sooner than necessary.
GCMemoryInfo gcMemoryInfo = GC.GetGCMemoryInfo();
_memoryLimitBytes = gcMemoryInfo.HighMemoryLoadThresholdBytes;
_memoryUsageBytes = Math.Min(gcMemoryInfo.MemoryLoadBytes, gcMemoryInfo.HighMemoryLoadThresholdBytes);
return true; // continue receiving gen 2 GC callbacks
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace System.Threading
{
/// <summary>
/// A thread-pool run and managed on the CLR.
/// </summary>
internal sealed partial class PortableThreadPool
{
private const int ThreadPoolThreadTimeoutMs = 20 * 1000; // If you change this make sure to change the timeout times in the tests.
private const int SmallStackSizeBytes = 256 * 1024;
private const short MaxPossibleThreadCount = short.MaxValue;
#if TARGET_64BIT
private const short DefaultMaxWorkerThreadCount = MaxPossibleThreadCount;
#elif TARGET_32BIT
private const short DefaultMaxWorkerThreadCount = 1023;
#else
#error Unknown platform
#endif
private const int CpuUtilizationHigh = 95;
private const int CpuUtilizationLow = 80;
private static readonly short ForcedMinWorkerThreads =
AppContextConfigHelper.GetInt16Config("System.Threading.ThreadPool.MinThreads", 0, false);
private static readonly short ForcedMaxWorkerThreads =
AppContextConfigHelper.GetInt16Config("System.Threading.ThreadPool.MaxThreads", 0, false);
[ThreadStatic]
private static object? t_completionCountObject;
#pragma warning disable IDE1006 // Naming Styles
// The singleton must be initialized after the static variables above, as the constructor may be dependent on them.
// SOS's ThreadPool command depends on this name.
public static readonly PortableThreadPool ThreadPoolInstance = new PortableThreadPool();
#pragma warning restore IDE1006 // Naming Styles
private int _cpuUtilization; // SOS's ThreadPool command depends on this name
private short _minThreads;
private short _maxThreads;
private short _legacy_minIOCompletionThreads;
private short _legacy_maxIOCompletionThreads;
[StructLayout(LayoutKind.Explicit, Size = Internal.PaddingHelpers.CACHE_LINE_SIZE * 6)]
private struct CacheLineSeparated
{
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 1)]
public ThreadCounts counts; // SOS's ThreadPool command depends on this name
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 2)]
public int lastDequeueTime;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 3)]
public int priorCompletionCount;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 3 + sizeof(int))]
public int priorCompletedWorkRequestsTime;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 3 + sizeof(int) * 2)]
public int nextCompletedWorkRequestsTime;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 4)]
public volatile int numRequestedWorkers;
[FieldOffset(Internal.PaddingHelpers.CACHE_LINE_SIZE * 4 + sizeof(int))]
public int gateThreadRunningState;
}
private long _currentSampleStartTime;
private readonly ThreadInt64PersistentCounter _completionCounter = new ThreadInt64PersistentCounter();
private int _threadAdjustmentIntervalMs;
private short _numBlockedThreads;
private short _numThreadsAddedDueToBlocking;
private PendingBlockingAdjustment _pendingBlockingAdjustment;
private long _memoryUsageBytes;
private long _memoryLimitBytes;
#if TARGET_WINDOWS
private readonly nint _ioPort;
private IOCompletionPoller[]? _ioCompletionPollers;
#endif
private readonly LowLevelLock _threadAdjustmentLock = new LowLevelLock();
private CacheLineSeparated _separated; // SOS's ThreadPool command depends on this name
private PortableThreadPool()
{
_minThreads = HasForcedMinThreads ? ForcedMinWorkerThreads : (short)Environment.ProcessorCount;
if (_minThreads > MaxPossibleThreadCount)
{
_minThreads = MaxPossibleThreadCount;
}
_maxThreads = HasForcedMaxThreads ? ForcedMaxWorkerThreads : DefaultMaxWorkerThreadCount;
if (_maxThreads > MaxPossibleThreadCount)
{
_maxThreads = MaxPossibleThreadCount;
}
else if (_maxThreads < _minThreads)
{
_maxThreads = _minThreads;
}
_legacy_minIOCompletionThreads = 1;
_legacy_maxIOCompletionThreads = 1000;
_separated.counts.NumThreadsGoal = _minThreads;
#if TARGET_WINDOWS
_ioPort = CreateIOCompletionPort();
#endif
}
private static bool HasForcedMinThreads =>
ForcedMinWorkerThreads > 0 && (ForcedMaxWorkerThreads <= 0 || ForcedMinWorkerThreads <= ForcedMaxWorkerThreads);
private static bool HasForcedMaxThreads =>
ForcedMaxWorkerThreads > 0 && (ForcedMinWorkerThreads <= 0 || ForcedMinWorkerThreads <= ForcedMaxWorkerThreads);
public bool SetMinThreads(int workerThreads, int ioCompletionThreads)
{
if (workerThreads < 0 || ioCompletionThreads < 0)
{
return false;
}
bool addWorker = false;
bool wakeGateThread = false;
_threadAdjustmentLock.Acquire();
try
{
if (workerThreads > _maxThreads)
{
return false;
}
if (ThreadPool.UsePortableThreadPoolForIO
? ioCompletionThreads > _legacy_maxIOCompletionThreads
: !ThreadPool.CanSetMinIOCompletionThreads(ioCompletionThreads))
{
return false;
}
if (HasForcedMinThreads && workerThreads != ForcedMinWorkerThreads)
{
return false;
}
if (ThreadPool.UsePortableThreadPoolForIO)
{
_legacy_minIOCompletionThreads = (short)Math.Max(1, ioCompletionThreads);
}
else
{
ThreadPool.SetMinIOCompletionThreads(ioCompletionThreads);
}
short newMinThreads = (short)Math.Max(1, workerThreads);
if (newMinThreads == _minThreads)
{
return true;
}
_minThreads = newMinThreads;
if (_numBlockedThreads > 0)
{
// Blocking adjustment will adjust the goal according to its heuristics
if (_pendingBlockingAdjustment != PendingBlockingAdjustment.Immediately)
{
_pendingBlockingAdjustment = PendingBlockingAdjustment.Immediately;
wakeGateThread = true;
}
}
else if (_separated.counts.NumThreadsGoal < newMinThreads)
{
_separated.counts.InterlockedSetNumThreadsGoal(newMinThreads);
if (_separated.numRequestedWorkers > 0)
{
addWorker = true;
}
}
}
finally
{
_threadAdjustmentLock.Release();
}
if (addWorker)
{
WorkerThread.MaybeAddWorkingWorker(this);
}
else if (wakeGateThread)
{
GateThread.Wake(this);
}
return true;
}
public void GetMinThreads(out int workerThreads, out int ioCompletionThreads)
{
workerThreads = Volatile.Read(ref _minThreads);
ioCompletionThreads = _legacy_minIOCompletionThreads;
}
public bool SetMaxThreads(int workerThreads, int ioCompletionThreads)
{
if (workerThreads <= 0 || ioCompletionThreads <= 0)
{
return false;
}
_threadAdjustmentLock.Acquire();
try
{
if (workerThreads < _minThreads)
{
return false;
}
if (ThreadPool.UsePortableThreadPoolForIO
? ioCompletionThreads < _legacy_minIOCompletionThreads
: !ThreadPool.CanSetMaxIOCompletionThreads(ioCompletionThreads))
{
return false;
}
if (HasForcedMaxThreads && workerThreads != ForcedMaxWorkerThreads)
{
return false;
}
if (ThreadPool.UsePortableThreadPoolForIO)
{
_legacy_maxIOCompletionThreads = (short)Math.Min(ioCompletionThreads, MaxPossibleThreadCount);
}
else
{
ThreadPool.SetMaxIOCompletionThreads(ioCompletionThreads);
}
short newMaxThreads = (short)Math.Min(workerThreads, MaxPossibleThreadCount);
if (newMaxThreads == _maxThreads)
{
return true;
}
_maxThreads = newMaxThreads;
if (_separated.counts.NumThreadsGoal > newMaxThreads)
{
_separated.counts.InterlockedSetNumThreadsGoal(newMaxThreads);
}
return true;
}
finally
{
_threadAdjustmentLock.Release();
}
}
public void GetMaxThreads(out int workerThreads, out int ioCompletionThreads)
{
workerThreads = Volatile.Read(ref _maxThreads);
ioCompletionThreads = _legacy_maxIOCompletionThreads;
}
public void GetAvailableThreads(out int workerThreads, out int ioCompletionThreads)
{
ThreadCounts counts = _separated.counts.VolatileRead();
workerThreads = Math.Max(0, _maxThreads - counts.NumProcessingWork);
ioCompletionThreads = _legacy_maxIOCompletionThreads;
}
public int ThreadCount => _separated.counts.VolatileRead().NumExistingThreads;
public long CompletedWorkItemCount => _completionCounter.Count;
public object GetOrCreateThreadLocalCompletionCountObject() =>
t_completionCountObject ?? CreateThreadLocalCompletionCountObject();
[MethodImpl(MethodImplOptions.NoInlining)]
private object CreateThreadLocalCompletionCountObject()
{
Debug.Assert(t_completionCountObject == null);
object threadLocalCompletionCountObject = _completionCounter.CreateThreadLocalCountObject();
t_completionCountObject = threadLocalCompletionCountObject;
return threadLocalCompletionCountObject;
}
private void NotifyWorkItemProgress(object threadLocalCompletionCountObject, int currentTimeMs)
{
ThreadInt64PersistentCounter.Increment(threadLocalCompletionCountObject);
_separated.lastDequeueTime = currentTimeMs;
if (ShouldAdjustMaxWorkersActive(currentTimeMs))
{
AdjustMaxWorkersActive();
}
}
internal void NotifyWorkItemProgress() =>
NotifyWorkItemProgress(GetOrCreateThreadLocalCompletionCountObject(), Environment.TickCount);
internal bool NotifyWorkItemComplete(object? threadLocalCompletionCountObject, int currentTimeMs)
{
Debug.Assert(threadLocalCompletionCountObject != null);
NotifyWorkItemProgress(threadLocalCompletionCountObject!, currentTimeMs);
return !WorkerThread.ShouldStopProcessingWorkNow(this);
}
//
// This method must only be called if ShouldAdjustMaxWorkersActive has returned true, *and*
// _hillClimbingThreadAdjustmentLock is held.
//
private void AdjustMaxWorkersActive()
{
LowLevelLock threadAdjustmentLock = _threadAdjustmentLock;
if (!threadAdjustmentLock.TryAcquire())
{
// The lock is held by someone else, they will take care of this for us
return;
}
bool addWorker = false;
try
{
// Repeated checks from ShouldAdjustMaxWorkersActive() inside the lock
ThreadCounts counts = _separated.counts;
if (counts.NumProcessingWork > counts.NumThreadsGoal ||
_pendingBlockingAdjustment != PendingBlockingAdjustment.None)
{
return;
}
long endTime = Stopwatch.GetTimestamp();
double elapsedSeconds = Stopwatch.GetElapsedTime(_currentSampleStartTime, endTime).TotalSeconds;
if (elapsedSeconds * 1000 >= _threadAdjustmentIntervalMs / 2)
{
int currentTicks = Environment.TickCount;
int totalNumCompletions = (int)_completionCounter.Count;
int numCompletions = totalNumCompletions - _separated.priorCompletionCount;
short oldNumThreadsGoal = counts.NumThreadsGoal;
int newNumThreadsGoal;
(newNumThreadsGoal, _threadAdjustmentIntervalMs) =
HillClimbing.ThreadPoolHillClimber.Update(oldNumThreadsGoal, elapsedSeconds, numCompletions);
if (oldNumThreadsGoal != (short)newNumThreadsGoal)
{
_separated.counts.InterlockedSetNumThreadsGoal((short)newNumThreadsGoal);
//
// If we're increasing the goal, inject a thread. If that thread finds work, it will inject
// another thread, etc., until nobody finds work or we reach the new goal.
//
// If we're reducing the goal, whichever threads notice this first will sleep and timeout themselves.
//
if (newNumThreadsGoal > oldNumThreadsGoal)
{
addWorker = true;
}
}
_separated.priorCompletionCount = totalNumCompletions;
_separated.nextCompletedWorkRequestsTime = currentTicks + _threadAdjustmentIntervalMs;
Volatile.Write(ref _separated.priorCompletedWorkRequestsTime, currentTicks);
_currentSampleStartTime = endTime;
}
}
finally
{
threadAdjustmentLock.Release();
}
if (addWorker)
{
WorkerThread.MaybeAddWorkingWorker(this);
}
}
private bool ShouldAdjustMaxWorkersActive(int currentTimeMs)
{
if (HillClimbing.IsDisabled)
{
return false;
}
// We need to subtract by prior time because Environment.TickCount can wrap around, making a comparison of absolute
// times unreliable. Intervals are unsigned to avoid wrapping around on the subtract after enough time elapses, and
// this also prevents the initial elapsed interval from being negative due to the prior and next times being
// initialized to zero.
int priorTime = Volatile.Read(ref _separated.priorCompletedWorkRequestsTime);
uint requiredInterval = (uint)(_separated.nextCompletedWorkRequestsTime - priorTime);
uint elapsedInterval = (uint)(currentTimeMs - priorTime);
if (elapsedInterval < requiredInterval)
{
return false;
}
// Avoid trying to adjust the thread count goal if there are already more threads than the thread count goal.
// In that situation, hill climbing must have previously decided to decrease the thread count goal, so let's
// wait until the system responds to that change before calling into hill climbing again. This condition should
// be the opposite of the condition in WorkerThread.ShouldStopProcessingWorkNow that causes
// threads processing work to stop in response to a decreased thread count goal. The logic here is a bit
// different from the original CoreCLR code from which this implementation was ported because in this
// implementation there are no retired threads, so only the count of threads processing work is considered.
ThreadCounts counts = _separated.counts;
if (counts.NumProcessingWork > counts.NumThreadsGoal)
{
return false;
}
// Skip hill climbing when there is a pending blocking adjustment. Hill climbing may otherwise bypass the
// blocking adjustment heuristics and increase the thread count too quickly.
return _pendingBlockingAdjustment == PendingBlockingAdjustment.None;
}
internal void RequestWorker()
{
// The order of operations here is important. MaybeAddWorkingWorker() and EnsureRunning() use speculative checks to
// do their work and the memory barrier from the interlocked operation is necessary in this case for correctness.
Interlocked.Increment(ref _separated.numRequestedWorkers);
WorkerThread.MaybeAddWorkingWorker(this);
GateThread.EnsureRunning(this);
}
private bool OnGen2GCCallback()
{
// Gen 2 GCs may be very infrequent in some cases. If it becomes an issue, consider updating the memory usage more
// frequently. The memory usage is only used for fallback purposes in blocking adjustment, so an artifically higher
// memory usage may cause blocking adjustment to fall back to slower adjustments sooner than necessary.
GCMemoryInfo gcMemoryInfo = GC.GetGCMemoryInfo();
_memoryLimitBytes = gcMemoryInfo.HighMemoryLoadThresholdBytes;
_memoryUsageBytes = Math.Min(gcMemoryInfo.MemoryLoadBytes, gcMemoryInfo.HighMemoryLoadThresholdBytes);
return true; // continue receiving gen 2 GC callbacks
}
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Runtime/ref/System.Runtime.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace Microsoft.Win32.SafeHandles
{
public abstract partial class CriticalHandleMinusOneIsInvalid : System.Runtime.InteropServices.CriticalHandle
{
protected CriticalHandleMinusOneIsInvalid() : base (default(System.IntPtr)) { }
public override bool IsInvalid { get { throw null; } }
}
public abstract partial class CriticalHandleZeroOrMinusOneIsInvalid : System.Runtime.InteropServices.CriticalHandle
{
protected CriticalHandleZeroOrMinusOneIsInvalid() : base (default(System.IntPtr)) { }
public override bool IsInvalid { get { throw null; } }
}
public sealed partial class SafeFileHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
{
public SafeFileHandle() : base (default(bool)) { }
public SafeFileHandle(System.IntPtr preexistingHandle, bool ownsHandle) : base (default(bool)) { }
public override bool IsInvalid { get { throw null; } }
public bool IsAsync { get { throw null; } }
protected override bool ReleaseHandle() { throw null; }
}
public abstract partial class SafeHandleMinusOneIsInvalid : System.Runtime.InteropServices.SafeHandle
{
protected SafeHandleMinusOneIsInvalid(bool ownsHandle) : base (default(System.IntPtr), default(bool)) { }
public override bool IsInvalid { get { throw null; } }
}
public abstract partial class SafeHandleZeroOrMinusOneIsInvalid : System.Runtime.InteropServices.SafeHandle
{
protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle) : base (default(System.IntPtr), default(bool)) { }
public override bool IsInvalid { get { throw null; } }
}
public sealed partial class SafeWaitHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
{
public SafeWaitHandle() : base (default(bool)) { }
public SafeWaitHandle(System.IntPtr existingHandle, bool ownsHandle) : base (default(bool)) { }
protected override bool ReleaseHandle() { throw null; }
}
}
namespace System
{
public partial class AccessViolationException : System.SystemException
{
public AccessViolationException() { }
protected AccessViolationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public AccessViolationException(string? message) { }
public AccessViolationException(string? message, System.Exception? innerException) { }
}
public delegate void Action();
public delegate void Action<in T>(T obj);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16);
public delegate void Action<in T1, in T2>(T1 arg1, T2 arg2);
public delegate void Action<in T1, in T2, in T3>(T1 arg1, T2 arg2, T3 arg3);
public delegate void Action<in T1, in T2, in T3, in T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
public delegate void Action<in T1, in T2, in T3, in T4, in T5>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9);
public static partial class Activator
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName, object?[]? activationAttributes) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type type) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, bool nonPublic) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, params object?[]? args) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, object?[]? args, object?[]? activationAttributes) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, object?[]? activationAttributes) { throw null; }
public static T CreateInstance<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>() { throw null; }
}
public partial class AggregateException : System.Exception
{
public AggregateException() { }
public AggregateException(System.Collections.Generic.IEnumerable<System.Exception> innerExceptions) { }
public AggregateException(params System.Exception[] innerExceptions) { }
protected AggregateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public AggregateException(string? message) { }
public AggregateException(string? message, System.Collections.Generic.IEnumerable<System.Exception> innerExceptions) { }
public AggregateException(string? message, System.Exception innerException) { }
public AggregateException(string? message, params System.Exception[] innerExceptions) { }
public System.Collections.ObjectModel.ReadOnlyCollection<System.Exception> InnerExceptions { get { throw null; } }
public override string Message { get { throw null; } }
public System.AggregateException Flatten() { throw null; }
public override System.Exception GetBaseException() { throw null; }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public void Handle(System.Func<System.Exception, bool> predicate) { }
public override string ToString() { throw null; }
}
public static partial class AppContext
{
public static string BaseDirectory { get { throw null; } }
public static string? TargetFrameworkName { get { throw null; } }
public static object? GetData(string name) { throw null; }
public static void SetData(string name, object? data) { }
public static void SetSwitch(string switchName, bool isEnabled) { }
public static bool TryGetSwitch(string switchName, out bool isEnabled) { throw null; }
}
public sealed partial class AppDomain : System.MarshalByRefObject
{
internal AppDomain() { }
public string BaseDirectory { get { throw null; } }
public static System.AppDomain CurrentDomain { get { throw null; } }
public string? DynamicDirectory { get { throw null; } }
public string FriendlyName { get { throw null; } }
public int Id { get { throw null; } }
public bool IsFullyTrusted { get { throw null; } }
public bool IsHomogenous { get { throw null; } }
public static bool MonitoringIsEnabled { get { throw null; } set { } }
public long MonitoringSurvivedMemorySize { get { throw null; } }
public static long MonitoringSurvivedProcessMemorySize { get { throw null; } }
public long MonitoringTotalAllocatedMemorySize { get { throw null; } }
public System.TimeSpan MonitoringTotalProcessorTime { get { throw null; } }
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Security.PermissionSet PermissionSet { get { throw null; } }
public string? RelativeSearchPath { get { throw null; } }
public System.AppDomainSetup SetupInformation { get { throw null; } }
public bool ShadowCopyFiles { get { throw null; } }
public event System.AssemblyLoadEventHandler? AssemblyLoad { add { } remove { } }
public event System.ResolveEventHandler? AssemblyResolve { add { } remove { } }
public event System.EventHandler? DomainUnload { add { } remove { } }
public event System.EventHandler<System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs>? FirstChanceException { add { } remove { } }
public event System.EventHandler? ProcessExit { add { } remove { } }
public event System.ResolveEventHandler? ReflectionOnlyAssemblyResolve { add { } remove { } }
public event System.ResolveEventHandler? ResourceResolve { add { } remove { } }
public event System.ResolveEventHandler? TypeResolve { add { } remove { } }
public event System.UnhandledExceptionEventHandler? UnhandledException { add { } remove { } }
[System.ObsoleteAttribute("AppDomain.AppendPrivatePath has been deprecated and is not supported.")]
public void AppendPrivatePath(string? path) { }
public string ApplyPolicy(string assemblyName) { throw null; }
[System.ObsoleteAttribute("AppDomain.ClearPrivatePath has been deprecated and is not supported.")]
public void ClearPrivatePath() { }
[System.ObsoleteAttribute("AppDomain.ClearShadowCopyPath has been deprecated and is not supported.")]
public void ClearShadowCopyPath() { }
[System.ObsoleteAttribute("Creating and unloading AppDomains is not supported and throws an exception.", DiagnosticId = "SYSLIB0024", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.AppDomain CreateDomain(string friendlyName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceAndUnwrap(string assemblyName, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceAndUnwrap(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceAndUnwrap(string assemblyName, string typeName, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceFromAndUnwrap(string assemblyFile, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceFromAndUnwrap(string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceFromAndUnwrap(string assemblyFile, string typeName, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public int ExecuteAssembly(string assemblyFile) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public int ExecuteAssembly(string assemblyFile, string?[]? args) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public int ExecuteAssembly(string assemblyFile, string?[]? args, byte[]? hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm) { throw null; }
public int ExecuteAssemblyByName(System.Reflection.AssemblyName assemblyName, params string?[]? args) { throw null; }
public int ExecuteAssemblyByName(string assemblyName) { throw null; }
public int ExecuteAssemblyByName(string assemblyName, params string?[]? args) { throw null; }
public System.Reflection.Assembly[] GetAssemblies() { throw null; }
[System.ObsoleteAttribute("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread instead.")]
public static int GetCurrentThreadId() { throw null; }
public object? GetData(string name) { throw null; }
public bool? IsCompatibilitySwitchSet(string value) { throw null; }
public bool IsDefaultAppDomain() { throw null; }
public bool IsFinalizingForUnload() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public System.Reflection.Assembly Load(byte[] rawAssembly) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public System.Reflection.Assembly Load(byte[] rawAssembly, byte[]? rawSymbolStore) { throw null; }
public System.Reflection.Assembly Load(System.Reflection.AssemblyName assemblyRef) { throw null; }
public System.Reflection.Assembly Load(string assemblyString) { throw null; }
public System.Reflection.Assembly[] ReflectionOnlyGetAssemblies() { throw null; }
[System.ObsoleteAttribute("AppDomain.SetCachePath has been deprecated and is not supported.")]
public void SetCachePath(string? path) { }
public void SetData(string name, object? data) { }
[System.ObsoleteAttribute("AppDomain.SetDynamicBase has been deprecated and is not supported.")]
public void SetDynamicBase(string? path) { }
public void SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy policy) { }
[System.ObsoleteAttribute("AppDomain.SetShadowCopyFiles has been deprecated and is not supported.")]
public void SetShadowCopyFiles() { }
[System.ObsoleteAttribute("AppDomain.SetShadowCopyPath has been deprecated and is not supported.")]
public void SetShadowCopyPath(string? path) { }
public void SetThreadPrincipal(System.Security.Principal.IPrincipal principal) { }
public override string ToString() { throw null; }
[System.ObsoleteAttribute("Creating and unloading AppDomains is not supported and throws an exception.", DiagnosticId = "SYSLIB0024", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void Unload(System.AppDomain domain) { }
}
public sealed partial class AppDomainSetup
{
internal AppDomainSetup() { }
public string? ApplicationBase { get { throw null; } }
public string? TargetFrameworkName { get { throw null; } }
}
public partial class AppDomainUnloadedException : System.SystemException
{
public AppDomainUnloadedException() { }
protected AppDomainUnloadedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public AppDomainUnloadedException(string? message) { }
public AppDomainUnloadedException(string? message, System.Exception? innerException) { }
}
public partial class ApplicationException : System.Exception
{
public ApplicationException() { }
protected ApplicationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ApplicationException(string? message) { }
public ApplicationException(string? message, System.Exception? innerException) { }
}
public sealed partial class ApplicationId
{
public ApplicationId(byte[] publicKeyToken, string name, System.Version version, string? processorArchitecture, string? culture) { }
public string? Culture { get { throw null; } }
public string Name { get { throw null; } }
public string? ProcessorArchitecture { get { throw null; } }
public byte[] PublicKeyToken { get { throw null; } }
public System.Version Version { get { throw null; } }
public System.ApplicationId Copy() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public ref partial struct ArgIterator
{
private int _dummyPrimitive;
public ArgIterator(System.RuntimeArgumentHandle arglist) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe ArgIterator(System.RuntimeArgumentHandle arglist, void* ptr) { throw null; }
public void End() { }
public override bool Equals(object? o) { throw null; }
public override int GetHashCode() { throw null; }
[System.CLSCompliantAttribute(false)]
public System.TypedReference GetNextArg() { throw null; }
[System.CLSCompliantAttribute(false)]
public System.TypedReference GetNextArg(System.RuntimeTypeHandle rth) { throw null; }
public System.RuntimeTypeHandle GetNextArgType() { throw null; }
public int GetRemainingCount() { throw null; }
}
public partial class ArgumentException : System.SystemException
{
public ArgumentException() { }
protected ArgumentException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArgumentException(string? message) { }
public ArgumentException(string? message, System.Exception? innerException) { }
public ArgumentException(string? message, string? paramName) { }
public ArgumentException(string? message, string? paramName, System.Exception? innerException) { }
public override string Message { get { throw null; } }
public virtual string? ParamName { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static void ThrowIfNullOrEmpty([System.Diagnostics.CodeAnalysis.NotNullAttribute] string? argument, [System.Runtime.CompilerServices.CallerArgumentExpression("argument")] string? paramName = null) { throw null; }
}
public partial class ArgumentNullException : System.ArgumentException
{
public ArgumentNullException() { }
protected ArgumentNullException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArgumentNullException(string? paramName) { }
public ArgumentNullException(string? message, System.Exception? innerException) { }
public ArgumentNullException(string? paramName, string? message) { }
public static void ThrowIfNull([System.Diagnostics.CodeAnalysis.NotNullAttribute] object? argument, [System.Runtime.CompilerServices.CallerArgumentExpressionAttribute("argument")] string? paramName = null) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void ThrowIfNull([System.Diagnostics.CodeAnalysis.NotNullAttribute] void* argument, [System.Runtime.CompilerServices.CallerArgumentExpressionAttribute("argument")] string? paramName = null) { throw null; }
}
public partial class ArgumentOutOfRangeException : System.ArgumentException
{
public ArgumentOutOfRangeException() { }
protected ArgumentOutOfRangeException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArgumentOutOfRangeException(string? paramName) { }
public ArgumentOutOfRangeException(string? message, System.Exception? innerException) { }
public ArgumentOutOfRangeException(string? paramName, object? actualValue, string? message) { }
public ArgumentOutOfRangeException(string? paramName, string? message) { }
public virtual object? ActualValue { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class ArithmeticException : System.SystemException
{
public ArithmeticException() { }
protected ArithmeticException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArithmeticException(string? message) { }
public ArithmeticException(string? message, System.Exception? innerException) { }
}
public abstract partial class Array : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.ICloneable
{
internal Array() { }
public bool IsFixedSize { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public bool IsSynchronized { get { throw null; } }
public int Length { get { throw null; } }
public long LongLength { get { throw null; } }
public static int MaxLength { get { throw null; } }
public int Rank { get { throw null; } }
public object SyncRoot { get { throw null; } }
int System.Collections.ICollection.Count { get { throw null; } }
object? System.Collections.IList.this[int index] { get { throw null; } set { } }
public static System.Collections.ObjectModel.ReadOnlyCollection<T> AsReadOnly<T>(T[] array) { throw null; }
public static int BinarySearch(System.Array array, int index, int length, object? value) { throw null; }
public static int BinarySearch(System.Array array, int index, int length, object? value, System.Collections.IComparer? comparer) { throw null; }
public static int BinarySearch(System.Array array, object? value) { throw null; }
public static int BinarySearch(System.Array array, object? value, System.Collections.IComparer? comparer) { throw null; }
public static int BinarySearch<T>(T[] array, int index, int length, T value) { throw null; }
public static int BinarySearch<T>(T[] array, int index, int length, T value, System.Collections.Generic.IComparer<T>? comparer) { throw null; }
public static int BinarySearch<T>(T[] array, T value) { throw null; }
public static int BinarySearch<T>(T[] array, T value, System.Collections.Generic.IComparer<T>? comparer) { throw null; }
public static void Clear(System.Array array) { }
public static void Clear(System.Array array, int index, int length) { }
public object Clone() { throw null; }
public static void ConstrainedCopy(System.Array sourceArray, int sourceIndex, System.Array destinationArray, int destinationIndex, int length) { }
public static TOutput[] ConvertAll<TInput, TOutput>(TInput[] array, System.Converter<TInput, TOutput> converter) { throw null; }
public static void Copy(System.Array sourceArray, System.Array destinationArray, int length) { }
public static void Copy(System.Array sourceArray, System.Array destinationArray, long length) { }
public static void Copy(System.Array sourceArray, int sourceIndex, System.Array destinationArray, int destinationIndex, int length) { }
public static void Copy(System.Array sourceArray, long sourceIndex, System.Array destinationArray, long destinationIndex, long length) { }
public void CopyTo(System.Array array, int index) { }
public void CopyTo(System.Array array, long index) { }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public static System.Array CreateInstance(System.Type elementType, int length) { throw null; }
public static System.Array CreateInstance(System.Type elementType, int length1, int length2) { throw null; }
public static System.Array CreateInstance(System.Type elementType, int length1, int length2, int length3) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public static System.Array CreateInstance(System.Type elementType, params int[] lengths) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public static System.Array CreateInstance(System.Type elementType, int[] lengths, int[] lowerBounds) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public static System.Array CreateInstance(System.Type elementType, params long[] lengths) { throw null; }
public static T[] Empty<T>() { throw null; }
public static bool Exists<T>(T[] array, System.Predicate<T> match) { throw null; }
public static void Fill<T>(T[] array, T value) { }
public static void Fill<T>(T[] array, T value, int startIndex, int count) { }
public static T[] FindAll<T>(T[] array, System.Predicate<T> match) { throw null; }
public static int FindIndex<T>(T[] array, int startIndex, int count, System.Predicate<T> match) { throw null; }
public static int FindIndex<T>(T[] array, int startIndex, System.Predicate<T> match) { throw null; }
public static int FindIndex<T>(T[] array, System.Predicate<T> match) { throw null; }
public static int FindLastIndex<T>(T[] array, int startIndex, int count, System.Predicate<T> match) { throw null; }
public static int FindLastIndex<T>(T[] array, int startIndex, System.Predicate<T> match) { throw null; }
public static int FindLastIndex<T>(T[] array, System.Predicate<T> match) { throw null; }
public static T? FindLast<T>(T[] array, System.Predicate<T> match) { throw null; }
public static T? Find<T>(T[] array, System.Predicate<T> match) { throw null; }
public static void ForEach<T>(T[] array, System.Action<T> action) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
public int GetLength(int dimension) { throw null; }
public long GetLongLength(int dimension) { throw null; }
public int GetLowerBound(int dimension) { throw null; }
public int GetUpperBound(int dimension) { throw null; }
public object? GetValue(int index) { throw null; }
public object? GetValue(int index1, int index2) { throw null; }
public object? GetValue(int index1, int index2, int index3) { throw null; }
public object? GetValue(params int[] indices) { throw null; }
public object? GetValue(long index) { throw null; }
public object? GetValue(long index1, long index2) { throw null; }
public object? GetValue(long index1, long index2, long index3) { throw null; }
public object? GetValue(params long[] indices) { throw null; }
public static int IndexOf(System.Array array, object? value) { throw null; }
public static int IndexOf(System.Array array, object? value, int startIndex) { throw null; }
public static int IndexOf(System.Array array, object? value, int startIndex, int count) { throw null; }
public static int IndexOf<T>(T[] array, T value) { throw null; }
public static int IndexOf<T>(T[] array, T value, int startIndex) { throw null; }
public static int IndexOf<T>(T[] array, T value, int startIndex, int count) { throw null; }
public void Initialize() { }
public static int LastIndexOf(System.Array array, object? value) { throw null; }
public static int LastIndexOf(System.Array array, object? value, int startIndex) { throw null; }
public static int LastIndexOf(System.Array array, object? value, int startIndex, int count) { throw null; }
public static int LastIndexOf<T>(T[] array, T value) { throw null; }
public static int LastIndexOf<T>(T[] array, T value, int startIndex) { throw null; }
public static int LastIndexOf<T>(T[] array, T value, int startIndex, int count) { throw null; }
public static void Resize<T>([System.Diagnostics.CodeAnalysis.NotNullAttribute] ref T[]? array, int newSize) { throw null; }
public static void Reverse(System.Array array) { }
public static void Reverse(System.Array array, int index, int length) { }
public static void Reverse<T>(T[] array) { }
public static void Reverse<T>(T[] array, int index, int length) { }
public void SetValue(object? value, int index) { }
public void SetValue(object? value, int index1, int index2) { }
public void SetValue(object? value, int index1, int index2, int index3) { }
public void SetValue(object? value, params int[] indices) { }
public void SetValue(object? value, long index) { }
public void SetValue(object? value, long index1, long index2) { }
public void SetValue(object? value, long index1, long index2, long index3) { }
public void SetValue(object? value, params long[] indices) { }
public static void Sort(System.Array array) { }
public static void Sort(System.Array keys, System.Array? items) { }
public static void Sort(System.Array keys, System.Array? items, System.Collections.IComparer? comparer) { }
public static void Sort(System.Array keys, System.Array? items, int index, int length) { }
public static void Sort(System.Array keys, System.Array? items, int index, int length, System.Collections.IComparer? comparer) { }
public static void Sort(System.Array array, System.Collections.IComparer? comparer) { }
public static void Sort(System.Array array, int index, int length) { }
public static void Sort(System.Array array, int index, int length, System.Collections.IComparer? comparer) { }
public static void Sort<T>(T[] array) { }
public static void Sort<T>(T[] array, System.Collections.Generic.IComparer<T>? comparer) { }
public static void Sort<T>(T[] array, System.Comparison<T> comparison) { }
public static void Sort<T>(T[] array, int index, int length) { }
public static void Sort<T>(T[] array, int index, int length, System.Collections.Generic.IComparer<T>? comparer) { }
public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items) { }
public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items, System.Collections.Generic.IComparer<TKey>? comparer) { }
public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items, int index, int length) { }
public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items, int index, int length, System.Collections.Generic.IComparer<TKey>? comparer) { }
int System.Collections.IList.Add(object? value) { throw null; }
void System.Collections.IList.Clear() { }
bool System.Collections.IList.Contains(object? value) { throw null; }
int System.Collections.IList.IndexOf(object? value) { throw null; }
void System.Collections.IList.Insert(int index, object? value) { }
void System.Collections.IList.Remove(object? value) { }
void System.Collections.IList.RemoveAt(int index) { }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
public static bool TrueForAll<T>(T[] array, System.Predicate<T> match) { throw null; }
}
public readonly partial struct ArraySegment<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.IEnumerable
{
private readonly T[] _array;
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ArraySegment(T[] array) { throw null; }
public ArraySegment(T[] array, int offset, int count) { throw null; }
public T[]? Array { get { throw null; } }
public int Count { get { throw null; } }
public static System.ArraySegment<T> Empty { get { throw null; } }
public T this[int index] { get { throw null; } set { } }
public int Offset { get { throw null; } }
bool System.Collections.Generic.ICollection<T>.IsReadOnly { get { throw null; } }
T System.Collections.Generic.IList<T>.this[int index] { get { throw null; } set { } }
T System.Collections.Generic.IReadOnlyList<T>.this[int index] { get { throw null; } }
public void CopyTo(System.ArraySegment<T> destination) { }
public void CopyTo(T[] destination) { }
public void CopyTo(T[] destination, int destinationIndex) { }
public bool Equals(System.ArraySegment<T> obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public System.ArraySegment<T>.Enumerator GetEnumerator() { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.ArraySegment<T> a, System.ArraySegment<T> b) { throw null; }
public static implicit operator System.ArraySegment<T> (T[] array) { throw null; }
public static bool operator !=(System.ArraySegment<T> a, System.ArraySegment<T> b) { throw null; }
public System.ArraySegment<T> Slice(int index) { throw null; }
public System.ArraySegment<T> Slice(int index, int count) { throw null; }
void System.Collections.Generic.ICollection<T>.Add(T item) { }
void System.Collections.Generic.ICollection<T>.Clear() { }
bool System.Collections.Generic.ICollection<T>.Contains(T item) { throw null; }
bool System.Collections.Generic.ICollection<T>.Remove(T item) { throw null; }
System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() { throw null; }
int System.Collections.Generic.IList<T>.IndexOf(T item) { throw null; }
void System.Collections.Generic.IList<T>.Insert(int index, T item) { }
void System.Collections.Generic.IList<T>.RemoveAt(int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public T[] ToArray() { throw null; }
public partial struct Enumerator : System.Collections.Generic.IEnumerator<T>, System.Collections.IEnumerator, System.IDisposable
{
private readonly T[] _array;
private object _dummy;
private int _dummyPrimitive;
public T Current { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
public void Dispose() { }
public bool MoveNext() { throw null; }
void System.Collections.IEnumerator.Reset() { }
}
}
public partial class ArrayTypeMismatchException : System.SystemException
{
public ArrayTypeMismatchException() { }
protected ArrayTypeMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArrayTypeMismatchException(string? message) { }
public ArrayTypeMismatchException(string? message, System.Exception? innerException) { }
}
public partial class AssemblyLoadEventArgs : System.EventArgs
{
public AssemblyLoadEventArgs(System.Reflection.Assembly loadedAssembly) { }
public System.Reflection.Assembly LoadedAssembly { get { throw null; } }
}
public delegate void AssemblyLoadEventHandler(object? sender, System.AssemblyLoadEventArgs args);
public delegate void AsyncCallback(System.IAsyncResult ar);
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=true, AllowMultiple=false)]
public abstract partial class Attribute
{
protected Attribute() { }
public virtual object TypeId { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.Assembly element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.Module element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.Module element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, System.Type attributeType) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public override int GetHashCode() { throw null; }
public virtual bool IsDefaultAttribute() { throw null; }
public static bool IsDefined(System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static bool IsDefined(System.Reflection.Assembly element, System.Type attributeType, bool inherit) { throw null; }
public static bool IsDefined(System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static bool IsDefined(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static bool IsDefined(System.Reflection.Module element, System.Type attributeType) { throw null; }
public static bool IsDefined(System.Reflection.Module element, System.Type attributeType, bool inherit) { throw null; }
public static bool IsDefined(System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static bool IsDefined(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public virtual bool Match(object? obj) { throw null; }
}
[System.FlagsAttribute]
public enum AttributeTargets
{
Assembly = 1,
Module = 2,
Class = 4,
Struct = 8,
Enum = 16,
Constructor = 32,
Method = 64,
Property = 128,
Field = 256,
Event = 512,
Interface = 1024,
Parameter = 2048,
Delegate = 4096,
ReturnValue = 8192,
GenericParameter = 16384,
All = 32767,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=true)]
public sealed partial class AttributeUsageAttribute : System.Attribute
{
public AttributeUsageAttribute(System.AttributeTargets validOn) { }
public bool AllowMultiple { get { throw null; } set { } }
public bool Inherited { get { throw null; } set { } }
public System.AttributeTargets ValidOn { get { throw null; } }
}
public partial class BadImageFormatException : System.SystemException
{
public BadImageFormatException() { }
protected BadImageFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public BadImageFormatException(string? message) { }
public BadImageFormatException(string? message, System.Exception? inner) { }
public BadImageFormatException(string? message, string? fileName) { }
public BadImageFormatException(string? message, string? fileName, System.Exception? inner) { }
public string? FileName { get { throw null; } }
public string? FusionLog { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum Base64FormattingOptions
{
None = 0,
InsertLineBreaks = 1,
}
public static partial class BitConverter
{
public static readonly bool IsLittleEndian;
public static long DoubleToInt64Bits(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong DoubleToUInt64Bits(double value) { throw null; }
public static byte[] GetBytes(bool value) { throw null; }
public static byte[] GetBytes(char value) { throw null; }
public static byte[] GetBytes(double value) { throw null; }
public static byte[] GetBytes(System.Half value) { throw null; }
public static byte[] GetBytes(short value) { throw null; }
public static byte[] GetBytes(int value) { throw null; }
public static byte[] GetBytes(long value) { throw null; }
public static byte[] GetBytes(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte[] GetBytes(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte[] GetBytes(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte[] GetBytes(ulong value) { throw null; }
public static short HalfToInt16Bits(System.Half value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort HalfToUInt16Bits(System.Half value) { throw null; }
public static System.Half Int16BitsToHalf(short value) { throw null; }
public static float Int32BitsToSingle(int value) { throw null; }
public static double Int64BitsToDouble(long value) { throw null; }
public static int SingleToInt32Bits(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint SingleToUInt32Bits(float value) { throw null; }
public static bool ToBoolean(byte[] value, int startIndex) { throw null; }
public static bool ToBoolean(System.ReadOnlySpan<byte> value) { throw null; }
public static char ToChar(byte[] value, int startIndex) { throw null; }
public static char ToChar(System.ReadOnlySpan<byte> value) { throw null; }
public static double ToDouble(byte[] value, int startIndex) { throw null; }
public static double ToDouble(System.ReadOnlySpan<byte> value) { throw null; }
public static System.Half ToHalf(byte[] value, int startIndex) { throw null; }
public static System.Half ToHalf(System.ReadOnlySpan<byte> value) { throw null; }
public static short ToInt16(byte[] value, int startIndex) { throw null; }
public static short ToInt16(System.ReadOnlySpan<byte> value) { throw null; }
public static int ToInt32(byte[] value, int startIndex) { throw null; }
public static int ToInt32(System.ReadOnlySpan<byte> value) { throw null; }
public static long ToInt64(byte[] value, int startIndex) { throw null; }
public static long ToInt64(System.ReadOnlySpan<byte> value) { throw null; }
public static float ToSingle(byte[] value, int startIndex) { throw null; }
public static float ToSingle(System.ReadOnlySpan<byte> value) { throw null; }
public static string ToString(byte[] value) { throw null; }
public static string ToString(byte[] value, int startIndex) { throw null; }
public static string ToString(byte[] value, int startIndex, int length) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(byte[] value, int startIndex) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(System.ReadOnlySpan<byte> value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(byte[] value, int startIndex) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(System.ReadOnlySpan<byte> value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(byte[] value, int startIndex) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(System.ReadOnlySpan<byte> value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, bool value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, char value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, double value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, System.Half value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, short value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, int value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, long value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteBytes(System.Span<byte> destination, ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteBytes(System.Span<byte> destination, uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteBytes(System.Span<byte> destination, ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.Half UInt16BitsToHalf(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float UInt32BitsToSingle(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double UInt64BitsToDouble(ulong value) { throw null; }
}
public readonly partial struct Boolean : System.IComparable, System.IComparable<bool>, System.IConvertible, System.IEquatable<bool>
{
private readonly bool _dummyPrimitive;
public static readonly string FalseString;
public static readonly string TrueString;
public int CompareTo(System.Boolean value) { throw null; }
public int CompareTo(object? obj) { throw null; }
public System.Boolean Equals(System.Boolean obj) { throw null; }
public override System.Boolean Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Boolean Parse(System.ReadOnlySpan<char> value) { throw null; }
public static System.Boolean Parse(string value) { throw null; }
System.Boolean System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public System.Boolean TryFormat(System.Span<char> destination, out int charsWritten) { throw null; }
public static System.Boolean TryParse(System.ReadOnlySpan<char> value, out System.Boolean result) { throw null; }
public static System.Boolean TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value, out System.Boolean result) { throw null; }
}
public static partial class Buffer
{
public static void BlockCopy(System.Array src, int srcOffset, System.Array dst, int dstOffset, int count) { }
public static int ByteLength(System.Array array) { throw null; }
public static byte GetByte(System.Array array, int index) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void MemoryCopy(void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void MemoryCopy(void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy) { }
public static void SetByte(System.Array array, int index, byte value) { }
}
public readonly partial struct Byte : System.IComparable, System.IComparable<byte>, System.IConvertible, System.IEquatable<byte>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<byte>,
System.IMinMaxValue<byte>,
System.IUnsignedNumber<byte>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly byte _dummyPrimitive;
public const byte MaxValue = (byte)255;
public const byte MinValue = (byte)0;
public int CompareTo(System.Byte value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Byte obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Byte Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.Byte Parse(string s) { throw null; }
public static System.Byte Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Byte Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Byte Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
System.Byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Byte result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Byte result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Byte result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Byte result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IAdditiveIdentity<byte, byte>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IMinMaxValue<byte>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IMinMaxValue<byte>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IMultiplicativeIdentity<byte, byte>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IAdditionOperators<byte, byte, byte>.operator +(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.LeadingZeroCount(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.PopCount(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.RotateLeft(byte value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.RotateRight(byte value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.TrailingZeroCount(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<byte>.IsPow2(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryNumber<byte>.Log2(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBitwiseOperators<byte, byte, byte>.operator &(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBitwiseOperators<byte, byte, byte>.operator |(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBitwiseOperators<byte, byte, byte>.operator ^(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBitwiseOperators<byte, byte, byte>.operator ~(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<byte, byte>.operator <(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<byte, byte>.operator <=(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<byte, byte>.operator >(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<byte, byte>.operator >=(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IDecrementOperators<byte>.operator --(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IDivisionOperators<byte, byte, byte>.operator /(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<byte, byte>.operator ==(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<byte, byte>.operator !=(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IIncrementOperators<byte>.operator ++(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IModulusOperators<byte, byte, byte>.operator %(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IMultiplyOperators<byte, byte, byte>.operator *(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Abs(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Clamp(byte value, byte min, byte max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (byte Quotient, byte Remainder) INumber<byte>.DivRem(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Max(byte x, byte y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Min(byte x, byte y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Sign(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<byte>.TryCreate<TOther>(TOther value, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<byte>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<byte>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IParseable<byte>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<byte>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IShiftOperators<byte, byte>.operator <<(byte value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IShiftOperators<byte, byte>.operator >>(byte value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte ISpanParseable<byte>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<byte>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte ISubtractionOperators<byte, byte, byte>.operator -(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IUnaryNegationOperators<byte, byte>.operator -(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IUnaryPlusOperators<byte, byte>.operator +(byte value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial class CannotUnloadAppDomainException : System.SystemException
{
public CannotUnloadAppDomainException() { }
protected CannotUnloadAppDomainException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public CannotUnloadAppDomainException(string? message) { }
public CannotUnloadAppDomainException(string? message, System.Exception? innerException) { }
}
public readonly partial struct Char : System.IComparable, System.IComparable<char>, System.IConvertible, System.IEquatable<char>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<char>,
System.IMinMaxValue<char>,
System.IUnsignedNumber<char>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly char _dummyPrimitive;
public const char MaxValue = '\uFFFF';
public const char MinValue = '\0';
public int CompareTo(System.Char value) { throw null; }
public int CompareTo(object? value) { throw null; }
public static string ConvertFromUtf32(int utf32) { throw null; }
public static int ConvertToUtf32(System.Char highSurrogate, System.Char lowSurrogate) { throw null; }
public static int ConvertToUtf32(string s, int index) { throw null; }
public bool Equals(System.Char obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static double GetNumericValue(System.Char c) { throw null; }
public static double GetNumericValue(string s, int index) { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(System.Char c) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(string s, int index) { throw null; }
public static bool IsAscii(System.Char c) { throw null; }
public static bool IsControl(System.Char c) { throw null; }
public static bool IsControl(string s, int index) { throw null; }
public static bool IsDigit(System.Char c) { throw null; }
public static bool IsDigit(string s, int index) { throw null; }
public static bool IsHighSurrogate(System.Char c) { throw null; }
public static bool IsHighSurrogate(string s, int index) { throw null; }
public static bool IsLetter(System.Char c) { throw null; }
public static bool IsLetter(string s, int index) { throw null; }
public static bool IsLetterOrDigit(System.Char c) { throw null; }
public static bool IsLetterOrDigit(string s, int index) { throw null; }
public static bool IsLower(System.Char c) { throw null; }
public static bool IsLower(string s, int index) { throw null; }
public static bool IsLowSurrogate(System.Char c) { throw null; }
public static bool IsLowSurrogate(string s, int index) { throw null; }
public static bool IsNumber(System.Char c) { throw null; }
public static bool IsNumber(string s, int index) { throw null; }
public static bool IsPunctuation(System.Char c) { throw null; }
public static bool IsPunctuation(string s, int index) { throw null; }
public static bool IsSeparator(System.Char c) { throw null; }
public static bool IsSeparator(string s, int index) { throw null; }
public static bool IsSurrogate(System.Char c) { throw null; }
public static bool IsSurrogate(string s, int index) { throw null; }
public static bool IsSurrogatePair(System.Char highSurrogate, System.Char lowSurrogate) { throw null; }
public static bool IsSurrogatePair(string s, int index) { throw null; }
public static bool IsSymbol(System.Char c) { throw null; }
public static bool IsSymbol(string s, int index) { throw null; }
public static bool IsUpper(System.Char c) { throw null; }
public static bool IsUpper(string s, int index) { throw null; }
public static bool IsWhiteSpace(System.Char c) { throw null; }
public static bool IsWhiteSpace(string s, int index) { throw null; }
public static System.Char Parse(string s) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
System.Char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public static System.Char ToLower(System.Char c) { throw null; }
public static System.Char ToLower(System.Char c, System.Globalization.CultureInfo culture) { throw null; }
public static System.Char ToLowerInvariant(System.Char c) { throw null; }
public override string ToString() { throw null; }
public static string ToString(System.Char c) { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public static System.Char ToUpper(System.Char c) { throw null; }
public static System.Char ToUpper(System.Char c, System.Globalization.CultureInfo culture) { throw null; }
public static System.Char ToUpperInvariant(System.Char c) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Char result) { throw null; }
bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw null; }
string System.IFormattable.ToString(string? format, IFormatProvider? formatProvider) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IAdditiveIdentity<char, char>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IMinMaxValue<char>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IMinMaxValue<char>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IMultiplicativeIdentity<char, char>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IAdditionOperators<char, char, char>.operator +(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.LeadingZeroCount(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.PopCount(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.RotateLeft(char value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.RotateRight(char value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.TrailingZeroCount(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<char>.IsPow2(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryNumber<char>.Log2(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBitwiseOperators<char, char, char>.operator &(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBitwiseOperators<char, char, char>.operator |(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBitwiseOperators<char, char, char>.operator ^(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBitwiseOperators<char, char, char>.operator ~(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<char, char>.operator <(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<char, char>.operator <=(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<char, char>.operator >(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<char, char>.operator >=(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IDecrementOperators<char>.operator --(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IDivisionOperators<char, char, char>.operator /(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<char, char>.operator ==(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<char, char>.operator !=(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IIncrementOperators<char>.operator ++(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IModulusOperators<char, char, char>.operator %(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IMultiplyOperators<char, char, char>.operator *(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Abs(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Clamp(char value, char min, char max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (char Quotient, char Remainder) INumber<char>.DivRem(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Max(char x, char y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Min(char x, char y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Sign(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<char>.TryCreate<TOther>(TOther value, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<char>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<char>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IParseable<char>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<char>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IShiftOperators<char, char>.operator <<(char value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview"), System.Runtime.CompilerServices.SpecialNameAttribute]
static char IShiftOperators<char, char>.operator >>(char value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char ISpanParseable<char>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<char>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char ISubtractionOperators<char, char, char>.operator -(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IUnaryNegationOperators<char, char>.operator -(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IUnaryPlusOperators<char, char>.operator +(char value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public sealed partial class CharEnumerator : System.Collections.Generic.IEnumerator<char>, System.Collections.IEnumerator, System.ICloneable, System.IDisposable
{
internal CharEnumerator() { }
public char Current { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
public object Clone() { throw null; }
public void Dispose() { }
public bool MoveNext() { throw null; }
public void Reset() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=true, AllowMultiple=false)]
public sealed partial class CLSCompliantAttribute : System.Attribute
{
public CLSCompliantAttribute(bool isCompliant) { }
public bool IsCompliant { get { throw null; } }
}
public delegate int Comparison<in T>(T x, T y);
public abstract partial class ContextBoundObject : System.MarshalByRefObject
{
protected ContextBoundObject() { }
}
public partial class ContextMarshalException : System.SystemException
{
public ContextMarshalException() { }
protected ContextMarshalException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ContextMarshalException(string? message) { }
public ContextMarshalException(string? message, System.Exception? inner) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public partial class ContextStaticAttribute : System.Attribute
{
public ContextStaticAttribute() { }
}
public static partial class Convert
{
public static readonly object DBNull;
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static object? ChangeType(object? value, System.Type conversionType) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static object? ChangeType(object? value, System.Type conversionType, System.IFormatProvider? provider) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static object? ChangeType(object? value, System.TypeCode typeCode) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static object? ChangeType(object? value, System.TypeCode typeCode, System.IFormatProvider? provider) { throw null; }
public static byte[] FromBase64CharArray(char[] inArray, int offset, int length) { throw null; }
public static byte[] FromBase64String(string s) { throw null; }
public static byte[] FromHexString(System.ReadOnlySpan<char> chars) { throw null; }
public static byte[] FromHexString(string s) { throw null; }
public static System.TypeCode GetTypeCode(object? value) { throw null; }
public static bool IsDBNull([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut) { throw null; }
public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut, System.Base64FormattingOptions options) { throw null; }
public static string ToBase64String(byte[] inArray) { throw null; }
public static string ToBase64String(byte[] inArray, System.Base64FormattingOptions options) { throw null; }
public static string ToBase64String(byte[] inArray, int offset, int length) { throw null; }
public static string ToBase64String(byte[] inArray, int offset, int length, System.Base64FormattingOptions options) { throw null; }
public static string ToBase64String(System.ReadOnlySpan<byte> bytes, System.Base64FormattingOptions options = System.Base64FormattingOptions.None) { throw null; }
public static bool ToBoolean(bool value) { throw null; }
public static bool ToBoolean(byte value) { throw null; }
public static bool ToBoolean(char value) { throw null; }
public static bool ToBoolean(System.DateTime value) { throw null; }
public static bool ToBoolean(decimal value) { throw null; }
public static bool ToBoolean(double value) { throw null; }
public static bool ToBoolean(short value) { throw null; }
public static bool ToBoolean(int value) { throw null; }
public static bool ToBoolean(long value) { throw null; }
public static bool ToBoolean([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static bool ToBoolean([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool ToBoolean(sbyte value) { throw null; }
public static bool ToBoolean(float value) { throw null; }
public static bool ToBoolean([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value) { throw null; }
public static bool ToBoolean([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool ToBoolean(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool ToBoolean(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool ToBoolean(ulong value) { throw null; }
public static byte ToByte(bool value) { throw null; }
public static byte ToByte(byte value) { throw null; }
public static byte ToByte(char value) { throw null; }
public static byte ToByte(System.DateTime value) { throw null; }
public static byte ToByte(decimal value) { throw null; }
public static byte ToByte(double value) { throw null; }
public static byte ToByte(short value) { throw null; }
public static byte ToByte(int value) { throw null; }
public static byte ToByte(long value) { throw null; }
public static byte ToByte(object? value) { throw null; }
public static byte ToByte(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte ToByte(sbyte value) { throw null; }
public static byte ToByte(float value) { throw null; }
public static byte ToByte(string? value) { throw null; }
public static byte ToByte(string? value, System.IFormatProvider? provider) { throw null; }
public static byte ToByte(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte ToByte(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte ToByte(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte ToByte(ulong value) { throw null; }
public static char ToChar(bool value) { throw null; }
public static char ToChar(byte value) { throw null; }
public static char ToChar(char value) { throw null; }
public static char ToChar(System.DateTime value) { throw null; }
public static char ToChar(decimal value) { throw null; }
public static char ToChar(double value) { throw null; }
public static char ToChar(short value) { throw null; }
public static char ToChar(int value) { throw null; }
public static char ToChar(long value) { throw null; }
public static char ToChar(object? value) { throw null; }
public static char ToChar(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static char ToChar(sbyte value) { throw null; }
public static char ToChar(float value) { throw null; }
public static char ToChar(string value) { throw null; }
public static char ToChar(string value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static char ToChar(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static char ToChar(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static char ToChar(ulong value) { throw null; }
public static System.DateTime ToDateTime(bool value) { throw null; }
public static System.DateTime ToDateTime(byte value) { throw null; }
public static System.DateTime ToDateTime(char value) { throw null; }
public static System.DateTime ToDateTime(System.DateTime value) { throw null; }
public static System.DateTime ToDateTime(decimal value) { throw null; }
public static System.DateTime ToDateTime(double value) { throw null; }
public static System.DateTime ToDateTime(short value) { throw null; }
public static System.DateTime ToDateTime(int value) { throw null; }
public static System.DateTime ToDateTime(long value) { throw null; }
public static System.DateTime ToDateTime(object? value) { throw null; }
public static System.DateTime ToDateTime(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.DateTime ToDateTime(sbyte value) { throw null; }
public static System.DateTime ToDateTime(float value) { throw null; }
public static System.DateTime ToDateTime(string? value) { throw null; }
public static System.DateTime ToDateTime(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.DateTime ToDateTime(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.DateTime ToDateTime(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.DateTime ToDateTime(ulong value) { throw null; }
public static decimal ToDecimal(bool value) { throw null; }
public static decimal ToDecimal(byte value) { throw null; }
public static decimal ToDecimal(char value) { throw null; }
public static decimal ToDecimal(System.DateTime value) { throw null; }
public static decimal ToDecimal(decimal value) { throw null; }
public static decimal ToDecimal(double value) { throw null; }
public static decimal ToDecimal(short value) { throw null; }
public static decimal ToDecimal(int value) { throw null; }
public static decimal ToDecimal(long value) { throw null; }
public static decimal ToDecimal(object? value) { throw null; }
public static decimal ToDecimal(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static decimal ToDecimal(sbyte value) { throw null; }
public static decimal ToDecimal(float value) { throw null; }
public static decimal ToDecimal(string? value) { throw null; }
public static decimal ToDecimal(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static decimal ToDecimal(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static decimal ToDecimal(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static decimal ToDecimal(ulong value) { throw null; }
public static double ToDouble(bool value) { throw null; }
public static double ToDouble(byte value) { throw null; }
public static double ToDouble(char value) { throw null; }
public static double ToDouble(System.DateTime value) { throw null; }
public static double ToDouble(decimal value) { throw null; }
public static double ToDouble(double value) { throw null; }
public static double ToDouble(short value) { throw null; }
public static double ToDouble(int value) { throw null; }
public static double ToDouble(long value) { throw null; }
public static double ToDouble(object? value) { throw null; }
public static double ToDouble(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double ToDouble(sbyte value) { throw null; }
public static double ToDouble(float value) { throw null; }
public static double ToDouble(string? value) { throw null; }
public static double ToDouble(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double ToDouble(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double ToDouble(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double ToDouble(ulong value) { throw null; }
public static string ToHexString(byte[] inArray) { throw null; }
public static string ToHexString(byte[] inArray, int offset, int length) { throw null; }
public static string ToHexString(System.ReadOnlySpan<byte> bytes) { throw null; }
public static short ToInt16(bool value) { throw null; }
public static short ToInt16(byte value) { throw null; }
public static short ToInt16(char value) { throw null; }
public static short ToInt16(System.DateTime value) { throw null; }
public static short ToInt16(decimal value) { throw null; }
public static short ToInt16(double value) { throw null; }
public static short ToInt16(short value) { throw null; }
public static short ToInt16(int value) { throw null; }
public static short ToInt16(long value) { throw null; }
public static short ToInt16(object? value) { throw null; }
public static short ToInt16(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static short ToInt16(sbyte value) { throw null; }
public static short ToInt16(float value) { throw null; }
public static short ToInt16(string? value) { throw null; }
public static short ToInt16(string? value, System.IFormatProvider? provider) { throw null; }
public static short ToInt16(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static short ToInt16(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static short ToInt16(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static short ToInt16(ulong value) { throw null; }
public static int ToInt32(bool value) { throw null; }
public static int ToInt32(byte value) { throw null; }
public static int ToInt32(char value) { throw null; }
public static int ToInt32(System.DateTime value) { throw null; }
public static int ToInt32(decimal value) { throw null; }
public static int ToInt32(double value) { throw null; }
public static int ToInt32(short value) { throw null; }
public static int ToInt32(int value) { throw null; }
public static int ToInt32(long value) { throw null; }
public static int ToInt32(object? value) { throw null; }
public static int ToInt32(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int ToInt32(sbyte value) { throw null; }
public static int ToInt32(float value) { throw null; }
public static int ToInt32(string? value) { throw null; }
public static int ToInt32(string? value, System.IFormatProvider? provider) { throw null; }
public static int ToInt32(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int ToInt32(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int ToInt32(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int ToInt32(ulong value) { throw null; }
public static long ToInt64(bool value) { throw null; }
public static long ToInt64(byte value) { throw null; }
public static long ToInt64(char value) { throw null; }
public static long ToInt64(System.DateTime value) { throw null; }
public static long ToInt64(decimal value) { throw null; }
public static long ToInt64(double value) { throw null; }
public static long ToInt64(short value) { throw null; }
public static long ToInt64(int value) { throw null; }
public static long ToInt64(long value) { throw null; }
public static long ToInt64(object? value) { throw null; }
public static long ToInt64(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static long ToInt64(sbyte value) { throw null; }
public static long ToInt64(float value) { throw null; }
public static long ToInt64(string? value) { throw null; }
public static long ToInt64(string? value, System.IFormatProvider? provider) { throw null; }
public static long ToInt64(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static long ToInt64(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static long ToInt64(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static long ToInt64(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(bool value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(byte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(System.DateTime value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(short value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(string? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(string value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(ulong value) { throw null; }
public static float ToSingle(bool value) { throw null; }
public static float ToSingle(byte value) { throw null; }
public static float ToSingle(char value) { throw null; }
public static float ToSingle(System.DateTime value) { throw null; }
public static float ToSingle(decimal value) { throw null; }
public static float ToSingle(double value) { throw null; }
public static float ToSingle(short value) { throw null; }
public static float ToSingle(int value) { throw null; }
public static float ToSingle(long value) { throw null; }
public static float ToSingle(object? value) { throw null; }
public static float ToSingle(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float ToSingle(sbyte value) { throw null; }
public static float ToSingle(float value) { throw null; }
public static float ToSingle(string? value) { throw null; }
public static float ToSingle(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float ToSingle(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float ToSingle(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float ToSingle(ulong value) { throw null; }
public static string ToString(bool value) { throw null; }
public static string ToString(bool value, System.IFormatProvider? provider) { throw null; }
public static string ToString(byte value) { throw null; }
public static string ToString(byte value, System.IFormatProvider? provider) { throw null; }
public static string ToString(byte value, int toBase) { throw null; }
public static string ToString(char value) { throw null; }
public static string ToString(char value, System.IFormatProvider? provider) { throw null; }
public static string ToString(System.DateTime value) { throw null; }
public static string ToString(System.DateTime value, System.IFormatProvider? provider) { throw null; }
public static string ToString(decimal value) { throw null; }
public static string ToString(decimal value, System.IFormatProvider? provider) { throw null; }
public static string ToString(double value) { throw null; }
public static string ToString(double value, System.IFormatProvider? provider) { throw null; }
public static string ToString(short value) { throw null; }
public static string ToString(short value, System.IFormatProvider? provider) { throw null; }
public static string ToString(short value, int toBase) { throw null; }
public static string ToString(int value) { throw null; }
public static string ToString(int value, System.IFormatProvider? provider) { throw null; }
public static string ToString(int value, int toBase) { throw null; }
public static string ToString(long value) { throw null; }
public static string ToString(long value, System.IFormatProvider? provider) { throw null; }
public static string ToString(long value, int toBase) { throw null; }
public static string? ToString(object? value) { throw null; }
public static string? ToString(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(sbyte value, System.IFormatProvider? provider) { throw null; }
public static string ToString(float value) { throw null; }
public static string ToString(float value, System.IFormatProvider? provider) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? ToString(string? value) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? ToString(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(ushort value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(uint value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(ulong value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(bool value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(byte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(System.DateTime value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(short value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(string? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(bool value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(byte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(System.DateTime value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(short value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(string? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(bool value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(byte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(System.DateTime value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(short value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(string? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(ulong value) { throw null; }
public static bool TryFromBase64Chars(System.ReadOnlySpan<char> chars, System.Span<byte> bytes, out int bytesWritten) { throw null; }
public static bool TryFromBase64String(string s, System.Span<byte> bytes, out int bytesWritten) { throw null; }
public static bool TryToBase64Chars(System.ReadOnlySpan<byte> bytes, System.Span<char> chars, out int charsWritten, System.Base64FormattingOptions options = System.Base64FormattingOptions.None) { throw null; }
}
public delegate TOutput Converter<in TInput, out TOutput>(TInput input);
public readonly partial struct DateOnly : System.IComparable, System.IComparable<System.DateOnly>, System.IEquatable<System.DateOnly>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IComparisonOperators<DateOnly, DateOnly>,
System.IMinMaxValue<DateOnly>,
System.ISpanParseable<DateOnly>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
public static DateOnly MinValue { get { throw null; } }
public static DateOnly MaxValue { get { throw null; } }
public DateOnly(int year, int month, int day) { throw null; }
public DateOnly(int year, int month, int day, System.Globalization.Calendar calendar) { throw null; }
public static DateOnly FromDayNumber(int dayNumber) { throw null; }
public int Year { get { throw null; } }
public int Month { get { throw null; } }
public int Day { get { throw null; } }
public System.DayOfWeek DayOfWeek { get { throw null; } }
public int DayOfYear { get { throw null; } }
public int DayNumber { get { throw null; } }
public System.DateOnly AddDays(int value) { throw null; }
public System.DateOnly AddMonths(int value) { throw null; }
public System.DateOnly AddYears(int value) { throw null; }
public static bool operator ==(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator >(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator >=(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator !=(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator <(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator <=(System.DateOnly left, System.DateOnly right) { throw null; }
public System.DateTime ToDateTime(System.TimeOnly time) { throw null; }
public System.DateTime ToDateTime(System.TimeOnly time, System.DateTimeKind kind) { throw null; }
public static System.DateOnly FromDateTime(System.DateTime dateTime) { throw null; }
public int CompareTo(System.DateOnly value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.DateOnly value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public static System.DateOnly Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly ParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, System.IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly ParseExact(System.ReadOnlySpan<char> s, string[] formats) { throw null; }
public static System.DateOnly ParseExact(System.ReadOnlySpan<char> s, string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly Parse(string s) { throw null; }
public static System.DateOnly Parse(string s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly ParseExact(string s, string format) { throw null; }
public static System.DateOnly ParseExact(string s, string format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly ParseExact(string s, string[] formats) { throw null; }
public static System.DateOnly ParseExact(string s, string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.DateOnly result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, out System.DateOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, out System.DateOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.DateOnly result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, out System.DateOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, out System.DateOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public string ToLongDateString() { throw null; }
public string ToShortDateString() { throw null; }
public override string ToString() { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateOnly IMinMaxValue<System.DateOnly>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateOnly IMinMaxValue<System.DateOnly>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateOnly, System.DateOnly>.operator <(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateOnly, System.DateOnly>.operator <=(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateOnly, System.DateOnly>.operator >(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateOnly, System.DateOnly>.operator >=(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateOnly, System.DateOnly>.operator ==(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateOnly, System.DateOnly>.operator !=(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateOnly IParseable<System.DateOnly>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.DateOnly>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.DateOnly result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateOnly ISpanParseable<System.DateOnly>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.DateOnly>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.DateOnly result) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct DateTime : System.IComparable, System.IComparable<System.DateTime>, System.IConvertible, System.IEquatable<System.DateTime>, System.ISpanFormattable, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IAdditionOperators<System.DateTime, System.TimeSpan, System.DateTime>,
System.IAdditiveIdentity<System.DateTime, System.TimeSpan>,
System.IComparisonOperators<System.DateTime, System.DateTime>,
System.IMinMaxValue<System.DateTime>,
System.ISpanParseable<System.DateTime>,
System.ISubtractionOperators<System.DateTime, System.TimeSpan, System.DateTime>,
System.ISubtractionOperators<System.DateTime, System.DateTime, System.TimeSpan>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.DateTime MaxValue;
public static readonly System.DateTime MinValue;
public static readonly System.DateTime UnixEpoch;
public DateTime(int year, int month, int day) { throw null; }
public DateTime(int year, int month, int day, System.Globalization.Calendar calendar) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, System.DateTimeKind kind) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, System.Globalization.Calendar calendar) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, System.DateTimeKind kind) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, System.Globalization.Calendar calendar) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, System.Globalization.Calendar calendar, System.DateTimeKind kind) { throw null; }
public DateTime(long ticks) { throw null; }
public DateTime(long ticks, System.DateTimeKind kind) { throw null; }
public System.DateTime Date { get { throw null; } }
public int Day { get { throw null; } }
public System.DayOfWeek DayOfWeek { get { throw null; } }
public int DayOfYear { get { throw null; } }
public int Hour { get { throw null; } }
public System.DateTimeKind Kind { get { throw null; } }
public int Millisecond { get { throw null; } }
public int Minute { get { throw null; } }
public int Month { get { throw null; } }
public static System.DateTime Now { get { throw null; } }
public int Second { get { throw null; } }
public long Ticks { get { throw null; } }
public System.TimeSpan TimeOfDay { get { throw null; } }
public static System.DateTime Today { get { throw null; } }
public static System.DateTime UtcNow { get { throw null; } }
public int Year { get { throw null; } }
public System.DateTime Add(System.TimeSpan value) { throw null; }
public System.DateTime AddDays(double value) { throw null; }
public System.DateTime AddHours(double value) { throw null; }
public System.DateTime AddMilliseconds(double value) { throw null; }
public System.DateTime AddMinutes(double value) { throw null; }
public System.DateTime AddMonths(int months) { throw null; }
public System.DateTime AddSeconds(double value) { throw null; }
public System.DateTime AddTicks(long value) { throw null; }
public System.DateTime AddYears(int value) { throw null; }
public static int Compare(System.DateTime t1, System.DateTime t2) { throw null; }
public int CompareTo(System.DateTime value) { throw null; }
public int CompareTo(object? value) { throw null; }
public static int DaysInMonth(int year, int month) { throw null; }
public bool Equals(System.DateTime value) { throw null; }
public static bool Equals(System.DateTime t1, System.DateTime t2) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static System.DateTime FromBinary(long dateData) { throw null; }
public static System.DateTime FromFileTime(long fileTime) { throw null; }
public static System.DateTime FromFileTimeUtc(long fileTime) { throw null; }
public static System.DateTime FromOADate(double d) { throw null; }
public string[] GetDateTimeFormats() { throw null; }
public string[] GetDateTimeFormats(char format) { throw null; }
public string[] GetDateTimeFormats(char format, System.IFormatProvider? provider) { throw null; }
public string[] GetDateTimeFormats(System.IFormatProvider? provider) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public bool IsDaylightSavingTime() { throw null; }
public static bool IsLeapYear(int year) { throw null; }
public static System.DateTime operator +(System.DateTime d, System.TimeSpan t) { throw null; }
public static bool operator ==(System.DateTime d1, System.DateTime d2) { throw null; }
public static bool operator >(System.DateTime t1, System.DateTime t2) { throw null; }
public static bool operator >=(System.DateTime t1, System.DateTime t2) { throw null; }
public static bool operator !=(System.DateTime d1, System.DateTime d2) { throw null; }
public static bool operator <(System.DateTime t1, System.DateTime t2) { throw null; }
public static bool operator <=(System.DateTime t1, System.DateTime t2) { throw null; }
public static System.TimeSpan operator -(System.DateTime d1, System.DateTime d2) { throw null; }
public static System.DateTime operator -(System.DateTime d, System.TimeSpan t) { throw null; }
public static System.DateTime Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider = null, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTime Parse(string s) { throw null; }
public static System.DateTime Parse(string s, System.IFormatProvider? provider) { throw null; }
public static System.DateTime Parse(string s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles styles) { throw null; }
public static System.DateTime ParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTime ParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTime ParseExact(string s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string format, System.IFormatProvider? provider) { throw null; }
public static System.DateTime ParseExact(string s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style) { throw null; }
public static System.DateTime ParseExact(string s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style) { throw null; }
public static System.DateTime SpecifyKind(System.DateTime value, System.DateTimeKind kind) { throw null; }
public System.TimeSpan Subtract(System.DateTime value) { throw null; }
public System.DateTime Subtract(System.TimeSpan value) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public long ToBinary() { throw null; }
public long ToFileTime() { throw null; }
public long ToFileTimeUtc() { throw null; }
public System.DateTime ToLocalTime() { throw null; }
public string ToLongDateString() { throw null; }
public string ToLongTimeString() { throw null; }
public double ToOADate() { throw null; }
public string ToShortDateString() { throw null; }
public string ToShortTimeString() { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format) { throw null; }
public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format, System.IFormatProvider? provider) { throw null; }
public System.DateTime ToUniversalTime() { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.DateTime result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles styles, out System.DateTime result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.DateTime result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles styles, out System.DateTime result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateTime result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateTime result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateTime result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateTime result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IAdditiveIdentity<System.DateTime, System.TimeSpan>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime IMinMaxValue<System.DateTime>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime IMinMaxValue<System.DateTime>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime IAdditionOperators<System.DateTime, System.TimeSpan, System.DateTime>.operator +(System.DateTime left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTime, System.DateTime>.operator <(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTime, System.DateTime>.operator <=(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTime, System.DateTime>.operator >(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTime, System.DateTime>.operator >=(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateTime, System.DateTime>.operator ==(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateTime, System.DateTime>.operator !=(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime IParseable<System.DateTime>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.DateTime>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.DateTime result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime ISpanParseable<System.DateTime>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.DateTime>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.DateTime result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime ISubtractionOperators<System.DateTime, System.TimeSpan, System.DateTime>.operator -(System.DateTime left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISubtractionOperators<System.DateTime, System.DateTime, System.TimeSpan>.operator -(System.DateTime left, System.DateTime right) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public enum DateTimeKind
{
Unspecified = 0,
Utc = 1,
Local = 2,
}
public readonly partial struct DateTimeOffset : System.IComparable, System.IComparable<System.DateTimeOffset>, System.IEquatable<System.DateTimeOffset>, System.ISpanFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IAdditionOperators<System.DateTimeOffset, System.TimeSpan, System.DateTimeOffset>,
System.IAdditiveIdentity<System.DateTimeOffset, System.TimeSpan>,
System.IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>,
System.IMinMaxValue<System.DateTimeOffset>, System.ISpanParseable<System.DateTimeOffset>,
System.ISubtractionOperators<System.DateTimeOffset, System.TimeSpan, System.DateTimeOffset>,
System.ISubtractionOperators<System.DateTimeOffset, System.DateTimeOffset, System.TimeSpan>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.DateTimeOffset MaxValue;
public static readonly System.DateTimeOffset MinValue;
public static readonly System.DateTimeOffset UnixEpoch;
public DateTimeOffset(System.DateTime dateTime) { throw null; }
public DateTimeOffset(System.DateTime dateTime, System.TimeSpan offset) { throw null; }
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, System.Globalization.Calendar calendar, System.TimeSpan offset) { throw null; }
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, System.TimeSpan offset) { throw null; }
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, System.TimeSpan offset) { throw null; }
public DateTimeOffset(long ticks, System.TimeSpan offset) { throw null; }
public System.DateTime Date { get { throw null; } }
public System.DateTime DateTime { get { throw null; } }
public int Day { get { throw null; } }
public System.DayOfWeek DayOfWeek { get { throw null; } }
public int DayOfYear { get { throw null; } }
public int Hour { get { throw null; } }
public System.DateTime LocalDateTime { get { throw null; } }
public int Millisecond { get { throw null; } }
public int Minute { get { throw null; } }
public int Month { get { throw null; } }
public static System.DateTimeOffset Now { get { throw null; } }
public System.TimeSpan Offset { get { throw null; } }
public int Second { get { throw null; } }
public long Ticks { get { throw null; } }
public System.TimeSpan TimeOfDay { get { throw null; } }
public System.DateTime UtcDateTime { get { throw null; } }
public static System.DateTimeOffset UtcNow { get { throw null; } }
public long UtcTicks { get { throw null; } }
public int Year { get { throw null; } }
public System.DateTimeOffset Add(System.TimeSpan timeSpan) { throw null; }
public System.DateTimeOffset AddDays(double days) { throw null; }
public System.DateTimeOffset AddHours(double hours) { throw null; }
public System.DateTimeOffset AddMilliseconds(double milliseconds) { throw null; }
public System.DateTimeOffset AddMinutes(double minutes) { throw null; }
public System.DateTimeOffset AddMonths(int months) { throw null; }
public System.DateTimeOffset AddSeconds(double seconds) { throw null; }
public System.DateTimeOffset AddTicks(long ticks) { throw null; }
public System.DateTimeOffset AddYears(int years) { throw null; }
public static int Compare(System.DateTimeOffset first, System.DateTimeOffset second) { throw null; }
public int CompareTo(System.DateTimeOffset other) { throw null; }
public bool Equals(System.DateTimeOffset other) { throw null; }
public static bool Equals(System.DateTimeOffset first, System.DateTimeOffset second) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool EqualsExact(System.DateTimeOffset other) { throw null; }
public static System.DateTimeOffset FromFileTime(long fileTime) { throw null; }
public static System.DateTimeOffset FromUnixTimeMilliseconds(long milliseconds) { throw null; }
public static System.DateTimeOffset FromUnixTimeSeconds(long seconds) { throw null; }
public override int GetHashCode() { throw null; }
public static System.DateTimeOffset operator +(System.DateTimeOffset dateTimeOffset, System.TimeSpan timeSpan) { throw null; }
public static bool operator ==(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static bool operator >(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static bool operator >=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static implicit operator System.DateTimeOffset (System.DateTime dateTime) { throw null; }
public static bool operator !=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static bool operator <(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static bool operator <=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static System.TimeSpan operator -(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static System.DateTimeOffset operator -(System.DateTimeOffset dateTimeOffset, System.TimeSpan timeSpan) { throw null; }
public static System.DateTimeOffset Parse(System.ReadOnlySpan<char> input, System.IFormatProvider? formatProvider = null, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTimeOffset Parse(string input) { throw null; }
public static System.DateTimeOffset Parse(string input, System.IFormatProvider? formatProvider) { throw null; }
public static System.DateTimeOffset Parse(string input, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles) { throw null; }
public static System.DateTimeOffset ParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTimeOffset ParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string[] formats, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTimeOffset ParseExact(string input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string format, System.IFormatProvider? formatProvider) { throw null; }
public static System.DateTimeOffset ParseExact(string input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string format, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles) { throw null; }
public static System.DateTimeOffset ParseExact(string input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string[] formats, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles) { throw null; }
public System.TimeSpan Subtract(System.DateTimeOffset value) { throw null; }
public System.DateTimeOffset Subtract(System.TimeSpan value) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public long ToFileTime() { throw null; }
public System.DateTimeOffset ToLocalTime() { throw null; }
public System.DateTimeOffset ToOffset(System.TimeSpan offset) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? formatProvider) { throw null; }
public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format) { throw null; }
public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format, System.IFormatProvider? formatProvider) { throw null; }
public System.DateTimeOffset ToUniversalTime() { throw null; }
public long ToUnixTimeMilliseconds() { throw null; }
public long ToUnixTimeSeconds() { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? formatProvider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, out System.DateTimeOffset result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, out System.DateTimeOffset result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string?[]? formats, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string?[]? formats, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IAdditiveIdentity<System.DateTimeOffset, System.TimeSpan>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset IMinMaxValue<System.DateTimeOffset>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset IMinMaxValue<System.DateTimeOffset>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset IAdditionOperators<System.DateTimeOffset, System.TimeSpan, System.DateTimeOffset>.operator +(System.DateTimeOffset left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>.operator <(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>.operator <=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>.operator >(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>.operator >=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateTimeOffset, System.DateTimeOffset>.operator ==(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateTimeOffset, System.DateTimeOffset>.operator !=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset IParseable<System.DateTimeOffset>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.DateTimeOffset>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.DateTimeOffset result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset ISpanParseable<System.DateTimeOffset>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.DateTimeOffset>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.DateTimeOffset result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset ISubtractionOperators<System.DateTimeOffset, System.TimeSpan, System.DateTimeOffset>.operator -(System.DateTimeOffset left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISubtractionOperators<System.DateTimeOffset, System.DateTimeOffset, System.TimeSpan>.operator -(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public enum DayOfWeek
{
Sunday = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
}
public sealed partial class DBNull : System.IConvertible, System.Runtime.Serialization.ISerializable
{
internal DBNull() { }
public static readonly System.DBNull Value;
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public System.TypeCode GetTypeCode() { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
}
public readonly partial struct Decimal : System.IComparable, System.IComparable<decimal>, System.IConvertible, System.IEquatable<decimal>, System.ISpanFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IMinMaxValue<decimal>,
System.ISignedNumber<decimal>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)0, (uint)4294967295, (uint)4294967295, (uint)4294967295)]
public static readonly decimal MaxValue;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)128, (uint)0, (uint)0, (uint)1)]
public static readonly decimal MinusOne;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)128, (uint)4294967295, (uint)4294967295, (uint)4294967295)]
public static readonly decimal MinValue;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)0, (uint)0, (uint)0, (uint)1)]
public static readonly decimal One;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)0, (uint)0, (uint)0, (uint)0)]
public static readonly decimal Zero;
public Decimal(double value) { throw null; }
public Decimal(int value) { throw null; }
public Decimal(int lo, int mid, int hi, bool isNegative, byte scale) { throw null; }
public Decimal(int[] bits) { throw null; }
public Decimal(long value) { throw null; }
public Decimal(System.ReadOnlySpan<int> bits) { throw null; }
public Decimal(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public Decimal(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public Decimal(ulong value) { throw null; }
public static System.Decimal Add(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal Ceiling(System.Decimal d) { throw null; }
public static int Compare(System.Decimal d1, System.Decimal d2) { throw null; }
public int CompareTo(System.Decimal value) { throw null; }
public int CompareTo(object? value) { throw null; }
public static System.Decimal Divide(System.Decimal d1, System.Decimal d2) { throw null; }
public bool Equals(System.Decimal value) { throw null; }
public static bool Equals(System.Decimal d1, System.Decimal d2) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static System.Decimal Floor(System.Decimal d) { throw null; }
public static System.Decimal FromOACurrency(long cy) { throw null; }
public static int[] GetBits(System.Decimal d) { throw null; }
public static int GetBits(System.Decimal d, System.Span<int> destination) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Decimal Multiply(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal Negate(System.Decimal d) { throw null; }
public static System.Decimal operator +(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator --(System.Decimal d) { throw null; }
public static System.Decimal operator /(System.Decimal d1, System.Decimal d2) { throw null; }
public static bool operator ==(System.Decimal d1, System.Decimal d2) { throw null; }
public static explicit operator byte (System.Decimal value) { throw null; }
public static explicit operator char (System.Decimal value) { throw null; }
public static explicit operator double (System.Decimal value) { throw null; }
public static explicit operator short (System.Decimal value) { throw null; }
public static explicit operator int (System.Decimal value) { throw null; }
public static explicit operator long (System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator sbyte (System.Decimal value) { throw null; }
public static explicit operator float (System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator ushort (System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator uint (System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator ulong (System.Decimal value) { throw null; }
public static explicit operator System.Decimal (double value) { throw null; }
public static explicit operator System.Decimal (float value) { throw null; }
public static bool operator >(System.Decimal d1, System.Decimal d2) { throw null; }
public static bool operator >=(System.Decimal d1, System.Decimal d2) { throw null; }
public static implicit operator System.Decimal (byte value) { throw null; }
public static implicit operator System.Decimal (char value) { throw null; }
public static implicit operator System.Decimal (short value) { throw null; }
public static implicit operator System.Decimal (int value) { throw null; }
public static implicit operator System.Decimal (long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Decimal (sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Decimal (ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Decimal (uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Decimal (ulong value) { throw null; }
public static System.Decimal operator ++(System.Decimal d) { throw null; }
public static bool operator !=(System.Decimal d1, System.Decimal d2) { throw null; }
public static bool operator <(System.Decimal d1, System.Decimal d2) { throw null; }
public static bool operator <=(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator %(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator *(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator -(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator -(System.Decimal d) { throw null; }
public static System.Decimal operator +(System.Decimal d) { throw null; }
public static System.Decimal Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Number, System.IFormatProvider? provider = null) { throw null; }
public static System.Decimal Parse(string s) { throw null; }
public static System.Decimal Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Decimal Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Decimal Parse(string s, System.IFormatProvider? provider) { throw null; }
public static System.Decimal Remainder(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal Round(System.Decimal d) { throw null; }
public static System.Decimal Round(System.Decimal d, int decimals) { throw null; }
public static System.Decimal Round(System.Decimal d, int decimals, System.MidpointRounding mode) { throw null; }
public static System.Decimal Round(System.Decimal d, System.MidpointRounding mode) { throw null; }
public static System.Decimal Subtract(System.Decimal d1, System.Decimal d2) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
System.Decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static byte ToByte(System.Decimal value) { throw null; }
public static double ToDouble(System.Decimal d) { throw null; }
public static short ToInt16(System.Decimal value) { throw null; }
public static int ToInt32(System.Decimal d) { throw null; }
public static long ToInt64(System.Decimal d) { throw null; }
public static long ToOACurrency(System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(System.Decimal value) { throw null; }
public static float ToSingle(System.Decimal d) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(System.Decimal d) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(System.Decimal d) { throw null; }
public static System.Decimal Truncate(System.Decimal d) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryGetBits(System.Decimal d, System.Span<int> destination, out int valuesWritten) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Decimal result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Decimal result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Decimal result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Decimal result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IAdditiveIdentity<decimal, decimal>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IMinMaxValue<decimal>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IMinMaxValue<decimal>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IMultiplicativeIdentity<decimal, decimal>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IAdditionOperators<decimal, decimal, decimal>.operator +(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<decimal, decimal>.operator <(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<decimal, decimal>.operator <=(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<decimal, decimal>.operator >(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<decimal, decimal>.operator >=(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IDecrementOperators<decimal>.operator --(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IDivisionOperators<decimal, decimal, decimal>.operator /(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<decimal, decimal>.operator ==(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<decimal, decimal>.operator !=(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IIncrementOperators<decimal>.operator ++(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IModulusOperators<decimal, decimal, decimal>.operator %(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IMultiplyOperators<decimal, decimal, decimal>.operator *(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Abs(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Clamp(decimal value, decimal min, decimal max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (decimal Quotient, decimal Remainder) INumber<decimal>.DivRem(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Max(decimal x, decimal y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Min(decimal x, decimal y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Sign(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<decimal>.TryCreate<TOther>(TOther value, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<decimal>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<decimal>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IParseable<decimal>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<decimal>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal ISignedNumber<decimal>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal ISpanParseable<decimal>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<decimal>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal ISubtractionOperators<decimal, decimal, decimal>.operator -(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IUnaryNegationOperators<decimal, decimal>.operator -(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IUnaryPlusOperators<decimal, decimal>.operator +(decimal value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public abstract partial class Delegate : System.ICloneable, System.Runtime.Serialization.ISerializable
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
protected Delegate(object target, string method) { }
protected Delegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method) { }
public System.Reflection.MethodInfo Method { get { throw null; } }
public object? Target { get { throw null; } }
public virtual object Clone() { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("a")]
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("b")]
public static System.Delegate? Combine(System.Delegate? a, System.Delegate? b) { throw null; }
public static System.Delegate? Combine(params System.Delegate?[]? delegates) { throw null; }
protected virtual System.Delegate CombineImpl(System.Delegate? d) { throw null; }
public static System.Delegate CreateDelegate(System.Type type, object? firstArgument, System.Reflection.MethodInfo method) { throw null; }
public static System.Delegate? CreateDelegate(System.Type type, object? firstArgument, System.Reflection.MethodInfo method, bool throwOnBindFailure) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
public static System.Delegate CreateDelegate(System.Type type, object target, string method) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
public static System.Delegate CreateDelegate(System.Type type, object target, string method, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
public static System.Delegate? CreateDelegate(System.Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure) { throw null; }
public static System.Delegate CreateDelegate(System.Type type, System.Reflection.MethodInfo method) { throw null; }
public static System.Delegate? CreateDelegate(System.Type type, System.Reflection.MethodInfo method, bool throwOnBindFailure) { throw null; }
public static System.Delegate CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method) { throw null; }
public static System.Delegate CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method, bool ignoreCase) { throw null; }
public static System.Delegate? CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method, bool ignoreCase, bool throwOnBindFailure) { throw null; }
public object? DynamicInvoke(params object?[]? args) { throw null; }
protected virtual object? DynamicInvokeImpl(object?[]? args) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public virtual System.Delegate[] GetInvocationList() { throw null; }
protected virtual System.Reflection.MethodInfo GetMethodImpl() { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(System.Delegate? d1, System.Delegate? d2) { throw null; }
public static bool operator !=(System.Delegate? d1, System.Delegate? d2) { throw null; }
public static System.Delegate? Remove(System.Delegate? source, System.Delegate? value) { throw null; }
public static System.Delegate? RemoveAll(System.Delegate? source, System.Delegate? value) { throw null; }
protected virtual System.Delegate? RemoveImpl(System.Delegate d) { throw null; }
}
public partial class DivideByZeroException : System.ArithmeticException
{
public DivideByZeroException() { }
protected DivideByZeroException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public DivideByZeroException(string? message) { }
public DivideByZeroException(string? message, System.Exception? innerException) { }
}
public readonly partial struct Double : System.IComparable, System.IComparable<double>, System.IConvertible, System.IEquatable<double>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryFloatingPoint<double>,
System.IMinMaxValue<double>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly double _dummyPrimitive;
public const double Epsilon = 5E-324;
public const double MaxValue = 1.7976931348623157E+308;
public const double MinValue = -1.7976931348623157E+308;
public const double NaN = 0.0 / 0.0;
public const double NegativeInfinity = -1.0 / 0.0;
public const double PositiveInfinity = 1.0 / 0.0;
public int CompareTo(System.Double value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Double obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static bool IsFinite(System.Double d) { throw null; }
public static bool IsInfinity(System.Double d) { throw null; }
public static bool IsNaN(System.Double d) { throw null; }
public static bool IsNegative(System.Double d) { throw null; }
public static bool IsNegativeInfinity(System.Double d) { throw null; }
public static bool IsNormal(System.Double d) { throw null; }
public static bool IsPositiveInfinity(System.Double d) { throw null; }
public static bool IsSubnormal(System.Double d) { throw null; }
public static bool operator ==(System.Double left, System.Double right) { throw null; }
public static bool operator >(System.Double left, System.Double right) { throw null; }
public static bool operator >=(System.Double left, System.Double right) { throw null; }
public static bool operator !=(System.Double left, System.Double right) { throw null; }
public static bool operator <(System.Double left, System.Double right) { throw null; }
public static bool operator <=(System.Double left, System.Double right) { throw null; }
public static System.Double Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; }
public static System.Double Parse(string s) { throw null; }
public static System.Double Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Double Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Double Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
System.Double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Double result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Double result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Double result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Double result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IAdditiveIdentity<double, double>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.E { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Epsilon { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.NaN { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.NegativeInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.NegativeZero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Pi { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.PositiveInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Tau { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMinMaxValue<double>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMinMaxValue<double>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMultiplicativeIdentity<double, double>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IAdditionOperators<double, double, double>.operator +(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<double>.IsPow2(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBinaryNumber<double>.Log2(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBitwiseOperators<double, double, double>.operator &(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBitwiseOperators<double, double, double>.operator |(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBitwiseOperators<double, double, double>.operator ^(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBitwiseOperators<double, double, double>.operator ~(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<double, double>.operator <(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<double, double>.operator <=(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<double, double>.operator >(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<double, double>.operator >=(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IDecrementOperators<double>.operator --(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IDivisionOperators<double, double, double>.operator /(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<double, double>.operator ==(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<double, double>.operator !=(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Acos(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Acosh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Asin(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Asinh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Atan(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Atan2(double y, double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Atanh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.BitIncrement(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.BitDecrement(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Cbrt(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Ceiling(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.CopySign(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Cos(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Cosh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Exp(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Floor(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.FusedMultiplyAdd(double left, double right, double addend) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.IEEERemainder(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static TInteger IFloatingPoint<double>.ILogB<TInteger>(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Log(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Log(double x, double newBase) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Log2(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Log10(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.MaxMagnitude(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.MinMagnitude(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Pow(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Round(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Round<TInteger>(double x, TInteger digits) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Round(double x, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Round<TInteger>(double x, TInteger digits, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.ScaleB<TInteger>(double x, TInteger n) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Sin(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Sinh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Sqrt(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Tan(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Tanh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Truncate(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsFinite(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsInfinity(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsNaN(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsNegative(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsNegativeInfinity(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsNormal(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsPositiveInfinity(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsSubnormal(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IIncrementOperators<double>.operator ++(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IModulusOperators<double, double, double>.operator %(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMultiplyOperators<double, double, double>.operator *(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Abs(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Clamp(double value, double min, double max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (double Quotient, double Remainder) INumber<double>.DivRem(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Max(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Min(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Sign(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<double>.TryCreate<TOther>(TOther value, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<double>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<double>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IParseable<double>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<double>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double ISignedNumber<double>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double ISpanParseable<double>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<double>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double ISubtractionOperators<double, double, double>.operator -(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IUnaryNegationOperators<double, double>.operator -(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IUnaryPlusOperators<double, double>.operator +(double value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial class DuplicateWaitObjectException : System.ArgumentException
{
public DuplicateWaitObjectException() { }
protected DuplicateWaitObjectException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public DuplicateWaitObjectException(string? parameterName) { }
public DuplicateWaitObjectException(string? message, System.Exception? innerException) { }
public DuplicateWaitObjectException(string? parameterName, string? message) { }
}
public partial class EntryPointNotFoundException : System.TypeLoadException
{
public EntryPointNotFoundException() { }
protected EntryPointNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public EntryPointNotFoundException(string? message) { }
public EntryPointNotFoundException(string? message, System.Exception? inner) { }
}
public abstract partial class Enum : System.ValueType, System.IComparable, System.IConvertible, System.IFormattable
{
protected Enum() { }
public int CompareTo(object? target) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public static string Format(System.Type enumType, object value, string format) { throw null; }
public override int GetHashCode() { throw null; }
public static string? GetName(System.Type enumType, object value) { throw null; }
public static string? GetName<TEnum>(TEnum value) where TEnum : struct, System.Enum { throw null; }
public static string[] GetNames(System.Type enumType) { throw null; }
public static string[] GetNames<TEnum>() where TEnum: struct, System.Enum { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Type GetUnderlyingType(System.Type enumType) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("It might not be possible to create an array of the enum type at runtime. Use the GetValues<TEnum> overload instead.")]
public static System.Array GetValues(System.Type enumType) { throw null; }
public static TEnum[] GetValues<TEnum>() where TEnum : struct, System.Enum { throw null; }
public bool HasFlag(System.Enum flag) { throw null; }
public static bool IsDefined(System.Type enumType, object value) { throw null; }
public static bool IsDefined<TEnum>(TEnum value) where TEnum : struct, System.Enum { throw null; }
public static object Parse(System.Type enumType, System.ReadOnlySpan<char> value) { throw null; }
public static object Parse(System.Type enumType, System.ReadOnlySpan<char> value, bool ignoreCase) { throw null; }
public static object Parse(System.Type enumType, string value) { throw null; }
public static object Parse(System.Type enumType, string value, bool ignoreCase) { throw null; }
public static TEnum Parse<TEnum>(System.ReadOnlySpan<char> value) where TEnum : struct { throw null; }
public static TEnum Parse<TEnum>(System.ReadOnlySpan<char> value, bool ignoreCase) where TEnum : struct { throw null; }
public static TEnum Parse<TEnum>(string value) where TEnum : struct { throw null; }
public static TEnum Parse<TEnum>(string value, bool ignoreCase) where TEnum : struct { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public static object ToObject(System.Type enumType, byte value) { throw null; }
public static object ToObject(System.Type enumType, short value) { throw null; }
public static object ToObject(System.Type enumType, int value) { throw null; }
public static object ToObject(System.Type enumType, long value) { throw null; }
public static object ToObject(System.Type enumType, object value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static object ToObject(System.Type enumType, sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static object ToObject(System.Type enumType, ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static object ToObject(System.Type enumType, uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static object ToObject(System.Type enumType, ulong value) { throw null; }
public override string ToString() { throw null; }
[System.ObsoleteAttribute("The provider argument is not used. Use ToString() instead.")]
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
[System.ObsoleteAttribute("The provider argument is not used. Use ToString(String) instead.")]
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public static bool TryParse(System.Type enumType, System.ReadOnlySpan<char> value, bool ignoreCase, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? result) { throw null; }
public static bool TryParse(System.Type enumType, System.ReadOnlySpan<char> value, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? result) { throw null; }
public static bool TryParse(System.Type enumType, string? value, bool ignoreCase, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? result) { throw null; }
public static bool TryParse(System.Type enumType, string? value, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? result) { throw null; }
public static bool TryParse<TEnum>(System.ReadOnlySpan<char> value, bool ignoreCase, out TEnum result) where TEnum : struct { throw null; }
public static bool TryParse<TEnum>(System.ReadOnlySpan<char> value, out TEnum result) where TEnum : struct { throw null; }
public static bool TryParse<TEnum>([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value, bool ignoreCase, out TEnum result) where TEnum : struct { throw null; }
public static bool TryParse<TEnum>([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value, out TEnum result) where TEnum : struct { throw null; }
}
public static partial class Environment
{
public static string CommandLine { get { throw null; } }
public static string CurrentDirectory { get { throw null; } set { } }
public static int CurrentManagedThreadId { get { throw null; } }
public static int ExitCode { get { throw null; } set { } }
public static bool HasShutdownStarted { get { throw null; } }
public static bool Is64BitOperatingSystem { get { throw null; } }
public static bool Is64BitProcess { get { throw null; } }
public static string MachineName { get { throw null; } }
public static string NewLine { get { throw null; } }
public static System.OperatingSystem OSVersion { get { throw null; } }
public static int ProcessId { get { throw null; } }
public static int ProcessorCount { get { throw null; } }
public static string? ProcessPath { get { throw null; } }
public static string StackTrace { get { throw null; } }
public static string SystemDirectory { get { throw null; } }
public static int SystemPageSize { get { throw null; } }
public static int TickCount { get { throw null; } }
public static long TickCount64 { get { throw null; } }
public static string UserDomainName { get { throw null; } }
public static bool UserInteractive { get { throw null; } }
public static string UserName { get { throw null; } }
public static System.Version Version { get { throw null; } }
public static long WorkingSet { get { throw null; } }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public static void Exit(int exitCode) { throw null; }
public static string ExpandEnvironmentVariables(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public static void FailFast(string? message) { throw null; }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public static void FailFast(string? message, System.Exception? exception) { throw null; }
public static string[] GetCommandLineArgs() { throw null; }
public static string? GetEnvironmentVariable(string variable) { throw null; }
public static string? GetEnvironmentVariable(string variable, System.EnvironmentVariableTarget target) { throw null; }
public static System.Collections.IDictionary GetEnvironmentVariables() { throw null; }
public static System.Collections.IDictionary GetEnvironmentVariables(System.EnvironmentVariableTarget target) { throw null; }
public static string GetFolderPath(System.Environment.SpecialFolder folder) { throw null; }
public static string GetFolderPath(System.Environment.SpecialFolder folder, System.Environment.SpecialFolderOption option) { throw null; }
public static string[] GetLogicalDrives() { throw null; }
public static void SetEnvironmentVariable(string variable, string? value) { }
public static void SetEnvironmentVariable(string variable, string? value, System.EnvironmentVariableTarget target) { }
public enum SpecialFolder
{
Desktop = 0,
Programs = 2,
MyDocuments = 5,
Personal = 5,
Favorites = 6,
Startup = 7,
Recent = 8,
SendTo = 9,
StartMenu = 11,
MyMusic = 13,
MyVideos = 14,
DesktopDirectory = 16,
MyComputer = 17,
NetworkShortcuts = 19,
Fonts = 20,
Templates = 21,
CommonStartMenu = 22,
CommonPrograms = 23,
CommonStartup = 24,
CommonDesktopDirectory = 25,
ApplicationData = 26,
PrinterShortcuts = 27,
LocalApplicationData = 28,
InternetCache = 32,
Cookies = 33,
History = 34,
CommonApplicationData = 35,
Windows = 36,
System = 37,
ProgramFiles = 38,
MyPictures = 39,
UserProfile = 40,
SystemX86 = 41,
ProgramFilesX86 = 42,
CommonProgramFiles = 43,
CommonProgramFilesX86 = 44,
CommonTemplates = 45,
CommonDocuments = 46,
CommonAdminTools = 47,
AdminTools = 48,
CommonMusic = 53,
CommonPictures = 54,
CommonVideos = 55,
Resources = 56,
LocalizedResources = 57,
CommonOemLinks = 58,
CDBurning = 59,
}
public enum SpecialFolderOption
{
None = 0,
DoNotVerify = 16384,
Create = 32768,
}
}
public enum EnvironmentVariableTarget
{
Process = 0,
User = 1,
Machine = 2,
}
public partial class EventArgs
{
public static readonly System.EventArgs Empty;
public EventArgs() { }
}
public delegate void EventHandler(object? sender, System.EventArgs e);
public delegate void EventHandler<TEventArgs>(object? sender, TEventArgs e);
public partial class Exception : System.Runtime.Serialization.ISerializable
{
public Exception() { }
protected Exception(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public Exception(string? message) { }
public Exception(string? message, System.Exception? innerException) { }
public virtual System.Collections.IDictionary Data { get { throw null; } }
public virtual string? HelpLink { get { throw null; } set { } }
public int HResult { get { throw null; } set { } }
public System.Exception? InnerException { get { throw null; } }
public virtual string Message { get { throw null; } }
public virtual string? Source { get { throw null; } set { } }
public virtual string? StackTrace { get { throw null; } }
public System.Reflection.MethodBase? TargetSite { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Metadata for the method might be incomplete or removed")] get { throw null; } }
[System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
protected event System.EventHandler<System.Runtime.Serialization.SafeSerializationEventArgs>? SerializeObjectState { add { } remove { } }
public virtual System.Exception GetBaseException() { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public new System.Type GetType() { throw null; }
public override string ToString() { throw null; }
}
[System.ObsoleteAttribute("ExecutionEngineException previously indicated an unspecified fatal error in the runtime. The runtime no longer raises this exception so this type is obsolete.")]
public sealed partial class ExecutionEngineException : System.SystemException
{
public ExecutionEngineException() { }
public ExecutionEngineException(string? message) { }
public ExecutionEngineException(string? message, System.Exception? innerException) { }
}
public partial class FieldAccessException : System.MemberAccessException
{
public FieldAccessException() { }
protected FieldAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public FieldAccessException(string? message) { }
public FieldAccessException(string? message, System.Exception? inner) { }
}
public partial class FileStyleUriParser : System.UriParser
{
public FileStyleUriParser() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Enum, Inherited=false)]
public partial class FlagsAttribute : System.Attribute
{
public FlagsAttribute() { }
}
public partial class FormatException : System.SystemException
{
public FormatException() { }
protected FormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public FormatException(string? message) { }
public FormatException(string? message, System.Exception? innerException) { }
}
public abstract partial class FormattableString : System.IFormattable
{
protected FormattableString() { }
public abstract int ArgumentCount { get; }
public abstract string Format { get; }
public static string CurrentCulture(System.FormattableString formattable) { throw null; }
public abstract object? GetArgument(int index);
public abstract object?[] GetArguments();
public static string Invariant(System.FormattableString formattable) { throw null; }
string System.IFormattable.ToString(string? ignored, System.IFormatProvider? formatProvider) { throw null; }
public override string ToString() { throw null; }
public abstract string ToString(System.IFormatProvider? formatProvider);
}
public partial class FtpStyleUriParser : System.UriParser
{
public FtpStyleUriParser() { }
}
public delegate TResult Func<out TResult>();
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16);
public delegate TResult Func<in T, out TResult>(T arg);
public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);
public delegate TResult Func<in T1, in T2, in T3, out TResult>(T1 arg1, T2 arg2, T3 arg3);
public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
public static partial class GC
{
public static int MaxGeneration { get { throw null; } }
public static void AddMemoryPressure(long bytesAllocated) { }
public static T[] AllocateArray<T>(int length, bool pinned = false) { throw null; }
public static T[] AllocateUninitializedArray<T>(int length, bool pinned = false) { throw null; }
public static void CancelFullGCNotification() { }
public static void Collect() { }
public static void Collect(int generation) { }
public static void Collect(int generation, System.GCCollectionMode mode) { }
public static void Collect(int generation, System.GCCollectionMode mode, bool blocking) { }
public static void Collect(int generation, System.GCCollectionMode mode, bool blocking, bool compacting) { }
public static int CollectionCount(int generation) { throw null; }
public static void EndNoGCRegion() { }
public static long GetAllocatedBytesForCurrentThread() { throw null; }
public static System.GCMemoryInfo GetGCMemoryInfo() { throw null; }
public static System.GCMemoryInfo GetGCMemoryInfo(System.GCKind kind) { throw null; }
public static int GetGeneration(object obj) { throw null; }
public static int GetGeneration(System.WeakReference wo) { throw null; }
public static long GetTotalAllocatedBytes(bool precise = false) { throw null; }
public static long GetTotalMemory(bool forceFullCollection) { throw null; }
public static void KeepAlive(object? obj) { }
public static void RegisterForFullGCNotification(int maxGenerationThreshold, int largeObjectHeapThreshold) { }
public static void RemoveMemoryPressure(long bytesAllocated) { }
public static void ReRegisterForFinalize(object obj) { }
public static void SuppressFinalize(object obj) { }
public static bool TryStartNoGCRegion(long totalSize) { throw null; }
public static bool TryStartNoGCRegion(long totalSize, bool disallowFullBlockingGC) { throw null; }
public static bool TryStartNoGCRegion(long totalSize, long lohSize) { throw null; }
public static bool TryStartNoGCRegion(long totalSize, long lohSize, bool disallowFullBlockingGC) { throw null; }
public static System.GCNotificationStatus WaitForFullGCApproach() { throw null; }
public static System.GCNotificationStatus WaitForFullGCApproach(int millisecondsTimeout) { throw null; }
public static System.GCNotificationStatus WaitForFullGCComplete() { throw null; }
public static System.GCNotificationStatus WaitForFullGCComplete(int millisecondsTimeout) { throw null; }
public static void WaitForPendingFinalizers() { }
}
public enum GCCollectionMode
{
Default = 0,
Forced = 1,
Optimized = 2,
}
public readonly partial struct GCGenerationInfo
{
private readonly int _dummyPrimitive;
public long FragmentationAfterBytes { get { throw null; } }
public long FragmentationBeforeBytes { get { throw null; } }
public long SizeAfterBytes { get { throw null; } }
public long SizeBeforeBytes { get { throw null; } }
}
public enum GCKind
{
Any = 0,
Ephemeral = 1,
FullBlocking = 2,
Background = 3,
}
public readonly partial struct GCMemoryInfo
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool Compacted { get { throw null; } }
public bool Concurrent { get { throw null; } }
public long FinalizationPendingCount { get { throw null; } }
public long FragmentedBytes { get { throw null; } }
public int Generation { get { throw null; } }
public System.ReadOnlySpan<System.GCGenerationInfo> GenerationInfo { get { throw null; } }
public long HeapSizeBytes { get { throw null; } }
public long HighMemoryLoadThresholdBytes { get { throw null; } }
public long Index { get { throw null; } }
public long MemoryLoadBytes { get { throw null; } }
public System.ReadOnlySpan<System.TimeSpan> PauseDurations { get { throw null; } }
public double PauseTimePercentage { get { throw null; } }
public long PinnedObjectsCount { get { throw null; } }
public long PromotedBytes { get { throw null; } }
public long TotalAvailableMemoryBytes { get { throw null; } }
public long TotalCommittedBytes { get { throw null; } }
}
public enum GCNotificationStatus
{
Succeeded = 0,
Failed = 1,
Canceled = 2,
Timeout = 3,
NotApplicable = 4,
}
public partial class GenericUriParser : System.UriParser
{
public GenericUriParser(System.GenericUriParserOptions options) { }
}
[System.FlagsAttribute]
public enum GenericUriParserOptions
{
Default = 0,
GenericAuthority = 1,
AllowEmptyAuthority = 2,
NoUserInfo = 4,
NoPort = 8,
NoQuery = 16,
NoFragment = 32,
DontConvertPathBackslashes = 64,
DontCompressPath = 128,
DontUnescapePathDotsAndSlashes = 256,
Idn = 512,
IriParsing = 1024,
}
public partial class GopherStyleUriParser : System.UriParser
{
public GopherStyleUriParser() { }
}
public readonly partial struct Guid : System.IComparable, System.IComparable<System.Guid>, System.IEquatable<System.Guid>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IComparisonOperators<System.Guid, System.Guid>,
System.ISpanParseable<System.Guid>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.Guid Empty;
public Guid(byte[] b) { throw null; }
public Guid(int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) { throw null; }
public Guid(int a, short b, short c, byte[] d) { throw null; }
public Guid(System.ReadOnlySpan<byte> b) { throw null; }
public Guid(string g) { throw null; }
[System.CLSCompliantAttribute(false)]
public Guid(uint a, ushort b, ushort c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) { throw null; }
public int CompareTo(System.Guid value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Guid g) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Guid NewGuid() { throw null; }
public static bool operator ==(System.Guid a, System.Guid b) { throw null; }
public static bool operator !=(System.Guid a, System.Guid b) { throw null; }
public static System.Guid Parse(System.ReadOnlySpan<char> input) { throw null; }
public static System.Guid Parse(string input) { throw null; }
public static System.Guid ParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format) { throw null; }
public static System.Guid ParseExact(string input, string format) { throw null; }
public byte[] ToByteArray() { throw null; }
public override string ToString() { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>)) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, out System.Guid result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, out System.Guid result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format, out System.Guid result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, out System.Guid result) { throw null; }
public bool TryWriteBytes(System.Span<byte> destination) { throw null; }
bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Guid, System.Guid>.operator <(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Guid, System.Guid>.operator <=(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Guid, System.Guid>.operator >(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Guid, System.Guid>.operator >=(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.Guid, System.Guid>.operator ==(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.Guid, System.Guid>.operator !=(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Guid IParseable<System.Guid>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.Guid>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.Guid result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Guid ISpanParseable<System.Guid>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.Guid>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.Guid result) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct Half : System.IComparable, System.IComparable<System.Half>, System.IEquatable<System.Half>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryFloatingPoint<System.Half>,
System.IMinMaxValue<System.Half>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static System.Half Epsilon { get { throw null; } }
public static System.Half MaxValue { get { throw null; } }
public static System.Half MinValue { get { throw null; } }
public static System.Half NaN { get { throw null; } }
public static System.Half NegativeInfinity { get { throw null; } }
public static System.Half PositiveInfinity { get { throw null; } }
public int CompareTo(System.Half other) { throw null; }
public int CompareTo(object? obj) { throw null; }
public bool Equals(System.Half other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool IsFinite(System.Half value) { throw null; }
public static bool IsInfinity(System.Half value) { throw null; }
public static bool IsNaN(System.Half value) { throw null; }
public static bool IsNegative(System.Half value) { throw null; }
public static bool IsNegativeInfinity(System.Half value) { throw null; }
public static bool IsNormal(System.Half value) { throw null; }
public static bool IsPositiveInfinity(System.Half value) { throw null; }
public static bool IsSubnormal(System.Half value) { throw null; }
public static bool operator ==(System.Half left, System.Half right) { throw null; }
public static explicit operator System.Half (double value) { throw null; }
public static explicit operator double (System.Half value) { throw null; }
public static explicit operator float (System.Half value) { throw null; }
public static explicit operator System.Half (float value) { throw null; }
public static bool operator >(System.Half left, System.Half right) { throw null; }
public static bool operator >=(System.Half left, System.Half right) { throw null; }
public static bool operator !=(System.Half left, System.Half right) { throw null; }
public static bool operator <(System.Half left, System.Half right) { throw null; }
public static bool operator <=(System.Half left, System.Half right) { throw null; }
public static System.Half Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; }
public static System.Half Parse(string s) { throw null; }
public static System.Half Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Half Parse(string s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; }
public static System.Half Parse(string s, System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Half result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Half result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Half result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Half result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IAdditiveIdentity<System.Half, System.Half>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.E { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Epsilon { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.NaN { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.NegativeInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.NegativeZero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Pi { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.PositiveInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Tau { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IMinMaxValue<System.Half>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IMinMaxValue<System.Half>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IMultiplicativeIdentity<System.Half, System.Half>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IAdditionOperators<System.Half, System.Half, System.Half>.operator +(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<System.Half>.IsPow2(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBinaryNumber<System.Half>.Log2(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBitwiseOperators<System.Half, System.Half, System.Half>.operator &(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBitwiseOperators<System.Half, System.Half, System.Half>.operator |(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBitwiseOperators<System.Half, System.Half, System.Half>.operator ^(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBitwiseOperators<System.Half, System.Half, System.Half>.operator ~(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Half, System.Half>.operator <(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Half, System.Half>.operator <=(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Half, System.Half>.operator >(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Half, System.Half>.operator >=(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IDecrementOperators<System.Half>.operator --(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IDivisionOperators<System.Half, System.Half, System.Half>.operator /(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.Half, System.Half>.operator ==(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.Half, System.Half>.operator !=(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Acos(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Acosh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Asin(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Asinh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Atan(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Atan2(System.Half y, System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Atanh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.BitIncrement(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.BitDecrement(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Cbrt(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Ceiling(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.CopySign(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Cos(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Cosh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Exp(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Floor(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.FusedMultiplyAdd(System.Half left, System.Half right, System.Half addend) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.IEEERemainder(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static TInteger IFloatingPoint<System.Half>.ILogB<TInteger>(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Log(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Log(System.Half x, System.Half newBase) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Log2(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Log10(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.MaxMagnitude(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.MinMagnitude(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Pow(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Round(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Round<TInteger>(System.Half x, TInteger digits) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Round(System.Half x, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Round<TInteger>(System.Half x, TInteger digits, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.ScaleB<TInteger>(System.Half x, TInteger n) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Sin(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Sinh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Sqrt(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Tan(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Tanh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Truncate(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsFinite(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsInfinity(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsNaN(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsNegative(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsNegativeInfinity(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsNormal(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsPositiveInfinity(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsSubnormal(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IIncrementOperators<System.Half>.operator ++(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IModulusOperators<System.Half, System.Half, System.Half>.operator %(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IMultiplyOperators<System.Half, System.Half, System.Half>.operator *(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Abs(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Clamp(System.Half value, System.Half min, System.Half max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (System.Half Quotient, System.Half Remainder) INumber<System.Half>.DivRem(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Max(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Min(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Sign(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<System.Half>.TryCreate<TOther>(TOther value, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<System.Half>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<System.Half>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IParseable<System.Half>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.Half>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half ISignedNumber<System.Half>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half ISpanParseable<System.Half>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.Half>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half ISubtractionOperators<System.Half, System.Half, System.Half>.operator -(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IUnaryNegationOperators<System.Half, System.Half>.operator -(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IUnaryPlusOperators<System.Half, System.Half>.operator +(System.Half value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial struct HashCode
{
private int _dummyPrimitive;
public void AddBytes(System.ReadOnlySpan<byte> value) { }
public void Add<T>(T value) { }
public void Add<T>(T value, System.Collections.Generic.IEqualityComparer<T>? comparer) { }
public static int Combine<T1>(T1 value1) { throw null; }
public static int Combine<T1, T2>(T1 value1, T2 value2) { throw null; }
public static int Combine<T1, T2, T3>(T1 value1, T2 value2, T3 value3) { throw null; }
public static int Combine<T1, T2, T3, T4>(T1 value1, T2 value2, T3 value3, T4 value4) { throw null; }
public static int Combine<T1, T2, T3, T4, T5>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) { throw null; }
public static int Combine<T1, T2, T3, T4, T5, T6>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) { throw null; }
public static int Combine<T1, T2, T3, T4, T5, T6, T7>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7) { throw null; }
public static int Combine<T1, T2, T3, T4, T5, T6, T7, T8>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("HashCode is a mutable struct and should not be compared with other HashCodes.", true)]
public override bool Equals(object? obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.", true)]
public override int GetHashCode() { throw null; }
public int ToHashCode() { throw null; }
}
public partial class HttpStyleUriParser : System.UriParser
{
public HttpStyleUriParser() { }
}
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IAdditionOperators<TSelf, TOther, TResult>
where TSelf : System.IAdditionOperators<TSelf, TOther, TResult>
{
static abstract TResult operator +(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IAdditiveIdentity<TSelf, TResult>
where TSelf : System.IAdditiveIdentity<TSelf, TResult>
{
static abstract TResult AdditiveIdentity { get; }
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IBinaryFloatingPoint<TSelf> : System.IBinaryNumber<TSelf>, System.IFloatingPoint<TSelf>
where TSelf : IBinaryFloatingPoint<TSelf>
{
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IBinaryInteger<TSelf> : System.IBinaryNumber<TSelf>, System.IShiftOperators<TSelf, TSelf>
where TSelf : IBinaryInteger<TSelf>
{
static abstract TSelf LeadingZeroCount(TSelf value);
static abstract TSelf PopCount(TSelf value);
static abstract TSelf RotateLeft(TSelf value, int rotateAmount);
static abstract TSelf RotateRight(TSelf value, int rotateAmount);
static abstract TSelf TrailingZeroCount(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IBinaryNumber<TSelf> : System.IBitwiseOperators<TSelf, TSelf, TSelf>, System.INumber<TSelf>
where TSelf : IBinaryNumber<TSelf>
{
static abstract bool IsPow2(TSelf value);
static abstract TSelf Log2(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IBitwiseOperators<TSelf, TOther, TResult>
where TSelf : System.IBitwiseOperators<TSelf, TOther, TResult>
{
static abstract TResult operator &(TSelf left, TOther right);
static abstract TResult operator |(TSelf left, TOther right);
static abstract TResult operator ^(TSelf left, TOther right);
static abstract TResult operator ~(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IComparisonOperators<TSelf, TOther> : System.IComparable, System.IComparable<TOther>, System.IEqualityOperators<TSelf, TOther>
where TSelf : IComparisonOperators<TSelf, TOther>
{
static abstract bool operator <(TSelf left, TOther right);
static abstract bool operator <=(TSelf left, TOther right);
static abstract bool operator >(TSelf left, TOther right);
static abstract bool operator >=(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IDecrementOperators<TSelf>
where TSelf : System.IDecrementOperators<TSelf>
{
static abstract TSelf operator --(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IDivisionOperators<TSelf, TOther, TResult>
where TSelf : System.IDivisionOperators<TSelf, TOther, TResult>
{
static abstract TResult operator /(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IEqualityOperators<TSelf, TOther> : IEquatable<TOther>
where TSelf : System.IEqualityOperators<TSelf, TOther>
{
static abstract bool operator ==(TSelf left, TOther right);
static abstract bool operator !=(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IFloatingPoint<TSelf> : System.ISignedNumber<TSelf>
where TSelf : System.IFloatingPoint<TSelf>
{
static abstract TSelf E { get; }
static abstract TSelf Epsilon { get; }
static abstract TSelf NaN { get; }
static abstract TSelf NegativeInfinity { get; }
static abstract TSelf NegativeZero { get; }
static abstract TSelf Pi { get; }
static abstract TSelf PositiveInfinity { get; }
static abstract TSelf Tau { get; }
static abstract TSelf Acos(TSelf x);
static abstract TSelf Acosh(TSelf x);
static abstract TSelf Asin(TSelf x);
static abstract TSelf Asinh(TSelf x);
static abstract TSelf Atan(TSelf x);
static abstract TSelf Atan2(TSelf y, TSelf x);
static abstract TSelf Atanh(TSelf x);
static abstract TSelf BitIncrement(TSelf x);
static abstract TSelf BitDecrement(TSelf x);
static abstract TSelf Cbrt(TSelf x);
static abstract TSelf Ceiling(TSelf x);
static abstract TSelf CopySign(TSelf x, TSelf y);
static abstract TSelf Cos(TSelf x);
static abstract TSelf Cosh(TSelf x);
static abstract TSelf Exp(TSelf x);
static abstract TSelf Floor(TSelf x);
static abstract TSelf FusedMultiplyAdd(TSelf left, TSelf right, TSelf addend);
static abstract TSelf IEEERemainder(TSelf left, TSelf right);
static abstract TInteger ILogB<TInteger>(TSelf x) where TInteger : IBinaryInteger<TInteger>;
static abstract bool IsFinite(TSelf value);
static abstract bool IsInfinity(TSelf value);
static abstract bool IsNaN(TSelf value);
static abstract bool IsNegative(TSelf value);
static abstract bool IsNegativeInfinity(TSelf value);
static abstract bool IsNormal(TSelf value);
static abstract bool IsPositiveInfinity(TSelf value);
static abstract bool IsSubnormal(TSelf value);
static abstract TSelf Log(TSelf x);
static abstract TSelf Log(TSelf x, TSelf newBase);
static abstract TSelf Log2(TSelf x);
static abstract TSelf Log10(TSelf x);
static abstract TSelf MaxMagnitude(TSelf x, TSelf y);
static abstract TSelf MinMagnitude(TSelf x, TSelf y);
static abstract TSelf Pow(TSelf x, TSelf y);
static abstract TSelf Round(TSelf x);
static abstract TSelf Round<TInteger>(TSelf x, TInteger digits) where TInteger : IBinaryInteger<TInteger>;
static abstract TSelf Round(TSelf x, MidpointRounding mode);
static abstract TSelf Round<TInteger>(TSelf x, TInteger digits, MidpointRounding mode) where TInteger : IBinaryInteger<TInteger>;
static abstract TSelf ScaleB<TInteger>(TSelf x, TInteger n) where TInteger : IBinaryInteger<TInteger>;
static abstract TSelf Sin(TSelf x);
static abstract TSelf Sinh(TSelf x);
static abstract TSelf Sqrt(TSelf x);
static abstract TSelf Tan(TSelf x);
static abstract TSelf Tanh(TSelf x);
static abstract TSelf Truncate(TSelf x);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IIncrementOperators<TSelf>
where TSelf : System.IIncrementOperators<TSelf>
{
static abstract TSelf operator ++(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IMinMaxValue<TSelf>
where TSelf : System.IMinMaxValue<TSelf>
{
static abstract TSelf MinValue { get; }
static abstract TSelf MaxValue { get; }
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IModulusOperators<TSelf, TOther, TResult>
where TSelf : System.IModulusOperators<TSelf, TOther, TResult>
{
static abstract TResult operator %(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IMultiplicativeIdentity<TSelf, TResult>
where TSelf : System.IMultiplicativeIdentity<TSelf, TResult>
{
static abstract TResult MultiplicativeIdentity { get; }
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IMultiplyOperators<TSelf, TOther, TResult>
where TSelf : System.IMultiplyOperators<TSelf, TOther, TResult>
{
static abstract TResult operator *(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface INumber<TSelf> : System.IAdditionOperators<TSelf, TSelf, TSelf>, System.IAdditiveIdentity<TSelf, TSelf>, System.IComparable, System.IComparable<TSelf>, System.IComparisonOperators<TSelf, TSelf>, System.IDecrementOperators<TSelf>, System.IDivisionOperators<TSelf, TSelf, TSelf>, System.IEquatable<TSelf>, System.IEqualityOperators<TSelf, TSelf>, System.IFormattable, System.IIncrementOperators<TSelf>, System.IModulusOperators<TSelf, TSelf, TSelf>, System.IMultiplicativeIdentity<TSelf, TSelf>, System.IMultiplyOperators<TSelf, TSelf, TSelf>, System.IParseable<TSelf>, System.ISpanFormattable, System.ISpanParseable<TSelf>, System.ISubtractionOperators<TSelf, TSelf, TSelf>, System.IUnaryNegationOperators<TSelf, TSelf>, System.IUnaryPlusOperators<TSelf, TSelf>
where TSelf : System.INumber<TSelf>
{
static abstract TSelf One { get; }
static abstract TSelf Zero { get; }
static abstract TSelf Abs(TSelf value);
static abstract TSelf Clamp(TSelf value, TSelf min, TSelf max);
static abstract TSelf Create<TOther>(TOther value) where TOther : INumber<TOther>;
static abstract TSelf CreateSaturating<TOther>(TOther value) where TOther : INumber<TOther>;
static abstract TSelf CreateTruncating<TOther>(TOther value) where TOther : INumber<TOther>;
static abstract (TSelf Quotient, TSelf Remainder) DivRem(TSelf left, TSelf right);
static abstract TSelf Max(TSelf x, TSelf y);
static abstract TSelf Min(TSelf x, TSelf y);
static abstract TSelf Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider);
static abstract TSelf Parse(ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider);
static abstract TSelf Sign(TSelf value);
static abstract bool TryCreate<TOther>(TOther value, out TSelf result) where TOther : INumber<TOther>;
static abstract bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out TSelf result);
static abstract bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, IFormatProvider? provider, out TSelf result);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IParseable<TSelf>
where TSelf : System.IParseable<TSelf>
{
static abstract TSelf Parse(string s, System.IFormatProvider? provider);
static abstract bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out TSelf result);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IShiftOperators<TSelf, TResult>
where TSelf : System.IShiftOperators<TSelf, TResult>
{
static abstract TResult operator <<(TSelf value, int shiftAmount);
static abstract TResult operator >>(TSelf value, int shiftAmount);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface ISignedNumber<TSelf> : System.INumber<TSelf>, System.IUnaryNegationOperators<TSelf, TSelf>
where TSelf : System.ISignedNumber<TSelf>
{
static abstract TSelf NegativeOne { get; }
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface ISpanParseable<TSelf> : System.IParseable<TSelf>
where TSelf : System.ISpanParseable<TSelf>
{
static abstract TSelf Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider);
static abstract bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out TSelf result);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface ISubtractionOperators<TSelf, TOther, TResult>
where TSelf : System.ISubtractionOperators<TSelf, TOther, TResult>
{
static abstract TResult operator -(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IUnaryNegationOperators<TSelf, TResult>
where TSelf : System.IUnaryNegationOperators<TSelf, TResult>
{
static abstract TResult operator -(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IUnaryPlusOperators<TSelf, TResult>
where TSelf : System.IUnaryPlusOperators<TSelf, TResult>
{
static abstract TResult operator +(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IUnsignedNumber<TSelf> : System.INumber<TSelf>
where TSelf : IUnsignedNumber<TSelf>
{
}
#endif // FEATURE_GENERIC_MATH
public partial interface IAsyncDisposable
{
System.Threading.Tasks.ValueTask DisposeAsync();
}
public partial interface IAsyncResult
{
object? AsyncState { get; }
System.Threading.WaitHandle AsyncWaitHandle { get; }
bool CompletedSynchronously { get; }
bool IsCompleted { get; }
}
public partial interface ICloneable
{
object Clone();
}
public partial interface IComparable
{
int CompareTo(object? obj);
}
public partial interface IComparable<in T>
{
int CompareTo(T? other);
}
[System.CLSCompliantAttribute(false)]
public partial interface IConvertible
{
System.TypeCode GetTypeCode();
bool ToBoolean(System.IFormatProvider? provider);
byte ToByte(System.IFormatProvider? provider);
char ToChar(System.IFormatProvider? provider);
System.DateTime ToDateTime(System.IFormatProvider? provider);
decimal ToDecimal(System.IFormatProvider? provider);
double ToDouble(System.IFormatProvider? provider);
short ToInt16(System.IFormatProvider? provider);
int ToInt32(System.IFormatProvider? provider);
long ToInt64(System.IFormatProvider? provider);
sbyte ToSByte(System.IFormatProvider? provider);
float ToSingle(System.IFormatProvider? provider);
string ToString(System.IFormatProvider? provider);
object ToType(System.Type conversionType, System.IFormatProvider? provider);
ushort ToUInt16(System.IFormatProvider? provider);
uint ToUInt32(System.IFormatProvider? provider);
ulong ToUInt64(System.IFormatProvider? provider);
}
public partial interface ICustomFormatter
{
string Format(string? format, object? arg, System.IFormatProvider? formatProvider);
}
public partial interface IDisposable
{
void Dispose();
}
public partial interface IEquatable<T>
{
bool Equals(T? other);
}
public partial interface IFormatProvider
{
object? GetFormat(System.Type? formatType);
}
public partial interface IFormattable
{
string ToString(string? format, System.IFormatProvider? formatProvider);
}
public readonly partial struct Index : System.IEquatable<System.Index>
{
private readonly int _dummyPrimitive;
public Index(int value, bool fromEnd = false) { throw null; }
public static System.Index End { get { throw null; } }
public bool IsFromEnd { get { throw null; } }
public static System.Index Start { get { throw null; } }
public int Value { get { throw null; } }
public bool Equals(System.Index other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static System.Index FromEnd(int value) { throw null; }
public static System.Index FromStart(int value) { throw null; }
public override int GetHashCode() { throw null; }
public int GetOffset(int length) { throw null; }
public static implicit operator System.Index (int value) { throw null; }
public override string ToString() { throw null; }
}
public sealed partial class IndexOutOfRangeException : System.SystemException
{
public IndexOutOfRangeException() { }
public IndexOutOfRangeException(string? message) { }
public IndexOutOfRangeException(string? message, System.Exception? innerException) { }
}
public sealed partial class InsufficientExecutionStackException : System.SystemException
{
public InsufficientExecutionStackException() { }
public InsufficientExecutionStackException(string? message) { }
public InsufficientExecutionStackException(string? message, System.Exception? innerException) { }
}
public sealed partial class InsufficientMemoryException : System.OutOfMemoryException
{
public InsufficientMemoryException() { }
public InsufficientMemoryException(string? message) { }
public InsufficientMemoryException(string? message, System.Exception? innerException) { }
}
public readonly partial struct Int16 : System.IComparable, System.IComparable<short>, System.IConvertible, System.IEquatable<short>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<short>,
System.IMinMaxValue<short>,
System.ISignedNumber<short>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly short _dummyPrimitive;
public const short MaxValue = (short)32767;
public const short MinValue = (short)-32768;
public int CompareTo(System.Int16 value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Int16 obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Int16 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.Int16 Parse(string s) { throw null; }
public static System.Int16 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Int16 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Int16 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
System.Int16 System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int16 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Int16 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int16 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Int16 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IAdditiveIdentity<short, short>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IMinMaxValue<short>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IMinMaxValue<short>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IMultiplicativeIdentity<short, short>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IAdditionOperators<short, short, short>.operator +(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.LeadingZeroCount(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.PopCount(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.RotateLeft(short value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.RotateRight(short value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.TrailingZeroCount(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<short>.IsPow2(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryNumber<short>.Log2(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBitwiseOperators<short, short, short>.operator &(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBitwiseOperators<short, short, short>.operator |(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBitwiseOperators<short, short, short>.operator ^(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBitwiseOperators<short, short, short>.operator ~(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<short, short>.operator <(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<short, short>.operator <=(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<short, short>.operator >(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<short, short>.operator >=(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IDecrementOperators<short>.operator --(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IDivisionOperators<short, short, short>.operator /(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<short, short>.operator ==(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<short, short>.operator !=(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IIncrementOperators<short>.operator ++(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IModulusOperators<short, short, short>.operator %(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IMultiplyOperators<short, short, short>.operator *(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Abs(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Clamp(short value, short min, short max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (short Quotient, short Remainder) INumber<short>.DivRem(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Max(short x, short y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Min(short x, short y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Sign(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<short>.TryCreate<TOther>(TOther value, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<short>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<short>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IParseable<short>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<short>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IShiftOperators<short, short>.operator <<(short value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IShiftOperators<short, short>.operator >>(short value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short ISignedNumber<short>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short ISpanParseable<short>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<short>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short ISubtractionOperators<short, short, short>.operator -(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IUnaryNegationOperators<short, short>.operator -(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IUnaryPlusOperators<short, short>.operator +(short value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct Int32 : System.IComparable, System.IComparable<int>, System.IConvertible, System.IEquatable<int>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<int>,
System.IMinMaxValue<int>,
System.ISignedNumber<int>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public const int MaxValue = 2147483647;
public const int MinValue = -2147483648;
public System.Int32 CompareTo(System.Int32 value) { throw null; }
public System.Int32 CompareTo(object? value) { throw null; }
public bool Equals(System.Int32 obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override System.Int32 GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Int32 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.Int32 Parse(string s) { throw null; }
public static System.Int32 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Int32 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Int32 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
System.Int32 System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out System.Int32 charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int32 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Int32 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int32 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Int32 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IAdditiveIdentity<int, int>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IMinMaxValue<int>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IMinMaxValue<int>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IMultiplicativeIdentity<int, int>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IAdditionOperators<int, int, int>.operator +(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.LeadingZeroCount(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.PopCount(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.RotateLeft(int value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.RotateRight(int value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.TrailingZeroCount(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<int>.IsPow2(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryNumber<int>.Log2(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBitwiseOperators<int, int, int>.operator &(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBitwiseOperators<int, int, int>.operator |(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBitwiseOperators<int, int, int>.operator ^(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBitwiseOperators<int, int, int>.operator ~(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<int, int>.operator <(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<int, int>.operator <=(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<int, int>.operator >(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<int, int>.operator >=(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IDecrementOperators<int>.operator --(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IDivisionOperators<int, int, int>.operator /(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<int, int>.operator ==(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<int, int>.operator !=(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IIncrementOperators<int>.operator ++(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IModulusOperators<int, int, int>.operator %(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IMultiplyOperators<int, int, int>.operator *(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Abs(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Clamp(int value, int min, int max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (int Quotient, int Remainder) INumber<int>.DivRem(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Max(int x, int y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Min(int x, int y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Sign(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<int>.TryCreate<TOther>(TOther value, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<int>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<int>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IParseable<int>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<int>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IShiftOperators<int, int>.operator <<(int value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IShiftOperators<int, int>.operator >>(int value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int ISignedNumber<int>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int ISpanParseable<int>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<int>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int ISubtractionOperators<int, int, int>.operator -(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IUnaryNegationOperators<int, int>.operator -(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IUnaryPlusOperators<int, int>.operator +(int value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct Int64 : System.IComparable, System.IComparable<long>, System.IConvertible, System.IEquatable<long>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<long>,
System.IMinMaxValue<long>,
System.ISignedNumber<long>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly long _dummyPrimitive;
public const long MaxValue = (long)9223372036854775807;
public const long MinValue = (long)-9223372036854775808;
public int CompareTo(System.Int64 value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Int64 obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Int64 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.Int64 Parse(string s) { throw null; }
public static System.Int64 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Int64 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Int64 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
System.Int64 System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int64 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Int64 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int64 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Int64 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IAdditiveIdentity<long, long>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IMinMaxValue<long>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IMinMaxValue<long>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IMultiplicativeIdentity<long, long>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IAdditionOperators<long, long, long>.operator +(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.LeadingZeroCount(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.PopCount(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.RotateLeft(long value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.RotateRight(long value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.TrailingZeroCount(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<long>.IsPow2(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryNumber<long>.Log2(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBitwiseOperators<long, long, long>.operator &(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBitwiseOperators<long, long, long>.operator |(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBitwiseOperators<long, long, long>.operator ^(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBitwiseOperators<long, long, long>.operator ~(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<long, long>.operator <(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<long, long>.operator <=(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<long, long>.operator >(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<long, long>.operator >=(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IDecrementOperators<long>.operator --(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IDivisionOperators<long, long, long>.operator /(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<long, long>.operator ==(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<long, long>.operator !=(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IIncrementOperators<long>.operator ++(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IModulusOperators<long, long, long>.operator %(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IMultiplyOperators<long, long, long>.operator *(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Abs(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Clamp(long value, long min, long max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (long Quotient, long Remainder) INumber<long>.DivRem(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Max(long x, long y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Min(long x, long y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Sign(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<long>.TryCreate<TOther>(TOther value, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<long>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<long>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IParseable<long>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<long>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IShiftOperators<long, long>.operator <<(long value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IShiftOperators<long, long>.operator >>(long value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long ISignedNumber<long>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long ISpanParseable<long>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<long>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long ISubtractionOperators<long, long, long>.operator -(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IUnaryNegationOperators<long, long>.operator -(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IUnaryPlusOperators<long, long>.operator +(long value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct IntPtr : System.IComparable, System.IComparable<nint>, System.IEquatable<nint>, System.ISpanFormattable, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<nint>,
System.IMinMaxValue<nint>,
System.ISignedNumber<nint>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.IntPtr Zero;
public IntPtr(int value) { throw null; }
public IntPtr(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe IntPtr(void* value) { throw null; }
public static System.IntPtr MaxValue { get { throw null; } }
public static System.IntPtr MinValue { get { throw null; } }
public static int Size { get { throw null; } }
public static System.IntPtr Add(System.IntPtr pointer, int offset) { throw null; }
public int CompareTo(System.IntPtr value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.IntPtr other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.IntPtr operator +(System.IntPtr pointer, int offset) { throw null; }
public static bool operator ==(System.IntPtr value1, System.IntPtr value2) { throw null; }
public static explicit operator System.IntPtr (int value) { throw null; }
public static explicit operator System.IntPtr (long value) { throw null; }
public static explicit operator int (System.IntPtr value) { throw null; }
public static explicit operator long (System.IntPtr value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static explicit operator void* (System.IntPtr value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static explicit operator System.IntPtr (void* value) { throw null; }
public static bool operator !=(System.IntPtr value1, System.IntPtr value2) { throw null; }
public static System.IntPtr operator -(System.IntPtr pointer, int offset) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static System.IntPtr Parse(string s) { throw null; }
public static System.IntPtr Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.IntPtr Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.IntPtr Parse(string s, System.IFormatProvider? provider) { throw null; }
public static System.IntPtr Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.IntPtr Subtract(System.IntPtr pointer, int offset) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public int ToInt32() { throw null; }
public long ToInt64() { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe void* ToPointer() { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.IntPtr result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.IntPtr result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.IntPtr result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.IntPtr result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IAdditiveIdentity<nint, nint>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IMinMaxValue<nint>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IMinMaxValue<nint>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IMultiplicativeIdentity<nint, nint>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IAdditionOperators<nint, nint, nint>.operator +(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.LeadingZeroCount(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.PopCount(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.RotateLeft(nint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.RotateRight(nint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.TrailingZeroCount(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<nint>.IsPow2(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryNumber<nint>.Log2(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBitwiseOperators<nint, nint, nint>.operator &(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBitwiseOperators<nint, nint, nint>.operator |(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBitwiseOperators<nint, nint, nint>.operator ^(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBitwiseOperators<nint, nint, nint>.operator ~(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nint, nint>.operator <(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nint, nint>.operator <=(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nint, nint>.operator >(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nint, nint>.operator >=(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IDecrementOperators<nint>.operator --(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IDivisionOperators<nint, nint, nint>.operator /(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<nint, nint>.operator ==(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<nint, nint>.operator !=(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IIncrementOperators<nint>.operator ++(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IModulusOperators<nint, nint, nint>.operator %(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IMultiplyOperators<nint, nint, nint>.operator *(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Abs(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Clamp(nint value, nint min, nint max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (nint Quotient, nint Remainder) INumber<nint>.DivRem(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Max(nint x, nint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Min(nint x, nint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Sign(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nint>.TryCreate<TOther>(TOther value, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nint>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IParseable<nint>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<nint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IShiftOperators<nint, nint>.operator <<(nint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IShiftOperators<nint, nint>.operator >>(nint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint ISignedNumber<nint>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint ISpanParseable<nint>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<nint>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint ISubtractionOperators<nint, nint, nint>.operator -(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IUnaryNegationOperators<nint, nint>.operator -(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IUnaryPlusOperators<nint, nint>.operator +(nint value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial class InvalidCastException : System.SystemException
{
public InvalidCastException() { }
protected InvalidCastException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public InvalidCastException(string? message) { }
public InvalidCastException(string? message, System.Exception? innerException) { }
public InvalidCastException(string? message, int errorCode) { }
}
public partial class InvalidOperationException : System.SystemException
{
public InvalidOperationException() { }
protected InvalidOperationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public InvalidOperationException(string? message) { }
public InvalidOperationException(string? message, System.Exception? innerException) { }
}
public sealed partial class InvalidProgramException : System.SystemException
{
public InvalidProgramException() { }
public InvalidProgramException(string? message) { }
public InvalidProgramException(string? message, System.Exception? inner) { }
}
public partial class InvalidTimeZoneException : System.Exception
{
public InvalidTimeZoneException() { }
protected InvalidTimeZoneException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public InvalidTimeZoneException(string? message) { }
public InvalidTimeZoneException(string? message, System.Exception? innerException) { }
}
public partial interface IObservable<out T>
{
System.IDisposable Subscribe(System.IObserver<T> observer);
}
public partial interface IObserver<in T>
{
void OnCompleted();
void OnError(System.Exception error);
void OnNext(T value);
}
public partial interface IProgress<in T>
{
void Report(T value);
}
public partial interface ISpanFormattable : System.IFormattable
{
bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
}
public partial class Lazy<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>
{
public Lazy() { }
public Lazy(bool isThreadSafe) { }
public Lazy(System.Func<T> valueFactory) { }
public Lazy(System.Func<T> valueFactory, bool isThreadSafe) { }
public Lazy(System.Func<T> valueFactory, System.Threading.LazyThreadSafetyMode mode) { }
public Lazy(System.Threading.LazyThreadSafetyMode mode) { }
public Lazy(T value) { }
public bool IsValueCreated { get { throw null; } }
public T Value { get { throw null; } }
public override string? ToString() { throw null; }
}
public partial class Lazy<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T, TMetadata> : System.Lazy<T>
{
public Lazy(System.Func<T> valueFactory, TMetadata metadata) { }
public Lazy(System.Func<T> valueFactory, TMetadata metadata, bool isThreadSafe) { }
public Lazy(System.Func<T> valueFactory, TMetadata metadata, System.Threading.LazyThreadSafetyMode mode) { }
public Lazy(TMetadata metadata) { }
public Lazy(TMetadata metadata, bool isThreadSafe) { }
public Lazy(TMetadata metadata, System.Threading.LazyThreadSafetyMode mode) { }
public TMetadata Metadata { get { throw null; } }
}
public partial class LdapStyleUriParser : System.UriParser
{
public LdapStyleUriParser() { }
}
public enum LoaderOptimization
{
NotSpecified = 0,
SingleDomain = 1,
MultiDomain = 2,
[System.ObsoleteAttribute("LoaderOptimization.DomainMask has been deprecated and is not supported.")]
DomainMask = 3,
MultiDomainHost = 3,
[System.ObsoleteAttribute("LoaderOptimization.DisallowBindings has been deprecated and is not supported.")]
DisallowBindings = 4,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method)]
public sealed partial class LoaderOptimizationAttribute : System.Attribute
{
public LoaderOptimizationAttribute(byte value) { }
public LoaderOptimizationAttribute(System.LoaderOptimization value) { }
public System.LoaderOptimization Value { get { throw null; } }
}
public abstract partial class MarshalByRefObject
{
protected MarshalByRefObject() { }
[System.ObsoleteAttribute("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0010", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public object GetLifetimeService() { throw null; }
[System.ObsoleteAttribute("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0010", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public virtual object InitializeLifetimeService() { throw null; }
protected System.MarshalByRefObject MemberwiseClone(bool cloneIdentity) { throw null; }
}
public static partial class Math
{
public const double E = 2.718281828459045;
public const double PI = 3.141592653589793;
public const double Tau = 6.283185307179586;
public static decimal Abs(decimal value) { throw null; }
public static double Abs(double value) { throw null; }
public static short Abs(short value) { throw null; }
public static int Abs(int value) { throw null; }
public static long Abs(long value) { throw null; }
public static nint Abs(nint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte Abs(sbyte value) { throw null; }
public static float Abs(float value) { throw null; }
public static double Acos(double d) { throw null; }
public static double Acosh(double d) { throw null; }
public static double Asin(double d) { throw null; }
public static double Asinh(double d) { throw null; }
public static double Atan(double d) { throw null; }
public static double Atan2(double y, double x) { throw null; }
public static double Atanh(double d) { throw null; }
public static long BigMul(int a, int b) { throw null; }
public static long BigMul(long a, long b, out long low) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong BigMul(ulong a, ulong b, out ulong low) { throw null; }
public static double BitDecrement(double x) { throw null; }
public static double BitIncrement(double x) { throw null; }
public static double Cbrt(double d) { throw null; }
public static decimal Ceiling(decimal d) { throw null; }
public static double Ceiling(double a) { throw null; }
public static byte Clamp(byte value, byte min, byte max) { throw null; }
public static decimal Clamp(decimal value, decimal min, decimal max) { throw null; }
public static double Clamp(double value, double min, double max) { throw null; }
public static short Clamp(short value, short min, short max) { throw null; }
public static int Clamp(int value, int min, int max) { throw null; }
public static long Clamp(long value, long min, long max) { throw null; }
public static nint Clamp(nint value, nint min, nint max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte Clamp(sbyte value, sbyte min, sbyte max) { throw null; }
public static float Clamp(float value, float min, float max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort Clamp(ushort value, ushort min, ushort max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint Clamp(uint value, uint min, uint max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong Clamp(ulong value, ulong min, ulong max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint Clamp(nuint value, nuint min, nuint max) { throw null; }
public static double CopySign(double x, double y) { throw null; }
public static double Cos(double d) { throw null; }
public static double Cosh(double value) { throw null; }
public static int DivRem(int a, int b, out int result) { throw null; }
public static long DivRem(long a, long b, out long result) { throw null; }
public static (byte Quotient, byte Remainder) DivRem(byte left, byte right) { throw null; }
public static (short Quotient, short Remainder) DivRem(short left, short right) { throw null; }
public static (int Quotient, int Remainder) DivRem(int left, int right) { throw null; }
public static (long Quotient, long Remainder) DivRem(long left, long right) { throw null; }
public static (nint Quotient, nint Remainder) DivRem(nint left, nint right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (sbyte Quotient, sbyte Remainder) DivRem(sbyte left, sbyte right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (ushort Quotient, ushort Remainder) DivRem(ushort left, ushort right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (uint Quotient, uint Remainder) DivRem(uint left, uint right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (ulong Quotient, ulong Remainder) DivRem(ulong left, ulong right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (nuint Quotient, nuint Remainder) DivRem(nuint left, nuint right) { throw null; }
public static double Exp(double d) { throw null; }
public static decimal Floor(decimal d) { throw null; }
public static double Floor(double d) { throw null; }
public static double FusedMultiplyAdd(double x, double y, double z) { throw null; }
public static double IEEERemainder(double x, double y) { throw null; }
public static int ILogB(double x) { throw null; }
public static double Log(double d) { throw null; }
public static double Log(double a, double newBase) { throw null; }
public static double Log10(double d) { throw null; }
public static double Log2(double x) { throw null; }
public static byte Max(byte val1, byte val2) { throw null; }
public static decimal Max(decimal val1, decimal val2) { throw null; }
public static double Max(double val1, double val2) { throw null; }
public static short Max(short val1, short val2) { throw null; }
public static int Max(int val1, int val2) { throw null; }
public static long Max(long val1, long val2) { throw null; }
public static nint Max(nint val1, nint val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte Max(sbyte val1, sbyte val2) { throw null; }
public static float Max(float val1, float val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort Max(ushort val1, ushort val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint Max(uint val1, uint val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong Max(ulong val1, ulong val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint Max(nuint val1, nuint val2) { throw null; }
public static double MaxMagnitude(double x, double y) { throw null; }
public static byte Min(byte val1, byte val2) { throw null; }
public static decimal Min(decimal val1, decimal val2) { throw null; }
public static double Min(double val1, double val2) { throw null; }
public static short Min(short val1, short val2) { throw null; }
public static int Min(int val1, int val2) { throw null; }
public static long Min(long val1, long val2) { throw null; }
public static nint Min(nint val1, nint val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte Min(sbyte val1, sbyte val2) { throw null; }
public static float Min(float val1, float val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort Min(ushort val1, ushort val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint Min(uint val1, uint val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong Min(ulong val1, ulong val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint Min(nuint val1, nuint val2) { throw null; }
public static double MinMagnitude(double x, double y) { throw null; }
public static double Pow(double x, double y) { throw null; }
public static double ReciprocalEstimate(double d) { throw null; }
public static double ReciprocalSqrtEstimate(double d) { throw null; }
public static decimal Round(decimal d) { throw null; }
public static decimal Round(decimal d, int decimals) { throw null; }
public static decimal Round(decimal d, int decimals, System.MidpointRounding mode) { throw null; }
public static decimal Round(decimal d, System.MidpointRounding mode) { throw null; }
public static double Round(double a) { throw null; }
public static double Round(double value, int digits) { throw null; }
public static double Round(double value, int digits, System.MidpointRounding mode) { throw null; }
public static double Round(double value, System.MidpointRounding mode) { throw null; }
public static double ScaleB(double x, int n) { throw null; }
public static int Sign(decimal value) { throw null; }
public static int Sign(double value) { throw null; }
public static int Sign(short value) { throw null; }
public static int Sign(int value) { throw null; }
public static int Sign(long value) { throw null; }
public static int Sign(nint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int Sign(sbyte value) { throw null; }
public static int Sign(float value) { throw null; }
public static double Sin(double a) { throw null; }
public static (double Sin, double Cos) SinCos(double x) { throw null; }
public static double Sinh(double value) { throw null; }
public static double Sqrt(double d) { throw null; }
public static double Tan(double a) { throw null; }
public static double Tanh(double value) { throw null; }
public static decimal Truncate(decimal d) { throw null; }
public static double Truncate(double d) { throw null; }
}
public static partial class MathF
{
public const float E = 2.7182817f;
public const float PI = 3.1415927f;
public const float Tau = 6.2831855f;
public static float Abs(float x) { throw null; }
public static float Acos(float x) { throw null; }
public static float Acosh(float x) { throw null; }
public static float Asin(float x) { throw null; }
public static float Asinh(float x) { throw null; }
public static float Atan(float x) { throw null; }
public static float Atan2(float y, float x) { throw null; }
public static float Atanh(float x) { throw null; }
public static float BitDecrement(float x) { throw null; }
public static float BitIncrement(float x) { throw null; }
public static float Cbrt(float x) { throw null; }
public static float Ceiling(float x) { throw null; }
public static float CopySign(float x, float y) { throw null; }
public static float Cos(float x) { throw null; }
public static float Cosh(float x) { throw null; }
public static float Exp(float x) { throw null; }
public static float Floor(float x) { throw null; }
public static float FusedMultiplyAdd(float x, float y, float z) { throw null; }
public static float IEEERemainder(float x, float y) { throw null; }
public static int ILogB(float x) { throw null; }
public static float Log(float x) { throw null; }
public static float Log(float x, float y) { throw null; }
public static float Log10(float x) { throw null; }
public static float Log2(float x) { throw null; }
public static float Max(float x, float y) { throw null; }
public static float MaxMagnitude(float x, float y) { throw null; }
public static float Min(float x, float y) { throw null; }
public static float MinMagnitude(float x, float y) { throw null; }
public static float Pow(float x, float y) { throw null; }
public static float ReciprocalEstimate(float x) { throw null; }
public static float ReciprocalSqrtEstimate(float x) { throw null; }
public static float Round(float x) { throw null; }
public static float Round(float x, int digits) { throw null; }
public static float Round(float x, int digits, System.MidpointRounding mode) { throw null; }
public static float Round(float x, System.MidpointRounding mode) { throw null; }
public static float ScaleB(float x, int n) { throw null; }
public static int Sign(float x) { throw null; }
public static float Sin(float x) { throw null; }
public static (float Sin, float Cos) SinCos(float x) { throw null; }
public static float Sinh(float x) { throw null; }
public static float Sqrt(float x) { throw null; }
public static float Tan(float x) { throw null; }
public static float Tanh(float x) { throw null; }
public static float Truncate(float x) { throw null; }
}
public partial class MemberAccessException : System.SystemException
{
public MemberAccessException() { }
protected MemberAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MemberAccessException(string? message) { }
public MemberAccessException(string? message, System.Exception? inner) { }
}
public readonly partial struct Memory<T> : System.IEquatable<System.Memory<T>>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public Memory(T[]? array) { throw null; }
public Memory(T[]? array, int start, int length) { throw null; }
public static System.Memory<T> Empty { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public int Length { get { throw null; } }
public System.Span<T> Span { get { throw null; } }
public void CopyTo(System.Memory<T> destination) { }
public bool Equals(System.Memory<T> other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static implicit operator System.Memory<T> (System.ArraySegment<T> segment) { throw null; }
public static implicit operator System.ReadOnlyMemory<T> (System.Memory<T> memory) { throw null; }
public static implicit operator System.Memory<T> (T[]? array) { throw null; }
public System.Buffers.MemoryHandle Pin() { throw null; }
public System.Memory<T> Slice(int start) { throw null; }
public System.Memory<T> Slice(int start, int length) { throw null; }
public T[] ToArray() { throw null; }
public override string ToString() { throw null; }
public bool TryCopyTo(System.Memory<T> destination) { throw null; }
}
public partial class MethodAccessException : System.MemberAccessException
{
public MethodAccessException() { }
protected MethodAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MethodAccessException(string? message) { }
public MethodAccessException(string? message, System.Exception? inner) { }
}
public enum MidpointRounding
{
ToEven = 0,
AwayFromZero = 1,
ToZero = 2,
ToNegativeInfinity = 3,
ToPositiveInfinity = 4,
}
public partial class MissingFieldException : System.MissingMemberException, System.Runtime.Serialization.ISerializable
{
public MissingFieldException() { }
protected MissingFieldException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingFieldException(string? message) { }
public MissingFieldException(string? message, System.Exception? inner) { }
public MissingFieldException(string? className, string? fieldName) { }
public override string Message { get { throw null; } }
}
public partial class MissingMemberException : System.MemberAccessException, System.Runtime.Serialization.ISerializable
{
protected string? ClassName;
protected string? MemberName;
protected byte[]? Signature;
public MissingMemberException() { }
protected MissingMemberException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingMemberException(string? message) { }
public MissingMemberException(string? message, System.Exception? inner) { }
public MissingMemberException(string? className, string? memberName) { }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class MissingMethodException : System.MissingMemberException
{
public MissingMethodException() { }
protected MissingMethodException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingMethodException(string? message) { }
public MissingMethodException(string? message, System.Exception? inner) { }
public MissingMethodException(string? className, string? methodName) { }
public override string Message { get { throw null; } }
}
public partial struct ModuleHandle : System.IEquatable<System.ModuleHandle>
{
private object _dummy;
private int _dummyPrimitive;
public static readonly System.ModuleHandle EmptyHandle;
public int MDStreamVersion { get { throw null; } }
public bool Equals(System.ModuleHandle handle) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeFieldHandle GetRuntimeFieldHandleFromMetadataToken(int fieldToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeMethodHandle GetRuntimeMethodHandleFromMetadataToken(int methodToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeTypeHandle GetRuntimeTypeHandleFromMetadataToken(int typeToken) { throw null; }
public static bool operator ==(System.ModuleHandle left, System.ModuleHandle right) { throw null; }
public static bool operator !=(System.ModuleHandle left, System.ModuleHandle right) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeFieldHandle ResolveFieldHandle(int fieldToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeFieldHandle ResolveFieldHandle(int fieldToken, System.RuntimeTypeHandle[]? typeInstantiationContext, System.RuntimeTypeHandle[]? methodInstantiationContext) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeMethodHandle ResolveMethodHandle(int methodToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeMethodHandle ResolveMethodHandle(int methodToken, System.RuntimeTypeHandle[]? typeInstantiationContext, System.RuntimeTypeHandle[]? methodInstantiationContext) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeTypeHandle ResolveTypeHandle(int typeToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeTypeHandle ResolveTypeHandle(int typeToken, System.RuntimeTypeHandle[]? typeInstantiationContext, System.RuntimeTypeHandle[]? methodInstantiationContext) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method)]
public sealed partial class MTAThreadAttribute : System.Attribute
{
public MTAThreadAttribute() { }
}
public abstract partial class MulticastDelegate : System.Delegate
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
protected MulticastDelegate(object target, string method) : base (default(object), default(string)) { }
protected MulticastDelegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method) : base (default(object), default(string)) { }
protected sealed override System.Delegate CombineImpl(System.Delegate? follow) { throw null; }
public sealed override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public sealed override int GetHashCode() { throw null; }
public sealed override System.Delegate[] GetInvocationList() { throw null; }
protected override System.Reflection.MethodInfo GetMethodImpl() { throw null; }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(System.MulticastDelegate? d1, System.MulticastDelegate? d2) { throw null; }
public static bool operator !=(System.MulticastDelegate? d1, System.MulticastDelegate? d2) { throw null; }
protected sealed override System.Delegate? RemoveImpl(System.Delegate value) { throw null; }
}
public sealed partial class MulticastNotSupportedException : System.SystemException
{
public MulticastNotSupportedException() { }
public MulticastNotSupportedException(string? message) { }
public MulticastNotSupportedException(string? message, System.Exception? inner) { }
}
public partial class NetPipeStyleUriParser : System.UriParser
{
public NetPipeStyleUriParser() { }
}
public partial class NetTcpStyleUriParser : System.UriParser
{
public NetTcpStyleUriParser() { }
}
public partial class NewsStyleUriParser : System.UriParser
{
public NewsStyleUriParser() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public sealed partial class NonSerializedAttribute : System.Attribute
{
public NonSerializedAttribute() { }
}
public partial class NotFiniteNumberException : System.ArithmeticException
{
public NotFiniteNumberException() { }
public NotFiniteNumberException(double offendingNumber) { }
protected NotFiniteNumberException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public NotFiniteNumberException(string? message) { }
public NotFiniteNumberException(string? message, double offendingNumber) { }
public NotFiniteNumberException(string? message, double offendingNumber, System.Exception? innerException) { }
public NotFiniteNumberException(string? message, System.Exception? innerException) { }
public double OffendingNumber { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class NotImplementedException : System.SystemException
{
public NotImplementedException() { }
protected NotImplementedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public NotImplementedException(string? message) { }
public NotImplementedException(string? message, System.Exception? inner) { }
}
public partial class NotSupportedException : System.SystemException
{
public NotSupportedException() { }
protected NotSupportedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public NotSupportedException(string? message) { }
public NotSupportedException(string? message, System.Exception? innerException) { }
}
public static partial class Nullable
{
public static int Compare<T>(T? n1, T? n2) where T : struct { throw null; }
public static bool Equals<T>(T? n1, T? n2) where T : struct { throw null; }
public static System.Type? GetUnderlyingType(System.Type nullableType) { throw null; }
public static ref readonly T GetValueRefOrDefaultRef<T>(in T? nullable) where T : struct { throw null; }
}
public partial struct Nullable<T> where T : struct
{
private T value;
private int _dummyPrimitive;
public Nullable(T value) { throw null; }
public readonly bool HasValue { get { throw null; } }
public readonly T Value { get { throw null; } }
public override bool Equals(object? other) { throw null; }
public override int GetHashCode() { throw null; }
public readonly T GetValueOrDefault() { throw null; }
public readonly T GetValueOrDefault(T defaultValue) { throw null; }
public static explicit operator T (T? value) { throw null; }
public static implicit operator T? (T value) { throw null; }
public override string? ToString() { throw null; }
}
public partial class NullReferenceException : System.SystemException
{
public NullReferenceException() { }
protected NullReferenceException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public NullReferenceException(string? message) { }
public NullReferenceException(string? message, System.Exception? innerException) { }
}
public partial class Object
{
public Object() { }
public virtual bool Equals(System.Object? obj) { throw null; }
public static bool Equals(System.Object? objA, System.Object? objB) { throw null; }
~Object() { }
public virtual int GetHashCode() { throw null; }
public System.Type GetType() { throw null; }
protected System.Object MemberwiseClone() { throw null; }
public static bool ReferenceEquals(System.Object? objA, System.Object? objB) { throw null; }
public virtual string? ToString() { throw null; }
}
public partial class ObjectDisposedException : System.InvalidOperationException
{
protected ObjectDisposedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ObjectDisposedException(string? objectName) { }
public ObjectDisposedException(string? message, System.Exception? innerException) { }
public ObjectDisposedException(string? objectName, string? message) { }
public override string Message { get { throw null; } }
public string ObjectName { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static void ThrowIf([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(true)] bool condition, object instance) => throw null;
public static void ThrowIf([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(true)] bool condition, System.Type type) => throw null;
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class ObsoleteAttribute : System.Attribute
{
public ObsoleteAttribute() { }
public ObsoleteAttribute(string? message) { }
public ObsoleteAttribute(string? message, bool error) { }
public string? DiagnosticId { get { throw null; } set { } }
public bool IsError { get { throw null; } }
public string? Message { get { throw null; } }
public string? UrlFormat { get { throw null; } set { } }
}
public sealed partial class OperatingSystem : System.ICloneable, System.Runtime.Serialization.ISerializable
{
public OperatingSystem(System.PlatformID platform, System.Version version) { }
public System.PlatformID Platform { get { throw null; } }
public string ServicePack { get { throw null; } }
public System.Version Version { get { throw null; } }
public string VersionString { get { throw null; } }
public object Clone() { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool IsAndroid() { throw null; }
public static bool IsAndroidVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0) { throw null; }
public static bool IsBrowser() { throw null; }
public static bool IsFreeBSD() { throw null; }
public static bool IsFreeBSDVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformGuardAttribute("maccatalyst")]
public static bool IsIOS() { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformGuardAttribute("maccatalyst")]
public static bool IsIOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsLinux() { throw null; }
public static bool IsMacCatalyst() { throw null; }
public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsMacOS() { throw null; }
public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsOSPlatform(string platform) { throw null; }
public static bool IsOSPlatformVersionAtLeast(string platform, int major, int minor = 0, int build = 0, int revision = 0) { throw null; }
public static bool IsTvOS() { throw null; }
public static bool IsTvOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsWatchOS() { throw null; }
public static bool IsWatchOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsWindows() { throw null; }
public static bool IsWindowsVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0) { throw null; }
public override string ToString() { throw null; }
}
public partial class OperationCanceledException : System.SystemException
{
public OperationCanceledException() { }
protected OperationCanceledException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public OperationCanceledException(string? message) { }
public OperationCanceledException(string? message, System.Exception? innerException) { }
public OperationCanceledException(string? message, System.Exception? innerException, System.Threading.CancellationToken token) { }
public OperationCanceledException(string? message, System.Threading.CancellationToken token) { }
public OperationCanceledException(System.Threading.CancellationToken token) { }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
}
public partial class OutOfMemoryException : System.SystemException
{
public OutOfMemoryException() { }
protected OutOfMemoryException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public OutOfMemoryException(string? message) { }
public OutOfMemoryException(string? message, System.Exception? innerException) { }
}
public partial class OverflowException : System.ArithmeticException
{
public OverflowException() { }
protected OverflowException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public OverflowException(string? message) { }
public OverflowException(string? message, System.Exception? innerException) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=true, AllowMultiple=false)]
public sealed partial class ParamArrayAttribute : System.Attribute
{
public ParamArrayAttribute() { }
}
public enum PlatformID
{
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Win32S = 0,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Win32Windows = 1,
Win32NT = 2,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
WinCE = 3,
Unix = 4,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Xbox = 5,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
MacOSX = 6,
Other = 7,
}
public partial class PlatformNotSupportedException : System.NotSupportedException
{
public PlatformNotSupportedException() { }
protected PlatformNotSupportedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public PlatformNotSupportedException(string? message) { }
public PlatformNotSupportedException(string? message, System.Exception? inner) { }
}
public delegate bool Predicate<in T>(T obj);
public partial class Progress<T> : System.IProgress<T>
{
public Progress() { }
public Progress(System.Action<T> handler) { }
public event System.EventHandler<T>? ProgressChanged { add { } remove { } }
protected virtual void OnReport(T value) { }
void System.IProgress<T>.Report(T value) { }
}
public partial class Random
{
public Random() { }
public Random(int Seed) { }
public static System.Random Shared { get { throw null; } }
public virtual int Next() { throw null; }
public virtual int Next(int maxValue) { throw null; }
public virtual int Next(int minValue, int maxValue) { throw null; }
public virtual void NextBytes(byte[] buffer) { }
public virtual void NextBytes(System.Span<byte> buffer) { }
public virtual double NextDouble() { throw null; }
public virtual long NextInt64() { throw null; }
public virtual long NextInt64(long maxValue) { throw null; }
public virtual long NextInt64(long minValue, long maxValue) { throw null; }
public virtual float NextSingle() { throw null; }
protected virtual double Sample() { throw null; }
}
public readonly partial struct Range : System.IEquatable<System.Range>
{
private readonly int _dummyPrimitive;
public Range(System.Index start, System.Index end) { throw null; }
public static System.Range All { get { throw null; } }
public System.Index End { get { throw null; } }
public System.Index Start { get { throw null; } }
public static System.Range EndAt(System.Index end) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public bool Equals(System.Range other) { throw null; }
public override int GetHashCode() { throw null; }
public (int Offset, int Length) GetOffsetAndLength(int length) { throw null; }
public static System.Range StartAt(System.Index start) { throw null; }
public override string ToString() { throw null; }
}
public partial class RankException : System.SystemException
{
public RankException() { }
protected RankException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public RankException(string? message) { }
public RankException(string? message, System.Exception? innerException) { }
}
public readonly partial struct ReadOnlyMemory<T> : System.IEquatable<System.ReadOnlyMemory<T>>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ReadOnlyMemory(T[]? array) { throw null; }
public ReadOnlyMemory(T[]? array, int start, int length) { throw null; }
public static System.ReadOnlyMemory<T> Empty { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public int Length { get { throw null; } }
public System.ReadOnlySpan<T> Span { get { throw null; } }
public void CopyTo(System.Memory<T> destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.ReadOnlyMemory<T> other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static implicit operator System.ReadOnlyMemory<T> (System.ArraySegment<T> segment) { throw null; }
public static implicit operator System.ReadOnlyMemory<T> (T[]? array) { throw null; }
public System.Buffers.MemoryHandle Pin() { throw null; }
public System.ReadOnlyMemory<T> Slice(int start) { throw null; }
public System.ReadOnlyMemory<T> Slice(int start, int length) { throw null; }
public T[] ToArray() { throw null; }
public override string ToString() { throw null; }
public bool TryCopyTo(System.Memory<T> destination) { throw null; }
}
public readonly ref partial struct ReadOnlySpan<T>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
[System.CLSCompliantAttribute(false)]
public unsafe ReadOnlySpan(void* pointer, int length) { throw null; }
public ReadOnlySpan(T[]? array) { throw null; }
public ReadOnlySpan(T[]? array, int start, int length) { throw null; }
public static System.ReadOnlySpan<T> Empty { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public ref readonly T this[int index] { get { throw null; } }
public int Length { get { throw null; } }
public void CopyTo(System.Span<T> destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Equals() on ReadOnlySpan will always throw an exception. Use the equality operator instead.")]
public override bool Equals(object? obj) { throw null; }
public System.ReadOnlySpan<T>.Enumerator GetEnumerator() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("GetHashCode() on ReadOnlySpan will always throw an exception.")]
public override int GetHashCode() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public ref readonly T GetPinnableReference() { throw null; }
public static bool operator ==(System.ReadOnlySpan<T> left, System.ReadOnlySpan<T> right) { throw null; }
public static implicit operator System.ReadOnlySpan<T> (System.ArraySegment<T> segment) { throw null; }
public static implicit operator System.ReadOnlySpan<T> (T[]? array) { throw null; }
public static bool operator !=(System.ReadOnlySpan<T> left, System.ReadOnlySpan<T> right) { throw null; }
public System.ReadOnlySpan<T> Slice(int start) { throw null; }
public System.ReadOnlySpan<T> Slice(int start, int length) { throw null; }
public T[] ToArray() { throw null; }
public override string ToString() { throw null; }
public bool TryCopyTo(System.Span<T> destination) { throw null; }
public ref partial struct Enumerator
{
private object _dummy;
private int _dummyPrimitive;
public ref readonly T Current { get { throw null; } }
public bool MoveNext() { throw null; }
}
}
public partial class ResolveEventArgs : System.EventArgs
{
public ResolveEventArgs(string name) { }
public ResolveEventArgs(string name, System.Reflection.Assembly? requestingAssembly) { }
public string Name { get { throw null; } }
public System.Reflection.Assembly? RequestingAssembly { get { throw null; } }
}
public delegate System.Reflection.Assembly? ResolveEventHandler(object? sender, System.ResolveEventArgs args);
public ref partial struct RuntimeArgumentHandle
{
private int _dummyPrimitive;
}
public partial struct RuntimeFieldHandle : System.IEquatable<System.RuntimeFieldHandle>, System.Runtime.Serialization.ISerializable
{
private object _dummy;
private int _dummyPrimitive;
public System.IntPtr Value { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public bool Equals(System.RuntimeFieldHandle handle) { throw null; }
public override int GetHashCode() { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(System.RuntimeFieldHandle left, System.RuntimeFieldHandle right) { throw null; }
public static bool operator !=(System.RuntimeFieldHandle left, System.RuntimeFieldHandle right) { throw null; }
}
public partial struct RuntimeMethodHandle : System.IEquatable<System.RuntimeMethodHandle>, System.Runtime.Serialization.ISerializable
{
private object _dummy;
private int _dummyPrimitive;
public System.IntPtr Value { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public bool Equals(System.RuntimeMethodHandle handle) { throw null; }
public System.IntPtr GetFunctionPointer() { throw null; }
public override int GetHashCode() { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(System.RuntimeMethodHandle left, System.RuntimeMethodHandle right) { throw null; }
public static bool operator !=(System.RuntimeMethodHandle left, System.RuntimeMethodHandle right) { throw null; }
}
public partial struct RuntimeTypeHandle : System.IEquatable<System.RuntimeTypeHandle>, System.Runtime.Serialization.ISerializable
{
private object _dummy;
private int _dummyPrimitive;
public System.IntPtr Value { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public bool Equals(System.RuntimeTypeHandle handle) { throw null; }
public override int GetHashCode() { throw null; }
public System.ModuleHandle GetModuleHandle() { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(object? left, System.RuntimeTypeHandle right) { throw null; }
public static bool operator ==(System.RuntimeTypeHandle left, object? right) { throw null; }
public static bool operator !=(object? left, System.RuntimeTypeHandle right) { throw null; }
public static bool operator !=(System.RuntimeTypeHandle left, object? right) { throw null; }
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct SByte : System.IComparable, System.IComparable<sbyte>, System.IConvertible, System.IEquatable<sbyte>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<sbyte>,
System.IMinMaxValue<sbyte>,
System.ISignedNumber<sbyte>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly sbyte _dummyPrimitive;
public const sbyte MaxValue = (sbyte)127;
public const sbyte MinValue = (sbyte)-128;
public int CompareTo(object? obj) { throw null; }
public int CompareTo(System.SByte value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.SByte obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.SByte Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.SByte Parse(string s) { throw null; }
public static System.SByte Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.SByte Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.SByte Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
System.SByte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.SByte result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.SByte result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.SByte result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.SByte result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IAdditiveIdentity<sbyte, sbyte>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IMinMaxValue<sbyte>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IMinMaxValue<sbyte>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IMultiplicativeIdentity<sbyte, sbyte>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IAdditionOperators<sbyte, sbyte, sbyte>.operator +(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.LeadingZeroCount(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.PopCount(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.RotateLeft(sbyte value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.RotateRight(sbyte value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.TrailingZeroCount(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<sbyte>.IsPow2(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryNumber<sbyte>.Log2(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBitwiseOperators<sbyte, sbyte, sbyte>.operator &(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBitwiseOperators<sbyte, sbyte, sbyte>.operator |(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBitwiseOperators<sbyte, sbyte, sbyte>.operator ^(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBitwiseOperators<sbyte, sbyte, sbyte>.operator ~(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<sbyte, sbyte>.operator <(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<sbyte, sbyte>.operator <=(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<sbyte, sbyte>.operator >(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<sbyte, sbyte>.operator >=(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IDecrementOperators<sbyte>.operator --(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IDivisionOperators<sbyte, sbyte, sbyte>.operator /(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<sbyte, sbyte>.operator ==(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<sbyte, sbyte>.operator !=(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IIncrementOperators<sbyte>.operator ++(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IModulusOperators<sbyte, sbyte, sbyte>.operator %(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IMultiplyOperators<sbyte, sbyte, sbyte>.operator *(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Abs(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Clamp(sbyte value, sbyte min, sbyte max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (sbyte Quotient, sbyte Remainder) INumber<sbyte>.DivRem(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Max(sbyte x, sbyte y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Min(sbyte x, sbyte y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Sign(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<sbyte>.TryCreate<TOther>(TOther value, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<sbyte>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<sbyte>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IParseable<sbyte>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<sbyte>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IShiftOperators<sbyte, sbyte>.operator <<(sbyte value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IShiftOperators<sbyte, sbyte>.operator >>(sbyte value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte ISignedNumber<sbyte>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte ISpanParseable<sbyte>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<sbyte>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte ISubtractionOperators<sbyte, sbyte, sbyte>.operator -(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IUnaryNegationOperators<sbyte, sbyte>.operator -(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IUnaryPlusOperators<sbyte, sbyte>.operator +(sbyte value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class SerializableAttribute : System.Attribute
{
public SerializableAttribute() { }
}
public readonly partial struct Single : System.IComparable, System.IComparable<float>, System.IConvertible, System.IEquatable<float>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryFloatingPoint<float>,
System.IMinMaxValue<float>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly float _dummyPrimitive;
public const float Epsilon = 1E-45f;
public const float MaxValue = 3.4028235E+38f;
public const float MinValue = -3.4028235E+38f;
public const float NaN = 0.0f / 0.0f;
public const float NegativeInfinity = -1.0f / 0.0f;
public const float PositiveInfinity = 1.0f / 0.0f;
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.Single value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Single obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static bool IsFinite(System.Single f) { throw null; }
public static bool IsInfinity(System.Single f) { throw null; }
public static bool IsNaN(System.Single f) { throw null; }
public static bool IsNegative(System.Single f) { throw null; }
public static bool IsNegativeInfinity(System.Single f) { throw null; }
public static bool IsNormal(System.Single f) { throw null; }
public static bool IsPositiveInfinity(System.Single f) { throw null; }
public static bool IsSubnormal(System.Single f) { throw null; }
public static bool operator ==(System.Single left, System.Single right) { throw null; }
public static bool operator >(System.Single left, System.Single right) { throw null; }
public static bool operator >=(System.Single left, System.Single right) { throw null; }
public static bool operator !=(System.Single left, System.Single right) { throw null; }
public static bool operator <(System.Single left, System.Single right) { throw null; }
public static bool operator <=(System.Single left, System.Single right) { throw null; }
public static System.Single Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; }
public static System.Single Parse(string s) { throw null; }
public static System.Single Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Single Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Single Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
System.Single System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Single result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Single result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Single result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Single result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IAdditiveIdentity<float, float>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.E { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Epsilon { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.NaN { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.NegativeInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.NegativeZero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Pi { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.PositiveInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Tau { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IMinMaxValue<float>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IMinMaxValue<float>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IMultiplicativeIdentity<float, float>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IAdditionOperators<float, float, float>.operator +(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<float>.IsPow2(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBinaryNumber<float>.Log2(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBitwiseOperators<float, float, float>.operator &(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBitwiseOperators<float, float, float>.operator |(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBitwiseOperators<float, float, float>.operator ^(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBitwiseOperators<float, float, float>.operator ~(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<float, float>.operator <(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<float, float>.operator <=(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<float, float>.operator >(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<float, float>.operator >=(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IDecrementOperators<float>.operator --(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IDivisionOperators<float, float, float>.operator /(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<float, float>.operator ==(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<float, float>.operator !=(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Acos(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Acosh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Asin(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Asinh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Atan(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Atan2(float y, float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Atanh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.BitIncrement(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.BitDecrement(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Cbrt(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Ceiling(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.CopySign(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Cos(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Cosh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Exp(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Floor(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.FusedMultiplyAdd(float left, float right, float addend) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.IEEERemainder(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static TInteger IFloatingPoint<float>.ILogB<TInteger>(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Log(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Log(float x, float newBase) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Log2(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Log10(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.MaxMagnitude(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.MinMagnitude(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Pow(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Round(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Round<TInteger>(float x, TInteger digits) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Round(float x, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Round<TInteger>(float x, TInteger digits, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.ScaleB<TInteger>(float x, TInteger n) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Sin(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Sinh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Sqrt(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Tan(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Tanh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Truncate(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsFinite(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsInfinity(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsNaN(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsNegative(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsNegativeInfinity(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsNormal(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsPositiveInfinity(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsSubnormal(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IIncrementOperators<float>.operator ++(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IModulusOperators<float, float, float>.operator %(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IMultiplyOperators<float, float, float>.operator *(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Abs(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Clamp(float value, float min, float max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (float Quotient, float Remainder) INumber<float>.DivRem(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Max(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Min(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Sign(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<float>.TryCreate<TOther>(TOther value, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<float>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<float>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IParseable<float>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<float>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float ISignedNumber<float>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float ISpanParseable<float>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<float>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float ISubtractionOperators<float, float, float>.operator -(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IUnaryNegationOperators<float, float>.operator -(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IUnaryPlusOperators<float, float>.operator +(float value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly ref partial struct Span<T>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
[System.CLSCompliantAttribute(false)]
public unsafe Span(void* pointer, int length) { throw null; }
public Span(T[]? array) { throw null; }
public Span(T[]? array, int start, int length) { throw null; }
public static System.Span<T> Empty { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public ref T this[int index] { get { throw null; } }
public int Length { get { throw null; } }
public void Clear() { }
public void CopyTo(System.Span<T> destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Equals() on Span will always throw an exception. Use the equality operator instead.")]
public override bool Equals(object? obj) { throw null; }
public void Fill(T value) { }
public System.Span<T>.Enumerator GetEnumerator() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("GetHashCode() on Span will always throw an exception.")]
public override int GetHashCode() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public ref T GetPinnableReference() { throw null; }
public static bool operator ==(System.Span<T> left, System.Span<T> right) { throw null; }
public static implicit operator System.Span<T> (System.ArraySegment<T> segment) { throw null; }
public static implicit operator System.ReadOnlySpan<T> (System.Span<T> span) { throw null; }
public static implicit operator System.Span<T> (T[]? array) { throw null; }
public static bool operator !=(System.Span<T> left, System.Span<T> right) { throw null; }
public System.Span<T> Slice(int start) { throw null; }
public System.Span<T> Slice(int start, int length) { throw null; }
public T[] ToArray() { throw null; }
public override string ToString() { throw null; }
public bool TryCopyTo(System.Span<T> destination) { throw null; }
public ref partial struct Enumerator
{
private object _dummy;
private int _dummyPrimitive;
public ref T Current { get { throw null; } }
public bool MoveNext() { throw null; }
}
}
public sealed partial class StackOverflowException : System.SystemException
{
public StackOverflowException() { }
public StackOverflowException(string? message) { }
public StackOverflowException(string? message, System.Exception? innerException) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method)]
public sealed partial class STAThreadAttribute : System.Attribute
{
public STAThreadAttribute() { }
}
public sealed partial class String : System.Collections.Generic.IEnumerable<char>, System.Collections.IEnumerable, System.ICloneable, System.IComparable, System.IComparable<string?>, System.IConvertible, System.IEquatable<string?>
{
public static readonly string Empty;
[System.CLSCompliantAttribute(false)]
public unsafe String(char* value) { }
[System.CLSCompliantAttribute(false)]
public unsafe String(char* value, int startIndex, int length) { }
public String(char c, int count) { }
public String(char[]? value) { }
public String(char[] value, int startIndex, int length) { }
public String(System.ReadOnlySpan<char> value) { }
[System.CLSCompliantAttribute(false)]
public unsafe String(sbyte* value) { }
[System.CLSCompliantAttribute(false)]
public unsafe String(sbyte* value, int startIndex, int length) { }
[System.CLSCompliantAttribute(false)]
public unsafe String(sbyte* value, int startIndex, int length, System.Text.Encoding enc) { }
[System.Runtime.CompilerServices.IndexerName("Chars")]
public char this[int index] { get { throw null; } }
public int Length { get { throw null; } }
public object Clone() { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length) { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length, bool ignoreCase) { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length, System.Globalization.CultureInfo? culture, System.Globalization.CompareOptions options) { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length, System.StringComparison comparisonType) { throw null; }
public static int Compare(System.String? strA, System.String? strB) { throw null; }
public static int Compare(System.String? strA, System.String? strB, bool ignoreCase) { throw null; }
public static int Compare(System.String? strA, System.String? strB, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public static int Compare(System.String? strA, System.String? strB, System.Globalization.CultureInfo? culture, System.Globalization.CompareOptions options) { throw null; }
public static int Compare(System.String? strA, System.String? strB, System.StringComparison comparisonType) { throw null; }
public static int CompareOrdinal(System.String? strA, int indexA, System.String? strB, int indexB, int length) { throw null; }
public static int CompareOrdinal(System.String? strA, System.String? strB) { throw null; }
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.String? strB) { throw null; }
public static System.String Concat(System.Collections.Generic.IEnumerable<string?> values) { throw null; }
public static System.String Concat(object? arg0) { throw null; }
public static System.String Concat(object? arg0, object? arg1) { throw null; }
public static System.String Concat(object? arg0, object? arg1, object? arg2) { throw null; }
public static System.String Concat(params object?[] args) { throw null; }
public static System.String Concat(System.ReadOnlySpan<char> str0, System.ReadOnlySpan<char> str1) { throw null; }
public static System.String Concat(System.ReadOnlySpan<char> str0, System.ReadOnlySpan<char> str1, System.ReadOnlySpan<char> str2) { throw null; }
public static System.String Concat(System.ReadOnlySpan<char> str0, System.ReadOnlySpan<char> str1, System.ReadOnlySpan<char> str2, System.ReadOnlySpan<char> str3) { throw null; }
public static System.String Concat(System.String? str0, System.String? str1) { throw null; }
public static System.String Concat(System.String? str0, System.String? str1, System.String? str2) { throw null; }
public static System.String Concat(System.String? str0, System.String? str1, System.String? str2, System.String? str3) { throw null; }
public static System.String Concat(params string?[] values) { throw null; }
public static System.String Concat<T>(System.Collections.Generic.IEnumerable<T> values) { throw null; }
public bool Contains(char value) { throw null; }
public bool Contains(char value, System.StringComparison comparisonType) { throw null; }
public bool Contains(System.String value) { throw null; }
public bool Contains(System.String value, System.StringComparison comparisonType) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This API should not be used to create mutable strings. See https://go.microsoft.com/fwlink/?linkid=2084035 for alternatives.")]
public static System.String Copy(System.String str) { throw null; }
public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count) { }
public void CopyTo(System.Span<char> destination) { }
public static System.String Create(System.IFormatProvider? provider, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("provider")] ref System.Runtime.CompilerServices.DefaultInterpolatedStringHandler handler) { throw null; }
public static System.String Create(System.IFormatProvider? provider, System.Span<char> initialBuffer, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute(new string[]{ "provider", "initialBuffer"})] ref System.Runtime.CompilerServices.DefaultInterpolatedStringHandler handler) { throw null; }
public static System.String Create<TState>(int length, TState state, System.Buffers.SpanAction<char, TState> action) { throw null; }
public bool EndsWith(char value) { throw null; }
public bool EndsWith(System.String value) { throw null; }
public bool EndsWith(System.String value, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public bool EndsWith(System.String value, System.StringComparison comparisonType) { throw null; }
public System.Text.StringRuneEnumerator EnumerateRunes() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.String? value) { throw null; }
public static bool Equals(System.String? a, System.String? b) { throw null; }
public static bool Equals(System.String? a, System.String? b, System.StringComparison comparisonType) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.String? value, System.StringComparison comparisonType) { throw null; }
public static System.String Format(System.IFormatProvider? provider, System.String format, object? arg0) { throw null; }
public static System.String Format(System.IFormatProvider? provider, System.String format, object? arg0, object? arg1) { throw null; }
public static System.String Format(System.IFormatProvider? provider, System.String format, object? arg0, object? arg1, object? arg2) { throw null; }
public static System.String Format(System.IFormatProvider? provider, System.String format, params object?[] args) { throw null; }
public static System.String Format(System.String format, object? arg0) { throw null; }
public static System.String Format(System.String format, object? arg0, object? arg1) { throw null; }
public static System.String Format(System.String format, object? arg0, object? arg1, object? arg2) { throw null; }
public static System.String Format(System.String format, params object?[] args) { throw null; }
public System.CharEnumerator GetEnumerator() { throw null; }
public override int GetHashCode() { throw null; }
public static int GetHashCode(System.ReadOnlySpan<char> value) { throw null; }
public static int GetHashCode(System.ReadOnlySpan<char> value, System.StringComparison comparisonType) { throw null; }
public int GetHashCode(System.StringComparison comparisonType) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public ref readonly char GetPinnableReference() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public int IndexOf(char value) { throw null; }
public int IndexOf(char value, int startIndex) { throw null; }
public int IndexOf(char value, int startIndex, int count) { throw null; }
public int IndexOf(char value, System.StringComparison comparisonType) { throw null; }
public int IndexOf(System.String value) { throw null; }
public int IndexOf(System.String value, int startIndex) { throw null; }
public int IndexOf(System.String value, int startIndex, int count) { throw null; }
public int IndexOf(System.String value, int startIndex, int count, System.StringComparison comparisonType) { throw null; }
public int IndexOf(System.String value, int startIndex, System.StringComparison comparisonType) { throw null; }
public int IndexOf(System.String value, System.StringComparison comparisonType) { throw null; }
public int IndexOfAny(char[] anyOf) { throw null; }
public int IndexOfAny(char[] anyOf, int startIndex) { throw null; }
public int IndexOfAny(char[] anyOf, int startIndex, int count) { throw null; }
public System.String Insert(int startIndex, System.String value) { throw null; }
public static System.String Intern(System.String str) { throw null; }
public static System.String? IsInterned(System.String str) { throw null; }
public bool IsNormalized() { throw null; }
public bool IsNormalized(System.Text.NormalizationForm normalizationForm) { throw null; }
public static bool IsNullOrEmpty([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(false)] System.String? value) { throw null; }
public static bool IsNullOrWhiteSpace([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(false)] System.String? value) { throw null; }
public static System.String Join(char separator, params object?[] values) { throw null; }
public static System.String Join(char separator, params string?[] value) { throw null; }
public static System.String Join(char separator, string?[] value, int startIndex, int count) { throw null; }
public static System.String Join(System.String? separator, System.Collections.Generic.IEnumerable<string?> values) { throw null; }
public static System.String Join(System.String? separator, params object?[] values) { throw null; }
public static System.String Join(System.String? separator, params string?[] value) { throw null; }
public static System.String Join(System.String? separator, string?[] value, int startIndex, int count) { throw null; }
public static System.String Join<T>(char separator, System.Collections.Generic.IEnumerable<T> values) { throw null; }
public static System.String Join<T>(System.String? separator, System.Collections.Generic.IEnumerable<T> values) { throw null; }
public int LastIndexOf(char value) { throw null; }
public int LastIndexOf(char value, int startIndex) { throw null; }
public int LastIndexOf(char value, int startIndex, int count) { throw null; }
public int LastIndexOf(System.String value) { throw null; }
public int LastIndexOf(System.String value, int startIndex) { throw null; }
public int LastIndexOf(System.String value, int startIndex, int count) { throw null; }
public int LastIndexOf(System.String value, int startIndex, int count, System.StringComparison comparisonType) { throw null; }
public int LastIndexOf(System.String value, int startIndex, System.StringComparison comparisonType) { throw null; }
public int LastIndexOf(System.String value, System.StringComparison comparisonType) { throw null; }
public int LastIndexOfAny(char[] anyOf) { throw null; }
public int LastIndexOfAny(char[] anyOf, int startIndex) { throw null; }
public int LastIndexOfAny(char[] anyOf, int startIndex, int count) { throw null; }
public System.String Normalize() { throw null; }
public System.String Normalize(System.Text.NormalizationForm normalizationForm) { throw null; }
public static bool operator ==(System.String? a, System.String? b) { throw null; }
public static implicit operator System.ReadOnlySpan<char> (System.String? value) { throw null; }
public static bool operator !=(System.String? a, System.String? b) { throw null; }
public System.String PadLeft(int totalWidth) { throw null; }
public System.String PadLeft(int totalWidth, char paddingChar) { throw null; }
public System.String PadRight(int totalWidth) { throw null; }
public System.String PadRight(int totalWidth, char paddingChar) { throw null; }
public System.String Remove(int startIndex) { throw null; }
public System.String Remove(int startIndex, int count) { throw null; }
public System.String Replace(char oldChar, char newChar) { throw null; }
public System.String Replace(System.String oldValue, System.String? newValue) { throw null; }
public System.String Replace(System.String oldValue, System.String? newValue, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public System.String Replace(System.String oldValue, System.String? newValue, System.StringComparison comparisonType) { throw null; }
public System.String ReplaceLineEndings() { throw null; }
public System.String ReplaceLineEndings(System.String replacementText) { throw null; }
public string[] Split(char separator, int count, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; }
public string[] Split(char separator, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; }
public string[] Split(params char[]? separator) { throw null; }
public string[] Split(char[]? separator, int count) { throw null; }
public string[] Split(char[]? separator, int count, System.StringSplitOptions options) { throw null; }
public string[] Split(char[]? separator, System.StringSplitOptions options) { throw null; }
public string[] Split(System.String? separator, int count, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; }
public string[] Split(System.String? separator, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; }
public string[] Split(string[]? separator, int count, System.StringSplitOptions options) { throw null; }
public string[] Split(string[]? separator, System.StringSplitOptions options) { throw null; }
public bool StartsWith(char value) { throw null; }
public bool StartsWith(System.String value) { throw null; }
public bool StartsWith(System.String value, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public bool StartsWith(System.String value, System.StringComparison comparisonType) { throw null; }
public System.String Substring(int startIndex) { throw null; }
public System.String Substring(int startIndex, int length) { throw null; }
System.Collections.Generic.IEnumerator<char> System.Collections.Generic.IEnumerable<char>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public char[] ToCharArray() { throw null; }
public char[] ToCharArray(int startIndex, int length) { throw null; }
public System.String ToLower() { throw null; }
public System.String ToLower(System.Globalization.CultureInfo? culture) { throw null; }
public System.String ToLowerInvariant() { throw null; }
public override System.String ToString() { throw null; }
public System.String ToString(System.IFormatProvider? provider) { throw null; }
public System.String ToUpper() { throw null; }
public System.String ToUpper(System.Globalization.CultureInfo? culture) { throw null; }
public System.String ToUpperInvariant() { throw null; }
public System.String Trim() { throw null; }
public System.String Trim(char trimChar) { throw null; }
public System.String Trim(params char[]? trimChars) { throw null; }
public System.String TrimEnd() { throw null; }
public System.String TrimEnd(char trimChar) { throw null; }
public System.String TrimEnd(params char[]? trimChars) { throw null; }
public System.String TrimStart() { throw null; }
public System.String TrimStart(char trimChar) { throw null; }
public System.String TrimStart(params char[]? trimChars) { throw null; }
public bool TryCopyTo(System.Span<char> destination) { throw null; }
}
public abstract partial class StringComparer : System.Collections.Generic.IComparer<string?>, System.Collections.Generic.IEqualityComparer<string?>, System.Collections.IComparer, System.Collections.IEqualityComparer
{
protected StringComparer() { }
public static System.StringComparer CurrentCulture { get { throw null; } }
public static System.StringComparer CurrentCultureIgnoreCase { get { throw null; } }
public static System.StringComparer InvariantCulture { get { throw null; } }
public static System.StringComparer InvariantCultureIgnoreCase { get { throw null; } }
public static System.StringComparer Ordinal { get { throw null; } }
public static System.StringComparer OrdinalIgnoreCase { get { throw null; } }
public int Compare(object? x, object? y) { throw null; }
public abstract int Compare(string? x, string? y);
public static System.StringComparer Create(System.Globalization.CultureInfo culture, bool ignoreCase) { throw null; }
public static System.StringComparer Create(System.Globalization.CultureInfo culture, System.Globalization.CompareOptions options) { throw null; }
public new bool Equals(object? x, object? y) { throw null; }
public abstract bool Equals(string? x, string? y);
public static System.StringComparer FromComparison(System.StringComparison comparisonType) { throw null; }
public int GetHashCode(object obj) { throw null; }
public abstract int GetHashCode(string obj);
public static bool IsWellKnownCultureAwareComparer(System.Collections.Generic.IEqualityComparer<string?>? comparer, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Globalization.CompareInfo? compareInfo, out System.Globalization.CompareOptions compareOptions) { throw null; }
public static bool IsWellKnownOrdinalComparer(System.Collections.Generic.IEqualityComparer<string?>? comparer, out bool ignoreCase) { throw null; }
}
public enum StringComparison
{
CurrentCulture = 0,
CurrentCultureIgnoreCase = 1,
InvariantCulture = 2,
InvariantCultureIgnoreCase = 3,
Ordinal = 4,
OrdinalIgnoreCase = 5,
}
public static partial class StringNormalizationExtensions
{
public static bool IsNormalized(this string strInput) { throw null; }
public static bool IsNormalized(this string strInput, System.Text.NormalizationForm normalizationForm) { throw null; }
public static string Normalize(this string strInput) { throw null; }
public static string Normalize(this string strInput, System.Text.NormalizationForm normalizationForm) { throw null; }
}
[System.FlagsAttribute]
public enum StringSplitOptions
{
None = 0,
RemoveEmptyEntries = 1,
TrimEntries = 2,
}
public partial class SystemException : System.Exception
{
public SystemException() { }
protected SystemException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public SystemException(string? message) { }
public SystemException(string? message, System.Exception? innerException) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public partial class ThreadStaticAttribute : System.Attribute
{
public ThreadStaticAttribute() { }
}
public readonly partial struct TimeOnly : System.IComparable, System.IComparable<System.TimeOnly>, System.IEquatable<System.TimeOnly>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IComparisonOperators<System.TimeOnly, System.TimeOnly>,
System.IMinMaxValue<System.TimeOnly>,
System.ISpanParseable<System.TimeOnly>,
System.ISubtractionOperators<System.TimeOnly, System.TimeOnly, System.TimeSpan>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
public static System.TimeOnly MinValue { get { throw null; } }
public static System.TimeOnly MaxValue { get { throw null; } }
public TimeOnly(int hour, int minute) { throw null; }
public TimeOnly(int hour, int minute, int second) { throw null; }
public TimeOnly(int hour, int minute, int second, int millisecond) { throw null; }
public TimeOnly(long ticks) { throw null; }
public int Hour { get { throw null; } }
public int Minute { get { throw null; } }
public int Second { get { throw null; } }
public int Millisecond { get { throw null; } }
public long Ticks { get { throw null; } }
public System.TimeOnly Add(System.TimeSpan value) { throw null; }
public System.TimeOnly Add(System.TimeSpan value, out int wrappedDays) { throw null; }
public System.TimeOnly AddHours(double value) { throw null; }
public System.TimeOnly AddHours(double value, out int wrappedDays) { throw null; }
public System.TimeOnly AddMinutes(double value) { throw null; }
public System.TimeOnly AddMinutes(double value, out int wrappedDays) { throw null; }
public bool IsBetween(System.TimeOnly start, System.TimeOnly end) { throw null; }
public static bool operator ==(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator >(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator >=(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator !=(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator <(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator <=(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static System.TimeSpan operator -(System.TimeOnly t1, System.TimeOnly t2) { throw null; }
public static System.TimeOnly FromTimeSpan(System.TimeSpan timeSpan) { throw null; }
public static System.TimeOnly FromDateTime(System.DateTime dateTime) { throw null; }
public System.TimeSpan ToTimeSpan() { throw null; }
public int CompareTo(System.TimeOnly value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.TimeOnly value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public static System.TimeOnly Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly ParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, System.IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly ParseExact(System.ReadOnlySpan<char> s, string[] formats) { throw null; }
public static System.TimeOnly ParseExact(System.ReadOnlySpan<char> s, string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly Parse(string s) { throw null; }
public static System.TimeOnly Parse(string s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly ParseExact(string s, string format) { throw null; }
public static System.TimeOnly ParseExact(string s, string format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly ParseExact(string s, string[] formats) { throw null; }
public static System.TimeOnly ParseExact(string s, string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.TimeOnly result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, out System.TimeOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, out System.TimeOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.TimeOnly result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, out System.TimeOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, out System.TimeOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public string ToLongTimeString() { throw null; }
public string ToShortTimeString() { throw null; }
public override string ToString() { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeOnly, System.TimeOnly>.operator <(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeOnly, System.TimeOnly>.operator <=(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeOnly, System.TimeOnly>.operator >(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeOnly, System.TimeOnly>.operator >=(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.TimeOnly, System.TimeOnly>.operator ==(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.TimeOnly, System.TimeOnly>.operator !=(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeOnly IParseable<System.TimeOnly>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.TimeOnly>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.TimeOnly result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeOnly ISpanParseable<System.TimeOnly>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.TimeOnly>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.TimeOnly result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISubtractionOperators<System.TimeOnly, System.TimeOnly, System.TimeSpan>.operator -(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeOnly IMinMaxValue<System.TimeOnly>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeOnly IMinMaxValue<System.TimeOnly>.MaxValue { get { throw null; } }
#endif // FEATURE_GENERIC_MATH
}
public partial class TimeoutException : System.SystemException
{
public TimeoutException() { }
protected TimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TimeoutException(string? message) { }
public TimeoutException(string? message, System.Exception? innerException) { }
}
public readonly partial struct TimeSpan : System.IComparable, System.IComparable<System.TimeSpan>, System.IEquatable<System.TimeSpan>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IAdditionOperators<System.TimeSpan, System.TimeSpan, System.TimeSpan>,
System.IAdditiveIdentity<System.TimeSpan, System.TimeSpan>,
System.IComparisonOperators<System.TimeSpan, System.TimeSpan>,
System.IDivisionOperators<System.TimeSpan, double, System.TimeSpan>,
System.IDivisionOperators<System.TimeSpan, System.TimeSpan, double>,
System.IMinMaxValue<System.TimeSpan>,
System.IMultiplyOperators<System.TimeSpan, double, System.TimeSpan>,
System.IMultiplicativeIdentity<System.TimeSpan, double>,
System.ISpanParseable<System.TimeSpan>,
System.ISubtractionOperators<System.TimeSpan, System.TimeSpan, System.TimeSpan>,
System.IUnaryNegationOperators<System.TimeSpan, System.TimeSpan>,
System.IUnaryPlusOperators<System.TimeSpan, System.TimeSpan>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.TimeSpan MaxValue;
public static readonly System.TimeSpan MinValue;
public const long TicksPerDay = (long)864000000000;
public const long TicksPerHour = (long)36000000000;
public const long TicksPerMillisecond = (long)10000;
public const long TicksPerMinute = (long)600000000;
public const long TicksPerSecond = (long)10000000;
public static readonly System.TimeSpan Zero;
public TimeSpan(int hours, int minutes, int seconds) { throw null; }
public TimeSpan(int days, int hours, int minutes, int seconds) { throw null; }
public TimeSpan(int days, int hours, int minutes, int seconds, int milliseconds) { throw null; }
public TimeSpan(long ticks) { throw null; }
public int Days { get { throw null; } }
public int Hours { get { throw null; } }
public int Milliseconds { get { throw null; } }
public int Minutes { get { throw null; } }
public int Seconds { get { throw null; } }
public long Ticks { get { throw null; } }
public double TotalDays { get { throw null; } }
public double TotalHours { get { throw null; } }
public double TotalMilliseconds { get { throw null; } }
public double TotalMinutes { get { throw null; } }
public double TotalSeconds { get { throw null; } }
public System.TimeSpan Add(System.TimeSpan ts) { throw null; }
public static int Compare(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.TimeSpan value) { throw null; }
public System.TimeSpan Divide(double divisor) { throw null; }
public double Divide(System.TimeSpan ts) { throw null; }
public System.TimeSpan Duration() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public bool Equals(System.TimeSpan obj) { throw null; }
public static bool Equals(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static System.TimeSpan FromDays(double value) { throw null; }
public static System.TimeSpan FromHours(double value) { throw null; }
public static System.TimeSpan FromMilliseconds(double value) { throw null; }
public static System.TimeSpan FromMinutes(double value) { throw null; }
public static System.TimeSpan FromSeconds(double value) { throw null; }
public static System.TimeSpan FromTicks(long value) { throw null; }
public override int GetHashCode() { throw null; }
public System.TimeSpan Multiply(double factor) { throw null; }
public System.TimeSpan Negate() { throw null; }
public static System.TimeSpan operator +(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static System.TimeSpan operator /(System.TimeSpan timeSpan, double divisor) { throw null; }
public static double operator /(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator ==(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator >(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator >=(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator !=(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator <(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator <=(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static System.TimeSpan operator *(double factor, System.TimeSpan timeSpan) { throw null; }
public static System.TimeSpan operator *(System.TimeSpan timeSpan, double factor) { throw null; }
public static System.TimeSpan operator -(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static System.TimeSpan operator -(System.TimeSpan t) { throw null; }
public static System.TimeSpan operator +(System.TimeSpan t) { throw null; }
public static System.TimeSpan Parse(System.ReadOnlySpan<char> input, System.IFormatProvider? formatProvider = null) { throw null; }
public static System.TimeSpan Parse(string s) { throw null; }
public static System.TimeSpan Parse(string input, System.IFormatProvider? formatProvider) { throw null; }
public static System.TimeSpan ParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles = System.Globalization.TimeSpanStyles.None) { throw null; }
public static System.TimeSpan ParseExact(System.ReadOnlySpan<char> input, string[] formats, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles = System.Globalization.TimeSpanStyles.None) { throw null; }
public static System.TimeSpan ParseExact(string input, string format, System.IFormatProvider? formatProvider) { throw null; }
public static System.TimeSpan ParseExact(string input, string format, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles) { throw null; }
public static System.TimeSpan ParseExact(string input, string[] formats, System.IFormatProvider? formatProvider) { throw null; }
public static System.TimeSpan ParseExact(string input, string[] formats, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles) { throw null; }
public System.TimeSpan Subtract(System.TimeSpan ts) { throw null; }
public override string ToString() { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? formatProvider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? formatProvider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.TimeSpan result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.TimeSpan result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles, out System.TimeSpan result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles, out System.TimeSpan result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles, out System.TimeSpan result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles, out System.TimeSpan result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IAdditiveIdentity<System.TimeSpan, System.TimeSpan>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IMinMaxValue<System.TimeSpan>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IMinMaxValue<System.TimeSpan>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMultiplicativeIdentity<System.TimeSpan, double>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IAdditionOperators<System.TimeSpan, System.TimeSpan, System.TimeSpan>.operator +(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeSpan, System.TimeSpan>.operator <(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeSpan, System.TimeSpan>.operator <=(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeSpan, System.TimeSpan>.operator >(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeSpan, System.TimeSpan>.operator >=(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IDivisionOperators<System.TimeSpan, double, System.TimeSpan>.operator /(System.TimeSpan left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IDivisionOperators<System.TimeSpan, System.TimeSpan, double>.operator /(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.TimeSpan, System.TimeSpan>.operator ==(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.TimeSpan, System.TimeSpan>.operator !=(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IMultiplyOperators<System.TimeSpan, double, System.TimeSpan>.operator *(System.TimeSpan left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IParseable<System.TimeSpan>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.TimeSpan>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.TimeSpan result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISpanParseable<System.TimeSpan>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.TimeSpan>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.TimeSpan result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISubtractionOperators<System.TimeSpan, System.TimeSpan, System.TimeSpan>.operator -(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IUnaryNegationOperators<System.TimeSpan, System.TimeSpan>.operator -(System.TimeSpan value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IUnaryPlusOperators<System.TimeSpan, System.TimeSpan>.operator +(System.TimeSpan value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.ObsoleteAttribute("System.TimeZone has been deprecated. Investigate the use of System.TimeZoneInfo instead.")]
public abstract partial class TimeZone
{
protected TimeZone() { }
public static System.TimeZone CurrentTimeZone { get { throw null; } }
public abstract string DaylightName { get; }
public abstract string StandardName { get; }
public abstract System.Globalization.DaylightTime GetDaylightChanges(int year);
public abstract System.TimeSpan GetUtcOffset(System.DateTime time);
public virtual bool IsDaylightSavingTime(System.DateTime time) { throw null; }
public static bool IsDaylightSavingTime(System.DateTime time, System.Globalization.DaylightTime daylightTimes) { throw null; }
public virtual System.DateTime ToLocalTime(System.DateTime time) { throw null; }
public virtual System.DateTime ToUniversalTime(System.DateTime time) { throw null; }
}
public sealed partial class TimeZoneInfo : System.IEquatable<System.TimeZoneInfo?>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
internal TimeZoneInfo() { }
public System.TimeSpan BaseUtcOffset { get { throw null; } }
public string DaylightName { get { throw null; } }
public string DisplayName { get { throw null; } }
public bool HasIanaId { get { throw null; } }
public string Id { get { throw null; } }
public static System.TimeZoneInfo Local { get { throw null; } }
public string StandardName { get { throw null; } }
public bool SupportsDaylightSavingTime { get { throw null; } }
public static System.TimeZoneInfo Utc { get { throw null; } }
public static void ClearCachedData() { }
public static System.DateTime ConvertTime(System.DateTime dateTime, System.TimeZoneInfo destinationTimeZone) { throw null; }
public static System.DateTime ConvertTime(System.DateTime dateTime, System.TimeZoneInfo sourceTimeZone, System.TimeZoneInfo destinationTimeZone) { throw null; }
public static System.DateTimeOffset ConvertTime(System.DateTimeOffset dateTimeOffset, System.TimeZoneInfo destinationTimeZone) { throw null; }
public static System.DateTime ConvertTimeBySystemTimeZoneId(System.DateTime dateTime, string destinationTimeZoneId) { throw null; }
public static System.DateTime ConvertTimeBySystemTimeZoneId(System.DateTime dateTime, string sourceTimeZoneId, string destinationTimeZoneId) { throw null; }
public static System.DateTimeOffset ConvertTimeBySystemTimeZoneId(System.DateTimeOffset dateTimeOffset, string destinationTimeZoneId) { throw null; }
public static System.DateTime ConvertTimeFromUtc(System.DateTime dateTime, System.TimeZoneInfo destinationTimeZone) { throw null; }
public static System.DateTime ConvertTimeToUtc(System.DateTime dateTime) { throw null; }
public static System.DateTime ConvertTimeToUtc(System.DateTime dateTime, System.TimeZoneInfo sourceTimeZone) { throw null; }
public static System.TimeZoneInfo CreateCustomTimeZone(string id, System.TimeSpan baseUtcOffset, string? displayName, string? standardDisplayName) { throw null; }
public static System.TimeZoneInfo CreateCustomTimeZone(string id, System.TimeSpan baseUtcOffset, string? displayName, string? standardDisplayName, string? daylightDisplayName, System.TimeZoneInfo.AdjustmentRule[]? adjustmentRules) { throw null; }
public static System.TimeZoneInfo CreateCustomTimeZone(string id, System.TimeSpan baseUtcOffset, string? displayName, string? standardDisplayName, string? daylightDisplayName, System.TimeZoneInfo.AdjustmentRule[]? adjustmentRules, bool disableDaylightSavingTime) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.TimeZoneInfo? other) { throw null; }
public static System.TimeZoneInfo FindSystemTimeZoneById(string id) { throw null; }
public static System.TimeZoneInfo FromSerializedString(string source) { throw null; }
public System.TimeZoneInfo.AdjustmentRule[] GetAdjustmentRules() { throw null; }
public System.TimeSpan[] GetAmbiguousTimeOffsets(System.DateTime dateTime) { throw null; }
public System.TimeSpan[] GetAmbiguousTimeOffsets(System.DateTimeOffset dateTimeOffset) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Collections.ObjectModel.ReadOnlyCollection<System.TimeZoneInfo> GetSystemTimeZones() { throw null; }
public System.TimeSpan GetUtcOffset(System.DateTime dateTime) { throw null; }
public System.TimeSpan GetUtcOffset(System.DateTimeOffset dateTimeOffset) { throw null; }
public bool HasSameRules(System.TimeZoneInfo other) { throw null; }
public bool IsAmbiguousTime(System.DateTime dateTime) { throw null; }
public bool IsAmbiguousTime(System.DateTimeOffset dateTimeOffset) { throw null; }
public bool IsDaylightSavingTime(System.DateTime dateTime) { throw null; }
public bool IsDaylightSavingTime(System.DateTimeOffset dateTimeOffset) { throw null; }
public bool IsInvalidTime(System.DateTime dateTime) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public string ToSerializedString() { throw null; }
public override string ToString() { throw null; }
public static bool TryConvertIanaIdToWindowsId(string ianaId, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out string? windowsId) { throw null; }
public static bool TryConvertWindowsIdToIanaId(string windowsId, string? region, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out string? ianaId) { throw null; }
public static bool TryConvertWindowsIdToIanaId(string windowsId, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out string? ianaId) { throw null; }
public sealed partial class AdjustmentRule : System.IEquatable<System.TimeZoneInfo.AdjustmentRule?>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
internal AdjustmentRule() { }
public System.TimeSpan BaseUtcOffsetDelta { get { throw null; } }
public System.DateTime DateEnd { get { throw null; } }
public System.DateTime DateStart { get { throw null; } }
public System.TimeSpan DaylightDelta { get { throw null; } }
public System.TimeZoneInfo.TransitionTime DaylightTransitionEnd { get { throw null; } }
public System.TimeZoneInfo.TransitionTime DaylightTransitionStart { get { throw null; } }
public static System.TimeZoneInfo.AdjustmentRule CreateAdjustmentRule(System.DateTime dateStart, System.DateTime dateEnd, System.TimeSpan daylightDelta, System.TimeZoneInfo.TransitionTime daylightTransitionStart, System.TimeZoneInfo.TransitionTime daylightTransitionEnd) { throw null; }
public static System.TimeZoneInfo.AdjustmentRule CreateAdjustmentRule(System.DateTime dateStart, System.DateTime dateEnd, System.TimeSpan daylightDelta, System.TimeZoneInfo.TransitionTime daylightTransitionStart, System.TimeZoneInfo.TransitionTime daylightTransitionEnd, System.TimeSpan baseUtcOffsetDelta) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.TimeZoneInfo.AdjustmentRule? other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public readonly partial struct TransitionTime : System.IEquatable<System.TimeZoneInfo.TransitionTime>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
private readonly int _dummyPrimitive;
public int Day { get { throw null; } }
public System.DayOfWeek DayOfWeek { get { throw null; } }
public bool IsFixedDateRule { get { throw null; } }
public int Month { get { throw null; } }
public System.DateTime TimeOfDay { get { throw null; } }
public int Week { get { throw null; } }
public static System.TimeZoneInfo.TransitionTime CreateFixedDateRule(System.DateTime timeOfDay, int month, int day) { throw null; }
public static System.TimeZoneInfo.TransitionTime CreateFloatingDateRule(System.DateTime timeOfDay, int month, int week, System.DayOfWeek dayOfWeek) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.TimeZoneInfo.TransitionTime other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.TimeZoneInfo.TransitionTime t1, System.TimeZoneInfo.TransitionTime t2) { throw null; }
public static bool operator !=(System.TimeZoneInfo.TransitionTime t1, System.TimeZoneInfo.TransitionTime t2) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
}
public partial class TimeZoneNotFoundException : System.Exception
{
public TimeZoneNotFoundException() { }
protected TimeZoneNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TimeZoneNotFoundException(string? message) { }
public TimeZoneNotFoundException(string? message, System.Exception? innerException) { }
}
public static partial class Tuple
{
public static System.Tuple<T1> Create<T1>(T1 item1) { throw null; }
public static System.Tuple<T1, T2> Create<T1, T2>(T1 item1, T2 item2) { throw null; }
public static System.Tuple<T1, T2, T3> Create<T1, T2, T3>(T1 item1, T2 item2, T3 item3) { throw null; }
public static System.Tuple<T1, T2, T3, T4> Create<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5> Create<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6> Create<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7> Create<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8>> Create<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) { throw null; }
}
public static partial class TupleExtensions
{
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1>(this System.Tuple<T1> value, out T1 item1) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2>(this System.Tuple<T1, T2> value, out T1 item1, out T2 item2) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19, out T20 item20) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20, T21>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19, out T20 item20, out T21 item21) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3>(this System.Tuple<T1, T2, T3> value, out T1 item1, out T2 item2, out T3 item3) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4>(this System.Tuple<T1, T2, T3, T4> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5>(this System.Tuple<T1, T2, T3, T4, T5> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6>(this System.Tuple<T1, T2, T3, T4, T5, T6> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9) { throw null; }
public static System.Tuple<T1> ToTuple<T1>(this System.ValueTuple<T1> value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) value) { throw null; }
public static System.Tuple<T1, T2> ToTuple<T1, T2>(this (T1, T2) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20, T21>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) value) { throw null; }
public static System.Tuple<T1, T2, T3> ToTuple<T1, T2, T3>(this (T1, T2, T3) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4> ToTuple<T1, T2, T3, T4>(this (T1, T2, T3, T4) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5> ToTuple<T1, T2, T3, T4, T5>(this (T1, T2, T3, T4, T5) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6> ToTuple<T1, T2, T3, T4, T5, T6>(this (T1, T2, T3, T4, T5, T6) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7> ToTuple<T1, T2, T3, T4, T5, T6, T7>(this (T1, T2, T3, T4, T5, T6, T7) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8>(this (T1, T2, T3, T4, T5, T6, T7, T8) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9) value) { throw null; }
public static System.ValueTuple<T1> ToValueTuple<T1>(this System.Tuple<T1> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19>>> value) { throw null; }
public static (T1, T2) ToValueTuple<T1, T2>(this System.Tuple<T1, T2> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20, T21>>> value) { throw null; }
public static (T1, T2, T3) ToValueTuple<T1, T2, T3>(this System.Tuple<T1, T2, T3> value) { throw null; }
public static (T1, T2, T3, T4) ToValueTuple<T1, T2, T3, T4>(this System.Tuple<T1, T2, T3, T4> value) { throw null; }
public static (T1, T2, T3, T4, T5) ToValueTuple<T1, T2, T3, T4, T5>(this System.Tuple<T1, T2, T3, T4, T5> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6) ToValueTuple<T1, T2, T3, T4, T5, T6>(this System.Tuple<T1, T2, T3, T4, T5, T6> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7) ToValueTuple<T1, T2, T3, T4, T5, T6, T7>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9>> value) { throw null; }
}
public partial class Tuple<T1> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1) { }
public T1 Item1 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4, T5> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
public T5 Item5 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4, T5, T6> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
public T5 Item5 { get { throw null; } }
public T6 Item6 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4, T5, T6, T7> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
public T5 Item5 { get { throw null; } }
public T6 Item6 { get { throw null; } }
public T7 Item7 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple where TRest : notnull
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
public T5 Item5 { get { throw null; } }
public T6 Item6 { get { throw null; } }
public T7 Item7 { get { throw null; } }
public TRest Rest { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class Type : System.Reflection.MemberInfo, System.Reflection.IReflect
{
public static readonly char Delimiter;
public static readonly System.Type[] EmptyTypes;
public static readonly System.Reflection.MemberFilter FilterAttribute;
public static readonly System.Reflection.MemberFilter FilterName;
public static readonly System.Reflection.MemberFilter FilterNameIgnoreCase;
public static readonly object Missing;
protected Type() { }
public abstract System.Reflection.Assembly Assembly { get; }
public abstract string? AssemblyQualifiedName { get; }
public System.Reflection.TypeAttributes Attributes { get { throw null; } }
public abstract System.Type? BaseType { get; }
public virtual bool ContainsGenericParameters { get { throw null; } }
public virtual System.Reflection.MethodBase? DeclaringMethod { get { throw null; } }
public override System.Type? DeclaringType { get { throw null; } }
public static System.Reflection.Binder DefaultBinder { get { throw null; } }
public abstract string? FullName { get; }
public virtual System.Reflection.GenericParameterAttributes GenericParameterAttributes { get { throw null; } }
public virtual int GenericParameterPosition { get { throw null; } }
public virtual System.Type[] GenericTypeArguments { get { throw null; } }
public abstract System.Guid GUID { get; }
public bool HasElementType { get { throw null; } }
public bool IsAbstract { get { throw null; } }
public bool IsAnsiClass { get { throw null; } }
public bool IsArray { get { throw null; } }
public bool IsAutoClass { get { throw null; } }
public bool IsAutoLayout { get { throw null; } }
public bool IsByRef { get { throw null; } }
public virtual bool IsByRefLike { get { throw null; } }
public bool IsClass { get { throw null; } }
public bool IsCOMObject { get { throw null; } }
public virtual bool IsConstructedGenericType { get { throw null; } }
public bool IsContextful { get { throw null; } }
public virtual bool IsEnum { get { throw null; } }
public bool IsExplicitLayout { get { throw null; } }
public virtual bool IsGenericMethodParameter { get { throw null; } }
public virtual bool IsGenericParameter { get { throw null; } }
public virtual bool IsGenericType { get { throw null; } }
public virtual bool IsGenericTypeDefinition { get { throw null; } }
public virtual bool IsGenericTypeParameter { get { throw null; } }
public bool IsImport { get { throw null; } }
public bool IsInterface { get { throw null; } }
public bool IsLayoutSequential { get { throw null; } }
public bool IsMarshalByRef { get { throw null; } }
public bool IsNested { get { throw null; } }
public bool IsNestedAssembly { get { throw null; } }
public bool IsNestedFamANDAssem { get { throw null; } }
public bool IsNestedFamily { get { throw null; } }
public bool IsNestedFamORAssem { get { throw null; } }
public bool IsNestedPrivate { get { throw null; } }
public bool IsNestedPublic { get { throw null; } }
public bool IsNotPublic { get { throw null; } }
public bool IsPointer { get { throw null; } }
public bool IsPrimitive { get { throw null; } }
public bool IsPublic { get { throw null; } }
public bool IsSealed { get { throw null; } }
public virtual bool IsSecurityCritical { get { throw null; } }
public virtual bool IsSecuritySafeCritical { get { throw null; } }
public virtual bool IsSecurityTransparent { get { throw null; } }
public virtual bool IsSerializable { get { throw null; } }
public virtual bool IsSignatureType { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public virtual bool IsSZArray { get { throw null; } }
public virtual bool IsTypeDefinition { get { throw null; } }
public bool IsUnicodeClass { get { throw null; } }
public bool IsValueType { get { throw null; } }
public virtual bool IsVariableBoundArray { get { throw null; } }
public bool IsVisible { get { throw null; } }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public abstract new System.Reflection.Module Module { get; }
public abstract string? Namespace { get; }
public override System.Type? ReflectedType { get { throw null; } }
public virtual System.Runtime.InteropServices.StructLayoutAttribute? StructLayoutAttribute { get { throw null; } }
public virtual System.RuntimeTypeHandle TypeHandle { get { throw null; } }
public System.Reflection.ConstructorInfo? TypeInitializer { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] get { throw null; } }
public abstract System.Type UnderlyingSystemType { get; }
public override bool Equals(object? o) { throw null; }
public virtual bool Equals(System.Type? o) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public virtual System.Type[] FindInterfaces(System.Reflection.TypeFilter filter, object? filterCriteria) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public virtual System.Reflection.MemberInfo[] FindMembers(System.Reflection.MemberTypes memberType, System.Reflection.BindingFlags bindingAttr, System.Reflection.MemberFilter? filter, object? filterCriteria) { throw null; }
public virtual int GetArrayRank() { throw null; }
protected abstract System.Reflection.TypeAttributes GetAttributeFlagsImpl();
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo? GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo? GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo? GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo? GetConstructor(System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
protected abstract System.Reflection.ConstructorInfo? GetConstructorImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo[] GetConstructors() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public abstract System.Reflection.ConstructorInfo[] GetConstructors(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public virtual System.Reflection.MemberInfo[] GetDefaultMembers() { throw null; }
public abstract System.Type? GetElementType();
public virtual string? GetEnumName(object value) { throw null; }
public virtual string[] GetEnumNames() { throw null; }
public virtual System.Type GetEnumUnderlyingType() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("It might not be possible to create an array of the enum type at runtime. Use Enum.GetValues<TEnum> instead.")]
public virtual System.Array GetEnumValues() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public System.Reflection.EventInfo? GetEvent(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public abstract System.Reflection.EventInfo? GetEvent(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public virtual System.Reflection.EventInfo[] GetEvents() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public abstract System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public System.Reflection.FieldInfo? GetField(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public abstract System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public System.Reflection.FieldInfo[] GetFields() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public abstract System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingAttr);
public virtual System.Type[] GetGenericArguments() { throw null; }
public virtual System.Type[] GetGenericParameterConstraints() { throw null; }
public virtual System.Type GetGenericTypeDefinition() { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public System.Type? GetInterface(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public abstract System.Type? GetInterface(string name, bool ignoreCase);
public virtual System.Reflection.InterfaceMapping GetInterfaceMap([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type interfaceType) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public abstract System.Type[] GetInterfaces();
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.MemberInfo[] GetMember(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public virtual System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public virtual System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.MemberTypes type, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.MemberInfo[] GetMembers() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public abstract System.Reflection.MemberInfo[] GetMembers(System.Reflection.BindingFlags bindingAttr);
public virtual System.Reflection.MemberInfo GetMemberWithSameMetadataDefinitionAs(System.Reflection.MemberInfo member) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, int genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, int genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, int genericParameterCount, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, int genericParameterCount, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
protected virtual System.Reflection.MethodInfo? GetMethodImpl(string name, int genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
protected abstract System.Reflection.MethodInfo? GetMethodImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo[] GetMethods() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public abstract System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public System.Type? GetNestedType(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public abstract System.Type? GetNestedType(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public System.Type[] GetNestedTypes() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public abstract System.Type[] GetNestedTypes(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo[] GetProperties() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public abstract System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type? returnType, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Type? returnType) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Type? returnType, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Type? returnType, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
protected abstract System.Reflection.PropertyInfo? GetPropertyImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type? returnType, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
public new System.Type GetType() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, bool throwOnError) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, bool throwOnError, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly?>? assemblyResolver, System.Func<System.Reflection.Assembly?, string, bool, System.Type?>? typeResolver) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly?>? assemblyResolver, System.Func<System.Reflection.Assembly?, string, bool, System.Type?>? typeResolver, bool throwOnError) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly?>? assemblyResolver, System.Func<System.Reflection.Assembly?, string, bool, System.Type?>? typeResolver, bool throwOnError, bool ignoreCase) { throw null; }
public static System.Type[] GetTypeArray(object[] args) { throw null; }
public static System.TypeCode GetTypeCode(System.Type? type) { throw null; }
protected virtual System.TypeCode GetTypeCodeImpl() { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromCLSID(System.Guid clsid) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromCLSID(System.Guid clsid, bool throwOnError) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromCLSID(System.Guid clsid, string? server) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromCLSID(System.Guid clsid, string? server, bool throwOnError) { throw null; }
public static System.Type? GetTypeFromHandle(System.RuntimeTypeHandle handle) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromProgID(string progID) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromProgID(string progID, bool throwOnError) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromProgID(string progID, string? server) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromProgID(string progID, string? server, bool throwOnError) { throw null; }
public static System.RuntimeTypeHandle GetTypeHandle(object o) { throw null; }
protected abstract bool HasElementTypeImpl();
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args, System.Globalization.CultureInfo? culture) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public abstract object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args, System.Reflection.ParameterModifier[]? modifiers, System.Globalization.CultureInfo? culture, string[]? namedParameters);
protected abstract bool IsArrayImpl();
public virtual bool IsAssignableFrom([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Type? c) { throw null; }
public bool IsAssignableTo([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Type? targetType) { throw null; }
protected abstract bool IsByRefImpl();
protected abstract bool IsCOMObjectImpl();
protected virtual bool IsContextfulImpl() { throw null; }
public virtual bool IsEnumDefined(object value) { throw null; }
public virtual bool IsEquivalentTo([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Type? other) { throw null; }
public virtual bool IsInstanceOfType([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; }
protected virtual bool IsMarshalByRefImpl() { throw null; }
protected abstract bool IsPointerImpl();
protected abstract bool IsPrimitiveImpl();
public virtual bool IsSubclassOf(System.Type c) { throw null; }
protected virtual bool IsValueTypeImpl() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public virtual System.Type MakeArrayType() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public virtual System.Type MakeArrayType(int rank) { throw null; }
public virtual System.Type MakeByRefType() { throw null; }
public static System.Type MakeGenericMethodParameter(int position) { throw null; }
public static System.Type MakeGenericSignatureType(System.Type genericTypeDefinition, params System.Type[] typeArguments) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The native code for this instantiation might not be available at runtime.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
public virtual System.Type MakeGenericType(params System.Type[] typeArguments) { throw null; }
public virtual System.Type MakePointerType() { throw null; }
public static bool operator ==(System.Type? left, System.Type? right) { throw null; }
public static bool operator !=(System.Type? left, System.Type? right) { throw null; }
[System.ObsoleteAttribute("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0018", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Type? ReflectionOnlyGetType(string typeName, bool throwIfNotFound, bool ignoreCase) { throw null; }
public override string ToString() { throw null; }
}
public partial class TypeAccessException : System.TypeLoadException
{
public TypeAccessException() { }
protected TypeAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TypeAccessException(string? message) { }
public TypeAccessException(string? message, System.Exception? inner) { }
}
public enum TypeCode
{
Empty = 0,
Object = 1,
DBNull = 2,
Boolean = 3,
Char = 4,
SByte = 5,
Byte = 6,
Int16 = 7,
UInt16 = 8,
Int32 = 9,
UInt32 = 10,
Int64 = 11,
UInt64 = 12,
Single = 13,
Double = 14,
Decimal = 15,
DateTime = 16,
String = 18,
}
[System.CLSCompliantAttribute(false)]
public ref partial struct TypedReference
{
private object _dummy;
private int _dummyPrimitive;
public override bool Equals(object? o) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Type GetTargetType(System.TypedReference value) { throw null; }
public static System.TypedReference MakeTypedReference(object target, System.Reflection.FieldInfo[] flds) { throw null; }
public static void SetTypedReference(System.TypedReference target, object? value) { }
public static System.RuntimeTypeHandle TargetTypeToken(System.TypedReference value) { throw null; }
public static object ToObject(System.TypedReference value) { throw null; }
}
public sealed partial class TypeInitializationException : System.SystemException
{
public TypeInitializationException(string? fullTypeName, System.Exception? innerException) { }
public string TypeName { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class TypeLoadException : System.SystemException, System.Runtime.Serialization.ISerializable
{
public TypeLoadException() { }
protected TypeLoadException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TypeLoadException(string? message) { }
public TypeLoadException(string? message, System.Exception? inner) { }
public override string Message { get { throw null; } }
public string TypeName { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class TypeUnloadedException : System.SystemException
{
public TypeUnloadedException() { }
protected TypeUnloadedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TypeUnloadedException(string? message) { }
public TypeUnloadedException(string? message, System.Exception? innerException) { }
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct UInt16 : System.IComparable, System.IComparable<ushort>, System.IConvertible, System.IEquatable<ushort>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<ushort>,
System.IMinMaxValue<ushort>,
System.IUnsignedNumber<ushort>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly ushort _dummyPrimitive;
public const ushort MaxValue = (ushort)65535;
public const ushort MinValue = (ushort)0;
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.UInt16 value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.UInt16 obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.UInt16 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.UInt16 Parse(string s) { throw null; }
public static System.UInt16 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.UInt16 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.UInt16 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
System.UInt16 System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt16 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.UInt16 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt16 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UInt16 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IAdditiveIdentity<ushort, ushort>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IMinMaxValue<ushort>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IMinMaxValue<ushort>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IMultiplicativeIdentity<ushort, ushort>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IAdditionOperators<ushort, ushort, ushort>.operator +(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.LeadingZeroCount(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.PopCount(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.RotateLeft(ushort value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.RotateRight(ushort value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.TrailingZeroCount(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<ushort>.IsPow2(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryNumber<ushort>.Log2(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBitwiseOperators<ushort, ushort, ushort>.operator &(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBitwiseOperators<ushort, ushort, ushort>.operator |(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBitwiseOperators<ushort, ushort, ushort>.operator ^(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBitwiseOperators<ushort, ushort, ushort>.operator ~(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ushort, ushort>.operator <(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ushort, ushort>.operator <=(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ushort, ushort>.operator >(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ushort, ushort>.operator >=(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IDecrementOperators<ushort>.operator --(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IDivisionOperators<ushort, ushort, ushort>.operator /(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<ushort, ushort>.operator ==(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<ushort, ushort>.operator !=(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IIncrementOperators<ushort>.operator ++(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IModulusOperators<ushort, ushort, ushort>.operator %(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IMultiplyOperators<ushort, ushort, ushort>.operator *(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Abs(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Clamp(ushort value, ushort min, ushort max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (ushort Quotient, ushort Remainder) INumber<ushort>.DivRem(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Max(ushort x, ushort y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Min(ushort x, ushort y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Sign(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ushort>.TryCreate<TOther>(TOther value, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ushort>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ushort>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IParseable<ushort>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<ushort>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IShiftOperators<ushort, ushort>.operator <<(ushort value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IShiftOperators<ushort, ushort>.operator >>(ushort value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort ISpanParseable<ushort>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<ushort>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort ISubtractionOperators<ushort, ushort, ushort>.operator -(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IUnaryNegationOperators<ushort, ushort>.operator -(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IUnaryPlusOperators<ushort, ushort>.operator +(ushort value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct UInt32 : System.IComparable, System.IComparable<uint>, System.IConvertible, System.IEquatable<uint>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<uint>,
System.IMinMaxValue<uint>,
System.IUnsignedNumber<uint>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly uint _dummyPrimitive;
public const uint MaxValue = (uint)4294967295;
public const uint MinValue = (uint)0;
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.UInt32 value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.UInt32 obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.UInt32 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.UInt32 Parse(string s) { throw null; }
public static System.UInt32 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.UInt32 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.UInt32 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
System.UInt32 System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt32 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.UInt32 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt32 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UInt32 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IAdditiveIdentity<uint, uint>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IMinMaxValue<uint>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IMinMaxValue<uint>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IMultiplicativeIdentity<uint, uint>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IAdditionOperators<uint, uint, uint>.operator +(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.LeadingZeroCount(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.PopCount(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.RotateLeft(uint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.RotateRight(uint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.TrailingZeroCount(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<uint>.IsPow2(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryNumber<uint>.Log2(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBitwiseOperators<uint, uint, uint>.operator &(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBitwiseOperators<uint, uint, uint>.operator |(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBitwiseOperators<uint, uint, uint>.operator ^(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBitwiseOperators<uint, uint, uint>.operator ~(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<uint, uint>.operator <(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<uint, uint>.operator <=(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<uint, uint>.operator >(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<uint, uint>.operator >=(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IDecrementOperators<uint>.operator --(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IDivisionOperators<uint, uint, uint>.operator /(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<uint, uint>.operator ==(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<uint, uint>.operator !=(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IIncrementOperators<uint>.operator ++(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IModulusOperators<uint, uint, uint>.operator %(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IMultiplyOperators<uint, uint, uint>.operator *(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Abs(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Clamp(uint value, uint min, uint max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (uint Quotient, uint Remainder) INumber<uint>.DivRem(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Max(uint x, uint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Min(uint x, uint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Sign(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<uint>.TryCreate<TOther>(TOther value, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<uint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<uint>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IParseable<uint>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<uint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IShiftOperators<uint, uint>.operator <<(uint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IShiftOperators<uint, uint>.operator >>(uint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint ISpanParseable<uint>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<uint>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint ISubtractionOperators<uint, uint, uint>.operator -(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IUnaryNegationOperators<uint, uint>.operator -(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IUnaryPlusOperators<uint, uint>.operator +(uint value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct UInt64 : System.IComparable, System.IComparable<ulong>, System.IConvertible, System.IEquatable<ulong>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<ulong>,
System.IMinMaxValue<ulong>,
System.IUnsignedNumber<ulong>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly ulong _dummyPrimitive;
public const ulong MaxValue = (ulong)18446744073709551615;
public const ulong MinValue = (ulong)0;
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.UInt64 value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.UInt64 obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.UInt64 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.UInt64 Parse(string s) { throw null; }
public static System.UInt64 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.UInt64 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.UInt64 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
System.UInt64 System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt64 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.UInt64 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt64 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UInt64 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IAdditiveIdentity<ulong, ulong>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IMinMaxValue<ulong>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IMinMaxValue<ulong>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IMultiplicativeIdentity<ulong, ulong>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IAdditionOperators<ulong, ulong, ulong>.operator +(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.LeadingZeroCount(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.PopCount(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.RotateLeft(ulong value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.RotateRight(ulong value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.TrailingZeroCount(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<ulong>.IsPow2(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryNumber<ulong>.Log2(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBitwiseOperators<ulong, ulong, ulong>.operator &(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBitwiseOperators<ulong, ulong, ulong>.operator |(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBitwiseOperators<ulong, ulong, ulong>.operator ^(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBitwiseOperators<ulong, ulong, ulong>.operator ~(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ulong, ulong>.operator <(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ulong, ulong>.operator <=(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ulong, ulong>.operator >(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ulong, ulong>.operator >=(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IDecrementOperators<ulong>.operator --(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IDivisionOperators<ulong, ulong, ulong>.operator /(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<ulong, ulong>.operator ==(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<ulong, ulong>.operator !=(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IIncrementOperators<ulong>.operator ++(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IModulusOperators<ulong, ulong, ulong>.operator %(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IMultiplyOperators<ulong, ulong, ulong>.operator *(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Abs(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Clamp(ulong value, ulong min, ulong max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (ulong Quotient, ulong Remainder) INumber<ulong>.DivRem(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Max(ulong x, ulong y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Min(ulong x, ulong y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Sign(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ulong>.TryCreate<TOther>(TOther value, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ulong>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ulong>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IParseable<ulong>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<ulong>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IShiftOperators<ulong, ulong>.operator <<(ulong value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IShiftOperators<ulong, ulong>.operator >>(ulong value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong ISpanParseable<ulong>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<ulong>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong ISubtractionOperators<ulong, ulong, ulong>.operator -(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IUnaryNegationOperators<ulong, ulong>.operator -(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IUnaryPlusOperators<ulong, ulong>.operator +(ulong value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct UIntPtr : System.IComparable, System.IComparable<nuint>, System.IEquatable<nuint>, System.ISpanFormattable, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<nuint>,
System.IMinMaxValue<nuint>,
System.IUnsignedNumber<nuint>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.UIntPtr Zero;
public UIntPtr(uint value) { throw null; }
public UIntPtr(ulong value) { throw null; }
public unsafe UIntPtr(void* value) { throw null; }
public static System.UIntPtr MaxValue { get { throw null; } }
public static System.UIntPtr MinValue { get { throw null; } }
public static int Size { get { throw null; } }
public static System.UIntPtr Add(System.UIntPtr pointer, int offset) { throw null; }
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.UIntPtr value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.UIntPtr other) { throw null; }
public override int GetHashCode() { throw null; }
public static System.UIntPtr operator +(System.UIntPtr pointer, int offset) { throw null; }
public static bool operator ==(System.UIntPtr value1, System.UIntPtr value2) { throw null; }
public static explicit operator System.UIntPtr (uint value) { throw null; }
public static explicit operator System.UIntPtr (ulong value) { throw null; }
public static explicit operator uint (System.UIntPtr value) { throw null; }
public static explicit operator ulong (System.UIntPtr value) { throw null; }
public unsafe static explicit operator void* (System.UIntPtr value) { throw null; }
public unsafe static explicit operator System.UIntPtr (void* value) { throw null; }
public static bool operator !=(System.UIntPtr value1, System.UIntPtr value2) { throw null; }
public static System.UIntPtr operator -(System.UIntPtr pointer, int offset) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static System.UIntPtr Parse(string s) { throw null; }
public static System.UIntPtr Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.UIntPtr Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.UIntPtr Parse(string s, System.IFormatProvider? provider) { throw null; }
public static System.UIntPtr Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.UIntPtr Subtract(System.UIntPtr pointer, int offset) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public unsafe void* ToPointer() { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public uint ToUInt32() { throw null; }
public ulong ToUInt64() { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UIntPtr result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UIntPtr result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.UIntPtr result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UIntPtr result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IAdditiveIdentity<nuint, nuint>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IMinMaxValue<nuint>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IMinMaxValue<nuint>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IMultiplicativeIdentity<nuint, nuint>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IAdditionOperators<nuint, nuint, nuint>.operator +(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.LeadingZeroCount(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.PopCount(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.RotateLeft(nuint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.RotateRight(nuint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.TrailingZeroCount(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<nuint>.IsPow2(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryNumber<nuint>.Log2(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBitwiseOperators<nuint, nuint, nuint>.operator &(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBitwiseOperators<nuint, nuint, nuint>.operator |(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBitwiseOperators<nuint, nuint, nuint>.operator ^(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBitwiseOperators<nuint, nuint, nuint>.operator ~(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nuint, nuint>.operator <(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nuint, nuint>.operator <=(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nuint, nuint>.operator >(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nuint, nuint>.operator >=(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IDecrementOperators<nuint>.operator --(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IDivisionOperators<nuint, nuint, nuint>.operator /(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<nuint, nuint>.operator ==(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<nuint, nuint>.operator !=(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IIncrementOperators<nuint>.operator ++(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IModulusOperators<nuint, nuint, nuint>.operator %(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IMultiplyOperators<nuint, nuint, nuint>.operator *(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Abs(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Clamp(nuint value, nuint min, nuint max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (nuint Quotient, nuint Remainder) INumber<nuint>.DivRem(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Max(nuint x, nuint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Min(nuint x, nuint y) { throw null; }[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Sign(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nuint>.TryCreate<TOther>(TOther value, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nuint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nuint>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IParseable<nuint>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<nuint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IShiftOperators<nuint, nuint>.operator <<(nuint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IShiftOperators<nuint, nuint>.operator >>(nuint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint ISpanParseable<nuint>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<nuint>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint ISubtractionOperators<nuint, nuint, nuint>.operator -(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IUnaryNegationOperators<nuint, nuint>.operator -(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IUnaryPlusOperators<nuint, nuint>.operator +(nuint value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial class UnauthorizedAccessException : System.SystemException
{
public UnauthorizedAccessException() { }
protected UnauthorizedAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public UnauthorizedAccessException(string? message) { }
public UnauthorizedAccessException(string? message, System.Exception? inner) { }
}
public partial class UnhandledExceptionEventArgs : System.EventArgs
{
public UnhandledExceptionEventArgs(object exception, bool isTerminating) { }
public object ExceptionObject { get { throw null; } }
public bool IsTerminating { get { throw null; } }
}
public delegate void UnhandledExceptionEventHandler(object sender, System.UnhandledExceptionEventArgs e);
public partial class Uri : System.Runtime.Serialization.ISerializable
{
public static readonly string SchemeDelimiter;
public static readonly string UriSchemeFile;
public static readonly string UriSchemeFtp;
public static readonly string UriSchemeFtps;
public static readonly string UriSchemeGopher;
public static readonly string UriSchemeHttp;
public static readonly string UriSchemeHttps;
public static readonly string UriSchemeMailto;
public static readonly string UriSchemeNetPipe;
public static readonly string UriSchemeNetTcp;
public static readonly string UriSchemeNews;
public static readonly string UriSchemeNntp;
public static readonly string UriSchemeSftp;
public static readonly string UriSchemeSsh;
public static readonly string UriSchemeTelnet;
public static readonly string UriSchemeWs;
public static readonly string UriSchemeWss;
protected Uri(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public Uri(string uriString) { }
[System.ObsoleteAttribute("This constructor has been deprecated; the dontEscape parameter is always false. Use Uri(string) instead.")]
public Uri(string uriString, bool dontEscape) { }
public Uri(string uriString, in System.UriCreationOptions creationOptions) { }
public Uri(string uriString, System.UriKind uriKind) { }
public Uri(System.Uri baseUri, string? relativeUri) { }
[System.ObsoleteAttribute("This constructor has been deprecated; the dontEscape parameter is always false. Use Uri(Uri, string) instead.")]
public Uri(System.Uri baseUri, string? relativeUri, bool dontEscape) { }
public Uri(System.Uri baseUri, System.Uri relativeUri) { }
public string AbsolutePath { get { throw null; } }
public string AbsoluteUri { get { throw null; } }
public string Authority { get { throw null; } }
public string DnsSafeHost { get { throw null; } }
public string Fragment { get { throw null; } }
public string Host { get { throw null; } }
public System.UriHostNameType HostNameType { get { throw null; } }
public string IdnHost { get { throw null; } }
public bool IsAbsoluteUri { get { throw null; } }
public bool IsDefaultPort { get { throw null; } }
public bool IsFile { get { throw null; } }
public bool IsLoopback { get { throw null; } }
public bool IsUnc { get { throw null; } }
public string LocalPath { get { throw null; } }
public string OriginalString { get { throw null; } }
public string PathAndQuery { get { throw null; } }
public int Port { get { throw null; } }
public string Query { get { throw null; } }
public string Scheme { get { throw null; } }
public string[] Segments { get { throw null; } }
public bool UserEscaped { get { throw null; } }
public string UserInfo { get { throw null; } }
[System.ObsoleteAttribute("Uri.Canonicalize has been deprecated and is not supported.")]
protected virtual void Canonicalize() { }
public static System.UriHostNameType CheckHostName(string? name) { throw null; }
public static bool CheckSchemeName([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? schemeName) { throw null; }
[System.ObsoleteAttribute("Uri.CheckSecurity has been deprecated and is not supported.")]
protected virtual void CheckSecurity() { }
public static int Compare(System.Uri? uri1, System.Uri? uri2, System.UriComponents partsToCompare, System.UriFormat compareFormat, System.StringComparison comparisonType) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? comparand) { throw null; }
[System.ObsoleteAttribute("Uri.Escape has been deprecated and is not supported.")]
protected virtual void Escape() { }
public static string EscapeDataString(string stringToEscape) { throw null; }
[System.ObsoleteAttribute("Uri.EscapeString has been deprecated. Use GetComponents() or Uri.EscapeDataString to escape a Uri component or a string.")]
protected static string EscapeString(string? str) { throw null; }
[System.ObsoleteAttribute("Uri.EscapeUriString can corrupt the Uri string in some cases. Consider using Uri.EscapeDataString for query string components instead.", DiagnosticId = "SYSLIB0013", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static string EscapeUriString(string stringToEscape) { throw null; }
public static int FromHex(char digit) { throw null; }
public string GetComponents(System.UriComponents components, System.UriFormat format) { throw null; }
public override int GetHashCode() { throw null; }
public string GetLeftPart(System.UriPartial part) { throw null; }
protected void GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public static string HexEscape(char character) { throw null; }
public static char HexUnescape(string pattern, ref int index) { throw null; }
[System.ObsoleteAttribute("Uri.IsBadFileSystemCharacter has been deprecated and is not supported.")]
protected virtual bool IsBadFileSystemCharacter(char character) { throw null; }
public bool IsBaseOf(System.Uri uri) { throw null; }
[System.ObsoleteAttribute("Uri.IsExcludedCharacter has been deprecated and is not supported.")]
protected static bool IsExcludedCharacter(char character) { throw null; }
public static bool IsHexDigit(char character) { throw null; }
public static bool IsHexEncoding(string pattern, int index) { throw null; }
[System.ObsoleteAttribute("Uri.IsReservedCharacter has been deprecated and is not supported.")]
protected virtual bool IsReservedCharacter(char character) { throw null; }
public bool IsWellFormedOriginalString() { throw null; }
public static bool IsWellFormedUriString([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? uriString, System.UriKind uriKind) { throw null; }
[System.ObsoleteAttribute("Uri.MakeRelative has been deprecated. Use MakeRelativeUri(Uri uri) instead.")]
public string MakeRelative(System.Uri toUri) { throw null; }
public System.Uri MakeRelativeUri(System.Uri uri) { throw null; }
public static bool operator ==(System.Uri? uri1, System.Uri? uri2) { throw null; }
public static bool operator !=(System.Uri? uri1, System.Uri? uri2) { throw null; }
[System.ObsoleteAttribute("Uri.Parse has been deprecated and is not supported.")]
protected virtual void Parse() { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public override string ToString() { throw null; }
public static bool TryCreate([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? uriString, in System.UriCreationOptions creationOptions, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Uri? result) { throw null; }
public static bool TryCreate([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? uriString, System.UriKind uriKind, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Uri? result) { throw null; }
public static bool TryCreate(System.Uri? baseUri, string? relativeUri, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Uri? result) { throw null; }
public static bool TryCreate(System.Uri? baseUri, System.Uri? relativeUri, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Uri? result) { throw null; }
[System.ObsoleteAttribute("Uri.Unescape has been deprecated. Use GetComponents() or Uri.UnescapeDataString() to unescape a Uri component or a string.")]
protected virtual string Unescape(string path) { throw null; }
public static string UnescapeDataString(string stringToUnescape) { throw null; }
}
public partial class UriBuilder
{
public UriBuilder() { }
public UriBuilder(string uri) { }
public UriBuilder(string? schemeName, string? hostName) { }
public UriBuilder(string? scheme, string? host, int portNumber) { }
public UriBuilder(string? scheme, string? host, int port, string? pathValue) { }
public UriBuilder(string? scheme, string? host, int port, string? path, string? extraValue) { }
public UriBuilder(System.Uri uri) { }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Fragment { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Host { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Password { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Path { get { throw null; } set { } }
public int Port { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Query { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Scheme { get { throw null; } set { } }
public System.Uri Uri { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string UserName { get { throw null; } set { } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? rparam) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum UriComponents
{
SerializationInfoString = -2147483648,
Scheme = 1,
UserInfo = 2,
Host = 4,
Port = 8,
SchemeAndServer = 13,
Path = 16,
Query = 32,
PathAndQuery = 48,
HttpRequestUrl = 61,
Fragment = 64,
AbsoluteUri = 127,
StrongPort = 128,
HostAndPort = 132,
StrongAuthority = 134,
NormalizedHost = 256,
KeepDelimiter = 1073741824,
}
public partial struct UriCreationOptions
{
private int _dummyPrimitive;
public bool DangerousDisablePathAndQueryCanonicalization { readonly get { throw null; } set { } }
}
public enum UriFormat
{
UriEscaped = 1,
Unescaped = 2,
SafeUnescaped = 3,
}
public partial class UriFormatException : System.FormatException, System.Runtime.Serialization.ISerializable
{
public UriFormatException() { }
protected UriFormatException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public UriFormatException(string? textString) { }
public UriFormatException(string? textString, System.Exception? e) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
}
public enum UriHostNameType
{
Unknown = 0,
Basic = 1,
Dns = 2,
IPv4 = 3,
IPv6 = 4,
}
public enum UriKind
{
RelativeOrAbsolute = 0,
Absolute = 1,
Relative = 2,
}
public abstract partial class UriParser
{
protected UriParser() { }
protected virtual string GetComponents(System.Uri uri, System.UriComponents components, System.UriFormat format) { throw null; }
protected virtual void InitializeAndValidate(System.Uri uri, out System.UriFormatException? parsingError) { throw null; }
protected virtual bool IsBaseOf(System.Uri baseUri, System.Uri relativeUri) { throw null; }
public static bool IsKnownScheme(string schemeName) { throw null; }
protected virtual bool IsWellFormedOriginalString(System.Uri uri) { throw null; }
protected virtual System.UriParser OnNewUri() { throw null; }
protected virtual void OnRegister(string schemeName, int defaultPort) { }
public static void Register(System.UriParser uriParser, string schemeName, int defaultPort) { }
protected virtual string? Resolve(System.Uri baseUri, System.Uri? relativeUri, out System.UriFormatException? parsingError) { throw null; }
}
public enum UriPartial
{
Scheme = 0,
Authority = 1,
Path = 2,
Query = 3,
}
public partial struct ValueTuple : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<System.ValueTuple>, System.IEquatable<System.ValueTuple>, System.Runtime.CompilerServices.ITuple
{
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo(System.ValueTuple other) { throw null; }
public static System.ValueTuple Create() { throw null; }
public static System.ValueTuple<T1> Create<T1>(T1 item1) { throw null; }
public static (T1, T2) Create<T1, T2>(T1 item1, T2 item2) { throw null; }
public static (T1, T2, T3) Create<T1, T2, T3>(T1 item1, T2 item2, T3 item3) { throw null; }
public static (T1, T2, T3, T4) Create<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4) { throw null; }
public static (T1, T2, T3, T4, T5) Create<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { throw null; }
public static (T1, T2, T3, T4, T5, T6) Create<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7) Create<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8) Create<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.ValueTuple other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<System.ValueTuple<T1>>, System.IEquatable<System.ValueTuple<T1>>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public ValueTuple(T1 item1) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo(System.ValueTuple<T1> other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.ValueTuple<T1> other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2)>, System.IEquatable<(T1, T2)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public ValueTuple(T1 item1, T2 item2) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3)>, System.IEquatable<(T1, T2, T3)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public ValueTuple(T1 item1, T2 item2, T3 item3) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3, T4)>, System.IEquatable<(T1, T2, T3, T4)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3, T4) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3, T4) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4, T5> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3, T4, T5)>, System.IEquatable<(T1, T2, T3, T4, T5)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3, T4, T5) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3, T4, T5) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4, T5, T6> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3, T4, T5, T6)>, System.IEquatable<(T1, T2, T3, T4, T5, T6)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
public T6 Item6;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3, T4, T5, T6) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3, T4, T5, T6) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4, T5, T6, T7> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3, T4, T5, T6, T7)>, System.IEquatable<(T1, T2, T3, T4, T5, T6, T7)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
public T6 Item6;
public T7 Item7;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3, T4, T5, T6, T7) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3, T4, T5, T6, T7) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>>, System.IEquatable<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>>, System.Runtime.CompilerServices.ITuple where TRest : struct
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
public T6 Item6;
public T7 Item7;
public TRest Rest;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo(System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class ValueType
{
protected ValueType() { }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public override string? ToString() { throw null; }
}
public sealed partial class Version : System.ICloneable, System.IComparable, System.IComparable<System.Version?>, System.IEquatable<System.Version?>, System.IFormattable, System.ISpanFormattable
{
public Version() { }
public Version(int major, int minor) { }
public Version(int major, int minor, int build) { }
public Version(int major, int minor, int build, int revision) { }
public Version(string version) { }
public int Build { get { throw null; } }
public int Major { get { throw null; } }
public short MajorRevision { get { throw null; } }
public int Minor { get { throw null; } }
public short MinorRevision { get { throw null; } }
public int Revision { get { throw null; } }
public object Clone() { throw null; }
public int CompareTo(object? version) { throw null; }
public int CompareTo(System.Version? value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Version? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator >(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator >=(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator !=(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator <(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator <=(System.Version? v1, System.Version? v2) { throw null; }
public static System.Version Parse(System.ReadOnlySpan<char> input) { throw null; }
public static System.Version Parse(string input) { throw null; }
string System.IFormattable.ToString(string? format, System.IFormatProvider? formatProvider) { throw null; }
bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(int fieldCount) { throw null; }
public bool TryFormat(System.Span<char> destination, int fieldCount, out int charsWritten) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Version? result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Version? result) { throw null; }
}
public partial struct Void
{
}
public partial class WeakReference : System.Runtime.Serialization.ISerializable
{
public WeakReference(object? target) { }
public WeakReference(object? target, bool trackResurrection) { }
protected WeakReference(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public virtual bool IsAlive { get { throw null; } }
public virtual object? Target { get { throw null; } set { } }
public virtual bool TrackResurrection { get { throw null; } }
~WeakReference() { }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public sealed partial class WeakReference<T> : System.Runtime.Serialization.ISerializable where T : class?
{
public WeakReference(T target) { }
public WeakReference(T target, bool trackResurrection) { }
~WeakReference() { }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public void SetTarget(T target) { }
public bool TryGetTarget([System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false), System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out T target) { throw null; }
}
}
namespace System.Buffers
{
public abstract partial class ArrayPool<T>
{
protected ArrayPool() { }
public static System.Buffers.ArrayPool<T> Shared { get { throw null; } }
public static System.Buffers.ArrayPool<T> Create() { throw null; }
public static System.Buffers.ArrayPool<T> Create(int maxArrayLength, int maxArraysPerBucket) { throw null; }
public abstract T[] Rent(int minimumLength);
public abstract void Return(T[] array, bool clearArray = false);
}
public partial interface IMemoryOwner<T> : System.IDisposable
{
System.Memory<T> Memory { get; }
}
public partial interface IPinnable
{
System.Buffers.MemoryHandle Pin(int elementIndex);
void Unpin();
}
public partial struct MemoryHandle : System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
[System.CLSCompliantAttribute(false)]
public unsafe MemoryHandle(void* pointer, System.Runtime.InteropServices.GCHandle handle = default(System.Runtime.InteropServices.GCHandle), System.Buffers.IPinnable? pinnable = null) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe void* Pointer { get { throw null; } }
public void Dispose() { }
}
public abstract partial class MemoryManager<T> : System.Buffers.IMemoryOwner<T>, System.Buffers.IPinnable, System.IDisposable
{
protected MemoryManager() { }
public virtual System.Memory<T> Memory { get { throw null; } }
protected System.Memory<T> CreateMemory(int length) { throw null; }
protected System.Memory<T> CreateMemory(int start, int length) { throw null; }
protected abstract void Dispose(bool disposing);
public abstract System.Span<T> GetSpan();
public abstract System.Buffers.MemoryHandle Pin(int elementIndex = 0);
void System.IDisposable.Dispose() { }
protected internal virtual bool TryGetArray(out System.ArraySegment<T> segment) { throw null; }
public abstract void Unpin();
}
public enum OperationStatus
{
Done = 0,
DestinationTooSmall = 1,
NeedMoreData = 2,
InvalidData = 3,
}
public delegate void ReadOnlySpanAction<T, in TArg>(System.ReadOnlySpan<T> span, TArg arg);
public delegate void SpanAction<T, in TArg>(System.Span<T> span, TArg arg);
}
namespace System.CodeDom.Compiler
{
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false, AllowMultiple=false)]
public sealed partial class GeneratedCodeAttribute : System.Attribute
{
public GeneratedCodeAttribute(string? tool, string? version) { }
public string? Tool { get { throw null; } }
public string? Version { get { throw null; } }
}
public partial class IndentedTextWriter : System.IO.TextWriter
{
public const string DefaultTabString = " ";
public IndentedTextWriter(System.IO.TextWriter writer) { }
public IndentedTextWriter(System.IO.TextWriter writer, string tabString) { }
public override System.Text.Encoding Encoding { get { throw null; } }
public int Indent { get { throw null; } set { } }
public System.IO.TextWriter InnerWriter { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public override string NewLine { get { throw null; } set { } }
public override void Close() { }
public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync() { throw null; }
protected virtual void OutputTabs() { }
protected virtual System.Threading.Tasks.Task OutputTabsAsync() { throw null; }
public override void Write(bool value) { }
public override void Write(char value) { }
public override void Write(char[]? buffer) { }
public override void Write(char[] buffer, int index, int count) { }
public override void Write(double value) { }
public override void Write(int value) { }
public override void Write(long value) { }
public override void Write(object? value) { }
public override void Write(float value) { }
public override void Write(string? s) { }
public override void Write(string format, object? arg0) { }
public override void Write(string format, object? arg0, object? arg1) { }
public override void Write(string format, params object?[] arg) { }
public override System.Threading.Tasks.Task WriteAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(string? value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteLine() { }
public override void WriteLine(bool value) { }
public override void WriteLine(char value) { }
public override void WriteLine(char[]? buffer) { }
public override void WriteLine(char[] buffer, int index, int count) { }
public override void WriteLine(double value) { }
public override void WriteLine(int value) { }
public override void WriteLine(long value) { }
public override void WriteLine(object? value) { }
public override void WriteLine(float value) { }
public override void WriteLine(string? s) { }
public override void WriteLine(string format, object? arg0) { }
public override void WriteLine(string format, object? arg0, object? arg1) { }
public override void WriteLine(string format, params object?[] arg) { }
[System.CLSCompliantAttribute(false)]
public override void WriteLine(uint value) { }
public override System.Threading.Tasks.Task WriteLineAsync() { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(string? value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public void WriteLineNoTabs(string? s) { }
public System.Threading.Tasks.Task WriteLineNoTabsAsync(string? s) { throw null; }
}
}
namespace System.Collections
{
public partial class ArrayList : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ICloneable
{
public ArrayList() { }
public ArrayList(System.Collections.ICollection c) { }
public ArrayList(int capacity) { }
public virtual int Capacity { get { throw null; } set { } }
public virtual int Count { get { throw null; } }
public virtual bool IsFixedSize { get { throw null; } }
public virtual bool IsReadOnly { get { throw null; } }
public virtual bool IsSynchronized { get { throw null; } }
public virtual object? this[int index] { get { throw null; } set { } }
public virtual object SyncRoot { get { throw null; } }
public static System.Collections.ArrayList Adapter(System.Collections.IList list) { throw null; }
public virtual int Add(object? value) { throw null; }
public virtual void AddRange(System.Collections.ICollection c) { }
public virtual int BinarySearch(int index, int count, object? value, System.Collections.IComparer? comparer) { throw null; }
public virtual int BinarySearch(object? value) { throw null; }
public virtual int BinarySearch(object? value, System.Collections.IComparer? comparer) { throw null; }
public virtual void Clear() { }
public virtual object Clone() { throw null; }
public virtual bool Contains(object? item) { throw null; }
public virtual void CopyTo(System.Array array) { }
public virtual void CopyTo(System.Array array, int arrayIndex) { }
public virtual void CopyTo(int index, System.Array array, int arrayIndex, int count) { }
public static System.Collections.ArrayList FixedSize(System.Collections.ArrayList list) { throw null; }
public static System.Collections.IList FixedSize(System.Collections.IList list) { throw null; }
public virtual System.Collections.IEnumerator GetEnumerator() { throw null; }
public virtual System.Collections.IEnumerator GetEnumerator(int index, int count) { throw null; }
public virtual System.Collections.ArrayList GetRange(int index, int count) { throw null; }
public virtual int IndexOf(object? value) { throw null; }
public virtual int IndexOf(object? value, int startIndex) { throw null; }
public virtual int IndexOf(object? value, int startIndex, int count) { throw null; }
public virtual void Insert(int index, object? value) { }
public virtual void InsertRange(int index, System.Collections.ICollection c) { }
public virtual int LastIndexOf(object? value) { throw null; }
public virtual int LastIndexOf(object? value, int startIndex) { throw null; }
public virtual int LastIndexOf(object? value, int startIndex, int count) { throw null; }
public static System.Collections.ArrayList ReadOnly(System.Collections.ArrayList list) { throw null; }
public static System.Collections.IList ReadOnly(System.Collections.IList list) { throw null; }
public virtual void Remove(object? obj) { }
public virtual void RemoveAt(int index) { }
public virtual void RemoveRange(int index, int count) { }
public static System.Collections.ArrayList Repeat(object? value, int count) { throw null; }
public virtual void Reverse() { }
public virtual void Reverse(int index, int count) { }
public virtual void SetRange(int index, System.Collections.ICollection c) { }
public virtual void Sort() { }
public virtual void Sort(System.Collections.IComparer? comparer) { }
public virtual void Sort(int index, int count, System.Collections.IComparer? comparer) { }
public static System.Collections.ArrayList Synchronized(System.Collections.ArrayList list) { throw null; }
public static System.Collections.IList Synchronized(System.Collections.IList list) { throw null; }
public virtual object?[] ToArray() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public virtual System.Array ToArray(System.Type type) { throw null; }
public virtual void TrimToSize() { }
}
public sealed partial class Comparer : System.Collections.IComparer, System.Runtime.Serialization.ISerializable
{
public static readonly System.Collections.Comparer Default;
public static readonly System.Collections.Comparer DefaultInvariant;
public Comparer(System.Globalization.CultureInfo culture) { }
public int Compare(object? a, object? b) { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial struct DictionaryEntry
{
private object _dummy;
private int _dummyPrimitive;
public DictionaryEntry(object key, object? value) { throw null; }
public object Key { get { throw null; } set { } }
public object? Value { get { throw null; } set { } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public void Deconstruct(out object key, out object? value) { throw null; }
}
public partial class Hashtable : System.Collections.ICollection, System.Collections.IDictionary, System.Collections.IEnumerable, System.ICloneable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
public Hashtable() { }
public Hashtable(System.Collections.IDictionary d) { }
public Hashtable(System.Collections.IDictionary d, System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(IDictionary, IEqualityComparer) instead.")]
public Hashtable(System.Collections.IDictionary d, System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
public Hashtable(System.Collections.IDictionary d, float loadFactor) { }
public Hashtable(System.Collections.IDictionary d, float loadFactor, System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(IDictionary, float, IEqualityComparer) instead.")]
public Hashtable(System.Collections.IDictionary d, float loadFactor, System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
public Hashtable(System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(IEqualityComparer) instead.")]
public Hashtable(System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
public Hashtable(int capacity) { }
public Hashtable(int capacity, System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(int, IEqualityComparer) instead.")]
public Hashtable(int capacity, System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
public Hashtable(int capacity, float loadFactor) { }
public Hashtable(int capacity, float loadFactor, System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(int, float, IEqualityComparer) instead.")]
public Hashtable(int capacity, float loadFactor, System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
protected Hashtable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
[System.ObsoleteAttribute("Hashtable.comparer has been deprecated. Use the KeyComparer properties instead.")]
protected System.Collections.IComparer? comparer { get { throw null; } set { } }
public virtual int Count { get { throw null; } }
protected System.Collections.IEqualityComparer? EqualityComparer { get { throw null; } }
[System.ObsoleteAttribute("Hashtable.hcp has been deprecated. Use the EqualityComparer property instead.")]
protected System.Collections.IHashCodeProvider? hcp { get { throw null; } set { } }
public virtual bool IsFixedSize { get { throw null; } }
public virtual bool IsReadOnly { get { throw null; } }
public virtual bool IsSynchronized { get { throw null; } }
public virtual object? this[object key] { get { throw null; } set { } }
public virtual System.Collections.ICollection Keys { get { throw null; } }
public virtual object SyncRoot { get { throw null; } }
public virtual System.Collections.ICollection Values { get { throw null; } }
public virtual void Add(object key, object? value) { }
public virtual void Clear() { }
public virtual object Clone() { throw null; }
public virtual bool Contains(object key) { throw null; }
public virtual bool ContainsKey(object key) { throw null; }
public virtual bool ContainsValue(object? value) { throw null; }
public virtual void CopyTo(System.Array array, int arrayIndex) { }
public virtual System.Collections.IDictionaryEnumerator GetEnumerator() { throw null; }
protected virtual int GetHash(object key) { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
protected virtual bool KeyEquals(object? item, object key) { throw null; }
public virtual void OnDeserialization(object? sender) { }
public virtual void Remove(object key) { }
public static System.Collections.Hashtable Synchronized(System.Collections.Hashtable table) { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public partial interface ICollection : System.Collections.IEnumerable
{
int Count { get; }
bool IsSynchronized { get; }
object SyncRoot { get; }
void CopyTo(System.Array array, int index);
}
public partial interface IComparer
{
int Compare(object? x, object? y);
}
public partial interface IDictionary : System.Collections.ICollection, System.Collections.IEnumerable
{
bool IsFixedSize { get; }
bool IsReadOnly { get; }
object? this[object key] { get; set; }
System.Collections.ICollection Keys { get; }
System.Collections.ICollection Values { get; }
void Add(object key, object? value);
void Clear();
bool Contains(object key);
new System.Collections.IDictionaryEnumerator GetEnumerator();
void Remove(object key);
}
public partial interface IDictionaryEnumerator : System.Collections.IEnumerator
{
System.Collections.DictionaryEntry Entry { get; }
object Key { get; }
object? Value { get; }
}
public partial interface IEnumerable
{
System.Collections.IEnumerator GetEnumerator();
}
public partial interface IEnumerator
{
#nullable disable // explicitly leaving Current as "oblivious" to avoid spurious warnings in foreach over non-generic enumerables
object Current { get; }
#nullable restore
bool MoveNext();
void Reset();
}
public partial interface IEqualityComparer
{
bool Equals(object? x, object? y);
int GetHashCode(object obj);
}
[System.ObsoleteAttribute("IHashCodeProvider has been deprecated. Use IEqualityComparer instead.")]
public partial interface IHashCodeProvider
{
int GetHashCode(object obj);
}
public partial interface IList : System.Collections.ICollection, System.Collections.IEnumerable
{
bool IsFixedSize { get; }
bool IsReadOnly { get; }
object? this[int index] { get; set; }
int Add(object? value);
void Clear();
bool Contains(object? value);
int IndexOf(object? value);
void Insert(int index, object? value);
void Remove(object? value);
void RemoveAt(int index);
}
public partial interface IStructuralComparable
{
int CompareTo(object? other, System.Collections.IComparer comparer);
}
public partial interface IStructuralEquatable
{
bool Equals(object? other, System.Collections.IEqualityComparer comparer);
int GetHashCode(System.Collections.IEqualityComparer comparer);
}
}
namespace System.Collections.Generic
{
public partial interface IAsyncEnumerable<out T>
{
System.Collections.Generic.IAsyncEnumerator<T> GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
}
public partial interface IAsyncEnumerator<out T> : System.IAsyncDisposable
{
T Current { get; }
System.Threading.Tasks.ValueTask<bool> MoveNextAsync();
}
public partial interface ICollection<T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
{
int Count { get; }
bool IsReadOnly { get; }
void Add(T item);
void Clear();
bool Contains(T item);
void CopyTo(T[] array, int arrayIndex);
bool Remove(T item);
}
public partial interface IComparer<in T>
{
int Compare(T? x, T? y);
}
public partial interface IDictionary<TKey, TValue> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable
{
TValue this[TKey key] { get; set; }
System.Collections.Generic.ICollection<TKey> Keys { get; }
System.Collections.Generic.ICollection<TValue> Values { get; }
void Add(TKey key, TValue value);
bool ContainsKey(TKey key);
bool Remove(TKey key);
bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value);
}
public partial interface IEnumerable<out T> : System.Collections.IEnumerable
{
new System.Collections.Generic.IEnumerator<T> GetEnumerator();
}
public partial interface IEnumerator<out T> : System.Collections.IEnumerator, System.IDisposable
{
new T Current { get; }
}
public partial interface IEqualityComparer<in T>
{
bool Equals(T? x, T? y);
int GetHashCode([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T obj);
}
public partial interface IList<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
{
T this[int index] { get; set; }
int IndexOf(T item);
void Insert(int index, T item);
void RemoveAt(int index);
}
public partial interface IReadOnlyCollection<out T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
{
int Count { get; }
}
public partial interface IReadOnlyDictionary<TKey, TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable
{
TValue this[TKey key] { get; }
System.Collections.Generic.IEnumerable<TKey> Keys { get; }
System.Collections.Generic.IEnumerable<TValue> Values { get; }
bool ContainsKey(TKey key);
bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value);
}
public partial interface IReadOnlyList<out T> : System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.IEnumerable
{
T this[int index] { get; }
}
public partial interface IReadOnlySet<T> : System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.IEnumerable
{
bool Contains(T item);
bool IsProperSubsetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsProperSupersetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsSubsetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsSupersetOf(System.Collections.Generic.IEnumerable<T> other);
bool Overlaps(System.Collections.Generic.IEnumerable<T> other);
bool SetEquals(System.Collections.Generic.IEnumerable<T> other);
}
public partial interface ISet<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
{
new bool Add(T item);
void ExceptWith(System.Collections.Generic.IEnumerable<T> other);
void IntersectWith(System.Collections.Generic.IEnumerable<T> other);
bool IsProperSubsetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsProperSupersetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsSubsetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsSupersetOf(System.Collections.Generic.IEnumerable<T> other);
bool Overlaps(System.Collections.Generic.IEnumerable<T> other);
bool SetEquals(System.Collections.Generic.IEnumerable<T> other);
void SymmetricExceptWith(System.Collections.Generic.IEnumerable<T> other);
void UnionWith(System.Collections.Generic.IEnumerable<T> other);
}
public partial class KeyNotFoundException : System.SystemException
{
public KeyNotFoundException() { }
protected KeyNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public KeyNotFoundException(string? message) { }
public KeyNotFoundException(string? message, System.Exception? innerException) { }
}
public static partial class KeyValuePair
{
public static System.Collections.Generic.KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey key, TValue value) { throw null; }
}
public readonly partial struct KeyValuePair<TKey, TValue>
{
private readonly TKey key;
private readonly TValue value;
private readonly int _dummyPrimitive;
public KeyValuePair(TKey key, TValue value) { throw null; }
public TKey Key { get { throw null; } }
public TValue Value { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public void Deconstruct(out TKey key, out TValue value) { throw null; }
public override string ToString() { throw null; }
}
}
namespace System.Collections.ObjectModel
{
public partial class Collection<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList
{
public Collection() { }
public Collection(System.Collections.Generic.IList<T> list) { }
public int Count { get { throw null; } }
public T this[int index] { get { throw null; } set { } }
protected System.Collections.Generic.IList<T> Items { get { throw null; } }
bool System.Collections.Generic.ICollection<T>.IsReadOnly { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
bool System.Collections.IList.IsFixedSize { get { throw null; } }
bool System.Collections.IList.IsReadOnly { get { throw null; } }
object? System.Collections.IList.this[int index] { get { throw null; } set { } }
public void Add(T item) { }
public void Clear() { }
protected virtual void ClearItems() { }
public bool Contains(T item) { throw null; }
public void CopyTo(T[] array, int index) { }
public System.Collections.Generic.IEnumerator<T> GetEnumerator() { throw null; }
public int IndexOf(T item) { throw null; }
public void Insert(int index, T item) { }
protected virtual void InsertItem(int index, T item) { }
public bool Remove(T item) { throw null; }
public void RemoveAt(int index) { }
protected virtual void RemoveItem(int index) { }
protected virtual void SetItem(int index, T item) { }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
int System.Collections.IList.Add(object? value) { throw null; }
bool System.Collections.IList.Contains(object? value) { throw null; }
int System.Collections.IList.IndexOf(object? value) { throw null; }
void System.Collections.IList.Insert(int index, object? value) { }
void System.Collections.IList.Remove(object? value) { }
}
public partial class ReadOnlyCollection<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList
{
public ReadOnlyCollection(System.Collections.Generic.IList<T> list) { }
public int Count { get { throw null; } }
public T this[int index] { get { throw null; } }
protected System.Collections.Generic.IList<T> Items { get { throw null; } }
bool System.Collections.Generic.ICollection<T>.IsReadOnly { get { throw null; } }
T System.Collections.Generic.IList<T>.this[int index] { get { throw null; } set { } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
bool System.Collections.IList.IsFixedSize { get { throw null; } }
bool System.Collections.IList.IsReadOnly { get { throw null; } }
object? System.Collections.IList.this[int index] { get { throw null; } set { } }
public bool Contains(T value) { throw null; }
public void CopyTo(T[] array, int index) { }
public System.Collections.Generic.IEnumerator<T> GetEnumerator() { throw null; }
public int IndexOf(T value) { throw null; }
void System.Collections.Generic.ICollection<T>.Add(T value) { }
void System.Collections.Generic.ICollection<T>.Clear() { }
bool System.Collections.Generic.ICollection<T>.Remove(T value) { throw null; }
void System.Collections.Generic.IList<T>.Insert(int index, T value) { }
void System.Collections.Generic.IList<T>.RemoveAt(int index) { }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
int System.Collections.IList.Add(object? value) { throw null; }
void System.Collections.IList.Clear() { }
bool System.Collections.IList.Contains(object? value) { throw null; }
int System.Collections.IList.IndexOf(object? value) { throw null; }
void System.Collections.IList.Insert(int index, object? value) { }
void System.Collections.IList.Remove(object? value) { }
void System.Collections.IList.RemoveAt(int index) { }
}
public partial class ReadOnlyDictionary<TKey, TValue> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IDictionary<TKey, TValue>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>, System.Collections.ICollection, System.Collections.IDictionary, System.Collections.IEnumerable where TKey : notnull
{
public ReadOnlyDictionary(System.Collections.Generic.IDictionary<TKey, TValue> dictionary) { }
public int Count { get { throw null; } }
protected System.Collections.Generic.IDictionary<TKey, TValue> Dictionary { get { throw null; } }
public TValue this[TKey key] { get { throw null; } }
public System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.KeyCollection Keys { get { throw null; } }
bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.IsReadOnly { get { throw null; } }
TValue System.Collections.Generic.IDictionary<TKey, TValue>.this[TKey key] { get { throw null; } set { } }
System.Collections.Generic.ICollection<TKey> System.Collections.Generic.IDictionary<TKey, TValue>.Keys { get { throw null; } }
System.Collections.Generic.ICollection<TValue> System.Collections.Generic.IDictionary<TKey, TValue>.Values { get { throw null; } }
System.Collections.Generic.IEnumerable<TKey> System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>.Keys { get { throw null; } }
System.Collections.Generic.IEnumerable<TValue> System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>.Values { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
bool System.Collections.IDictionary.IsFixedSize { get { throw null; } }
bool System.Collections.IDictionary.IsReadOnly { get { throw null; } }
object? System.Collections.IDictionary.this[object key] { get { throw null; } set { } }
System.Collections.ICollection System.Collections.IDictionary.Keys { get { throw null; } }
System.Collections.ICollection System.Collections.IDictionary.Values { get { throw null; } }
public System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.ValueCollection Values { get { throw null; } }
public bool ContainsKey(TKey key) { throw null; }
public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>> GetEnumerator() { throw null; }
void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Add(System.Collections.Generic.KeyValuePair<TKey, TValue> item) { }
void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Clear() { }
bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Contains(System.Collections.Generic.KeyValuePair<TKey, TValue> item) { throw null; }
void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.CopyTo(System.Collections.Generic.KeyValuePair<TKey, TValue>[] array, int arrayIndex) { }
bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Remove(System.Collections.Generic.KeyValuePair<TKey, TValue> item) { throw null; }
void System.Collections.Generic.IDictionary<TKey, TValue>.Add(TKey key, TValue value) { }
bool System.Collections.Generic.IDictionary<TKey, TValue>.Remove(TKey key) { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
void System.Collections.IDictionary.Add(object key, object? value) { }
void System.Collections.IDictionary.Clear() { }
bool System.Collections.IDictionary.Contains(object key) { throw null; }
System.Collections.IDictionaryEnumerator System.Collections.IDictionary.GetEnumerator() { throw null; }
void System.Collections.IDictionary.Remove(object key) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; }
public sealed partial class KeyCollection : System.Collections.Generic.ICollection<TKey>, System.Collections.Generic.IEnumerable<TKey>, System.Collections.Generic.IReadOnlyCollection<TKey>, System.Collections.ICollection, System.Collections.IEnumerable
{
internal KeyCollection() { }
public int Count { get { throw null; } }
bool System.Collections.Generic.ICollection<TKey>.IsReadOnly { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
public void CopyTo(TKey[] array, int arrayIndex) { }
public System.Collections.Generic.IEnumerator<TKey> GetEnumerator() { throw null; }
void System.Collections.Generic.ICollection<TKey>.Add(TKey item) { }
void System.Collections.Generic.ICollection<TKey>.Clear() { }
bool System.Collections.Generic.ICollection<TKey>.Contains(TKey item) { throw null; }
bool System.Collections.Generic.ICollection<TKey>.Remove(TKey item) { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public sealed partial class ValueCollection : System.Collections.Generic.ICollection<TValue>, System.Collections.Generic.IEnumerable<TValue>, System.Collections.Generic.IReadOnlyCollection<TValue>, System.Collections.ICollection, System.Collections.IEnumerable
{
internal ValueCollection() { }
public int Count { get { throw null; } }
bool System.Collections.Generic.ICollection<TValue>.IsReadOnly { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
public void CopyTo(TValue[] array, int arrayIndex) { }
public System.Collections.Generic.IEnumerator<TValue> GetEnumerator() { throw null; }
void System.Collections.Generic.ICollection<TValue>.Add(TValue item) { }
void System.Collections.Generic.ICollection<TValue>.Clear() { }
bool System.Collections.Generic.ICollection<TValue>.Contains(TValue item) { throw null; }
bool System.Collections.Generic.ICollection<TValue>.Remove(TValue item) { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
}
}
namespace System.ComponentModel
{
[System.AttributeUsageAttribute(System.AttributeTargets.All)]
public partial class DefaultValueAttribute : System.Attribute
{
public DefaultValueAttribute(bool value) { }
public DefaultValueAttribute(byte value) { }
public DefaultValueAttribute(char value) { }
public DefaultValueAttribute(double value) { }
public DefaultValueAttribute(short value) { }
public DefaultValueAttribute(int value) { }
public DefaultValueAttribute(long value) { }
public DefaultValueAttribute(object? value) { }
[System.CLSCompliantAttribute(false)]
public DefaultValueAttribute(sbyte value) { }
public DefaultValueAttribute(float value) { }
public DefaultValueAttribute(string? value) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
public DefaultValueAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, string? value) { }
[System.CLSCompliantAttribute(false)]
public DefaultValueAttribute(ushort value) { }
[System.CLSCompliantAttribute(false)]
public DefaultValueAttribute(uint value) { }
[System.CLSCompliantAttribute(false)]
public DefaultValueAttribute(ulong value) { }
public virtual object? Value { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
protected void SetValue(object? value) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct)]
public sealed partial class EditorBrowsableAttribute : System.Attribute
{
public EditorBrowsableAttribute() { }
public EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState state) { }
public System.ComponentModel.EditorBrowsableState State { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
}
public enum EditorBrowsableState
{
Always = 0,
Never = 1,
Advanced = 2,
}
}
namespace System.Configuration.Assemblies
{
public enum AssemblyHashAlgorithm
{
None = 0,
MD5 = 32771,
SHA1 = 32772,
SHA256 = 32780,
SHA384 = 32781,
SHA512 = 32782,
}
public enum AssemblyVersionCompatibility
{
SameMachine = 1,
SameProcess = 2,
SameDomain = 3,
}
}
namespace System.Diagnostics
{
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true)]
public sealed partial class ConditionalAttribute : System.Attribute
{
public ConditionalAttribute(string conditionString) { }
public string ConditionString { get { throw null; } }
}
public static partial class Debug
{
public static bool AutoFlush { get { throw null; } set { } }
public static int IndentLevel { get { throw null; } set { } }
public static int IndentSize { get { throw null; } set { } }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.AssertInterpolatedStringHandler message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.AssertInterpolatedStringHandler message, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.AssertInterpolatedStringHandler detailMessage) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, string? message, string? detailMessage) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, string? message, string detailMessageFormat, params object?[] args) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Close() { }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Fail(string? message) => throw null;
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Fail(string? message, string? detailMessage) => throw null;
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Flush() { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Indent() { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Print(string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Print(string format, params object?[] args) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Unindent() { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Write(object? value) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Write(object? value, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Write(string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Write(string? message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.WriteIfInterpolatedStringHandler message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.WriteIfInterpolatedStringHandler message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, object? value) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, object? value, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, string? message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(object? value) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(object? value, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(string format, params object?[] args) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(string? message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.WriteIfInterpolatedStringHandler message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.WriteIfInterpolatedStringHandler message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, object? value) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, object? value, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, string? message, string? category) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute]
public partial struct AssertInterpolatedStringHandler
{
private object _dummy;
private int _dummyPrimitive;
public AssertInterpolatedStringHandler(int literalLength, int formattedCount, bool condition, out bool shouldAppend) { throw null; }
public void AppendFormatted(object? value, int alignment = 0, string? format = null) { }
public void AppendFormatted(System.ReadOnlySpan<char> value) { }
public void AppendFormatted(System.ReadOnlySpan<char> value, int alignment = 0, string? format = null) { }
public void AppendFormatted(string? value) { }
public void AppendFormatted(string? value, int alignment = 0, string? format = null) { }
public void AppendFormatted<T>(T value) { }
public void AppendFormatted<T>(T value, int alignment) { }
public void AppendFormatted<T>(T value, int alignment, string? format) { }
public void AppendFormatted<T>(T value, string? format) { }
public void AppendLiteral(string value) { }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute]
public partial struct WriteIfInterpolatedStringHandler
{
private object _dummy;
private int _dummyPrimitive;
public WriteIfInterpolatedStringHandler(int literalLength, int formattedCount, bool condition, out bool shouldAppend) { throw null; }
public void AppendFormatted(object? value, int alignment = 0, string? format = null) { }
public void AppendFormatted(System.ReadOnlySpan<char> value) { }
public void AppendFormatted(System.ReadOnlySpan<char> value, int alignment = 0, string? format = null) { }
public void AppendFormatted(string? value) { }
public void AppendFormatted(string? value, int alignment = 0, string? format = null) { }
public void AppendFormatted<T>(T value) { }
public void AppendFormatted<T>(T value, int alignment) { }
public void AppendFormatted<T>(T value, int alignment, string? format) { }
public void AppendFormatted<T>(T value, string? format) { }
public void AppendLiteral(string value) { }
}
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Module, AllowMultiple=false)]
public sealed partial class DebuggableAttribute : System.Attribute
{
public DebuggableAttribute(bool isJITTrackingEnabled, bool isJITOptimizerDisabled) { }
public DebuggableAttribute(System.Diagnostics.DebuggableAttribute.DebuggingModes modes) { }
public System.Diagnostics.DebuggableAttribute.DebuggingModes DebuggingFlags { get { throw null; } }
public bool IsJITOptimizerDisabled { get { throw null; } }
public bool IsJITTrackingEnabled { get { throw null; } }
[System.FlagsAttribute]
public enum DebuggingModes
{
None = 0,
Default = 1,
IgnoreSymbolStoreSequencePoints = 2,
EnableEditAndContinue = 4,
DisableOptimizations = 256,
}
}
public static partial class Debugger
{
public static readonly string? DefaultCategory;
public static bool IsAttached { get { throw null; } }
public static void Break() { }
public static bool IsLogging() { throw null; }
public static bool Launch() { throw null; }
public static void Log(int level, string? category, string? message) { }
public static void NotifyOfCrossThreadDependency() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false)]
public sealed partial class DebuggerBrowsableAttribute : System.Attribute
{
public DebuggerBrowsableAttribute(System.Diagnostics.DebuggerBrowsableState state) { }
public System.Diagnostics.DebuggerBrowsableState State { get { throw null; } }
}
public enum DebuggerBrowsableState
{
Never = 0,
Collapsed = 2,
RootHidden = 3,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true)]
public sealed partial class DebuggerDisplayAttribute : System.Attribute
{
public DebuggerDisplayAttribute(string? value) { }
public string? Name { get { throw null; } set { } }
public System.Type? Target { get { throw null; } set { } }
public string? TargetTypeName { get { throw null; } set { } }
public string? Type { get { throw null; } set { } }
public string Value { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)]
public sealed partial class DebuggerHiddenAttribute : System.Attribute
{
public DebuggerHiddenAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class DebuggerNonUserCodeAttribute : System.Attribute
{
public DebuggerNonUserCodeAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class DebuggerStepperBoundaryAttribute : System.Attribute
{
public DebuggerStepperBoundaryAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class DebuggerStepThroughAttribute : System.Attribute
{
public DebuggerStepThroughAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=true)]
public sealed partial class DebuggerTypeProxyAttribute : System.Attribute
{
public DebuggerTypeProxyAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string typeName) { }
public DebuggerTypeProxyAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type) { }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public string ProxyTypeName { get { throw null; } }
public System.Type? Target { get { throw null; } set { } }
public string? TargetTypeName { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=true)]
public sealed partial class DebuggerVisualizerAttribute : System.Attribute
{
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string visualizerTypeName) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string visualizerTypeName, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string? visualizerObjectSourceTypeName) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string visualizerTypeName, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizerObjectSource) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizer) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizer, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string? visualizerObjectSourceTypeName) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizer, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizerObjectSource) { }
public string? Description { get { throw null; } set { } }
public System.Type? Target { get { throw null; } set { } }
public string? TargetTypeName { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public string? VisualizerObjectSourceTypeName { get { throw null; } }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public string VisualizerTypeName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class StackTraceHiddenAttribute : System.Attribute
{
public StackTraceHiddenAttribute() { }
}
public partial class Stopwatch
{
public static readonly long Frequency;
public static readonly bool IsHighResolution;
public Stopwatch() { }
public System.TimeSpan Elapsed { get { throw null; } }
public long ElapsedMilliseconds { get { throw null; } }
public long ElapsedTicks { get { throw null; } }
public bool IsRunning { get { throw null; } }
public static long GetTimestamp() { throw null; }
public void Reset() { }
public void Restart() { }
public void Start() { }
public static System.Diagnostics.Stopwatch StartNew() { throw null; }
public void Stop() { }
}
public sealed partial class UnreachableException : System.Exception
{
public UnreachableException() { }
public UnreachableException(string? message) { }
public UnreachableException(string? message, System.Exception? innerException) { }
}
}
namespace System.Diagnostics.CodeAnalysis
{
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, Inherited=false)]
public sealed partial class AllowNullAttribute : System.Attribute
{
public AllowNullAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class ConstantExpectedAttribute : System.Attribute
{
public ConstantExpectedAttribute() { }
public object? Max { get { throw null; } set { } }
public object? Min { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, Inherited=false)]
public sealed partial class DisallowNullAttribute : System.Attribute
{
public DisallowNullAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class DoesNotReturnAttribute : System.Attribute
{
public DoesNotReturnAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class DoesNotReturnIfAttribute : System.Attribute
{
public DoesNotReturnIfAttribute(bool parameterValue) { }
public bool ParameterValue { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.GenericParameter | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class DynamicallyAccessedMembersAttribute : System.Attribute
{
public DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes memberTypes) { }
public System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberTypes { get { throw null; } }
}
[System.FlagsAttribute]
public enum DynamicallyAccessedMemberTypes
{
All = -1,
None = 0,
PublicParameterlessConstructor = 1,
PublicConstructors = 3,
NonPublicConstructors = 4,
PublicMethods = 8,
NonPublicMethods = 16,
PublicFields = 32,
NonPublicFields = 64,
PublicNestedTypes = 128,
NonPublicNestedTypes = 256,
PublicProperties = 512,
NonPublicProperties = 1024,
PublicEvents = 2048,
NonPublicEvents = 4096,
Interfaces = 8192,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Field | System.AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
public sealed partial class DynamicDependencyAttribute : System.Attribute
{
public DynamicDependencyAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes memberTypes, string typeName, string assemblyName) { }
public DynamicDependencyAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes memberTypes, System.Type type) { }
public DynamicDependencyAttribute(string memberSignature) { }
public DynamicDependencyAttribute(string memberSignature, string typeName, string assemblyName) { }
public DynamicDependencyAttribute(string memberSignature, System.Type type) { }
public string? AssemblyName { get { throw null; } }
public string? Condition { get { throw null; } set { } }
public string? MemberSignature { get { throw null; } }
public System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberTypes { get { throw null; } }
public System.Type? Type { get { throw null; } }
public string? TypeName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]
public sealed partial class ExcludeFromCodeCoverageAttribute : System.Attribute
{
public ExcludeFromCodeCoverageAttribute() { }
public string? Justification { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, Inherited=false)]
public sealed partial class MaybeNullAttribute : System.Attribute
{
public MaybeNullAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class MaybeNullWhenAttribute : System.Attribute
{
public MaybeNullWhenAttribute(bool returnValue) { }
public bool ReturnValue { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false, AllowMultiple=true)]
public sealed partial class MemberNotNullAttribute : System.Attribute
{
public MemberNotNullAttribute(string member) { }
public MemberNotNullAttribute(params string[] members) { }
public string[] Members { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false, AllowMultiple=true)]
public sealed partial class MemberNotNullWhenAttribute : System.Attribute
{
public MemberNotNullWhenAttribute(bool returnValue, string member) { }
public MemberNotNullWhenAttribute(bool returnValue, params string[] members) { }
public string[] Members { get { throw null; } }
public bool ReturnValue { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, Inherited=false)]
public sealed partial class NotNullAttribute : System.Attribute
{
public NotNullAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, AllowMultiple=true, Inherited=false)]
public sealed partial class NotNullIfNotNullAttribute : System.Attribute
{
public NotNullIfNotNullAttribute(string parameterName) { }
public string ParameterName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class NotNullWhenAttribute : System.Attribute
{
public NotNullWhenAttribute(bool returnValue) { }
public bool ReturnValue { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false, AllowMultiple=false)]
public sealed partial class RequiresAssemblyFilesAttribute : System.Attribute
{
public RequiresAssemblyFilesAttribute() { }
public RequiresAssemblyFilesAttribute(string message) { }
public string? Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class RequiresDynamicCodeAttribute : System.Attribute
{
public RequiresDynamicCodeAttribute(string message) { }
public string Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class RequiresUnreferencedCodeAttribute : System.Attribute
{
public RequiresUnreferencedCodeAttribute(string message) { }
public string Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsage(System.AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
public sealed class SetsRequiredMembersAttribute : System.Attribute
{
public SetsRequiredMembersAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter | System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed partial class StringSyntaxAttribute : System.Attribute
{
public StringSyntaxAttribute(string syntax) { }
public StringSyntaxAttribute(string syntax, params object?[] arguments) { }
public string Syntax { get { throw null; } }
public object?[] Arguments { get { throw null; } }
public const string DateTimeFormat = "DateTimeFormat";
public const string Json = "Json";
public const string Regex = "Regex";
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false, AllowMultiple=true)]
[System.Diagnostics.ConditionalAttribute("CODE_ANALYSIS")]
public sealed partial class SuppressMessageAttribute : System.Attribute
{
public SuppressMessageAttribute(string category, string checkId) { }
public string Category { get { throw null; } }
public string CheckId { get { throw null; } }
public string? Justification { get { throw null; } set { } }
public string? MessageId { get { throw null; } set { } }
public string? Scope { get { throw null; } set { } }
public string? Target { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false, AllowMultiple=true)]
public sealed partial class UnconditionalSuppressMessageAttribute : System.Attribute
{
public UnconditionalSuppressMessageAttribute(string category, string checkId) { }
public string Category { get { throw null; } }
public string CheckId { get { throw null; } }
public string? Justification { get { throw null; } set { } }
public string? MessageId { get { throw null; } set { } }
public string? Scope { get { throw null; } set { } }
public string? Target { get { throw null; } set { } }
}
}
namespace System.Globalization
{
public abstract partial class Calendar : System.ICloneable
{
public const int CurrentEra = 0;
protected Calendar() { }
public virtual System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
protected virtual int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public abstract int[] Eras { get; }
public bool IsReadOnly { get { throw null; } }
public virtual System.DateTime MaxSupportedDateTime { get { throw null; } }
public virtual System.DateTime MinSupportedDateTime { get { throw null; } }
public virtual int TwoDigitYearMax { get { throw null; } set { } }
public virtual System.DateTime AddDays(System.DateTime time, int days) { throw null; }
public virtual System.DateTime AddHours(System.DateTime time, int hours) { throw null; }
public virtual System.DateTime AddMilliseconds(System.DateTime time, double milliseconds) { throw null; }
public virtual System.DateTime AddMinutes(System.DateTime time, int minutes) { throw null; }
public abstract System.DateTime AddMonths(System.DateTime time, int months);
public virtual System.DateTime AddSeconds(System.DateTime time, int seconds) { throw null; }
public virtual System.DateTime AddWeeks(System.DateTime time, int weeks) { throw null; }
public abstract System.DateTime AddYears(System.DateTime time, int years);
public virtual object Clone() { throw null; }
public abstract int GetDayOfMonth(System.DateTime time);
public abstract System.DayOfWeek GetDayOfWeek(System.DateTime time);
public abstract int GetDayOfYear(System.DateTime time);
public virtual int GetDaysInMonth(int year, int month) { throw null; }
public abstract int GetDaysInMonth(int year, int month, int era);
public virtual int GetDaysInYear(int year) { throw null; }
public abstract int GetDaysInYear(int year, int era);
public abstract int GetEra(System.DateTime time);
public virtual int GetHour(System.DateTime time) { throw null; }
public virtual int GetLeapMonth(int year) { throw null; }
public virtual int GetLeapMonth(int year, int era) { throw null; }
public virtual double GetMilliseconds(System.DateTime time) { throw null; }
public virtual int GetMinute(System.DateTime time) { throw null; }
public abstract int GetMonth(System.DateTime time);
public virtual int GetMonthsInYear(int year) { throw null; }
public abstract int GetMonthsInYear(int year, int era);
public virtual int GetSecond(System.DateTime time) { throw null; }
public virtual int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public abstract int GetYear(System.DateTime time);
public virtual bool IsLeapDay(int year, int month, int day) { throw null; }
public abstract bool IsLeapDay(int year, int month, int day, int era);
public virtual bool IsLeapMonth(int year, int month) { throw null; }
public abstract bool IsLeapMonth(int year, int month, int era);
public virtual bool IsLeapYear(int year) { throw null; }
public abstract bool IsLeapYear(int year, int era);
public static System.Globalization.Calendar ReadOnly(System.Globalization.Calendar calendar) { throw null; }
public virtual System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond) { throw null; }
public abstract System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era);
public virtual int ToFourDigitYear(int year) { throw null; }
}
public enum CalendarAlgorithmType
{
Unknown = 0,
SolarCalendar = 1,
LunarCalendar = 2,
LunisolarCalendar = 3,
}
public enum CalendarWeekRule
{
FirstDay = 0,
FirstFullWeek = 1,
FirstFourDayWeek = 2,
}
public static partial class CharUnicodeInfo
{
public static int GetDecimalDigitValue(char ch) { throw null; }
public static int GetDecimalDigitValue(string s, int index) { throw null; }
public static int GetDigitValue(char ch) { throw null; }
public static int GetDigitValue(string s, int index) { throw null; }
public static double GetNumericValue(char ch) { throw null; }
public static double GetNumericValue(string s, int index) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(char ch) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(int codePoint) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(string s, int index) { throw null; }
}
public partial class ChineseLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
{
public const int ChineseEra = 1;
public ChineseLunisolarCalendar() { }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int GetEra(System.DateTime time) { throw null; }
}
public sealed partial class CompareInfo : System.Runtime.Serialization.IDeserializationCallback
{
internal CompareInfo() { }
public int LCID { get { throw null; } }
public string Name { get { throw null; } }
public System.Globalization.SortVersion Version { get { throw null; } }
public int Compare(System.ReadOnlySpan<char> string1, System.ReadOnlySpan<char> string2, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int Compare(string? string1, int offset1, int length1, string? string2, int offset2, int length2) { throw null; }
public int Compare(string? string1, int offset1, int length1, string? string2, int offset2, int length2, System.Globalization.CompareOptions options) { throw null; }
public int Compare(string? string1, int offset1, string? string2, int offset2) { throw null; }
public int Compare(string? string1, int offset1, string? string2, int offset2, System.Globalization.CompareOptions options) { throw null; }
public int Compare(string? string1, string? string2) { throw null; }
public int Compare(string? string1, string? string2, System.Globalization.CompareOptions options) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static System.Globalization.CompareInfo GetCompareInfo(int culture) { throw null; }
public static System.Globalization.CompareInfo GetCompareInfo(int culture, System.Reflection.Assembly assembly) { throw null; }
public static System.Globalization.CompareInfo GetCompareInfo(string name) { throw null; }
public static System.Globalization.CompareInfo GetCompareInfo(string name, System.Reflection.Assembly assembly) { throw null; }
public override int GetHashCode() { throw null; }
public int GetHashCode(System.ReadOnlySpan<char> source, System.Globalization.CompareOptions options) { throw null; }
public int GetHashCode(string source, System.Globalization.CompareOptions options) { throw null; }
public int GetSortKey(System.ReadOnlySpan<char> source, System.Span<byte> destination, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public System.Globalization.SortKey GetSortKey(string source) { throw null; }
public System.Globalization.SortKey GetSortKey(string source, System.Globalization.CompareOptions options) { throw null; }
public int GetSortKeyLength(System.ReadOnlySpan<char> source, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int IndexOf(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> value, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int IndexOf(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> value, System.Globalization.CompareOptions options, out int matchLength) { throw null; }
public int IndexOf(System.ReadOnlySpan<char> source, System.Text.Rune value, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int IndexOf(string source, char value) { throw null; }
public int IndexOf(string source, char value, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, char value, int startIndex) { throw null; }
public int IndexOf(string source, char value, int startIndex, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, char value, int startIndex, int count) { throw null; }
public int IndexOf(string source, char value, int startIndex, int count, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, string value) { throw null; }
public int IndexOf(string source, string value, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, string value, int startIndex) { throw null; }
public int IndexOf(string source, string value, int startIndex, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, string value, int startIndex, int count) { throw null; }
public int IndexOf(string source, string value, int startIndex, int count, System.Globalization.CompareOptions options) { throw null; }
public bool IsPrefix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> prefix, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public bool IsPrefix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> prefix, System.Globalization.CompareOptions options, out int matchLength) { throw null; }
public bool IsPrefix(string source, string prefix) { throw null; }
public bool IsPrefix(string source, string prefix, System.Globalization.CompareOptions options) { throw null; }
public static bool IsSortable(char ch) { throw null; }
public static bool IsSortable(System.ReadOnlySpan<char> text) { throw null; }
public static bool IsSortable(string text) { throw null; }
public static bool IsSortable(System.Text.Rune value) { throw null; }
public bool IsSuffix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> suffix, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public bool IsSuffix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> suffix, System.Globalization.CompareOptions options, out int matchLength) { throw null; }
public bool IsSuffix(string source, string suffix) { throw null; }
public bool IsSuffix(string source, string suffix, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> value, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int LastIndexOf(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> value, System.Globalization.CompareOptions options, out int matchLength) { throw null; }
public int LastIndexOf(System.ReadOnlySpan<char> source, System.Text.Rune value, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int LastIndexOf(string source, char value) { throw null; }
public int LastIndexOf(string source, char value, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, char value, int startIndex) { throw null; }
public int LastIndexOf(string source, char value, int startIndex, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, char value, int startIndex, int count) { throw null; }
public int LastIndexOf(string source, char value, int startIndex, int count, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, string value) { throw null; }
public int LastIndexOf(string source, string value, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, string value, int startIndex) { throw null; }
public int LastIndexOf(string source, string value, int startIndex, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, string value, int startIndex, int count) { throw null; }
public int LastIndexOf(string source, string value, int startIndex, int count, System.Globalization.CompareOptions options) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum CompareOptions
{
None = 0,
IgnoreCase = 1,
IgnoreNonSpace = 2,
IgnoreSymbols = 4,
IgnoreKanaType = 8,
IgnoreWidth = 16,
OrdinalIgnoreCase = 268435456,
StringSort = 536870912,
Ordinal = 1073741824,
}
public partial class CultureInfo : System.ICloneable, System.IFormatProvider
{
public CultureInfo(int culture) { }
public CultureInfo(int culture, bool useUserOverride) { }
public CultureInfo(string name) { }
public CultureInfo(string name, bool useUserOverride) { }
public virtual System.Globalization.Calendar Calendar { get { throw null; } }
public virtual System.Globalization.CompareInfo CompareInfo { get { throw null; } }
public System.Globalization.CultureTypes CultureTypes { get { throw null; } }
public static System.Globalization.CultureInfo CurrentCulture { get { throw null; } set { } }
public static System.Globalization.CultureInfo CurrentUICulture { get { throw null; } set { } }
public virtual System.Globalization.DateTimeFormatInfo DateTimeFormat { get { throw null; } set { } }
public static System.Globalization.CultureInfo? DefaultThreadCurrentCulture { get { throw null; } set { } }
public static System.Globalization.CultureInfo? DefaultThreadCurrentUICulture { get { throw null; } set { } }
public virtual string DisplayName { get { throw null; } }
public virtual string EnglishName { get { throw null; } }
public string IetfLanguageTag { get { throw null; } }
public static System.Globalization.CultureInfo InstalledUICulture { get { throw null; } }
public static System.Globalization.CultureInfo InvariantCulture { get { throw null; } }
public virtual bool IsNeutralCulture { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public virtual int KeyboardLayoutId { get { throw null; } }
public virtual int LCID { get { throw null; } }
public virtual string Name { get { throw null; } }
public virtual string NativeName { get { throw null; } }
public virtual System.Globalization.NumberFormatInfo NumberFormat { get { throw null; } set { } }
public virtual System.Globalization.Calendar[] OptionalCalendars { get { throw null; } }
public virtual System.Globalization.CultureInfo Parent { get { throw null; } }
public virtual System.Globalization.TextInfo TextInfo { get { throw null; } }
public virtual string ThreeLetterISOLanguageName { get { throw null; } }
public virtual string ThreeLetterWindowsLanguageName { get { throw null; } }
public virtual string TwoLetterISOLanguageName { get { throw null; } }
public bool UseUserOverride { get { throw null; } }
public void ClearCachedData() { }
public virtual object Clone() { throw null; }
public static System.Globalization.CultureInfo CreateSpecificCulture(string name) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public System.Globalization.CultureInfo GetConsoleFallbackUICulture() { throw null; }
public static System.Globalization.CultureInfo GetCultureInfo(int culture) { throw null; }
public static System.Globalization.CultureInfo GetCultureInfo(string name) { throw null; }
public static System.Globalization.CultureInfo GetCultureInfo(string name, bool predefinedOnly) { throw null; }
public static System.Globalization.CultureInfo GetCultureInfo(string name, string altName) { throw null; }
public static System.Globalization.CultureInfo GetCultureInfoByIetfLanguageTag(string name) { throw null; }
public static System.Globalization.CultureInfo[] GetCultures(System.Globalization.CultureTypes types) { throw null; }
public virtual object? GetFormat(System.Type? formatType) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Globalization.CultureInfo ReadOnly(System.Globalization.CultureInfo ci) { throw null; }
public override string ToString() { throw null; }
}
public partial class CultureNotFoundException : System.ArgumentException
{
public CultureNotFoundException() { }
protected CultureNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public CultureNotFoundException(string? message) { }
public CultureNotFoundException(string? message, System.Exception? innerException) { }
public CultureNotFoundException(string? message, int invalidCultureId, System.Exception? innerException) { }
public CultureNotFoundException(string? paramName, int invalidCultureId, string? message) { }
public CultureNotFoundException(string? paramName, string? message) { }
public CultureNotFoundException(string? message, string? invalidCultureName, System.Exception? innerException) { }
public CultureNotFoundException(string? paramName, string? invalidCultureName, string? message) { }
public virtual int? InvalidCultureId { get { throw null; } }
public virtual string? InvalidCultureName { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
[System.FlagsAttribute]
public enum CultureTypes
{
NeutralCultures = 1,
SpecificCultures = 2,
InstalledWin32Cultures = 4,
AllCultures = 7,
UserCustomCulture = 8,
ReplacementCultures = 16,
[System.ObsoleteAttribute("CultureTypes.WindowsOnlyCultures has been deprecated. Use other values in CultureTypes instead.")]
WindowsOnlyCultures = 32,
[System.ObsoleteAttribute("CultureTypes.FrameworkCultures has been deprecated. Use other values in CultureTypes instead.")]
FrameworkCultures = 64,
}
public sealed partial class DateTimeFormatInfo : System.ICloneable, System.IFormatProvider
{
public DateTimeFormatInfo() { }
public string[] AbbreviatedDayNames { get { throw null; } set { } }
public string[] AbbreviatedMonthGenitiveNames { get { throw null; } set { } }
public string[] AbbreviatedMonthNames { get { throw null; } set { } }
public string AMDesignator { get { throw null; } set { } }
public System.Globalization.Calendar Calendar { get { throw null; } set { } }
public System.Globalization.CalendarWeekRule CalendarWeekRule { get { throw null; } set { } }
public static System.Globalization.DateTimeFormatInfo CurrentInfo { get { throw null; } }
public string DateSeparator { get { throw null; } set { } }
public string[] DayNames { get { throw null; } set { } }
public System.DayOfWeek FirstDayOfWeek { get { throw null; } set { } }
public string FullDateTimePattern { get { throw null; } set { } }
public static System.Globalization.DateTimeFormatInfo InvariantInfo { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public string LongDatePattern { get { throw null; } set { } }
public string LongTimePattern { get { throw null; } set { } }
public string MonthDayPattern { get { throw null; } set { } }
public string[] MonthGenitiveNames { get { throw null; } set { } }
public string[] MonthNames { get { throw null; } set { } }
public string NativeCalendarName { get { throw null; } }
public string PMDesignator { get { throw null; } set { } }
public string RFC1123Pattern { get { throw null; } }
public string ShortDatePattern { get { throw null; } set { } }
public string[] ShortestDayNames { get { throw null; } set { } }
public string ShortTimePattern { get { throw null; } set { } }
public string SortableDateTimePattern { get { throw null; } }
public string TimeSeparator { get { throw null; } set { } }
public string UniversalSortableDateTimePattern { get { throw null; } }
public string YearMonthPattern { get { throw null; } set { } }
public object Clone() { throw null; }
public string GetAbbreviatedDayName(System.DayOfWeek dayofweek) { throw null; }
public string GetAbbreviatedEraName(int era) { throw null; }
public string GetAbbreviatedMonthName(int month) { throw null; }
public string[] GetAllDateTimePatterns() { throw null; }
public string[] GetAllDateTimePatterns(char format) { throw null; }
public string GetDayName(System.DayOfWeek dayofweek) { throw null; }
public int GetEra(string eraName) { throw null; }
public string GetEraName(int era) { throw null; }
public object? GetFormat(System.Type? formatType) { throw null; }
public static System.Globalization.DateTimeFormatInfo GetInstance(System.IFormatProvider? provider) { throw null; }
public string GetMonthName(int month) { throw null; }
public string GetShortestDayName(System.DayOfWeek dayOfWeek) { throw null; }
public static System.Globalization.DateTimeFormatInfo ReadOnly(System.Globalization.DateTimeFormatInfo dtfi) { throw null; }
public void SetAllDateTimePatterns(string[] patterns, char format) { }
}
[System.FlagsAttribute]
public enum DateTimeStyles
{
None = 0,
AllowLeadingWhite = 1,
AllowTrailingWhite = 2,
AllowInnerWhite = 4,
AllowWhiteSpaces = 7,
NoCurrentDateDefault = 8,
AdjustToUniversal = 16,
AssumeLocal = 32,
AssumeUniversal = 64,
RoundtripKind = 128,
}
public partial class DaylightTime
{
public DaylightTime(System.DateTime start, System.DateTime end, System.TimeSpan delta) { }
public System.TimeSpan Delta { get { throw null; } }
public System.DateTime End { get { throw null; } }
public System.DateTime Start { get { throw null; } }
}
public enum DigitShapes
{
Context = 0,
None = 1,
NativeNational = 2,
}
public abstract partial class EastAsianLunisolarCalendar : System.Globalization.Calendar
{
internal EastAsianLunisolarCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public int GetCelestialStem(int sexagenaryYear) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public virtual int GetSexagenaryYear(System.DateTime time) { throw null; }
public int GetTerrestrialBranch(int sexagenaryYear) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public static partial class GlobalizationExtensions
{
public static System.StringComparer GetStringComparer(this System.Globalization.CompareInfo compareInfo, System.Globalization.CompareOptions options) { throw null; }
}
public partial class GregorianCalendar : System.Globalization.Calendar
{
public const int ADEra = 1;
public GregorianCalendar() { }
public GregorianCalendar(System.Globalization.GregorianCalendarTypes type) { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public virtual System.Globalization.GregorianCalendarTypes CalendarType { get { throw null; } set { } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public enum GregorianCalendarTypes
{
Localized = 1,
USEnglish = 2,
MiddleEastFrench = 9,
Arabic = 10,
TransliteratedEnglish = 11,
TransliteratedFrench = 12,
}
public partial class HebrewCalendar : System.Globalization.Calendar
{
public static readonly int HebrewEra;
public HebrewCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class HijriCalendar : System.Globalization.Calendar
{
public static readonly int HijriEra;
public HijriCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public int HijriAdjustment { get { throw null; } set { } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public sealed partial class IdnMapping
{
public IdnMapping() { }
public bool AllowUnassigned { get { throw null; } set { } }
public bool UseStd3AsciiRules { get { throw null; } set { } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public string GetAscii(string unicode) { throw null; }
public string GetAscii(string unicode, int index) { throw null; }
public string GetAscii(string unicode, int index, int count) { throw null; }
public override int GetHashCode() { throw null; }
public string GetUnicode(string ascii) { throw null; }
public string GetUnicode(string ascii, int index) { throw null; }
public string GetUnicode(string ascii, int index, int count) { throw null; }
}
public static partial class ISOWeek
{
public static int GetWeekOfYear(System.DateTime date) { throw null; }
public static int GetWeeksInYear(int year) { throw null; }
public static int GetYear(System.DateTime date) { throw null; }
public static System.DateTime GetYearEnd(int year) { throw null; }
public static System.DateTime GetYearStart(int year) { throw null; }
public static System.DateTime ToDateTime(int year, int week, System.DayOfWeek dayOfWeek) { throw null; }
}
public partial class JapaneseCalendar : System.Globalization.Calendar
{
public JapaneseCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class JapaneseLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
{
public const int JapaneseEra = 1;
public JapaneseLunisolarCalendar() { }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int GetEra(System.DateTime time) { throw null; }
}
public partial class JulianCalendar : System.Globalization.Calendar
{
public static readonly int JulianEra;
public JulianCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class KoreanCalendar : System.Globalization.Calendar
{
public const int KoreanEra = 1;
public KoreanCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class KoreanLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
{
public const int GregorianEra = 1;
public KoreanLunisolarCalendar() { }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int GetEra(System.DateTime time) { throw null; }
}
public sealed partial class NumberFormatInfo : System.ICloneable, System.IFormatProvider
{
public NumberFormatInfo() { }
public int CurrencyDecimalDigits { get { throw null; } set { } }
public string CurrencyDecimalSeparator { get { throw null; } set { } }
public string CurrencyGroupSeparator { get { throw null; } set { } }
public int[] CurrencyGroupSizes { get { throw null; } set { } }
public int CurrencyNegativePattern { get { throw null; } set { } }
public int CurrencyPositivePattern { get { throw null; } set { } }
public string CurrencySymbol { get { throw null; } set { } }
public static System.Globalization.NumberFormatInfo CurrentInfo { get { throw null; } }
public System.Globalization.DigitShapes DigitSubstitution { get { throw null; } set { } }
public static System.Globalization.NumberFormatInfo InvariantInfo { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public string NaNSymbol { get { throw null; } set { } }
public string[] NativeDigits { get { throw null; } set { } }
public string NegativeInfinitySymbol { get { throw null; } set { } }
public string NegativeSign { get { throw null; } set { } }
public int NumberDecimalDigits { get { throw null; } set { } }
public string NumberDecimalSeparator { get { throw null; } set { } }
public string NumberGroupSeparator { get { throw null; } set { } }
public int[] NumberGroupSizes { get { throw null; } set { } }
public int NumberNegativePattern { get { throw null; } set { } }
public int PercentDecimalDigits { get { throw null; } set { } }
public string PercentDecimalSeparator { get { throw null; } set { } }
public string PercentGroupSeparator { get { throw null; } set { } }
public int[] PercentGroupSizes { get { throw null; } set { } }
public int PercentNegativePattern { get { throw null; } set { } }
public int PercentPositivePattern { get { throw null; } set { } }
public string PercentSymbol { get { throw null; } set { } }
public string PerMilleSymbol { get { throw null; } set { } }
public string PositiveInfinitySymbol { get { throw null; } set { } }
public string PositiveSign { get { throw null; } set { } }
public object Clone() { throw null; }
public object? GetFormat(System.Type? formatType) { throw null; }
public static System.Globalization.NumberFormatInfo GetInstance(System.IFormatProvider? formatProvider) { throw null; }
public static System.Globalization.NumberFormatInfo ReadOnly(System.Globalization.NumberFormatInfo nfi) { throw null; }
}
[System.FlagsAttribute]
public enum NumberStyles
{
None = 0,
AllowLeadingWhite = 1,
AllowTrailingWhite = 2,
AllowLeadingSign = 4,
Integer = 7,
AllowTrailingSign = 8,
AllowParentheses = 16,
AllowDecimalPoint = 32,
AllowThousands = 64,
Number = 111,
AllowExponent = 128,
Float = 167,
AllowCurrencySymbol = 256,
Currency = 383,
Any = 511,
AllowHexSpecifier = 512,
HexNumber = 515,
}
public partial class PersianCalendar : System.Globalization.Calendar
{
public static readonly int PersianEra;
public PersianCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class RegionInfo
{
public RegionInfo(int culture) { }
public RegionInfo(string name) { }
public virtual string CurrencyEnglishName { get { throw null; } }
public virtual string CurrencyNativeName { get { throw null; } }
public virtual string CurrencySymbol { get { throw null; } }
public static System.Globalization.RegionInfo CurrentRegion { get { throw null; } }
public virtual string DisplayName { get { throw null; } }
public virtual string EnglishName { get { throw null; } }
public virtual int GeoId { get { throw null; } }
public virtual bool IsMetric { get { throw null; } }
public virtual string ISOCurrencySymbol { get { throw null; } }
public virtual string Name { get { throw null; } }
public virtual string NativeName { get { throw null; } }
public virtual string ThreeLetterISORegionName { get { throw null; } }
public virtual string ThreeLetterWindowsRegionName { get { throw null; } }
public virtual string TwoLetterISORegionName { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public sealed partial class SortKey
{
internal SortKey() { }
public byte[] KeyData { get { throw null; } }
public string OriginalString { get { throw null; } }
public static int Compare(System.Globalization.SortKey sortkey1, System.Globalization.SortKey sortkey2) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public sealed partial class SortVersion : System.IEquatable<System.Globalization.SortVersion?>
{
public SortVersion(int fullVersion, System.Guid sortId) { }
public int FullVersion { get { throw null; } }
public System.Guid SortId { get { throw null; } }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Globalization.SortVersion? other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Globalization.SortVersion? left, System.Globalization.SortVersion? right) { throw null; }
public static bool operator !=(System.Globalization.SortVersion? left, System.Globalization.SortVersion? right) { throw null; }
}
public partial class StringInfo
{
public StringInfo() { }
public StringInfo(string value) { }
public int LengthInTextElements { get { throw null; } }
public string String { get { throw null; } set { } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public static string GetNextTextElement(string str) { throw null; }
public static string GetNextTextElement(string str, int index) { throw null; }
public static int GetNextTextElementLength(System.ReadOnlySpan<char> str) { throw null; }
public static int GetNextTextElementLength(string str) { throw null; }
public static int GetNextTextElementLength(string str, int index) { throw null; }
public static System.Globalization.TextElementEnumerator GetTextElementEnumerator(string str) { throw null; }
public static System.Globalization.TextElementEnumerator GetTextElementEnumerator(string str, int index) { throw null; }
public static int[] ParseCombiningCharacters(string str) { throw null; }
public string SubstringByTextElements(int startingTextElement) { throw null; }
public string SubstringByTextElements(int startingTextElement, int lengthInTextElements) { throw null; }
}
public partial class TaiwanCalendar : System.Globalization.Calendar
{
public TaiwanCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class TaiwanLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
{
public TaiwanLunisolarCalendar() { }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int GetEra(System.DateTime time) { throw null; }
}
public partial class TextElementEnumerator : System.Collections.IEnumerator
{
internal TextElementEnumerator() { }
public object Current { get { throw null; } }
public int ElementIndex { get { throw null; } }
public string GetTextElement() { throw null; }
public bool MoveNext() { throw null; }
public void Reset() { }
}
public sealed partial class TextInfo : System.ICloneable, System.Runtime.Serialization.IDeserializationCallback
{
internal TextInfo() { }
public int ANSICodePage { get { throw null; } }
public string CultureName { get { throw null; } }
public int EBCDICCodePage { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public bool IsRightToLeft { get { throw null; } }
public int LCID { get { throw null; } }
public string ListSeparator { get { throw null; } set { } }
public int MacCodePage { get { throw null; } }
public int OEMCodePage { get { throw null; } }
public object Clone() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Globalization.TextInfo ReadOnly(System.Globalization.TextInfo textInfo) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
public char ToLower(char c) { throw null; }
public string ToLower(string str) { throw null; }
public override string ToString() { throw null; }
public string ToTitleCase(string str) { throw null; }
public char ToUpper(char c) { throw null; }
public string ToUpper(string str) { throw null; }
}
public partial class ThaiBuddhistCalendar : System.Globalization.Calendar
{
public const int ThaiBuddhistEra = 1;
public ThaiBuddhistCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
[System.FlagsAttribute]
public enum TimeSpanStyles
{
None = 0,
AssumeNegative = 1,
}
public partial class UmAlQuraCalendar : System.Globalization.Calendar
{
public const int UmAlQuraEra = 1;
public UmAlQuraCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public enum UnicodeCategory
{
UppercaseLetter = 0,
LowercaseLetter = 1,
TitlecaseLetter = 2,
ModifierLetter = 3,
OtherLetter = 4,
NonSpacingMark = 5,
SpacingCombiningMark = 6,
EnclosingMark = 7,
DecimalDigitNumber = 8,
LetterNumber = 9,
OtherNumber = 10,
SpaceSeparator = 11,
LineSeparator = 12,
ParagraphSeparator = 13,
Control = 14,
Format = 15,
Surrogate = 16,
PrivateUse = 17,
ConnectorPunctuation = 18,
DashPunctuation = 19,
OpenPunctuation = 20,
ClosePunctuation = 21,
InitialQuotePunctuation = 22,
FinalQuotePunctuation = 23,
OtherPunctuation = 24,
MathSymbol = 25,
CurrencySymbol = 26,
ModifierSymbol = 27,
OtherSymbol = 28,
OtherNotAssigned = 29,
}
}
namespace System.IO
{
public partial class BinaryReader : System.IDisposable
{
public BinaryReader(System.IO.Stream input) { }
public BinaryReader(System.IO.Stream input, System.Text.Encoding encoding) { }
public BinaryReader(System.IO.Stream input, System.Text.Encoding encoding, bool leaveOpen) { }
public virtual System.IO.Stream BaseStream { get { throw null; } }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected virtual void FillBuffer(int numBytes) { }
public virtual int PeekChar() { throw null; }
public virtual int Read() { throw null; }
public virtual int Read(byte[] buffer, int index, int count) { throw null; }
public virtual int Read(char[] buffer, int index, int count) { throw null; }
public virtual int Read(System.Span<byte> buffer) { throw null; }
public virtual int Read(System.Span<char> buffer) { throw null; }
public int Read7BitEncodedInt() { throw null; }
public long Read7BitEncodedInt64() { throw null; }
public virtual bool ReadBoolean() { throw null; }
public virtual byte ReadByte() { throw null; }
public virtual byte[] ReadBytes(int count) { throw null; }
public virtual char ReadChar() { throw null; }
public virtual char[] ReadChars(int count) { throw null; }
public virtual decimal ReadDecimal() { throw null; }
public virtual double ReadDouble() { throw null; }
public virtual System.Half ReadHalf() { throw null; }
public virtual short ReadInt16() { throw null; }
public virtual int ReadInt32() { throw null; }
public virtual long ReadInt64() { throw null; }
[System.CLSCompliantAttribute(false)]
public virtual sbyte ReadSByte() { throw null; }
public virtual float ReadSingle() { throw null; }
public virtual string ReadString() { throw null; }
[System.CLSCompliantAttribute(false)]
public virtual ushort ReadUInt16() { throw null; }
[System.CLSCompliantAttribute(false)]
public virtual uint ReadUInt32() { throw null; }
[System.CLSCompliantAttribute(false)]
public virtual ulong ReadUInt64() { throw null; }
}
public partial class BinaryWriter : System.IAsyncDisposable, System.IDisposable
{
public static readonly System.IO.BinaryWriter Null;
protected System.IO.Stream OutStream;
protected BinaryWriter() { }
public BinaryWriter(System.IO.Stream output) { }
public BinaryWriter(System.IO.Stream output, System.Text.Encoding encoding) { }
public BinaryWriter(System.IO.Stream output, System.Text.Encoding encoding, bool leaveOpen) { }
public virtual System.IO.Stream BaseStream { get { throw null; } }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public virtual void Flush() { }
public virtual long Seek(int offset, System.IO.SeekOrigin origin) { throw null; }
public virtual void Write(bool value) { }
public virtual void Write(byte value) { }
public virtual void Write(byte[] buffer) { }
public virtual void Write(byte[] buffer, int index, int count) { }
public virtual void Write(char ch) { }
public virtual void Write(char[] chars) { }
public virtual void Write(char[] chars, int index, int count) { }
public virtual void Write(decimal value) { }
public virtual void Write(double value) { }
public virtual void Write(System.Half value) { }
public virtual void Write(short value) { }
public virtual void Write(int value) { }
public virtual void Write(long value) { }
public virtual void Write(System.ReadOnlySpan<byte> buffer) { }
public virtual void Write(System.ReadOnlySpan<char> chars) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(sbyte value) { }
public virtual void Write(float value) { }
public virtual void Write(string value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(ushort value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(uint value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(ulong value) { }
public void Write7BitEncodedInt(int value) { }
public void Write7BitEncodedInt64(long value) { }
}
public sealed partial class BufferedStream : System.IO.Stream
{
public BufferedStream(System.IO.Stream stream) { }
public BufferedStream(System.IO.Stream stream, int bufferSize) { }
public int BufferSize { get { throw null; } }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
public override long Length { get { throw null; } }
public override long Position { get { throw null; } set { } }
public System.IO.Stream UnderlyingStream { get { throw null; } }
public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override void CopyTo(System.IO.Stream destination, int bufferSize) { }
public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; }
protected override void Dispose(bool disposing) { }
public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override int EndRead(System.IAsyncResult asyncResult) { throw null; }
public override void EndWrite(System.IAsyncResult asyncResult) { }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public override int Read(byte[] buffer, int offset, int count) { throw null; }
public override int Read(System.Span<byte> destination) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadByte() { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; }
public override void SetLength(long value) { }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteByte(byte value) { }
}
public static partial class Directory
{
public static System.IO.DirectoryInfo CreateDirectory(string path) { throw null; }
public static System.IO.FileSystemInfo CreateSymbolicLink(string path, string pathToTarget) { throw null; }
public static void Delete(string path) { }
public static void Delete(string path, bool recursive) { }
public static System.Collections.Generic.IEnumerable<string> EnumerateDirectories(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateDirectories(string path, string searchPattern) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateDirectories(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateDirectories(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFiles(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFiles(string path, string searchPattern) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFiles(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFiles(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFileSystemEntries(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static bool Exists([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? path) { throw null; }
public static System.DateTime GetCreationTime(string path) { throw null; }
public static System.DateTime GetCreationTimeUtc(string path) { throw null; }
public static string GetCurrentDirectory() { throw null; }
public static string[] GetDirectories(string path) { throw null; }
public static string[] GetDirectories(string path, string searchPattern) { throw null; }
public static string[] GetDirectories(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static string[] GetDirectories(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static string GetDirectoryRoot(string path) { throw null; }
public static string[] GetFiles(string path) { throw null; }
public static string[] GetFiles(string path, string searchPattern) { throw null; }
public static string[] GetFiles(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static string[] GetFiles(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static string[] GetFileSystemEntries(string path) { throw null; }
public static string[] GetFileSystemEntries(string path, string searchPattern) { throw null; }
public static string[] GetFileSystemEntries(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static string[] GetFileSystemEntries(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static System.DateTime GetLastAccessTime(string path) { throw null; }
public static System.DateTime GetLastAccessTimeUtc(string path) { throw null; }
public static System.DateTime GetLastWriteTime(string path) { throw null; }
public static System.DateTime GetLastWriteTimeUtc(string path) { throw null; }
public static string[] GetLogicalDrives() { throw null; }
public static System.IO.DirectoryInfo? GetParent(string path) { throw null; }
public static void Move(string sourceDirName, string destDirName) { }
public static System.IO.FileSystemInfo? ResolveLinkTarget(string linkPath, bool returnFinalTarget) { throw null; }
public static void SetCreationTime(string path, System.DateTime creationTime) { }
public static void SetCreationTimeUtc(string path, System.DateTime creationTimeUtc) { }
public static void SetCurrentDirectory(string path) { }
public static void SetLastAccessTime(string path, System.DateTime lastAccessTime) { }
public static void SetLastAccessTimeUtc(string path, System.DateTime lastAccessTimeUtc) { }
public static void SetLastWriteTime(string path, System.DateTime lastWriteTime) { }
public static void SetLastWriteTimeUtc(string path, System.DateTime lastWriteTimeUtc) { }
}
public sealed partial class DirectoryInfo : System.IO.FileSystemInfo
{
public DirectoryInfo(string path) { }
public override bool Exists { get { throw null; } }
public override string Name { get { throw null; } }
public System.IO.DirectoryInfo? Parent { get { throw null; } }
public System.IO.DirectoryInfo Root { get { throw null; } }
public void Create() { }
public System.IO.DirectoryInfo CreateSubdirectory(string path) { throw null; }
public override void Delete() { }
public void Delete(bool recursive) { }
public System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo> EnumerateDirectories() { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo> EnumerateDirectories(string searchPattern) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo> EnumerateDirectories(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo> EnumerateDirectories(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileInfo> EnumerateFiles() { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileInfo> EnumerateFiles(string searchPattern) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileInfo> EnumerateFiles(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileInfo> EnumerateFiles(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> EnumerateFileSystemInfos() { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> EnumerateFileSystemInfos(string searchPattern) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> EnumerateFileSystemInfos(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> EnumerateFileSystemInfos(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.IO.DirectoryInfo[] GetDirectories() { throw null; }
public System.IO.DirectoryInfo[] GetDirectories(string searchPattern) { throw null; }
public System.IO.DirectoryInfo[] GetDirectories(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.IO.DirectoryInfo[] GetDirectories(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.IO.FileInfo[] GetFiles() { throw null; }
public System.IO.FileInfo[] GetFiles(string searchPattern) { throw null; }
public System.IO.FileInfo[] GetFiles(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.IO.FileInfo[] GetFiles(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.IO.FileSystemInfo[] GetFileSystemInfos() { throw null; }
public System.IO.FileSystemInfo[] GetFileSystemInfos(string searchPattern) { throw null; }
public System.IO.FileSystemInfo[] GetFileSystemInfos(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.IO.FileSystemInfo[] GetFileSystemInfos(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public void MoveTo(string destDirName) { }
public override string ToString() { throw null; }
}
public partial class DirectoryNotFoundException : System.IO.IOException
{
public DirectoryNotFoundException() { }
protected DirectoryNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public DirectoryNotFoundException(string? message) { }
public DirectoryNotFoundException(string? message, System.Exception? innerException) { }
}
public partial class EndOfStreamException : System.IO.IOException
{
public EndOfStreamException() { }
protected EndOfStreamException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public EndOfStreamException(string? message) { }
public EndOfStreamException(string? message, System.Exception? innerException) { }
}
public partial class EnumerationOptions
{
public EnumerationOptions() { }
public System.IO.FileAttributes AttributesToSkip { get { throw null; } set { } }
public int BufferSize { get { throw null; } set { } }
public bool IgnoreInaccessible { get { throw null; } set { } }
public System.IO.MatchCasing MatchCasing { get { throw null; } set { } }
public System.IO.MatchType MatchType { get { throw null; } set { } }
public int MaxRecursionDepth { get { throw null; } set { } }
public bool RecurseSubdirectories { get { throw null; } set { } }
public bool ReturnSpecialDirectories { get { throw null; } set { } }
}
public static partial class File
{
public static void AppendAllLines(string path, System.Collections.Generic.IEnumerable<string> contents) { }
public static void AppendAllLines(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task AppendAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task AppendAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void AppendAllText(string path, string? contents) { }
public static void AppendAllText(string path, string? contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task AppendAllTextAsync(string path, string? contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task AppendAllTextAsync(string path, string? contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.IO.StreamWriter AppendText(string path) { throw null; }
public static void Copy(string sourceFileName, string destFileName) { }
public static void Copy(string sourceFileName, string destFileName, bool overwrite) { }
public static System.IO.FileStream Create(string path) { throw null; }
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.FileSystemInfo CreateSymbolicLink(string path, string pathToTarget) { throw null; }
public static System.IO.StreamWriter CreateText(string path) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void Decrypt(string path) { }
public static void Delete(string path) { }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void Encrypt(string path) { }
public static bool Exists([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? path) { throw null; }
public static System.IO.FileAttributes GetAttributes(string path) { throw null; }
public static System.DateTime GetCreationTime(string path) { throw null; }
public static System.DateTime GetCreationTimeUtc(string path) { throw null; }
public static System.DateTime GetLastAccessTime(string path) { throw null; }
public static System.DateTime GetLastAccessTimeUtc(string path) { throw null; }
public static System.DateTime GetLastWriteTime(string path) { throw null; }
public static System.DateTime GetLastWriteTimeUtc(string path) { throw null; }
public static void Move(string sourceFileName, string destFileName) { }
public static void Move(string sourceFileName, string destFileName, bool overwrite) { }
public static System.IO.FileStream Open(string path, System.IO.FileMode mode) { throw null; }
public static System.IO.FileStream Open(string path, System.IO.FileMode mode, System.IO.FileAccess access) { throw null; }
public static System.IO.FileStream Open(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) { throw null; }
public static System.IO.FileStream Open(string path, System.IO.FileStreamOptions options) { throw null; }
public static Microsoft.Win32.SafeHandles.SafeFileHandle OpenHandle(string path, System.IO.FileMode mode = System.IO.FileMode.Open, System.IO.FileAccess access = System.IO.FileAccess.Read, System.IO.FileShare share = System.IO.FileShare.Read, System.IO.FileOptions options = System.IO.FileOptions.None, long preallocationSize = (long)0) { throw null; }
public static System.IO.FileStream OpenRead(string path) { throw null; }
public static System.IO.StreamReader OpenText(string path) { throw null; }
public static System.IO.FileStream OpenWrite(string path) { throw null; }
public static byte[] ReadAllBytes(string path) { throw null; }
public static System.Threading.Tasks.Task<byte[]> ReadAllBytesAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static string[] ReadAllLines(string path) { throw null; }
public static string[] ReadAllLines(string path, System.Text.Encoding encoding) { throw null; }
public static System.Threading.Tasks.Task<string[]> ReadAllLinesAsync(string path, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task<string[]> ReadAllLinesAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static string ReadAllText(string path) { throw null; }
public static string ReadAllText(string path, System.Text.Encoding encoding) { throw null; }
public static System.Threading.Tasks.Task<string> ReadAllTextAsync(string path, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task<string> ReadAllTextAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Collections.Generic.IEnumerable<string> ReadLines(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> ReadLines(string path, System.Text.Encoding encoding) { throw null; }
public static void Replace(string sourceFileName, string destinationFileName, string? destinationBackupFileName) { }
public static void Replace(string sourceFileName, string destinationFileName, string? destinationBackupFileName, bool ignoreMetadataErrors) { }
public static System.IO.FileSystemInfo? ResolveLinkTarget(string linkPath, bool returnFinalTarget) { throw null; }
public static void SetAttributes(string path, System.IO.FileAttributes fileAttributes) { }
public static void SetCreationTime(string path, System.DateTime creationTime) { }
public static void SetCreationTimeUtc(string path, System.DateTime creationTimeUtc) { }
public static void SetLastAccessTime(string path, System.DateTime lastAccessTime) { }
public static void SetLastAccessTimeUtc(string path, System.DateTime lastAccessTimeUtc) { }
public static void SetLastWriteTime(string path, System.DateTime lastWriteTime) { }
public static void SetLastWriteTimeUtc(string path, System.DateTime lastWriteTimeUtc) { }
public static void WriteAllBytes(string path, byte[] bytes) { }
public static System.Threading.Tasks.Task WriteAllBytesAsync(string path, byte[] bytes, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void WriteAllLines(string path, System.Collections.Generic.IEnumerable<string> contents) { }
public static void WriteAllLines(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding) { }
public static void WriteAllLines(string path, string[] contents) { }
public static void WriteAllLines(string path, string[] contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task WriteAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task WriteAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void WriteAllText(string path, string? contents) { }
public static void WriteAllText(string path, string? contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task WriteAllTextAsync(string path, string? contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task WriteAllTextAsync(string path, string? contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
[System.FlagsAttribute]
public enum FileAccess
{
Read = 1,
Write = 2,
ReadWrite = 3,
}
[System.FlagsAttribute]
public enum FileAttributes
{
ReadOnly = 1,
Hidden = 2,
System = 4,
Directory = 16,
Archive = 32,
Device = 64,
Normal = 128,
Temporary = 256,
SparseFile = 512,
ReparsePoint = 1024,
Compressed = 2048,
Offline = 4096,
NotContentIndexed = 8192,
Encrypted = 16384,
IntegrityStream = 32768,
NoScrubData = 131072,
}
public sealed partial class FileInfo : System.IO.FileSystemInfo
{
public FileInfo(string fileName) { }
public System.IO.DirectoryInfo? Directory { get { throw null; } }
public string? DirectoryName { get { throw null; } }
public override bool Exists { get { throw null; } }
public bool IsReadOnly { get { throw null; } set { } }
public long Length { get { throw null; } }
public override string Name { get { throw null; } }
public System.IO.StreamWriter AppendText() { throw null; }
public System.IO.FileInfo CopyTo(string destFileName) { throw null; }
public System.IO.FileInfo CopyTo(string destFileName, bool overwrite) { throw null; }
public System.IO.FileStream Create() { throw null; }
public System.IO.StreamWriter CreateText() { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public void Decrypt() { }
public override void Delete() { }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public void Encrypt() { }
public void MoveTo(string destFileName) { }
public void MoveTo(string destFileName, bool overwrite) { }
public System.IO.FileStream Open(System.IO.FileMode mode) { throw null; }
public System.IO.FileStream Open(System.IO.FileMode mode, System.IO.FileAccess access) { throw null; }
public System.IO.FileStream Open(System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) { throw null; }
public System.IO.FileStream Open(System.IO.FileStreamOptions options) { throw null; }
public System.IO.FileStream OpenRead() { throw null; }
public System.IO.StreamReader OpenText() { throw null; }
public System.IO.FileStream OpenWrite() { throw null; }
public System.IO.FileInfo Replace(string destinationFileName, string? destinationBackupFileName) { throw null; }
public System.IO.FileInfo Replace(string destinationFileName, string? destinationBackupFileName, bool ignoreMetadataErrors) { throw null; }
}
public partial class FileLoadException : System.IO.IOException
{
public FileLoadException() { }
protected FileLoadException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public FileLoadException(string? message) { }
public FileLoadException(string? message, System.Exception? inner) { }
public FileLoadException(string? message, string? fileName) { }
public FileLoadException(string? message, string? fileName, System.Exception? inner) { }
public string? FileName { get { throw null; } }
public string? FusionLog { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
public enum FileMode
{
CreateNew = 1,
Create = 2,
Open = 3,
OpenOrCreate = 4,
Truncate = 5,
Append = 6,
}
public partial class FileNotFoundException : System.IO.IOException
{
public FileNotFoundException() { }
protected FileNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public FileNotFoundException(string? message) { }
public FileNotFoundException(string? message, System.Exception? innerException) { }
public FileNotFoundException(string? message, string? fileName) { }
public FileNotFoundException(string? message, string? fileName, System.Exception? innerException) { }
public string? FileName { get { throw null; } }
public string? FusionLog { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum FileOptions
{
WriteThrough = -2147483648,
None = 0,
Encrypted = 16384,
DeleteOnClose = 67108864,
SequentialScan = 134217728,
RandomAccess = 268435456,
Asynchronous = 1073741824,
}
[System.FlagsAttribute]
public enum FileShare
{
None = 0,
Read = 1,
Write = 2,
ReadWrite = 3,
Delete = 4,
Inheritable = 16,
}
public partial class FileStream : System.IO.Stream
{
public FileStream(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access) { }
public FileStream(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access, int bufferSize) { }
public FileStream(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access, int bufferSize, bool isAsync) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use FileStream(SafeFileHandle handle, FileAccess access) instead.")]
public FileStream(System.IntPtr handle, System.IO.FileAccess access) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use FileStream(SafeFileHandle handle, FileAccess access) and optionally make a new SafeFileHandle with ownsHandle=false if needed instead.")]
public FileStream(System.IntPtr handle, System.IO.FileAccess access, bool ownsHandle) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use FileStream(SafeFileHandle handle, FileAccess access, int bufferSize) and optionally make a new SafeFileHandle with ownsHandle=false if needed instead.")]
public FileStream(System.IntPtr handle, System.IO.FileAccess access, bool ownsHandle, int bufferSize) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use FileStream(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync) and optionally make a new SafeFileHandle with ownsHandle=false if needed instead.")]
public FileStream(System.IntPtr handle, System.IO.FileAccess access, bool ownsHandle, int bufferSize, bool isAsync) { }
public FileStream(string path, System.IO.FileMode mode) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, bool useAsync) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, System.IO.FileOptions options) { }
public FileStream(string path, System.IO.FileStreamOptions options) { }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
[System.ObsoleteAttribute("FileStream.Handle has been deprecated. Use FileStream's SafeFileHandle property instead.")]
public virtual System.IntPtr Handle { get { throw null; } }
public virtual bool IsAsync { get { throw null; } }
public override long Length { get { throw null; } }
public virtual string Name { get { throw null; } }
public override long Position { get { throw null; } set { } }
public virtual Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { get { throw null; } }
public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; }
protected override void Dispose(bool disposing) { }
public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override int EndRead(System.IAsyncResult asyncResult) { throw null; }
public override void EndWrite(System.IAsyncResult asyncResult) { }
~FileStream() { }
public override void Flush() { }
public virtual void Flush(bool flushToDisk) { }
public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("macos")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
public virtual void Lock(long position, long length) { }
public override int Read(byte[] buffer, int offset, int count) { throw null; }
public override int Read(System.Span<byte> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
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.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("macos")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
public virtual void Unlock(long position, long length) { }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteByte(byte value) { }
}
public sealed partial class FileStreamOptions
{
public FileStreamOptions() { }
public System.IO.FileAccess Access { get { throw null; } set { } }
public int BufferSize { get { throw null; } set { } }
public System.IO.FileMode Mode { get { throw null; } set { } }
public System.IO.FileOptions Options { get { throw null; } set { } }
public long PreallocationSize { get { throw null; } set { } }
public System.IO.FileShare Share { get { throw null; } set { } }
}
public abstract partial class FileSystemInfo : System.MarshalByRefObject, System.Runtime.Serialization.ISerializable
{
protected string FullPath;
protected string OriginalPath;
protected FileSystemInfo() { }
protected FileSystemInfo(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public System.IO.FileAttributes Attributes { get { throw null; } set { } }
public System.DateTime CreationTime { get { throw null; } set { } }
public System.DateTime CreationTimeUtc { get { throw null; } set { } }
public abstract bool Exists { get; }
public string Extension { get { throw null; } }
public virtual string FullName { get { throw null; } }
public System.DateTime LastAccessTime { get { throw null; } set { } }
public System.DateTime LastAccessTimeUtc { get { throw null; } set { } }
public System.DateTime LastWriteTime { get { throw null; } set { } }
public System.DateTime LastWriteTimeUtc { get { throw null; } set { } }
public string? LinkTarget { get { throw null; } }
public abstract string Name { get; }
public void CreateAsSymbolicLink(string pathToTarget) { }
public abstract void Delete();
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public void Refresh() { }
public System.IO.FileSystemInfo? ResolveLinkTarget(bool returnFinalTarget) { throw null; }
public override string ToString() { throw null; }
}
public enum HandleInheritability
{
None = 0,
Inheritable = 1,
}
public sealed partial class InvalidDataException : System.SystemException
{
public InvalidDataException() { }
public InvalidDataException(string? message) { }
public InvalidDataException(string? message, System.Exception? innerException) { }
}
public partial class IOException : System.SystemException
{
public IOException() { }
protected IOException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public IOException(string? message) { }
public IOException(string? message, System.Exception? innerException) { }
public IOException(string? message, int hresult) { }
}
public enum MatchCasing
{
PlatformDefault = 0,
CaseSensitive = 1,
CaseInsensitive = 2,
}
public enum MatchType
{
Simple = 0,
Win32 = 1,
}
public partial class MemoryStream : System.IO.Stream
{
public MemoryStream() { }
public MemoryStream(byte[] buffer) { }
public MemoryStream(byte[] buffer, bool writable) { }
public MemoryStream(byte[] buffer, int index, int count) { }
public MemoryStream(byte[] buffer, int index, int count, bool writable) { }
public MemoryStream(byte[] buffer, int index, int count, bool writable, bool publiclyVisible) { }
public MemoryStream(int capacity) { }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
public virtual int Capacity { get { throw null; } set { } }
public override long Length { get { throw null; } }
public override long Position { get { throw null; } set { } }
public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override void CopyTo(System.IO.Stream destination, int bufferSize) { }
public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; }
protected override void Dispose(bool disposing) { }
public override int EndRead(System.IAsyncResult asyncResult) { throw null; }
public override void EndWrite(System.IAsyncResult asyncResult) { }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual byte[] GetBuffer() { throw null; }
public override int Read(byte[] buffer, int offset, int count) { throw null; }
public override int Read(System.Span<byte> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadByte() { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin loc) { throw null; }
public override void SetLength(long value) { }
public virtual byte[] ToArray() { throw null; }
public virtual bool TryGetBuffer(out System.ArraySegment<byte> buffer) { throw null; }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteByte(byte value) { }
public virtual void WriteTo(System.IO.Stream stream) { }
}
public static partial class Path
{
public static readonly char AltDirectorySeparatorChar;
public static readonly char DirectorySeparatorChar;
[System.ObsoleteAttribute("Path.InvalidPathChars has been deprecated. Use GetInvalidPathChars or GetInvalidFileNameChars instead.")]
public static readonly char[] InvalidPathChars;
public static readonly char PathSeparator;
public static readonly char VolumeSeparatorChar;
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("path")]
public static string? ChangeExtension(string? path, string? extension) { throw null; }
public static string Combine(string path1, string path2) { throw null; }
public static string Combine(string path1, string path2, string path3) { throw null; }
public static string Combine(string path1, string path2, string path3, string path4) { throw null; }
public static string Combine(params string[] paths) { throw null; }
public static bool EndsInDirectorySeparator(System.ReadOnlySpan<char> path) { throw null; }
public static bool EndsInDirectorySeparator(string path) { throw null; }
public static bool Exists([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] string? path) { throw null; }
public static System.ReadOnlySpan<char> GetDirectoryName(System.ReadOnlySpan<char> path) { throw null; }
public static string? GetDirectoryName(string? path) { throw null; }
public static System.ReadOnlySpan<char> GetExtension(System.ReadOnlySpan<char> path) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("path")]
public static string? GetExtension(string? path) { throw null; }
public static System.ReadOnlySpan<char> GetFileName(System.ReadOnlySpan<char> path) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("path")]
public static string? GetFileName(string? path) { throw null; }
public static System.ReadOnlySpan<char> GetFileNameWithoutExtension(System.ReadOnlySpan<char> path) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("path")]
public static string? GetFileNameWithoutExtension(string? path) { throw null; }
public static string GetFullPath(string path) { throw null; }
public static string GetFullPath(string path, string basePath) { throw null; }
public static char[] GetInvalidFileNameChars() { throw null; }
public static char[] GetInvalidPathChars() { throw null; }
public static System.ReadOnlySpan<char> GetPathRoot(System.ReadOnlySpan<char> path) { throw null; }
public static string? GetPathRoot(string? path) { throw null; }
public static string GetRandomFileName() { throw null; }
public static string GetRelativePath(string relativeTo, string path) { throw null; }
public static string GetTempFileName() { throw null; }
public static string GetTempPath() { throw null; }
public static bool HasExtension(System.ReadOnlySpan<char> path) { throw null; }
public static bool HasExtension([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? path) { throw null; }
public static bool IsPathFullyQualified(System.ReadOnlySpan<char> path) { throw null; }
public static bool IsPathFullyQualified(string path) { throw null; }
public static bool IsPathRooted(System.ReadOnlySpan<char> path) { throw null; }
public static bool IsPathRooted([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? path) { throw null; }
public static string Join(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2) { throw null; }
public static string Join(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2, System.ReadOnlySpan<char> path3) { throw null; }
public static string Join(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2, System.ReadOnlySpan<char> path3, System.ReadOnlySpan<char> path4) { throw null; }
public static string Join(string? path1, string? path2) { throw null; }
public static string Join(string? path1, string? path2, string? path3) { throw null; }
public static string Join(string? path1, string? path2, string? path3, string? path4) { throw null; }
public static string Join(params string?[] paths) { throw null; }
public static System.ReadOnlySpan<char> TrimEndingDirectorySeparator(System.ReadOnlySpan<char> path) { throw null; }
public static string TrimEndingDirectorySeparator(string path) { throw null; }
public static bool TryJoin(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2, System.ReadOnlySpan<char> path3, System.Span<char> destination, out int charsWritten) { throw null; }
public static bool TryJoin(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2, System.Span<char> destination, out int charsWritten) { throw null; }
}
public partial class PathTooLongException : System.IO.IOException
{
public PathTooLongException() { }
protected PathTooLongException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public PathTooLongException(string? message) { }
public PathTooLongException(string? message, System.Exception? innerException) { }
}
public static partial class RandomAccess
{
public static long GetLength(Microsoft.Win32.SafeHandles.SafeFileHandle handle) { throw null; }
public static void SetLength(Microsoft.Win32.SafeHandles.SafeFileHandle handle, long length) { throw null; }
public static long Read(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<System.Memory<byte>> buffers, long fileOffset) { throw null; }
public static int Read(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Span<byte> buffer, long fileOffset) { throw null; }
public static System.Threading.Tasks.ValueTask<long> ReadAsync(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<System.Memory<byte>> buffers, long fileOffset, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.ValueTask<int> ReadAsync(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Memory<byte> buffer, long fileOffset, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void Write(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<System.ReadOnlyMemory<byte>> buffers, long fileOffset) { }
public static void Write(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.ReadOnlySpan<byte> buffer, long fileOffset) { }
public static System.Threading.Tasks.ValueTask WriteAsync(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<System.ReadOnlyMemory<byte>> buffers, long fileOffset, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.ValueTask WriteAsync(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.ReadOnlyMemory<byte> buffer, long fileOffset, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public enum SearchOption
{
TopDirectoryOnly = 0,
AllDirectories = 1,
}
public enum SeekOrigin
{
Begin = 0,
Current = 1,
End = 2,
}
public abstract partial class Stream : System.MarshalByRefObject, System.IAsyncDisposable, System.IDisposable
{
public static readonly System.IO.Stream Null;
protected Stream() { }
public abstract bool CanRead { get; }
public abstract bool CanSeek { get; }
public virtual bool CanTimeout { get { throw null; } }
public abstract bool CanWrite { get; }
public abstract long Length { get; }
public abstract long Position { get; set; }
public virtual int ReadTimeout { get { throw null; } set { } }
public virtual int WriteTimeout { get { throw null; } set { } }
public virtual System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public virtual System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public virtual void Close() { }
public void CopyTo(System.IO.Stream destination) { }
public virtual void CopyTo(System.IO.Stream destination, int bufferSize) { }
public System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination) { throw null; }
public System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize) { throw null; }
public virtual System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, System.Threading.CancellationToken cancellationToken) { throw null; }
[System.ObsoleteAttribute("CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.")]
protected virtual System.Threading.WaitHandle CreateWaitHandle() { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public virtual int EndRead(System.IAsyncResult asyncResult) { throw null; }
public virtual void EndWrite(System.IAsyncResult asyncResult) { }
public abstract void Flush();
public System.Threading.Tasks.Task FlushAsync() { throw null; }
public virtual System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
[System.ObsoleteAttribute("Do not call or override this method.")]
protected virtual void ObjectInvariant() { }
public abstract int Read(byte[] buffer, int offset, int count);
public virtual int Read(System.Span<byte> buffer) { throw null; }
public System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count) { throw null; }
public virtual System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual int ReadByte() { throw null; }
public abstract long Seek(long offset, System.IO.SeekOrigin origin);
public abstract void SetLength(long value);
public static System.IO.Stream Synchronized(System.IO.Stream stream) { throw null; }
protected static void ValidateBufferArguments(byte[] buffer, int offset, int count) { }
protected static void ValidateCopyToArguments(System.IO.Stream destination, int bufferSize) { }
public abstract void Write(byte[] buffer, int offset, int count);
public virtual void Write(System.ReadOnlySpan<byte> buffer) { }
public System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual void WriteByte(byte value) { }
}
public partial class StreamReader : System.IO.TextReader
{
public static readonly new System.IO.StreamReader Null;
public StreamReader(System.IO.Stream stream) { }
public StreamReader(System.IO.Stream stream, bool detectEncodingFromByteOrderMarks) { }
public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding) { }
public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks) { }
public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) { }
public StreamReader(System.IO.Stream stream, System.Text.Encoding? encoding = null, bool detectEncodingFromByteOrderMarks = true, int bufferSize = -1, bool leaveOpen = false) { }
public StreamReader(string path) { }
public StreamReader(string path, bool detectEncodingFromByteOrderMarks) { }
public StreamReader(string path, System.IO.FileStreamOptions options) { }
public StreamReader(string path, System.Text.Encoding encoding) { }
public StreamReader(string path, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks) { }
public StreamReader(string path, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) { }
public StreamReader(string path, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, System.IO.FileStreamOptions options) { }
public virtual System.IO.Stream BaseStream { get { throw null; } }
public virtual System.Text.Encoding CurrentEncoding { get { throw null; } }
public bool EndOfStream { get { throw null; } }
public override void Close() { }
public void DiscardBufferedData() { }
protected override void Dispose(bool disposing) { }
public override int Peek() { throw null; }
public override int Read() { throw null; }
public override int Read(char[] buffer, int index, int count) { throw null; }
public override int Read(System.Span<char> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadBlock(char[] buffer, int index, int count) { throw null; }
public override int ReadBlock(System.Span<char> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadBlockAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override string? ReadLine() { throw null; }
public override System.Threading.Tasks.Task<string?> ReadLineAsync() { throw null; }
public override System.Threading.Tasks.ValueTask<string?> ReadLineAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public override string ReadToEnd() { throw null; }
public override System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
public override System.Threading.Tasks.Task<string> ReadToEndAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class StreamWriter : System.IO.TextWriter
{
public static readonly new System.IO.StreamWriter Null;
public StreamWriter(System.IO.Stream stream) { }
public StreamWriter(System.IO.Stream stream, System.Text.Encoding encoding) { }
public StreamWriter(System.IO.Stream stream, System.Text.Encoding encoding, int bufferSize) { }
public StreamWriter(System.IO.Stream stream, System.Text.Encoding? encoding = null, int bufferSize = -1, bool leaveOpen = false) { }
public StreamWriter(string path) { }
public StreamWriter(string path, bool append) { }
public StreamWriter(string path, bool append, System.Text.Encoding encoding) { }
public StreamWriter(string path, bool append, System.Text.Encoding encoding, int bufferSize) { }
public StreamWriter(string path, System.IO.FileStreamOptions options) { }
public StreamWriter(string path, System.Text.Encoding encoding, System.IO.FileStreamOptions options) { }
public virtual bool AutoFlush { get { throw null; } set { } }
public virtual System.IO.Stream BaseStream { get { throw null; } }
public override System.Text.Encoding Encoding { get { throw null; } }
public override void Close() { }
protected override void Dispose(bool disposing) { }
public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync() { throw null; }
public override void Write(char value) { }
public override void Write(char[]? buffer) { }
public override void Write(char[] buffer, int index, int count) { }
public override void Write(System.ReadOnlySpan<char> buffer) { }
public override void Write(string? value) { }
public override void Write(string format, object? arg0) { }
public override void Write(string format, object? arg0, object? arg1) { }
public override void Write(string format, object? arg0, object? arg1, object? arg2) { }
public override void Write(string format, params object?[] arg) { }
public override System.Threading.Tasks.Task WriteAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(string? value) { throw null; }
public override void WriteLine(System.ReadOnlySpan<char> buffer) { }
public override void WriteLine(string? value) { }
public override void WriteLine(string format, object? arg0) { }
public override void WriteLine(string format, object? arg0, object? arg1) { }
public override void WriteLine(string format, object? arg0, object? arg1, object? arg2) { }
public override void WriteLine(string format, params object?[] arg) { }
public override System.Threading.Tasks.Task WriteLineAsync() { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(string? value) { throw null; }
}
public partial class StringReader : System.IO.TextReader
{
public StringReader(string s) { }
public override void Close() { }
protected override void Dispose(bool disposing) { }
public override int Peek() { throw null; }
public override int Read() { throw null; }
public override int Read(char[] buffer, int index, int count) { throw null; }
public override int Read(System.Span<char> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadBlock(System.Span<char> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadBlockAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override string? ReadLine() { throw null; }
public override System.Threading.Tasks.Task<string?> ReadLineAsync() { throw null; }
public override System.Threading.Tasks.ValueTask<string?> ReadLineAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public override string ReadToEnd() { throw null; }
public override System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
public override System.Threading.Tasks.Task<string> ReadToEndAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class StringWriter : System.IO.TextWriter
{
public StringWriter() { }
public StringWriter(System.IFormatProvider? formatProvider) { }
public StringWriter(System.Text.StringBuilder sb) { }
public StringWriter(System.Text.StringBuilder sb, System.IFormatProvider? formatProvider) { }
public override System.Text.Encoding Encoding { get { throw null; } }
public override void Close() { }
protected override void Dispose(bool disposing) { }
public override System.Threading.Tasks.Task FlushAsync() { throw null; }
public virtual System.Text.StringBuilder GetStringBuilder() { throw null; }
public override string ToString() { throw null; }
public override void Write(char value) { }
public override void Write(char[] buffer, int index, int count) { }
public override void Write(System.ReadOnlySpan<char> buffer) { }
public override void Write(string? value) { }
public override void Write(System.Text.StringBuilder? value) { }
public override System.Threading.Tasks.Task WriteAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(string? value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteLine(System.ReadOnlySpan<char> buffer) { }
public override void WriteLine(System.Text.StringBuilder? value) { }
public override System.Threading.Tasks.Task WriteLineAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(string? value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public abstract partial class TextReader : System.MarshalByRefObject, System.IDisposable
{
public static readonly System.IO.TextReader Null;
protected TextReader() { }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual int Peek() { throw null; }
public virtual int Read() { throw null; }
public virtual int Read(char[] buffer, int index, int count) { throw null; }
public virtual int Read(System.Span<char> buffer) { throw null; }
public virtual System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
public virtual System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual int ReadBlock(char[] buffer, int index, int count) { throw null; }
public virtual int ReadBlock(System.Span<char> buffer) { throw null; }
public virtual System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
public virtual System.Threading.Tasks.ValueTask<int> ReadBlockAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual string? ReadLine() { throw null; }
public virtual System.Threading.Tasks.Task<string?> ReadLineAsync() { throw null; }
public virtual System.Threading.Tasks.ValueTask<string?> ReadLineAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual string ReadToEnd() { throw null; }
public virtual System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
public virtual System.Threading.Tasks.Task<string> ReadToEndAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.IO.TextReader Synchronized(System.IO.TextReader reader) { throw null; }
}
public abstract partial class TextWriter : System.MarshalByRefObject, System.IAsyncDisposable, System.IDisposable
{
protected char[] CoreNewLine;
public static readonly System.IO.TextWriter Null;
protected TextWriter() { }
protected TextWriter(System.IFormatProvider? formatProvider) { }
public abstract System.Text.Encoding Encoding { get; }
public virtual System.IFormatProvider FormatProvider { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public virtual string NewLine { get { throw null; } set { } }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public virtual void Flush() { }
public virtual System.Threading.Tasks.Task FlushAsync() { throw null; }
public static System.IO.TextWriter Synchronized(System.IO.TextWriter writer) { throw null; }
public virtual void Write(bool value) { }
public virtual void Write(char value) { }
public virtual void Write(char[]? buffer) { }
public virtual void Write(char[] buffer, int index, int count) { }
public virtual void Write(decimal value) { }
public virtual void Write(double value) { }
public virtual void Write(int value) { }
public virtual void Write(long value) { }
public virtual void Write(object? value) { }
public virtual void Write(System.ReadOnlySpan<char> buffer) { }
public virtual void Write(float value) { }
public virtual void Write(string? value) { }
public virtual void Write(string format, object? arg0) { }
public virtual void Write(string format, object? arg0, object? arg1) { }
public virtual void Write(string format, object? arg0, object? arg1, object? arg2) { }
public virtual void Write(string format, params object?[] arg) { }
public virtual void Write(System.Text.StringBuilder? value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(uint value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(ulong value) { }
public virtual System.Threading.Tasks.Task WriteAsync(char value) { throw null; }
public System.Threading.Tasks.Task WriteAsync(char[]? buffer) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(char[] buffer, int index, int count) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(string? value) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual void WriteLine() { }
public virtual void WriteLine(bool value) { }
public virtual void WriteLine(char value) { }
public virtual void WriteLine(char[]? buffer) { }
public virtual void WriteLine(char[] buffer, int index, int count) { }
public virtual void WriteLine(decimal value) { }
public virtual void WriteLine(double value) { }
public virtual void WriteLine(int value) { }
public virtual void WriteLine(long value) { }
public virtual void WriteLine(object? value) { }
public virtual void WriteLine(System.ReadOnlySpan<char> buffer) { }
public virtual void WriteLine(float value) { }
public virtual void WriteLine(string? value) { }
public virtual void WriteLine(string format, object? arg0) { }
public virtual void WriteLine(string format, object? arg0, object? arg1) { }
public virtual void WriteLine(string format, object? arg0, object? arg1, object? arg2) { }
public virtual void WriteLine(string format, params object?[] arg) { }
public virtual void WriteLine(System.Text.StringBuilder? value) { }
[System.CLSCompliantAttribute(false)]
public virtual void WriteLine(uint value) { }
[System.CLSCompliantAttribute(false)]
public virtual void WriteLine(ulong value) { }
public virtual System.Threading.Tasks.Task WriteLineAsync() { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(char value) { throw null; }
public System.Threading.Tasks.Task WriteLineAsync(char[]? buffer) { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count) { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(string? value) { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class UnmanagedMemoryStream : System.IO.Stream
{
protected UnmanagedMemoryStream() { }
[System.CLSCompliantAttribute(false)]
public unsafe UnmanagedMemoryStream(byte* pointer, long length) { }
[System.CLSCompliantAttribute(false)]
public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, System.IO.FileAccess access) { }
public UnmanagedMemoryStream(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length) { }
public UnmanagedMemoryStream(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length, System.IO.FileAccess access) { }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
public long Capacity { get { throw null; } }
public override long Length { get { throw null; } }
public override long Position { get { throw null; } set { } }
[System.CLSCompliantAttribute(false)]
public unsafe byte* PositionPointer { get { throw null; } set { } }
protected override void Dispose(bool disposing) { }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
[System.CLSCompliantAttribute(false)]
protected unsafe void Initialize(byte* pointer, long length, long capacity, System.IO.FileAccess access) { }
protected void Initialize(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length, System.IO.FileAccess access) { }
public override int Read(byte[] buffer, int offset, int count) { throw null; }
public override int Read(System.Span<byte> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadByte() { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin loc) { throw null; }
public override void SetLength(long value) { }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteByte(byte value) { }
}
}
namespace System.IO.Enumeration
{
public ref partial struct FileSystemEntry
{
private object _dummy;
private int _dummyPrimitive;
public System.IO.FileAttributes Attributes { get { throw null; } }
public System.DateTimeOffset CreationTimeUtc { get { throw null; } }
public readonly System.ReadOnlySpan<char> Directory { get { throw null; } }
public System.ReadOnlySpan<char> FileName { get { throw null; } }
public bool IsDirectory { get { throw null; } }
public bool IsHidden { get { throw null; } }
public System.DateTimeOffset LastAccessTimeUtc { get { throw null; } }
public System.DateTimeOffset LastWriteTimeUtc { get { throw null; } }
public long Length { get { throw null; } }
public readonly System.ReadOnlySpan<char> OriginalRootDirectory { get { throw null; } }
public readonly System.ReadOnlySpan<char> RootDirectory { get { throw null; } }
public System.IO.FileSystemInfo ToFileSystemInfo() { throw null; }
public string ToFullPath() { throw null; }
public string ToSpecifiedFullPath() { throw null; }
}
public partial class FileSystemEnumerable<TResult> : System.Collections.Generic.IEnumerable<TResult>, System.Collections.IEnumerable
{
public FileSystemEnumerable(string directory, System.IO.Enumeration.FileSystemEnumerable<TResult>.FindTransform transform, System.IO.EnumerationOptions? options = null) { }
public System.IO.Enumeration.FileSystemEnumerable<TResult>.FindPredicate? ShouldIncludePredicate { get { throw null; } set { } }
public System.IO.Enumeration.FileSystemEnumerable<TResult>.FindPredicate? ShouldRecursePredicate { get { throw null; } set { } }
public System.Collections.Generic.IEnumerator<TResult> GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public delegate bool FindPredicate(ref System.IO.Enumeration.FileSystemEntry entry);
public delegate TResult FindTransform(ref System.IO.Enumeration.FileSystemEntry entry);
}
public abstract partial class FileSystemEnumerator<TResult> : System.Runtime.ConstrainedExecution.CriticalFinalizerObject, System.Collections.Generic.IEnumerator<TResult>, System.Collections.IEnumerator, System.IDisposable
{
public FileSystemEnumerator(string directory, System.IO.EnumerationOptions? options = null) { }
public TResult Current { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
protected virtual bool ContinueOnError(int error) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public bool MoveNext() { throw null; }
protected virtual void OnDirectoryFinished(System.ReadOnlySpan<char> directory) { }
public void Reset() { }
protected virtual bool ShouldIncludeEntry(ref System.IO.Enumeration.FileSystemEntry entry) { throw null; }
protected virtual bool ShouldRecurseIntoEntry(ref System.IO.Enumeration.FileSystemEntry entry) { throw null; }
protected abstract TResult TransformEntry(ref System.IO.Enumeration.FileSystemEntry entry);
}
public static partial class FileSystemName
{
public static bool MatchesSimpleExpression(System.ReadOnlySpan<char> expression, System.ReadOnlySpan<char> name, bool ignoreCase = true) { throw null; }
public static bool MatchesWin32Expression(System.ReadOnlySpan<char> expression, System.ReadOnlySpan<char> name, bool ignoreCase = true) { throw null; }
public static string TranslateWin32Expression(string? expression) { throw null; }
}
}
namespace System.Net
{
public static partial class WebUtility
{
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? HtmlDecode(string? value) { throw null; }
public static void HtmlDecode(string? value, System.IO.TextWriter output) { }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? HtmlEncode(string? value) { throw null; }
public static void HtmlEncode(string? value, System.IO.TextWriter output) { }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("encodedValue")]
public static string? UrlDecode(string? encodedValue) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("encodedValue")]
public static byte[]? UrlDecodeToBytes(byte[]? encodedValue, int offset, int count) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? UrlEncode(string? value) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static byte[]? UrlEncodeToBytes(byte[]? value, int offset, int count) { throw null; }
}
}
namespace System.Numerics
{
public static partial class BitOperations
{
public static bool IsPow2(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool IsPow2(uint value) { throw null; }
public static bool IsPow2(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool IsPow2(ulong value) { throw null; }
public static bool IsPow2(nint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool IsPow2(nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int LeadingZeroCount(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int LeadingZeroCount(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int LeadingZeroCount(nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int Log2(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int Log2(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int Log2(nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int PopCount(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int PopCount(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int PopCount(nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint RotateLeft(uint value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong RotateLeft(ulong value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint RotateLeft(nuint value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint RotateRight(uint value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong RotateRight(ulong value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint RotateRight(nuint value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint RoundUpToPowerOf2(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong RoundUpToPowerOf2(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint RoundUpToPowerOf2(nuint value) { throw null; }
public static int TrailingZeroCount(int value) { throw null; }
public static int TrailingZeroCount(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int TrailingZeroCount(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int TrailingZeroCount(ulong value) { throw null; }
public static int TrailingZeroCount(nint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int TrailingZeroCount(nuint value) { throw null; }
}
}
namespace System.Reflection
{
public sealed partial class AmbiguousMatchException : System.SystemException
{
public AmbiguousMatchException() { }
public AmbiguousMatchException(string? message) { }
public AmbiguousMatchException(string? message, System.Exception? inner) { }
}
public abstract partial class Assembly : System.Reflection.ICustomAttributeProvider, System.Runtime.Serialization.ISerializable
{
protected Assembly() { }
[System.ObsoleteAttribute("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual string? CodeBase { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo> DefinedTypes { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")] get { throw null; } }
public virtual System.Reflection.MethodInfo? EntryPoint { get { throw null; } }
[System.ObsoleteAttribute("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual string EscapedCodeBase { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Type> ExportedTypes { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")] get { throw null; } }
public virtual string? FullName { get { throw null; } }
[System.ObsoleteAttribute("The Global Assembly Cache is not supported.", DiagnosticId = "SYSLIB0005", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public virtual bool GlobalAssemblyCache { get { throw null; } }
public virtual long HostContext { get { throw null; } }
public virtual string ImageRuntimeVersion { get { throw null; } }
public virtual bool IsCollectible { get { throw null; } }
public virtual bool IsDynamic { get { throw null; } }
public bool IsFullyTrusted { get { throw null; } }
public virtual string Location { get { throw null; } }
public virtual System.Reflection.Module ManifestModule { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.Module> Modules { get { throw null; } }
public virtual bool ReflectionOnly { get { throw null; } }
public virtual System.Security.SecurityRuleSet SecurityRuleSet { get { throw null; } }
public virtual event System.Reflection.ModuleResolveEventHandler? ModuleResolve { add { } remove { } }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Assembly.CreateInstance is not supported with trimming. Use Type.GetType instead.")]
public object? CreateInstance(string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Assembly.CreateInstance is not supported with trimming. Use Type.GetType instead.")]
public object? CreateInstance(string typeName, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Assembly.CreateInstance is not supported with trimming. Use Type.GetType instead.")]
public virtual object? CreateInstance(string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object[]? args, System.Globalization.CultureInfo? culture, object[]? activationAttributes) { throw null; }
public static string CreateQualifiedName(string? assemblyName, string? typeName) { throw null; }
public override bool Equals(object? o) { throw null; }
public static System.Reflection.Assembly? GetAssembly(System.Type type) { throw null; }
public static System.Reflection.Assembly GetCallingAssembly() { throw null; }
public virtual object[] GetCustomAttributes(bool inherit) { throw null; }
public virtual object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; }
public static System.Reflection.Assembly? GetEntryAssembly() { throw null; }
public static System.Reflection.Assembly GetExecutingAssembly() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] GetExportedTypes() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual System.IO.FileStream? GetFile(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual System.IO.FileStream[] GetFiles() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual System.IO.FileStream[] GetFiles(bool getResourceModules) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] GetForwardedTypes() { throw null; }
public override int GetHashCode() { throw null; }
public System.Reflection.Module[] GetLoadedModules() { throw null; }
public virtual System.Reflection.Module[] GetLoadedModules(bool getResourceModules) { throw null; }
public virtual System.Reflection.ManifestResourceInfo? GetManifestResourceInfo(string resourceName) { throw null; }
public virtual string[] GetManifestResourceNames() { throw null; }
public virtual System.IO.Stream? GetManifestResourceStream(string name) { throw null; }
public virtual System.IO.Stream? GetManifestResourceStream(System.Type type, string name) { throw null; }
public virtual System.Reflection.Module? GetModule(string name) { throw null; }
public System.Reflection.Module[] GetModules() { throw null; }
public virtual System.Reflection.Module[] GetModules(bool getResourceModules) { throw null; }
public virtual System.Reflection.AssemblyName GetName() { throw null; }
public virtual System.Reflection.AssemblyName GetName(bool copiedName) { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Assembly references might be removed")]
public virtual System.Reflection.AssemblyName[] GetReferencedAssemblies() { throw null; }
public virtual System.Reflection.Assembly GetSatelliteAssembly(System.Globalization.CultureInfo culture) { throw null; }
public virtual System.Reflection.Assembly GetSatelliteAssembly(System.Globalization.CultureInfo culture, System.Version? version) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string name, bool throwOnError) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string name, bool throwOnError, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] GetTypes() { throw null; }
public virtual bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly Load(byte[] rawAssembly) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly Load(byte[] rawAssembly, byte[]? rawSymbolStore) { throw null; }
public static System.Reflection.Assembly Load(System.Reflection.AssemblyName assemblyRef) { throw null; }
public static System.Reflection.Assembly Load(string assemblyString) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly LoadFile(string path) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly LoadFrom(string assemblyFile) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly LoadFrom(string assemblyFile, byte[]? hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded module depends on might be removed")]
public System.Reflection.Module LoadModule(string moduleName, byte[]? rawModule) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded module depends on might be removed")]
public virtual System.Reflection.Module LoadModule(string moduleName, byte[]? rawModule, byte[]? rawSymbolStore) { throw null; }
[System.ObsoleteAttribute("Assembly.LoadWithPartialName has been deprecated. Use Assembly.Load() instead.")]
public static System.Reflection.Assembly? LoadWithPartialName(string partialName) { throw null; }
public static bool operator ==(System.Reflection.Assembly? left, System.Reflection.Assembly? right) { throw null; }
public static bool operator !=(System.Reflection.Assembly? left, System.Reflection.Assembly? right) { throw null; }
[System.ObsoleteAttribute("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0018", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly ReflectionOnlyLoad(byte[] rawAssembly) { throw null; }
[System.ObsoleteAttribute("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0018", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly ReflectionOnlyLoad(string assemblyString) { throw null; }
[System.ObsoleteAttribute("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0018", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly ReflectionOnlyLoadFrom(string assemblyFile) { throw null; }
public override string ToString() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly UnsafeLoadFrom(string assemblyFile) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyAlgorithmIdAttribute : System.Attribute
{
public AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm algorithmId) { }
[System.CLSCompliantAttribute(false)]
public AssemblyAlgorithmIdAttribute(uint algorithmId) { }
[System.CLSCompliantAttribute(false)]
public uint AlgorithmId { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyCompanyAttribute : System.Attribute
{
public AssemblyCompanyAttribute(string company) { }
public string Company { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyConfigurationAttribute : System.Attribute
{
public AssemblyConfigurationAttribute(string configuration) { }
public string Configuration { get { throw null; } }
}
public enum AssemblyContentType
{
Default = 0,
WindowsRuntime = 1,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyCopyrightAttribute : System.Attribute
{
public AssemblyCopyrightAttribute(string copyright) { }
public string Copyright { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyCultureAttribute : System.Attribute
{
public AssemblyCultureAttribute(string culture) { }
public string Culture { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyDefaultAliasAttribute : System.Attribute
{
public AssemblyDefaultAliasAttribute(string defaultAlias) { }
public string DefaultAlias { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyDelaySignAttribute : System.Attribute
{
public AssemblyDelaySignAttribute(bool delaySign) { }
public bool DelaySign { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyDescriptionAttribute : System.Attribute
{
public AssemblyDescriptionAttribute(string description) { }
public string Description { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyFileVersionAttribute : System.Attribute
{
public AssemblyFileVersionAttribute(string version) { }
public string Version { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyFlagsAttribute : System.Attribute
{
[System.ObsoleteAttribute("This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.")]
public AssemblyFlagsAttribute(int assemblyFlags) { }
public AssemblyFlagsAttribute(System.Reflection.AssemblyNameFlags assemblyFlags) { }
[System.CLSCompliantAttribute(false)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.")]
public AssemblyFlagsAttribute(uint flags) { }
public int AssemblyFlags { get { throw null; } }
[System.CLSCompliantAttribute(false)]
[System.ObsoleteAttribute("AssemblyFlagsAttribute.Flags has been deprecated. Use AssemblyFlags instead.")]
public uint Flags { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyInformationalVersionAttribute : System.Attribute
{
public AssemblyInformationalVersionAttribute(string informationalVersion) { }
public string InformationalVersion { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyKeyFileAttribute : System.Attribute
{
public AssemblyKeyFileAttribute(string keyFile) { }
public string KeyFile { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyKeyNameAttribute : System.Attribute
{
public AssemblyKeyNameAttribute(string keyName) { }
public string KeyName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed partial class AssemblyMetadataAttribute : System.Attribute
{
public AssemblyMetadataAttribute(string key, string? value) { }
public string Key { get { throw null; } }
public string? Value { get { throw null; } }
}
public sealed partial class AssemblyName : System.ICloneable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
public AssemblyName() { }
public AssemblyName(string assemblyName) { }
public string? CodeBase { [System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("The code will return an empty string for assemblies embedded in a single-file app")] get { throw null; } set { } }
public System.Reflection.AssemblyContentType ContentType { get { throw null; } set { } }
public System.Globalization.CultureInfo? CultureInfo { get { throw null; } set { } }
public string? CultureName { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("The code will return an empty string for assemblies embedded in a single-file app")]
public string? EscapedCodeBase { get { throw null; } }
public System.Reflection.AssemblyNameFlags Flags { get { throw null; } set { } }
public string FullName { get { throw null; } }
[System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Configuration.Assemblies.AssemblyHashAlgorithm HashAlgorithm { get { throw null; } set { } }
[System.ObsoleteAttribute("Strong name signing is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0017", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Reflection.StrongNameKeyPair? KeyPair { get { throw null; } set { } }
public string? Name { get { throw null; } set { } }
[System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Reflection.ProcessorArchitecture ProcessorArchitecture { get { throw null; } set { } }
public System.Version? Version { get { throw null; } set { } }
[System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Configuration.Assemblies.AssemblyVersionCompatibility VersionCompatibility { get { throw null; } set { } }
public object Clone() { throw null; }
public static System.Reflection.AssemblyName GetAssemblyName(string assemblyFile) { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public byte[]? GetPublicKey() { throw null; }
public byte[]? GetPublicKeyToken() { throw null; }
public void OnDeserialization(object? sender) { }
public static bool ReferenceMatchesDefinition(System.Reflection.AssemblyName? reference, System.Reflection.AssemblyName? definition) { throw null; }
public void SetPublicKey(byte[]? publicKey) { }
public void SetPublicKeyToken(byte[]? publicKeyToken) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum AssemblyNameFlags
{
None = 0,
PublicKey = 1,
Retargetable = 256,
EnableJITcompileOptimizer = 16384,
EnableJITcompileTracking = 32768,
}
public partial class AssemblyNameProxy : System.MarshalByRefObject
{
public AssemblyNameProxy() { }
public System.Reflection.AssemblyName GetAssemblyName(string assemblyFile) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyProductAttribute : System.Attribute
{
public AssemblyProductAttribute(string product) { }
public string Product { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false, AllowMultiple=false)]
public sealed partial class AssemblySignatureKeyAttribute : System.Attribute
{
public AssemblySignatureKeyAttribute(string publicKey, string countersignature) { }
public string Countersignature { get { throw null; } }
public string PublicKey { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyTitleAttribute : System.Attribute
{
public AssemblyTitleAttribute(string title) { }
public string Title { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyTrademarkAttribute : System.Attribute
{
public AssemblyTrademarkAttribute(string trademark) { }
public string Trademark { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyVersionAttribute : System.Attribute
{
public AssemblyVersionAttribute(string version) { }
public string Version { get { throw null; } }
}
public abstract partial class Binder
{
protected Binder() { }
public abstract System.Reflection.FieldInfo BindToField(System.Reflection.BindingFlags bindingAttr, System.Reflection.FieldInfo[] match, object value, System.Globalization.CultureInfo? culture);
public abstract System.Reflection.MethodBase BindToMethod(System.Reflection.BindingFlags bindingAttr, System.Reflection.MethodBase[] match, ref object?[] args, System.Reflection.ParameterModifier[]? modifiers, System.Globalization.CultureInfo? culture, string[]? names, out object? state);
public abstract object ChangeType(object value, System.Type type, System.Globalization.CultureInfo? culture);
public abstract void ReorderArgumentArray(ref object?[] args, object state);
public abstract System.Reflection.MethodBase? SelectMethod(System.Reflection.BindingFlags bindingAttr, System.Reflection.MethodBase[] match, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers);
public abstract System.Reflection.PropertyInfo? SelectProperty(System.Reflection.BindingFlags bindingAttr, System.Reflection.PropertyInfo[] match, System.Type? returnType, System.Type[]? indexes, System.Reflection.ParameterModifier[]? modifiers);
}
[System.FlagsAttribute]
public enum BindingFlags
{
Default = 0,
IgnoreCase = 1,
DeclaredOnly = 2,
Instance = 4,
Static = 8,
Public = 16,
NonPublic = 32,
FlattenHierarchy = 64,
InvokeMethod = 256,
CreateInstance = 512,
GetField = 1024,
SetField = 2048,
GetProperty = 4096,
SetProperty = 8192,
PutDispProperty = 16384,
PutRefDispProperty = 32768,
ExactBinding = 65536,
SuppressChangeType = 131072,
OptionalParamBinding = 262144,
IgnoreReturn = 16777216,
DoNotWrapExceptions = 33554432,
}
[System.FlagsAttribute]
public enum CallingConventions
{
Standard = 1,
VarArgs = 2,
Any = 3,
HasThis = 32,
ExplicitThis = 64,
}
public abstract partial class ConstructorInfo : System.Reflection.MethodBase
{
public static readonly string ConstructorName;
public static readonly string TypeConstructorName;
protected ConstructorInfo() { }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public object Invoke(object?[]? parameters) { throw null; }
public abstract object Invoke(System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? parameters, System.Globalization.CultureInfo? culture);
public static bool operator ==(System.Reflection.ConstructorInfo? left, System.Reflection.ConstructorInfo? right) { throw null; }
public static bool operator !=(System.Reflection.ConstructorInfo? left, System.Reflection.ConstructorInfo? right) { throw null; }
}
public partial class CustomAttributeData
{
protected CustomAttributeData() { }
public virtual System.Type AttributeType { get { throw null; } }
public virtual System.Reflection.ConstructorInfo Constructor { get { throw null; } }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeTypedArgument> ConstructorArguments { get { throw null; } }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeNamedArgument> NamedArguments { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public static System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributes(System.Reflection.Assembly target) { throw null; }
public static System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributes(System.Reflection.MemberInfo target) { throw null; }
public static System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributes(System.Reflection.Module target) { throw null; }
public static System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributes(System.Reflection.ParameterInfo target) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public static partial class CustomAttributeExtensions
{
public static System.Attribute? GetCustomAttribute(this System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.Module element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.Assembly element) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.Module element) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.Module element, System.Type attributeType) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.Assembly element) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.MemberInfo element) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.MemberInfo element, bool inherit) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.Module element) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.ParameterInfo element) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.ParameterInfo element, bool inherit) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.Assembly element) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.MemberInfo element) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.MemberInfo element, bool inherit) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.Module element) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.ParameterInfo element) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.ParameterInfo element, bool inherit) where T : System.Attribute { throw null; }
public static bool IsDefined(this System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static bool IsDefined(this System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static bool IsDefined(this System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static bool IsDefined(this System.Reflection.Module element, System.Type attributeType) { throw null; }
public static bool IsDefined(this System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static bool IsDefined(this System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
}
public partial class CustomAttributeFormatException : System.FormatException
{
public CustomAttributeFormatException() { }
protected CustomAttributeFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public CustomAttributeFormatException(string? message) { }
public CustomAttributeFormatException(string? message, System.Exception? inner) { }
}
public readonly partial struct CustomAttributeNamedArgument : System.IEquatable<System.Reflection.CustomAttributeNamedArgument>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, object? value) { throw null; }
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, System.Reflection.CustomAttributeTypedArgument typedArgument) { throw null; }
public bool IsField { get { throw null; } }
public System.Reflection.MemberInfo MemberInfo { get { throw null; } }
public string MemberName { get { throw null; } }
public System.Reflection.CustomAttributeTypedArgument TypedValue { get { throw null; } }
public bool Equals(System.Reflection.CustomAttributeNamedArgument other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Reflection.CustomAttributeNamedArgument left, System.Reflection.CustomAttributeNamedArgument right) { throw null; }
public static bool operator !=(System.Reflection.CustomAttributeNamedArgument left, System.Reflection.CustomAttributeNamedArgument right) { throw null; }
public override string ToString() { throw null; }
}
public readonly partial struct CustomAttributeTypedArgument : System.IEquatable<System.Reflection.CustomAttributeTypedArgument>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public CustomAttributeTypedArgument(object value) { throw null; }
public CustomAttributeTypedArgument(System.Type argumentType, object? value) { throw null; }
public System.Type ArgumentType { get { throw null; } }
public object? Value { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Reflection.CustomAttributeTypedArgument other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Reflection.CustomAttributeTypedArgument left, System.Reflection.CustomAttributeTypedArgument right) { throw null; }
public static bool operator !=(System.Reflection.CustomAttributeTypedArgument left, System.Reflection.CustomAttributeTypedArgument right) { throw null; }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Struct)]
public sealed partial class DefaultMemberAttribute : System.Attribute
{
public DefaultMemberAttribute(string memberName) { }
public string MemberName { get { throw null; } }
}
[System.FlagsAttribute]
public enum EventAttributes
{
None = 0,
SpecialName = 512,
ReservedMask = 1024,
RTSpecialName = 1024,
}
public abstract partial class EventInfo : System.Reflection.MemberInfo
{
protected EventInfo() { }
public virtual System.Reflection.MethodInfo? AddMethod { get { throw null; } }
public abstract System.Reflection.EventAttributes Attributes { get; }
public virtual System.Type? EventHandlerType { get { throw null; } }
public virtual bool IsMulticast { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public virtual System.Reflection.MethodInfo? RaiseMethod { get { throw null; } }
public virtual System.Reflection.MethodInfo? RemoveMethod { get { throw null; } }
public virtual void AddEventHandler(object? target, System.Delegate? handler) { }
public override bool Equals(object? obj) { throw null; }
public System.Reflection.MethodInfo? GetAddMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetAddMethod(bool nonPublic);
public override int GetHashCode() { throw null; }
public System.Reflection.MethodInfo[] GetOtherMethods() { throw null; }
public virtual System.Reflection.MethodInfo[] GetOtherMethods(bool nonPublic) { throw null; }
public System.Reflection.MethodInfo? GetRaiseMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetRaiseMethod(bool nonPublic);
public System.Reflection.MethodInfo? GetRemoveMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetRemoveMethod(bool nonPublic);
public static bool operator ==(System.Reflection.EventInfo? left, System.Reflection.EventInfo? right) { throw null; }
public static bool operator !=(System.Reflection.EventInfo? left, System.Reflection.EventInfo? right) { throw null; }
public virtual void RemoveEventHandler(object? target, System.Delegate? handler) { }
}
public partial class ExceptionHandlingClause
{
protected ExceptionHandlingClause() { }
public virtual System.Type? CatchType { get { throw null; } }
public virtual int FilterOffset { get { throw null; } }
public virtual System.Reflection.ExceptionHandlingClauseOptions Flags { get { throw null; } }
public virtual int HandlerLength { get { throw null; } }
public virtual int HandlerOffset { get { throw null; } }
public virtual int TryLength { get { throw null; } }
public virtual int TryOffset { get { throw null; } }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum ExceptionHandlingClauseOptions
{
Clause = 0,
Filter = 1,
Finally = 2,
Fault = 4,
}
[System.FlagsAttribute]
public enum FieldAttributes
{
PrivateScope = 0,
Private = 1,
FamANDAssem = 2,
Assembly = 3,
Family = 4,
FamORAssem = 5,
Public = 6,
FieldAccessMask = 7,
Static = 16,
InitOnly = 32,
Literal = 64,
NotSerialized = 128,
HasFieldRVA = 256,
SpecialName = 512,
RTSpecialName = 1024,
HasFieldMarshal = 4096,
PinvokeImpl = 8192,
HasDefault = 32768,
ReservedMask = 38144,
}
public abstract partial class FieldInfo : System.Reflection.MemberInfo
{
protected FieldInfo() { }
public abstract System.Reflection.FieldAttributes Attributes { get; }
public abstract System.RuntimeFieldHandle FieldHandle { get; }
public abstract System.Type FieldType { get; }
public bool IsAssembly { get { throw null; } }
public bool IsFamily { get { throw null; } }
public bool IsFamilyAndAssembly { get { throw null; } }
public bool IsFamilyOrAssembly { get { throw null; } }
public bool IsInitOnly { get { throw null; } }
public bool IsLiteral { get { throw null; } }
public bool IsNotSerialized { get { throw null; } }
public bool IsPinvokeImpl { get { throw null; } }
public bool IsPrivate { get { throw null; } }
public bool IsPublic { get { throw null; } }
public virtual bool IsSecurityCritical { get { throw null; } }
public virtual bool IsSecuritySafeCritical { get { throw null; } }
public virtual bool IsSecurityTransparent { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public bool IsStatic { get { throw null; } }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public static System.Reflection.FieldInfo GetFieldFromHandle(System.RuntimeFieldHandle handle) { throw null; }
public static System.Reflection.FieldInfo GetFieldFromHandle(System.RuntimeFieldHandle handle, System.RuntimeTypeHandle declaringType) { throw null; }
public override int GetHashCode() { throw null; }
public virtual System.Type[] GetOptionalCustomModifiers() { throw null; }
public virtual object? GetRawConstantValue() { throw null; }
public virtual System.Type[] GetRequiredCustomModifiers() { throw null; }
public abstract object? GetValue(object? obj);
[System.CLSCompliantAttribute(false)]
public virtual object? GetValueDirect(System.TypedReference obj) { throw null; }
public static bool operator ==(System.Reflection.FieldInfo? left, System.Reflection.FieldInfo? right) { throw null; }
public static bool operator !=(System.Reflection.FieldInfo? left, System.Reflection.FieldInfo? right) { throw null; }
public void SetValue(object? obj, object? value) { }
public abstract void SetValue(object? obj, object? value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, System.Globalization.CultureInfo? culture);
[System.CLSCompliantAttribute(false)]
public virtual void SetValueDirect(System.TypedReference obj, object value) { }
}
[System.FlagsAttribute]
public enum GenericParameterAttributes
{
None = 0,
Covariant = 1,
Contravariant = 2,
VarianceMask = 3,
ReferenceTypeConstraint = 4,
NotNullableValueTypeConstraint = 8,
DefaultConstructorConstraint = 16,
SpecialConstraintMask = 28,
}
public partial interface ICustomAttributeProvider
{
object[] GetCustomAttributes(bool inherit);
object[] GetCustomAttributes(System.Type attributeType, bool inherit);
bool IsDefined(System.Type attributeType, bool inherit);
}
public enum ImageFileMachine
{
I386 = 332,
ARM = 452,
IA64 = 512,
AMD64 = 34404,
}
public partial struct InterfaceMapping
{
public System.Reflection.MethodInfo[] InterfaceMethods;
public System.Type InterfaceType;
public System.Reflection.MethodInfo[] TargetMethods;
public System.Type TargetType;
}
public static partial class IntrospectionExtensions
{
public static System.Reflection.TypeInfo GetTypeInfo(this System.Type type) { throw null; }
}
public partial class InvalidFilterCriteriaException : System.ApplicationException
{
public InvalidFilterCriteriaException() { }
protected InvalidFilterCriteriaException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public InvalidFilterCriteriaException(string? message) { }
public InvalidFilterCriteriaException(string? message, System.Exception? inner) { }
}
public partial interface IReflect
{
System.Type UnderlyingSystemType { get; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.MemberInfo[] GetMembers(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.PropertyInfo? GetProperty(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.PropertyInfo? GetProperty(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type? returnType, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args, System.Reflection.ParameterModifier[]? modifiers, System.Globalization.CultureInfo? culture, string[]? namedParameters);
}
public partial interface IReflectableType
{
System.Reflection.TypeInfo GetTypeInfo();
}
public partial class LocalVariableInfo
{
protected LocalVariableInfo() { }
public virtual bool IsPinned { get { throw null; } }
public virtual int LocalIndex { get { throw null; } }
public virtual System.Type LocalType { get { throw null; } }
public override string ToString() { throw null; }
}
public partial class ManifestResourceInfo
{
public ManifestResourceInfo(System.Reflection.Assembly? containingAssembly, string? containingFileName, System.Reflection.ResourceLocation resourceLocation) { }
public virtual string? FileName { get { throw null; } }
public virtual System.Reflection.Assembly? ReferencedAssembly { get { throw null; } }
public virtual System.Reflection.ResourceLocation ResourceLocation { get { throw null; } }
}
public delegate bool MemberFilter(System.Reflection.MemberInfo m, object? filterCriteria);
public abstract partial class MemberInfo : System.Reflection.ICustomAttributeProvider
{
protected MemberInfo() { }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
public abstract System.Type? DeclaringType { get; }
public virtual bool IsCollectible { get { throw null; } }
public abstract System.Reflection.MemberTypes MemberType { get; }
public virtual int MetadataToken { get { throw null; } }
public virtual System.Reflection.Module Module { get { throw null; } }
public abstract string Name { get; }
public abstract System.Type? ReflectedType { get; }
public override bool Equals(object? obj) { throw null; }
public abstract object[] GetCustomAttributes(bool inherit);
public abstract object[] GetCustomAttributes(System.Type attributeType, bool inherit);
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; }
public override int GetHashCode() { throw null; }
public virtual bool HasSameMetadataDefinitionAs(System.Reflection.MemberInfo other) { throw null; }
public abstract bool IsDefined(System.Type attributeType, bool inherit);
public static bool operator ==(System.Reflection.MemberInfo? left, System.Reflection.MemberInfo? right) { throw null; }
public static bool operator !=(System.Reflection.MemberInfo? left, System.Reflection.MemberInfo? right) { throw null; }
}
[System.FlagsAttribute]
public enum MemberTypes
{
Constructor = 1,
Event = 2,
Field = 4,
Method = 8,
Property = 16,
TypeInfo = 32,
Custom = 64,
NestedType = 128,
All = 191,
}
[System.FlagsAttribute]
public enum MethodAttributes
{
PrivateScope = 0,
ReuseSlot = 0,
Private = 1,
FamANDAssem = 2,
Assembly = 3,
Family = 4,
FamORAssem = 5,
Public = 6,
MemberAccessMask = 7,
UnmanagedExport = 8,
Static = 16,
Final = 32,
Virtual = 64,
HideBySig = 128,
NewSlot = 256,
VtableLayoutMask = 256,
CheckAccessOnOverride = 512,
Abstract = 1024,
SpecialName = 2048,
RTSpecialName = 4096,
PinvokeImpl = 8192,
HasSecurity = 16384,
RequireSecObject = 32768,
ReservedMask = 53248,
}
public abstract partial class MethodBase : System.Reflection.MemberInfo
{
protected MethodBase() { }
public abstract System.Reflection.MethodAttributes Attributes { get; }
public virtual System.Reflection.CallingConventions CallingConvention { get { throw null; } }
public virtual bool ContainsGenericParameters { get { throw null; } }
public bool IsAbstract { get { throw null; } }
public bool IsAssembly { get { throw null; } }
public virtual bool IsConstructedGenericMethod { get { throw null; } }
public bool IsConstructor { get { throw null; } }
public bool IsFamily { get { throw null; } }
public bool IsFamilyAndAssembly { get { throw null; } }
public bool IsFamilyOrAssembly { get { throw null; } }
public bool IsFinal { get { throw null; } }
public virtual bool IsGenericMethod { get { throw null; } }
public virtual bool IsGenericMethodDefinition { get { throw null; } }
public bool IsHideBySig { get { throw null; } }
public bool IsPrivate { get { throw null; } }
public bool IsPublic { get { throw null; } }
public virtual bool IsSecurityCritical { get { throw null; } }
public virtual bool IsSecuritySafeCritical { get { throw null; } }
public virtual bool IsSecurityTransparent { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public bool IsStatic { get { throw null; } }
public bool IsVirtual { get { throw null; } }
public abstract System.RuntimeMethodHandle MethodHandle { get; }
public virtual System.Reflection.MethodImplAttributes MethodImplementationFlags { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Metadata for the method might be incomplete or removed")]
public static System.Reflection.MethodBase? GetCurrentMethod() { throw null; }
public virtual System.Type[] GetGenericArguments() { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming may change method bodies. For example it can change some instructions, remove branches or local variables.")]
public virtual System.Reflection.MethodBody? GetMethodBody() { throw null; }
public static System.Reflection.MethodBase? GetMethodFromHandle(System.RuntimeMethodHandle handle) { throw null; }
public static System.Reflection.MethodBase? GetMethodFromHandle(System.RuntimeMethodHandle handle, System.RuntimeTypeHandle declaringType) { throw null; }
public abstract System.Reflection.MethodImplAttributes GetMethodImplementationFlags();
public abstract System.Reflection.ParameterInfo[] GetParameters();
public object? Invoke(object? obj, object?[]? parameters) { throw null; }
public abstract object? Invoke(object? obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? parameters, System.Globalization.CultureInfo? culture);
public static bool operator ==(System.Reflection.MethodBase? left, System.Reflection.MethodBase? right) { throw null; }
public static bool operator !=(System.Reflection.MethodBase? left, System.Reflection.MethodBase? right) { throw null; }
}
public partial class MethodBody
{
protected MethodBody() { }
public virtual System.Collections.Generic.IList<System.Reflection.ExceptionHandlingClause> ExceptionHandlingClauses { get { throw null; } }
public virtual bool InitLocals { get { throw null; } }
public virtual int LocalSignatureMetadataToken { get { throw null; } }
public virtual System.Collections.Generic.IList<System.Reflection.LocalVariableInfo> LocalVariables { get { throw null; } }
public virtual int MaxStackSize { get { throw null; } }
public virtual byte[]? GetILAsByteArray() { throw null; }
}
public enum MethodImplAttributes
{
IL = 0,
Managed = 0,
Native = 1,
OPTIL = 2,
CodeTypeMask = 3,
Runtime = 3,
ManagedMask = 4,
Unmanaged = 4,
NoInlining = 8,
ForwardRef = 16,
Synchronized = 32,
NoOptimization = 64,
PreserveSig = 128,
AggressiveInlining = 256,
AggressiveOptimization = 512,
InternalCall = 4096,
MaxMethodImplVal = 65535,
}
public abstract partial class MethodInfo : System.Reflection.MethodBase
{
protected MethodInfo() { }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public virtual System.Reflection.ParameterInfo ReturnParameter { get { throw null; } }
public virtual System.Type ReturnType { get { throw null; } }
public abstract System.Reflection.ICustomAttributeProvider ReturnTypeCustomAttributes { get; }
public virtual System.Delegate CreateDelegate(System.Type delegateType) { throw null; }
public virtual System.Delegate CreateDelegate(System.Type delegateType, object? target) { throw null; }
public T CreateDelegate<T>() where T : System.Delegate { throw null; }
public T CreateDelegate<T>(object? target) where T : System.Delegate { throw null; }
public override bool Equals(object? obj) { throw null; }
public abstract System.Reflection.MethodInfo GetBaseDefinition();
public override System.Type[] GetGenericArguments() { throw null; }
public virtual System.Reflection.MethodInfo GetGenericMethodDefinition() { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The native code for this instantiation might not be available at runtime.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
public virtual System.Reflection.MethodInfo MakeGenericMethod(params System.Type[] typeArguments) { throw null; }
public static bool operator ==(System.Reflection.MethodInfo? left, System.Reflection.MethodInfo? right) { throw null; }
public static bool operator !=(System.Reflection.MethodInfo? left, System.Reflection.MethodInfo? right) { throw null; }
}
public sealed partial class Missing : System.Runtime.Serialization.ISerializable
{
internal Missing() { }
public static readonly System.Reflection.Missing Value;
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public abstract partial class Module : System.Reflection.ICustomAttributeProvider, System.Runtime.Serialization.ISerializable
{
public static readonly System.Reflection.TypeFilter FilterTypeName;
public static readonly System.Reflection.TypeFilter FilterTypeNameIgnoreCase;
protected Module() { }
public virtual System.Reflection.Assembly Assembly { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("Returns <Unknown> for modules with no file path")]
public virtual string FullyQualifiedName { get { throw null; } }
public virtual int MDStreamVersion { get { throw null; } }
public virtual int MetadataToken { get { throw null; } }
public System.ModuleHandle ModuleHandle { get { throw null; } }
public virtual System.Guid ModuleVersionId { get { throw null; } }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("Returns <Unknown> for modules with no file path")]
public virtual string Name { get { throw null; } }
public virtual string ScopeName { get { throw null; } }
public override bool Equals(object? o) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] FindTypes(System.Reflection.TypeFilter? filter, object? filterCriteria) { throw null; }
public virtual object[] GetCustomAttributes(bool inherit) { throw null; }
public virtual object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Fields might be removed")]
public System.Reflection.FieldInfo? GetField(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Fields might be removed")]
public virtual System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Fields might be removed")]
public System.Reflection.FieldInfo[] GetFields() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Fields might be removed")]
public virtual System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingFlags) { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public System.Reflection.MethodInfo? GetMethod(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public System.Reflection.MethodInfo? GetMethod(string name, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
protected virtual System.Reflection.MethodInfo? GetMethodImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public System.Reflection.MethodInfo[] GetMethods() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public virtual System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingFlags) { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public virtual void GetPEKind(out System.Reflection.PortableExecutableKinds peKind, out System.Reflection.ImageFileMachine machine) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string className) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string className, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string className, bool throwOnError, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] GetTypes() { throw null; }
public virtual bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
public virtual bool IsResource() { throw null; }
public static bool operator ==(System.Reflection.Module? left, System.Reflection.Module? right) { throw null; }
public static bool operator !=(System.Reflection.Module? left, System.Reflection.Module? right) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.Reflection.FieldInfo? ResolveField(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual System.Reflection.FieldInfo? ResolveField(int metadataToken, System.Type[]? genericTypeArguments, System.Type[]? genericMethodArguments) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.Reflection.MemberInfo? ResolveMember(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual System.Reflection.MemberInfo? ResolveMember(int metadataToken, System.Type[]? genericTypeArguments, System.Type[]? genericMethodArguments) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.Reflection.MethodBase? ResolveMethod(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual System.Reflection.MethodBase? ResolveMethod(int metadataToken, System.Type[]? genericTypeArguments, System.Type[]? genericMethodArguments) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual byte[] ResolveSignature(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual string ResolveString(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.Type ResolveType(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual System.Type ResolveType(int metadataToken, System.Type[]? genericTypeArguments, System.Type[]? genericMethodArguments) { throw null; }
public override string ToString() { throw null; }
}
public delegate System.Reflection.Module ModuleResolveEventHandler(object sender, System.ResolveEventArgs e);
public sealed partial class NullabilityInfo
{
internal NullabilityInfo() { }
public System.Reflection.NullabilityInfo? ElementType { get { throw null; } }
public System.Reflection.NullabilityInfo[] GenericTypeArguments { get { throw null; } }
public System.Reflection.NullabilityState ReadState { get { throw null; } }
public System.Type Type { get { throw null; } }
public System.Reflection.NullabilityState WriteState { get { throw null; } }
}
public sealed partial class NullabilityInfoContext
{
public NullabilityInfoContext() { }
public System.Reflection.NullabilityInfo Create(System.Reflection.EventInfo eventInfo) { throw null; }
public System.Reflection.NullabilityInfo Create(System.Reflection.FieldInfo fieldInfo) { throw null; }
public System.Reflection.NullabilityInfo Create(System.Reflection.ParameterInfo parameterInfo) { throw null; }
public System.Reflection.NullabilityInfo Create(System.Reflection.PropertyInfo propertyInfo) { throw null; }
}
public enum NullabilityState
{
Unknown = 0,
NotNull = 1,
Nullable = 2,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class ObfuscateAssemblyAttribute : System.Attribute
{
public ObfuscateAssemblyAttribute(bool assemblyIsPrivate) { }
public bool AssemblyIsPrivate { get { throw null; } }
public bool StripAfterObfuscation { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed partial class ObfuscationAttribute : System.Attribute
{
public ObfuscationAttribute() { }
public bool ApplyToMembers { get { throw null; } set { } }
public bool Exclude { get { throw null; } set { } }
public string? Feature { get { throw null; } set { } }
public bool StripAfterObfuscation { get { throw null; } set { } }
}
[System.FlagsAttribute]
public enum ParameterAttributes
{
None = 0,
In = 1,
Out = 2,
Lcid = 4,
Retval = 8,
Optional = 16,
HasDefault = 4096,
HasFieldMarshal = 8192,
Reserved3 = 16384,
Reserved4 = 32768,
ReservedMask = 61440,
}
public partial class ParameterInfo : System.Reflection.ICustomAttributeProvider, System.Runtime.Serialization.IObjectReference
{
protected System.Reflection.ParameterAttributes AttrsImpl;
protected System.Type? ClassImpl;
protected object? DefaultValueImpl;
protected System.Reflection.MemberInfo MemberImpl;
protected string? NameImpl;
protected int PositionImpl;
protected ParameterInfo() { }
public virtual System.Reflection.ParameterAttributes Attributes { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
public virtual object? DefaultValue { get { throw null; } }
public virtual bool HasDefaultValue { get { throw null; } }
public bool IsIn { get { throw null; } }
public bool IsLcid { get { throw null; } }
public bool IsOptional { get { throw null; } }
public bool IsOut { get { throw null; } }
public bool IsRetval { get { throw null; } }
public virtual System.Reflection.MemberInfo Member { get { throw null; } }
public virtual int MetadataToken { get { throw null; } }
public virtual string? Name { get { throw null; } }
public virtual System.Type ParameterType { get { throw null; } }
public virtual int Position { get { throw null; } }
public virtual object? RawDefaultValue { get { throw null; } }
public virtual object[] GetCustomAttributes(bool inherit) { throw null; }
public virtual object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; }
public virtual System.Type[] GetOptionalCustomModifiers() { throw null; }
public object GetRealObject(System.Runtime.Serialization.StreamingContext context) { throw null; }
public virtual System.Type[] GetRequiredCustomModifiers() { throw null; }
public virtual bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
public override string ToString() { throw null; }
}
public readonly partial struct ParameterModifier
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ParameterModifier(int parameterCount) { throw null; }
public bool this[int index] { get { throw null; } set { } }
}
[System.CLSCompliantAttribute(false)]
public sealed partial class Pointer : System.Runtime.Serialization.ISerializable
{
internal Pointer() { }
public unsafe static object Box(void* ptr, System.Type type) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public unsafe static void* Unbox(object ptr) { throw null; }
}
[System.FlagsAttribute]
public enum PortableExecutableKinds
{
NotAPortableExecutableImage = 0,
ILOnly = 1,
Required32Bit = 2,
PE32Plus = 4,
Unmanaged32Bit = 8,
Preferred32Bit = 16,
}
public enum ProcessorArchitecture
{
None = 0,
MSIL = 1,
X86 = 2,
IA64 = 3,
Amd64 = 4,
Arm = 5,
}
[System.FlagsAttribute]
public enum PropertyAttributes
{
None = 0,
SpecialName = 512,
RTSpecialName = 1024,
HasDefault = 4096,
Reserved2 = 8192,
Reserved3 = 16384,
Reserved4 = 32768,
ReservedMask = 62464,
}
public abstract partial class PropertyInfo : System.Reflection.MemberInfo
{
protected PropertyInfo() { }
public abstract System.Reflection.PropertyAttributes Attributes { get; }
public abstract bool CanRead { get; }
public abstract bool CanWrite { get; }
public virtual System.Reflection.MethodInfo? GetMethod { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public abstract System.Type PropertyType { get; }
public virtual System.Reflection.MethodInfo? SetMethod { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public System.Reflection.MethodInfo[] GetAccessors() { throw null; }
public abstract System.Reflection.MethodInfo[] GetAccessors(bool nonPublic);
public virtual object? GetConstantValue() { throw null; }
public System.Reflection.MethodInfo? GetGetMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetGetMethod(bool nonPublic);
public override int GetHashCode() { throw null; }
public abstract System.Reflection.ParameterInfo[] GetIndexParameters();
public virtual System.Type[] GetOptionalCustomModifiers() { throw null; }
public virtual object? GetRawConstantValue() { throw null; }
public virtual System.Type[] GetRequiredCustomModifiers() { throw null; }
public System.Reflection.MethodInfo? GetSetMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetSetMethod(bool nonPublic);
public object? GetValue(object? obj) { throw null; }
public virtual object? GetValue(object? obj, object?[]? index) { throw null; }
public abstract object? GetValue(object? obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? index, System.Globalization.CultureInfo? culture);
public static bool operator ==(System.Reflection.PropertyInfo? left, System.Reflection.PropertyInfo? right) { throw null; }
public static bool operator !=(System.Reflection.PropertyInfo? left, System.Reflection.PropertyInfo? right) { throw null; }
public void SetValue(object? obj, object? value) { }
public virtual void SetValue(object? obj, object? value, object?[]? index) { }
public abstract void SetValue(object? obj, object? value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? index, System.Globalization.CultureInfo? culture);
}
public abstract partial class ReflectionContext
{
protected ReflectionContext() { }
public virtual System.Reflection.TypeInfo GetTypeForObject(object value) { throw null; }
public abstract System.Reflection.Assembly MapAssembly(System.Reflection.Assembly assembly);
public abstract System.Reflection.TypeInfo MapType(System.Reflection.TypeInfo type);
}
public sealed partial class ReflectionTypeLoadException : System.SystemException, System.Runtime.Serialization.ISerializable
{
public ReflectionTypeLoadException(System.Type?[]? classes, System.Exception?[]? exceptions) { }
public ReflectionTypeLoadException(System.Type?[]? classes, System.Exception?[]? exceptions, string? message) { }
public System.Exception?[] LoaderExceptions { get { throw null; } }
public override string Message { get { throw null; } }
public System.Type?[] Types { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum ResourceAttributes
{
Public = 1,
Private = 2,
}
[System.FlagsAttribute]
public enum ResourceLocation
{
Embedded = 1,
ContainedInAnotherAssembly = 2,
ContainedInManifestFile = 4,
}
public static partial class RuntimeReflectionExtensions
{
public static System.Reflection.MethodInfo GetMethodInfo(this System.Delegate del) { throw null; }
public static System.Reflection.MethodInfo? GetRuntimeBaseDefinition(this System.Reflection.MethodInfo method) { throw null; }
public static System.Reflection.EventInfo? GetRuntimeEvent([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)] this System.Type type, string name) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Reflection.EventInfo> GetRuntimeEvents([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)] this System.Type type) { throw null; }
public static System.Reflection.FieldInfo? GetRuntimeField([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)] this System.Type type, string name) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo> GetRuntimeFields([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)] this System.Type type) { throw null; }
public static System.Reflection.InterfaceMapping GetRuntimeInterfaceMap(this System.Reflection.TypeInfo typeInfo, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type interfaceType) { throw null; }
public static System.Reflection.MethodInfo? GetRuntimeMethod([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] this System.Type type, string name, System.Type[] parameters) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> GetRuntimeMethods([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] this System.Type type) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo> GetRuntimeProperties([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] this System.Type type) { throw null; }
public static System.Reflection.PropertyInfo? GetRuntimeProperty([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] this System.Type type, string name) { throw null; }
}
[System.ObsoleteAttribute("Strong name signing is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0017", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public partial class StrongNameKeyPair : System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
public StrongNameKeyPair(byte[] keyPairArray) { }
public StrongNameKeyPair(System.IO.FileStream keyPairFile) { }
protected StrongNameKeyPair(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public StrongNameKeyPair(string keyPairContainer) { }
public byte[] PublicKey { get { throw null; } }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class TargetException : System.ApplicationException
{
public TargetException() { }
protected TargetException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TargetException(string? message) { }
public TargetException(string? message, System.Exception? inner) { }
}
public sealed partial class TargetInvocationException : System.ApplicationException
{
public TargetInvocationException(System.Exception? inner) { }
public TargetInvocationException(string? message, System.Exception? inner) { }
}
public sealed partial class TargetParameterCountException : System.ApplicationException
{
public TargetParameterCountException() { }
public TargetParameterCountException(string? message) { }
public TargetParameterCountException(string? message, System.Exception? inner) { }
}
[System.FlagsAttribute]
public enum TypeAttributes
{
AnsiClass = 0,
AutoLayout = 0,
Class = 0,
NotPublic = 0,
Public = 1,
NestedPublic = 2,
NestedPrivate = 3,
NestedFamily = 4,
NestedAssembly = 5,
NestedFamANDAssem = 6,
NestedFamORAssem = 7,
VisibilityMask = 7,
SequentialLayout = 8,
ExplicitLayout = 16,
LayoutMask = 24,
ClassSemanticsMask = 32,
Interface = 32,
Abstract = 128,
Sealed = 256,
SpecialName = 1024,
RTSpecialName = 2048,
Import = 4096,
Serializable = 8192,
WindowsRuntime = 16384,
UnicodeClass = 65536,
AutoClass = 131072,
CustomFormatClass = 196608,
StringFormatMask = 196608,
HasSecurity = 262144,
ReservedMask = 264192,
BeforeFieldInit = 1048576,
CustomFormatMask = 12582912,
}
public partial class TypeDelegator : System.Reflection.TypeInfo
{
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
protected System.Type typeImpl;
protected TypeDelegator() { }
public TypeDelegator([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type delegatingType) { }
public override System.Reflection.Assembly Assembly { get { throw null; } }
public override string? AssemblyQualifiedName { get { throw null; } }
public override System.Type? BaseType { get { throw null; } }
public override string? FullName { get { throw null; } }
public override System.Guid GUID { get { throw null; } }
public override bool IsByRefLike { get { throw null; } }
public override bool IsCollectible { get { throw null; } }
public override bool IsConstructedGenericType { get { throw null; } }
public override bool IsGenericMethodParameter { get { throw null; } }
public override bool IsGenericTypeParameter { get { throw null; } }
public override bool IsSZArray { get { throw null; } }
public override bool IsTypeDefinition { get { throw null; } }
public override bool IsVariableBoundArray { get { throw null; } }
public override int MetadataToken { get { throw null; } }
public override System.Reflection.Module Module { get { throw null; } }
public override string Name { get { throw null; } }
public override string? Namespace { get { throw null; } }
public override System.RuntimeTypeHandle TypeHandle { get { throw null; } }
public override System.Type UnderlyingSystemType { get { throw null; } }
protected override System.Reflection.TypeAttributes GetAttributeFlagsImpl() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
protected override System.Reflection.ConstructorInfo? GetConstructorImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public override System.Reflection.ConstructorInfo[] GetConstructors(System.Reflection.BindingFlags bindingAttr) { throw null; }
public override object[] GetCustomAttributes(bool inherit) { throw null; }
public override object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
public override System.Type? GetElementType() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo? GetEvent(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo[] GetEvents() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public override System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public override System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public override System.Type? GetInterface(string name, bool ignoreCase) { throw null; }
public override System.Reflection.InterfaceMapping GetInterfaceMap([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type interfaceType) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public override System.Type[] GetInterfaces() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public override System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.MemberTypes type, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public override System.Reflection.MemberInfo[] GetMembers(System.Reflection.BindingFlags bindingAttr) { throw null; }
public override System.Reflection.MemberInfo GetMemberWithSameMetadataDefinitionAs(System.Reflection.MemberInfo member) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
protected override System.Reflection.MethodInfo? GetMethodImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public override System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public override System.Type? GetNestedType(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public override System.Type[] GetNestedTypes(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public override System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
protected override System.Reflection.PropertyInfo? GetPropertyImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type? returnType, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
protected override bool HasElementTypeImpl() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public override object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args, System.Reflection.ParameterModifier[]? modifiers, System.Globalization.CultureInfo? culture, string[]? namedParameters) { throw null; }
protected override bool IsArrayImpl() { throw null; }
public override bool IsAssignableFrom([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Reflection.TypeInfo? typeInfo) { throw null; }
protected override bool IsByRefImpl() { throw null; }
protected override bool IsCOMObjectImpl() { throw null; }
public override bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
protected override bool IsPointerImpl() { throw null; }
protected override bool IsPrimitiveImpl() { throw null; }
protected override bool IsValueTypeImpl() { throw null; }
}
public delegate bool TypeFilter(System.Type m, object? filterCriteria);
public abstract partial class TypeInfo : System.Type, System.Reflection.IReflectableType
{
protected TypeInfo() { }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo> DeclaredConstructors { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.EventInfo> DeclaredEvents { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo> DeclaredFields { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.MemberInfo> DeclaredMembers { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> DeclaredMethods { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo> DeclaredNestedTypes { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo> DeclaredProperties { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] get { throw null; } }
public virtual System.Type[] GenericTypeParameters { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Type> ImplementedInterfaces { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)] get { throw null; } }
public virtual System.Type AsType() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public virtual System.Reflection.EventInfo? GetDeclaredEvent(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public virtual System.Reflection.FieldInfo? GetDeclaredField(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public virtual System.Reflection.MethodInfo? GetDeclaredMethod(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public virtual System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> GetDeclaredMethods(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public virtual System.Reflection.TypeInfo? GetDeclaredNestedType(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public virtual System.Reflection.PropertyInfo? GetDeclaredProperty(string name) { throw null; }
public virtual bool IsAssignableFrom([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Reflection.TypeInfo? typeInfo) { throw null; }
System.Reflection.TypeInfo System.Reflection.IReflectableType.GetTypeInfo() { throw null; }
}
}
namespace System.Resources
{
public partial interface IResourceReader : System.Collections.IEnumerable, System.IDisposable
{
void Close();
new System.Collections.IDictionaryEnumerator GetEnumerator();
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public partial class MissingManifestResourceException : System.SystemException
{
public MissingManifestResourceException() { }
protected MissingManifestResourceException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingManifestResourceException(string? message) { }
public MissingManifestResourceException(string? message, System.Exception? inner) { }
}
public partial class MissingSatelliteAssemblyException : System.SystemException
{
public MissingSatelliteAssemblyException() { }
protected MissingSatelliteAssemblyException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingSatelliteAssemblyException(string? message) { }
public MissingSatelliteAssemblyException(string? message, System.Exception? inner) { }
public MissingSatelliteAssemblyException(string? message, string? cultureName) { }
public string? CultureName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class NeutralResourcesLanguageAttribute : System.Attribute
{
public NeutralResourcesLanguageAttribute(string cultureName) { }
public NeutralResourcesLanguageAttribute(string cultureName, System.Resources.UltimateResourceFallbackLocation location) { }
public string CultureName { get { throw null; } }
public System.Resources.UltimateResourceFallbackLocation Location { get { throw null; } }
}
public partial class ResourceManager
{
public static readonly int HeaderVersionNumber;
public static readonly int MagicNumber;
protected System.Reflection.Assembly? MainAssembly;
protected ResourceManager() { }
public ResourceManager(string baseName, System.Reflection.Assembly assembly) { }
public ResourceManager(string baseName, System.Reflection.Assembly assembly, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type? usingResourceSet) { }
public ResourceManager(System.Type resourceSource) { }
public virtual string BaseName { get { throw null; } }
protected System.Resources.UltimateResourceFallbackLocation FallbackLocation { get { throw null; } set { } }
public virtual bool IgnoreCase { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public virtual System.Type ResourceSetType { get { throw null; } }
public static System.Resources.ResourceManager CreateFileBasedResourceManager(string baseName, string resourceDir, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type? usingResourceSet) { throw null; }
protected static System.Globalization.CultureInfo GetNeutralResourcesLanguage(System.Reflection.Assembly a) { throw null; }
public virtual object? GetObject(string name) { throw null; }
public virtual object? GetObject(string name, System.Globalization.CultureInfo? culture) { throw null; }
protected virtual string GetResourceFileName(System.Globalization.CultureInfo culture) { throw null; }
public virtual System.Resources.ResourceSet? GetResourceSet(System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) { throw null; }
protected static System.Version? GetSatelliteContractVersion(System.Reflection.Assembly a) { throw null; }
public System.IO.UnmanagedMemoryStream? GetStream(string name) { throw null; }
public System.IO.UnmanagedMemoryStream? GetStream(string name, System.Globalization.CultureInfo? culture) { throw null; }
public virtual string? GetString(string name) { throw null; }
public virtual string? GetString(string name, System.Globalization.CultureInfo? culture) { throw null; }
protected virtual System.Resources.ResourceSet? InternalGetResourceSet(System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) { throw null; }
public virtual void ReleaseAllResources() { }
}
public sealed partial class ResourceReader : System.Collections.IEnumerable, System.IDisposable, System.Resources.IResourceReader
{
public ResourceReader(System.IO.Stream stream) { }
public ResourceReader(string fileName) { }
public void Close() { }
public void Dispose() { }
public System.Collections.IDictionaryEnumerator GetEnumerator() { throw null; }
public void GetResourceData(string resourceName, out string resourceType, out byte[] resourceData) { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public partial class ResourceSet : System.Collections.IEnumerable, System.IDisposable
{
protected ResourceSet() { }
public ResourceSet(System.IO.Stream stream) { }
public ResourceSet(System.Resources.IResourceReader reader) { }
public ResourceSet(string fileName) { }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual System.Type GetDefaultReader() { throw null; }
public virtual System.Type GetDefaultWriter() { throw null; }
public virtual System.Collections.IDictionaryEnumerator GetEnumerator() { throw null; }
public virtual object? GetObject(string name) { throw null; }
public virtual object? GetObject(string name, bool ignoreCase) { throw null; }
public virtual string? GetString(string name) { throw null; }
public virtual string? GetString(string name, bool ignoreCase) { throw null; }
protected virtual void ReadResources() { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class SatelliteContractVersionAttribute : System.Attribute
{
public SatelliteContractVersionAttribute(string version) { }
public string Version { get { throw null; } }
}
public enum UltimateResourceFallbackLocation
{
MainAssembly = 0,
Satellite = 1,
}
}
namespace System.Runtime
{
public sealed partial class AmbiguousImplementationException : System.Exception
{
public AmbiguousImplementationException() { }
public AmbiguousImplementationException(string? message) { }
public AmbiguousImplementationException(string? message, System.Exception? innerException) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyTargetedPatchBandAttribute : System.Attribute
{
public AssemblyTargetedPatchBandAttribute(string targetedPatchBand) { }
public string TargetedPatchBand { get { throw null; } }
}
public partial struct DependentHandle : System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
public DependentHandle(object? target, object? dependent) { throw null; }
public object? Dependent { get { throw null; } set { } }
public bool IsAllocated { get { throw null; } }
public object? Target { get { throw null; } set { } }
public (object? Target, object? Dependent) TargetAndDependent { get { throw null; } }
public void Dispose() { }
}
public enum GCLargeObjectHeapCompactionMode
{
Default = 1,
CompactOnce = 2,
}
public enum GCLatencyMode
{
Batch = 0,
Interactive = 1,
LowLatency = 2,
SustainedLowLatency = 3,
NoGCRegion = 4,
}
public static partial class GCSettings
{
public static bool IsServerGC { get { throw null; } }
public static System.Runtime.GCLargeObjectHeapCompactionMode LargeObjectHeapCompactionMode { get { throw null; } set { } }
public static System.Runtime.GCLatencyMode LatencyMode { get { throw null; } set { } }
}
public static partial class JitInfo
{
public static System.TimeSpan GetCompilationTime(bool currentThread = false) { throw null; }
public static long GetCompiledILBytes(bool currentThread = false) { throw null; }
public static long GetCompiledMethodCount(bool currentThread = false) { throw null; }
}
public sealed partial class MemoryFailPoint : System.Runtime.ConstrainedExecution.CriticalFinalizerObject, System.IDisposable
{
public MemoryFailPoint(int sizeInMegabytes) { }
public void Dispose() { }
~MemoryFailPoint() { }
}
public static partial class ProfileOptimization
{
public static void SetProfileRoot(string directoryPath) { }
public static void StartProfile(string? profile) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed partial class TargetedPatchingOptOutAttribute : System.Attribute
{
public TargetedPatchingOptOutAttribute(string reason) { }
public string Reason { get { throw null; } }
}
}
namespace System.Runtime.CompilerServices
{
[System.AttributeUsageAttribute(System.AttributeTargets.Field)]
public sealed partial class AccessedThroughPropertyAttribute : System.Attribute
{
public AccessedThroughPropertyAttribute(string propertyName) { }
public string PropertyName { get { throw null; } }
}
public partial struct AsyncIteratorMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void Complete() { }
public static System.Runtime.CompilerServices.AsyncIteratorMethodBuilder Create() { throw null; }
public void MoveNext<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
public sealed partial class AsyncIteratorStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute
{
public AsyncIteratorStateMachineAttribute(System.Type stateMachineType) : base (default(System.Type)) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]
public sealed partial class AsyncMethodBuilderAttribute : System.Attribute
{
public AsyncMethodBuilderAttribute(System.Type builderType) { }
public System.Type BuilderType { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
public sealed partial class AsyncStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute
{
public AsyncStateMachineAttribute(System.Type stateMachineType) : base (default(System.Type)) { }
}
public partial struct AsyncTaskMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.Task Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncTaskMethodBuilder Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct AsyncTaskMethodBuilder<TResult>
{
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.Task<TResult> Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult> Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult(TResult result) { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct AsyncValueTaskMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.ValueTask Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct AsyncValueTaskMethodBuilder<TResult>
{
private TResult _result;
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.ValueTask<TResult> Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder<TResult> Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult(TResult result) { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct AsyncVoidMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncVoidMethodBuilder Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial class CallConvCdecl
{
public CallConvCdecl() { }
}
public partial class CallConvFastcall
{
public CallConvFastcall() { }
}
public partial class CallConvMemberFunction
{
public CallConvMemberFunction() { }
}
public partial class CallConvStdcall
{
public CallConvStdcall() { }
}
public partial class CallConvSuppressGCTransition
{
public CallConvSuppressGCTransition() { }
}
public partial class CallConvThiscall
{
public CallConvThiscall() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)]
public sealed partial class CallerArgumentExpressionAttribute : System.Attribute
{
public CallerArgumentExpressionAttribute(string parameterName) { }
public string ParameterName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class CallerFilePathAttribute : System.Attribute
{
public CallerFilePathAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class CallerLineNumberAttribute : System.Attribute
{
public CallerLineNumberAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class CallerMemberNameAttribute : System.Attribute
{
public CallerMemberNameAttribute() { }
}
[System.FlagsAttribute]
public enum CompilationRelaxations
{
NoStringInterning = 8,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method | System.AttributeTargets.Module)]
public partial class CompilationRelaxationsAttribute : System.Attribute
{
public CompilationRelaxationsAttribute(int relaxations) { }
public CompilationRelaxationsAttribute(System.Runtime.CompilerServices.CompilationRelaxations relaxations) { }
public int CompilationRelaxations { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=true)]
public sealed partial class CompilerGeneratedAttribute : System.Attribute
{
public CompilerGeneratedAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class)]
public partial class CompilerGlobalScopeAttribute : System.Attribute
{
public CompilerGlobalScopeAttribute() { }
}
public sealed partial class ConditionalWeakTable<TKey, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable where TKey : class where TValue : class?
{
public ConditionalWeakTable() { }
public void Add(TKey key, TValue value) { }
public void AddOrUpdate(TKey key, TValue value) { }
public void Clear() { }
public TValue GetOrCreateValue(TKey key) { throw null; }
public TValue GetValue(TKey key, System.Runtime.CompilerServices.ConditionalWeakTable<TKey, TValue>.CreateValueCallback createValueCallback) { throw null; }
public bool Remove(TKey key) { throw null; }
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; }
public delegate TValue CreateValueCallback(TKey key);
}
public readonly partial struct ConfiguredAsyncDisposable
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable DisposeAsync() { throw null; }
}
public readonly partial struct ConfiguredCancelableAsyncEnumerable<T>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T>.Enumerator GetAsyncEnumerator() { throw null; }
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation(System.Threading.CancellationToken cancellationToken) { throw null; }
public readonly partial struct Enumerator
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public T Current { get { throw null; } }
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable DisposeAsync() { throw null; }
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<bool> MoveNextAsync() { throw null; }
}
}
public readonly partial struct ConfiguredTaskAwaitable
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter GetAwaiter() { throw null; }
public readonly partial struct ConfiguredTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
public readonly partial struct ConfiguredTaskAwaitable<TResult>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult>.ConfiguredTaskAwaiter GetAwaiter() { throw null; }
public readonly partial struct ConfiguredTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public TResult GetResult() { throw null; }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
public readonly partial struct ConfiguredValueTaskAwaitable
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable.ConfiguredValueTaskAwaiter GetAwaiter() { throw null; }
public readonly partial struct ConfiguredValueTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
public readonly partial struct ConfiguredValueTaskAwaitable<TResult>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>.ConfiguredValueTaskAwaiter GetAwaiter() { throw null; }
public readonly partial struct ConfiguredValueTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public TResult GetResult() { throw null; }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)]
public abstract partial class CustomConstantAttribute : System.Attribute
{
protected CustomConstantAttribute() { }
public abstract object? Value { get; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class DateTimeConstantAttribute : System.Runtime.CompilerServices.CustomConstantAttribute
{
public DateTimeConstantAttribute(long ticks) { }
public override object Value { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class DecimalConstantAttribute : System.Attribute
{
public DecimalConstantAttribute(byte scale, byte sign, int hi, int mid, int low) { }
[System.CLSCompliantAttribute(false)]
public DecimalConstantAttribute(byte scale, byte sign, uint hi, uint mid, uint low) { }
public decimal Value { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly)]
public sealed partial class DefaultDependencyAttribute : System.Attribute
{
public DefaultDependencyAttribute(System.Runtime.CompilerServices.LoadHint loadHintArgument) { }
public System.Runtime.CompilerServices.LoadHint LoadHint { get { throw null; } }
}
[System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute]
public ref partial struct DefaultInterpolatedStringHandler
{
private object _dummy;
private int _dummyPrimitive;
public DefaultInterpolatedStringHandler(int literalLength, int formattedCount) { throw null; }
public DefaultInterpolatedStringHandler(int literalLength, int formattedCount, System.IFormatProvider? provider) { throw null; }
public DefaultInterpolatedStringHandler(int literalLength, int formattedCount, System.IFormatProvider? provider, System.Span<char> initialBuffer) { throw null; }
public void AppendFormatted(object? value, int alignment = 0, string? format = null) { }
public void AppendFormatted(System.ReadOnlySpan<char> value) { }
public void AppendFormatted(System.ReadOnlySpan<char> value, int alignment = 0, string? format = null) { }
public void AppendFormatted(string? value) { }
public void AppendFormatted(string? value, int alignment = 0, string? format = null) { }
public void AppendFormatted<T>(T value) { }
public void AppendFormatted<T>(T value, int alignment) { }
public void AppendFormatted<T>(T value, int alignment, string? format) { }
public void AppendFormatted<T>(T value, string? format) { }
public void AppendLiteral(string value) { }
public override string ToString() { throw null; }
public string ToStringAndClear() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true)]
public sealed partial class DependencyAttribute : System.Attribute
{
public DependencyAttribute(string dependentAssemblyArgument, System.Runtime.CompilerServices.LoadHint loadHintArgument) { }
public string DependentAssembly { get { throw null; } }
public System.Runtime.CompilerServices.LoadHint LoadHint { get { throw null; } }
}
[System.ObsoleteAttribute("DisablePrivateReflectionAttribute has no effect in .NET 6.0+.", DiagnosticId = "SYSLIB0015", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class DisablePrivateReflectionAttribute : System.Attribute
{
public DisablePrivateReflectionAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
public sealed class DisableRuntimeMarshallingAttribute : Attribute
{
public DisableRuntimeMarshallingAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All)]
public partial class DiscardableAttribute : System.Attribute
{
public DiscardableAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class EnumeratorCancellationAttribute : System.Attribute
{
public EnumeratorCancellationAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method)]
public sealed partial class ExtensionAttribute : System.Attribute
{
public ExtensionAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field)]
public sealed partial class FixedAddressValueTypeAttribute : System.Attribute
{
public FixedAddressValueTypeAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public sealed partial class FixedBufferAttribute : System.Attribute
{
public FixedBufferAttribute(System.Type elementType, int length) { }
public System.Type ElementType { get { throw null; } }
public int Length { get { throw null; } }
}
public static partial class FormattableStringFactory
{
public static System.FormattableString Create(string format, params object?[] arguments) { throw null; }
}
public partial interface IAsyncStateMachine
{
void MoveNext();
void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine);
}
public partial interface ICriticalNotifyCompletion : System.Runtime.CompilerServices.INotifyCompletion
{
void UnsafeOnCompleted(System.Action continuation);
}
[System.AttributeUsageAttribute(System.AttributeTargets.Property, Inherited=true)]
public sealed partial class IndexerNameAttribute : System.Attribute
{
public IndexerNameAttribute(string indexerName) { }
}
public partial interface INotifyCompletion
{
void OnCompleted(System.Action continuation);
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed partial class InternalsVisibleToAttribute : System.Attribute
{
public InternalsVisibleToAttribute(string assemblyName) { }
public bool AllInternalsVisible { get { throw null; } set { } }
public string AssemblyName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)]
public sealed partial class InterpolatedStringHandlerArgumentAttribute : System.Attribute
{
public InterpolatedStringHandlerArgumentAttribute(string argument) { }
public InterpolatedStringHandlerArgumentAttribute(params string[] arguments) { }
public string[] Arguments { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed partial class InterpolatedStringHandlerAttribute : System.Attribute
{
public InterpolatedStringHandlerAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Struct)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class IsByRefLikeAttribute : System.Attribute
{
public IsByRefLikeAttribute() { }
}
public static partial class IsConst
{
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static partial class IsExternalInit
{
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class IsReadOnlyAttribute : System.Attribute
{
public IsReadOnlyAttribute() { }
}
public partial interface IStrongBox
{
object? Value { get; set; }
}
public static partial class IsVolatile
{
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
public sealed partial class IteratorStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute
{
public IteratorStateMachineAttribute(System.Type stateMachineType) : base (default(System.Type)) { }
}
public partial interface ITuple
{
object? this[int index] { get; }
int Length { get; }
}
public enum LoadHint
{
Default = 0,
Always = 1,
Sometimes = 2,
}
public enum MethodCodeType
{
IL = 0,
Native = 1,
OPTIL = 2,
Runtime = 3,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class MethodImplAttribute : System.Attribute
{
public System.Runtime.CompilerServices.MethodCodeType MethodCodeType;
public MethodImplAttribute() { }
public MethodImplAttribute(short value) { }
public MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions methodImplOptions) { }
public System.Runtime.CompilerServices.MethodImplOptions Value { get { throw null; } }
}
[System.FlagsAttribute]
public enum MethodImplOptions
{
Unmanaged = 4,
NoInlining = 8,
ForwardRef = 16,
Synchronized = 32,
NoOptimization = 64,
PreserveSig = 128,
AggressiveInlining = 256,
AggressiveOptimization = 512,
InternalCall = 4096,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class ModuleInitializerAttribute : System.Attribute
{
public ModuleInitializerAttribute() { }
}
public partial struct PoolingAsyncValueTaskMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.ValueTask Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct PoolingAsyncValueTaskMethodBuilder<TResult>
{
private TResult _result;
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.ValueTask<TResult> Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder<TResult> Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult(TResult result) { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed partial class PreserveBaseOverridesAttribute : System.Attribute
{
public PreserveBaseOverridesAttribute() { }
}
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class RequiredMemberAttribute : System.Attribute
{
public RequiredMemberAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
public sealed partial class ReferenceAssemblyAttribute : System.Attribute
{
public ReferenceAssemblyAttribute() { }
public ReferenceAssemblyAttribute(string? description) { }
public string? Description { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false, AllowMultiple=false)]
public sealed partial class RuntimeCompatibilityAttribute : System.Attribute
{
public RuntimeCompatibilityAttribute() { }
public bool WrapNonExceptionThrows { get { throw null; } set { } }
}
public static partial class RuntimeFeature
{
public const string ByRefFields = "ByRefFields";
public const string CovariantReturnsOfClasses = "CovariantReturnsOfClasses";
public const string DefaultImplementationsOfInterfaces = "DefaultImplementationsOfInterfaces";
public const string PortablePdb = "PortablePdb";
public const string UnmanagedSignatureCallingConvention = "UnmanagedSignatureCallingConvention";
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public const string VirtualStaticsInInterfaces = "VirtualStaticsInInterfaces";
public static bool IsDynamicCodeCompiled { get { throw null; } }
public static bool IsDynamicCodeSupported { get { throw null; } }
public static bool IsSupported(string feature) { throw null; }
}
public static partial class RuntimeHelpers
{
[System.ObsoleteAttribute("OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.")]
public static int OffsetToStringData { get { throw null; } }
public static System.IntPtr AllocateTypeAssociatedMemory(System.Type type, int size) { throw null; }
public static System.ReadOnlySpan<T> CreateSpan<T>(System.RuntimeFieldHandle fldHandle) { throw null; }
public static void EnsureSufficientExecutionStack() { }
public static new bool Equals(object? o1, object? o2) { throw null; }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void ExecuteCodeWithGuaranteedCleanup(System.Runtime.CompilerServices.RuntimeHelpers.TryCode code, System.Runtime.CompilerServices.RuntimeHelpers.CleanupCode backoutCode, object? userData) { }
public static int GetHashCode(object? o) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("obj")]
public static object? GetObjectValue(object? obj) { throw null; }
public static T[] GetSubArray<T>(T[] array, System.Range range) { throw null; }
public static object GetUninitializedObject([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type) { throw null; }
public static void InitializeArray(System.Array array, System.RuntimeFieldHandle fldHandle) { }
public static bool IsReferenceOrContainsReferences<T>() { throw null; }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void PrepareConstrainedRegions() { }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void PrepareConstrainedRegionsNoOP() { }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void PrepareContractedDelegate(System.Delegate d) { }
public static void PrepareDelegate(System.Delegate d) { }
public static void PrepareMethod(System.RuntimeMethodHandle method) { }
public static void PrepareMethod(System.RuntimeMethodHandle method, System.RuntimeTypeHandle[]? instantiation) { }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void ProbeForSufficientStack() { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimmer can't guarantee existence of class constructor")]
public static void RunClassConstructor(System.RuntimeTypeHandle type) { }
public static void RunModuleConstructor(System.ModuleHandle module) { }
public static bool TryEnsureSufficientExecutionStack() { throw null; }
public delegate void CleanupCode(object? userData, bool exceptionThrown);
public delegate void TryCode(object? userData);
}
public sealed partial class RuntimeWrappedException : System.Exception
{
public RuntimeWrappedException(object thrownObject) { }
public object WrappedException { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class SkipLocalsInitAttribute : System.Attribute
{
public SkipLocalsInitAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct)]
public sealed partial class SpecialNameAttribute : System.Attribute
{
public SpecialNameAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
public partial class StateMachineAttribute : System.Attribute
{
public StateMachineAttribute(System.Type stateMachineType) { }
public System.Type StateMachineType { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class StringFreezingAttribute : System.Attribute
{
public StringFreezingAttribute() { }
}
public partial class StrongBox<T> : System.Runtime.CompilerServices.IStrongBox
{
[System.Diagnostics.CodeAnalysis.MaybeNullAttribute]
public T Value;
public StrongBox() { }
public StrongBox(T value) { }
object? System.Runtime.CompilerServices.IStrongBox.Value { get { throw null; } set { } }
}
[System.ObsoleteAttribute("SuppressIldasmAttribute has no effect in .NET 6.0+.", DiagnosticId = "SYSLIB0025", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Module)]
public sealed partial class SuppressIldasmAttribute : System.Attribute
{
public SuppressIldasmAttribute() { }
}
public sealed partial class SwitchExpressionException : System.InvalidOperationException
{
public SwitchExpressionException() { }
public SwitchExpressionException(System.Exception? innerException) { }
public SwitchExpressionException(object? unmatchedValue) { }
public SwitchExpressionException(string? message) { }
public SwitchExpressionException(string? message, System.Exception? innerException) { }
public override string Message { get { throw null; } }
public object? UnmatchedValue { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public readonly partial struct TaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
public readonly partial struct TaskAwaiter<TResult> : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public TResult GetResult() { throw null; }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Struct)]
[System.CLSCompliantAttribute(false)]
public sealed partial class TupleElementNamesAttribute : System.Attribute
{
public TupleElementNamesAttribute(string?[] transformNames) { }
public System.Collections.Generic.IList<string?> TransformNames { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]
public sealed partial class TypeForwardedFromAttribute : System.Attribute
{
public TypeForwardedFromAttribute(string assemblyFullName) { }
public string AssemblyFullName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed partial class TypeForwardedToAttribute : System.Attribute
{
public TypeForwardedToAttribute(System.Type destination) { }
public System.Type Destination { get { throw null; } }
}
public static partial class Unsafe
{
public static ref T AddByteOffset<T>(ref T source, System.IntPtr byteOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ref T AddByteOffset<T>(ref T source, nuint byteOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void* Add<T>(void* source, int elementOffset) { throw null; }
public static ref T Add<T>(ref T source, int elementOffset) { throw null; }
public static ref T Add<T>(ref T source, System.IntPtr elementOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ref T Add<T>(ref T source, nuint elementOffset) { throw null; }
public static bool AreSame<T>([System.Diagnostics.CodeAnalysis.AllowNull] ref T left, [System.Diagnostics.CodeAnalysis.AllowNull] ref T right) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void* AsPointer<T>(ref T value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static ref T AsRef<T>(void* source) { throw null; }
public static ref T AsRef<T>(in T source) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("o")]
public static T? As<T>(object? o) where T : class? { throw null; }
public static ref TTo As<TFrom, TTo>(ref TFrom source) { throw null; }
public static System.IntPtr ByteOffset<T>([System.Diagnostics.CodeAnalysis.AllowNull] ref T origin, [System.Diagnostics.CodeAnalysis.AllowNull] ref T target) { throw null; }
[System.CLSCompliantAttribute(false)]
public static void CopyBlock(ref byte destination, ref byte source, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void CopyBlock(void* destination, void* source, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public static void CopyBlockUnaligned(ref byte destination, ref byte source, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void CopyBlockUnaligned(void* destination, void* source, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void Copy<T>(void* destination, ref T source) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void Copy<T>(ref T destination, void* source) { }
[System.CLSCompliantAttribute(false)]
public static void InitBlock(ref byte startAddress, byte value, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void InitBlock(void* startAddress, byte value, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public static void InitBlockUnaligned(ref byte startAddress, byte value, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount) { }
public static bool IsAddressGreaterThan<T>([System.Diagnostics.CodeAnalysis.AllowNull] ref T left, [System.Diagnostics.CodeAnalysis.AllowNull] ref T right) { throw null; }
public static bool IsAddressLessThan<T>([System.Diagnostics.CodeAnalysis.AllowNull] ref T left, [System.Diagnostics.CodeAnalysis.AllowNull] ref T right) { throw null; }
public static bool IsNullRef<T>(ref T source) { throw null; }
public static ref T NullRef<T>() { throw null; }
public static T ReadUnaligned<T>(ref byte source) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static T ReadUnaligned<T>(void* source) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static T Read<T>(void* source) { throw null; }
public static void SkipInit<T>(out T value) { throw null; }
public static int SizeOf<T>() { throw null; }
public static ref T SubtractByteOffset<T>(ref T source, System.IntPtr byteOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ref T SubtractByteOffset<T>(ref T source, nuint byteOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void* Subtract<T>(void* source, int elementOffset) { throw null; }
public static ref T Subtract<T>(ref T source, int elementOffset) { throw null; }
public static ref T Subtract<T>(ref T source, System.IntPtr elementOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ref T Subtract<T>(ref T source, nuint elementOffset) { throw null; }
public static ref T Unbox<T>(object box) where T : struct { throw null; }
public static void WriteUnaligned<T>(ref byte destination, T value) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void WriteUnaligned<T>(void* destination, T value) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void Write<T>(void* destination, T value) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Struct)]
public sealed partial class UnsafeValueTypeAttribute : System.Attribute
{
public UnsafeValueTypeAttribute() { }
}
public readonly partial struct ValueTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
public readonly partial struct ValueTaskAwaiter<TResult> : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public TResult GetResult() { throw null; }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
public readonly partial struct YieldAwaitable
{
public System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter GetAwaiter() { throw null; }
public readonly partial struct YieldAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
}
namespace System.Runtime.ConstrainedExecution
{
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public enum Cer
{
None = 0,
MayFail = 1,
Success = 2,
}
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public enum Consistency
{
MayCorruptProcess = 0,
MayCorruptAppDomain = 1,
MayCorruptInstance = 2,
WillNotCorruptState = 3,
}
public abstract partial class CriticalFinalizerObject
{
protected CriticalFinalizerObject() { }
~CriticalFinalizerObject() { }
}
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class PrePrepareMethodAttribute : System.Attribute
{
public PrePrepareMethodAttribute() { }
}
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class ReliabilityContractAttribute : System.Attribute
{
public ReliabilityContractAttribute(System.Runtime.ConstrainedExecution.Consistency consistencyGuarantee, System.Runtime.ConstrainedExecution.Cer cer) { }
public System.Runtime.ConstrainedExecution.Cer Cer { get { throw null; } }
public System.Runtime.ConstrainedExecution.Consistency ConsistencyGuarantee { get { throw null; } }
}
}
namespace System.Runtime.ExceptionServices
{
public sealed partial class ExceptionDispatchInfo
{
internal ExceptionDispatchInfo() { }
public System.Exception SourceException { get { throw null; } }
public static System.Runtime.ExceptionServices.ExceptionDispatchInfo Capture(System.Exception source) { throw null; }
public static System.Exception SetCurrentStackTrace(System.Exception source) { throw null; }
public static System.Exception SetRemoteStackTrace(System.Exception source, string stackTrace) { throw null; }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public void Throw() => throw null;
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public static void Throw(System.Exception source) => throw null;
}
public partial class FirstChanceExceptionEventArgs : System.EventArgs
{
public FirstChanceExceptionEventArgs(System.Exception exception) { }
public System.Exception Exception { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
[System.ObsoleteAttribute("Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored.", DiagnosticId = "SYSLIB0032", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public sealed partial class HandleProcessCorruptedStateExceptionsAttribute : System.Attribute
{
public HandleProcessCorruptedStateExceptionsAttribute() { }
}
}
namespace System.Runtime.InteropServices
{
public enum Architecture
{
X86 = 0,
X64 = 1,
Arm = 2,
Arm64 = 3,
Wasm = 4,
S390x = 5,
LoongArch64 = 6,
Armv6 = 7,
}
public enum CharSet
{
None = 1,
Ansi = 2,
Unicode = 3,
Auto = 4,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class ComVisibleAttribute : System.Attribute
{
public ComVisibleAttribute(bool visibility) { }
public bool Value { get { throw null; } }
}
public abstract partial class CriticalHandle : System.Runtime.ConstrainedExecution.CriticalFinalizerObject, System.IDisposable
{
protected System.IntPtr handle;
protected CriticalHandle(System.IntPtr invalidHandleValue) { }
public bool IsClosed { get { throw null; } }
public abstract bool IsInvalid { get; }
public void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~CriticalHandle() { }
protected abstract bool ReleaseHandle();
protected void SetHandle(System.IntPtr handle) { }
public void SetHandleAsInvalid() { }
}
public partial class ExternalException : System.SystemException
{
public ExternalException() { }
protected ExternalException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ExternalException(string? message) { }
public ExternalException(string? message, System.Exception? inner) { }
public ExternalException(string? message, int errorCode) { }
public virtual int ErrorCode { get { throw null; } }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public sealed partial class FieldOffsetAttribute : System.Attribute
{
public FieldOffsetAttribute(int offset) { }
public int Value { get { throw null; } }
}
public partial struct GCHandle : System.IEquatable<System.Runtime.InteropServices.GCHandle>
{
private int _dummyPrimitive;
public bool IsAllocated { get { throw null; } }
public object? Target { get { throw null; } set { } }
public System.IntPtr AddrOfPinnedObject() { throw null; }
public static System.Runtime.InteropServices.GCHandle Alloc(object? value) { throw null; }
public static System.Runtime.InteropServices.GCHandle Alloc(object? value, System.Runtime.InteropServices.GCHandleType type) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; }
public bool Equals(System.Runtime.InteropServices.GCHandle other) { throw null; }
public void Free() { }
public static System.Runtime.InteropServices.GCHandle FromIntPtr(System.IntPtr value) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Runtime.InteropServices.GCHandle a, System.Runtime.InteropServices.GCHandle b) { throw null; }
public static explicit operator System.Runtime.InteropServices.GCHandle (System.IntPtr value) { throw null; }
public static explicit operator System.IntPtr (System.Runtime.InteropServices.GCHandle value) { throw null; }
public static bool operator !=(System.Runtime.InteropServices.GCHandle a, System.Runtime.InteropServices.GCHandle b) { throw null; }
public static System.IntPtr ToIntPtr(System.Runtime.InteropServices.GCHandle value) { throw null; }
}
public enum GCHandleType
{
Weak = 0,
WeakTrackResurrection = 1,
Normal = 2,
Pinned = 3,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class InAttribute : System.Attribute
{
public InAttribute() { }
}
public enum LayoutKind
{
Sequential = 0,
Explicit = 2,
Auto = 3,
}
public readonly partial struct OSPlatform : System.IEquatable<System.Runtime.InteropServices.OSPlatform>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public static System.Runtime.InteropServices.OSPlatform FreeBSD { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Linux { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform OSX { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Windows { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Create(string osPlatform) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Runtime.InteropServices.OSPlatform other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Runtime.InteropServices.OSPlatform left, System.Runtime.InteropServices.OSPlatform right) { throw null; }
public static bool operator !=(System.Runtime.InteropServices.OSPlatform left, System.Runtime.InteropServices.OSPlatform right) { throw null; }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class OutAttribute : System.Attribute
{
public OutAttribute() { }
}
public static partial class RuntimeInformation
{
public static string FrameworkDescription { get { throw null; } }
public static System.Runtime.InteropServices.Architecture OSArchitecture { get { throw null; } }
public static string OSDescription { get { throw null; } }
public static System.Runtime.InteropServices.Architecture ProcessArchitecture { get { throw null; } }
public static string RuntimeIdentifier { get { throw null; } }
public static bool IsOSPlatform(System.Runtime.InteropServices.OSPlatform osPlatform) { throw null; }
}
public abstract partial class SafeBuffer : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
{
protected SafeBuffer(bool ownsHandle) : base (default(bool)) { }
[System.CLSCompliantAttribute(false)]
public ulong ByteLength { get { throw null; } }
[System.CLSCompliantAttribute(false)]
public unsafe void AcquirePointer(ref byte* pointer) { }
[System.CLSCompliantAttribute(false)]
public void Initialize(uint numElements, uint sizeOfEachElement) { }
[System.CLSCompliantAttribute(false)]
public void Initialize(ulong numBytes) { }
[System.CLSCompliantAttribute(false)]
public void Initialize<T>(uint numElements) where T : struct { }
[System.CLSCompliantAttribute(false)]
public void ReadArray<T>(ulong byteOffset, T[] array, int index, int count) where T : struct { }
[System.CLSCompliantAttribute(false)]
public void ReadSpan<T>(ulong byteOffset, System.Span<T> buffer) where T : struct { }
[System.CLSCompliantAttribute(false)]
public T Read<T>(ulong byteOffset) where T : struct { throw null; }
public void ReleasePointer() { }
[System.CLSCompliantAttribute(false)]
public void WriteArray<T>(ulong byteOffset, T[] array, int index, int count) where T : struct { }
[System.CLSCompliantAttribute(false)]
public void WriteSpan<T>(ulong byteOffset, System.ReadOnlySpan<T> data) where T : struct { }
[System.CLSCompliantAttribute(false)]
public void Write<T>(ulong byteOffset, T value) where T : struct { }
}
public abstract partial class SafeHandle : System.Runtime.ConstrainedExecution.CriticalFinalizerObject, System.IDisposable
{
protected System.IntPtr handle;
protected SafeHandle(System.IntPtr invalidHandleValue, bool ownsHandle) { }
public bool IsClosed { get { throw null; } }
public abstract bool IsInvalid { get; }
public void Close() { }
public void DangerousAddRef(ref bool success) { }
public System.IntPtr DangerousGetHandle() { throw null; }
public void DangerousRelease() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~SafeHandle() { }
protected abstract bool ReleaseHandle();
protected void SetHandle(System.IntPtr handle) { }
public void SetHandleAsInvalid() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class StructLayoutAttribute : System.Attribute
{
public System.Runtime.InteropServices.CharSet CharSet;
public int Pack;
public int Size;
public StructLayoutAttribute(short layoutKind) { }
public StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind layoutKind) { }
public System.Runtime.InteropServices.LayoutKind Value { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class SuppressGCTransitionAttribute : System.Attribute
{
public SuppressGCTransitionAttribute() { }
}
public enum UnmanagedType
{
Bool = 2,
I1 = 3,
U1 = 4,
I2 = 5,
U2 = 6,
I4 = 7,
U4 = 8,
I8 = 9,
U8 = 10,
R4 = 11,
R8 = 12,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling as Currency may be unavailable in future releases.")]
Currency = 15,
BStr = 19,
LPStr = 20,
LPWStr = 21,
LPTStr = 22,
ByValTStr = 23,
IUnknown = 25,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
IDispatch = 26,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Struct = 27,
Interface = 28,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
SafeArray = 29,
ByValArray = 30,
SysInt = 31,
SysUInt = 32,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling as VBByRefString may be unavailable in future releases.")]
VBByRefStr = 34,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling as AnsiBStr may be unavailable in future releases.")]
AnsiBStr = 35,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling as TBstr may be unavailable in future releases.")]
TBStr = 36,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
VariantBool = 37,
FunctionPtr = 38,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling arbitrary types may be unavailable in future releases. Specify the type you wish to marshal as.")]
AsAny = 40,
LPArray = 42,
LPStruct = 43,
CustomMarshaler = 44,
Error = 45,
IInspectable = 46,
HString = 47,
LPUTF8Str = 48,
}
}
namespace System.Runtime.Remoting
{
public partial class ObjectHandle : System.MarshalByRefObject
{
public ObjectHandle(object? o) { }
public object? Unwrap() { throw null; }
}
}
namespace System.Runtime.Serialization
{
public partial interface IDeserializationCallback
{
void OnDeserialization(object? sender);
}
[System.CLSCompliantAttribute(false)]
public partial interface IFormatterConverter
{
object Convert(object value, System.Type type);
object Convert(object value, System.TypeCode typeCode);
bool ToBoolean(object value);
byte ToByte(object value);
char ToChar(object value);
System.DateTime ToDateTime(object value);
decimal ToDecimal(object value);
double ToDouble(object value);
short ToInt16(object value);
int ToInt32(object value);
long ToInt64(object value);
sbyte ToSByte(object value);
float ToSingle(object value);
string? ToString(object value);
ushort ToUInt16(object value);
uint ToUInt32(object value);
ulong ToUInt64(object value);
}
public partial interface IObjectReference
{
object GetRealObject(System.Runtime.Serialization.StreamingContext context);
}
public partial interface ISafeSerializationData
{
void CompleteDeserialization(object deserialized);
}
public partial interface ISerializable
{
void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class OnDeserializedAttribute : System.Attribute
{
public OnDeserializedAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class OnDeserializingAttribute : System.Attribute
{
public OnDeserializingAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class OnSerializedAttribute : System.Attribute
{
public OnSerializedAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class OnSerializingAttribute : System.Attribute
{
public OnSerializingAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public sealed partial class OptionalFieldAttribute : System.Attribute
{
public OptionalFieldAttribute() { }
public int VersionAdded { get { throw null; } set { } }
}
public sealed partial class SafeSerializationEventArgs : System.EventArgs
{
internal SafeSerializationEventArgs() { }
public System.Runtime.Serialization.StreamingContext StreamingContext { get { throw null; } }
public void AddSerializedState(System.Runtime.Serialization.ISafeSerializationData serializedState) { }
}
public readonly partial struct SerializationEntry
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public string Name { get { throw null; } }
public System.Type ObjectType { get { throw null; } }
public object? Value { get { throw null; } }
}
public partial class SerializationException : System.SystemException
{
public SerializationException() { }
protected SerializationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public SerializationException(string? message) { }
public SerializationException(string? message, System.Exception? innerException) { }
}
public sealed partial class SerializationInfo
{
[System.CLSCompliantAttribute(false)]
public SerializationInfo(System.Type type, System.Runtime.Serialization.IFormatterConverter converter) { }
[System.CLSCompliantAttribute(false)]
public SerializationInfo(System.Type type, System.Runtime.Serialization.IFormatterConverter converter, bool requireSameTokenInPartialTrust) { }
public string AssemblyName { get { throw null; } set { } }
public string FullTypeName { get { throw null; } set { } }
public bool IsAssemblyNameSetExplicit { get { throw null; } }
public bool IsFullTypeNameSetExplicit { get { throw null; } }
public int MemberCount { get { throw null; } }
public System.Type ObjectType { get { throw null; } }
public void AddValue(string name, bool value) { }
public void AddValue(string name, byte value) { }
public void AddValue(string name, char value) { }
public void AddValue(string name, System.DateTime value) { }
public void AddValue(string name, decimal value) { }
public void AddValue(string name, double value) { }
public void AddValue(string name, short value) { }
public void AddValue(string name, int value) { }
public void AddValue(string name, long value) { }
public void AddValue(string name, object? value) { }
public void AddValue(string name, object? value, System.Type type) { }
[System.CLSCompliantAttribute(false)]
public void AddValue(string name, sbyte value) { }
public void AddValue(string name, float value) { }
[System.CLSCompliantAttribute(false)]
public void AddValue(string name, ushort value) { }
[System.CLSCompliantAttribute(false)]
public void AddValue(string name, uint value) { }
[System.CLSCompliantAttribute(false)]
public void AddValue(string name, ulong value) { }
public bool GetBoolean(string name) { throw null; }
public byte GetByte(string name) { throw null; }
public char GetChar(string name) { throw null; }
public System.DateTime GetDateTime(string name) { throw null; }
public decimal GetDecimal(string name) { throw null; }
public double GetDouble(string name) { throw null; }
public System.Runtime.Serialization.SerializationInfoEnumerator GetEnumerator() { throw null; }
public short GetInt16(string name) { throw null; }
public int GetInt32(string name) { throw null; }
public long GetInt64(string name) { throw null; }
[System.CLSCompliantAttribute(false)]
public sbyte GetSByte(string name) { throw null; }
public float GetSingle(string name) { throw null; }
public string? GetString(string name) { throw null; }
[System.CLSCompliantAttribute(false)]
public ushort GetUInt16(string name) { throw null; }
[System.CLSCompliantAttribute(false)]
public uint GetUInt32(string name) { throw null; }
[System.CLSCompliantAttribute(false)]
public ulong GetUInt64(string name) { throw null; }
public object? GetValue(string name, System.Type type) { throw null; }
public void SetType(System.Type type) { }
}
public sealed partial class SerializationInfoEnumerator : System.Collections.IEnumerator
{
internal SerializationInfoEnumerator() { }
public System.Runtime.Serialization.SerializationEntry Current { get { throw null; } }
public string Name { get { throw null; } }
public System.Type ObjectType { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
public object? Value { get { throw null; } }
public bool MoveNext() { throw null; }
public void Reset() { }
}
public readonly partial struct StreamingContext
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public StreamingContext(System.Runtime.Serialization.StreamingContextStates state) { throw null; }
public StreamingContext(System.Runtime.Serialization.StreamingContextStates state, object? additional) { throw null; }
public object? Context { get { throw null; } }
public System.Runtime.Serialization.StreamingContextStates State { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
}
[System.FlagsAttribute]
public enum StreamingContextStates
{
CrossProcess = 1,
CrossMachine = 2,
File = 4,
Persistence = 8,
Remoting = 16,
Other = 32,
Clone = 64,
CrossAppDomain = 128,
All = 255,
}
}
namespace System.Runtime.Versioning
{
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed partial class ComponentGuaranteesAttribute : System.Attribute
{
public ComponentGuaranteesAttribute(System.Runtime.Versioning.ComponentGuaranteesOptions guarantees) { }
public System.Runtime.Versioning.ComponentGuaranteesOptions Guarantees { get { throw null; } }
}
[System.FlagsAttribute]
public enum ComponentGuaranteesOptions
{
None = 0,
Exchange = 1,
Stable = 2,
SideBySide = 4,
}
public sealed partial class FrameworkName : System.IEquatable<System.Runtime.Versioning.FrameworkName?>
{
public FrameworkName(string frameworkName) { }
public FrameworkName(string identifier, System.Version version) { }
public FrameworkName(string identifier, System.Version version, string? profile) { }
public string FullName { get { throw null; } }
public string Identifier { get { throw null; } }
public string Profile { get { throw null; } }
public System.Version Version { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Runtime.Versioning.FrameworkName? other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Runtime.Versioning.FrameworkName? left, System.Runtime.Versioning.FrameworkName? right) { throw null; }
public static bool operator !=(System.Runtime.Versioning.FrameworkName? left, System.Runtime.Versioning.FrameworkName? right) { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class OSPlatformAttribute : System.Attribute
{
private protected OSPlatformAttribute(string platformName) { }
public string PlatformName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class RequiresPreviewFeaturesAttribute : System.Attribute
{
public RequiresPreviewFeaturesAttribute() { }
public RequiresPreviewFeaturesAttribute(string? message) { }
public string? Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)]
[System.Diagnostics.ConditionalAttribute("RESOURCE_ANNOTATION_WORK")]
public sealed partial class ResourceConsumptionAttribute : System.Attribute
{
public ResourceConsumptionAttribute(System.Runtime.Versioning.ResourceScope resourceScope) { }
public ResourceConsumptionAttribute(System.Runtime.Versioning.ResourceScope resourceScope, System.Runtime.Versioning.ResourceScope consumptionScope) { }
public System.Runtime.Versioning.ResourceScope ConsumptionScope { get { throw null; } }
public System.Runtime.Versioning.ResourceScope ResourceScope { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)]
[System.Diagnostics.ConditionalAttribute("RESOURCE_ANNOTATION_WORK")]
public sealed partial class ResourceExposureAttribute : System.Attribute
{
public ResourceExposureAttribute(System.Runtime.Versioning.ResourceScope exposureLevel) { }
public System.Runtime.Versioning.ResourceScope ResourceExposureLevel { get { throw null; } }
}
[System.FlagsAttribute]
public enum ResourceScope
{
None = 0,
Machine = 1,
Process = 2,
AppDomain = 4,
Library = 8,
Private = 16,
Assembly = 32,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed partial class SupportedOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public SupportedOSPlatformAttribute(string platformName) : base(platformName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=true, Inherited=false)]
public sealed partial class SupportedOSPlatformGuardAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public SupportedOSPlatformGuardAttribute(string platformName) : base(platformName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class TargetFrameworkAttribute : System.Attribute
{
public TargetFrameworkAttribute(string frameworkName) { }
public string? FrameworkDisplayName { get { throw null; } set { } }
public string FrameworkName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class TargetPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public TargetPlatformAttribute(string platformName) : base(platformName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed partial class UnsupportedOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public UnsupportedOSPlatformAttribute(string platformName) : base(platformName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=true, Inherited=false)]
public sealed partial class UnsupportedOSPlatformGuardAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public UnsupportedOSPlatformGuardAttribute(string platformName) : base(platformName) { }
}
public static partial class VersioningHelper
{
public static string MakeVersionSafeName(string? name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to) { throw null; }
public static string MakeVersionSafeName(string? name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to, System.Type? type) { throw null; }
}
}
namespace System.Security
{
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class AllowPartiallyTrustedCallersAttribute : System.Attribute
{
public AllowPartiallyTrustedCallersAttribute() { }
public System.Security.PartialTrustVisibilityLevel PartialTrustVisibilityLevel { get { throw null; } set { } }
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public partial interface IPermission : System.Security.ISecurityEncodable
{
System.Security.IPermission Copy();
void Demand();
System.Security.IPermission? Intersect(System.Security.IPermission? target);
bool IsSubsetOf(System.Security.IPermission? target);
System.Security.IPermission? Union(System.Security.IPermission? target);
}
public partial interface ISecurityEncodable
{
void FromXml(System.Security.SecurityElement e);
System.Security.SecurityElement? ToXml();
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public partial interface IStackWalk
{
void Assert();
void Demand();
void Deny();
void PermitOnly();
}
public enum PartialTrustVisibilityLevel
{
VisibleToAllHosts = 0,
NotVisibleByDefault = 1,
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public partial class PermissionSet : System.Collections.ICollection, System.Collections.IEnumerable, System.Runtime.Serialization.IDeserializationCallback, System.Security.ISecurityEncodable, System.Security.IStackWalk
{
public PermissionSet(System.Security.Permissions.PermissionState state) { }
public PermissionSet(System.Security.PermissionSet? permSet) { }
public virtual int Count { get { throw null; } }
public virtual bool IsReadOnly { get { throw null; } }
public virtual bool IsSynchronized { get { throw null; } }
public virtual object SyncRoot { get { throw null; } }
public System.Security.IPermission? AddPermission(System.Security.IPermission? perm) { throw null; }
protected virtual System.Security.IPermission? AddPermissionImpl(System.Security.IPermission? perm) { throw null; }
public void Assert() { }
public bool ContainsNonCodeAccessPermissions() { throw null; }
[System.ObsoleteAttribute]
public static byte[] ConvertPermissionSet(string inFormat, byte[] inData, string outFormat) { throw null; }
public virtual System.Security.PermissionSet Copy() { throw null; }
public virtual void CopyTo(System.Array array, int index) { }
public void Demand() { }
[System.ObsoleteAttribute]
public void Deny() { }
public override bool Equals(object? o) { throw null; }
public virtual void FromXml(System.Security.SecurityElement et) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
protected virtual System.Collections.IEnumerator GetEnumeratorImpl() { throw null; }
public override int GetHashCode() { throw null; }
public System.Security.IPermission? GetPermission(System.Type? permClass) { throw null; }
protected virtual System.Security.IPermission? GetPermissionImpl(System.Type? permClass) { throw null; }
public System.Security.PermissionSet? Intersect(System.Security.PermissionSet? other) { throw null; }
public bool IsEmpty() { throw null; }
public bool IsSubsetOf(System.Security.PermissionSet? target) { throw null; }
public bool IsUnrestricted() { throw null; }
public void PermitOnly() { }
public System.Security.IPermission? RemovePermission(System.Type? permClass) { throw null; }
protected virtual System.Security.IPermission? RemovePermissionImpl(System.Type? permClass) { throw null; }
public static void RevertAssert() { }
public System.Security.IPermission? SetPermission(System.Security.IPermission? perm) { throw null; }
protected virtual System.Security.IPermission? SetPermissionImpl(System.Security.IPermission? perm) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
public override string ToString() { throw null; }
public virtual System.Security.SecurityElement? ToXml() { throw null; }
public System.Security.PermissionSet? Union(System.Security.PermissionSet? other) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed partial class SecurityCriticalAttribute : System.Attribute
{
public SecurityCriticalAttribute() { }
public SecurityCriticalAttribute(System.Security.SecurityCriticalScope scope) { }
[System.ObsoleteAttribute("SecurityCriticalScope is only used for .NET 2.0 transparency compatibility.")]
public System.Security.SecurityCriticalScope Scope { get { throw null; } }
}
[System.ObsoleteAttribute("SecurityCriticalScope is only used for .NET 2.0 transparency compatibility.")]
public enum SecurityCriticalScope
{
Explicit = 0,
Everything = 1,
}
public sealed partial class SecurityElement
{
public SecurityElement(string tag) { }
public SecurityElement(string tag, string? text) { }
public System.Collections.Hashtable? Attributes { get { throw null; } set { } }
public System.Collections.ArrayList? Children { get { throw null; } set { } }
public string Tag { get { throw null; } set { } }
public string? Text { get { throw null; } set { } }
public void AddAttribute(string name, string value) { }
public void AddChild(System.Security.SecurityElement child) { }
public string? Attribute(string name) { throw null; }
public System.Security.SecurityElement Copy() { throw null; }
public bool Equal([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Security.SecurityElement? other) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("str")]
public static string? Escape(string? str) { throw null; }
public static System.Security.SecurityElement? FromString(string xml) { throw null; }
public static bool IsValidAttributeName([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? name) { throw null; }
public static bool IsValidAttributeValue([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value) { throw null; }
public static bool IsValidTag([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? tag) { throw null; }
public static bool IsValidText([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? text) { throw null; }
public System.Security.SecurityElement? SearchForChildByTag(string tag) { throw null; }
public string? SearchForTextOfTag(string tag) { throw null; }
public override string ToString() { throw null; }
}
public partial class SecurityException : System.SystemException
{
public SecurityException() { }
protected SecurityException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public SecurityException(string? message) { }
public SecurityException(string? message, System.Exception? inner) { }
public SecurityException(string? message, System.Type? type) { }
public SecurityException(string? message, System.Type? type, string? state) { }
public object? Demanded { get { throw null; } set { } }
public object? DenySetInstance { get { throw null; } set { } }
public System.Reflection.AssemblyName? FailedAssemblyInfo { get { throw null; } set { } }
public string? GrantedSet { get { throw null; } set { } }
public System.Reflection.MethodInfo? Method { get { throw null; } set { } }
public string? PermissionState { get { throw null; } set { } }
public System.Type? PermissionType { get { throw null; } set { } }
public object? PermitOnlySetInstance { get { throw null; } set { } }
public string? RefusedSet { get { throw null; } set { } }
public string? Url { get { throw null; } set { } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
public sealed partial class SecurityRulesAttribute : System.Attribute
{
public SecurityRulesAttribute(System.Security.SecurityRuleSet ruleSet) { }
public System.Security.SecurityRuleSet RuleSet { get { throw null; } }
public bool SkipVerificationInFullTrust { get { throw null; } set { } }
}
public enum SecurityRuleSet : byte
{
None = (byte)0,
Level1 = (byte)1,
Level2 = (byte)2,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed partial class SecuritySafeCriticalAttribute : System.Attribute
{
public SecuritySafeCriticalAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class SecurityTransparentAttribute : System.Attribute
{
public SecurityTransparentAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
[System.ObsoleteAttribute("SecurityTreatAsSafe is only used for .NET 2.0 transparency compatibility. Use the SecuritySafeCriticalAttribute instead.")]
public sealed partial class SecurityTreatAsSafeAttribute : System.Attribute
{
public SecurityTreatAsSafeAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Interface | System.AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
public sealed partial class SuppressUnmanagedCodeSecurityAttribute : System.Attribute
{
public SuppressUnmanagedCodeSecurityAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Module, AllowMultiple=true, Inherited=false)]
public sealed partial class UnverifiableCodeAttribute : System.Attribute
{
public UnverifiableCodeAttribute() { }
}
public partial class VerificationException : System.SystemException
{
public VerificationException() { }
protected VerificationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public VerificationException(string? message) { }
public VerificationException(string? message, System.Exception? innerException) { }
}
}
namespace System.Security.Cryptography
{
public partial class CryptographicException : System.SystemException
{
public CryptographicException() { }
public CryptographicException(int hr) { }
protected CryptographicException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public CryptographicException(string? message) { }
public CryptographicException(string? message, System.Exception? inner) { }
public CryptographicException(string format, string? insert) { }
}
}
namespace System.Security.Permissions
{
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public abstract partial class CodeAccessSecurityAttribute : System.Security.Permissions.SecurityAttribute
{
protected CodeAccessSecurityAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public enum PermissionState
{
None = 0,
Unrestricted = 1,
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public enum SecurityAction
{
Demand = 2,
Assert = 3,
Deny = 4,
PermitOnly = 5,
LinkDemand = 6,
InheritanceDemand = 7,
RequestMinimum = 8,
RequestOptional = 9,
RequestRefuse = 10,
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public abstract partial class SecurityAttribute : System.Attribute
{
protected SecurityAttribute(System.Security.Permissions.SecurityAction action) { }
public System.Security.Permissions.SecurityAction Action { get { throw null; } set { } }
public bool Unrestricted { get { throw null; } set { } }
public abstract System.Security.IPermission? CreatePermission();
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed partial class SecurityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
{
public SecurityPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
public bool Assertion { get { throw null; } set { } }
public bool BindingRedirects { get { throw null; } set { } }
public bool ControlAppDomain { get { throw null; } set { } }
public bool ControlDomainPolicy { get { throw null; } set { } }
public bool ControlEvidence { get { throw null; } set { } }
public bool ControlPolicy { get { throw null; } set { } }
public bool ControlPrincipal { get { throw null; } set { } }
public bool ControlThread { get { throw null; } set { } }
public bool Execution { get { throw null; } set { } }
public System.Security.Permissions.SecurityPermissionFlag Flags { get { throw null; } set { } }
public bool Infrastructure { get { throw null; } set { } }
public bool RemotingConfiguration { get { throw null; } set { } }
public bool SerializationFormatter { get { throw null; } set { } }
public bool SkipVerification { get { throw null; } set { } }
public bool UnmanagedCode { get { throw null; } set { } }
public override System.Security.IPermission? CreatePermission() { throw null; }
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.FlagsAttribute]
public enum SecurityPermissionFlag
{
NoFlags = 0,
Assertion = 1,
UnmanagedCode = 2,
SkipVerification = 4,
Execution = 8,
ControlThread = 16,
ControlEvidence = 32,
ControlPolicy = 64,
SerializationFormatter = 128,
ControlDomainPolicy = 256,
ControlPrincipal = 512,
ControlAppDomain = 1024,
RemotingConfiguration = 2048,
Infrastructure = 4096,
BindingRedirects = 8192,
AllFlags = 16383,
}
}
namespace System.Security.Principal
{
public partial interface IIdentity
{
string? AuthenticationType { get; }
bool IsAuthenticated { get; }
string? Name { get; }
}
public partial interface IPrincipal
{
System.Security.Principal.IIdentity? Identity { get; }
bool IsInRole(string role);
}
public enum PrincipalPolicy
{
UnauthenticatedPrincipal = 0,
NoPrincipal = 1,
WindowsPrincipal = 2,
}
public enum TokenImpersonationLevel
{
None = 0,
Anonymous = 1,
Identification = 2,
Impersonation = 3,
Delegation = 4,
}
}
namespace System.Text
{
public abstract partial class Decoder
{
protected Decoder() { }
public System.Text.DecoderFallback? Fallback { get { throw null; } set { } }
public System.Text.DecoderFallbackBuffer FallbackBuffer { get { throw null; } }
[System.CLSCompliantAttribute(false)]
public unsafe virtual void Convert(byte* bytes, int byteCount, char* chars, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; }
public virtual void Convert(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; }
public virtual void Convert(System.ReadOnlySpan<byte> bytes, System.Span<char> chars, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetCharCount(byte* bytes, int count, bool flush) { throw null; }
public abstract int GetCharCount(byte[] bytes, int index, int count);
public virtual int GetCharCount(byte[] bytes, int index, int count, bool flush) { throw null; }
public virtual int GetCharCount(System.ReadOnlySpan<byte> bytes, bool flush) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) { throw null; }
public abstract int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex);
public virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush) { throw null; }
public virtual int GetChars(System.ReadOnlySpan<byte> bytes, System.Span<char> chars, bool flush) { throw null; }
public virtual void Reset() { }
}
public sealed partial class DecoderExceptionFallback : System.Text.DecoderFallback
{
public DecoderExceptionFallback() { }
public override int MaxCharCount { get { throw null; } }
public override System.Text.DecoderFallbackBuffer CreateFallbackBuffer() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
}
public sealed partial class DecoderExceptionFallbackBuffer : System.Text.DecoderFallbackBuffer
{
public DecoderExceptionFallbackBuffer() { }
public override int Remaining { get { throw null; } }
public override bool Fallback(byte[] bytesUnknown, int index) { throw null; }
public override char GetNextChar() { throw null; }
public override bool MovePrevious() { throw null; }
}
public abstract partial class DecoderFallback
{
protected DecoderFallback() { }
public static System.Text.DecoderFallback ExceptionFallback { get { throw null; } }
public abstract int MaxCharCount { get; }
public static System.Text.DecoderFallback ReplacementFallback { get { throw null; } }
public abstract System.Text.DecoderFallbackBuffer CreateFallbackBuffer();
}
public abstract partial class DecoderFallbackBuffer
{
protected DecoderFallbackBuffer() { }
public abstract int Remaining { get; }
public abstract bool Fallback(byte[] bytesUnknown, int index);
public abstract char GetNextChar();
public abstract bool MovePrevious();
public virtual void Reset() { }
}
public sealed partial class DecoderFallbackException : System.ArgumentException
{
public DecoderFallbackException() { }
public DecoderFallbackException(string? message) { }
public DecoderFallbackException(string? message, byte[]? bytesUnknown, int index) { }
public DecoderFallbackException(string? message, System.Exception? innerException) { }
public byte[]? BytesUnknown { get { throw null; } }
public int Index { get { throw null; } }
}
public sealed partial class DecoderReplacementFallback : System.Text.DecoderFallback
{
public DecoderReplacementFallback() { }
public DecoderReplacementFallback(string replacement) { }
public string DefaultString { get { throw null; } }
public override int MaxCharCount { get { throw null; } }
public override System.Text.DecoderFallbackBuffer CreateFallbackBuffer() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
}
public sealed partial class DecoderReplacementFallbackBuffer : System.Text.DecoderFallbackBuffer
{
public DecoderReplacementFallbackBuffer(System.Text.DecoderReplacementFallback fallback) { }
public override int Remaining { get { throw null; } }
public override bool Fallback(byte[] bytesUnknown, int index) { throw null; }
public override char GetNextChar() { throw null; }
public override bool MovePrevious() { throw null; }
public override void Reset() { }
}
public abstract partial class Encoder
{
protected Encoder() { }
public System.Text.EncoderFallback? Fallback { get { throw null; } set { } }
public System.Text.EncoderFallbackBuffer FallbackBuffer { get { throw null; } }
[System.CLSCompliantAttribute(false)]
public unsafe virtual void Convert(char* chars, int charCount, byte* bytes, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; }
public virtual void Convert(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; }
public virtual void Convert(System.ReadOnlySpan<char> chars, System.Span<byte> bytes, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetByteCount(char* chars, int count, bool flush) { throw null; }
public abstract int GetByteCount(char[] chars, int index, int count, bool flush);
public virtual int GetByteCount(System.ReadOnlySpan<char> chars, bool flush) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) { throw null; }
public abstract int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, bool flush);
public virtual int GetBytes(System.ReadOnlySpan<char> chars, System.Span<byte> bytes, bool flush) { throw null; }
public virtual void Reset() { }
}
public sealed partial class EncoderExceptionFallback : System.Text.EncoderFallback
{
public EncoderExceptionFallback() { }
public override int MaxCharCount { get { throw null; } }
public override System.Text.EncoderFallbackBuffer CreateFallbackBuffer() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
}
public sealed partial class EncoderExceptionFallbackBuffer : System.Text.EncoderFallbackBuffer
{
public EncoderExceptionFallbackBuffer() { }
public override int Remaining { get { throw null; } }
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index) { throw null; }
public override bool Fallback(char charUnknown, int index) { throw null; }
public override char GetNextChar() { throw null; }
public override bool MovePrevious() { throw null; }
}
public abstract partial class EncoderFallback
{
protected EncoderFallback() { }
public static System.Text.EncoderFallback ExceptionFallback { get { throw null; } }
public abstract int MaxCharCount { get; }
public static System.Text.EncoderFallback ReplacementFallback { get { throw null; } }
public abstract System.Text.EncoderFallbackBuffer CreateFallbackBuffer();
}
public abstract partial class EncoderFallbackBuffer
{
protected EncoderFallbackBuffer() { }
public abstract int Remaining { get; }
public abstract bool Fallback(char charUnknownHigh, char charUnknownLow, int index);
public abstract bool Fallback(char charUnknown, int index);
public abstract char GetNextChar();
public abstract bool MovePrevious();
public virtual void Reset() { }
}
public sealed partial class EncoderFallbackException : System.ArgumentException
{
public EncoderFallbackException() { }
public EncoderFallbackException(string? message) { }
public EncoderFallbackException(string? message, System.Exception? innerException) { }
public char CharUnknown { get { throw null; } }
public char CharUnknownHigh { get { throw null; } }
public char CharUnknownLow { get { throw null; } }
public int Index { get { throw null; } }
public bool IsUnknownSurrogate() { throw null; }
}
public sealed partial class EncoderReplacementFallback : System.Text.EncoderFallback
{
public EncoderReplacementFallback() { }
public EncoderReplacementFallback(string replacement) { }
public string DefaultString { get { throw null; } }
public override int MaxCharCount { get { throw null; } }
public override System.Text.EncoderFallbackBuffer CreateFallbackBuffer() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
}
public sealed partial class EncoderReplacementFallbackBuffer : System.Text.EncoderFallbackBuffer
{
public EncoderReplacementFallbackBuffer(System.Text.EncoderReplacementFallback fallback) { }
public override int Remaining { get { throw null; } }
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index) { throw null; }
public override bool Fallback(char charUnknown, int index) { throw null; }
public override char GetNextChar() { throw null; }
public override bool MovePrevious() { throw null; }
public override void Reset() { }
}
public abstract partial class Encoding : System.ICloneable
{
protected Encoding() { }
protected Encoding(int codePage) { }
protected Encoding(int codePage, System.Text.EncoderFallback? encoderFallback, System.Text.DecoderFallback? decoderFallback) { }
public static System.Text.Encoding ASCII { get { throw null; } }
public static System.Text.Encoding BigEndianUnicode { get { throw null; } }
public virtual string BodyName { get { throw null; } }
public virtual int CodePage { get { throw null; } }
public System.Text.DecoderFallback DecoderFallback { get { throw null; } set { } }
public static System.Text.Encoding Default { get { throw null; } }
public System.Text.EncoderFallback EncoderFallback { get { throw null; } set { } }
public virtual string EncodingName { get { throw null; } }
public virtual string HeaderName { get { throw null; } }
public virtual bool IsBrowserDisplay { get { throw null; } }
public virtual bool IsBrowserSave { get { throw null; } }
public virtual bool IsMailNewsDisplay { get { throw null; } }
public virtual bool IsMailNewsSave { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public virtual bool IsSingleByte { get { throw null; } }
public static System.Text.Encoding Latin1 { get { throw null; } }
public virtual System.ReadOnlySpan<byte> Preamble { get { throw null; } }
public static System.Text.Encoding Unicode { get { throw null; } }
public static System.Text.Encoding UTF32 { get { throw null; } }
[System.ObsoleteAttribute("The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.", DiagnosticId = "SYSLIB0001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Text.Encoding UTF7 { get { throw null; } }
public static System.Text.Encoding UTF8 { get { throw null; } }
public virtual string WebName { get { throw null; } }
public virtual int WindowsCodePage { get { throw null; } }
public virtual object Clone() { throw null; }
public static byte[] Convert(System.Text.Encoding srcEncoding, System.Text.Encoding dstEncoding, byte[] bytes) { throw null; }
public static byte[] Convert(System.Text.Encoding srcEncoding, System.Text.Encoding dstEncoding, byte[] bytes, int index, int count) { throw null; }
public static System.IO.Stream CreateTranscodingStream(System.IO.Stream innerStream, System.Text.Encoding innerStreamEncoding, System.Text.Encoding outerStreamEncoding, bool leaveOpen = false) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetByteCount(char* chars, int count) { throw null; }
public virtual int GetByteCount(char[] chars) { throw null; }
public abstract int GetByteCount(char[] chars, int index, int count);
public virtual int GetByteCount(System.ReadOnlySpan<char> chars) { throw null; }
public virtual int GetByteCount(string s) { throw null; }
public int GetByteCount(string s, int index, int count) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { throw null; }
public virtual byte[] GetBytes(char[] chars) { throw null; }
public virtual byte[] GetBytes(char[] chars, int index, int count) { throw null; }
public abstract int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex);
public virtual int GetBytes(System.ReadOnlySpan<char> chars, System.Span<byte> bytes) { throw null; }
public virtual byte[] GetBytes(string s) { throw null; }
public byte[] GetBytes(string s, int index, int count) { throw null; }
public virtual int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetCharCount(byte* bytes, int count) { throw null; }
public virtual int GetCharCount(byte[] bytes) { throw null; }
public abstract int GetCharCount(byte[] bytes, int index, int count);
public virtual int GetCharCount(System.ReadOnlySpan<byte> bytes) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { throw null; }
public virtual char[] GetChars(byte[] bytes) { throw null; }
public virtual char[] GetChars(byte[] bytes, int index, int count) { throw null; }
public abstract int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex);
public virtual int GetChars(System.ReadOnlySpan<byte> bytes, System.Span<char> chars) { throw null; }
public virtual System.Text.Decoder GetDecoder() { throw null; }
public virtual System.Text.Encoder GetEncoder() { throw null; }
public static System.Text.Encoding GetEncoding(int codepage) { throw null; }
public static System.Text.Encoding GetEncoding(int codepage, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) { throw null; }
public static System.Text.Encoding GetEncoding(string name) { throw null; }
public static System.Text.Encoding GetEncoding(string name, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) { throw null; }
public static System.Text.EncodingInfo[] GetEncodings() { throw null; }
public override int GetHashCode() { throw null; }
public abstract int GetMaxByteCount(int charCount);
public abstract int GetMaxCharCount(int byteCount);
public virtual byte[] GetPreamble() { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe string GetString(byte* bytes, int byteCount) { throw null; }
public virtual string GetString(byte[] bytes) { throw null; }
public virtual string GetString(byte[] bytes, int index, int count) { throw null; }
public string GetString(System.ReadOnlySpan<byte> bytes) { throw null; }
public bool IsAlwaysNormalized() { throw null; }
public virtual bool IsAlwaysNormalized(System.Text.NormalizationForm form) { throw null; }
public static void RegisterProvider(System.Text.EncodingProvider provider) { }
}
public sealed partial class EncodingInfo
{
public EncodingInfo(System.Text.EncodingProvider provider, int codePage, string name, string displayName) { }
public int CodePage { get { throw null; } }
public string DisplayName { get { throw null; } }
public string Name { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public System.Text.Encoding GetEncoding() { throw null; }
public override int GetHashCode() { throw null; }
}
public abstract partial class EncodingProvider
{
public EncodingProvider() { }
public abstract System.Text.Encoding? GetEncoding(int codepage);
public virtual System.Text.Encoding? GetEncoding(int codepage, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) { throw null; }
public abstract System.Text.Encoding? GetEncoding(string name);
public virtual System.Text.Encoding? GetEncoding(string name, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) { throw null; }
public virtual System.Collections.Generic.IEnumerable<System.Text.EncodingInfo> GetEncodings() { throw null; }
}
public enum NormalizationForm
{
FormC = 1,
FormD = 2,
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
FormKC = 5,
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
FormKD = 6,
}
public readonly partial struct Rune : System.IComparable, System.IComparable<System.Text.Rune>, System.IEquatable<System.Text.Rune>, System.IFormattable, System.ISpanFormattable
{
private readonly int _dummyPrimitive;
public Rune(char ch) { throw null; }
public Rune(char highSurrogate, char lowSurrogate) { throw null; }
public Rune(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public Rune(uint value) { throw null; }
public bool IsAscii { get { throw null; } }
public bool IsBmp { get { throw null; } }
public int Plane { get { throw null; } }
public static System.Text.Rune ReplacementChar { get { throw null; } }
public int Utf16SequenceLength { get { throw null; } }
public int Utf8SequenceLength { get { throw null; } }
public int Value { get { throw null; } }
public int CompareTo(System.Text.Rune other) { throw null; }
public static System.Buffers.OperationStatus DecodeFromUtf16(System.ReadOnlySpan<char> source, out System.Text.Rune result, out int charsConsumed) { throw null; }
public static System.Buffers.OperationStatus DecodeFromUtf8(System.ReadOnlySpan<byte> source, out System.Text.Rune result, out int bytesConsumed) { throw null; }
public static System.Buffers.OperationStatus DecodeLastFromUtf16(System.ReadOnlySpan<char> source, out System.Text.Rune result, out int charsConsumed) { throw null; }
public static System.Buffers.OperationStatus DecodeLastFromUtf8(System.ReadOnlySpan<byte> source, out System.Text.Rune value, out int bytesConsumed) { throw null; }
public int EncodeToUtf16(System.Span<char> destination) { throw null; }
public int EncodeToUtf8(System.Span<byte> destination) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Text.Rune other) { throw null; }
public override int GetHashCode() { throw null; }
public static double GetNumericValue(System.Text.Rune value) { throw null; }
public static System.Text.Rune GetRuneAt(string input, int index) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(System.Text.Rune value) { throw null; }
public static bool IsControl(System.Text.Rune value) { throw null; }
public static bool IsDigit(System.Text.Rune value) { throw null; }
public static bool IsLetter(System.Text.Rune value) { throw null; }
public static bool IsLetterOrDigit(System.Text.Rune value) { throw null; }
public static bool IsLower(System.Text.Rune value) { throw null; }
public static bool IsNumber(System.Text.Rune value) { throw null; }
public static bool IsPunctuation(System.Text.Rune value) { throw null; }
public static bool IsSeparator(System.Text.Rune value) { throw null; }
public static bool IsSymbol(System.Text.Rune value) { throw null; }
public static bool IsUpper(System.Text.Rune value) { throw null; }
public static bool IsValid(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool IsValid(uint value) { throw null; }
public static bool IsWhiteSpace(System.Text.Rune value) { throw null; }
public static bool operator ==(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static explicit operator System.Text.Rune (char ch) { throw null; }
public static explicit operator System.Text.Rune (int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator System.Text.Rune (uint value) { throw null; }
public static bool operator >(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static bool operator >=(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static bool operator !=(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static bool operator <(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static bool operator <=(System.Text.Rune left, System.Text.Rune right) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
string System.IFormattable.ToString(string? format, System.IFormatProvider? formatProvider) { throw null; }
bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw null; }
public static System.Text.Rune ToLower(System.Text.Rune value, System.Globalization.CultureInfo culture) { throw null; }
public static System.Text.Rune ToLowerInvariant(System.Text.Rune value) { throw null; }
public override string ToString() { throw null; }
public static System.Text.Rune ToUpper(System.Text.Rune value, System.Globalization.CultureInfo culture) { throw null; }
public static System.Text.Rune ToUpperInvariant(System.Text.Rune value) { throw null; }
public static bool TryCreate(char highSurrogate, char lowSurrogate, out System.Text.Rune result) { throw null; }
public static bool TryCreate(char ch, out System.Text.Rune result) { throw null; }
public static bool TryCreate(int value, out System.Text.Rune result) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryCreate(uint value, out System.Text.Rune result) { throw null; }
public bool TryEncodeToUtf16(System.Span<char> destination, out int charsWritten) { throw null; }
public bool TryEncodeToUtf8(System.Span<byte> destination, out int bytesWritten) { throw null; }
public static bool TryGetRuneAt(string input, int index, out System.Text.Rune value) { throw null; }
}
public sealed partial class StringBuilder : System.Runtime.Serialization.ISerializable
{
public StringBuilder() { }
public StringBuilder(int capacity) { }
public StringBuilder(int capacity, int maxCapacity) { }
public StringBuilder(string? value) { }
public StringBuilder(string? value, int capacity) { }
public StringBuilder(string? value, int startIndex, int length, int capacity) { }
public int Capacity { get { throw null; } set { } }
[System.Runtime.CompilerServices.IndexerName("Chars")]
public char this[int index] { get { throw null; } set { } }
public int Length { get { throw null; } set { } }
public int MaxCapacity { get { throw null; } }
public System.Text.StringBuilder Append(bool value) { throw null; }
public System.Text.StringBuilder Append(byte value) { throw null; }
public System.Text.StringBuilder Append(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe System.Text.StringBuilder Append(char* value, int valueCount) { throw null; }
public System.Text.StringBuilder Append(char value, int repeatCount) { throw null; }
public System.Text.StringBuilder Append(char[]? value) { throw null; }
public System.Text.StringBuilder Append(char[]? value, int startIndex, int charCount) { throw null; }
public System.Text.StringBuilder Append(decimal value) { throw null; }
public System.Text.StringBuilder Append(double value) { throw null; }
public System.Text.StringBuilder Append(System.IFormatProvider? provider, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute(new string[]{ "", "provider"})] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; }
public System.Text.StringBuilder Append(short value) { throw null; }
public System.Text.StringBuilder Append(int value) { throw null; }
public System.Text.StringBuilder Append(long value) { throw null; }
public System.Text.StringBuilder Append(object? value) { throw null; }
public System.Text.StringBuilder Append(System.ReadOnlyMemory<char> value) { throw null; }
public System.Text.StringBuilder Append(System.ReadOnlySpan<char> value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Append(sbyte value) { throw null; }
public System.Text.StringBuilder Append(float value) { throw null; }
public System.Text.StringBuilder Append(string? value) { throw null; }
public System.Text.StringBuilder Append(string? value, int startIndex, int count) { throw null; }
public System.Text.StringBuilder Append(System.Text.StringBuilder? value) { throw null; }
public System.Text.StringBuilder Append(System.Text.StringBuilder? value, int startIndex, int count) { throw null; }
public System.Text.StringBuilder Append([System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("")] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Append(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Append(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Append(ulong value) { throw null; }
public System.Text.StringBuilder AppendFormat(System.IFormatProvider? provider, string format, object? arg0) { throw null; }
public System.Text.StringBuilder AppendFormat(System.IFormatProvider? provider, string format, object? arg0, object? arg1) { throw null; }
public System.Text.StringBuilder AppendFormat(System.IFormatProvider? provider, string format, object? arg0, object? arg1, object? arg2) { throw null; }
public System.Text.StringBuilder AppendFormat(System.IFormatProvider? provider, string format, params object?[] args) { throw null; }
public System.Text.StringBuilder AppendFormat(string format, object? arg0) { throw null; }
public System.Text.StringBuilder AppendFormat(string format, object? arg0, object? arg1) { throw null; }
public System.Text.StringBuilder AppendFormat(string format, object? arg0, object? arg1, object? arg2) { throw null; }
public System.Text.StringBuilder AppendFormat(string format, params object?[] args) { throw null; }
public System.Text.StringBuilder AppendJoin(char separator, params object?[] values) { throw null; }
public System.Text.StringBuilder AppendJoin(char separator, params string?[] values) { throw null; }
public System.Text.StringBuilder AppendJoin(string? separator, params object?[] values) { throw null; }
public System.Text.StringBuilder AppendJoin(string? separator, params string?[] values) { throw null; }
public System.Text.StringBuilder AppendJoin<T>(char separator, System.Collections.Generic.IEnumerable<T> values) { throw null; }
public System.Text.StringBuilder AppendJoin<T>(string? separator, System.Collections.Generic.IEnumerable<T> values) { throw null; }
public System.Text.StringBuilder AppendLine() { throw null; }
public System.Text.StringBuilder AppendLine(System.IFormatProvider? provider, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute(new string[]{ "", "provider"})] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; }
public System.Text.StringBuilder AppendLine(string? value) { throw null; }
public System.Text.StringBuilder AppendLine([System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("")] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; }
public System.Text.StringBuilder Clear() { throw null; }
public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count) { }
public void CopyTo(int sourceIndex, System.Span<char> destination, int count) { }
public int EnsureCapacity(int capacity) { throw null; }
public bool Equals(System.ReadOnlySpan<char> span) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Text.StringBuilder? sb) { throw null; }
public System.Text.StringBuilder.ChunkEnumerator GetChunks() { throw null; }
public System.Text.StringBuilder Insert(int index, bool value) { throw null; }
public System.Text.StringBuilder Insert(int index, byte value) { throw null; }
public System.Text.StringBuilder Insert(int index, char value) { throw null; }
public System.Text.StringBuilder Insert(int index, char[]? value) { throw null; }
public System.Text.StringBuilder Insert(int index, char[]? value, int startIndex, int charCount) { throw null; }
public System.Text.StringBuilder Insert(int index, decimal value) { throw null; }
public System.Text.StringBuilder Insert(int index, double value) { throw null; }
public System.Text.StringBuilder Insert(int index, short value) { throw null; }
public System.Text.StringBuilder Insert(int index, int value) { throw null; }
public System.Text.StringBuilder Insert(int index, long value) { throw null; }
public System.Text.StringBuilder Insert(int index, object? value) { throw null; }
public System.Text.StringBuilder Insert(int index, System.ReadOnlySpan<char> value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Insert(int index, sbyte value) { throw null; }
public System.Text.StringBuilder Insert(int index, float value) { throw null; }
public System.Text.StringBuilder Insert(int index, string? value) { throw null; }
public System.Text.StringBuilder Insert(int index, string? value, int count) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Insert(int index, ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Insert(int index, uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Insert(int index, ulong value) { throw null; }
public System.Text.StringBuilder Remove(int startIndex, int length) { throw null; }
public System.Text.StringBuilder Replace(char oldChar, char newChar) { throw null; }
public System.Text.StringBuilder Replace(char oldChar, char newChar, int startIndex, int count) { throw null; }
public System.Text.StringBuilder Replace(string oldValue, string? newValue) { throw null; }
public System.Text.StringBuilder Replace(string oldValue, string? newValue, int startIndex, int count) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
public string ToString(int startIndex, int length) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute]
public partial struct AppendInterpolatedStringHandler
{
private object _dummy;
private int _dummyPrimitive;
public AppendInterpolatedStringHandler(int literalLength, int formattedCount, System.Text.StringBuilder stringBuilder) { throw null; }
public AppendInterpolatedStringHandler(int literalLength, int formattedCount, System.Text.StringBuilder stringBuilder, System.IFormatProvider? provider) { throw null; }
public void AppendFormatted(object? value, int alignment = 0, string? format = null) { }
public void AppendFormatted(System.ReadOnlySpan<char> value) { }
public void AppendFormatted(System.ReadOnlySpan<char> value, int alignment = 0, string? format = null) { }
public void AppendFormatted(string? value) { }
public void AppendFormatted(string? value, int alignment = 0, string? format = null) { }
public void AppendFormatted<T>(T value) { }
public void AppendFormatted<T>(T value, int alignment) { }
public void AppendFormatted<T>(T value, int alignment, string? format) { }
public void AppendFormatted<T>(T value, string? format) { }
public void AppendLiteral(string value) { }
}
public partial struct ChunkEnumerator
{
private object _dummy;
private int _dummyPrimitive;
public System.ReadOnlyMemory<char> Current { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public System.Text.StringBuilder.ChunkEnumerator GetEnumerator() { throw null; }
public bool MoveNext() { throw null; }
}
}
public partial struct StringRuneEnumerator : System.Collections.Generic.IEnumerable<System.Text.Rune>, System.Collections.Generic.IEnumerator<System.Text.Rune>, System.Collections.IEnumerable, System.Collections.IEnumerator, System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
public System.Text.Rune Current { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
public System.Text.StringRuneEnumerator GetEnumerator() { throw null; }
public bool MoveNext() { throw null; }
System.Collections.Generic.IEnumerator<System.Text.Rune> System.Collections.Generic.IEnumerable<System.Text.Rune>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
void System.Collections.IEnumerator.Reset() { }
void System.IDisposable.Dispose() { }
}
}
namespace System.Text.Unicode
{
public static partial class Utf8
{
public static System.Buffers.OperationStatus FromUtf16(System.ReadOnlySpan<char> source, System.Span<byte> destination, out int charsRead, out int bytesWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; }
public static System.Buffers.OperationStatus ToUtf16(System.ReadOnlySpan<byte> source, System.Span<char> destination, out int bytesRead, out int charsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; }
}
}
namespace System.Threading
{
public readonly partial struct CancellationToken : System.IEquatable<System.Threading.CancellationToken>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public CancellationToken(bool canceled) { throw null; }
public bool CanBeCanceled { get { throw null; } }
public bool IsCancellationRequested { get { throw null; } }
public static System.Threading.CancellationToken None { get { throw null; } }
public System.Threading.WaitHandle WaitHandle { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other) { throw null; }
public bool Equals(System.Threading.CancellationToken other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Threading.CancellationToken left, System.Threading.CancellationToken right) { throw null; }
public static bool operator !=(System.Threading.CancellationToken left, System.Threading.CancellationToken right) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action callback) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action callback, bool useSynchronizationContext) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action<object?, System.Threading.CancellationToken> callback, object? state) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action<object?> callback, object? state) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action<object?> callback, object? state, bool useSynchronizationContext) { throw null; }
public void ThrowIfCancellationRequested() { }
public System.Threading.CancellationTokenRegistration UnsafeRegister(System.Action<object?, System.Threading.CancellationToken> callback, object? state) { throw null; }
public System.Threading.CancellationTokenRegistration UnsafeRegister(System.Action<object?> callback, object? state) { throw null; }
}
public readonly partial struct CancellationTokenRegistration : System.IAsyncDisposable, System.IDisposable, System.IEquatable<System.Threading.CancellationTokenRegistration>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Threading.CancellationToken Token { get { throw null; } }
public void Dispose() { }
public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Threading.CancellationTokenRegistration other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Threading.CancellationTokenRegistration left, System.Threading.CancellationTokenRegistration right) { throw null; }
public static bool operator !=(System.Threading.CancellationTokenRegistration left, System.Threading.CancellationTokenRegistration right) { throw null; }
public bool Unregister() { throw null; }
}
public partial class CancellationTokenSource : System.IDisposable
{
public CancellationTokenSource() { }
public CancellationTokenSource(int millisecondsDelay) { }
public CancellationTokenSource(System.TimeSpan delay) { }
public bool IsCancellationRequested { get { throw null; } }
public System.Threading.CancellationToken Token { get { throw null; } }
public void Cancel() { }
public void Cancel(bool throwOnFirstException) { }
public void CancelAfter(int millisecondsDelay) { }
public void CancelAfter(System.TimeSpan delay) { }
public static System.Threading.CancellationTokenSource CreateLinkedTokenSource(System.Threading.CancellationToken token) { throw null; }
public static System.Threading.CancellationTokenSource CreateLinkedTokenSource(System.Threading.CancellationToken token1, System.Threading.CancellationToken token2) { throw null; }
public static System.Threading.CancellationTokenSource CreateLinkedTokenSource(params System.Threading.CancellationToken[] tokens) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public bool TryReset() { throw null; }
}
public enum LazyThreadSafetyMode
{
None = 0,
PublicationOnly = 1,
ExecutionAndPublication = 2,
}
public sealed partial class PeriodicTimer : System.IDisposable
{
public PeriodicTimer(System.TimeSpan period) { }
public void Dispose() { }
~PeriodicTimer() { }
public System.Threading.Tasks.ValueTask<bool> WaitForNextTickAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public static partial class Timeout
{
public const int Infinite = -1;
public static readonly System.TimeSpan InfiniteTimeSpan;
}
public sealed partial class Timer : System.MarshalByRefObject, System.IAsyncDisposable, System.IDisposable
{
public Timer(System.Threading.TimerCallback callback) { }
public Timer(System.Threading.TimerCallback callback, object? state, int dueTime, int period) { }
public Timer(System.Threading.TimerCallback callback, object? state, long dueTime, long period) { }
public Timer(System.Threading.TimerCallback callback, object? state, System.TimeSpan dueTime, System.TimeSpan period) { }
[System.CLSCompliantAttribute(false)]
public Timer(System.Threading.TimerCallback callback, object? state, uint dueTime, uint period) { }
public static long ActiveCount { get { throw null; } }
public bool Change(int dueTime, int period) { throw null; }
public bool Change(long dueTime, long period) { throw null; }
public bool Change(System.TimeSpan dueTime, System.TimeSpan period) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool Change(uint dueTime, uint period) { throw null; }
public void Dispose() { }
public bool Dispose(System.Threading.WaitHandle notifyObject) { throw null; }
public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
}
public delegate void TimerCallback(object? state);
public abstract partial class WaitHandle : System.MarshalByRefObject, System.IDisposable
{
protected static readonly System.IntPtr InvalidHandle;
public const int WaitTimeout = 258;
protected WaitHandle() { }
[System.ObsoleteAttribute("WaitHandle.Handle has been deprecated. Use the SafeWaitHandle property instead.")]
public virtual System.IntPtr Handle { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public Microsoft.Win32.SafeHandles.SafeWaitHandle SafeWaitHandle { get { throw null; } set { } }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool explicitDisposing) { }
public static bool SignalAndWait(System.Threading.WaitHandle toSignal, System.Threading.WaitHandle toWaitOn) { throw null; }
public static bool SignalAndWait(System.Threading.WaitHandle toSignal, System.Threading.WaitHandle toWaitOn, int millisecondsTimeout, bool exitContext) { throw null; }
public static bool SignalAndWait(System.Threading.WaitHandle toSignal, System.Threading.WaitHandle toWaitOn, System.TimeSpan timeout, bool exitContext) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles, System.TimeSpan timeout) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles, System.TimeSpan timeout, bool exitContext) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles, System.TimeSpan timeout) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles, System.TimeSpan timeout, bool exitContext) { throw null; }
public virtual bool WaitOne() { throw null; }
public virtual bool WaitOne(int millisecondsTimeout) { throw null; }
public virtual bool WaitOne(int millisecondsTimeout, bool exitContext) { throw null; }
public virtual bool WaitOne(System.TimeSpan timeout) { throw null; }
public virtual bool WaitOne(System.TimeSpan timeout, bool exitContext) { throw null; }
}
public static partial class WaitHandleExtensions
{
public static Microsoft.Win32.SafeHandles.SafeWaitHandle GetSafeWaitHandle(this System.Threading.WaitHandle waitHandle) { throw null; }
public static void SetSafeWaitHandle(this System.Threading.WaitHandle waitHandle, Microsoft.Win32.SafeHandles.SafeWaitHandle? value) { }
}
}
namespace System.Threading.Tasks
{
public partial class ConcurrentExclusiveSchedulerPair
{
public ConcurrentExclusiveSchedulerPair() { }
public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler) { }
public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler, int maxConcurrencyLevel) { }
public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask) { }
public System.Threading.Tasks.Task Completion { get { throw null; } }
public System.Threading.Tasks.TaskScheduler ConcurrentScheduler { get { throw null; } }
public System.Threading.Tasks.TaskScheduler ExclusiveScheduler { get { throw null; } }
public void Complete() { }
}
public partial class Task : System.IAsyncResult, System.IDisposable
{
public Task(System.Action action) { }
public Task(System.Action action, System.Threading.CancellationToken cancellationToken) { }
public Task(System.Action action, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public Task(System.Action action, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public Task(System.Action<object?> action, object? state) { }
public Task(System.Action<object?> action, object? state, System.Threading.CancellationToken cancellationToken) { }
public Task(System.Action<object?> action, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public Task(System.Action<object?> action, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public object? AsyncState { get { throw null; } }
public static System.Threading.Tasks.Task CompletedTask { get { throw null; } }
public System.Threading.Tasks.TaskCreationOptions CreationOptions { get { throw null; } }
public static int? CurrentId { get { throw null; } }
public System.AggregateException? Exception { get { throw null; } }
public static System.Threading.Tasks.TaskFactory Factory { get { throw null; } }
public int Id { get { throw null; } }
public bool IsCanceled { get { throw null; } }
public bool IsCompleted { get { throw null; } }
public bool IsCompletedSuccessfully { get { throw null; } }
public bool IsFaulted { get { throw null; } }
public System.Threading.Tasks.TaskStatus Status { get { throw null; } }
System.Threading.WaitHandle System.IAsyncResult.AsyncWaitHandle { get { throw null; } }
bool System.IAsyncResult.CompletedSynchronously { get { throw null; } }
public System.Runtime.CompilerServices.ConfiguredTaskAwaitable ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public static System.Threading.Tasks.Task Delay(int millisecondsDelay) { throw null; }
public static System.Threading.Tasks.Task Delay(int millisecondsDelay, System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task Delay(System.TimeSpan delay) { throw null; }
public static System.Threading.Tasks.Task Delay(System.TimeSpan delay, System.Threading.CancellationToken cancellationToken) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public static System.Threading.Tasks.Task FromCanceled(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task<TResult> FromCanceled<TResult>(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task FromException(System.Exception exception) { throw null; }
public static System.Threading.Tasks.Task<TResult> FromException<TResult>(System.Exception exception) { throw null; }
public static System.Threading.Tasks.Task<TResult> FromResult<TResult>(TResult result) { throw null; }
public System.Runtime.CompilerServices.TaskAwaiter GetAwaiter() { throw null; }
public static System.Threading.Tasks.Task Run(System.Action action) { throw null; }
public static System.Threading.Tasks.Task Run(System.Action action, System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task Run(System.Func<System.Threading.Tasks.Task?> function) { throw null; }
public static System.Threading.Tasks.Task Run(System.Func<System.Threading.Tasks.Task?> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public void RunSynchronously() { }
public void RunSynchronously(System.Threading.Tasks.TaskScheduler scheduler) { }
public static System.Threading.Tasks.Task<TResult> Run<TResult>(System.Func<System.Threading.Tasks.Task<TResult>?> function) { throw null; }
public static System.Threading.Tasks.Task<TResult> Run<TResult>(System.Func<System.Threading.Tasks.Task<TResult>?> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task<TResult> Run<TResult>(System.Func<TResult> function) { throw null; }
public static System.Threading.Tasks.Task<TResult> Run<TResult>(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public void Start() { }
public void Start(System.Threading.Tasks.TaskScheduler scheduler) { }
public void Wait() { }
public bool Wait(int millisecondsTimeout) { throw null; }
public bool Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; }
public void Wait(System.Threading.CancellationToken cancellationToken) { }
public bool Wait(System.TimeSpan timeout) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static void WaitAll(params System.Threading.Tasks.Task[] tasks) { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static bool WaitAll(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static bool WaitAll(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static void WaitAll(System.Threading.Tasks.Task[] tasks, System.Threading.CancellationToken cancellationToken) { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static bool WaitAll(System.Threading.Tasks.Task[] tasks, System.TimeSpan timeout) { throw null; }
public static int WaitAny(params System.Threading.Tasks.Task[] tasks) { throw null; }
public static int WaitAny(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout) { throw null; }
public static int WaitAny(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; }
public static int WaitAny(System.Threading.Tasks.Task[] tasks, System.Threading.CancellationToken cancellationToken) { throw null; }
public static int WaitAny(System.Threading.Tasks.Task[] tasks, System.TimeSpan timeout) { throw null; }
public System.Threading.Tasks.Task WaitAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task WaitAsync(System.TimeSpan timeout) { throw null; }
public System.Threading.Tasks.Task WaitAsync(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task WhenAll(System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task> tasks) { throw null; }
public static System.Threading.Tasks.Task WhenAll(params System.Threading.Tasks.Task[] tasks) { throw null; }
public static System.Threading.Tasks.Task<TResult[]> WhenAll<TResult>(System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task<TResult>> tasks) { throw null; }
public static System.Threading.Tasks.Task<TResult[]> WhenAll<TResult>(params System.Threading.Tasks.Task<TResult>[] tasks) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task> WhenAny(System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task> tasks) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task> WhenAny(System.Threading.Tasks.Task task1, System.Threading.Tasks.Task task2) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task> WhenAny(params System.Threading.Tasks.Task[] tasks) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> WhenAny<TResult>(System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task<TResult>> tasks) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> WhenAny<TResult>(System.Threading.Tasks.Task<TResult> task1, System.Threading.Tasks.Task<TResult> task2) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> WhenAny<TResult>(params System.Threading.Tasks.Task<TResult>[] tasks) { throw null; }
public static System.Runtime.CompilerServices.YieldAwaitable Yield() { throw null; }
}
public static partial class TaskAsyncEnumerableExtensions
{
public static System.Runtime.CompilerServices.ConfiguredAsyncDisposable ConfigureAwait(this System.IAsyncDisposable source, bool continueOnCapturedContext) { throw null; }
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, bool continueOnCapturedContext) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.Collections.Generic.IEnumerable<T> ToBlockingEnumerable<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class TaskCanceledException : System.OperationCanceledException
{
public TaskCanceledException() { }
protected TaskCanceledException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TaskCanceledException(string? message) { }
public TaskCanceledException(string? message, System.Exception? innerException) { }
public TaskCanceledException(string? message, System.Exception? innerException, System.Threading.CancellationToken token) { }
public TaskCanceledException(System.Threading.Tasks.Task? task) { }
public System.Threading.Tasks.Task? Task { get { throw null; } }
}
public partial class TaskCompletionSource
{
public TaskCompletionSource() { }
public TaskCompletionSource(object? state) { }
public TaskCompletionSource(object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public TaskCompletionSource(System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public System.Threading.Tasks.Task Task { get { throw null; } }
public void SetCanceled() { }
public void SetCanceled(System.Threading.CancellationToken cancellationToken) { }
public void SetException(System.Collections.Generic.IEnumerable<System.Exception> exceptions) { }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public bool TrySetCanceled() { throw null; }
public bool TrySetCanceled(System.Threading.CancellationToken cancellationToken) { throw null; }
public bool TrySetException(System.Collections.Generic.IEnumerable<System.Exception> exceptions) { throw null; }
public bool TrySetException(System.Exception exception) { throw null; }
public bool TrySetResult() { throw null; }
}
public partial class TaskCompletionSource<TResult>
{
public TaskCompletionSource() { }
public TaskCompletionSource(object? state) { }
public TaskCompletionSource(object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public TaskCompletionSource(System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public System.Threading.Tasks.Task<TResult> Task { get { throw null; } }
public void SetCanceled() { }
public void SetCanceled(System.Threading.CancellationToken cancellationToken) { }
public void SetException(System.Collections.Generic.IEnumerable<System.Exception> exceptions) { }
public void SetException(System.Exception exception) { }
public void SetResult(TResult result) { }
public bool TrySetCanceled() { throw null; }
public bool TrySetCanceled(System.Threading.CancellationToken cancellationToken) { throw null; }
public bool TrySetException(System.Collections.Generic.IEnumerable<System.Exception> exceptions) { throw null; }
public bool TrySetException(System.Exception exception) { throw null; }
public bool TrySetResult(TResult result) { throw null; }
}
[System.FlagsAttribute]
public enum TaskContinuationOptions
{
None = 0,
PreferFairness = 1,
LongRunning = 2,
AttachedToParent = 4,
DenyChildAttach = 8,
HideScheduler = 16,
LazyCancellation = 32,
RunContinuationsAsynchronously = 64,
NotOnRanToCompletion = 65536,
NotOnFaulted = 131072,
OnlyOnCanceled = 196608,
NotOnCanceled = 262144,
OnlyOnFaulted = 327680,
OnlyOnRanToCompletion = 393216,
ExecuteSynchronously = 524288,
}
[System.FlagsAttribute]
public enum TaskCreationOptions
{
None = 0,
PreferFairness = 1,
LongRunning = 2,
AttachedToParent = 4,
DenyChildAttach = 8,
HideScheduler = 16,
RunContinuationsAsynchronously = 64,
}
public static partial class TaskExtensions
{
public static System.Threading.Tasks.Task Unwrap(this System.Threading.Tasks.Task<System.Threading.Tasks.Task> task) { throw null; }
public static System.Threading.Tasks.Task<TResult> Unwrap<TResult>(this System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> task) { throw null; }
}
public partial class TaskFactory
{
public TaskFactory() { }
public TaskFactory(System.Threading.CancellationToken cancellationToken) { }
public TaskFactory(System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler? scheduler) { }
public TaskFactory(System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { }
public TaskFactory(System.Threading.Tasks.TaskScheduler? scheduler) { }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
public System.Threading.Tasks.TaskContinuationOptions ContinuationOptions { get { throw null; } }
public System.Threading.Tasks.TaskCreationOptions CreationOptions { get { throw null; } }
public System.Threading.Tasks.TaskScheduler? Scheduler { get { throw null; } }
public System.Threading.Tasks.Task ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task[]> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task[]> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task[]> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task[]> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>[]> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>[]> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>[]> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>[]> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, object? state) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.IAsyncResult asyncResult, System.Action<System.IAsyncResult> endMethod) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.IAsyncResult asyncResult, System.Action<System.IAsyncResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.IAsyncResult asyncResult, System.Action<System.IAsyncResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, object? state) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TResult>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TResult>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1, TArg2>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, object? state) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1, TArg2>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TResult>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TResult>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1, TArg2, TArg3>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1, TArg2, TArg3>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TArg3, TResult>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TArg3, TResult>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action action) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action action, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action action, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action action, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action<object?> action, object? state) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action<object?> action, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action<object?> action, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action<object?> action, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<object?, TResult> function, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<object?, TResult> function, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<TResult> function) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<TResult> function, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
}
public partial class TaskFactory<TResult>
{
public TaskFactory() { }
public TaskFactory(System.Threading.CancellationToken cancellationToken) { }
public TaskFactory(System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler? scheduler) { }
public TaskFactory(System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { }
public TaskFactory(System.Threading.Tasks.TaskScheduler? scheduler) { }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
public System.Threading.Tasks.TaskContinuationOptions ContinuationOptions { get { throw null; } }
public System.Threading.Tasks.TaskCreationOptions CreationOptions { get { throw null; } }
public System.Threading.Tasks.TaskScheduler? Scheduler { get { throw null; } }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TArg3>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TArg3>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<object?, TResult> function, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<object?, TResult> function, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<TResult> function) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<TResult> function, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
}
public abstract partial class TaskScheduler
{
protected TaskScheduler() { }
public static System.Threading.Tasks.TaskScheduler Current { get { throw null; } }
public static System.Threading.Tasks.TaskScheduler Default { get { throw null; } }
public int Id { get { throw null; } }
public virtual int MaximumConcurrencyLevel { get { throw null; } }
public static event System.EventHandler<System.Threading.Tasks.UnobservedTaskExceptionEventArgs>? UnobservedTaskException { add { } remove { } }
public static System.Threading.Tasks.TaskScheduler FromCurrentSynchronizationContext() { throw null; }
protected abstract System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task>? GetScheduledTasks();
protected internal abstract void QueueTask(System.Threading.Tasks.Task task);
protected internal virtual bool TryDequeue(System.Threading.Tasks.Task task) { throw null; }
protected bool TryExecuteTask(System.Threading.Tasks.Task task) { throw null; }
protected abstract bool TryExecuteTaskInline(System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued);
}
public partial class TaskSchedulerException : System.Exception
{
public TaskSchedulerException() { }
public TaskSchedulerException(System.Exception? innerException) { }
protected TaskSchedulerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TaskSchedulerException(string? message) { }
public TaskSchedulerException(string? message, System.Exception? innerException) { }
}
public enum TaskStatus
{
Created = 0,
WaitingForActivation = 1,
WaitingToRun = 2,
Running = 3,
WaitingForChildrenToComplete = 4,
RanToCompletion = 5,
Canceled = 6,
Faulted = 7,
}
public partial class Task<TResult> : System.Threading.Tasks.Task
{
public Task(System.Func<object?, TResult> function, object? state) : base (default(System.Action)) { }
public Task(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken) : base (default(System.Action)) { }
public Task(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions) : base (default(System.Action)) { }
public Task(System.Func<object?, TResult> function, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) : base (default(System.Action)) { }
public Task(System.Func<TResult> function) : base (default(System.Action)) { }
public Task(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken) : base (default(System.Action)) { }
public Task(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions) : base (default(System.Action)) { }
public Task(System.Func<TResult> function, System.Threading.Tasks.TaskCreationOptions creationOptions) : base (default(System.Action)) { }
public static new System.Threading.Tasks.TaskFactory<TResult> Factory { get { throw null; } }
public TResult Result { get { throw null; } }
public new System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult> ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public new System.Runtime.CompilerServices.TaskAwaiter<TResult> GetAwaiter() { throw null; }
public new System.Threading.Tasks.Task<TResult> WaitAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public new System.Threading.Tasks.Task<TResult> WaitAsync(System.TimeSpan timeout) { throw null; }
public new System.Threading.Tasks.Task<TResult> WaitAsync(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class UnobservedTaskExceptionEventArgs : System.EventArgs
{
public UnobservedTaskExceptionEventArgs(System.AggregateException exception) { }
public System.AggregateException Exception { get { throw null; } }
public bool Observed { get { throw null; } }
public void SetObserved() { }
}
[System.Runtime.CompilerServices.AsyncMethodBuilderAttribute(typeof(System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder))]
public readonly partial struct ValueTask : System.IEquatable<System.Threading.Tasks.ValueTask>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ValueTask(System.Threading.Tasks.Sources.IValueTaskSource source, short token) { throw null; }
public ValueTask(System.Threading.Tasks.Task task) { throw null; }
public static System.Threading.Tasks.ValueTask CompletedTask { get { throw null; } }
public bool IsCanceled { get { throw null; } }
public bool IsCompleted { get { throw null; } }
public bool IsCompletedSuccessfully { get { throw null; } }
public bool IsFaulted { get { throw null; } }
public System.Threading.Tasks.Task AsTask() { throw null; }
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Threading.Tasks.ValueTask other) { throw null; }
public static System.Threading.Tasks.ValueTask FromCanceled(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.ValueTask<TResult> FromCanceled<TResult>(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.ValueTask FromException(System.Exception exception) { throw null; }
public static System.Threading.Tasks.ValueTask<TResult> FromException<TResult>(System.Exception exception) { throw null; }
public static System.Threading.Tasks.ValueTask<TResult> FromResult<TResult>(TResult result) { throw null; }
public System.Runtime.CompilerServices.ValueTaskAwaiter GetAwaiter() { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Threading.Tasks.ValueTask left, System.Threading.Tasks.ValueTask right) { throw null; }
public static bool operator !=(System.Threading.Tasks.ValueTask left, System.Threading.Tasks.ValueTask right) { throw null; }
public System.Threading.Tasks.ValueTask Preserve() { throw null; }
}
[System.Runtime.CompilerServices.AsyncMethodBuilderAttribute(typeof(System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder<>))]
public readonly partial struct ValueTask<TResult> : System.IEquatable<System.Threading.Tasks.ValueTask<TResult>>
{
private readonly TResult _result;
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ValueTask(System.Threading.Tasks.Sources.IValueTaskSource<TResult> source, short token) { throw null; }
public ValueTask(System.Threading.Tasks.Task<TResult> task) { throw null; }
public ValueTask(TResult result) { throw null; }
public bool IsCanceled { get { throw null; } }
public bool IsCompleted { get { throw null; } }
public bool IsCompletedSuccessfully { get { throw null; } }
public bool IsFaulted { get { throw null; } }
public TResult Result { get { throw null; } }
public System.Threading.Tasks.Task<TResult> AsTask() { throw null; }
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult> ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Threading.Tasks.ValueTask<TResult> other) { throw null; }
public System.Runtime.CompilerServices.ValueTaskAwaiter<TResult> GetAwaiter() { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Threading.Tasks.ValueTask<TResult> left, System.Threading.Tasks.ValueTask<TResult> right) { throw null; }
public static bool operator !=(System.Threading.Tasks.ValueTask<TResult> left, System.Threading.Tasks.ValueTask<TResult> right) { throw null; }
public System.Threading.Tasks.ValueTask<TResult> Preserve() { throw null; }
public override string? ToString() { throw null; }
}
}
namespace System.Threading.Tasks.Sources
{
public partial interface IValueTaskSource
{
void GetResult(short token);
System.Threading.Tasks.Sources.ValueTaskSourceStatus GetStatus(short token);
void OnCompleted(System.Action<object?> continuation, object? state, short token, System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags flags);
}
public partial interface IValueTaskSource<out TResult>
{
TResult GetResult(short token);
System.Threading.Tasks.Sources.ValueTaskSourceStatus GetStatus(short token);
void OnCompleted(System.Action<object?> continuation, object? state, short token, System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags flags);
}
public partial struct ManualResetValueTaskSourceCore<TResult>
{
private TResult _result;
private object _dummy;
private int _dummyPrimitive;
public bool RunContinuationsAsynchronously { readonly get { throw null; } set { } }
public short Version { get { throw null; } }
public TResult GetResult(short token) { throw null; }
public System.Threading.Tasks.Sources.ValueTaskSourceStatus GetStatus(short token) { throw null; }
public void OnCompleted(System.Action<object?> continuation, object? state, short token, System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags flags) { }
public void Reset() { }
public void SetException(System.Exception error) { }
public void SetResult(TResult result) { }
}
[System.FlagsAttribute]
public enum ValueTaskSourceOnCompletedFlags
{
None = 0,
UseSchedulingContext = 1,
FlowExecutionContext = 2,
}
public enum ValueTaskSourceStatus
{
Pending = 0,
Succeeded = 1,
Faulted = 2,
Canceled = 3,
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ------------------------------------------------------------------------------
// Changes to this file must follow the https://aka.ms/api-review process.
// ------------------------------------------------------------------------------
namespace Microsoft.Win32.SafeHandles
{
public abstract partial class CriticalHandleMinusOneIsInvalid : System.Runtime.InteropServices.CriticalHandle
{
protected CriticalHandleMinusOneIsInvalid() : base (default(System.IntPtr)) { }
public override bool IsInvalid { get { throw null; } }
}
public abstract partial class CriticalHandleZeroOrMinusOneIsInvalid : System.Runtime.InteropServices.CriticalHandle
{
protected CriticalHandleZeroOrMinusOneIsInvalid() : base (default(System.IntPtr)) { }
public override bool IsInvalid { get { throw null; } }
}
public sealed partial class SafeFileHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
{
public SafeFileHandle() : base (default(bool)) { }
public SafeFileHandle(System.IntPtr preexistingHandle, bool ownsHandle) : base (default(bool)) { }
public override bool IsInvalid { get { throw null; } }
public bool IsAsync { get { throw null; } }
protected override bool ReleaseHandle() { throw null; }
}
public abstract partial class SafeHandleMinusOneIsInvalid : System.Runtime.InteropServices.SafeHandle
{
protected SafeHandleMinusOneIsInvalid(bool ownsHandle) : base (default(System.IntPtr), default(bool)) { }
public override bool IsInvalid { get { throw null; } }
}
public abstract partial class SafeHandleZeroOrMinusOneIsInvalid : System.Runtime.InteropServices.SafeHandle
{
protected SafeHandleZeroOrMinusOneIsInvalid(bool ownsHandle) : base (default(System.IntPtr), default(bool)) { }
public override bool IsInvalid { get { throw null; } }
}
public sealed partial class SafeWaitHandle : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
{
public SafeWaitHandle() : base (default(bool)) { }
public SafeWaitHandle(System.IntPtr existingHandle, bool ownsHandle) : base (default(bool)) { }
protected override bool ReleaseHandle() { throw null; }
}
}
namespace System
{
public partial class AccessViolationException : System.SystemException
{
public AccessViolationException() { }
protected AccessViolationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public AccessViolationException(string? message) { }
public AccessViolationException(string? message, System.Exception? innerException) { }
}
public delegate void Action();
public delegate void Action<in T>(T obj);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16);
public delegate void Action<in T1, in T2>(T1 arg1, T2 arg2);
public delegate void Action<in T1, in T2, in T3>(T1 arg1, T2 arg2, T3 arg3);
public delegate void Action<in T1, in T2, in T3, in T4>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
public delegate void Action<in T1, in T2, in T3, in T4, in T5>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
public delegate void Action<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9);
public static partial class Activator
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName, object?[]? activationAttributes) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] System.Type type) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, bool nonPublic) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, params object?[]? args) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, object?[]? args, object?[]? activationAttributes) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture) { throw null; }
public static object? CreateInstance([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public static System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, object?[]? activationAttributes) { throw null; }
public static T CreateInstance<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>() { throw null; }
}
public partial class AggregateException : System.Exception
{
public AggregateException() { }
public AggregateException(System.Collections.Generic.IEnumerable<System.Exception> innerExceptions) { }
public AggregateException(params System.Exception[] innerExceptions) { }
protected AggregateException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public AggregateException(string? message) { }
public AggregateException(string? message, System.Collections.Generic.IEnumerable<System.Exception> innerExceptions) { }
public AggregateException(string? message, System.Exception innerException) { }
public AggregateException(string? message, params System.Exception[] innerExceptions) { }
public System.Collections.ObjectModel.ReadOnlyCollection<System.Exception> InnerExceptions { get { throw null; } }
public override string Message { get { throw null; } }
public System.AggregateException Flatten() { throw null; }
public override System.Exception GetBaseException() { throw null; }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public void Handle(System.Func<System.Exception, bool> predicate) { }
public override string ToString() { throw null; }
}
public static partial class AppContext
{
public static string BaseDirectory { get { throw null; } }
public static string? TargetFrameworkName { get { throw null; } }
public static object? GetData(string name) { throw null; }
public static void SetData(string name, object? data) { }
public static void SetSwitch(string switchName, bool isEnabled) { }
public static bool TryGetSwitch(string switchName, out bool isEnabled) { throw null; }
}
public sealed partial class AppDomain : System.MarshalByRefObject
{
internal AppDomain() { }
public string BaseDirectory { get { throw null; } }
public static System.AppDomain CurrentDomain { get { throw null; } }
public string? DynamicDirectory { get { throw null; } }
public string FriendlyName { get { throw null; } }
public int Id { get { throw null; } }
public bool IsFullyTrusted { get { throw null; } }
public bool IsHomogenous { get { throw null; } }
public static bool MonitoringIsEnabled { get { throw null; } set { } }
public long MonitoringSurvivedMemorySize { get { throw null; } }
public static long MonitoringSurvivedProcessMemorySize { get { throw null; } }
public long MonitoringTotalAllocatedMemorySize { get { throw null; } }
public System.TimeSpan MonitoringTotalProcessorTime { get { throw null; } }
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Security.PermissionSet PermissionSet { get { throw null; } }
public string? RelativeSearchPath { get { throw null; } }
public System.AppDomainSetup SetupInformation { get { throw null; } }
public bool ShadowCopyFiles { get { throw null; } }
public event System.AssemblyLoadEventHandler? AssemblyLoad { add { } remove { } }
public event System.ResolveEventHandler? AssemblyResolve { add { } remove { } }
public event System.EventHandler? DomainUnload { add { } remove { } }
public event System.EventHandler<System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs>? FirstChanceException { add { } remove { } }
public event System.EventHandler? ProcessExit { add { } remove { } }
public event System.ResolveEventHandler? ReflectionOnlyAssemblyResolve { add { } remove { } }
public event System.ResolveEventHandler? ResourceResolve { add { } remove { } }
public event System.ResolveEventHandler? TypeResolve { add { } remove { } }
public event System.UnhandledExceptionEventHandler? UnhandledException { add { } remove { } }
[System.ObsoleteAttribute("AppDomain.AppendPrivatePath has been deprecated and is not supported.")]
public void AppendPrivatePath(string? path) { }
public string ApplyPolicy(string assemblyName) { throw null; }
[System.ObsoleteAttribute("AppDomain.ClearPrivatePath has been deprecated and is not supported.")]
public void ClearPrivatePath() { }
[System.ObsoleteAttribute("AppDomain.ClearShadowCopyPath has been deprecated and is not supported.")]
public void ClearShadowCopyPath() { }
[System.ObsoleteAttribute("Creating and unloading AppDomains is not supported and throws an exception.", DiagnosticId = "SYSLIB0024", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.AppDomain CreateDomain(string friendlyName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstance(string assemblyName, string typeName, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceAndUnwrap(string assemblyName, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceAndUnwrap(string assemblyName, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceAndUnwrap(string assemblyName, string typeName, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public System.Runtime.Remoting.ObjectHandle? CreateInstanceFrom(string assemblyFile, string typeName, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceFromAndUnwrap(string assemblyFile, string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceFromAndUnwrap(string assemblyFile, string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object?[]? args, System.Globalization.CultureInfo? culture, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Type and its constructor could be removed")]
public object? CreateInstanceFromAndUnwrap(string assemblyFile, string typeName, object?[]? activationAttributes) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public int ExecuteAssembly(string assemblyFile) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public int ExecuteAssembly(string assemblyFile, string?[]? args) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public int ExecuteAssembly(string assemblyFile, string?[]? args, byte[]? hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm) { throw null; }
public int ExecuteAssemblyByName(System.Reflection.AssemblyName assemblyName, params string?[]? args) { throw null; }
public int ExecuteAssemblyByName(string assemblyName) { throw null; }
public int ExecuteAssemblyByName(string assemblyName, params string?[]? args) { throw null; }
public System.Reflection.Assembly[] GetAssemblies() { throw null; }
[System.ObsoleteAttribute("AppDomain.GetCurrentThreadId has been deprecated because it does not provide a stable Id when managed threads are running on fibers (aka lightweight threads). To get a stable identifier for a managed thread, use the ManagedThreadId property on Thread instead.")]
public static int GetCurrentThreadId() { throw null; }
public object? GetData(string name) { throw null; }
public bool? IsCompatibilitySwitchSet(string value) { throw null; }
public bool IsDefaultAppDomain() { throw null; }
public bool IsFinalizingForUnload() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public System.Reflection.Assembly Load(byte[] rawAssembly) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public System.Reflection.Assembly Load(byte[] rawAssembly, byte[]? rawSymbolStore) { throw null; }
public System.Reflection.Assembly Load(System.Reflection.AssemblyName assemblyRef) { throw null; }
public System.Reflection.Assembly Load(string assemblyString) { throw null; }
public System.Reflection.Assembly[] ReflectionOnlyGetAssemblies() { throw null; }
[System.ObsoleteAttribute("AppDomain.SetCachePath has been deprecated and is not supported.")]
public void SetCachePath(string? path) { }
public void SetData(string name, object? data) { }
[System.ObsoleteAttribute("AppDomain.SetDynamicBase has been deprecated and is not supported.")]
public void SetDynamicBase(string? path) { }
public void SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy policy) { }
[System.ObsoleteAttribute("AppDomain.SetShadowCopyFiles has been deprecated and is not supported.")]
public void SetShadowCopyFiles() { }
[System.ObsoleteAttribute("AppDomain.SetShadowCopyPath has been deprecated and is not supported.")]
public void SetShadowCopyPath(string? path) { }
public void SetThreadPrincipal(System.Security.Principal.IPrincipal principal) { }
public override string ToString() { throw null; }
[System.ObsoleteAttribute("Creating and unloading AppDomains is not supported and throws an exception.", DiagnosticId = "SYSLIB0024", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void Unload(System.AppDomain domain) { }
}
public sealed partial class AppDomainSetup
{
internal AppDomainSetup() { }
public string? ApplicationBase { get { throw null; } }
public string? TargetFrameworkName { get { throw null; } }
}
public partial class AppDomainUnloadedException : System.SystemException
{
public AppDomainUnloadedException() { }
protected AppDomainUnloadedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public AppDomainUnloadedException(string? message) { }
public AppDomainUnloadedException(string? message, System.Exception? innerException) { }
}
public partial class ApplicationException : System.Exception
{
public ApplicationException() { }
protected ApplicationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ApplicationException(string? message) { }
public ApplicationException(string? message, System.Exception? innerException) { }
}
public sealed partial class ApplicationId
{
public ApplicationId(byte[] publicKeyToken, string name, System.Version version, string? processorArchitecture, string? culture) { }
public string? Culture { get { throw null; } }
public string Name { get { throw null; } }
public string? ProcessorArchitecture { get { throw null; } }
public byte[] PublicKeyToken { get { throw null; } }
public System.Version Version { get { throw null; } }
public System.ApplicationId Copy() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public ref partial struct ArgIterator
{
private int _dummyPrimitive;
public ArgIterator(System.RuntimeArgumentHandle arglist) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe ArgIterator(System.RuntimeArgumentHandle arglist, void* ptr) { throw null; }
public void End() { }
public override bool Equals(object? o) { throw null; }
public override int GetHashCode() { throw null; }
[System.CLSCompliantAttribute(false)]
public System.TypedReference GetNextArg() { throw null; }
[System.CLSCompliantAttribute(false)]
public System.TypedReference GetNextArg(System.RuntimeTypeHandle rth) { throw null; }
public System.RuntimeTypeHandle GetNextArgType() { throw null; }
public int GetRemainingCount() { throw null; }
}
public partial class ArgumentException : System.SystemException
{
public ArgumentException() { }
protected ArgumentException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArgumentException(string? message) { }
public ArgumentException(string? message, System.Exception? innerException) { }
public ArgumentException(string? message, string? paramName) { }
public ArgumentException(string? message, string? paramName, System.Exception? innerException) { }
public override string Message { get { throw null; } }
public virtual string? ParamName { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static void ThrowIfNullOrEmpty([System.Diagnostics.CodeAnalysis.NotNullAttribute] string? argument, [System.Runtime.CompilerServices.CallerArgumentExpression("argument")] string? paramName = null) { throw null; }
}
public partial class ArgumentNullException : System.ArgumentException
{
public ArgumentNullException() { }
protected ArgumentNullException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArgumentNullException(string? paramName) { }
public ArgumentNullException(string? message, System.Exception? innerException) { }
public ArgumentNullException(string? paramName, string? message) { }
public static void ThrowIfNull([System.Diagnostics.CodeAnalysis.NotNullAttribute] object? argument, [System.Runtime.CompilerServices.CallerArgumentExpressionAttribute("argument")] string? paramName = null) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void ThrowIfNull([System.Diagnostics.CodeAnalysis.NotNullAttribute] void* argument, [System.Runtime.CompilerServices.CallerArgumentExpressionAttribute("argument")] string? paramName = null) { throw null; }
}
public partial class ArgumentOutOfRangeException : System.ArgumentException
{
public ArgumentOutOfRangeException() { }
protected ArgumentOutOfRangeException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArgumentOutOfRangeException(string? paramName) { }
public ArgumentOutOfRangeException(string? message, System.Exception? innerException) { }
public ArgumentOutOfRangeException(string? paramName, object? actualValue, string? message) { }
public ArgumentOutOfRangeException(string? paramName, string? message) { }
public virtual object? ActualValue { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class ArithmeticException : System.SystemException
{
public ArithmeticException() { }
protected ArithmeticException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArithmeticException(string? message) { }
public ArithmeticException(string? message, System.Exception? innerException) { }
}
public abstract partial class Array : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.ICloneable
{
internal Array() { }
public bool IsFixedSize { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public bool IsSynchronized { get { throw null; } }
public int Length { get { throw null; } }
public long LongLength { get { throw null; } }
public static int MaxLength { get { throw null; } }
public int Rank { get { throw null; } }
public object SyncRoot { get { throw null; } }
int System.Collections.ICollection.Count { get { throw null; } }
object? System.Collections.IList.this[int index] { get { throw null; } set { } }
public static System.Collections.ObjectModel.ReadOnlyCollection<T> AsReadOnly<T>(T[] array) { throw null; }
public static int BinarySearch(System.Array array, int index, int length, object? value) { throw null; }
public static int BinarySearch(System.Array array, int index, int length, object? value, System.Collections.IComparer? comparer) { throw null; }
public static int BinarySearch(System.Array array, object? value) { throw null; }
public static int BinarySearch(System.Array array, object? value, System.Collections.IComparer? comparer) { throw null; }
public static int BinarySearch<T>(T[] array, int index, int length, T value) { throw null; }
public static int BinarySearch<T>(T[] array, int index, int length, T value, System.Collections.Generic.IComparer<T>? comparer) { throw null; }
public static int BinarySearch<T>(T[] array, T value) { throw null; }
public static int BinarySearch<T>(T[] array, T value, System.Collections.Generic.IComparer<T>? comparer) { throw null; }
public static void Clear(System.Array array) { }
public static void Clear(System.Array array, int index, int length) { }
public object Clone() { throw null; }
public static void ConstrainedCopy(System.Array sourceArray, int sourceIndex, System.Array destinationArray, int destinationIndex, int length) { }
public static TOutput[] ConvertAll<TInput, TOutput>(TInput[] array, System.Converter<TInput, TOutput> converter) { throw null; }
public static void Copy(System.Array sourceArray, System.Array destinationArray, int length) { }
public static void Copy(System.Array sourceArray, System.Array destinationArray, long length) { }
public static void Copy(System.Array sourceArray, int sourceIndex, System.Array destinationArray, int destinationIndex, int length) { }
public static void Copy(System.Array sourceArray, long sourceIndex, System.Array destinationArray, long destinationIndex, long length) { }
public void CopyTo(System.Array array, int index) { }
public void CopyTo(System.Array array, long index) { }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public static System.Array CreateInstance(System.Type elementType, int length) { throw null; }
public static System.Array CreateInstance(System.Type elementType, int length1, int length2) { throw null; }
public static System.Array CreateInstance(System.Type elementType, int length1, int length2, int length3) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public static System.Array CreateInstance(System.Type elementType, params int[] lengths) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public static System.Array CreateInstance(System.Type elementType, int[] lengths, int[] lowerBounds) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public static System.Array CreateInstance(System.Type elementType, params long[] lengths) { throw null; }
public static T[] Empty<T>() { throw null; }
public static bool Exists<T>(T[] array, System.Predicate<T> match) { throw null; }
public static void Fill<T>(T[] array, T value) { }
public static void Fill<T>(T[] array, T value, int startIndex, int count) { }
public static T[] FindAll<T>(T[] array, System.Predicate<T> match) { throw null; }
public static int FindIndex<T>(T[] array, int startIndex, int count, System.Predicate<T> match) { throw null; }
public static int FindIndex<T>(T[] array, int startIndex, System.Predicate<T> match) { throw null; }
public static int FindIndex<T>(T[] array, System.Predicate<T> match) { throw null; }
public static int FindLastIndex<T>(T[] array, int startIndex, int count, System.Predicate<T> match) { throw null; }
public static int FindLastIndex<T>(T[] array, int startIndex, System.Predicate<T> match) { throw null; }
public static int FindLastIndex<T>(T[] array, System.Predicate<T> match) { throw null; }
public static T? FindLast<T>(T[] array, System.Predicate<T> match) { throw null; }
public static T? Find<T>(T[] array, System.Predicate<T> match) { throw null; }
public static void ForEach<T>(T[] array, System.Action<T> action) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
public int GetLength(int dimension) { throw null; }
public long GetLongLength(int dimension) { throw null; }
public int GetLowerBound(int dimension) { throw null; }
public int GetUpperBound(int dimension) { throw null; }
public object? GetValue(int index) { throw null; }
public object? GetValue(int index1, int index2) { throw null; }
public object? GetValue(int index1, int index2, int index3) { throw null; }
public object? GetValue(params int[] indices) { throw null; }
public object? GetValue(long index) { throw null; }
public object? GetValue(long index1, long index2) { throw null; }
public object? GetValue(long index1, long index2, long index3) { throw null; }
public object? GetValue(params long[] indices) { throw null; }
public static int IndexOf(System.Array array, object? value) { throw null; }
public static int IndexOf(System.Array array, object? value, int startIndex) { throw null; }
public static int IndexOf(System.Array array, object? value, int startIndex, int count) { throw null; }
public static int IndexOf<T>(T[] array, T value) { throw null; }
public static int IndexOf<T>(T[] array, T value, int startIndex) { throw null; }
public static int IndexOf<T>(T[] array, T value, int startIndex, int count) { throw null; }
public void Initialize() { }
public static int LastIndexOf(System.Array array, object? value) { throw null; }
public static int LastIndexOf(System.Array array, object? value, int startIndex) { throw null; }
public static int LastIndexOf(System.Array array, object? value, int startIndex, int count) { throw null; }
public static int LastIndexOf<T>(T[] array, T value) { throw null; }
public static int LastIndexOf<T>(T[] array, T value, int startIndex) { throw null; }
public static int LastIndexOf<T>(T[] array, T value, int startIndex, int count) { throw null; }
public static void Resize<T>([System.Diagnostics.CodeAnalysis.NotNullAttribute] ref T[]? array, int newSize) { throw null; }
public static void Reverse(System.Array array) { }
public static void Reverse(System.Array array, int index, int length) { }
public static void Reverse<T>(T[] array) { }
public static void Reverse<T>(T[] array, int index, int length) { }
public void SetValue(object? value, int index) { }
public void SetValue(object? value, int index1, int index2) { }
public void SetValue(object? value, int index1, int index2, int index3) { }
public void SetValue(object? value, params int[] indices) { }
public void SetValue(object? value, long index) { }
public void SetValue(object? value, long index1, long index2) { }
public void SetValue(object? value, long index1, long index2, long index3) { }
public void SetValue(object? value, params long[] indices) { }
public static void Sort(System.Array array) { }
public static void Sort(System.Array keys, System.Array? items) { }
public static void Sort(System.Array keys, System.Array? items, System.Collections.IComparer? comparer) { }
public static void Sort(System.Array keys, System.Array? items, int index, int length) { }
public static void Sort(System.Array keys, System.Array? items, int index, int length, System.Collections.IComparer? comparer) { }
public static void Sort(System.Array array, System.Collections.IComparer? comparer) { }
public static void Sort(System.Array array, int index, int length) { }
public static void Sort(System.Array array, int index, int length, System.Collections.IComparer? comparer) { }
public static void Sort<T>(T[] array) { }
public static void Sort<T>(T[] array, System.Collections.Generic.IComparer<T>? comparer) { }
public static void Sort<T>(T[] array, System.Comparison<T> comparison) { }
public static void Sort<T>(T[] array, int index, int length) { }
public static void Sort<T>(T[] array, int index, int length, System.Collections.Generic.IComparer<T>? comparer) { }
public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items) { }
public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items, System.Collections.Generic.IComparer<TKey>? comparer) { }
public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items, int index, int length) { }
public static void Sort<TKey, TValue>(TKey[] keys, TValue[]? items, int index, int length, System.Collections.Generic.IComparer<TKey>? comparer) { }
int System.Collections.IList.Add(object? value) { throw null; }
void System.Collections.IList.Clear() { }
bool System.Collections.IList.Contains(object? value) { throw null; }
int System.Collections.IList.IndexOf(object? value) { throw null; }
void System.Collections.IList.Insert(int index, object? value) { }
void System.Collections.IList.Remove(object? value) { }
void System.Collections.IList.RemoveAt(int index) { }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
public static bool TrueForAll<T>(T[] array, System.Predicate<T> match) { throw null; }
}
public readonly partial struct ArraySegment<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.IEnumerable
{
private readonly T[] _array;
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ArraySegment(T[] array) { throw null; }
public ArraySegment(T[] array, int offset, int count) { throw null; }
public T[]? Array { get { throw null; } }
public int Count { get { throw null; } }
public static System.ArraySegment<T> Empty { get { throw null; } }
public T this[int index] { get { throw null; } set { } }
public int Offset { get { throw null; } }
bool System.Collections.Generic.ICollection<T>.IsReadOnly { get { throw null; } }
T System.Collections.Generic.IList<T>.this[int index] { get { throw null; } set { } }
T System.Collections.Generic.IReadOnlyList<T>.this[int index] { get { throw null; } }
public void CopyTo(System.ArraySegment<T> destination) { }
public void CopyTo(T[] destination) { }
public void CopyTo(T[] destination, int destinationIndex) { }
public bool Equals(System.ArraySegment<T> obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public System.ArraySegment<T>.Enumerator GetEnumerator() { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.ArraySegment<T> a, System.ArraySegment<T> b) { throw null; }
public static implicit operator System.ArraySegment<T> (T[] array) { throw null; }
public static bool operator !=(System.ArraySegment<T> a, System.ArraySegment<T> b) { throw null; }
public System.ArraySegment<T> Slice(int index) { throw null; }
public System.ArraySegment<T> Slice(int index, int count) { throw null; }
void System.Collections.Generic.ICollection<T>.Add(T item) { }
void System.Collections.Generic.ICollection<T>.Clear() { }
bool System.Collections.Generic.ICollection<T>.Contains(T item) { throw null; }
bool System.Collections.Generic.ICollection<T>.Remove(T item) { throw null; }
System.Collections.Generic.IEnumerator<T> System.Collections.Generic.IEnumerable<T>.GetEnumerator() { throw null; }
int System.Collections.Generic.IList<T>.IndexOf(T item) { throw null; }
void System.Collections.Generic.IList<T>.Insert(int index, T item) { }
void System.Collections.Generic.IList<T>.RemoveAt(int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public T[] ToArray() { throw null; }
public partial struct Enumerator : System.Collections.Generic.IEnumerator<T>, System.Collections.IEnumerator, System.IDisposable
{
private readonly T[] _array;
private object _dummy;
private int _dummyPrimitive;
public T Current { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
public void Dispose() { }
public bool MoveNext() { throw null; }
void System.Collections.IEnumerator.Reset() { }
}
}
public partial class ArrayTypeMismatchException : System.SystemException
{
public ArrayTypeMismatchException() { }
protected ArrayTypeMismatchException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ArrayTypeMismatchException(string? message) { }
public ArrayTypeMismatchException(string? message, System.Exception? innerException) { }
}
public partial class AssemblyLoadEventArgs : System.EventArgs
{
public AssemblyLoadEventArgs(System.Reflection.Assembly loadedAssembly) { }
public System.Reflection.Assembly LoadedAssembly { get { throw null; } }
}
public delegate void AssemblyLoadEventHandler(object? sender, System.AssemblyLoadEventArgs args);
public delegate void AsyncCallback(System.IAsyncResult ar);
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=true, AllowMultiple=false)]
public abstract partial class Attribute
{
protected Attribute() { }
public virtual object TypeId { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.Assembly element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.Module element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.Module element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Assembly element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, System.Type attributeType) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.Module element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, bool inherit) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static System.Attribute[] GetCustomAttributes(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public override int GetHashCode() { throw null; }
public virtual bool IsDefaultAttribute() { throw null; }
public static bool IsDefined(System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static bool IsDefined(System.Reflection.Assembly element, System.Type attributeType, bool inherit) { throw null; }
public static bool IsDefined(System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static bool IsDefined(System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static bool IsDefined(System.Reflection.Module element, System.Type attributeType) { throw null; }
public static bool IsDefined(System.Reflection.Module element, System.Type attributeType, bool inherit) { throw null; }
public static bool IsDefined(System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static bool IsDefined(System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public virtual bool Match(object? obj) { throw null; }
}
[System.FlagsAttribute]
public enum AttributeTargets
{
Assembly = 1,
Module = 2,
Class = 4,
Struct = 8,
Enum = 16,
Constructor = 32,
Method = 64,
Property = 128,
Field = 256,
Event = 512,
Interface = 1024,
Parameter = 2048,
Delegate = 4096,
ReturnValue = 8192,
GenericParameter = 16384,
All = 32767,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class, Inherited=true)]
public sealed partial class AttributeUsageAttribute : System.Attribute
{
public AttributeUsageAttribute(System.AttributeTargets validOn) { }
public bool AllowMultiple { get { throw null; } set { } }
public bool Inherited { get { throw null; } set { } }
public System.AttributeTargets ValidOn { get { throw null; } }
}
public partial class BadImageFormatException : System.SystemException
{
public BadImageFormatException() { }
protected BadImageFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public BadImageFormatException(string? message) { }
public BadImageFormatException(string? message, System.Exception? inner) { }
public BadImageFormatException(string? message, string? fileName) { }
public BadImageFormatException(string? message, string? fileName, System.Exception? inner) { }
public string? FileName { get { throw null; } }
public string? FusionLog { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum Base64FormattingOptions
{
None = 0,
InsertLineBreaks = 1,
}
public static partial class BitConverter
{
public static readonly bool IsLittleEndian;
public static long DoubleToInt64Bits(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong DoubleToUInt64Bits(double value) { throw null; }
public static byte[] GetBytes(bool value) { throw null; }
public static byte[] GetBytes(char value) { throw null; }
public static byte[] GetBytes(double value) { throw null; }
public static byte[] GetBytes(System.Half value) { throw null; }
public static byte[] GetBytes(short value) { throw null; }
public static byte[] GetBytes(int value) { throw null; }
public static byte[] GetBytes(long value) { throw null; }
public static byte[] GetBytes(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte[] GetBytes(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte[] GetBytes(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte[] GetBytes(ulong value) { throw null; }
public static short HalfToInt16Bits(System.Half value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort HalfToUInt16Bits(System.Half value) { throw null; }
public static System.Half Int16BitsToHalf(short value) { throw null; }
public static float Int32BitsToSingle(int value) { throw null; }
public static double Int64BitsToDouble(long value) { throw null; }
public static int SingleToInt32Bits(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint SingleToUInt32Bits(float value) { throw null; }
public static bool ToBoolean(byte[] value, int startIndex) { throw null; }
public static bool ToBoolean(System.ReadOnlySpan<byte> value) { throw null; }
public static char ToChar(byte[] value, int startIndex) { throw null; }
public static char ToChar(System.ReadOnlySpan<byte> value) { throw null; }
public static double ToDouble(byte[] value, int startIndex) { throw null; }
public static double ToDouble(System.ReadOnlySpan<byte> value) { throw null; }
public static System.Half ToHalf(byte[] value, int startIndex) { throw null; }
public static System.Half ToHalf(System.ReadOnlySpan<byte> value) { throw null; }
public static short ToInt16(byte[] value, int startIndex) { throw null; }
public static short ToInt16(System.ReadOnlySpan<byte> value) { throw null; }
public static int ToInt32(byte[] value, int startIndex) { throw null; }
public static int ToInt32(System.ReadOnlySpan<byte> value) { throw null; }
public static long ToInt64(byte[] value, int startIndex) { throw null; }
public static long ToInt64(System.ReadOnlySpan<byte> value) { throw null; }
public static float ToSingle(byte[] value, int startIndex) { throw null; }
public static float ToSingle(System.ReadOnlySpan<byte> value) { throw null; }
public static string ToString(byte[] value) { throw null; }
public static string ToString(byte[] value, int startIndex) { throw null; }
public static string ToString(byte[] value, int startIndex, int length) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(byte[] value, int startIndex) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(System.ReadOnlySpan<byte> value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(byte[] value, int startIndex) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(System.ReadOnlySpan<byte> value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(byte[] value, int startIndex) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(System.ReadOnlySpan<byte> value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, bool value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, char value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, double value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, System.Half value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, short value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, int value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, long value) { throw null; }
public static bool TryWriteBytes(System.Span<byte> destination, float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteBytes(System.Span<byte> destination, ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteBytes(System.Span<byte> destination, uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteBytes(System.Span<byte> destination, ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.Half UInt16BitsToHalf(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float UInt32BitsToSingle(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double UInt64BitsToDouble(ulong value) { throw null; }
}
public readonly partial struct Boolean : System.IComparable, System.IComparable<bool>, System.IConvertible, System.IEquatable<bool>
{
private readonly bool _dummyPrimitive;
public static readonly string FalseString;
public static readonly string TrueString;
public int CompareTo(System.Boolean value) { throw null; }
public int CompareTo(object? obj) { throw null; }
public System.Boolean Equals(System.Boolean obj) { throw null; }
public override System.Boolean Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Boolean Parse(System.ReadOnlySpan<char> value) { throw null; }
public static System.Boolean Parse(string value) { throw null; }
System.Boolean System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public System.Boolean TryFormat(System.Span<char> destination, out int charsWritten) { throw null; }
public static System.Boolean TryParse(System.ReadOnlySpan<char> value, out System.Boolean result) { throw null; }
public static System.Boolean TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value, out System.Boolean result) { throw null; }
}
public static partial class Buffer
{
public static void BlockCopy(System.Array src, int srcOffset, System.Array dst, int dstOffset, int count) { }
public static int ByteLength(System.Array array) { throw null; }
public static byte GetByte(System.Array array, int index) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void MemoryCopy(void* source, void* destination, long destinationSizeInBytes, long sourceBytesToCopy) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void MemoryCopy(void* source, void* destination, ulong destinationSizeInBytes, ulong sourceBytesToCopy) { }
public static void SetByte(System.Array array, int index, byte value) { }
}
public readonly partial struct Byte : System.IComparable, System.IComparable<byte>, System.IConvertible, System.IEquatable<byte>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<byte>,
System.IMinMaxValue<byte>,
System.IUnsignedNumber<byte>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly byte _dummyPrimitive;
public const byte MaxValue = (byte)255;
public const byte MinValue = (byte)0;
public int CompareTo(System.Byte value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Byte obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Byte Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.Byte Parse(string s) { throw null; }
public static System.Byte Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Byte Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Byte Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
System.Byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Byte result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Byte result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Byte result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Byte result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IAdditiveIdentity<byte, byte>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IMinMaxValue<byte>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IMinMaxValue<byte>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IMultiplicativeIdentity<byte, byte>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IAdditionOperators<byte, byte, byte>.operator +(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.LeadingZeroCount(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.PopCount(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.RotateLeft(byte value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.RotateRight(byte value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryInteger<byte>.TrailingZeroCount(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<byte>.IsPow2(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBinaryNumber<byte>.Log2(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBitwiseOperators<byte, byte, byte>.operator &(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBitwiseOperators<byte, byte, byte>.operator |(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBitwiseOperators<byte, byte, byte>.operator ^(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IBitwiseOperators<byte, byte, byte>.operator ~(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<byte, byte>.operator <(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<byte, byte>.operator <=(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<byte, byte>.operator >(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<byte, byte>.operator >=(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IDecrementOperators<byte>.operator --(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IDivisionOperators<byte, byte, byte>.operator /(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<byte, byte>.operator ==(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<byte, byte>.operator !=(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IIncrementOperators<byte>.operator ++(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IModulusOperators<byte, byte, byte>.operator %(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IMultiplyOperators<byte, byte, byte>.operator *(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Abs(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Clamp(byte value, byte min, byte max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (byte Quotient, byte Remainder) INumber<byte>.DivRem(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Max(byte x, byte y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Min(byte x, byte y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte INumber<byte>.Sign(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<byte>.TryCreate<TOther>(TOther value, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<byte>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<byte>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IParseable<byte>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<byte>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IShiftOperators<byte, byte>.operator <<(byte value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IShiftOperators<byte, byte>.operator >>(byte value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte ISpanParseable<byte>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<byte>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out byte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte ISubtractionOperators<byte, byte, byte>.operator -(byte left, byte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IUnaryNegationOperators<byte, byte>.operator -(byte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static byte IUnaryPlusOperators<byte, byte>.operator +(byte value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial class CannotUnloadAppDomainException : System.SystemException
{
public CannotUnloadAppDomainException() { }
protected CannotUnloadAppDomainException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public CannotUnloadAppDomainException(string? message) { }
public CannotUnloadAppDomainException(string? message, System.Exception? innerException) { }
}
public readonly partial struct Char : System.IComparable, System.IComparable<char>, System.IConvertible, System.IEquatable<char>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<char>,
System.IMinMaxValue<char>,
System.IUnsignedNumber<char>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly char _dummyPrimitive;
public const char MaxValue = '\uFFFF';
public const char MinValue = '\0';
public int CompareTo(System.Char value) { throw null; }
public int CompareTo(object? value) { throw null; }
public static string ConvertFromUtf32(int utf32) { throw null; }
public static int ConvertToUtf32(System.Char highSurrogate, System.Char lowSurrogate) { throw null; }
public static int ConvertToUtf32(string s, int index) { throw null; }
public bool Equals(System.Char obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static double GetNumericValue(System.Char c) { throw null; }
public static double GetNumericValue(string s, int index) { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(System.Char c) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(string s, int index) { throw null; }
public static bool IsAscii(System.Char c) { throw null; }
public static bool IsControl(System.Char c) { throw null; }
public static bool IsControl(string s, int index) { throw null; }
public static bool IsDigit(System.Char c) { throw null; }
public static bool IsDigit(string s, int index) { throw null; }
public static bool IsHighSurrogate(System.Char c) { throw null; }
public static bool IsHighSurrogate(string s, int index) { throw null; }
public static bool IsLetter(System.Char c) { throw null; }
public static bool IsLetter(string s, int index) { throw null; }
public static bool IsLetterOrDigit(System.Char c) { throw null; }
public static bool IsLetterOrDigit(string s, int index) { throw null; }
public static bool IsLower(System.Char c) { throw null; }
public static bool IsLower(string s, int index) { throw null; }
public static bool IsLowSurrogate(System.Char c) { throw null; }
public static bool IsLowSurrogate(string s, int index) { throw null; }
public static bool IsNumber(System.Char c) { throw null; }
public static bool IsNumber(string s, int index) { throw null; }
public static bool IsPunctuation(System.Char c) { throw null; }
public static bool IsPunctuation(string s, int index) { throw null; }
public static bool IsSeparator(System.Char c) { throw null; }
public static bool IsSeparator(string s, int index) { throw null; }
public static bool IsSurrogate(System.Char c) { throw null; }
public static bool IsSurrogate(string s, int index) { throw null; }
public static bool IsSurrogatePair(System.Char highSurrogate, System.Char lowSurrogate) { throw null; }
public static bool IsSurrogatePair(string s, int index) { throw null; }
public static bool IsSymbol(System.Char c) { throw null; }
public static bool IsSymbol(string s, int index) { throw null; }
public static bool IsUpper(System.Char c) { throw null; }
public static bool IsUpper(string s, int index) { throw null; }
public static bool IsWhiteSpace(System.Char c) { throw null; }
public static bool IsWhiteSpace(string s, int index) { throw null; }
public static System.Char Parse(string s) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
System.Char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public static System.Char ToLower(System.Char c) { throw null; }
public static System.Char ToLower(System.Char c, System.Globalization.CultureInfo culture) { throw null; }
public static System.Char ToLowerInvariant(System.Char c) { throw null; }
public override string ToString() { throw null; }
public static string ToString(System.Char c) { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public static System.Char ToUpper(System.Char c) { throw null; }
public static System.Char ToUpper(System.Char c, System.Globalization.CultureInfo culture) { throw null; }
public static System.Char ToUpperInvariant(System.Char c) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Char result) { throw null; }
bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw null; }
string System.IFormattable.ToString(string? format, IFormatProvider? formatProvider) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IAdditiveIdentity<char, char>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IMinMaxValue<char>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IMinMaxValue<char>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IMultiplicativeIdentity<char, char>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IAdditionOperators<char, char, char>.operator +(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.LeadingZeroCount(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.PopCount(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.RotateLeft(char value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.RotateRight(char value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryInteger<char>.TrailingZeroCount(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<char>.IsPow2(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBinaryNumber<char>.Log2(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBitwiseOperators<char, char, char>.operator &(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBitwiseOperators<char, char, char>.operator |(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBitwiseOperators<char, char, char>.operator ^(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IBitwiseOperators<char, char, char>.operator ~(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<char, char>.operator <(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<char, char>.operator <=(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<char, char>.operator >(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<char, char>.operator >=(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IDecrementOperators<char>.operator --(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IDivisionOperators<char, char, char>.operator /(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<char, char>.operator ==(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<char, char>.operator !=(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IIncrementOperators<char>.operator ++(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IModulusOperators<char, char, char>.operator %(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IMultiplyOperators<char, char, char>.operator *(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Abs(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Clamp(char value, char min, char max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (char Quotient, char Remainder) INumber<char>.DivRem(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Max(char x, char y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Min(char x, char y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char INumber<char>.Sign(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<char>.TryCreate<TOther>(TOther value, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<char>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<char>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IParseable<char>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<char>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IShiftOperators<char, char>.operator <<(char value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeatures("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview"), System.Runtime.CompilerServices.SpecialNameAttribute]
static char IShiftOperators<char, char>.operator >>(char value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char ISpanParseable<char>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<char>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out char result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char ISubtractionOperators<char, char, char>.operator -(char left, char right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IUnaryNegationOperators<char, char>.operator -(char value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static char IUnaryPlusOperators<char, char>.operator +(char value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public sealed partial class CharEnumerator : System.Collections.Generic.IEnumerator<char>, System.Collections.IEnumerator, System.ICloneable, System.IDisposable
{
internal CharEnumerator() { }
public char Current { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
public object Clone() { throw null; }
public void Dispose() { }
public bool MoveNext() { throw null; }
public void Reset() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=true, AllowMultiple=false)]
public sealed partial class CLSCompliantAttribute : System.Attribute
{
public CLSCompliantAttribute(bool isCompliant) { }
public bool IsCompliant { get { throw null; } }
}
public delegate int Comparison<in T>(T x, T y);
public abstract partial class ContextBoundObject : System.MarshalByRefObject
{
protected ContextBoundObject() { }
}
public partial class ContextMarshalException : System.SystemException
{
public ContextMarshalException() { }
protected ContextMarshalException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ContextMarshalException(string? message) { }
public ContextMarshalException(string? message, System.Exception? inner) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public partial class ContextStaticAttribute : System.Attribute
{
public ContextStaticAttribute() { }
}
public static partial class Convert
{
public static readonly object DBNull;
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static object? ChangeType(object? value, System.Type conversionType) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static object? ChangeType(object? value, System.Type conversionType, System.IFormatProvider? provider) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static object? ChangeType(object? value, System.TypeCode typeCode) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static object? ChangeType(object? value, System.TypeCode typeCode, System.IFormatProvider? provider) { throw null; }
public static byte[] FromBase64CharArray(char[] inArray, int offset, int length) { throw null; }
public static byte[] FromBase64String(string s) { throw null; }
public static byte[] FromHexString(System.ReadOnlySpan<char> chars) { throw null; }
public static byte[] FromHexString(string s) { throw null; }
public static System.TypeCode GetTypeCode(object? value) { throw null; }
public static bool IsDBNull([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut) { throw null; }
public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut, System.Base64FormattingOptions options) { throw null; }
public static string ToBase64String(byte[] inArray) { throw null; }
public static string ToBase64String(byte[] inArray, System.Base64FormattingOptions options) { throw null; }
public static string ToBase64String(byte[] inArray, int offset, int length) { throw null; }
public static string ToBase64String(byte[] inArray, int offset, int length, System.Base64FormattingOptions options) { throw null; }
public static string ToBase64String(System.ReadOnlySpan<byte> bytes, System.Base64FormattingOptions options = System.Base64FormattingOptions.None) { throw null; }
public static bool ToBoolean(bool value) { throw null; }
public static bool ToBoolean(byte value) { throw null; }
public static bool ToBoolean(char value) { throw null; }
public static bool ToBoolean(System.DateTime value) { throw null; }
public static bool ToBoolean(decimal value) { throw null; }
public static bool ToBoolean(double value) { throw null; }
public static bool ToBoolean(short value) { throw null; }
public static bool ToBoolean(int value) { throw null; }
public static bool ToBoolean(long value) { throw null; }
public static bool ToBoolean([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static bool ToBoolean([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool ToBoolean(sbyte value) { throw null; }
public static bool ToBoolean(float value) { throw null; }
public static bool ToBoolean([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value) { throw null; }
public static bool ToBoolean([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool ToBoolean(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool ToBoolean(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool ToBoolean(ulong value) { throw null; }
public static byte ToByte(bool value) { throw null; }
public static byte ToByte(byte value) { throw null; }
public static byte ToByte(char value) { throw null; }
public static byte ToByte(System.DateTime value) { throw null; }
public static byte ToByte(decimal value) { throw null; }
public static byte ToByte(double value) { throw null; }
public static byte ToByte(short value) { throw null; }
public static byte ToByte(int value) { throw null; }
public static byte ToByte(long value) { throw null; }
public static byte ToByte(object? value) { throw null; }
public static byte ToByte(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte ToByte(sbyte value) { throw null; }
public static byte ToByte(float value) { throw null; }
public static byte ToByte(string? value) { throw null; }
public static byte ToByte(string? value, System.IFormatProvider? provider) { throw null; }
public static byte ToByte(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte ToByte(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte ToByte(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static byte ToByte(ulong value) { throw null; }
public static char ToChar(bool value) { throw null; }
public static char ToChar(byte value) { throw null; }
public static char ToChar(char value) { throw null; }
public static char ToChar(System.DateTime value) { throw null; }
public static char ToChar(decimal value) { throw null; }
public static char ToChar(double value) { throw null; }
public static char ToChar(short value) { throw null; }
public static char ToChar(int value) { throw null; }
public static char ToChar(long value) { throw null; }
public static char ToChar(object? value) { throw null; }
public static char ToChar(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static char ToChar(sbyte value) { throw null; }
public static char ToChar(float value) { throw null; }
public static char ToChar(string value) { throw null; }
public static char ToChar(string value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static char ToChar(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static char ToChar(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static char ToChar(ulong value) { throw null; }
public static System.DateTime ToDateTime(bool value) { throw null; }
public static System.DateTime ToDateTime(byte value) { throw null; }
public static System.DateTime ToDateTime(char value) { throw null; }
public static System.DateTime ToDateTime(System.DateTime value) { throw null; }
public static System.DateTime ToDateTime(decimal value) { throw null; }
public static System.DateTime ToDateTime(double value) { throw null; }
public static System.DateTime ToDateTime(short value) { throw null; }
public static System.DateTime ToDateTime(int value) { throw null; }
public static System.DateTime ToDateTime(long value) { throw null; }
public static System.DateTime ToDateTime(object? value) { throw null; }
public static System.DateTime ToDateTime(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.DateTime ToDateTime(sbyte value) { throw null; }
public static System.DateTime ToDateTime(float value) { throw null; }
public static System.DateTime ToDateTime(string? value) { throw null; }
public static System.DateTime ToDateTime(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.DateTime ToDateTime(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.DateTime ToDateTime(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.DateTime ToDateTime(ulong value) { throw null; }
public static decimal ToDecimal(bool value) { throw null; }
public static decimal ToDecimal(byte value) { throw null; }
public static decimal ToDecimal(char value) { throw null; }
public static decimal ToDecimal(System.DateTime value) { throw null; }
public static decimal ToDecimal(decimal value) { throw null; }
public static decimal ToDecimal(double value) { throw null; }
public static decimal ToDecimal(short value) { throw null; }
public static decimal ToDecimal(int value) { throw null; }
public static decimal ToDecimal(long value) { throw null; }
public static decimal ToDecimal(object? value) { throw null; }
public static decimal ToDecimal(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static decimal ToDecimal(sbyte value) { throw null; }
public static decimal ToDecimal(float value) { throw null; }
public static decimal ToDecimal(string? value) { throw null; }
public static decimal ToDecimal(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static decimal ToDecimal(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static decimal ToDecimal(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static decimal ToDecimal(ulong value) { throw null; }
public static double ToDouble(bool value) { throw null; }
public static double ToDouble(byte value) { throw null; }
public static double ToDouble(char value) { throw null; }
public static double ToDouble(System.DateTime value) { throw null; }
public static double ToDouble(decimal value) { throw null; }
public static double ToDouble(double value) { throw null; }
public static double ToDouble(short value) { throw null; }
public static double ToDouble(int value) { throw null; }
public static double ToDouble(long value) { throw null; }
public static double ToDouble(object? value) { throw null; }
public static double ToDouble(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double ToDouble(sbyte value) { throw null; }
public static double ToDouble(float value) { throw null; }
public static double ToDouble(string? value) { throw null; }
public static double ToDouble(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double ToDouble(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double ToDouble(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static double ToDouble(ulong value) { throw null; }
public static string ToHexString(byte[] inArray) { throw null; }
public static string ToHexString(byte[] inArray, int offset, int length) { throw null; }
public static string ToHexString(System.ReadOnlySpan<byte> bytes) { throw null; }
public static short ToInt16(bool value) { throw null; }
public static short ToInt16(byte value) { throw null; }
public static short ToInt16(char value) { throw null; }
public static short ToInt16(System.DateTime value) { throw null; }
public static short ToInt16(decimal value) { throw null; }
public static short ToInt16(double value) { throw null; }
public static short ToInt16(short value) { throw null; }
public static short ToInt16(int value) { throw null; }
public static short ToInt16(long value) { throw null; }
public static short ToInt16(object? value) { throw null; }
public static short ToInt16(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static short ToInt16(sbyte value) { throw null; }
public static short ToInt16(float value) { throw null; }
public static short ToInt16(string? value) { throw null; }
public static short ToInt16(string? value, System.IFormatProvider? provider) { throw null; }
public static short ToInt16(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static short ToInt16(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static short ToInt16(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static short ToInt16(ulong value) { throw null; }
public static int ToInt32(bool value) { throw null; }
public static int ToInt32(byte value) { throw null; }
public static int ToInt32(char value) { throw null; }
public static int ToInt32(System.DateTime value) { throw null; }
public static int ToInt32(decimal value) { throw null; }
public static int ToInt32(double value) { throw null; }
public static int ToInt32(short value) { throw null; }
public static int ToInt32(int value) { throw null; }
public static int ToInt32(long value) { throw null; }
public static int ToInt32(object? value) { throw null; }
public static int ToInt32(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int ToInt32(sbyte value) { throw null; }
public static int ToInt32(float value) { throw null; }
public static int ToInt32(string? value) { throw null; }
public static int ToInt32(string? value, System.IFormatProvider? provider) { throw null; }
public static int ToInt32(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int ToInt32(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int ToInt32(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int ToInt32(ulong value) { throw null; }
public static long ToInt64(bool value) { throw null; }
public static long ToInt64(byte value) { throw null; }
public static long ToInt64(char value) { throw null; }
public static long ToInt64(System.DateTime value) { throw null; }
public static long ToInt64(decimal value) { throw null; }
public static long ToInt64(double value) { throw null; }
public static long ToInt64(short value) { throw null; }
public static long ToInt64(int value) { throw null; }
public static long ToInt64(long value) { throw null; }
public static long ToInt64(object? value) { throw null; }
public static long ToInt64(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static long ToInt64(sbyte value) { throw null; }
public static long ToInt64(float value) { throw null; }
public static long ToInt64(string? value) { throw null; }
public static long ToInt64(string? value, System.IFormatProvider? provider) { throw null; }
public static long ToInt64(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static long ToInt64(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static long ToInt64(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static long ToInt64(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(bool value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(byte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(System.DateTime value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(short value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(string? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(string value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(ulong value) { throw null; }
public static float ToSingle(bool value) { throw null; }
public static float ToSingle(byte value) { throw null; }
public static float ToSingle(char value) { throw null; }
public static float ToSingle(System.DateTime value) { throw null; }
public static float ToSingle(decimal value) { throw null; }
public static float ToSingle(double value) { throw null; }
public static float ToSingle(short value) { throw null; }
public static float ToSingle(int value) { throw null; }
public static float ToSingle(long value) { throw null; }
public static float ToSingle(object? value) { throw null; }
public static float ToSingle(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float ToSingle(sbyte value) { throw null; }
public static float ToSingle(float value) { throw null; }
public static float ToSingle(string? value) { throw null; }
public static float ToSingle(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float ToSingle(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float ToSingle(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static float ToSingle(ulong value) { throw null; }
public static string ToString(bool value) { throw null; }
public static string ToString(bool value, System.IFormatProvider? provider) { throw null; }
public static string ToString(byte value) { throw null; }
public static string ToString(byte value, System.IFormatProvider? provider) { throw null; }
public static string ToString(byte value, int toBase) { throw null; }
public static string ToString(char value) { throw null; }
public static string ToString(char value, System.IFormatProvider? provider) { throw null; }
public static string ToString(System.DateTime value) { throw null; }
public static string ToString(System.DateTime value, System.IFormatProvider? provider) { throw null; }
public static string ToString(decimal value) { throw null; }
public static string ToString(decimal value, System.IFormatProvider? provider) { throw null; }
public static string ToString(double value) { throw null; }
public static string ToString(double value, System.IFormatProvider? provider) { throw null; }
public static string ToString(short value) { throw null; }
public static string ToString(short value, System.IFormatProvider? provider) { throw null; }
public static string ToString(short value, int toBase) { throw null; }
public static string ToString(int value) { throw null; }
public static string ToString(int value, System.IFormatProvider? provider) { throw null; }
public static string ToString(int value, int toBase) { throw null; }
public static string ToString(long value) { throw null; }
public static string ToString(long value, System.IFormatProvider? provider) { throw null; }
public static string ToString(long value, int toBase) { throw null; }
public static string? ToString(object? value) { throw null; }
public static string? ToString(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(sbyte value, System.IFormatProvider? provider) { throw null; }
public static string ToString(float value) { throw null; }
public static string ToString(float value, System.IFormatProvider? provider) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? ToString(string? value) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? ToString(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(ushort value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(uint value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static string ToString(ulong value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(bool value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(byte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(System.DateTime value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(short value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(string? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(bool value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(byte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(System.DateTime value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(short value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(string? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(bool value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(byte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(System.DateTime value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(double value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(short value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(object? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(string? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(string? value, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(string? value, int fromBase) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(ulong value) { throw null; }
public static bool TryFromBase64Chars(System.ReadOnlySpan<char> chars, System.Span<byte> bytes, out int bytesWritten) { throw null; }
public static bool TryFromBase64String(string s, System.Span<byte> bytes, out int bytesWritten) { throw null; }
public static bool TryToBase64Chars(System.ReadOnlySpan<byte> bytes, System.Span<char> chars, out int charsWritten, System.Base64FormattingOptions options = System.Base64FormattingOptions.None) { throw null; }
}
public delegate TOutput Converter<in TInput, out TOutput>(TInput input);
public readonly partial struct DateOnly : System.IComparable, System.IComparable<System.DateOnly>, System.IEquatable<System.DateOnly>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IComparisonOperators<DateOnly, DateOnly>,
System.IMinMaxValue<DateOnly>,
System.ISpanParseable<DateOnly>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
public static DateOnly MinValue { get { throw null; } }
public static DateOnly MaxValue { get { throw null; } }
public DateOnly(int year, int month, int day) { throw null; }
public DateOnly(int year, int month, int day, System.Globalization.Calendar calendar) { throw null; }
public static DateOnly FromDayNumber(int dayNumber) { throw null; }
public int Year { get { throw null; } }
public int Month { get { throw null; } }
public int Day { get { throw null; } }
public System.DayOfWeek DayOfWeek { get { throw null; } }
public int DayOfYear { get { throw null; } }
public int DayNumber { get { throw null; } }
public System.DateOnly AddDays(int value) { throw null; }
public System.DateOnly AddMonths(int value) { throw null; }
public System.DateOnly AddYears(int value) { throw null; }
public static bool operator ==(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator >(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator >=(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator !=(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator <(System.DateOnly left, System.DateOnly right) { throw null; }
public static bool operator <=(System.DateOnly left, System.DateOnly right) { throw null; }
public System.DateTime ToDateTime(System.TimeOnly time) { throw null; }
public System.DateTime ToDateTime(System.TimeOnly time, System.DateTimeKind kind) { throw null; }
public static System.DateOnly FromDateTime(System.DateTime dateTime) { throw null; }
public int CompareTo(System.DateOnly value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.DateOnly value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public static System.DateOnly Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly ParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, System.IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly ParseExact(System.ReadOnlySpan<char> s, string[] formats) { throw null; }
public static System.DateOnly ParseExact(System.ReadOnlySpan<char> s, string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly Parse(string s) { throw null; }
public static System.DateOnly Parse(string s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly ParseExact(string s, string format) { throw null; }
public static System.DateOnly ParseExact(string s, string format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateOnly ParseExact(string s, string[] formats) { throw null; }
public static System.DateOnly ParseExact(string s, string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.DateOnly result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, out System.DateOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, out System.DateOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.DateOnly result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, out System.DateOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, out System.DateOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateOnly result) { throw null; }
public string ToLongDateString() { throw null; }
public string ToShortDateString() { throw null; }
public override string ToString() { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateOnly IMinMaxValue<System.DateOnly>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateOnly IMinMaxValue<System.DateOnly>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateOnly, System.DateOnly>.operator <(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateOnly, System.DateOnly>.operator <=(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateOnly, System.DateOnly>.operator >(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateOnly, System.DateOnly>.operator >=(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateOnly, System.DateOnly>.operator ==(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateOnly, System.DateOnly>.operator !=(System.DateOnly left, System.DateOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateOnly IParseable<System.DateOnly>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.DateOnly>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.DateOnly result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateOnly ISpanParseable<System.DateOnly>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.DateOnly>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.DateOnly result) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct DateTime : System.IComparable, System.IComparable<System.DateTime>, System.IConvertible, System.IEquatable<System.DateTime>, System.ISpanFormattable, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IAdditionOperators<System.DateTime, System.TimeSpan, System.DateTime>,
System.IAdditiveIdentity<System.DateTime, System.TimeSpan>,
System.IComparisonOperators<System.DateTime, System.DateTime>,
System.IMinMaxValue<System.DateTime>,
System.ISpanParseable<System.DateTime>,
System.ISubtractionOperators<System.DateTime, System.TimeSpan, System.DateTime>,
System.ISubtractionOperators<System.DateTime, System.DateTime, System.TimeSpan>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.DateTime MaxValue;
public static readonly System.DateTime MinValue;
public static readonly System.DateTime UnixEpoch;
public DateTime(int year, int month, int day) { throw null; }
public DateTime(int year, int month, int day, System.Globalization.Calendar calendar) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, System.DateTimeKind kind) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, System.Globalization.Calendar calendar) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, System.DateTimeKind kind) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, System.Globalization.Calendar calendar) { throw null; }
public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, System.Globalization.Calendar calendar, System.DateTimeKind kind) { throw null; }
public DateTime(long ticks) { throw null; }
public DateTime(long ticks, System.DateTimeKind kind) { throw null; }
public System.DateTime Date { get { throw null; } }
public int Day { get { throw null; } }
public System.DayOfWeek DayOfWeek { get { throw null; } }
public int DayOfYear { get { throw null; } }
public int Hour { get { throw null; } }
public System.DateTimeKind Kind { get { throw null; } }
public int Millisecond { get { throw null; } }
public int Minute { get { throw null; } }
public int Month { get { throw null; } }
public static System.DateTime Now { get { throw null; } }
public int Second { get { throw null; } }
public long Ticks { get { throw null; } }
public System.TimeSpan TimeOfDay { get { throw null; } }
public static System.DateTime Today { get { throw null; } }
public static System.DateTime UtcNow { get { throw null; } }
public int Year { get { throw null; } }
public System.DateTime Add(System.TimeSpan value) { throw null; }
public System.DateTime AddDays(double value) { throw null; }
public System.DateTime AddHours(double value) { throw null; }
public System.DateTime AddMilliseconds(double value) { throw null; }
public System.DateTime AddMinutes(double value) { throw null; }
public System.DateTime AddMonths(int months) { throw null; }
public System.DateTime AddSeconds(double value) { throw null; }
public System.DateTime AddTicks(long value) { throw null; }
public System.DateTime AddYears(int value) { throw null; }
public static int Compare(System.DateTime t1, System.DateTime t2) { throw null; }
public int CompareTo(System.DateTime value) { throw null; }
public int CompareTo(object? value) { throw null; }
public static int DaysInMonth(int year, int month) { throw null; }
public bool Equals(System.DateTime value) { throw null; }
public static bool Equals(System.DateTime t1, System.DateTime t2) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static System.DateTime FromBinary(long dateData) { throw null; }
public static System.DateTime FromFileTime(long fileTime) { throw null; }
public static System.DateTime FromFileTimeUtc(long fileTime) { throw null; }
public static System.DateTime FromOADate(double d) { throw null; }
public string[] GetDateTimeFormats() { throw null; }
public string[] GetDateTimeFormats(char format) { throw null; }
public string[] GetDateTimeFormats(char format, System.IFormatProvider? provider) { throw null; }
public string[] GetDateTimeFormats(System.IFormatProvider? provider) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public bool IsDaylightSavingTime() { throw null; }
public static bool IsLeapYear(int year) { throw null; }
public static System.DateTime operator +(System.DateTime d, System.TimeSpan t) { throw null; }
public static bool operator ==(System.DateTime d1, System.DateTime d2) { throw null; }
public static bool operator >(System.DateTime t1, System.DateTime t2) { throw null; }
public static bool operator >=(System.DateTime t1, System.DateTime t2) { throw null; }
public static bool operator !=(System.DateTime d1, System.DateTime d2) { throw null; }
public static bool operator <(System.DateTime t1, System.DateTime t2) { throw null; }
public static bool operator <=(System.DateTime t1, System.DateTime t2) { throw null; }
public static System.TimeSpan operator -(System.DateTime d1, System.DateTime d2) { throw null; }
public static System.DateTime operator -(System.DateTime d, System.TimeSpan t) { throw null; }
public static System.DateTime Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider = null, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTime Parse(string s) { throw null; }
public static System.DateTime Parse(string s, System.IFormatProvider? provider) { throw null; }
public static System.DateTime Parse(string s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles styles) { throw null; }
public static System.DateTime ParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTime ParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTime ParseExact(string s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string format, System.IFormatProvider? provider) { throw null; }
public static System.DateTime ParseExact(string s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style) { throw null; }
public static System.DateTime ParseExact(string s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style) { throw null; }
public static System.DateTime SpecifyKind(System.DateTime value, System.DateTimeKind kind) { throw null; }
public System.TimeSpan Subtract(System.DateTime value) { throw null; }
public System.DateTime Subtract(System.TimeSpan value) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public long ToBinary() { throw null; }
public long ToFileTime() { throw null; }
public long ToFileTimeUtc() { throw null; }
public System.DateTime ToLocalTime() { throw null; }
public string ToLongDateString() { throw null; }
public string ToLongTimeString() { throw null; }
public double ToOADate() { throw null; }
public string ToShortDateString() { throw null; }
public string ToShortTimeString() { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format) { throw null; }
public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format, System.IFormatProvider? provider) { throw null; }
public System.DateTime ToUniversalTime() { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.DateTime result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles styles, out System.DateTime result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.DateTime result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles styles, out System.DateTime result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateTime result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateTime result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateTime result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.DateTime result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IAdditiveIdentity<System.DateTime, System.TimeSpan>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime IMinMaxValue<System.DateTime>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime IMinMaxValue<System.DateTime>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime IAdditionOperators<System.DateTime, System.TimeSpan, System.DateTime>.operator +(System.DateTime left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTime, System.DateTime>.operator <(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTime, System.DateTime>.operator <=(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTime, System.DateTime>.operator >(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTime, System.DateTime>.operator >=(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateTime, System.DateTime>.operator ==(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateTime, System.DateTime>.operator !=(System.DateTime left, System.DateTime right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime IParseable<System.DateTime>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.DateTime>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.DateTime result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime ISpanParseable<System.DateTime>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.DateTime>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.DateTime result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTime ISubtractionOperators<System.DateTime, System.TimeSpan, System.DateTime>.operator -(System.DateTime left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISubtractionOperators<System.DateTime, System.DateTime, System.TimeSpan>.operator -(System.DateTime left, System.DateTime right) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public enum DateTimeKind
{
Unspecified = 0,
Utc = 1,
Local = 2,
}
public readonly partial struct DateTimeOffset : System.IComparable, System.IComparable<System.DateTimeOffset>, System.IEquatable<System.DateTimeOffset>, System.ISpanFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IAdditionOperators<System.DateTimeOffset, System.TimeSpan, System.DateTimeOffset>,
System.IAdditiveIdentity<System.DateTimeOffset, System.TimeSpan>,
System.IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>,
System.IMinMaxValue<System.DateTimeOffset>, System.ISpanParseable<System.DateTimeOffset>,
System.ISubtractionOperators<System.DateTimeOffset, System.TimeSpan, System.DateTimeOffset>,
System.ISubtractionOperators<System.DateTimeOffset, System.DateTimeOffset, System.TimeSpan>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.DateTimeOffset MaxValue;
public static readonly System.DateTimeOffset MinValue;
public static readonly System.DateTimeOffset UnixEpoch;
public DateTimeOffset(System.DateTime dateTime) { throw null; }
public DateTimeOffset(System.DateTime dateTime, System.TimeSpan offset) { throw null; }
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, System.Globalization.Calendar calendar, System.TimeSpan offset) { throw null; }
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, int millisecond, System.TimeSpan offset) { throw null; }
public DateTimeOffset(int year, int month, int day, int hour, int minute, int second, System.TimeSpan offset) { throw null; }
public DateTimeOffset(long ticks, System.TimeSpan offset) { throw null; }
public System.DateTime Date { get { throw null; } }
public System.DateTime DateTime { get { throw null; } }
public int Day { get { throw null; } }
public System.DayOfWeek DayOfWeek { get { throw null; } }
public int DayOfYear { get { throw null; } }
public int Hour { get { throw null; } }
public System.DateTime LocalDateTime { get { throw null; } }
public int Millisecond { get { throw null; } }
public int Minute { get { throw null; } }
public int Month { get { throw null; } }
public static System.DateTimeOffset Now { get { throw null; } }
public System.TimeSpan Offset { get { throw null; } }
public int Second { get { throw null; } }
public long Ticks { get { throw null; } }
public System.TimeSpan TimeOfDay { get { throw null; } }
public System.DateTime UtcDateTime { get { throw null; } }
public static System.DateTimeOffset UtcNow { get { throw null; } }
public long UtcTicks { get { throw null; } }
public int Year { get { throw null; } }
public System.DateTimeOffset Add(System.TimeSpan timeSpan) { throw null; }
public System.DateTimeOffset AddDays(double days) { throw null; }
public System.DateTimeOffset AddHours(double hours) { throw null; }
public System.DateTimeOffset AddMilliseconds(double milliseconds) { throw null; }
public System.DateTimeOffset AddMinutes(double minutes) { throw null; }
public System.DateTimeOffset AddMonths(int months) { throw null; }
public System.DateTimeOffset AddSeconds(double seconds) { throw null; }
public System.DateTimeOffset AddTicks(long ticks) { throw null; }
public System.DateTimeOffset AddYears(int years) { throw null; }
public static int Compare(System.DateTimeOffset first, System.DateTimeOffset second) { throw null; }
public int CompareTo(System.DateTimeOffset other) { throw null; }
public bool Equals(System.DateTimeOffset other) { throw null; }
public static bool Equals(System.DateTimeOffset first, System.DateTimeOffset second) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool EqualsExact(System.DateTimeOffset other) { throw null; }
public static System.DateTimeOffset FromFileTime(long fileTime) { throw null; }
public static System.DateTimeOffset FromUnixTimeMilliseconds(long milliseconds) { throw null; }
public static System.DateTimeOffset FromUnixTimeSeconds(long seconds) { throw null; }
public override int GetHashCode() { throw null; }
public static System.DateTimeOffset operator +(System.DateTimeOffset dateTimeOffset, System.TimeSpan timeSpan) { throw null; }
public static bool operator ==(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static bool operator >(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static bool operator >=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static implicit operator System.DateTimeOffset (System.DateTime dateTime) { throw null; }
public static bool operator !=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static bool operator <(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static bool operator <=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static System.TimeSpan operator -(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
public static System.DateTimeOffset operator -(System.DateTimeOffset dateTimeOffset, System.TimeSpan timeSpan) { throw null; }
public static System.DateTimeOffset Parse(System.ReadOnlySpan<char> input, System.IFormatProvider? formatProvider = null, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTimeOffset Parse(string input) { throw null; }
public static System.DateTimeOffset Parse(string input, System.IFormatProvider? formatProvider) { throw null; }
public static System.DateTimeOffset Parse(string input, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles) { throw null; }
public static System.DateTimeOffset ParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTimeOffset ParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string[] formats, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.DateTimeOffset ParseExact(string input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string format, System.IFormatProvider? formatProvider) { throw null; }
public static System.DateTimeOffset ParseExact(string input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string format, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles) { throw null; }
public static System.DateTimeOffset ParseExact(string input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string[] formats, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles) { throw null; }
public System.TimeSpan Subtract(System.DateTimeOffset value) { throw null; }
public System.DateTimeOffset Subtract(System.TimeSpan value) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public long ToFileTime() { throw null; }
public System.DateTimeOffset ToLocalTime() { throw null; }
public System.DateTimeOffset ToOffset(System.TimeSpan offset) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? formatProvider) { throw null; }
public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format) { throw null; }
public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format, System.IFormatProvider? formatProvider) { throw null; }
public System.DateTimeOffset ToUniversalTime() { throw null; }
public long ToUnixTimeMilliseconds() { throw null; }
public long ToUnixTimeSeconds() { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? formatProvider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, out System.DateTimeOffset result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, out System.DateTimeOffset result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string?[]? formats, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string? format, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true), System.Diagnostics.CodeAnalysis.StringSyntaxAttribute(System.Diagnostics.CodeAnalysis.StringSyntaxAttribute.DateTimeFormat)] string?[]? formats, System.IFormatProvider? formatProvider, System.Globalization.DateTimeStyles styles, out System.DateTimeOffset result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IAdditiveIdentity<System.DateTimeOffset, System.TimeSpan>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset IMinMaxValue<System.DateTimeOffset>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset IMinMaxValue<System.DateTimeOffset>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset IAdditionOperators<System.DateTimeOffset, System.TimeSpan, System.DateTimeOffset>.operator +(System.DateTimeOffset left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>.operator <(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>.operator <=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>.operator >(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.DateTimeOffset, System.DateTimeOffset>.operator >=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateTimeOffset, System.DateTimeOffset>.operator ==(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.DateTimeOffset, System.DateTimeOffset>.operator !=(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset IParseable<System.DateTimeOffset>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.DateTimeOffset>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.DateTimeOffset result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset ISpanParseable<System.DateTimeOffset>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.DateTimeOffset>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.DateTimeOffset result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.DateTimeOffset ISubtractionOperators<System.DateTimeOffset, System.TimeSpan, System.DateTimeOffset>.operator -(System.DateTimeOffset left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISubtractionOperators<System.DateTimeOffset, System.DateTimeOffset, System.TimeSpan>.operator -(System.DateTimeOffset left, System.DateTimeOffset right) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public enum DayOfWeek
{
Sunday = 0,
Monday = 1,
Tuesday = 2,
Wednesday = 3,
Thursday = 4,
Friday = 5,
Saturday = 6,
}
public sealed partial class DBNull : System.IConvertible, System.Runtime.Serialization.ISerializable
{
internal DBNull() { }
public static readonly System.DBNull Value;
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public System.TypeCode GetTypeCode() { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
}
public readonly partial struct Decimal : System.IComparable, System.IComparable<decimal>, System.IConvertible, System.IEquatable<decimal>, System.ISpanFormattable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IMinMaxValue<decimal>,
System.ISignedNumber<decimal>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)0, (uint)4294967295, (uint)4294967295, (uint)4294967295)]
public static readonly decimal MaxValue;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)128, (uint)0, (uint)0, (uint)1)]
public static readonly decimal MinusOne;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)128, (uint)4294967295, (uint)4294967295, (uint)4294967295)]
public static readonly decimal MinValue;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)0, (uint)0, (uint)0, (uint)1)]
public static readonly decimal One;
[System.Runtime.CompilerServices.DecimalConstantAttribute((byte)0, (byte)0, (uint)0, (uint)0, (uint)0)]
public static readonly decimal Zero;
public Decimal(double value) { throw null; }
public Decimal(int value) { throw null; }
public Decimal(int lo, int mid, int hi, bool isNegative, byte scale) { throw null; }
public Decimal(int[] bits) { throw null; }
public Decimal(long value) { throw null; }
public Decimal(System.ReadOnlySpan<int> bits) { throw null; }
public Decimal(float value) { throw null; }
[System.CLSCompliantAttribute(false)]
public Decimal(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public Decimal(ulong value) { throw null; }
public static System.Decimal Add(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal Ceiling(System.Decimal d) { throw null; }
public static int Compare(System.Decimal d1, System.Decimal d2) { throw null; }
public int CompareTo(System.Decimal value) { throw null; }
public int CompareTo(object? value) { throw null; }
public static System.Decimal Divide(System.Decimal d1, System.Decimal d2) { throw null; }
public bool Equals(System.Decimal value) { throw null; }
public static bool Equals(System.Decimal d1, System.Decimal d2) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static System.Decimal Floor(System.Decimal d) { throw null; }
public static System.Decimal FromOACurrency(long cy) { throw null; }
public static int[] GetBits(System.Decimal d) { throw null; }
public static int GetBits(System.Decimal d, System.Span<int> destination) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Decimal Multiply(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal Negate(System.Decimal d) { throw null; }
public static System.Decimal operator +(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator --(System.Decimal d) { throw null; }
public static System.Decimal operator /(System.Decimal d1, System.Decimal d2) { throw null; }
public static bool operator ==(System.Decimal d1, System.Decimal d2) { throw null; }
public static explicit operator byte (System.Decimal value) { throw null; }
public static explicit operator char (System.Decimal value) { throw null; }
public static explicit operator double (System.Decimal value) { throw null; }
public static explicit operator short (System.Decimal value) { throw null; }
public static explicit operator int (System.Decimal value) { throw null; }
public static explicit operator long (System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator sbyte (System.Decimal value) { throw null; }
public static explicit operator float (System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator ushort (System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator uint (System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator ulong (System.Decimal value) { throw null; }
public static explicit operator System.Decimal (double value) { throw null; }
public static explicit operator System.Decimal (float value) { throw null; }
public static bool operator >(System.Decimal d1, System.Decimal d2) { throw null; }
public static bool operator >=(System.Decimal d1, System.Decimal d2) { throw null; }
public static implicit operator System.Decimal (byte value) { throw null; }
public static implicit operator System.Decimal (char value) { throw null; }
public static implicit operator System.Decimal (short value) { throw null; }
public static implicit operator System.Decimal (int value) { throw null; }
public static implicit operator System.Decimal (long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Decimal (sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Decimal (ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Decimal (uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static implicit operator System.Decimal (ulong value) { throw null; }
public static System.Decimal operator ++(System.Decimal d) { throw null; }
public static bool operator !=(System.Decimal d1, System.Decimal d2) { throw null; }
public static bool operator <(System.Decimal d1, System.Decimal d2) { throw null; }
public static bool operator <=(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator %(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator *(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator -(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal operator -(System.Decimal d) { throw null; }
public static System.Decimal operator +(System.Decimal d) { throw null; }
public static System.Decimal Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Number, System.IFormatProvider? provider = null) { throw null; }
public static System.Decimal Parse(string s) { throw null; }
public static System.Decimal Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Decimal Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Decimal Parse(string s, System.IFormatProvider? provider) { throw null; }
public static System.Decimal Remainder(System.Decimal d1, System.Decimal d2) { throw null; }
public static System.Decimal Round(System.Decimal d) { throw null; }
public static System.Decimal Round(System.Decimal d, int decimals) { throw null; }
public static System.Decimal Round(System.Decimal d, int decimals, System.MidpointRounding mode) { throw null; }
public static System.Decimal Round(System.Decimal d, System.MidpointRounding mode) { throw null; }
public static System.Decimal Subtract(System.Decimal d1, System.Decimal d2) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
System.Decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static byte ToByte(System.Decimal value) { throw null; }
public static double ToDouble(System.Decimal d) { throw null; }
public static short ToInt16(System.Decimal value) { throw null; }
public static int ToInt32(System.Decimal d) { throw null; }
public static long ToInt64(System.Decimal d) { throw null; }
public static long ToOACurrency(System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ToSByte(System.Decimal value) { throw null; }
public static float ToSingle(System.Decimal d) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ToUInt16(System.Decimal value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ToUInt32(System.Decimal d) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ToUInt64(System.Decimal d) { throw null; }
public static System.Decimal Truncate(System.Decimal d) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryGetBits(System.Decimal d, System.Span<int> destination, out int valuesWritten) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Decimal result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Decimal result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Decimal result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Decimal result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IAdditiveIdentity<decimal, decimal>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IMinMaxValue<decimal>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IMinMaxValue<decimal>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IMultiplicativeIdentity<decimal, decimal>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IAdditionOperators<decimal, decimal, decimal>.operator +(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<decimal, decimal>.operator <(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<decimal, decimal>.operator <=(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<decimal, decimal>.operator >(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<decimal, decimal>.operator >=(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IDecrementOperators<decimal>.operator --(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IDivisionOperators<decimal, decimal, decimal>.operator /(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<decimal, decimal>.operator ==(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<decimal, decimal>.operator !=(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IIncrementOperators<decimal>.operator ++(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IModulusOperators<decimal, decimal, decimal>.operator %(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IMultiplyOperators<decimal, decimal, decimal>.operator *(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Abs(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Clamp(decimal value, decimal min, decimal max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (decimal Quotient, decimal Remainder) INumber<decimal>.DivRem(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Max(decimal x, decimal y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Min(decimal x, decimal y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal INumber<decimal>.Sign(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<decimal>.TryCreate<TOther>(TOther value, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<decimal>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<decimal>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IParseable<decimal>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<decimal>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal ISignedNumber<decimal>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal ISpanParseable<decimal>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<decimal>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out decimal result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal ISubtractionOperators<decimal, decimal, decimal>.operator -(decimal left, decimal right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IUnaryNegationOperators<decimal, decimal>.operator -(decimal value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static decimal IUnaryPlusOperators<decimal, decimal>.operator +(decimal value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public abstract partial class Delegate : System.ICloneable, System.Runtime.Serialization.ISerializable
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
protected Delegate(object target, string method) { }
protected Delegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method) { }
public System.Reflection.MethodInfo Method { get { throw null; } }
public object? Target { get { throw null; } }
public virtual object Clone() { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("a")]
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("b")]
public static System.Delegate? Combine(System.Delegate? a, System.Delegate? b) { throw null; }
public static System.Delegate? Combine(params System.Delegate?[]? delegates) { throw null; }
protected virtual System.Delegate CombineImpl(System.Delegate? d) { throw null; }
public static System.Delegate CreateDelegate(System.Type type, object? firstArgument, System.Reflection.MethodInfo method) { throw null; }
public static System.Delegate? CreateDelegate(System.Type type, object? firstArgument, System.Reflection.MethodInfo method, bool throwOnBindFailure) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
public static System.Delegate CreateDelegate(System.Type type, object target, string method) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
public static System.Delegate CreateDelegate(System.Type type, object target, string method, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
public static System.Delegate? CreateDelegate(System.Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure) { throw null; }
public static System.Delegate CreateDelegate(System.Type type, System.Reflection.MethodInfo method) { throw null; }
public static System.Delegate? CreateDelegate(System.Type type, System.Reflection.MethodInfo method, bool throwOnBindFailure) { throw null; }
public static System.Delegate CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method) { throw null; }
public static System.Delegate CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method, bool ignoreCase) { throw null; }
public static System.Delegate? CreateDelegate(System.Type type, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method, bool ignoreCase, bool throwOnBindFailure) { throw null; }
public object? DynamicInvoke(params object?[]? args) { throw null; }
protected virtual object? DynamicInvokeImpl(object?[]? args) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public virtual System.Delegate[] GetInvocationList() { throw null; }
protected virtual System.Reflection.MethodInfo GetMethodImpl() { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(System.Delegate? d1, System.Delegate? d2) { throw null; }
public static bool operator !=(System.Delegate? d1, System.Delegate? d2) { throw null; }
public static System.Delegate? Remove(System.Delegate? source, System.Delegate? value) { throw null; }
public static System.Delegate? RemoveAll(System.Delegate? source, System.Delegate? value) { throw null; }
protected virtual System.Delegate? RemoveImpl(System.Delegate d) { throw null; }
}
public partial class DivideByZeroException : System.ArithmeticException
{
public DivideByZeroException() { }
protected DivideByZeroException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public DivideByZeroException(string? message) { }
public DivideByZeroException(string? message, System.Exception? innerException) { }
}
public readonly partial struct Double : System.IComparable, System.IComparable<double>, System.IConvertible, System.IEquatable<double>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryFloatingPoint<double>,
System.IMinMaxValue<double>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly double _dummyPrimitive;
public const double Epsilon = 5E-324;
public const double MaxValue = 1.7976931348623157E+308;
public const double MinValue = -1.7976931348623157E+308;
public const double NaN = 0.0 / 0.0;
public const double NegativeInfinity = -1.0 / 0.0;
public const double PositiveInfinity = 1.0 / 0.0;
public int CompareTo(System.Double value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Double obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static bool IsFinite(System.Double d) { throw null; }
public static bool IsInfinity(System.Double d) { throw null; }
public static bool IsNaN(System.Double d) { throw null; }
public static bool IsNegative(System.Double d) { throw null; }
public static bool IsNegativeInfinity(System.Double d) { throw null; }
public static bool IsNormal(System.Double d) { throw null; }
public static bool IsPositiveInfinity(System.Double d) { throw null; }
public static bool IsSubnormal(System.Double d) { throw null; }
public static bool operator ==(System.Double left, System.Double right) { throw null; }
public static bool operator >(System.Double left, System.Double right) { throw null; }
public static bool operator >=(System.Double left, System.Double right) { throw null; }
public static bool operator !=(System.Double left, System.Double right) { throw null; }
public static bool operator <(System.Double left, System.Double right) { throw null; }
public static bool operator <=(System.Double left, System.Double right) { throw null; }
public static System.Double Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; }
public static System.Double Parse(string s) { throw null; }
public static System.Double Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Double Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Double Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
System.Double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Double result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Double result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Double result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Double result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IAdditiveIdentity<double, double>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.E { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Epsilon { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.NaN { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.NegativeInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.NegativeZero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Pi { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.PositiveInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Tau { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMinMaxValue<double>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMinMaxValue<double>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMultiplicativeIdentity<double, double>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IAdditionOperators<double, double, double>.operator +(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<double>.IsPow2(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBinaryNumber<double>.Log2(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBitwiseOperators<double, double, double>.operator &(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBitwiseOperators<double, double, double>.operator |(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBitwiseOperators<double, double, double>.operator ^(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IBitwiseOperators<double, double, double>.operator ~(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<double, double>.operator <(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<double, double>.operator <=(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<double, double>.operator >(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<double, double>.operator >=(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IDecrementOperators<double>.operator --(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IDivisionOperators<double, double, double>.operator /(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<double, double>.operator ==(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<double, double>.operator !=(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Acos(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Acosh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Asin(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Asinh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Atan(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Atan2(double y, double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Atanh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.BitIncrement(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.BitDecrement(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Cbrt(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Ceiling(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.CopySign(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Cos(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Cosh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Exp(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Floor(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.FusedMultiplyAdd(double left, double right, double addend) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.IEEERemainder(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static TInteger IFloatingPoint<double>.ILogB<TInteger>(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Log(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Log(double x, double newBase) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Log2(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Log10(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.MaxMagnitude(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.MinMagnitude(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Pow(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Round(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Round<TInteger>(double x, TInteger digits) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Round(double x, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Round<TInteger>(double x, TInteger digits, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.ScaleB<TInteger>(double x, TInteger n) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Sin(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Sinh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Sqrt(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Tan(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Tanh(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IFloatingPoint<double>.Truncate(double x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsFinite(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsInfinity(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsNaN(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsNegative(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsNegativeInfinity(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsNormal(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsPositiveInfinity(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<double>.IsSubnormal(double d) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IIncrementOperators<double>.operator ++(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IModulusOperators<double, double, double>.operator %(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMultiplyOperators<double, double, double>.operator *(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Abs(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Clamp(double value, double min, double max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (double Quotient, double Remainder) INumber<double>.DivRem(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Max(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Min(double x, double y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double INumber<double>.Sign(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<double>.TryCreate<TOther>(TOther value, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<double>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<double>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IParseable<double>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<double>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double ISignedNumber<double>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double ISpanParseable<double>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<double>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out double result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double ISubtractionOperators<double, double, double>.operator -(double left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IUnaryNegationOperators<double, double>.operator -(double value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IUnaryPlusOperators<double, double>.operator +(double value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial class DuplicateWaitObjectException : System.ArgumentException
{
public DuplicateWaitObjectException() { }
protected DuplicateWaitObjectException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public DuplicateWaitObjectException(string? parameterName) { }
public DuplicateWaitObjectException(string? message, System.Exception? innerException) { }
public DuplicateWaitObjectException(string? parameterName, string? message) { }
}
public partial class EntryPointNotFoundException : System.TypeLoadException
{
public EntryPointNotFoundException() { }
protected EntryPointNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public EntryPointNotFoundException(string? message) { }
public EntryPointNotFoundException(string? message, System.Exception? inner) { }
}
public abstract partial class Enum : System.ValueType, System.IComparable, System.IConvertible, System.IFormattable
{
protected Enum() { }
public int CompareTo(object? target) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public static string Format(System.Type enumType, object value, string format) { throw null; }
public override int GetHashCode() { throw null; }
public static string? GetName(System.Type enumType, object value) { throw null; }
public static string? GetName<TEnum>(TEnum value) where TEnum : struct, System.Enum { throw null; }
public static string[] GetNames(System.Type enumType) { throw null; }
public static string[] GetNames<TEnum>() where TEnum: struct, System.Enum { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Type GetUnderlyingType(System.Type enumType) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("It might not be possible to create an array of the enum type at runtime. Use the GetValues<TEnum> overload instead.")]
public static System.Array GetValues(System.Type enumType) { throw null; }
public static TEnum[] GetValues<TEnum>() where TEnum : struct, System.Enum { throw null; }
public bool HasFlag(System.Enum flag) { throw null; }
public static bool IsDefined(System.Type enumType, object value) { throw null; }
public static bool IsDefined<TEnum>(TEnum value) where TEnum : struct, System.Enum { throw null; }
public static object Parse(System.Type enumType, System.ReadOnlySpan<char> value) { throw null; }
public static object Parse(System.Type enumType, System.ReadOnlySpan<char> value, bool ignoreCase) { throw null; }
public static object Parse(System.Type enumType, string value) { throw null; }
public static object Parse(System.Type enumType, string value, bool ignoreCase) { throw null; }
public static TEnum Parse<TEnum>(System.ReadOnlySpan<char> value) where TEnum : struct { throw null; }
public static TEnum Parse<TEnum>(System.ReadOnlySpan<char> value, bool ignoreCase) where TEnum : struct { throw null; }
public static TEnum Parse<TEnum>(string value) where TEnum : struct { throw null; }
public static TEnum Parse<TEnum>(string value, bool ignoreCase) where TEnum : struct { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public static object ToObject(System.Type enumType, byte value) { throw null; }
public static object ToObject(System.Type enumType, short value) { throw null; }
public static object ToObject(System.Type enumType, int value) { throw null; }
public static object ToObject(System.Type enumType, long value) { throw null; }
public static object ToObject(System.Type enumType, object value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static object ToObject(System.Type enumType, sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static object ToObject(System.Type enumType, ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static object ToObject(System.Type enumType, uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static object ToObject(System.Type enumType, ulong value) { throw null; }
public override string ToString() { throw null; }
[System.ObsoleteAttribute("The provider argument is not used. Use ToString() instead.")]
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
[System.ObsoleteAttribute("The provider argument is not used. Use ToString(String) instead.")]
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public static bool TryParse(System.Type enumType, System.ReadOnlySpan<char> value, bool ignoreCase, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? result) { throw null; }
public static bool TryParse(System.Type enumType, System.ReadOnlySpan<char> value, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? result) { throw null; }
public static bool TryParse(System.Type enumType, string? value, bool ignoreCase, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? result) { throw null; }
public static bool TryParse(System.Type enumType, string? value, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out object? result) { throw null; }
public static bool TryParse<TEnum>(System.ReadOnlySpan<char> value, bool ignoreCase, out TEnum result) where TEnum : struct { throw null; }
public static bool TryParse<TEnum>(System.ReadOnlySpan<char> value, out TEnum result) where TEnum : struct { throw null; }
public static bool TryParse<TEnum>([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value, bool ignoreCase, out TEnum result) where TEnum : struct { throw null; }
public static bool TryParse<TEnum>([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value, out TEnum result) where TEnum : struct { throw null; }
}
public static partial class Environment
{
public static string CommandLine { get { throw null; } }
public static string CurrentDirectory { get { throw null; } set { } }
public static int CurrentManagedThreadId { get { throw null; } }
public static int ExitCode { get { throw null; } set { } }
public static bool HasShutdownStarted { get { throw null; } }
public static bool Is64BitOperatingSystem { get { throw null; } }
public static bool Is64BitProcess { get { throw null; } }
public static string MachineName { get { throw null; } }
public static string NewLine { get { throw null; } }
public static System.OperatingSystem OSVersion { get { throw null; } }
public static int ProcessId { get { throw null; } }
public static int ProcessorCount { get { throw null; } }
public static string? ProcessPath { get { throw null; } }
public static string StackTrace { get { throw null; } }
public static string SystemDirectory { get { throw null; } }
public static int SystemPageSize { get { throw null; } }
public static int TickCount { get { throw null; } }
public static long TickCount64 { get { throw null; } }
public static string UserDomainName { get { throw null; } }
public static bool UserInteractive { get { throw null; } }
public static string UserName { get { throw null; } }
public static System.Version Version { get { throw null; } }
public static long WorkingSet { get { throw null; } }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public static void Exit(int exitCode) { throw null; }
public static string ExpandEnvironmentVariables(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public static void FailFast(string? message) { throw null; }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public static void FailFast(string? message, System.Exception? exception) { throw null; }
public static string[] GetCommandLineArgs() { throw null; }
public static string? GetEnvironmentVariable(string variable) { throw null; }
public static string? GetEnvironmentVariable(string variable, System.EnvironmentVariableTarget target) { throw null; }
public static System.Collections.IDictionary GetEnvironmentVariables() { throw null; }
public static System.Collections.IDictionary GetEnvironmentVariables(System.EnvironmentVariableTarget target) { throw null; }
public static string GetFolderPath(System.Environment.SpecialFolder folder) { throw null; }
public static string GetFolderPath(System.Environment.SpecialFolder folder, System.Environment.SpecialFolderOption option) { throw null; }
public static string[] GetLogicalDrives() { throw null; }
public static void SetEnvironmentVariable(string variable, string? value) { }
public static void SetEnvironmentVariable(string variable, string? value, System.EnvironmentVariableTarget target) { }
public enum SpecialFolder
{
Desktop = 0,
Programs = 2,
MyDocuments = 5,
Personal = 5,
Favorites = 6,
Startup = 7,
Recent = 8,
SendTo = 9,
StartMenu = 11,
MyMusic = 13,
MyVideos = 14,
DesktopDirectory = 16,
MyComputer = 17,
NetworkShortcuts = 19,
Fonts = 20,
Templates = 21,
CommonStartMenu = 22,
CommonPrograms = 23,
CommonStartup = 24,
CommonDesktopDirectory = 25,
ApplicationData = 26,
PrinterShortcuts = 27,
LocalApplicationData = 28,
InternetCache = 32,
Cookies = 33,
History = 34,
CommonApplicationData = 35,
Windows = 36,
System = 37,
ProgramFiles = 38,
MyPictures = 39,
UserProfile = 40,
SystemX86 = 41,
ProgramFilesX86 = 42,
CommonProgramFiles = 43,
CommonProgramFilesX86 = 44,
CommonTemplates = 45,
CommonDocuments = 46,
CommonAdminTools = 47,
AdminTools = 48,
CommonMusic = 53,
CommonPictures = 54,
CommonVideos = 55,
Resources = 56,
LocalizedResources = 57,
CommonOemLinks = 58,
CDBurning = 59,
}
public enum SpecialFolderOption
{
None = 0,
DoNotVerify = 16384,
Create = 32768,
}
}
public enum EnvironmentVariableTarget
{
Process = 0,
User = 1,
Machine = 2,
}
public partial class EventArgs
{
public static readonly System.EventArgs Empty;
public EventArgs() { }
}
public delegate void EventHandler(object? sender, System.EventArgs e);
public delegate void EventHandler<TEventArgs>(object? sender, TEventArgs e);
public partial class Exception : System.Runtime.Serialization.ISerializable
{
public Exception() { }
protected Exception(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public Exception(string? message) { }
public Exception(string? message, System.Exception? innerException) { }
public virtual System.Collections.IDictionary Data { get { throw null; } }
public virtual string? HelpLink { get { throw null; } set { } }
public int HResult { get { throw null; } set { } }
public System.Exception? InnerException { get { throw null; } }
public virtual string Message { get { throw null; } }
public virtual string? Source { get { throw null; } set { } }
public virtual string? StackTrace { get { throw null; } }
public System.Reflection.MethodBase? TargetSite { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Metadata for the method might be incomplete or removed")] get { throw null; } }
[System.ObsoleteAttribute("BinaryFormatter serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for more information.", DiagnosticId = "SYSLIB0011", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
protected event System.EventHandler<System.Runtime.Serialization.SafeSerializationEventArgs>? SerializeObjectState { add { } remove { } }
public virtual System.Exception GetBaseException() { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public new System.Type GetType() { throw null; }
public override string ToString() { throw null; }
}
[System.ObsoleteAttribute("ExecutionEngineException previously indicated an unspecified fatal error in the runtime. The runtime no longer raises this exception so this type is obsolete.")]
public sealed partial class ExecutionEngineException : System.SystemException
{
public ExecutionEngineException() { }
public ExecutionEngineException(string? message) { }
public ExecutionEngineException(string? message, System.Exception? innerException) { }
}
public partial class FieldAccessException : System.MemberAccessException
{
public FieldAccessException() { }
protected FieldAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public FieldAccessException(string? message) { }
public FieldAccessException(string? message, System.Exception? inner) { }
}
public partial class FileStyleUriParser : System.UriParser
{
public FileStyleUriParser() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Enum, Inherited=false)]
public partial class FlagsAttribute : System.Attribute
{
public FlagsAttribute() { }
}
public partial class FormatException : System.SystemException
{
public FormatException() { }
protected FormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public FormatException(string? message) { }
public FormatException(string? message, System.Exception? innerException) { }
}
public abstract partial class FormattableString : System.IFormattable
{
protected FormattableString() { }
public abstract int ArgumentCount { get; }
public abstract string Format { get; }
public static string CurrentCulture(System.FormattableString formattable) { throw null; }
public abstract object? GetArgument(int index);
public abstract object?[] GetArguments();
public static string Invariant(System.FormattableString formattable) { throw null; }
string System.IFormattable.ToString(string? ignored, System.IFormatProvider? formatProvider) { throw null; }
public override string ToString() { throw null; }
public abstract string ToString(System.IFormatProvider? formatProvider);
}
public partial class FtpStyleUriParser : System.UriParser
{
public FtpStyleUriParser() { }
}
public delegate TResult Func<out TResult>();
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, in T9, in T10, in T11, in T12, in T13, in T14, in T15, in T16, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13, T14 arg14, T15 arg15, T16 arg16);
public delegate TResult Func<in T, out TResult>(T arg);
public delegate TResult Func<in T1, in T2, out TResult>(T1 arg1, T2 arg2);
public delegate TResult Func<in T1, in T2, in T3, out TResult>(T1 arg1, T2 arg2, T3 arg3);
public delegate TResult Func<in T1, in T2, in T3, in T4, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7);
public delegate TResult Func<in T1, in T2, in T3, in T4, in T5, in T6, in T7, in T8, out TResult>(T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8);
public static partial class GC
{
public static int MaxGeneration { get { throw null; } }
public static void AddMemoryPressure(long bytesAllocated) { }
public static T[] AllocateArray<T>(int length, bool pinned = false) { throw null; }
public static T[] AllocateUninitializedArray<T>(int length, bool pinned = false) { throw null; }
public static void CancelFullGCNotification() { }
public static void Collect() { }
public static void Collect(int generation) { }
public static void Collect(int generation, System.GCCollectionMode mode) { }
public static void Collect(int generation, System.GCCollectionMode mode, bool blocking) { }
public static void Collect(int generation, System.GCCollectionMode mode, bool blocking, bool compacting) { }
public static int CollectionCount(int generation) { throw null; }
public static void EndNoGCRegion() { }
public static long GetAllocatedBytesForCurrentThread() { throw null; }
public static System.GCMemoryInfo GetGCMemoryInfo() { throw null; }
public static System.GCMemoryInfo GetGCMemoryInfo(System.GCKind kind) { throw null; }
public static int GetGeneration(object obj) { throw null; }
public static int GetGeneration(System.WeakReference wo) { throw null; }
public static long GetTotalAllocatedBytes(bool precise = false) { throw null; }
public static long GetTotalMemory(bool forceFullCollection) { throw null; }
public static void KeepAlive(object? obj) { }
public static void RegisterForFullGCNotification(int maxGenerationThreshold, int largeObjectHeapThreshold) { }
public static void RemoveMemoryPressure(long bytesAllocated) { }
public static void ReRegisterForFinalize(object obj) { }
public static void SuppressFinalize(object obj) { }
public static bool TryStartNoGCRegion(long totalSize) { throw null; }
public static bool TryStartNoGCRegion(long totalSize, bool disallowFullBlockingGC) { throw null; }
public static bool TryStartNoGCRegion(long totalSize, long lohSize) { throw null; }
public static bool TryStartNoGCRegion(long totalSize, long lohSize, bool disallowFullBlockingGC) { throw null; }
public static System.GCNotificationStatus WaitForFullGCApproach() { throw null; }
public static System.GCNotificationStatus WaitForFullGCApproach(int millisecondsTimeout) { throw null; }
public static System.GCNotificationStatus WaitForFullGCComplete() { throw null; }
public static System.GCNotificationStatus WaitForFullGCComplete(int millisecondsTimeout) { throw null; }
public static void WaitForPendingFinalizers() { }
}
public enum GCCollectionMode
{
Default = 0,
Forced = 1,
Optimized = 2,
}
public readonly partial struct GCGenerationInfo
{
private readonly int _dummyPrimitive;
public long FragmentationAfterBytes { get { throw null; } }
public long FragmentationBeforeBytes { get { throw null; } }
public long SizeAfterBytes { get { throw null; } }
public long SizeBeforeBytes { get { throw null; } }
}
public enum GCKind
{
Any = 0,
Ephemeral = 1,
FullBlocking = 2,
Background = 3,
}
public readonly partial struct GCMemoryInfo
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool Compacted { get { throw null; } }
public bool Concurrent { get { throw null; } }
public long FinalizationPendingCount { get { throw null; } }
public long FragmentedBytes { get { throw null; } }
public int Generation { get { throw null; } }
public System.ReadOnlySpan<System.GCGenerationInfo> GenerationInfo { get { throw null; } }
public long HeapSizeBytes { get { throw null; } }
public long HighMemoryLoadThresholdBytes { get { throw null; } }
public long Index { get { throw null; } }
public long MemoryLoadBytes { get { throw null; } }
public System.ReadOnlySpan<System.TimeSpan> PauseDurations { get { throw null; } }
public double PauseTimePercentage { get { throw null; } }
public long PinnedObjectsCount { get { throw null; } }
public long PromotedBytes { get { throw null; } }
public long TotalAvailableMemoryBytes { get { throw null; } }
public long TotalCommittedBytes { get { throw null; } }
}
public enum GCNotificationStatus
{
Succeeded = 0,
Failed = 1,
Canceled = 2,
Timeout = 3,
NotApplicable = 4,
}
public partial class GenericUriParser : System.UriParser
{
public GenericUriParser(System.GenericUriParserOptions options) { }
}
[System.FlagsAttribute]
public enum GenericUriParserOptions
{
Default = 0,
GenericAuthority = 1,
AllowEmptyAuthority = 2,
NoUserInfo = 4,
NoPort = 8,
NoQuery = 16,
NoFragment = 32,
DontConvertPathBackslashes = 64,
DontCompressPath = 128,
DontUnescapePathDotsAndSlashes = 256,
Idn = 512,
IriParsing = 1024,
}
public partial class GopherStyleUriParser : System.UriParser
{
public GopherStyleUriParser() { }
}
public readonly partial struct Guid : System.IComparable, System.IComparable<System.Guid>, System.IEquatable<System.Guid>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IComparisonOperators<System.Guid, System.Guid>,
System.ISpanParseable<System.Guid>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.Guid Empty;
public Guid(byte[] b) { throw null; }
public Guid(int a, short b, short c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) { throw null; }
public Guid(int a, short b, short c, byte[] d) { throw null; }
public Guid(System.ReadOnlySpan<byte> b) { throw null; }
public Guid(string g) { throw null; }
[System.CLSCompliantAttribute(false)]
public Guid(uint a, ushort b, ushort c, byte d, byte e, byte f, byte g, byte h, byte i, byte j, byte k) { throw null; }
public int CompareTo(System.Guid value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Guid g) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Guid NewGuid() { throw null; }
public static bool operator ==(System.Guid a, System.Guid b) { throw null; }
public static bool operator !=(System.Guid a, System.Guid b) { throw null; }
public static System.Guid Parse(System.ReadOnlySpan<char> input) { throw null; }
public static System.Guid Parse(string input) { throw null; }
public static System.Guid ParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format) { throw null; }
public static System.Guid ParseExact(string input, string format) { throw null; }
public byte[] ToByteArray() { throw null; }
public override string ToString() { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>)) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, out System.Guid result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, out System.Guid result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format, out System.Guid result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, out System.Guid result) { throw null; }
public bool TryWriteBytes(System.Span<byte> destination) { throw null; }
bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Guid, System.Guid>.operator <(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Guid, System.Guid>.operator <=(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Guid, System.Guid>.operator >(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Guid, System.Guid>.operator >=(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.Guid, System.Guid>.operator ==(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.Guid, System.Guid>.operator !=(System.Guid left, System.Guid right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Guid IParseable<System.Guid>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.Guid>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.Guid result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Guid ISpanParseable<System.Guid>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.Guid>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.Guid result) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct Half : System.IComparable, System.IComparable<System.Half>, System.IEquatable<System.Half>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryFloatingPoint<System.Half>,
System.IMinMaxValue<System.Half>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static System.Half Epsilon { get { throw null; } }
public static System.Half MaxValue { get { throw null; } }
public static System.Half MinValue { get { throw null; } }
public static System.Half NaN { get { throw null; } }
public static System.Half NegativeInfinity { get { throw null; } }
public static System.Half PositiveInfinity { get { throw null; } }
public int CompareTo(System.Half other) { throw null; }
public int CompareTo(object? obj) { throw null; }
public bool Equals(System.Half other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool IsFinite(System.Half value) { throw null; }
public static bool IsInfinity(System.Half value) { throw null; }
public static bool IsNaN(System.Half value) { throw null; }
public static bool IsNegative(System.Half value) { throw null; }
public static bool IsNegativeInfinity(System.Half value) { throw null; }
public static bool IsNormal(System.Half value) { throw null; }
public static bool IsPositiveInfinity(System.Half value) { throw null; }
public static bool IsSubnormal(System.Half value) { throw null; }
public static bool operator ==(System.Half left, System.Half right) { throw null; }
public static explicit operator System.Half (double value) { throw null; }
public static explicit operator double (System.Half value) { throw null; }
public static explicit operator float (System.Half value) { throw null; }
public static explicit operator System.Half (float value) { throw null; }
public static bool operator >(System.Half left, System.Half right) { throw null; }
public static bool operator >=(System.Half left, System.Half right) { throw null; }
public static bool operator !=(System.Half left, System.Half right) { throw null; }
public static bool operator <(System.Half left, System.Half right) { throw null; }
public static bool operator <=(System.Half left, System.Half right) { throw null; }
public static System.Half Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; }
public static System.Half Parse(string s) { throw null; }
public static System.Half Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Half Parse(string s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; }
public static System.Half Parse(string s, System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Half result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Half result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Half result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Half result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IAdditiveIdentity<System.Half, System.Half>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.E { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Epsilon { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.NaN { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.NegativeInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.NegativeZero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Pi { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.PositiveInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Tau { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IMinMaxValue<System.Half>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IMinMaxValue<System.Half>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IMultiplicativeIdentity<System.Half, System.Half>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IAdditionOperators<System.Half, System.Half, System.Half>.operator +(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<System.Half>.IsPow2(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBinaryNumber<System.Half>.Log2(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBitwiseOperators<System.Half, System.Half, System.Half>.operator &(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBitwiseOperators<System.Half, System.Half, System.Half>.operator |(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBitwiseOperators<System.Half, System.Half, System.Half>.operator ^(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IBitwiseOperators<System.Half, System.Half, System.Half>.operator ~(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Half, System.Half>.operator <(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Half, System.Half>.operator <=(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Half, System.Half>.operator >(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.Half, System.Half>.operator >=(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IDecrementOperators<System.Half>.operator --(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IDivisionOperators<System.Half, System.Half, System.Half>.operator /(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.Half, System.Half>.operator ==(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.Half, System.Half>.operator !=(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Acos(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Acosh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Asin(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Asinh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Atan(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Atan2(System.Half y, System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Atanh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.BitIncrement(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.BitDecrement(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Cbrt(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Ceiling(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.CopySign(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Cos(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Cosh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Exp(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Floor(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.FusedMultiplyAdd(System.Half left, System.Half right, System.Half addend) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.IEEERemainder(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static TInteger IFloatingPoint<System.Half>.ILogB<TInteger>(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Log(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Log(System.Half x, System.Half newBase) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Log2(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Log10(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.MaxMagnitude(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.MinMagnitude(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Pow(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Round(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Round<TInteger>(System.Half x, TInteger digits) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Round(System.Half x, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Round<TInteger>(System.Half x, TInteger digits, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.ScaleB<TInteger>(System.Half x, TInteger n) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Sin(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Sinh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Sqrt(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Tan(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Tanh(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IFloatingPoint<System.Half>.Truncate(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsFinite(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsInfinity(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsNaN(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsNegative(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsNegativeInfinity(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsNormal(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsPositiveInfinity(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<System.Half>.IsSubnormal(System.Half x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IIncrementOperators<System.Half>.operator ++(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IModulusOperators<System.Half, System.Half, System.Half>.operator %(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IMultiplyOperators<System.Half, System.Half, System.Half>.operator *(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Abs(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Clamp(System.Half value, System.Half min, System.Half max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (System.Half Quotient, System.Half Remainder) INumber<System.Half>.DivRem(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Max(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Min(System.Half x, System.Half y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half INumber<System.Half>.Sign(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<System.Half>.TryCreate<TOther>(TOther value, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<System.Half>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<System.Half>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IParseable<System.Half>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.Half>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half ISignedNumber<System.Half>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half ISpanParseable<System.Half>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.Half>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.Half result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half ISubtractionOperators<System.Half, System.Half, System.Half>.operator -(System.Half left, System.Half right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IUnaryNegationOperators<System.Half, System.Half>.operator -(System.Half value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.Half IUnaryPlusOperators<System.Half, System.Half>.operator +(System.Half value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial struct HashCode
{
private int _dummyPrimitive;
public void AddBytes(System.ReadOnlySpan<byte> value) { }
public void Add<T>(T value) { }
public void Add<T>(T value, System.Collections.Generic.IEqualityComparer<T>? comparer) { }
public static int Combine<T1>(T1 value1) { throw null; }
public static int Combine<T1, T2>(T1 value1, T2 value2) { throw null; }
public static int Combine<T1, T2, T3>(T1 value1, T2 value2, T3 value3) { throw null; }
public static int Combine<T1, T2, T3, T4>(T1 value1, T2 value2, T3 value3, T4 value4) { throw null; }
public static int Combine<T1, T2, T3, T4, T5>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5) { throw null; }
public static int Combine<T1, T2, T3, T4, T5, T6>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6) { throw null; }
public static int Combine<T1, T2, T3, T4, T5, T6, T7>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7) { throw null; }
public static int Combine<T1, T2, T3, T4, T5, T6, T7, T8>(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("HashCode is a mutable struct and should not be compared with other HashCodes.", true)]
public override bool Equals(object? obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.", true)]
public override int GetHashCode() { throw null; }
public int ToHashCode() { throw null; }
}
public partial class HttpStyleUriParser : System.UriParser
{
public HttpStyleUriParser() { }
}
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IAdditionOperators<TSelf, TOther, TResult>
where TSelf : System.IAdditionOperators<TSelf, TOther, TResult>
{
static abstract TResult operator +(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IAdditiveIdentity<TSelf, TResult>
where TSelf : System.IAdditiveIdentity<TSelf, TResult>
{
static abstract TResult AdditiveIdentity { get; }
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IBinaryFloatingPoint<TSelf> : System.IBinaryNumber<TSelf>, System.IFloatingPoint<TSelf>
where TSelf : IBinaryFloatingPoint<TSelf>
{
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IBinaryInteger<TSelf> : System.IBinaryNumber<TSelf>, System.IShiftOperators<TSelf, TSelf>
where TSelf : IBinaryInteger<TSelf>
{
static abstract TSelf LeadingZeroCount(TSelf value);
static abstract TSelf PopCount(TSelf value);
static abstract TSelf RotateLeft(TSelf value, int rotateAmount);
static abstract TSelf RotateRight(TSelf value, int rotateAmount);
static abstract TSelf TrailingZeroCount(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IBinaryNumber<TSelf> : System.IBitwiseOperators<TSelf, TSelf, TSelf>, System.INumber<TSelf>
where TSelf : IBinaryNumber<TSelf>
{
static abstract bool IsPow2(TSelf value);
static abstract TSelf Log2(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IBitwiseOperators<TSelf, TOther, TResult>
where TSelf : System.IBitwiseOperators<TSelf, TOther, TResult>
{
static abstract TResult operator &(TSelf left, TOther right);
static abstract TResult operator |(TSelf left, TOther right);
static abstract TResult operator ^(TSelf left, TOther right);
static abstract TResult operator ~(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IComparisonOperators<TSelf, TOther> : System.IComparable, System.IComparable<TOther>, System.IEqualityOperators<TSelf, TOther>
where TSelf : IComparisonOperators<TSelf, TOther>
{
static abstract bool operator <(TSelf left, TOther right);
static abstract bool operator <=(TSelf left, TOther right);
static abstract bool operator >(TSelf left, TOther right);
static abstract bool operator >=(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IDecrementOperators<TSelf>
where TSelf : System.IDecrementOperators<TSelf>
{
static abstract TSelf operator --(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IDivisionOperators<TSelf, TOther, TResult>
where TSelf : System.IDivisionOperators<TSelf, TOther, TResult>
{
static abstract TResult operator /(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IEqualityOperators<TSelf, TOther> : IEquatable<TOther>
where TSelf : System.IEqualityOperators<TSelf, TOther>
{
static abstract bool operator ==(TSelf left, TOther right);
static abstract bool operator !=(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IFloatingPoint<TSelf> : System.ISignedNumber<TSelf>
where TSelf : System.IFloatingPoint<TSelf>
{
static abstract TSelf E { get; }
static abstract TSelf Epsilon { get; }
static abstract TSelf NaN { get; }
static abstract TSelf NegativeInfinity { get; }
static abstract TSelf NegativeZero { get; }
static abstract TSelf Pi { get; }
static abstract TSelf PositiveInfinity { get; }
static abstract TSelf Tau { get; }
static abstract TSelf Acos(TSelf x);
static abstract TSelf Acosh(TSelf x);
static abstract TSelf Asin(TSelf x);
static abstract TSelf Asinh(TSelf x);
static abstract TSelf Atan(TSelf x);
static abstract TSelf Atan2(TSelf y, TSelf x);
static abstract TSelf Atanh(TSelf x);
static abstract TSelf BitIncrement(TSelf x);
static abstract TSelf BitDecrement(TSelf x);
static abstract TSelf Cbrt(TSelf x);
static abstract TSelf Ceiling(TSelf x);
static abstract TSelf CopySign(TSelf x, TSelf y);
static abstract TSelf Cos(TSelf x);
static abstract TSelf Cosh(TSelf x);
static abstract TSelf Exp(TSelf x);
static abstract TSelf Floor(TSelf x);
static abstract TSelf FusedMultiplyAdd(TSelf left, TSelf right, TSelf addend);
static abstract TSelf IEEERemainder(TSelf left, TSelf right);
static abstract TInteger ILogB<TInteger>(TSelf x) where TInteger : IBinaryInteger<TInteger>;
static abstract bool IsFinite(TSelf value);
static abstract bool IsInfinity(TSelf value);
static abstract bool IsNaN(TSelf value);
static abstract bool IsNegative(TSelf value);
static abstract bool IsNegativeInfinity(TSelf value);
static abstract bool IsNormal(TSelf value);
static abstract bool IsPositiveInfinity(TSelf value);
static abstract bool IsSubnormal(TSelf value);
static abstract TSelf Log(TSelf x);
static abstract TSelf Log(TSelf x, TSelf newBase);
static abstract TSelf Log2(TSelf x);
static abstract TSelf Log10(TSelf x);
static abstract TSelf MaxMagnitude(TSelf x, TSelf y);
static abstract TSelf MinMagnitude(TSelf x, TSelf y);
static abstract TSelf Pow(TSelf x, TSelf y);
static abstract TSelf Round(TSelf x);
static abstract TSelf Round<TInteger>(TSelf x, TInteger digits) where TInteger : IBinaryInteger<TInteger>;
static abstract TSelf Round(TSelf x, MidpointRounding mode);
static abstract TSelf Round<TInteger>(TSelf x, TInteger digits, MidpointRounding mode) where TInteger : IBinaryInteger<TInteger>;
static abstract TSelf ScaleB<TInteger>(TSelf x, TInteger n) where TInteger : IBinaryInteger<TInteger>;
static abstract TSelf Sin(TSelf x);
static abstract TSelf Sinh(TSelf x);
static abstract TSelf Sqrt(TSelf x);
static abstract TSelf Tan(TSelf x);
static abstract TSelf Tanh(TSelf x);
static abstract TSelf Truncate(TSelf x);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IIncrementOperators<TSelf>
where TSelf : System.IIncrementOperators<TSelf>
{
static abstract TSelf operator ++(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IMinMaxValue<TSelf>
where TSelf : System.IMinMaxValue<TSelf>
{
static abstract TSelf MinValue { get; }
static abstract TSelf MaxValue { get; }
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IModulusOperators<TSelf, TOther, TResult>
where TSelf : System.IModulusOperators<TSelf, TOther, TResult>
{
static abstract TResult operator %(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IMultiplicativeIdentity<TSelf, TResult>
where TSelf : System.IMultiplicativeIdentity<TSelf, TResult>
{
static abstract TResult MultiplicativeIdentity { get; }
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IMultiplyOperators<TSelf, TOther, TResult>
where TSelf : System.IMultiplyOperators<TSelf, TOther, TResult>
{
static abstract TResult operator *(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface INumber<TSelf> : System.IAdditionOperators<TSelf, TSelf, TSelf>, System.IAdditiveIdentity<TSelf, TSelf>, System.IComparable, System.IComparable<TSelf>, System.IComparisonOperators<TSelf, TSelf>, System.IDecrementOperators<TSelf>, System.IDivisionOperators<TSelf, TSelf, TSelf>, System.IEquatable<TSelf>, System.IEqualityOperators<TSelf, TSelf>, System.IFormattable, System.IIncrementOperators<TSelf>, System.IModulusOperators<TSelf, TSelf, TSelf>, System.IMultiplicativeIdentity<TSelf, TSelf>, System.IMultiplyOperators<TSelf, TSelf, TSelf>, System.IParseable<TSelf>, System.ISpanFormattable, System.ISpanParseable<TSelf>, System.ISubtractionOperators<TSelf, TSelf, TSelf>, System.IUnaryNegationOperators<TSelf, TSelf>, System.IUnaryPlusOperators<TSelf, TSelf>
where TSelf : System.INumber<TSelf>
{
static abstract TSelf One { get; }
static abstract TSelf Zero { get; }
static abstract TSelf Abs(TSelf value);
static abstract TSelf Clamp(TSelf value, TSelf min, TSelf max);
static abstract TSelf Create<TOther>(TOther value) where TOther : INumber<TOther>;
static abstract TSelf CreateSaturating<TOther>(TOther value) where TOther : INumber<TOther>;
static abstract TSelf CreateTruncating<TOther>(TOther value) where TOther : INumber<TOther>;
static abstract (TSelf Quotient, TSelf Remainder) DivRem(TSelf left, TSelf right);
static abstract TSelf Max(TSelf x, TSelf y);
static abstract TSelf Min(TSelf x, TSelf y);
static abstract TSelf Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider);
static abstract TSelf Parse(ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider);
static abstract TSelf Sign(TSelf value);
static abstract bool TryCreate<TOther>(TOther value, out TSelf result) where TOther : INumber<TOther>;
static abstract bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out TSelf result);
static abstract bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, IFormatProvider? provider, out TSelf result);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IParseable<TSelf>
where TSelf : System.IParseable<TSelf>
{
static abstract TSelf Parse(string s, System.IFormatProvider? provider);
static abstract bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out TSelf result);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IShiftOperators<TSelf, TResult>
where TSelf : System.IShiftOperators<TSelf, TResult>
{
static abstract TResult operator <<(TSelf value, int shiftAmount);
static abstract TResult operator >>(TSelf value, int shiftAmount);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface ISignedNumber<TSelf> : System.INumber<TSelf>, System.IUnaryNegationOperators<TSelf, TSelf>
where TSelf : System.ISignedNumber<TSelf>
{
static abstract TSelf NegativeOne { get; }
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface ISpanParseable<TSelf> : System.IParseable<TSelf>
where TSelf : System.ISpanParseable<TSelf>
{
static abstract TSelf Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider);
static abstract bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out TSelf result);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface ISubtractionOperators<TSelf, TOther, TResult>
where TSelf : System.ISubtractionOperators<TSelf, TOther, TResult>
{
static abstract TResult operator -(TSelf left, TOther right);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IUnaryNegationOperators<TSelf, TResult>
where TSelf : System.IUnaryNegationOperators<TSelf, TResult>
{
static abstract TResult operator -(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IUnaryPlusOperators<TSelf, TResult>
where TSelf : System.IUnaryPlusOperators<TSelf, TResult>
{
static abstract TResult operator +(TSelf value);
}
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public partial interface IUnsignedNumber<TSelf> : System.INumber<TSelf>
where TSelf : IUnsignedNumber<TSelf>
{
}
#endif // FEATURE_GENERIC_MATH
public partial interface IAsyncDisposable
{
System.Threading.Tasks.ValueTask DisposeAsync();
}
public partial interface IAsyncResult
{
object? AsyncState { get; }
System.Threading.WaitHandle AsyncWaitHandle { get; }
bool CompletedSynchronously { get; }
bool IsCompleted { get; }
}
public partial interface ICloneable
{
object Clone();
}
public partial interface IComparable
{
int CompareTo(object? obj);
}
public partial interface IComparable<in T>
{
int CompareTo(T? other);
}
[System.CLSCompliantAttribute(false)]
public partial interface IConvertible
{
System.TypeCode GetTypeCode();
bool ToBoolean(System.IFormatProvider? provider);
byte ToByte(System.IFormatProvider? provider);
char ToChar(System.IFormatProvider? provider);
System.DateTime ToDateTime(System.IFormatProvider? provider);
decimal ToDecimal(System.IFormatProvider? provider);
double ToDouble(System.IFormatProvider? provider);
short ToInt16(System.IFormatProvider? provider);
int ToInt32(System.IFormatProvider? provider);
long ToInt64(System.IFormatProvider? provider);
sbyte ToSByte(System.IFormatProvider? provider);
float ToSingle(System.IFormatProvider? provider);
string ToString(System.IFormatProvider? provider);
object ToType(System.Type conversionType, System.IFormatProvider? provider);
ushort ToUInt16(System.IFormatProvider? provider);
uint ToUInt32(System.IFormatProvider? provider);
ulong ToUInt64(System.IFormatProvider? provider);
}
public partial interface ICustomFormatter
{
string Format(string? format, object? arg, System.IFormatProvider? formatProvider);
}
public partial interface IDisposable
{
void Dispose();
}
public partial interface IEquatable<T>
{
bool Equals(T? other);
}
public partial interface IFormatProvider
{
object? GetFormat(System.Type? formatType);
}
public partial interface IFormattable
{
string ToString(string? format, System.IFormatProvider? formatProvider);
}
public readonly partial struct Index : System.IEquatable<System.Index>
{
private readonly int _dummyPrimitive;
public Index(int value, bool fromEnd = false) { throw null; }
public static System.Index End { get { throw null; } }
public bool IsFromEnd { get { throw null; } }
public static System.Index Start { get { throw null; } }
public int Value { get { throw null; } }
public bool Equals(System.Index other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static System.Index FromEnd(int value) { throw null; }
public static System.Index FromStart(int value) { throw null; }
public override int GetHashCode() { throw null; }
public int GetOffset(int length) { throw null; }
public static implicit operator System.Index (int value) { throw null; }
public override string ToString() { throw null; }
}
public sealed partial class IndexOutOfRangeException : System.SystemException
{
public IndexOutOfRangeException() { }
public IndexOutOfRangeException(string? message) { }
public IndexOutOfRangeException(string? message, System.Exception? innerException) { }
}
public sealed partial class InsufficientExecutionStackException : System.SystemException
{
public InsufficientExecutionStackException() { }
public InsufficientExecutionStackException(string? message) { }
public InsufficientExecutionStackException(string? message, System.Exception? innerException) { }
}
public sealed partial class InsufficientMemoryException : System.OutOfMemoryException
{
public InsufficientMemoryException() { }
public InsufficientMemoryException(string? message) { }
public InsufficientMemoryException(string? message, System.Exception? innerException) { }
}
public readonly partial struct Int16 : System.IComparable, System.IComparable<short>, System.IConvertible, System.IEquatable<short>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<short>,
System.IMinMaxValue<short>,
System.ISignedNumber<short>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly short _dummyPrimitive;
public const short MaxValue = (short)32767;
public const short MinValue = (short)-32768;
public int CompareTo(System.Int16 value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Int16 obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Int16 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.Int16 Parse(string s) { throw null; }
public static System.Int16 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Int16 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Int16 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
System.Int16 System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int16 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Int16 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int16 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Int16 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IAdditiveIdentity<short, short>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IMinMaxValue<short>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IMinMaxValue<short>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IMultiplicativeIdentity<short, short>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IAdditionOperators<short, short, short>.operator +(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.LeadingZeroCount(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.PopCount(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.RotateLeft(short value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.RotateRight(short value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryInteger<short>.TrailingZeroCount(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<short>.IsPow2(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBinaryNumber<short>.Log2(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBitwiseOperators<short, short, short>.operator &(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBitwiseOperators<short, short, short>.operator |(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBitwiseOperators<short, short, short>.operator ^(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IBitwiseOperators<short, short, short>.operator ~(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<short, short>.operator <(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<short, short>.operator <=(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<short, short>.operator >(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<short, short>.operator >=(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IDecrementOperators<short>.operator --(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IDivisionOperators<short, short, short>.operator /(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<short, short>.operator ==(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<short, short>.operator !=(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IIncrementOperators<short>.operator ++(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IModulusOperators<short, short, short>.operator %(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IMultiplyOperators<short, short, short>.operator *(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Abs(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Clamp(short value, short min, short max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (short Quotient, short Remainder) INumber<short>.DivRem(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Max(short x, short y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Min(short x, short y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short INumber<short>.Sign(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<short>.TryCreate<TOther>(TOther value, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<short>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<short>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IParseable<short>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<short>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IShiftOperators<short, short>.operator <<(short value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IShiftOperators<short, short>.operator >>(short value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short ISignedNumber<short>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short ISpanParseable<short>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<short>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out short result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short ISubtractionOperators<short, short, short>.operator -(short left, short right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IUnaryNegationOperators<short, short>.operator -(short value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static short IUnaryPlusOperators<short, short>.operator +(short value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct Int32 : System.IComparable, System.IComparable<int>, System.IConvertible, System.IEquatable<int>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<int>,
System.IMinMaxValue<int>,
System.ISignedNumber<int>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public const int MaxValue = 2147483647;
public const int MinValue = -2147483648;
public System.Int32 CompareTo(System.Int32 value) { throw null; }
public System.Int32 CompareTo(object? value) { throw null; }
public bool Equals(System.Int32 obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override System.Int32 GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Int32 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.Int32 Parse(string s) { throw null; }
public static System.Int32 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Int32 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Int32 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
System.Int32 System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out System.Int32 charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int32 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Int32 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int32 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Int32 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IAdditiveIdentity<int, int>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IMinMaxValue<int>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IMinMaxValue<int>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IMultiplicativeIdentity<int, int>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IAdditionOperators<int, int, int>.operator +(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.LeadingZeroCount(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.PopCount(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.RotateLeft(int value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.RotateRight(int value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryInteger<int>.TrailingZeroCount(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<int>.IsPow2(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBinaryNumber<int>.Log2(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBitwiseOperators<int, int, int>.operator &(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBitwiseOperators<int, int, int>.operator |(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBitwiseOperators<int, int, int>.operator ^(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IBitwiseOperators<int, int, int>.operator ~(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<int, int>.operator <(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<int, int>.operator <=(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<int, int>.operator >(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<int, int>.operator >=(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IDecrementOperators<int>.operator --(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IDivisionOperators<int, int, int>.operator /(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<int, int>.operator ==(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<int, int>.operator !=(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IIncrementOperators<int>.operator ++(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IModulusOperators<int, int, int>.operator %(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IMultiplyOperators<int, int, int>.operator *(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Abs(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Clamp(int value, int min, int max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (int Quotient, int Remainder) INumber<int>.DivRem(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Max(int x, int y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Min(int x, int y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int INumber<int>.Sign(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<int>.TryCreate<TOther>(TOther value, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<int>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<int>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IParseable<int>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<int>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IShiftOperators<int, int>.operator <<(int value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IShiftOperators<int, int>.operator >>(int value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int ISignedNumber<int>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int ISpanParseable<int>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<int>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out int result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int ISubtractionOperators<int, int, int>.operator -(int left, int right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IUnaryNegationOperators<int, int>.operator -(int value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static int IUnaryPlusOperators<int, int>.operator +(int value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct Int64 : System.IComparable, System.IComparable<long>, System.IConvertible, System.IEquatable<long>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<long>,
System.IMinMaxValue<long>,
System.ISignedNumber<long>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly long _dummyPrimitive;
public const long MaxValue = (long)9223372036854775807;
public const long MinValue = (long)-9223372036854775808;
public int CompareTo(System.Int64 value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.Int64 obj) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.Int64 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.Int64 Parse(string s) { throw null; }
public static System.Int64 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Int64 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Int64 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
System.Int64 System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int64 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Int64 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Int64 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Int64 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IAdditiveIdentity<long, long>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IMinMaxValue<long>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IMinMaxValue<long>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IMultiplicativeIdentity<long, long>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IAdditionOperators<long, long, long>.operator +(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.LeadingZeroCount(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.PopCount(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.RotateLeft(long value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.RotateRight(long value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryInteger<long>.TrailingZeroCount(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<long>.IsPow2(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBinaryNumber<long>.Log2(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBitwiseOperators<long, long, long>.operator &(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBitwiseOperators<long, long, long>.operator |(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBitwiseOperators<long, long, long>.operator ^(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IBitwiseOperators<long, long, long>.operator ~(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<long, long>.operator <(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<long, long>.operator <=(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<long, long>.operator >(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<long, long>.operator >=(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IDecrementOperators<long>.operator --(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IDivisionOperators<long, long, long>.operator /(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<long, long>.operator ==(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<long, long>.operator !=(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IIncrementOperators<long>.operator ++(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IModulusOperators<long, long, long>.operator %(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IMultiplyOperators<long, long, long>.operator *(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Abs(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Clamp(long value, long min, long max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (long Quotient, long Remainder) INumber<long>.DivRem(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Max(long x, long y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Min(long x, long y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long INumber<long>.Sign(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<long>.TryCreate<TOther>(TOther value, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<long>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<long>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IParseable<long>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<long>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IShiftOperators<long, long>.operator <<(long value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IShiftOperators<long, long>.operator >>(long value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long ISignedNumber<long>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long ISpanParseable<long>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<long>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out long result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long ISubtractionOperators<long, long, long>.operator -(long left, long right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IUnaryNegationOperators<long, long>.operator -(long value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static long IUnaryPlusOperators<long, long>.operator +(long value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly partial struct IntPtr : System.IComparable, System.IComparable<nint>, System.IEquatable<nint>, System.ISpanFormattable, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<nint>,
System.IMinMaxValue<nint>,
System.ISignedNumber<nint>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.IntPtr Zero;
public IntPtr(int value) { throw null; }
public IntPtr(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe IntPtr(void* value) { throw null; }
public static System.IntPtr MaxValue { get { throw null; } }
public static System.IntPtr MinValue { get { throw null; } }
public static int Size { get { throw null; } }
public static System.IntPtr Add(System.IntPtr pointer, int offset) { throw null; }
public int CompareTo(System.IntPtr value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.IntPtr other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.IntPtr operator +(System.IntPtr pointer, int offset) { throw null; }
public static bool operator ==(System.IntPtr value1, System.IntPtr value2) { throw null; }
public static explicit operator System.IntPtr (int value) { throw null; }
public static explicit operator System.IntPtr (long value) { throw null; }
public static explicit operator int (System.IntPtr value) { throw null; }
public static explicit operator long (System.IntPtr value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static explicit operator void* (System.IntPtr value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static explicit operator System.IntPtr (void* value) { throw null; }
public static bool operator !=(System.IntPtr value1, System.IntPtr value2) { throw null; }
public static System.IntPtr operator -(System.IntPtr pointer, int offset) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static System.IntPtr Parse(string s) { throw null; }
public static System.IntPtr Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.IntPtr Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.IntPtr Parse(string s, System.IFormatProvider? provider) { throw null; }
public static System.IntPtr Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.IntPtr Subtract(System.IntPtr pointer, int offset) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public int ToInt32() { throw null; }
public long ToInt64() { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe void* ToPointer() { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.IntPtr result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.IntPtr result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.IntPtr result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.IntPtr result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IAdditiveIdentity<nint, nint>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IMinMaxValue<nint>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IMinMaxValue<nint>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IMultiplicativeIdentity<nint, nint>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IAdditionOperators<nint, nint, nint>.operator +(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.LeadingZeroCount(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.PopCount(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.RotateLeft(nint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.RotateRight(nint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryInteger<nint>.TrailingZeroCount(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<nint>.IsPow2(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBinaryNumber<nint>.Log2(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBitwiseOperators<nint, nint, nint>.operator &(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBitwiseOperators<nint, nint, nint>.operator |(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBitwiseOperators<nint, nint, nint>.operator ^(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IBitwiseOperators<nint, nint, nint>.operator ~(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nint, nint>.operator <(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nint, nint>.operator <=(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nint, nint>.operator >(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nint, nint>.operator >=(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IDecrementOperators<nint>.operator --(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IDivisionOperators<nint, nint, nint>.operator /(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<nint, nint>.operator ==(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<nint, nint>.operator !=(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IIncrementOperators<nint>.operator ++(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IModulusOperators<nint, nint, nint>.operator %(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IMultiplyOperators<nint, nint, nint>.operator *(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Abs(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Clamp(nint value, nint min, nint max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (nint Quotient, nint Remainder) INumber<nint>.DivRem(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Max(nint x, nint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Min(nint x, nint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint INumber<nint>.Sign(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nint>.TryCreate<TOther>(TOther value, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nint>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IParseable<nint>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<nint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IShiftOperators<nint, nint>.operator <<(nint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IShiftOperators<nint, nint>.operator >>(nint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint ISignedNumber<nint>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint ISpanParseable<nint>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<nint>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out nint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint ISubtractionOperators<nint, nint, nint>.operator -(nint left, nint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IUnaryNegationOperators<nint, nint>.operator -(nint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nint IUnaryPlusOperators<nint, nint>.operator +(nint value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial class InvalidCastException : System.SystemException
{
public InvalidCastException() { }
protected InvalidCastException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public InvalidCastException(string? message) { }
public InvalidCastException(string? message, System.Exception? innerException) { }
public InvalidCastException(string? message, int errorCode) { }
}
public partial class InvalidOperationException : System.SystemException
{
public InvalidOperationException() { }
protected InvalidOperationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public InvalidOperationException(string? message) { }
public InvalidOperationException(string? message, System.Exception? innerException) { }
}
public sealed partial class InvalidProgramException : System.SystemException
{
public InvalidProgramException() { }
public InvalidProgramException(string? message) { }
public InvalidProgramException(string? message, System.Exception? inner) { }
}
public partial class InvalidTimeZoneException : System.Exception
{
public InvalidTimeZoneException() { }
protected InvalidTimeZoneException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public InvalidTimeZoneException(string? message) { }
public InvalidTimeZoneException(string? message, System.Exception? innerException) { }
}
public partial interface IObservable<out T>
{
System.IDisposable Subscribe(System.IObserver<T> observer);
}
public partial interface IObserver<in T>
{
void OnCompleted();
void OnError(System.Exception error);
void OnNext(T value);
}
public partial interface IProgress<in T>
{
void Report(T value);
}
public partial interface ISpanFormattable : System.IFormattable
{
bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, IFormatProvider? provider);
}
public partial class Lazy<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T>
{
public Lazy() { }
public Lazy(bool isThreadSafe) { }
public Lazy(System.Func<T> valueFactory) { }
public Lazy(System.Func<T> valueFactory, bool isThreadSafe) { }
public Lazy(System.Func<T> valueFactory, System.Threading.LazyThreadSafetyMode mode) { }
public Lazy(System.Threading.LazyThreadSafetyMode mode) { }
public Lazy(T value) { }
public bool IsValueCreated { get { throw null; } }
public T Value { get { throw null; } }
public override string? ToString() { throw null; }
}
public partial class Lazy<[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]T, TMetadata> : System.Lazy<T>
{
public Lazy(System.Func<T> valueFactory, TMetadata metadata) { }
public Lazy(System.Func<T> valueFactory, TMetadata metadata, bool isThreadSafe) { }
public Lazy(System.Func<T> valueFactory, TMetadata metadata, System.Threading.LazyThreadSafetyMode mode) { }
public Lazy(TMetadata metadata) { }
public Lazy(TMetadata metadata, bool isThreadSafe) { }
public Lazy(TMetadata metadata, System.Threading.LazyThreadSafetyMode mode) { }
public TMetadata Metadata { get { throw null; } }
}
public partial class LdapStyleUriParser : System.UriParser
{
public LdapStyleUriParser() { }
}
public enum LoaderOptimization
{
NotSpecified = 0,
SingleDomain = 1,
MultiDomain = 2,
[System.ObsoleteAttribute("LoaderOptimization.DomainMask has been deprecated and is not supported.")]
DomainMask = 3,
MultiDomainHost = 3,
[System.ObsoleteAttribute("LoaderOptimization.DisallowBindings has been deprecated and is not supported.")]
DisallowBindings = 4,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method)]
public sealed partial class LoaderOptimizationAttribute : System.Attribute
{
public LoaderOptimizationAttribute(byte value) { }
public LoaderOptimizationAttribute(System.LoaderOptimization value) { }
public System.LoaderOptimization Value { get { throw null; } }
}
public abstract partial class MarshalByRefObject
{
protected MarshalByRefObject() { }
[System.ObsoleteAttribute("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0010", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public object GetLifetimeService() { throw null; }
[System.ObsoleteAttribute("This Remoting API is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0010", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public virtual object InitializeLifetimeService() { throw null; }
protected System.MarshalByRefObject MemberwiseClone(bool cloneIdentity) { throw null; }
}
public static partial class Math
{
public const double E = 2.718281828459045;
public const double PI = 3.141592653589793;
public const double Tau = 6.283185307179586;
public static decimal Abs(decimal value) { throw null; }
public static double Abs(double value) { throw null; }
public static short Abs(short value) { throw null; }
public static int Abs(int value) { throw null; }
public static long Abs(long value) { throw null; }
public static nint Abs(nint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte Abs(sbyte value) { throw null; }
public static float Abs(float value) { throw null; }
public static double Acos(double d) { throw null; }
public static double Acosh(double d) { throw null; }
public static double Asin(double d) { throw null; }
public static double Asinh(double d) { throw null; }
public static double Atan(double d) { throw null; }
public static double Atan2(double y, double x) { throw null; }
public static double Atanh(double d) { throw null; }
public static long BigMul(int a, int b) { throw null; }
public static long BigMul(long a, long b, out long low) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong BigMul(ulong a, ulong b, out ulong low) { throw null; }
public static double BitDecrement(double x) { throw null; }
public static double BitIncrement(double x) { throw null; }
public static double Cbrt(double d) { throw null; }
public static decimal Ceiling(decimal d) { throw null; }
public static double Ceiling(double a) { throw null; }
public static byte Clamp(byte value, byte min, byte max) { throw null; }
public static decimal Clamp(decimal value, decimal min, decimal max) { throw null; }
public static double Clamp(double value, double min, double max) { throw null; }
public static short Clamp(short value, short min, short max) { throw null; }
public static int Clamp(int value, int min, int max) { throw null; }
public static long Clamp(long value, long min, long max) { throw null; }
public static nint Clamp(nint value, nint min, nint max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte Clamp(sbyte value, sbyte min, sbyte max) { throw null; }
public static float Clamp(float value, float min, float max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort Clamp(ushort value, ushort min, ushort max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint Clamp(uint value, uint min, uint max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong Clamp(ulong value, ulong min, ulong max) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint Clamp(nuint value, nuint min, nuint max) { throw null; }
public static double CopySign(double x, double y) { throw null; }
public static double Cos(double d) { throw null; }
public static double Cosh(double value) { throw null; }
public static int DivRem(int a, int b, out int result) { throw null; }
public static long DivRem(long a, long b, out long result) { throw null; }
public static (byte Quotient, byte Remainder) DivRem(byte left, byte right) { throw null; }
public static (short Quotient, short Remainder) DivRem(short left, short right) { throw null; }
public static (int Quotient, int Remainder) DivRem(int left, int right) { throw null; }
public static (long Quotient, long Remainder) DivRem(long left, long right) { throw null; }
public static (nint Quotient, nint Remainder) DivRem(nint left, nint right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (sbyte Quotient, sbyte Remainder) DivRem(sbyte left, sbyte right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (ushort Quotient, ushort Remainder) DivRem(ushort left, ushort right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (uint Quotient, uint Remainder) DivRem(uint left, uint right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (ulong Quotient, ulong Remainder) DivRem(ulong left, ulong right) { throw null; }
[System.CLSCompliantAttribute(false)]
public static (nuint Quotient, nuint Remainder) DivRem(nuint left, nuint right) { throw null; }
public static double Exp(double d) { throw null; }
public static decimal Floor(decimal d) { throw null; }
public static double Floor(double d) { throw null; }
public static double FusedMultiplyAdd(double x, double y, double z) { throw null; }
public static double IEEERemainder(double x, double y) { throw null; }
public static int ILogB(double x) { throw null; }
public static double Log(double d) { throw null; }
public static double Log(double a, double newBase) { throw null; }
public static double Log10(double d) { throw null; }
public static double Log2(double x) { throw null; }
public static byte Max(byte val1, byte val2) { throw null; }
public static decimal Max(decimal val1, decimal val2) { throw null; }
public static double Max(double val1, double val2) { throw null; }
public static short Max(short val1, short val2) { throw null; }
public static int Max(int val1, int val2) { throw null; }
public static long Max(long val1, long val2) { throw null; }
public static nint Max(nint val1, nint val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte Max(sbyte val1, sbyte val2) { throw null; }
public static float Max(float val1, float val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort Max(ushort val1, ushort val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint Max(uint val1, uint val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong Max(ulong val1, ulong val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint Max(nuint val1, nuint val2) { throw null; }
public static double MaxMagnitude(double x, double y) { throw null; }
public static byte Min(byte val1, byte val2) { throw null; }
public static decimal Min(decimal val1, decimal val2) { throw null; }
public static double Min(double val1, double val2) { throw null; }
public static short Min(short val1, short val2) { throw null; }
public static int Min(int val1, int val2) { throw null; }
public static long Min(long val1, long val2) { throw null; }
public static nint Min(nint val1, nint val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte Min(sbyte val1, sbyte val2) { throw null; }
public static float Min(float val1, float val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort Min(ushort val1, ushort val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint Min(uint val1, uint val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong Min(ulong val1, ulong val2) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint Min(nuint val1, nuint val2) { throw null; }
public static double MinMagnitude(double x, double y) { throw null; }
public static double Pow(double x, double y) { throw null; }
public static double ReciprocalEstimate(double d) { throw null; }
public static double ReciprocalSqrtEstimate(double d) { throw null; }
public static decimal Round(decimal d) { throw null; }
public static decimal Round(decimal d, int decimals) { throw null; }
public static decimal Round(decimal d, int decimals, System.MidpointRounding mode) { throw null; }
public static decimal Round(decimal d, System.MidpointRounding mode) { throw null; }
public static double Round(double a) { throw null; }
public static double Round(double value, int digits) { throw null; }
public static double Round(double value, int digits, System.MidpointRounding mode) { throw null; }
public static double Round(double value, System.MidpointRounding mode) { throw null; }
public static double ScaleB(double x, int n) { throw null; }
public static int Sign(decimal value) { throw null; }
public static int Sign(double value) { throw null; }
public static int Sign(short value) { throw null; }
public static int Sign(int value) { throw null; }
public static int Sign(long value) { throw null; }
public static int Sign(nint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int Sign(sbyte value) { throw null; }
public static int Sign(float value) { throw null; }
public static double Sin(double a) { throw null; }
public static (double Sin, double Cos) SinCos(double x) { throw null; }
public static double Sinh(double value) { throw null; }
public static double Sqrt(double d) { throw null; }
public static double Tan(double a) { throw null; }
public static double Tanh(double value) { throw null; }
public static decimal Truncate(decimal d) { throw null; }
public static double Truncate(double d) { throw null; }
}
public static partial class MathF
{
public const float E = 2.7182817f;
public const float PI = 3.1415927f;
public const float Tau = 6.2831855f;
public static float Abs(float x) { throw null; }
public static float Acos(float x) { throw null; }
public static float Acosh(float x) { throw null; }
public static float Asin(float x) { throw null; }
public static float Asinh(float x) { throw null; }
public static float Atan(float x) { throw null; }
public static float Atan2(float y, float x) { throw null; }
public static float Atanh(float x) { throw null; }
public static float BitDecrement(float x) { throw null; }
public static float BitIncrement(float x) { throw null; }
public static float Cbrt(float x) { throw null; }
public static float Ceiling(float x) { throw null; }
public static float CopySign(float x, float y) { throw null; }
public static float Cos(float x) { throw null; }
public static float Cosh(float x) { throw null; }
public static float Exp(float x) { throw null; }
public static float Floor(float x) { throw null; }
public static float FusedMultiplyAdd(float x, float y, float z) { throw null; }
public static float IEEERemainder(float x, float y) { throw null; }
public static int ILogB(float x) { throw null; }
public static float Log(float x) { throw null; }
public static float Log(float x, float y) { throw null; }
public static float Log10(float x) { throw null; }
public static float Log2(float x) { throw null; }
public static float Max(float x, float y) { throw null; }
public static float MaxMagnitude(float x, float y) { throw null; }
public static float Min(float x, float y) { throw null; }
public static float MinMagnitude(float x, float y) { throw null; }
public static float Pow(float x, float y) { throw null; }
public static float ReciprocalEstimate(float x) { throw null; }
public static float ReciprocalSqrtEstimate(float x) { throw null; }
public static float Round(float x) { throw null; }
public static float Round(float x, int digits) { throw null; }
public static float Round(float x, int digits, System.MidpointRounding mode) { throw null; }
public static float Round(float x, System.MidpointRounding mode) { throw null; }
public static float ScaleB(float x, int n) { throw null; }
public static int Sign(float x) { throw null; }
public static float Sin(float x) { throw null; }
public static (float Sin, float Cos) SinCos(float x) { throw null; }
public static float Sinh(float x) { throw null; }
public static float Sqrt(float x) { throw null; }
public static float Tan(float x) { throw null; }
public static float Tanh(float x) { throw null; }
public static float Truncate(float x) { throw null; }
}
public partial class MemberAccessException : System.SystemException
{
public MemberAccessException() { }
protected MemberAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MemberAccessException(string? message) { }
public MemberAccessException(string? message, System.Exception? inner) { }
}
public readonly partial struct Memory<T> : System.IEquatable<System.Memory<T>>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public Memory(T[]? array) { throw null; }
public Memory(T[]? array, int start, int length) { throw null; }
public static System.Memory<T> Empty { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public int Length { get { throw null; } }
public System.Span<T> Span { get { throw null; } }
public void CopyTo(System.Memory<T> destination) { }
public bool Equals(System.Memory<T> other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static implicit operator System.Memory<T> (System.ArraySegment<T> segment) { throw null; }
public static implicit operator System.ReadOnlyMemory<T> (System.Memory<T> memory) { throw null; }
public static implicit operator System.Memory<T> (T[]? array) { throw null; }
public System.Buffers.MemoryHandle Pin() { throw null; }
public System.Memory<T> Slice(int start) { throw null; }
public System.Memory<T> Slice(int start, int length) { throw null; }
public T[] ToArray() { throw null; }
public override string ToString() { throw null; }
public bool TryCopyTo(System.Memory<T> destination) { throw null; }
}
public partial class MethodAccessException : System.MemberAccessException
{
public MethodAccessException() { }
protected MethodAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MethodAccessException(string? message) { }
public MethodAccessException(string? message, System.Exception? inner) { }
}
public enum MidpointRounding
{
ToEven = 0,
AwayFromZero = 1,
ToZero = 2,
ToNegativeInfinity = 3,
ToPositiveInfinity = 4,
}
public partial class MissingFieldException : System.MissingMemberException, System.Runtime.Serialization.ISerializable
{
public MissingFieldException() { }
protected MissingFieldException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingFieldException(string? message) { }
public MissingFieldException(string? message, System.Exception? inner) { }
public MissingFieldException(string? className, string? fieldName) { }
public override string Message { get { throw null; } }
}
public partial class MissingMemberException : System.MemberAccessException, System.Runtime.Serialization.ISerializable
{
protected string? ClassName;
protected string? MemberName;
protected byte[]? Signature;
public MissingMemberException() { }
protected MissingMemberException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingMemberException(string? message) { }
public MissingMemberException(string? message, System.Exception? inner) { }
public MissingMemberException(string? className, string? memberName) { }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class MissingMethodException : System.MissingMemberException
{
public MissingMethodException() { }
protected MissingMethodException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingMethodException(string? message) { }
public MissingMethodException(string? message, System.Exception? inner) { }
public MissingMethodException(string? className, string? methodName) { }
public override string Message { get { throw null; } }
}
public partial struct ModuleHandle : System.IEquatable<System.ModuleHandle>
{
private object _dummy;
private int _dummyPrimitive;
public static readonly System.ModuleHandle EmptyHandle;
public int MDStreamVersion { get { throw null; } }
public bool Equals(System.ModuleHandle handle) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeFieldHandle GetRuntimeFieldHandleFromMetadataToken(int fieldToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeMethodHandle GetRuntimeMethodHandleFromMetadataToken(int methodToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeTypeHandle GetRuntimeTypeHandleFromMetadataToken(int typeToken) { throw null; }
public static bool operator ==(System.ModuleHandle left, System.ModuleHandle right) { throw null; }
public static bool operator !=(System.ModuleHandle left, System.ModuleHandle right) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeFieldHandle ResolveFieldHandle(int fieldToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeFieldHandle ResolveFieldHandle(int fieldToken, System.RuntimeTypeHandle[]? typeInstantiationContext, System.RuntimeTypeHandle[]? methodInstantiationContext) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeMethodHandle ResolveMethodHandle(int methodToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeMethodHandle ResolveMethodHandle(int methodToken, System.RuntimeTypeHandle[]? typeInstantiationContext, System.RuntimeTypeHandle[]? methodInstantiationContext) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeTypeHandle ResolveTypeHandle(int typeToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.RuntimeTypeHandle ResolveTypeHandle(int typeToken, System.RuntimeTypeHandle[]? typeInstantiationContext, System.RuntimeTypeHandle[]? methodInstantiationContext) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method)]
public sealed partial class MTAThreadAttribute : System.Attribute
{
public MTAThreadAttribute() { }
}
public abstract partial class MulticastDelegate : System.Delegate
{
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The target method might be removed")]
protected MulticastDelegate(object target, string method) : base (default(object), default(string)) { }
protected MulticastDelegate([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type target, string method) : base (default(object), default(string)) { }
protected sealed override System.Delegate CombineImpl(System.Delegate? follow) { throw null; }
public sealed override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public sealed override int GetHashCode() { throw null; }
public sealed override System.Delegate[] GetInvocationList() { throw null; }
protected override System.Reflection.MethodInfo GetMethodImpl() { throw null; }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(System.MulticastDelegate? d1, System.MulticastDelegate? d2) { throw null; }
public static bool operator !=(System.MulticastDelegate? d1, System.MulticastDelegate? d2) { throw null; }
protected sealed override System.Delegate? RemoveImpl(System.Delegate value) { throw null; }
}
public sealed partial class MulticastNotSupportedException : System.SystemException
{
public MulticastNotSupportedException() { }
public MulticastNotSupportedException(string? message) { }
public MulticastNotSupportedException(string? message, System.Exception? inner) { }
}
public partial class NetPipeStyleUriParser : System.UriParser
{
public NetPipeStyleUriParser() { }
}
public partial class NetTcpStyleUriParser : System.UriParser
{
public NetTcpStyleUriParser() { }
}
public partial class NewsStyleUriParser : System.UriParser
{
public NewsStyleUriParser() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public sealed partial class NonSerializedAttribute : System.Attribute
{
public NonSerializedAttribute() { }
}
public partial class NotFiniteNumberException : System.ArithmeticException
{
public NotFiniteNumberException() { }
public NotFiniteNumberException(double offendingNumber) { }
protected NotFiniteNumberException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public NotFiniteNumberException(string? message) { }
public NotFiniteNumberException(string? message, double offendingNumber) { }
public NotFiniteNumberException(string? message, double offendingNumber, System.Exception? innerException) { }
public NotFiniteNumberException(string? message, System.Exception? innerException) { }
public double OffendingNumber { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class NotImplementedException : System.SystemException
{
public NotImplementedException() { }
protected NotImplementedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public NotImplementedException(string? message) { }
public NotImplementedException(string? message, System.Exception? inner) { }
}
public partial class NotSupportedException : System.SystemException
{
public NotSupportedException() { }
protected NotSupportedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public NotSupportedException(string? message) { }
public NotSupportedException(string? message, System.Exception? innerException) { }
}
public static partial class Nullable
{
public static int Compare<T>(T? n1, T? n2) where T : struct { throw null; }
public static bool Equals<T>(T? n1, T? n2) where T : struct { throw null; }
public static System.Type? GetUnderlyingType(System.Type nullableType) { throw null; }
public static ref readonly T GetValueRefOrDefaultRef<T>(in T? nullable) where T : struct { throw null; }
}
public partial struct Nullable<T> where T : struct
{
private T value;
private int _dummyPrimitive;
public Nullable(T value) { throw null; }
public readonly bool HasValue { get { throw null; } }
public readonly T Value { get { throw null; } }
public override bool Equals(object? other) { throw null; }
public override int GetHashCode() { throw null; }
public readonly T GetValueOrDefault() { throw null; }
public readonly T GetValueOrDefault(T defaultValue) { throw null; }
public static explicit operator T (T? value) { throw null; }
public static implicit operator T? (T value) { throw null; }
public override string? ToString() { throw null; }
}
public partial class NullReferenceException : System.SystemException
{
public NullReferenceException() { }
protected NullReferenceException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public NullReferenceException(string? message) { }
public NullReferenceException(string? message, System.Exception? innerException) { }
}
public partial class Object
{
public Object() { }
public virtual bool Equals(System.Object? obj) { throw null; }
public static bool Equals(System.Object? objA, System.Object? objB) { throw null; }
~Object() { }
public virtual int GetHashCode() { throw null; }
public System.Type GetType() { throw null; }
protected System.Object MemberwiseClone() { throw null; }
public static bool ReferenceEquals(System.Object? objA, System.Object? objB) { throw null; }
public virtual string? ToString() { throw null; }
}
public partial class ObjectDisposedException : System.InvalidOperationException
{
protected ObjectDisposedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ObjectDisposedException(string? objectName) { }
public ObjectDisposedException(string? message, System.Exception? innerException) { }
public ObjectDisposedException(string? objectName, string? message) { }
public override string Message { get { throw null; } }
public string ObjectName { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static void ThrowIf([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(true)] bool condition, object instance) => throw null;
public static void ThrowIf([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(true)] bool condition, System.Type type) => throw null;
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class ObsoleteAttribute : System.Attribute
{
public ObsoleteAttribute() { }
public ObsoleteAttribute(string? message) { }
public ObsoleteAttribute(string? message, bool error) { }
public string? DiagnosticId { get { throw null; } set { } }
public bool IsError { get { throw null; } }
public string? Message { get { throw null; } }
public string? UrlFormat { get { throw null; } set { } }
}
public sealed partial class OperatingSystem : System.ICloneable, System.Runtime.Serialization.ISerializable
{
public OperatingSystem(System.PlatformID platform, System.Version version) { }
public System.PlatformID Platform { get { throw null; } }
public string ServicePack { get { throw null; } }
public System.Version Version { get { throw null; } }
public string VersionString { get { throw null; } }
public object Clone() { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool IsAndroid() { throw null; }
public static bool IsAndroidVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0) { throw null; }
public static bool IsBrowser() { throw null; }
public static bool IsFreeBSD() { throw null; }
public static bool IsFreeBSDVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformGuardAttribute("maccatalyst")]
public static bool IsIOS() { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformGuardAttribute("maccatalyst")]
public static bool IsIOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsLinux() { throw null; }
public static bool IsMacCatalyst() { throw null; }
public static bool IsMacCatalystVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsMacOS() { throw null; }
public static bool IsMacOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsOSPlatform(string platform) { throw null; }
public static bool IsOSPlatformVersionAtLeast(string platform, int major, int minor = 0, int build = 0, int revision = 0) { throw null; }
public static bool IsTvOS() { throw null; }
public static bool IsTvOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsWatchOS() { throw null; }
public static bool IsWatchOSVersionAtLeast(int major, int minor = 0, int build = 0) { throw null; }
public static bool IsWindows() { throw null; }
public static bool IsWindowsVersionAtLeast(int major, int minor = 0, int build = 0, int revision = 0) { throw null; }
public override string ToString() { throw null; }
}
public partial class OperationCanceledException : System.SystemException
{
public OperationCanceledException() { }
protected OperationCanceledException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public OperationCanceledException(string? message) { }
public OperationCanceledException(string? message, System.Exception? innerException) { }
public OperationCanceledException(string? message, System.Exception? innerException, System.Threading.CancellationToken token) { }
public OperationCanceledException(string? message, System.Threading.CancellationToken token) { }
public OperationCanceledException(System.Threading.CancellationToken token) { }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
}
public partial class OutOfMemoryException : System.SystemException
{
public OutOfMemoryException() { }
protected OutOfMemoryException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public OutOfMemoryException(string? message) { }
public OutOfMemoryException(string? message, System.Exception? innerException) { }
}
public partial class OverflowException : System.ArithmeticException
{
public OverflowException() { }
protected OverflowException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public OverflowException(string? message) { }
public OverflowException(string? message, System.Exception? innerException) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=true, AllowMultiple=false)]
public sealed partial class ParamArrayAttribute : System.Attribute
{
public ParamArrayAttribute() { }
}
public enum PlatformID
{
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Win32S = 0,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Win32Windows = 1,
Win32NT = 2,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
WinCE = 3,
Unix = 4,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Xbox = 5,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
MacOSX = 6,
Other = 7,
}
public partial class PlatformNotSupportedException : System.NotSupportedException
{
public PlatformNotSupportedException() { }
protected PlatformNotSupportedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public PlatformNotSupportedException(string? message) { }
public PlatformNotSupportedException(string? message, System.Exception? inner) { }
}
public delegate bool Predicate<in T>(T obj);
public partial class Progress<T> : System.IProgress<T>
{
public Progress() { }
public Progress(System.Action<T> handler) { }
public event System.EventHandler<T>? ProgressChanged { add { } remove { } }
protected virtual void OnReport(T value) { }
void System.IProgress<T>.Report(T value) { }
}
public partial class Random
{
public Random() { }
public Random(int Seed) { }
public static System.Random Shared { get { throw null; } }
public virtual int Next() { throw null; }
public virtual int Next(int maxValue) { throw null; }
public virtual int Next(int minValue, int maxValue) { throw null; }
public virtual void NextBytes(byte[] buffer) { }
public virtual void NextBytes(System.Span<byte> buffer) { }
public virtual double NextDouble() { throw null; }
public virtual long NextInt64() { throw null; }
public virtual long NextInt64(long maxValue) { throw null; }
public virtual long NextInt64(long minValue, long maxValue) { throw null; }
public virtual float NextSingle() { throw null; }
protected virtual double Sample() { throw null; }
}
public readonly partial struct Range : System.IEquatable<System.Range>
{
private readonly int _dummyPrimitive;
public Range(System.Index start, System.Index end) { throw null; }
public static System.Range All { get { throw null; } }
public System.Index End { get { throw null; } }
public System.Index Start { get { throw null; } }
public static System.Range EndAt(System.Index end) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public bool Equals(System.Range other) { throw null; }
public override int GetHashCode() { throw null; }
public (int Offset, int Length) GetOffsetAndLength(int length) { throw null; }
public static System.Range StartAt(System.Index start) { throw null; }
public override string ToString() { throw null; }
}
public partial class RankException : System.SystemException
{
public RankException() { }
protected RankException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public RankException(string? message) { }
public RankException(string? message, System.Exception? innerException) { }
}
public readonly partial struct ReadOnlyMemory<T> : System.IEquatable<System.ReadOnlyMemory<T>>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ReadOnlyMemory(T[]? array) { throw null; }
public ReadOnlyMemory(T[]? array, int start, int length) { throw null; }
public static System.ReadOnlyMemory<T> Empty { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public int Length { get { throw null; } }
public System.ReadOnlySpan<T> Span { get { throw null; } }
public void CopyTo(System.Memory<T> destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.ReadOnlyMemory<T> other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static implicit operator System.ReadOnlyMemory<T> (System.ArraySegment<T> segment) { throw null; }
public static implicit operator System.ReadOnlyMemory<T> (T[]? array) { throw null; }
public System.Buffers.MemoryHandle Pin() { throw null; }
public System.ReadOnlyMemory<T> Slice(int start) { throw null; }
public System.ReadOnlyMemory<T> Slice(int start, int length) { throw null; }
public T[] ToArray() { throw null; }
public override string ToString() { throw null; }
public bool TryCopyTo(System.Memory<T> destination) { throw null; }
}
public readonly ref partial struct ReadOnlySpan<T>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
[System.CLSCompliantAttribute(false)]
public unsafe ReadOnlySpan(void* pointer, int length) { throw null; }
public ReadOnlySpan(T[]? array) { throw null; }
public ReadOnlySpan(T[]? array, int start, int length) { throw null; }
public static System.ReadOnlySpan<T> Empty { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public ref readonly T this[int index] { get { throw null; } }
public int Length { get { throw null; } }
public void CopyTo(System.Span<T> destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Equals() on ReadOnlySpan will always throw an exception. Use the equality operator instead.")]
public override bool Equals(object? obj) { throw null; }
public System.ReadOnlySpan<T>.Enumerator GetEnumerator() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("GetHashCode() on ReadOnlySpan will always throw an exception.")]
public override int GetHashCode() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public ref readonly T GetPinnableReference() { throw null; }
public static bool operator ==(System.ReadOnlySpan<T> left, System.ReadOnlySpan<T> right) { throw null; }
public static implicit operator System.ReadOnlySpan<T> (System.ArraySegment<T> segment) { throw null; }
public static implicit operator System.ReadOnlySpan<T> (T[]? array) { throw null; }
public static bool operator !=(System.ReadOnlySpan<T> left, System.ReadOnlySpan<T> right) { throw null; }
public System.ReadOnlySpan<T> Slice(int start) { throw null; }
public System.ReadOnlySpan<T> Slice(int start, int length) { throw null; }
public T[] ToArray() { throw null; }
public override string ToString() { throw null; }
public bool TryCopyTo(System.Span<T> destination) { throw null; }
public ref partial struct Enumerator
{
private object _dummy;
private int _dummyPrimitive;
public ref readonly T Current { get { throw null; } }
public bool MoveNext() { throw null; }
}
}
public partial class ResolveEventArgs : System.EventArgs
{
public ResolveEventArgs(string name) { }
public ResolveEventArgs(string name, System.Reflection.Assembly? requestingAssembly) { }
public string Name { get { throw null; } }
public System.Reflection.Assembly? RequestingAssembly { get { throw null; } }
}
public delegate System.Reflection.Assembly? ResolveEventHandler(object? sender, System.ResolveEventArgs args);
public ref partial struct RuntimeArgumentHandle
{
private int _dummyPrimitive;
}
public partial struct RuntimeFieldHandle : System.IEquatable<System.RuntimeFieldHandle>, System.Runtime.Serialization.ISerializable
{
private object _dummy;
private int _dummyPrimitive;
public System.IntPtr Value { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public bool Equals(System.RuntimeFieldHandle handle) { throw null; }
public override int GetHashCode() { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(System.RuntimeFieldHandle left, System.RuntimeFieldHandle right) { throw null; }
public static bool operator !=(System.RuntimeFieldHandle left, System.RuntimeFieldHandle right) { throw null; }
}
public partial struct RuntimeMethodHandle : System.IEquatable<System.RuntimeMethodHandle>, System.Runtime.Serialization.ISerializable
{
private object _dummy;
private int _dummyPrimitive;
public System.IntPtr Value { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public bool Equals(System.RuntimeMethodHandle handle) { throw null; }
public System.IntPtr GetFunctionPointer() { throw null; }
public override int GetHashCode() { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(System.RuntimeMethodHandle left, System.RuntimeMethodHandle right) { throw null; }
public static bool operator !=(System.RuntimeMethodHandle left, System.RuntimeMethodHandle right) { throw null; }
}
public partial struct RuntimeTypeHandle : System.IEquatable<System.RuntimeTypeHandle>, System.Runtime.Serialization.ISerializable
{
private object _dummy;
private int _dummyPrimitive;
public System.IntPtr Value { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public bool Equals(System.RuntimeTypeHandle handle) { throw null; }
public override int GetHashCode() { throw null; }
public System.ModuleHandle GetModuleHandle() { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public static bool operator ==(object? left, System.RuntimeTypeHandle right) { throw null; }
public static bool operator ==(System.RuntimeTypeHandle left, object? right) { throw null; }
public static bool operator !=(object? left, System.RuntimeTypeHandle right) { throw null; }
public static bool operator !=(System.RuntimeTypeHandle left, object? right) { throw null; }
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct SByte : System.IComparable, System.IComparable<sbyte>, System.IConvertible, System.IEquatable<sbyte>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<sbyte>,
System.IMinMaxValue<sbyte>,
System.ISignedNumber<sbyte>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly sbyte _dummyPrimitive;
public const sbyte MaxValue = (sbyte)127;
public const sbyte MinValue = (sbyte)-128;
public int CompareTo(object? obj) { throw null; }
public int CompareTo(System.SByte value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.SByte obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.SByte Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.SByte Parse(string s) { throw null; }
public static System.SByte Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.SByte Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.SByte Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
System.SByte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.SByte result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.SByte result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.SByte result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.SByte result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IAdditiveIdentity<sbyte, sbyte>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IMinMaxValue<sbyte>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IMinMaxValue<sbyte>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IMultiplicativeIdentity<sbyte, sbyte>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IAdditionOperators<sbyte, sbyte, sbyte>.operator +(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.LeadingZeroCount(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.PopCount(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.RotateLeft(sbyte value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.RotateRight(sbyte value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryInteger<sbyte>.TrailingZeroCount(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<sbyte>.IsPow2(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBinaryNumber<sbyte>.Log2(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBitwiseOperators<sbyte, sbyte, sbyte>.operator &(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBitwiseOperators<sbyte, sbyte, sbyte>.operator |(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBitwiseOperators<sbyte, sbyte, sbyte>.operator ^(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IBitwiseOperators<sbyte, sbyte, sbyte>.operator ~(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<sbyte, sbyte>.operator <(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<sbyte, sbyte>.operator <=(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<sbyte, sbyte>.operator >(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<sbyte, sbyte>.operator >=(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IDecrementOperators<sbyte>.operator --(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IDivisionOperators<sbyte, sbyte, sbyte>.operator /(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<sbyte, sbyte>.operator ==(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<sbyte, sbyte>.operator !=(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IIncrementOperators<sbyte>.operator ++(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IModulusOperators<sbyte, sbyte, sbyte>.operator %(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IMultiplyOperators<sbyte, sbyte, sbyte>.operator *(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Abs(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Clamp(sbyte value, sbyte min, sbyte max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (sbyte Quotient, sbyte Remainder) INumber<sbyte>.DivRem(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Max(sbyte x, sbyte y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Min(sbyte x, sbyte y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte INumber<sbyte>.Sign(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<sbyte>.TryCreate<TOther>(TOther value, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<sbyte>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<sbyte>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IParseable<sbyte>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<sbyte>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IShiftOperators<sbyte, sbyte>.operator <<(sbyte value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IShiftOperators<sbyte, sbyte>.operator >>(sbyte value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte ISignedNumber<sbyte>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte ISpanParseable<sbyte>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<sbyte>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out sbyte result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte ISubtractionOperators<sbyte, sbyte, sbyte>.operator -(sbyte left, sbyte right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IUnaryNegationOperators<sbyte, sbyte>.operator -(sbyte value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static sbyte IUnaryPlusOperators<sbyte, sbyte>.operator +(sbyte value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class SerializableAttribute : System.Attribute
{
public SerializableAttribute() { }
}
public readonly partial struct Single : System.IComparable, System.IComparable<float>, System.IConvertible, System.IEquatable<float>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryFloatingPoint<float>,
System.IMinMaxValue<float>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly float _dummyPrimitive;
public const float Epsilon = 1E-45f;
public const float MaxValue = 3.4028235E+38f;
public const float MinValue = -3.4028235E+38f;
public const float NaN = 0.0f / 0.0f;
public const float NegativeInfinity = -1.0f / 0.0f;
public const float PositiveInfinity = 1.0f / 0.0f;
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.Single value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Single obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static bool IsFinite(System.Single f) { throw null; }
public static bool IsInfinity(System.Single f) { throw null; }
public static bool IsNaN(System.Single f) { throw null; }
public static bool IsNegative(System.Single f) { throw null; }
public static bool IsNegativeInfinity(System.Single f) { throw null; }
public static bool IsNormal(System.Single f) { throw null; }
public static bool IsPositiveInfinity(System.Single f) { throw null; }
public static bool IsSubnormal(System.Single f) { throw null; }
public static bool operator ==(System.Single left, System.Single right) { throw null; }
public static bool operator >(System.Single left, System.Single right) { throw null; }
public static bool operator >=(System.Single left, System.Single right) { throw null; }
public static bool operator !=(System.Single left, System.Single right) { throw null; }
public static bool operator <(System.Single left, System.Single right) { throw null; }
public static bool operator <=(System.Single left, System.Single right) { throw null; }
public static System.Single Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.AllowDecimalPoint | System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowLeadingSign | System.Globalization.NumberStyles.AllowLeadingWhite | System.Globalization.NumberStyles.AllowThousands | System.Globalization.NumberStyles.AllowTrailingWhite, System.IFormatProvider? provider = null) { throw null; }
public static System.Single Parse(string s) { throw null; }
public static System.Single Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.Single Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.Single Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
System.Single System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Single result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.Single result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.Single result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.Single result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IAdditiveIdentity<float, float>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.E { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Epsilon { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.NaN { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.NegativeInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.NegativeZero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Pi { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.PositiveInfinity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Tau { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IMinMaxValue<float>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IMinMaxValue<float>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IMultiplicativeIdentity<float, float>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IAdditionOperators<float, float, float>.operator +(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<float>.IsPow2(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBinaryNumber<float>.Log2(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBitwiseOperators<float, float, float>.operator &(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBitwiseOperators<float, float, float>.operator |(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBitwiseOperators<float, float, float>.operator ^(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IBitwiseOperators<float, float, float>.operator ~(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<float, float>.operator <(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<float, float>.operator <=(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<float, float>.operator >(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<float, float>.operator >=(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IDecrementOperators<float>.operator --(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IDivisionOperators<float, float, float>.operator /(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<float, float>.operator ==(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<float, float>.operator !=(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Acos(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Acosh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Asin(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Asinh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Atan(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Atan2(float y, float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Atanh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.BitIncrement(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.BitDecrement(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Cbrt(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Ceiling(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.CopySign(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Cos(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Cosh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Exp(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Floor(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.FusedMultiplyAdd(float left, float right, float addend) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.IEEERemainder(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static TInteger IFloatingPoint<float>.ILogB<TInteger>(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Log(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Log(float x, float newBase) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Log2(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Log10(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.MaxMagnitude(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.MinMagnitude(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Pow(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Round(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Round<TInteger>(float x, TInteger digits) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Round(float x, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Round<TInteger>(float x, TInteger digits, System.MidpointRounding mode) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.ScaleB<TInteger>(float x, TInteger n) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Sin(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Sinh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Sqrt(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Tan(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Tanh(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IFloatingPoint<float>.Truncate(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsFinite(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsInfinity(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsNaN(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsNegative(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsNegativeInfinity(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsNormal(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsPositiveInfinity(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IFloatingPoint<float>.IsSubnormal(float x) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IIncrementOperators<float>.operator ++(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IModulusOperators<float, float, float>.operator %(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IMultiplyOperators<float, float, float>.operator *(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Abs(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Clamp(float value, float min, float max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (float Quotient, float Remainder) INumber<float>.DivRem(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Max(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Min(float x, float y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float INumber<float>.Sign(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<float>.TryCreate<TOther>(TOther value, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<float>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<float>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IParseable<float>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<float>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float ISignedNumber<float>.NegativeOne { get; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float ISpanParseable<float>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<float>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out float result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float ISubtractionOperators<float, float, float>.operator -(float left, float right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IUnaryNegationOperators<float, float>.operator -(float value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static float IUnaryPlusOperators<float, float>.operator +(float value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public readonly ref partial struct Span<T>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
[System.CLSCompliantAttribute(false)]
public unsafe Span(void* pointer, int length) { throw null; }
public Span(T[]? array) { throw null; }
public Span(T[]? array, int start, int length) { throw null; }
public static System.Span<T> Empty { get { throw null; } }
public bool IsEmpty { get { throw null; } }
public ref T this[int index] { get { throw null; } }
public int Length { get { throw null; } }
public void Clear() { }
public void CopyTo(System.Span<T> destination) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Equals() on Span will always throw an exception. Use the equality operator instead.")]
public override bool Equals(object? obj) { throw null; }
public void Fill(T value) { }
public System.Span<T>.Enumerator GetEnumerator() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("GetHashCode() on Span will always throw an exception.")]
public override int GetHashCode() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public ref T GetPinnableReference() { throw null; }
public static bool operator ==(System.Span<T> left, System.Span<T> right) { throw null; }
public static implicit operator System.Span<T> (System.ArraySegment<T> segment) { throw null; }
public static implicit operator System.ReadOnlySpan<T> (System.Span<T> span) { throw null; }
public static implicit operator System.Span<T> (T[]? array) { throw null; }
public static bool operator !=(System.Span<T> left, System.Span<T> right) { throw null; }
public System.Span<T> Slice(int start) { throw null; }
public System.Span<T> Slice(int start, int length) { throw null; }
public T[] ToArray() { throw null; }
public override string ToString() { throw null; }
public bool TryCopyTo(System.Span<T> destination) { throw null; }
public ref partial struct Enumerator
{
private object _dummy;
private int _dummyPrimitive;
public ref T Current { get { throw null; } }
public bool MoveNext() { throw null; }
}
}
public sealed partial class StackOverflowException : System.SystemException
{
public StackOverflowException() { }
public StackOverflowException(string? message) { }
public StackOverflowException(string? message, System.Exception? innerException) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method)]
public sealed partial class STAThreadAttribute : System.Attribute
{
public STAThreadAttribute() { }
}
public sealed partial class String : System.Collections.Generic.IEnumerable<char>, System.Collections.IEnumerable, System.ICloneable, System.IComparable, System.IComparable<string?>, System.IConvertible, System.IEquatable<string?>
{
public static readonly string Empty;
[System.CLSCompliantAttribute(false)]
public unsafe String(char* value) { }
[System.CLSCompliantAttribute(false)]
public unsafe String(char* value, int startIndex, int length) { }
public String(char c, int count) { }
public String(char[]? value) { }
public String(char[] value, int startIndex, int length) { }
public String(System.ReadOnlySpan<char> value) { }
[System.CLSCompliantAttribute(false)]
public unsafe String(sbyte* value) { }
[System.CLSCompliantAttribute(false)]
public unsafe String(sbyte* value, int startIndex, int length) { }
[System.CLSCompliantAttribute(false)]
public unsafe String(sbyte* value, int startIndex, int length, System.Text.Encoding enc) { }
[System.Runtime.CompilerServices.IndexerName("Chars")]
public char this[int index] { get { throw null; } }
public int Length { get { throw null; } }
public object Clone() { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length) { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length, bool ignoreCase) { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length, System.Globalization.CultureInfo? culture, System.Globalization.CompareOptions options) { throw null; }
public static int Compare(System.String? strA, int indexA, System.String? strB, int indexB, int length, System.StringComparison comparisonType) { throw null; }
public static int Compare(System.String? strA, System.String? strB) { throw null; }
public static int Compare(System.String? strA, System.String? strB, bool ignoreCase) { throw null; }
public static int Compare(System.String? strA, System.String? strB, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public static int Compare(System.String? strA, System.String? strB, System.Globalization.CultureInfo? culture, System.Globalization.CompareOptions options) { throw null; }
public static int Compare(System.String? strA, System.String? strB, System.StringComparison comparisonType) { throw null; }
public static int CompareOrdinal(System.String? strA, int indexA, System.String? strB, int indexB, int length) { throw null; }
public static int CompareOrdinal(System.String? strA, System.String? strB) { throw null; }
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.String? strB) { throw null; }
public static System.String Concat(System.Collections.Generic.IEnumerable<string?> values) { throw null; }
public static System.String Concat(object? arg0) { throw null; }
public static System.String Concat(object? arg0, object? arg1) { throw null; }
public static System.String Concat(object? arg0, object? arg1, object? arg2) { throw null; }
public static System.String Concat(params object?[] args) { throw null; }
public static System.String Concat(System.ReadOnlySpan<char> str0, System.ReadOnlySpan<char> str1) { throw null; }
public static System.String Concat(System.ReadOnlySpan<char> str0, System.ReadOnlySpan<char> str1, System.ReadOnlySpan<char> str2) { throw null; }
public static System.String Concat(System.ReadOnlySpan<char> str0, System.ReadOnlySpan<char> str1, System.ReadOnlySpan<char> str2, System.ReadOnlySpan<char> str3) { throw null; }
public static System.String Concat(System.String? str0, System.String? str1) { throw null; }
public static System.String Concat(System.String? str0, System.String? str1, System.String? str2) { throw null; }
public static System.String Concat(System.String? str0, System.String? str1, System.String? str2, System.String? str3) { throw null; }
public static System.String Concat(params string?[] values) { throw null; }
public static System.String Concat<T>(System.Collections.Generic.IEnumerable<T> values) { throw null; }
public bool Contains(char value) { throw null; }
public bool Contains(char value, System.StringComparison comparisonType) { throw null; }
public bool Contains(System.String value) { throw null; }
public bool Contains(System.String value, System.StringComparison comparisonType) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This API should not be used to create mutable strings. See https://go.microsoft.com/fwlink/?linkid=2084035 for alternatives.")]
public static System.String Copy(System.String str) { throw null; }
public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count) { }
public void CopyTo(System.Span<char> destination) { }
public static System.String Create(System.IFormatProvider? provider, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("provider")] ref System.Runtime.CompilerServices.DefaultInterpolatedStringHandler handler) { throw null; }
public static System.String Create(System.IFormatProvider? provider, System.Span<char> initialBuffer, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute(new string[]{ "provider", "initialBuffer"})] ref System.Runtime.CompilerServices.DefaultInterpolatedStringHandler handler) { throw null; }
public static System.String Create<TState>(int length, TState state, System.Buffers.SpanAction<char, TState> action) { throw null; }
public bool EndsWith(char value) { throw null; }
public bool EndsWith(System.String value) { throw null; }
public bool EndsWith(System.String value, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public bool EndsWith(System.String value, System.StringComparison comparisonType) { throw null; }
public System.Text.StringRuneEnumerator EnumerateRunes() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.String? value) { throw null; }
public static bool Equals(System.String? a, System.String? b) { throw null; }
public static bool Equals(System.String? a, System.String? b, System.StringComparison comparisonType) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.String? value, System.StringComparison comparisonType) { throw null; }
public static System.String Format(System.IFormatProvider? provider, System.String format, object? arg0) { throw null; }
public static System.String Format(System.IFormatProvider? provider, System.String format, object? arg0, object? arg1) { throw null; }
public static System.String Format(System.IFormatProvider? provider, System.String format, object? arg0, object? arg1, object? arg2) { throw null; }
public static System.String Format(System.IFormatProvider? provider, System.String format, params object?[] args) { throw null; }
public static System.String Format(System.String format, object? arg0) { throw null; }
public static System.String Format(System.String format, object? arg0, object? arg1) { throw null; }
public static System.String Format(System.String format, object? arg0, object? arg1, object? arg2) { throw null; }
public static System.String Format(System.String format, params object?[] args) { throw null; }
public System.CharEnumerator GetEnumerator() { throw null; }
public override int GetHashCode() { throw null; }
public static int GetHashCode(System.ReadOnlySpan<char> value) { throw null; }
public static int GetHashCode(System.ReadOnlySpan<char> value, System.StringComparison comparisonType) { throw null; }
public int GetHashCode(System.StringComparison comparisonType) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public ref readonly char GetPinnableReference() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public int IndexOf(char value) { throw null; }
public int IndexOf(char value, int startIndex) { throw null; }
public int IndexOf(char value, int startIndex, int count) { throw null; }
public int IndexOf(char value, System.StringComparison comparisonType) { throw null; }
public int IndexOf(System.String value) { throw null; }
public int IndexOf(System.String value, int startIndex) { throw null; }
public int IndexOf(System.String value, int startIndex, int count) { throw null; }
public int IndexOf(System.String value, int startIndex, int count, System.StringComparison comparisonType) { throw null; }
public int IndexOf(System.String value, int startIndex, System.StringComparison comparisonType) { throw null; }
public int IndexOf(System.String value, System.StringComparison comparisonType) { throw null; }
public int IndexOfAny(char[] anyOf) { throw null; }
public int IndexOfAny(char[] anyOf, int startIndex) { throw null; }
public int IndexOfAny(char[] anyOf, int startIndex, int count) { throw null; }
public System.String Insert(int startIndex, System.String value) { throw null; }
public static System.String Intern(System.String str) { throw null; }
public static System.String? IsInterned(System.String str) { throw null; }
public bool IsNormalized() { throw null; }
public bool IsNormalized(System.Text.NormalizationForm normalizationForm) { throw null; }
public static bool IsNullOrEmpty([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(false)] System.String? value) { throw null; }
public static bool IsNullOrWhiteSpace([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(false)] System.String? value) { throw null; }
public static System.String Join(char separator, params object?[] values) { throw null; }
public static System.String Join(char separator, params string?[] value) { throw null; }
public static System.String Join(char separator, string?[] value, int startIndex, int count) { throw null; }
public static System.String Join(System.String? separator, System.Collections.Generic.IEnumerable<string?> values) { throw null; }
public static System.String Join(System.String? separator, params object?[] values) { throw null; }
public static System.String Join(System.String? separator, params string?[] value) { throw null; }
public static System.String Join(System.String? separator, string?[] value, int startIndex, int count) { throw null; }
public static System.String Join<T>(char separator, System.Collections.Generic.IEnumerable<T> values) { throw null; }
public static System.String Join<T>(System.String? separator, System.Collections.Generic.IEnumerable<T> values) { throw null; }
public int LastIndexOf(char value) { throw null; }
public int LastIndexOf(char value, int startIndex) { throw null; }
public int LastIndexOf(char value, int startIndex, int count) { throw null; }
public int LastIndexOf(System.String value) { throw null; }
public int LastIndexOf(System.String value, int startIndex) { throw null; }
public int LastIndexOf(System.String value, int startIndex, int count) { throw null; }
public int LastIndexOf(System.String value, int startIndex, int count, System.StringComparison comparisonType) { throw null; }
public int LastIndexOf(System.String value, int startIndex, System.StringComparison comparisonType) { throw null; }
public int LastIndexOf(System.String value, System.StringComparison comparisonType) { throw null; }
public int LastIndexOfAny(char[] anyOf) { throw null; }
public int LastIndexOfAny(char[] anyOf, int startIndex) { throw null; }
public int LastIndexOfAny(char[] anyOf, int startIndex, int count) { throw null; }
public System.String Normalize() { throw null; }
public System.String Normalize(System.Text.NormalizationForm normalizationForm) { throw null; }
public static bool operator ==(System.String? a, System.String? b) { throw null; }
public static implicit operator System.ReadOnlySpan<char> (System.String? value) { throw null; }
public static bool operator !=(System.String? a, System.String? b) { throw null; }
public System.String PadLeft(int totalWidth) { throw null; }
public System.String PadLeft(int totalWidth, char paddingChar) { throw null; }
public System.String PadRight(int totalWidth) { throw null; }
public System.String PadRight(int totalWidth, char paddingChar) { throw null; }
public System.String Remove(int startIndex) { throw null; }
public System.String Remove(int startIndex, int count) { throw null; }
public System.String Replace(char oldChar, char newChar) { throw null; }
public System.String Replace(System.String oldValue, System.String? newValue) { throw null; }
public System.String Replace(System.String oldValue, System.String? newValue, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public System.String Replace(System.String oldValue, System.String? newValue, System.StringComparison comparisonType) { throw null; }
public System.String ReplaceLineEndings() { throw null; }
public System.String ReplaceLineEndings(System.String replacementText) { throw null; }
public string[] Split(char separator, int count, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; }
public string[] Split(char separator, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; }
public string[] Split(params char[]? separator) { throw null; }
public string[] Split(char[]? separator, int count) { throw null; }
public string[] Split(char[]? separator, int count, System.StringSplitOptions options) { throw null; }
public string[] Split(char[]? separator, System.StringSplitOptions options) { throw null; }
public string[] Split(System.String? separator, int count, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; }
public string[] Split(System.String? separator, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; }
public string[] Split(string[]? separator, int count, System.StringSplitOptions options) { throw null; }
public string[] Split(string[]? separator, System.StringSplitOptions options) { throw null; }
public bool StartsWith(char value) { throw null; }
public bool StartsWith(System.String value) { throw null; }
public bool StartsWith(System.String value, bool ignoreCase, System.Globalization.CultureInfo? culture) { throw null; }
public bool StartsWith(System.String value, System.StringComparison comparisonType) { throw null; }
public System.String Substring(int startIndex) { throw null; }
public System.String Substring(int startIndex, int length) { throw null; }
System.Collections.Generic.IEnumerator<char> System.Collections.Generic.IEnumerable<char>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public char[] ToCharArray() { throw null; }
public char[] ToCharArray(int startIndex, int length) { throw null; }
public System.String ToLower() { throw null; }
public System.String ToLower(System.Globalization.CultureInfo? culture) { throw null; }
public System.String ToLowerInvariant() { throw null; }
public override System.String ToString() { throw null; }
public System.String ToString(System.IFormatProvider? provider) { throw null; }
public System.String ToUpper() { throw null; }
public System.String ToUpper(System.Globalization.CultureInfo? culture) { throw null; }
public System.String ToUpperInvariant() { throw null; }
public System.String Trim() { throw null; }
public System.String Trim(char trimChar) { throw null; }
public System.String Trim(params char[]? trimChars) { throw null; }
public System.String TrimEnd() { throw null; }
public System.String TrimEnd(char trimChar) { throw null; }
public System.String TrimEnd(params char[]? trimChars) { throw null; }
public System.String TrimStart() { throw null; }
public System.String TrimStart(char trimChar) { throw null; }
public System.String TrimStart(params char[]? trimChars) { throw null; }
public bool TryCopyTo(System.Span<char> destination) { throw null; }
}
public abstract partial class StringComparer : System.Collections.Generic.IComparer<string?>, System.Collections.Generic.IEqualityComparer<string?>, System.Collections.IComparer, System.Collections.IEqualityComparer
{
protected StringComparer() { }
public static System.StringComparer CurrentCulture { get { throw null; } }
public static System.StringComparer CurrentCultureIgnoreCase { get { throw null; } }
public static System.StringComparer InvariantCulture { get { throw null; } }
public static System.StringComparer InvariantCultureIgnoreCase { get { throw null; } }
public static System.StringComparer Ordinal { get { throw null; } }
public static System.StringComparer OrdinalIgnoreCase { get { throw null; } }
public int Compare(object? x, object? y) { throw null; }
public abstract int Compare(string? x, string? y);
public static System.StringComparer Create(System.Globalization.CultureInfo culture, bool ignoreCase) { throw null; }
public static System.StringComparer Create(System.Globalization.CultureInfo culture, System.Globalization.CompareOptions options) { throw null; }
public new bool Equals(object? x, object? y) { throw null; }
public abstract bool Equals(string? x, string? y);
public static System.StringComparer FromComparison(System.StringComparison comparisonType) { throw null; }
public int GetHashCode(object obj) { throw null; }
public abstract int GetHashCode(string obj);
public static bool IsWellKnownCultureAwareComparer(System.Collections.Generic.IEqualityComparer<string?>? comparer, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Globalization.CompareInfo? compareInfo, out System.Globalization.CompareOptions compareOptions) { throw null; }
public static bool IsWellKnownOrdinalComparer(System.Collections.Generic.IEqualityComparer<string?>? comparer, out bool ignoreCase) { throw null; }
}
public enum StringComparison
{
CurrentCulture = 0,
CurrentCultureIgnoreCase = 1,
InvariantCulture = 2,
InvariantCultureIgnoreCase = 3,
Ordinal = 4,
OrdinalIgnoreCase = 5,
}
public static partial class StringNormalizationExtensions
{
public static bool IsNormalized(this string strInput) { throw null; }
public static bool IsNormalized(this string strInput, System.Text.NormalizationForm normalizationForm) { throw null; }
public static string Normalize(this string strInput) { throw null; }
public static string Normalize(this string strInput, System.Text.NormalizationForm normalizationForm) { throw null; }
}
[System.FlagsAttribute]
public enum StringSplitOptions
{
None = 0,
RemoveEmptyEntries = 1,
TrimEntries = 2,
}
public partial class SystemException : System.Exception
{
public SystemException() { }
protected SystemException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public SystemException(string? message) { }
public SystemException(string? message, System.Exception? innerException) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public partial class ThreadStaticAttribute : System.Attribute
{
public ThreadStaticAttribute() { }
}
public readonly partial struct TimeOnly : System.IComparable, System.IComparable<System.TimeOnly>, System.IEquatable<System.TimeOnly>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IComparisonOperators<System.TimeOnly, System.TimeOnly>,
System.IMinMaxValue<System.TimeOnly>,
System.ISpanParseable<System.TimeOnly>,
System.ISubtractionOperators<System.TimeOnly, System.TimeOnly, System.TimeSpan>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
public static System.TimeOnly MinValue { get { throw null; } }
public static System.TimeOnly MaxValue { get { throw null; } }
public TimeOnly(int hour, int minute) { throw null; }
public TimeOnly(int hour, int minute, int second) { throw null; }
public TimeOnly(int hour, int minute, int second, int millisecond) { throw null; }
public TimeOnly(long ticks) { throw null; }
public int Hour { get { throw null; } }
public int Minute { get { throw null; } }
public int Second { get { throw null; } }
public int Millisecond { get { throw null; } }
public long Ticks { get { throw null; } }
public System.TimeOnly Add(System.TimeSpan value) { throw null; }
public System.TimeOnly Add(System.TimeSpan value, out int wrappedDays) { throw null; }
public System.TimeOnly AddHours(double value) { throw null; }
public System.TimeOnly AddHours(double value, out int wrappedDays) { throw null; }
public System.TimeOnly AddMinutes(double value) { throw null; }
public System.TimeOnly AddMinutes(double value, out int wrappedDays) { throw null; }
public bool IsBetween(System.TimeOnly start, System.TimeOnly end) { throw null; }
public static bool operator ==(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator >(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator >=(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator !=(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator <(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static bool operator <=(System.TimeOnly left, System.TimeOnly right) { throw null; }
public static System.TimeSpan operator -(System.TimeOnly t1, System.TimeOnly t2) { throw null; }
public static System.TimeOnly FromTimeSpan(System.TimeSpan timeSpan) { throw null; }
public static System.TimeOnly FromDateTime(System.DateTime dateTime) { throw null; }
public System.TimeSpan ToTimeSpan() { throw null; }
public int CompareTo(System.TimeOnly value) { throw null; }
public int CompareTo(object? value) { throw null; }
public bool Equals(System.TimeOnly value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public static System.TimeOnly Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly ParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, System.IFormatProvider? provider = default, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly ParseExact(System.ReadOnlySpan<char> s, string[] formats) { throw null; }
public static System.TimeOnly ParseExact(System.ReadOnlySpan<char> s, string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly Parse(string s) { throw null; }
public static System.TimeOnly Parse(string s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly ParseExact(string s, string format) { throw null; }
public static System.TimeOnly ParseExact(string s, string format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static System.TimeOnly ParseExact(string s, string[] formats) { throw null; }
public static System.TimeOnly ParseExact(string s, string[] formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style = System.Globalization.DateTimeStyles.None) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.TimeOnly result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, out System.TimeOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, System.ReadOnlySpan<char> format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, out System.TimeOnly result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.TimeOnly result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, out System.TimeOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, out System.TimeOnly result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? provider, System.Globalization.DateTimeStyles style, out System.TimeOnly result) { throw null; }
public string ToLongTimeString() { throw null; }
public string ToShortTimeString() { throw null; }
public override string ToString() { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeOnly, System.TimeOnly>.operator <(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeOnly, System.TimeOnly>.operator <=(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeOnly, System.TimeOnly>.operator >(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeOnly, System.TimeOnly>.operator >=(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.TimeOnly, System.TimeOnly>.operator ==(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.TimeOnly, System.TimeOnly>.operator !=(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeOnly IParseable<System.TimeOnly>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.TimeOnly>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.TimeOnly result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeOnly ISpanParseable<System.TimeOnly>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.TimeOnly>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.TimeOnly result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISubtractionOperators<System.TimeOnly, System.TimeOnly, System.TimeSpan>.operator -(System.TimeOnly left, System.TimeOnly right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeOnly IMinMaxValue<System.TimeOnly>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeOnly IMinMaxValue<System.TimeOnly>.MaxValue { get { throw null; } }
#endif // FEATURE_GENERIC_MATH
}
public partial class TimeoutException : System.SystemException
{
public TimeoutException() { }
protected TimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TimeoutException(string? message) { }
public TimeoutException(string? message, System.Exception? innerException) { }
}
public readonly partial struct TimeSpan : System.IComparable, System.IComparable<System.TimeSpan>, System.IEquatable<System.TimeSpan>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IAdditionOperators<System.TimeSpan, System.TimeSpan, System.TimeSpan>,
System.IAdditiveIdentity<System.TimeSpan, System.TimeSpan>,
System.IComparisonOperators<System.TimeSpan, System.TimeSpan>,
System.IDivisionOperators<System.TimeSpan, double, System.TimeSpan>,
System.IDivisionOperators<System.TimeSpan, System.TimeSpan, double>,
System.IMinMaxValue<System.TimeSpan>,
System.IMultiplyOperators<System.TimeSpan, double, System.TimeSpan>,
System.IMultiplicativeIdentity<System.TimeSpan, double>,
System.ISpanParseable<System.TimeSpan>,
System.ISubtractionOperators<System.TimeSpan, System.TimeSpan, System.TimeSpan>,
System.IUnaryNegationOperators<System.TimeSpan, System.TimeSpan>,
System.IUnaryPlusOperators<System.TimeSpan, System.TimeSpan>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.TimeSpan MaxValue;
public static readonly System.TimeSpan MinValue;
public const long TicksPerDay = (long)864000000000;
public const long TicksPerHour = (long)36000000000;
public const long TicksPerMillisecond = (long)10000;
public const long TicksPerMinute = (long)600000000;
public const long TicksPerSecond = (long)10000000;
public static readonly System.TimeSpan Zero;
public TimeSpan(int hours, int minutes, int seconds) { throw null; }
public TimeSpan(int days, int hours, int minutes, int seconds) { throw null; }
public TimeSpan(int days, int hours, int minutes, int seconds, int milliseconds) { throw null; }
public TimeSpan(long ticks) { throw null; }
public int Days { get { throw null; } }
public int Hours { get { throw null; } }
public int Milliseconds { get { throw null; } }
public int Minutes { get { throw null; } }
public int Seconds { get { throw null; } }
public long Ticks { get { throw null; } }
public double TotalDays { get { throw null; } }
public double TotalHours { get { throw null; } }
public double TotalMilliseconds { get { throw null; } }
public double TotalMinutes { get { throw null; } }
public double TotalSeconds { get { throw null; } }
public System.TimeSpan Add(System.TimeSpan ts) { throw null; }
public static int Compare(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.TimeSpan value) { throw null; }
public System.TimeSpan Divide(double divisor) { throw null; }
public double Divide(System.TimeSpan ts) { throw null; }
public System.TimeSpan Duration() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public bool Equals(System.TimeSpan obj) { throw null; }
public static bool Equals(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static System.TimeSpan FromDays(double value) { throw null; }
public static System.TimeSpan FromHours(double value) { throw null; }
public static System.TimeSpan FromMilliseconds(double value) { throw null; }
public static System.TimeSpan FromMinutes(double value) { throw null; }
public static System.TimeSpan FromSeconds(double value) { throw null; }
public static System.TimeSpan FromTicks(long value) { throw null; }
public override int GetHashCode() { throw null; }
public System.TimeSpan Multiply(double factor) { throw null; }
public System.TimeSpan Negate() { throw null; }
public static System.TimeSpan operator +(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static System.TimeSpan operator /(System.TimeSpan timeSpan, double divisor) { throw null; }
public static double operator /(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator ==(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator >(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator >=(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator !=(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator <(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static bool operator <=(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static System.TimeSpan operator *(double factor, System.TimeSpan timeSpan) { throw null; }
public static System.TimeSpan operator *(System.TimeSpan timeSpan, double factor) { throw null; }
public static System.TimeSpan operator -(System.TimeSpan t1, System.TimeSpan t2) { throw null; }
public static System.TimeSpan operator -(System.TimeSpan t) { throw null; }
public static System.TimeSpan operator +(System.TimeSpan t) { throw null; }
public static System.TimeSpan Parse(System.ReadOnlySpan<char> input, System.IFormatProvider? formatProvider = null) { throw null; }
public static System.TimeSpan Parse(string s) { throw null; }
public static System.TimeSpan Parse(string input, System.IFormatProvider? formatProvider) { throw null; }
public static System.TimeSpan ParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles = System.Globalization.TimeSpanStyles.None) { throw null; }
public static System.TimeSpan ParseExact(System.ReadOnlySpan<char> input, string[] formats, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles = System.Globalization.TimeSpanStyles.None) { throw null; }
public static System.TimeSpan ParseExact(string input, string format, System.IFormatProvider? formatProvider) { throw null; }
public static System.TimeSpan ParseExact(string input, string format, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles) { throw null; }
public static System.TimeSpan ParseExact(string input, string[] formats, System.IFormatProvider? formatProvider) { throw null; }
public static System.TimeSpan ParseExact(string input, string[] formats, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles) { throw null; }
public System.TimeSpan Subtract(System.TimeSpan ts) { throw null; }
public override string ToString() { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? formatProvider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? formatProvider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.TimeSpan result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.TimeSpan result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles, out System.TimeSpan result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, System.ReadOnlySpan<char> format, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles, out System.TimeSpan result) { throw null; }
public static bool TryParseExact(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles, out System.TimeSpan result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? format, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? formatProvider, System.Globalization.TimeSpanStyles styles, out System.TimeSpan result) { throw null; }
public static bool TryParseExact([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string?[]? formats, System.IFormatProvider? formatProvider, out System.TimeSpan result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IAdditiveIdentity<System.TimeSpan, System.TimeSpan>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IMinMaxValue<System.TimeSpan>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IMinMaxValue<System.TimeSpan>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IMultiplicativeIdentity<System.TimeSpan, double>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IAdditionOperators<System.TimeSpan, System.TimeSpan, System.TimeSpan>.operator +(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeSpan, System.TimeSpan>.operator <(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeSpan, System.TimeSpan>.operator <=(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeSpan, System.TimeSpan>.operator >(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<System.TimeSpan, System.TimeSpan>.operator >=(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IDivisionOperators<System.TimeSpan, double, System.TimeSpan>.operator /(System.TimeSpan left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static double IDivisionOperators<System.TimeSpan, System.TimeSpan, double>.operator /(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.TimeSpan, System.TimeSpan>.operator ==(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<System.TimeSpan, System.TimeSpan>.operator !=(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IMultiplyOperators<System.TimeSpan, double, System.TimeSpan>.operator *(System.TimeSpan left, double right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IParseable<System.TimeSpan>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<System.TimeSpan>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out System.TimeSpan result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISpanParseable<System.TimeSpan>.Parse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<System.TimeSpan>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out System.TimeSpan result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan ISubtractionOperators<System.TimeSpan, System.TimeSpan, System.TimeSpan>.operator -(System.TimeSpan left, System.TimeSpan right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IUnaryNegationOperators<System.TimeSpan, System.TimeSpan>.operator -(System.TimeSpan value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static System.TimeSpan IUnaryPlusOperators<System.TimeSpan, System.TimeSpan>.operator +(System.TimeSpan value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.ObsoleteAttribute("System.TimeZone has been deprecated. Investigate the use of System.TimeZoneInfo instead.")]
public abstract partial class TimeZone
{
protected TimeZone() { }
public static System.TimeZone CurrentTimeZone { get { throw null; } }
public abstract string DaylightName { get; }
public abstract string StandardName { get; }
public abstract System.Globalization.DaylightTime GetDaylightChanges(int year);
public abstract System.TimeSpan GetUtcOffset(System.DateTime time);
public virtual bool IsDaylightSavingTime(System.DateTime time) { throw null; }
public static bool IsDaylightSavingTime(System.DateTime time, System.Globalization.DaylightTime daylightTimes) { throw null; }
public virtual System.DateTime ToLocalTime(System.DateTime time) { throw null; }
public virtual System.DateTime ToUniversalTime(System.DateTime time) { throw null; }
}
public sealed partial class TimeZoneInfo : System.IEquatable<System.TimeZoneInfo?>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
internal TimeZoneInfo() { }
public System.TimeSpan BaseUtcOffset { get { throw null; } }
public string DaylightName { get { throw null; } }
public string DisplayName { get { throw null; } }
public bool HasIanaId { get { throw null; } }
public string Id { get { throw null; } }
public static System.TimeZoneInfo Local { get { throw null; } }
public string StandardName { get { throw null; } }
public bool SupportsDaylightSavingTime { get { throw null; } }
public static System.TimeZoneInfo Utc { get { throw null; } }
public static void ClearCachedData() { }
public static System.DateTime ConvertTime(System.DateTime dateTime, System.TimeZoneInfo destinationTimeZone) { throw null; }
public static System.DateTime ConvertTime(System.DateTime dateTime, System.TimeZoneInfo sourceTimeZone, System.TimeZoneInfo destinationTimeZone) { throw null; }
public static System.DateTimeOffset ConvertTime(System.DateTimeOffset dateTimeOffset, System.TimeZoneInfo destinationTimeZone) { throw null; }
public static System.DateTime ConvertTimeBySystemTimeZoneId(System.DateTime dateTime, string destinationTimeZoneId) { throw null; }
public static System.DateTime ConvertTimeBySystemTimeZoneId(System.DateTime dateTime, string sourceTimeZoneId, string destinationTimeZoneId) { throw null; }
public static System.DateTimeOffset ConvertTimeBySystemTimeZoneId(System.DateTimeOffset dateTimeOffset, string destinationTimeZoneId) { throw null; }
public static System.DateTime ConvertTimeFromUtc(System.DateTime dateTime, System.TimeZoneInfo destinationTimeZone) { throw null; }
public static System.DateTime ConvertTimeToUtc(System.DateTime dateTime) { throw null; }
public static System.DateTime ConvertTimeToUtc(System.DateTime dateTime, System.TimeZoneInfo sourceTimeZone) { throw null; }
public static System.TimeZoneInfo CreateCustomTimeZone(string id, System.TimeSpan baseUtcOffset, string? displayName, string? standardDisplayName) { throw null; }
public static System.TimeZoneInfo CreateCustomTimeZone(string id, System.TimeSpan baseUtcOffset, string? displayName, string? standardDisplayName, string? daylightDisplayName, System.TimeZoneInfo.AdjustmentRule[]? adjustmentRules) { throw null; }
public static System.TimeZoneInfo CreateCustomTimeZone(string id, System.TimeSpan baseUtcOffset, string? displayName, string? standardDisplayName, string? daylightDisplayName, System.TimeZoneInfo.AdjustmentRule[]? adjustmentRules, bool disableDaylightSavingTime) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.TimeZoneInfo? other) { throw null; }
public static System.TimeZoneInfo FindSystemTimeZoneById(string id) { throw null; }
public static System.TimeZoneInfo FromSerializedString(string source) { throw null; }
public System.TimeZoneInfo.AdjustmentRule[] GetAdjustmentRules() { throw null; }
public System.TimeSpan[] GetAmbiguousTimeOffsets(System.DateTime dateTime) { throw null; }
public System.TimeSpan[] GetAmbiguousTimeOffsets(System.DateTimeOffset dateTimeOffset) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Collections.ObjectModel.ReadOnlyCollection<System.TimeZoneInfo> GetSystemTimeZones() { throw null; }
public System.TimeSpan GetUtcOffset(System.DateTime dateTime) { throw null; }
public System.TimeSpan GetUtcOffset(System.DateTimeOffset dateTimeOffset) { throw null; }
public bool HasSameRules(System.TimeZoneInfo other) { throw null; }
public bool IsAmbiguousTime(System.DateTime dateTime) { throw null; }
public bool IsAmbiguousTime(System.DateTimeOffset dateTimeOffset) { throw null; }
public bool IsDaylightSavingTime(System.DateTime dateTime) { throw null; }
public bool IsDaylightSavingTime(System.DateTimeOffset dateTimeOffset) { throw null; }
public bool IsInvalidTime(System.DateTime dateTime) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public string ToSerializedString() { throw null; }
public override string ToString() { throw null; }
public static bool TryConvertIanaIdToWindowsId(string ianaId, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out string? windowsId) { throw null; }
public static bool TryConvertWindowsIdToIanaId(string windowsId, string? region, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out string? ianaId) { throw null; }
public static bool TryConvertWindowsIdToIanaId(string windowsId, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out string? ianaId) { throw null; }
public sealed partial class AdjustmentRule : System.IEquatable<System.TimeZoneInfo.AdjustmentRule?>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
internal AdjustmentRule() { }
public System.TimeSpan BaseUtcOffsetDelta { get { throw null; } }
public System.DateTime DateEnd { get { throw null; } }
public System.DateTime DateStart { get { throw null; } }
public System.TimeSpan DaylightDelta { get { throw null; } }
public System.TimeZoneInfo.TransitionTime DaylightTransitionEnd { get { throw null; } }
public System.TimeZoneInfo.TransitionTime DaylightTransitionStart { get { throw null; } }
public static System.TimeZoneInfo.AdjustmentRule CreateAdjustmentRule(System.DateTime dateStart, System.DateTime dateEnd, System.TimeSpan daylightDelta, System.TimeZoneInfo.TransitionTime daylightTransitionStart, System.TimeZoneInfo.TransitionTime daylightTransitionEnd) { throw null; }
public static System.TimeZoneInfo.AdjustmentRule CreateAdjustmentRule(System.DateTime dateStart, System.DateTime dateEnd, System.TimeSpan daylightDelta, System.TimeZoneInfo.TransitionTime daylightTransitionStart, System.TimeZoneInfo.TransitionTime daylightTransitionEnd, System.TimeSpan baseUtcOffsetDelta) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.TimeZoneInfo.AdjustmentRule? other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public readonly partial struct TransitionTime : System.IEquatable<System.TimeZoneInfo.TransitionTime>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
private readonly int _dummyPrimitive;
public int Day { get { throw null; } }
public System.DayOfWeek DayOfWeek { get { throw null; } }
public bool IsFixedDateRule { get { throw null; } }
public int Month { get { throw null; } }
public System.DateTime TimeOfDay { get { throw null; } }
public int Week { get { throw null; } }
public static System.TimeZoneInfo.TransitionTime CreateFixedDateRule(System.DateTime timeOfDay, int month, int day) { throw null; }
public static System.TimeZoneInfo.TransitionTime CreateFloatingDateRule(System.DateTime timeOfDay, int month, int week, System.DayOfWeek dayOfWeek) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.TimeZoneInfo.TransitionTime other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.TimeZoneInfo.TransitionTime t1, System.TimeZoneInfo.TransitionTime t2) { throw null; }
public static bool operator !=(System.TimeZoneInfo.TransitionTime t1, System.TimeZoneInfo.TransitionTime t2) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
}
public partial class TimeZoneNotFoundException : System.Exception
{
public TimeZoneNotFoundException() { }
protected TimeZoneNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TimeZoneNotFoundException(string? message) { }
public TimeZoneNotFoundException(string? message, System.Exception? innerException) { }
}
public static partial class Tuple
{
public static System.Tuple<T1> Create<T1>(T1 item1) { throw null; }
public static System.Tuple<T1, T2> Create<T1, T2>(T1 item1, T2 item2) { throw null; }
public static System.Tuple<T1, T2, T3> Create<T1, T2, T3>(T1 item1, T2 item2, T3 item3) { throw null; }
public static System.Tuple<T1, T2, T3, T4> Create<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5> Create<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6> Create<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7> Create<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8>> Create<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) { throw null; }
}
public static partial class TupleExtensions
{
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1>(this System.Tuple<T1> value, out T1 item1) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2>(this System.Tuple<T1, T2> value, out T1 item1, out T2 item2) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19, out T20 item20) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20, T21>>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9, out T10 item10, out T11 item11, out T12 item12, out T13 item13, out T14 item14, out T15 item15, out T16 item16, out T17 item17, out T18 item18, out T19 item19, out T20 item20, out T21 item21) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3>(this System.Tuple<T1, T2, T3> value, out T1 item1, out T2 item2, out T3 item3) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4>(this System.Tuple<T1, T2, T3, T4> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5>(this System.Tuple<T1, T2, T3, T4, T5> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6>(this System.Tuple<T1, T2, T3, T4, T5, T6> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static void Deconstruct<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9>> value, out T1 item1, out T2 item2, out T3 item3, out T4 item4, out T5 item5, out T6 item6, out T7 item7, out T8 item8, out T9 item9) { throw null; }
public static System.Tuple<T1> ToTuple<T1>(this System.ValueTuple<T1> value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) value) { throw null; }
public static System.Tuple<T1, T2> ToTuple<T1, T2>(this (T1, T2) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20, T21>>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) value) { throw null; }
public static System.Tuple<T1, T2, T3> ToTuple<T1, T2, T3>(this (T1, T2, T3) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4> ToTuple<T1, T2, T3, T4>(this (T1, T2, T3, T4) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5> ToTuple<T1, T2, T3, T4, T5>(this (T1, T2, T3, T4, T5) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6> ToTuple<T1, T2, T3, T4, T5, T6>(this (T1, T2, T3, T4, T5, T6) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7> ToTuple<T1, T2, T3, T4, T5, T6, T7>(this (T1, T2, T3, T4, T5, T6, T7) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8>(this (T1, T2, T3, T4, T5, T6, T7, T8) value) { throw null; }
public static System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9>> ToTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this (T1, T2, T3, T4, T5, T6, T7, T8, T9) value) { throw null; }
public static System.ValueTuple<T1> ToValueTuple<T1>(this System.Tuple<T1> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19>>> value) { throw null; }
public static (T1, T2) ToValueTuple<T1, T2>(this System.Tuple<T1, T2> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20>>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9, T10, T11, T12, T13, T14, System.Tuple<T15, T16, T17, T18, T19, T20, T21>>> value) { throw null; }
public static (T1, T2, T3) ToValueTuple<T1, T2, T3>(this System.Tuple<T1, T2, T3> value) { throw null; }
public static (T1, T2, T3, T4) ToValueTuple<T1, T2, T3, T4>(this System.Tuple<T1, T2, T3, T4> value) { throw null; }
public static (T1, T2, T3, T4, T5) ToValueTuple<T1, T2, T3, T4, T5>(this System.Tuple<T1, T2, T3, T4, T5> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6) ToValueTuple<T1, T2, T3, T4, T5, T6>(this System.Tuple<T1, T2, T3, T4, T5, T6> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7) ToValueTuple<T1, T2, T3, T4, T5, T6, T7>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8>> value) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8, T9) ToValueTuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>(this System.Tuple<T1, T2, T3, T4, T5, T6, T7, System.Tuple<T8, T9>> value) { throw null; }
}
public partial class Tuple<T1> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1) { }
public T1 Item1 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4, T5> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
public T5 Item5 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4, T5, T6> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
public T5 Item5 { get { throw null; } }
public T6 Item6 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4, T5, T6, T7> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
public T5 Item5 { get { throw null; } }
public T6 Item6 { get { throw null; } }
public T7 Item7 { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public partial class Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.Runtime.CompilerServices.ITuple where TRest : notnull
{
public Tuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) { }
public T1 Item1 { get { throw null; } }
public T2 Item2 { get { throw null; } }
public T3 Item3 { get { throw null; } }
public T4 Item4 { get { throw null; } }
public T5 Item5 { get { throw null; } }
public T6 Item6 { get { throw null; } }
public T7 Item7 { get { throw null; } }
public TRest Rest { get { throw null; } }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class Type : System.Reflection.MemberInfo, System.Reflection.IReflect
{
public static readonly char Delimiter;
public static readonly System.Type[] EmptyTypes;
public static readonly System.Reflection.MemberFilter FilterAttribute;
public static readonly System.Reflection.MemberFilter FilterName;
public static readonly System.Reflection.MemberFilter FilterNameIgnoreCase;
public static readonly object Missing;
protected Type() { }
public abstract System.Reflection.Assembly Assembly { get; }
public abstract string? AssemblyQualifiedName { get; }
public System.Reflection.TypeAttributes Attributes { get { throw null; } }
public abstract System.Type? BaseType { get; }
public virtual bool ContainsGenericParameters { get { throw null; } }
public virtual System.Reflection.MethodBase? DeclaringMethod { get { throw null; } }
public override System.Type? DeclaringType { get { throw null; } }
public static System.Reflection.Binder DefaultBinder { get { throw null; } }
public abstract string? FullName { get; }
public virtual System.Reflection.GenericParameterAttributes GenericParameterAttributes { get { throw null; } }
public virtual int GenericParameterPosition { get { throw null; } }
public virtual System.Type[] GenericTypeArguments { get { throw null; } }
public abstract System.Guid GUID { get; }
public bool HasElementType { get { throw null; } }
public bool IsAbstract { get { throw null; } }
public bool IsAnsiClass { get { throw null; } }
public bool IsArray { get { throw null; } }
public bool IsAutoClass { get { throw null; } }
public bool IsAutoLayout { get { throw null; } }
public bool IsByRef { get { throw null; } }
public virtual bool IsByRefLike { get { throw null; } }
public bool IsClass { get { throw null; } }
public bool IsCOMObject { get { throw null; } }
public virtual bool IsConstructedGenericType { get { throw null; } }
public bool IsContextful { get { throw null; } }
public virtual bool IsEnum { get { throw null; } }
public bool IsExplicitLayout { get { throw null; } }
public virtual bool IsGenericMethodParameter { get { throw null; } }
public virtual bool IsGenericParameter { get { throw null; } }
public virtual bool IsGenericType { get { throw null; } }
public virtual bool IsGenericTypeDefinition { get { throw null; } }
public virtual bool IsGenericTypeParameter { get { throw null; } }
public bool IsImport { get { throw null; } }
public bool IsInterface { get { throw null; } }
public bool IsLayoutSequential { get { throw null; } }
public bool IsMarshalByRef { get { throw null; } }
public bool IsNested { get { throw null; } }
public bool IsNestedAssembly { get { throw null; } }
public bool IsNestedFamANDAssem { get { throw null; } }
public bool IsNestedFamily { get { throw null; } }
public bool IsNestedFamORAssem { get { throw null; } }
public bool IsNestedPrivate { get { throw null; } }
public bool IsNestedPublic { get { throw null; } }
public bool IsNotPublic { get { throw null; } }
public bool IsPointer { get { throw null; } }
public bool IsPrimitive { get { throw null; } }
public bool IsPublic { get { throw null; } }
public bool IsSealed { get { throw null; } }
public virtual bool IsSecurityCritical { get { throw null; } }
public virtual bool IsSecuritySafeCritical { get { throw null; } }
public virtual bool IsSecurityTransparent { get { throw null; } }
public virtual bool IsSerializable { get { throw null; } }
public virtual bool IsSignatureType { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public virtual bool IsSZArray { get { throw null; } }
public virtual bool IsTypeDefinition { get { throw null; } }
public bool IsUnicodeClass { get { throw null; } }
public bool IsValueType { get { throw null; } }
public virtual bool IsVariableBoundArray { get { throw null; } }
public bool IsVisible { get { throw null; } }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public abstract new System.Reflection.Module Module { get; }
public abstract string? Namespace { get; }
public override System.Type? ReflectedType { get { throw null; } }
public virtual System.Runtime.InteropServices.StructLayoutAttribute? StructLayoutAttribute { get { throw null; } }
public virtual System.RuntimeTypeHandle TypeHandle { get { throw null; } }
public System.Reflection.ConstructorInfo? TypeInitializer { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] get { throw null; } }
public abstract System.Type UnderlyingSystemType { get; }
public override bool Equals(object? o) { throw null; }
public virtual bool Equals(System.Type? o) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public virtual System.Type[] FindInterfaces(System.Reflection.TypeFilter filter, object? filterCriteria) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public virtual System.Reflection.MemberInfo[] FindMembers(System.Reflection.MemberTypes memberType, System.Reflection.BindingFlags bindingAttr, System.Reflection.MemberFilter? filter, object? filterCriteria) { throw null; }
public virtual int GetArrayRank() { throw null; }
protected abstract System.Reflection.TypeAttributes GetAttributeFlagsImpl();
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo? GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo? GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo? GetConstructor(System.Reflection.BindingFlags bindingAttr, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo? GetConstructor(System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
protected abstract System.Reflection.ConstructorInfo? GetConstructorImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public System.Reflection.ConstructorInfo[] GetConstructors() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public abstract System.Reflection.ConstructorInfo[] GetConstructors(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public virtual System.Reflection.MemberInfo[] GetDefaultMembers() { throw null; }
public abstract System.Type? GetElementType();
public virtual string? GetEnumName(object value) { throw null; }
public virtual string[] GetEnumNames() { throw null; }
public virtual System.Type GetEnumUnderlyingType() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("It might not be possible to create an array of the enum type at runtime. Use Enum.GetValues<TEnum> instead.")]
public virtual System.Array GetEnumValues() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public System.Reflection.EventInfo? GetEvent(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public abstract System.Reflection.EventInfo? GetEvent(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public virtual System.Reflection.EventInfo[] GetEvents() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public abstract System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public System.Reflection.FieldInfo? GetField(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public abstract System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public System.Reflection.FieldInfo[] GetFields() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public abstract System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingAttr);
public virtual System.Type[] GetGenericArguments() { throw null; }
public virtual System.Type[] GetGenericParameterConstraints() { throw null; }
public virtual System.Type GetGenericTypeDefinition() { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public System.Type? GetInterface(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public abstract System.Type? GetInterface(string name, bool ignoreCase);
public virtual System.Reflection.InterfaceMapping GetInterfaceMap([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type interfaceType) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public abstract System.Type[] GetInterfaces();
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.MemberInfo[] GetMember(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public virtual System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public virtual System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.MemberTypes type, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.MemberInfo[] GetMembers() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public abstract System.Reflection.MemberInfo[] GetMembers(System.Reflection.BindingFlags bindingAttr);
public virtual System.Reflection.MemberInfo GetMemberWithSameMetadataDefinitionAs(System.Reflection.MemberInfo member) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, int genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, int genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, int genericParameterCount, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, int genericParameterCount, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo? GetMethod(string name, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
protected virtual System.Reflection.MethodInfo? GetMethodImpl(string name, int genericParameterCount, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
protected abstract System.Reflection.MethodInfo? GetMethodImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public System.Reflection.MethodInfo[] GetMethods() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public abstract System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public System.Type? GetNestedType(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public abstract System.Type? GetNestedType(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public System.Type[] GetNestedTypes() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public abstract System.Type[] GetNestedTypes(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo[] GetProperties() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public abstract System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type? returnType, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Type? returnType) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Type? returnType, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Type? returnType, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public System.Reflection.PropertyInfo? GetProperty(string name, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
protected abstract System.Reflection.PropertyInfo? GetPropertyImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type? returnType, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers);
public new System.Type GetType() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, bool throwOnError) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, bool throwOnError, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly?>? assemblyResolver, System.Func<System.Reflection.Assembly?, string, bool, System.Type?>? typeResolver) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly?>? assemblyResolver, System.Func<System.Reflection.Assembly?, string, bool, System.Type?>? typeResolver, bool throwOnError) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("The type might be removed")]
public static System.Type? GetType(string typeName, System.Func<System.Reflection.AssemblyName, System.Reflection.Assembly?>? assemblyResolver, System.Func<System.Reflection.Assembly?, string, bool, System.Type?>? typeResolver, bool throwOnError, bool ignoreCase) { throw null; }
public static System.Type[] GetTypeArray(object[] args) { throw null; }
public static System.TypeCode GetTypeCode(System.Type? type) { throw null; }
protected virtual System.TypeCode GetTypeCodeImpl() { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromCLSID(System.Guid clsid) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromCLSID(System.Guid clsid, bool throwOnError) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromCLSID(System.Guid clsid, string? server) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromCLSID(System.Guid clsid, string? server, bool throwOnError) { throw null; }
public static System.Type? GetTypeFromHandle(System.RuntimeTypeHandle handle) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromProgID(string progID) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromProgID(string progID, bool throwOnError) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromProgID(string progID, string? server) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static System.Type? GetTypeFromProgID(string progID, string? server, bool throwOnError) { throw null; }
public static System.RuntimeTypeHandle GetTypeHandle(object o) { throw null; }
protected abstract bool HasElementTypeImpl();
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args, System.Globalization.CultureInfo? culture) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public abstract object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args, System.Reflection.ParameterModifier[]? modifiers, System.Globalization.CultureInfo? culture, string[]? namedParameters);
protected abstract bool IsArrayImpl();
public virtual bool IsAssignableFrom([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Type? c) { throw null; }
public bool IsAssignableTo([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Type? targetType) { throw null; }
protected abstract bool IsByRefImpl();
protected abstract bool IsCOMObjectImpl();
protected virtual bool IsContextfulImpl() { throw null; }
public virtual bool IsEnumDefined(object value) { throw null; }
public virtual bool IsEquivalentTo([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Type? other) { throw null; }
public virtual bool IsInstanceOfType([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; }
protected virtual bool IsMarshalByRefImpl() { throw null; }
protected abstract bool IsPointerImpl();
protected abstract bool IsPrimitiveImpl();
public virtual bool IsSubclassOf(System.Type c) { throw null; }
protected virtual bool IsValueTypeImpl() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public virtual System.Type MakeArrayType() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public virtual System.Type MakeArrayType(int rank) { throw null; }
public virtual System.Type MakeByRefType() { throw null; }
public static System.Type MakeGenericMethodParameter(int position) { throw null; }
public static System.Type MakeGenericSignatureType(System.Type genericTypeDefinition, params System.Type[] typeArguments) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The native code for this instantiation might not be available at runtime.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
public virtual System.Type MakeGenericType(params System.Type[] typeArguments) { throw null; }
public virtual System.Type MakePointerType() { throw null; }
public static bool operator ==(System.Type? left, System.Type? right) { throw null; }
public static bool operator !=(System.Type? left, System.Type? right) { throw null; }
[System.ObsoleteAttribute("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0018", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Type? ReflectionOnlyGetType(string typeName, bool throwIfNotFound, bool ignoreCase) { throw null; }
public override string ToString() { throw null; }
}
public partial class TypeAccessException : System.TypeLoadException
{
public TypeAccessException() { }
protected TypeAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TypeAccessException(string? message) { }
public TypeAccessException(string? message, System.Exception? inner) { }
}
public enum TypeCode
{
Empty = 0,
Object = 1,
DBNull = 2,
Boolean = 3,
Char = 4,
SByte = 5,
Byte = 6,
Int16 = 7,
UInt16 = 8,
Int32 = 9,
UInt32 = 10,
Int64 = 11,
UInt64 = 12,
Single = 13,
Double = 14,
Decimal = 15,
DateTime = 16,
String = 18,
}
[System.CLSCompliantAttribute(false)]
public ref partial struct TypedReference
{
private object _dummy;
private int _dummyPrimitive;
public override bool Equals(object? o) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Type GetTargetType(System.TypedReference value) { throw null; }
public static System.TypedReference MakeTypedReference(object target, System.Reflection.FieldInfo[] flds) { throw null; }
public static void SetTypedReference(System.TypedReference target, object? value) { }
public static System.RuntimeTypeHandle TargetTypeToken(System.TypedReference value) { throw null; }
public static object ToObject(System.TypedReference value) { throw null; }
}
public sealed partial class TypeInitializationException : System.SystemException
{
public TypeInitializationException(string? fullTypeName, System.Exception? innerException) { }
public string TypeName { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class TypeLoadException : System.SystemException, System.Runtime.Serialization.ISerializable
{
public TypeLoadException() { }
protected TypeLoadException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TypeLoadException(string? message) { }
public TypeLoadException(string? message, System.Exception? inner) { }
public override string Message { get { throw null; } }
public string TypeName { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class TypeUnloadedException : System.SystemException
{
public TypeUnloadedException() { }
protected TypeUnloadedException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TypeUnloadedException(string? message) { }
public TypeUnloadedException(string? message, System.Exception? innerException) { }
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct UInt16 : System.IComparable, System.IComparable<ushort>, System.IConvertible, System.IEquatable<ushort>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<ushort>,
System.IMinMaxValue<ushort>,
System.IUnsignedNumber<ushort>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly ushort _dummyPrimitive;
public const ushort MaxValue = (ushort)65535;
public const ushort MinValue = (ushort)0;
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.UInt16 value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.UInt16 obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.UInt16 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.UInt16 Parse(string s) { throw null; }
public static System.UInt16 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.UInt16 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.UInt16 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
System.UInt16 System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt16 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.UInt16 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt16 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UInt16 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IAdditiveIdentity<ushort, ushort>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IMinMaxValue<ushort>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IMinMaxValue<ushort>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IMultiplicativeIdentity<ushort, ushort>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IAdditionOperators<ushort, ushort, ushort>.operator +(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.LeadingZeroCount(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.PopCount(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.RotateLeft(ushort value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.RotateRight(ushort value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryInteger<ushort>.TrailingZeroCount(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<ushort>.IsPow2(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBinaryNumber<ushort>.Log2(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBitwiseOperators<ushort, ushort, ushort>.operator &(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBitwiseOperators<ushort, ushort, ushort>.operator |(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBitwiseOperators<ushort, ushort, ushort>.operator ^(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IBitwiseOperators<ushort, ushort, ushort>.operator ~(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ushort, ushort>.operator <(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ushort, ushort>.operator <=(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ushort, ushort>.operator >(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ushort, ushort>.operator >=(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IDecrementOperators<ushort>.operator --(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IDivisionOperators<ushort, ushort, ushort>.operator /(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<ushort, ushort>.operator ==(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<ushort, ushort>.operator !=(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IIncrementOperators<ushort>.operator ++(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IModulusOperators<ushort, ushort, ushort>.operator %(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IMultiplyOperators<ushort, ushort, ushort>.operator *(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Abs(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Clamp(ushort value, ushort min, ushort max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (ushort Quotient, ushort Remainder) INumber<ushort>.DivRem(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Max(ushort x, ushort y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Min(ushort x, ushort y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort INumber<ushort>.Sign(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ushort>.TryCreate<TOther>(TOther value, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ushort>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ushort>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IParseable<ushort>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<ushort>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IShiftOperators<ushort, ushort>.operator <<(ushort value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IShiftOperators<ushort, ushort>.operator >>(ushort value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort ISpanParseable<ushort>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<ushort>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out ushort result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort ISubtractionOperators<ushort, ushort, ushort>.operator -(ushort left, ushort right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IUnaryNegationOperators<ushort, ushort>.operator -(ushort value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ushort IUnaryPlusOperators<ushort, ushort>.operator +(ushort value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct UInt32 : System.IComparable, System.IComparable<uint>, System.IConvertible, System.IEquatable<uint>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<uint>,
System.IMinMaxValue<uint>,
System.IUnsignedNumber<uint>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly uint _dummyPrimitive;
public const uint MaxValue = (uint)4294967295;
public const uint MinValue = (uint)0;
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.UInt32 value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.UInt32 obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.UInt32 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.UInt32 Parse(string s) { throw null; }
public static System.UInt32 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.UInt32 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.UInt32 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
System.UInt32 System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
ulong System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt32 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.UInt32 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt32 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UInt32 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IAdditiveIdentity<uint, uint>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IMinMaxValue<uint>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IMinMaxValue<uint>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IMultiplicativeIdentity<uint, uint>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IAdditionOperators<uint, uint, uint>.operator +(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.LeadingZeroCount(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.PopCount(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.RotateLeft(uint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.RotateRight(uint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryInteger<uint>.TrailingZeroCount(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<uint>.IsPow2(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBinaryNumber<uint>.Log2(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBitwiseOperators<uint, uint, uint>.operator &(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBitwiseOperators<uint, uint, uint>.operator |(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBitwiseOperators<uint, uint, uint>.operator ^(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IBitwiseOperators<uint, uint, uint>.operator ~(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<uint, uint>.operator <(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<uint, uint>.operator <=(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<uint, uint>.operator >(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<uint, uint>.operator >=(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IDecrementOperators<uint>.operator --(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IDivisionOperators<uint, uint, uint>.operator /(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<uint, uint>.operator ==(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<uint, uint>.operator !=(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IIncrementOperators<uint>.operator ++(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IModulusOperators<uint, uint, uint>.operator %(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IMultiplyOperators<uint, uint, uint>.operator *(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Abs(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Clamp(uint value, uint min, uint max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (uint Quotient, uint Remainder) INumber<uint>.DivRem(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Max(uint x, uint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Min(uint x, uint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint INumber<uint>.Sign(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<uint>.TryCreate<TOther>(TOther value, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<uint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<uint>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IParseable<uint>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<uint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IShiftOperators<uint, uint>.operator <<(uint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IShiftOperators<uint, uint>.operator >>(uint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint ISpanParseable<uint>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<uint>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out uint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint ISubtractionOperators<uint, uint, uint>.operator -(uint left, uint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IUnaryNegationOperators<uint, uint>.operator -(uint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static uint IUnaryPlusOperators<uint, uint>.operator +(uint value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct UInt64 : System.IComparable, System.IComparable<ulong>, System.IConvertible, System.IEquatable<ulong>, System.ISpanFormattable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<ulong>,
System.IMinMaxValue<ulong>,
System.IUnsignedNumber<ulong>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly ulong _dummyPrimitive;
public const ulong MaxValue = (ulong)18446744073709551615;
public const ulong MinValue = (ulong)0;
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.UInt64 value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.UInt64 obj) { throw null; }
public override int GetHashCode() { throw null; }
public System.TypeCode GetTypeCode() { throw null; }
public static System.UInt64 Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.UInt64 Parse(string s) { throw null; }
public static System.UInt64 Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.UInt64 Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.UInt64 Parse(string s, System.IFormatProvider? provider) { throw null; }
bool System.IConvertible.ToBoolean(System.IFormatProvider? provider) { throw null; }
byte System.IConvertible.ToByte(System.IFormatProvider? provider) { throw null; }
char System.IConvertible.ToChar(System.IFormatProvider? provider) { throw null; }
System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider? provider) { throw null; }
decimal System.IConvertible.ToDecimal(System.IFormatProvider? provider) { throw null; }
double System.IConvertible.ToDouble(System.IFormatProvider? provider) { throw null; }
short System.IConvertible.ToInt16(System.IFormatProvider? provider) { throw null; }
int System.IConvertible.ToInt32(System.IFormatProvider? provider) { throw null; }
long System.IConvertible.ToInt64(System.IFormatProvider? provider) { throw null; }
sbyte System.IConvertible.ToSByte(System.IFormatProvider? provider) { throw null; }
float System.IConvertible.ToSingle(System.IFormatProvider? provider) { throw null; }
object System.IConvertible.ToType(System.Type type, System.IFormatProvider? provider) { throw null; }
ushort System.IConvertible.ToUInt16(System.IFormatProvider? provider) { throw null; }
uint System.IConvertible.ToUInt32(System.IFormatProvider? provider) { throw null; }
System.UInt64 System.IConvertible.ToUInt64(System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt64 result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.UInt64 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UInt64 result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UInt64 result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IAdditiveIdentity<ulong, ulong>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IMinMaxValue<ulong>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IMinMaxValue<ulong>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IMultiplicativeIdentity<ulong, ulong>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IAdditionOperators<ulong, ulong, ulong>.operator +(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.LeadingZeroCount(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.PopCount(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.RotateLeft(ulong value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.RotateRight(ulong value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryInteger<ulong>.TrailingZeroCount(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<ulong>.IsPow2(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBinaryNumber<ulong>.Log2(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBitwiseOperators<ulong, ulong, ulong>.operator &(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBitwiseOperators<ulong, ulong, ulong>.operator |(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBitwiseOperators<ulong, ulong, ulong>.operator ^(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IBitwiseOperators<ulong, ulong, ulong>.operator ~(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ulong, ulong>.operator <(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ulong, ulong>.operator <=(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ulong, ulong>.operator >(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<ulong, ulong>.operator >=(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IDecrementOperators<ulong>.operator --(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IDivisionOperators<ulong, ulong, ulong>.operator /(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<ulong, ulong>.operator ==(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<ulong, ulong>.operator !=(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IIncrementOperators<ulong>.operator ++(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IModulusOperators<ulong, ulong, ulong>.operator %(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IMultiplyOperators<ulong, ulong, ulong>.operator *(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Abs(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Clamp(ulong value, ulong min, ulong max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (ulong Quotient, ulong Remainder) INumber<ulong>.DivRem(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Max(ulong x, ulong y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Min(ulong x, ulong y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong INumber<ulong>.Sign(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ulong>.TryCreate<TOther>(TOther value, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ulong>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<ulong>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IParseable<ulong>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<ulong>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IShiftOperators<ulong, ulong>.operator <<(ulong value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IShiftOperators<ulong, ulong>.operator >>(ulong value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong ISpanParseable<ulong>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<ulong>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out ulong result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong ISubtractionOperators<ulong, ulong, ulong>.operator -(ulong left, ulong right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IUnaryNegationOperators<ulong, ulong>.operator -(ulong value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static ulong IUnaryPlusOperators<ulong, ulong>.operator +(ulong value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
[System.CLSCompliantAttribute(false)]
public readonly partial struct UIntPtr : System.IComparable, System.IComparable<nuint>, System.IEquatable<nuint>, System.ISpanFormattable, System.Runtime.Serialization.ISerializable
#if FEATURE_GENERIC_MATH
#pragma warning disable SA1001
, System.IBinaryInteger<nuint>,
System.IMinMaxValue<nuint>,
System.IUnsignedNumber<nuint>
#pragma warning restore SA1001
#endif // FEATURE_GENERIC_MATH
{
private readonly int _dummyPrimitive;
public static readonly System.UIntPtr Zero;
public UIntPtr(uint value) { throw null; }
public UIntPtr(ulong value) { throw null; }
public unsafe UIntPtr(void* value) { throw null; }
public static System.UIntPtr MaxValue { get { throw null; } }
public static System.UIntPtr MinValue { get { throw null; } }
public static int Size { get { throw null; } }
public static System.UIntPtr Add(System.UIntPtr pointer, int offset) { throw null; }
public int CompareTo(object? value) { throw null; }
public int CompareTo(System.UIntPtr value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.UIntPtr other) { throw null; }
public override int GetHashCode() { throw null; }
public static System.UIntPtr operator +(System.UIntPtr pointer, int offset) { throw null; }
public static bool operator ==(System.UIntPtr value1, System.UIntPtr value2) { throw null; }
public static explicit operator System.UIntPtr (uint value) { throw null; }
public static explicit operator System.UIntPtr (ulong value) { throw null; }
public static explicit operator uint (System.UIntPtr value) { throw null; }
public static explicit operator ulong (System.UIntPtr value) { throw null; }
public unsafe static explicit operator void* (System.UIntPtr value) { throw null; }
public unsafe static explicit operator System.UIntPtr (void* value) { throw null; }
public static bool operator !=(System.UIntPtr value1, System.UIntPtr value2) { throw null; }
public static System.UIntPtr operator -(System.UIntPtr pointer, int offset) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format = default(System.ReadOnlySpan<char>), System.IFormatProvider? provider = null) { throw null; }
public static System.UIntPtr Parse(string s) { throw null; }
public static System.UIntPtr Parse(string s, System.Globalization.NumberStyles style) { throw null; }
public static System.UIntPtr Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
public static System.UIntPtr Parse(string s, System.IFormatProvider? provider) { throw null; }
public static System.UIntPtr Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style = System.Globalization.NumberStyles.Integer, System.IFormatProvider? provider = null) { throw null; }
public static System.UIntPtr Subtract(System.UIntPtr pointer, int offset) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public unsafe void* ToPointer() { throw null; }
public override string ToString() { throw null; }
public string ToString(System.IFormatProvider? provider) { throw null; }
public string ToString(string? format) { throw null; }
public string ToString(string? format, System.IFormatProvider? provider) { throw null; }
public uint ToUInt32() { throw null; }
public ulong ToUInt64() { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UIntPtr result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, out System.UIntPtr result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, out System.UIntPtr result) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out System.UIntPtr result) { throw null; }
#if FEATURE_GENERIC_MATH
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IAdditiveIdentity<nuint, nuint>.AdditiveIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IMinMaxValue<nuint>.MinValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IMinMaxValue<nuint>.MaxValue { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IMultiplicativeIdentity<nuint, nuint>.MultiplicativeIdentity { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.One { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Zero { get { throw null; } }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IAdditionOperators<nuint, nuint, nuint>.operator +(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.LeadingZeroCount(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.PopCount(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.RotateLeft(nuint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.RotateRight(nuint value, int rotateAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryInteger<nuint>.TrailingZeroCount(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IBinaryNumber<nuint>.IsPow2(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBinaryNumber<nuint>.Log2(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBitwiseOperators<nuint, nuint, nuint>.operator &(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBitwiseOperators<nuint, nuint, nuint>.operator |(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBitwiseOperators<nuint, nuint, nuint>.operator ^(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IBitwiseOperators<nuint, nuint, nuint>.operator ~(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nuint, nuint>.operator <(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nuint, nuint>.operator <=(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nuint, nuint>.operator >(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IComparisonOperators<nuint, nuint>.operator >=(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IDecrementOperators<nuint>.operator --(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IDivisionOperators<nuint, nuint, nuint>.operator /(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<nuint, nuint>.operator ==(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IEqualityOperators<nuint, nuint>.operator !=(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IIncrementOperators<nuint>.operator ++(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IModulusOperators<nuint, nuint, nuint>.operator %(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IMultiplyOperators<nuint, nuint, nuint>.operator *(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Abs(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Clamp(nuint value, nuint min, nuint max) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Create<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.CreateSaturating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.CreateTruncating<TOther>(TOther value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static (nuint Quotient, nuint Remainder) INumber<nuint>.DivRem(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Max(nuint x, nuint y) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Min(nuint x, nuint y) { throw null; }[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Parse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint INumber<nuint>.Sign(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nuint>.TryCreate<TOther>(TOther value, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nuint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool INumber<nuint>.TryParse(System.ReadOnlySpan<char> s, System.Globalization.NumberStyles style, System.IFormatProvider? provider, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IParseable<nuint>.Parse(string s, System.IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool IParseable<nuint>.TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? s, System.IFormatProvider? provider, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IShiftOperators<nuint, nuint>.operator <<(nuint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IShiftOperators<nuint, nuint>.operator >>(nuint value, int shiftAmount) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint ISpanParseable<nuint>.Parse(System.ReadOnlySpan<char> s, IFormatProvider? provider) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static bool ISpanParseable<nuint>.TryParse(System.ReadOnlySpan<char> s, System.IFormatProvider? provider, out nuint result) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint ISubtractionOperators<nuint, nuint, nuint>.operator -(nuint left, nuint right) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IUnaryNegationOperators<nuint, nuint>.operator -(nuint value) { throw null; }
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
static nuint IUnaryPlusOperators<nuint, nuint>.operator +(nuint value) { throw null; }
#endif // FEATURE_GENERIC_MATH
}
public partial class UnauthorizedAccessException : System.SystemException
{
public UnauthorizedAccessException() { }
protected UnauthorizedAccessException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public UnauthorizedAccessException(string? message) { }
public UnauthorizedAccessException(string? message, System.Exception? inner) { }
}
public partial class UnhandledExceptionEventArgs : System.EventArgs
{
public UnhandledExceptionEventArgs(object exception, bool isTerminating) { }
public object ExceptionObject { get { throw null; } }
public bool IsTerminating { get { throw null; } }
}
public delegate void UnhandledExceptionEventHandler(object sender, System.UnhandledExceptionEventArgs e);
public partial class Uri : System.Runtime.Serialization.ISerializable
{
public static readonly string SchemeDelimiter;
public static readonly string UriSchemeFile;
public static readonly string UriSchemeFtp;
public static readonly string UriSchemeFtps;
public static readonly string UriSchemeGopher;
public static readonly string UriSchemeHttp;
public static readonly string UriSchemeHttps;
public static readonly string UriSchemeMailto;
public static readonly string UriSchemeNetPipe;
public static readonly string UriSchemeNetTcp;
public static readonly string UriSchemeNews;
public static readonly string UriSchemeNntp;
public static readonly string UriSchemeSftp;
public static readonly string UriSchemeSsh;
public static readonly string UriSchemeTelnet;
public static readonly string UriSchemeWs;
public static readonly string UriSchemeWss;
protected Uri(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public Uri(string uriString) { }
[System.ObsoleteAttribute("This constructor has been deprecated; the dontEscape parameter is always false. Use Uri(string) instead.")]
public Uri(string uriString, bool dontEscape) { }
public Uri(string uriString, in System.UriCreationOptions creationOptions) { }
public Uri(string uriString, System.UriKind uriKind) { }
public Uri(System.Uri baseUri, string? relativeUri) { }
[System.ObsoleteAttribute("This constructor has been deprecated; the dontEscape parameter is always false. Use Uri(Uri, string) instead.")]
public Uri(System.Uri baseUri, string? relativeUri, bool dontEscape) { }
public Uri(System.Uri baseUri, System.Uri relativeUri) { }
public string AbsolutePath { get { throw null; } }
public string AbsoluteUri { get { throw null; } }
public string Authority { get { throw null; } }
public string DnsSafeHost { get { throw null; } }
public string Fragment { get { throw null; } }
public string Host { get { throw null; } }
public System.UriHostNameType HostNameType { get { throw null; } }
public string IdnHost { get { throw null; } }
public bool IsAbsoluteUri { get { throw null; } }
public bool IsDefaultPort { get { throw null; } }
public bool IsFile { get { throw null; } }
public bool IsLoopback { get { throw null; } }
public bool IsUnc { get { throw null; } }
public string LocalPath { get { throw null; } }
public string OriginalString { get { throw null; } }
public string PathAndQuery { get { throw null; } }
public int Port { get { throw null; } }
public string Query { get { throw null; } }
public string Scheme { get { throw null; } }
public string[] Segments { get { throw null; } }
public bool UserEscaped { get { throw null; } }
public string UserInfo { get { throw null; } }
[System.ObsoleteAttribute("Uri.Canonicalize has been deprecated and is not supported.")]
protected virtual void Canonicalize() { }
public static System.UriHostNameType CheckHostName(string? name) { throw null; }
public static bool CheckSchemeName([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? schemeName) { throw null; }
[System.ObsoleteAttribute("Uri.CheckSecurity has been deprecated and is not supported.")]
protected virtual void CheckSecurity() { }
public static int Compare(System.Uri? uri1, System.Uri? uri2, System.UriComponents partsToCompare, System.UriFormat compareFormat, System.StringComparison comparisonType) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? comparand) { throw null; }
[System.ObsoleteAttribute("Uri.Escape has been deprecated and is not supported.")]
protected virtual void Escape() { }
public static string EscapeDataString(string stringToEscape) { throw null; }
[System.ObsoleteAttribute("Uri.EscapeString has been deprecated. Use GetComponents() or Uri.EscapeDataString to escape a Uri component or a string.")]
protected static string EscapeString(string? str) { throw null; }
[System.ObsoleteAttribute("Uri.EscapeUriString can corrupt the Uri string in some cases. Consider using Uri.EscapeDataString for query string components instead.", DiagnosticId = "SYSLIB0013", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static string EscapeUriString(string stringToEscape) { throw null; }
public static int FromHex(char digit) { throw null; }
public string GetComponents(System.UriComponents components, System.UriFormat format) { throw null; }
public override int GetHashCode() { throw null; }
public string GetLeftPart(System.UriPartial part) { throw null; }
protected void GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public static string HexEscape(char character) { throw null; }
public static char HexUnescape(string pattern, ref int index) { throw null; }
[System.ObsoleteAttribute("Uri.IsBadFileSystemCharacter has been deprecated and is not supported.")]
protected virtual bool IsBadFileSystemCharacter(char character) { throw null; }
public bool IsBaseOf(System.Uri uri) { throw null; }
[System.ObsoleteAttribute("Uri.IsExcludedCharacter has been deprecated and is not supported.")]
protected static bool IsExcludedCharacter(char character) { throw null; }
public static bool IsHexDigit(char character) { throw null; }
public static bool IsHexEncoding(string pattern, int index) { throw null; }
[System.ObsoleteAttribute("Uri.IsReservedCharacter has been deprecated and is not supported.")]
protected virtual bool IsReservedCharacter(char character) { throw null; }
public bool IsWellFormedOriginalString() { throw null; }
public static bool IsWellFormedUriString([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? uriString, System.UriKind uriKind) { throw null; }
[System.ObsoleteAttribute("Uri.MakeRelative has been deprecated. Use MakeRelativeUri(Uri uri) instead.")]
public string MakeRelative(System.Uri toUri) { throw null; }
public System.Uri MakeRelativeUri(System.Uri uri) { throw null; }
public static bool operator ==(System.Uri? uri1, System.Uri? uri2) { throw null; }
public static bool operator !=(System.Uri? uri1, System.Uri? uri2) { throw null; }
[System.ObsoleteAttribute("Uri.Parse has been deprecated and is not supported.")]
protected virtual void Parse() { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public override string ToString() { throw null; }
public static bool TryCreate([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? uriString, in System.UriCreationOptions creationOptions, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Uri? result) { throw null; }
public static bool TryCreate([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? uriString, System.UriKind uriKind, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Uri? result) { throw null; }
public static bool TryCreate(System.Uri? baseUri, string? relativeUri, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Uri? result) { throw null; }
public static bool TryCreate(System.Uri? baseUri, System.Uri? relativeUri, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Uri? result) { throw null; }
[System.ObsoleteAttribute("Uri.Unescape has been deprecated. Use GetComponents() or Uri.UnescapeDataString() to unescape a Uri component or a string.")]
protected virtual string Unescape(string path) { throw null; }
public static string UnescapeDataString(string stringToUnescape) { throw null; }
}
public partial class UriBuilder
{
public UriBuilder() { }
public UriBuilder(string uri) { }
public UriBuilder(string? schemeName, string? hostName) { }
public UriBuilder(string? scheme, string? host, int portNumber) { }
public UriBuilder(string? scheme, string? host, int port, string? pathValue) { }
public UriBuilder(string? scheme, string? host, int port, string? path, string? extraValue) { }
public UriBuilder(System.Uri uri) { }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Fragment { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Host { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Password { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Path { get { throw null; } set { } }
public int Port { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Query { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string Scheme { get { throw null; } set { } }
public System.Uri Uri { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public string UserName { get { throw null; } set { } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? rparam) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum UriComponents
{
SerializationInfoString = -2147483648,
Scheme = 1,
UserInfo = 2,
Host = 4,
Port = 8,
SchemeAndServer = 13,
Path = 16,
Query = 32,
PathAndQuery = 48,
HttpRequestUrl = 61,
Fragment = 64,
AbsoluteUri = 127,
StrongPort = 128,
HostAndPort = 132,
StrongAuthority = 134,
NormalizedHost = 256,
KeepDelimiter = 1073741824,
}
public partial struct UriCreationOptions
{
private int _dummyPrimitive;
public bool DangerousDisablePathAndQueryCanonicalization { readonly get { throw null; } set { } }
}
public enum UriFormat
{
UriEscaped = 1,
Unescaped = 2,
SafeUnescaped = 3,
}
public partial class UriFormatException : System.FormatException, System.Runtime.Serialization.ISerializable
{
public UriFormatException() { }
protected UriFormatException(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
public UriFormatException(string? textString) { }
public UriFormatException(string? textString, System.Exception? e) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext) { }
}
public enum UriHostNameType
{
Unknown = 0,
Basic = 1,
Dns = 2,
IPv4 = 3,
IPv6 = 4,
}
public enum UriKind
{
RelativeOrAbsolute = 0,
Absolute = 1,
Relative = 2,
}
public abstract partial class UriParser
{
protected UriParser() { }
protected virtual string GetComponents(System.Uri uri, System.UriComponents components, System.UriFormat format) { throw null; }
protected virtual void InitializeAndValidate(System.Uri uri, out System.UriFormatException? parsingError) { throw null; }
protected virtual bool IsBaseOf(System.Uri baseUri, System.Uri relativeUri) { throw null; }
public static bool IsKnownScheme(string schemeName) { throw null; }
protected virtual bool IsWellFormedOriginalString(System.Uri uri) { throw null; }
protected virtual System.UriParser OnNewUri() { throw null; }
protected virtual void OnRegister(string schemeName, int defaultPort) { }
public static void Register(System.UriParser uriParser, string schemeName, int defaultPort) { }
protected virtual string? Resolve(System.Uri baseUri, System.Uri? relativeUri, out System.UriFormatException? parsingError) { throw null; }
}
public enum UriPartial
{
Scheme = 0,
Authority = 1,
Path = 2,
Query = 3,
}
public partial struct ValueTuple : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<System.ValueTuple>, System.IEquatable<System.ValueTuple>, System.Runtime.CompilerServices.ITuple
{
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo(System.ValueTuple other) { throw null; }
public static System.ValueTuple Create() { throw null; }
public static System.ValueTuple<T1> Create<T1>(T1 item1) { throw null; }
public static (T1, T2) Create<T1, T2>(T1 item1, T2 item2) { throw null; }
public static (T1, T2, T3) Create<T1, T2, T3>(T1 item1, T2 item2, T3 item3) { throw null; }
public static (T1, T2, T3, T4) Create<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4) { throw null; }
public static (T1, T2, T3, T4, T5) Create<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { throw null; }
public static (T1, T2, T3, T4, T5, T6) Create<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7) Create<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { throw null; }
public static (T1, T2, T3, T4, T5, T6, T7, T8) Create<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.ValueTuple other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<System.ValueTuple<T1>>, System.IEquatable<System.ValueTuple<T1>>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public ValueTuple(T1 item1) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo(System.ValueTuple<T1> other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.ValueTuple<T1> other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2)>, System.IEquatable<(T1, T2)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public ValueTuple(T1 item1, T2 item2) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3)>, System.IEquatable<(T1, T2, T3)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public ValueTuple(T1 item1, T2 item2, T3 item3) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3, T4)>, System.IEquatable<(T1, T2, T3, T4)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3, T4) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3, T4) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4, T5> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3, T4, T5)>, System.IEquatable<(T1, T2, T3, T4, T5)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3, T4, T5) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3, T4, T5) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4, T5, T6> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3, T4, T5, T6)>, System.IEquatable<(T1, T2, T3, T4, T5, T6)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
public T6 Item6;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3, T4, T5, T6) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3, T4, T5, T6) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4, T5, T6, T7> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<(T1, T2, T3, T4, T5, T6, T7)>, System.IEquatable<(T1, T2, T3, T4, T5, T6, T7)>, System.Runtime.CompilerServices.ITuple
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
public T6 Item6;
public T7 Item7;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo((T1, T2, T3, T4, T5, T6, T7) other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals((T1, T2, T3, T4, T5, T6, T7) other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public partial struct ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> : System.Collections.IStructuralComparable, System.Collections.IStructuralEquatable, System.IComparable, System.IComparable<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>>, System.IEquatable<System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest>>, System.Runtime.CompilerServices.ITuple where TRest : struct
{
public T1 Item1;
public T2 Item2;
public T3 Item3;
public T4 Item4;
public T5 Item5;
public T6 Item6;
public T7 Item7;
public TRest Rest;
public ValueTuple(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) { throw null; }
object? System.Runtime.CompilerServices.ITuple.this[int index] { get { throw null; } }
int System.Runtime.CompilerServices.ITuple.Length { get { throw null; } }
public int CompareTo(System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.ValueTuple<T1, T2, T3, T4, T5, T6, T7, TRest> other) { throw null; }
public override int GetHashCode() { throw null; }
int System.Collections.IStructuralComparable.CompareTo(object? other, System.Collections.IComparer comparer) { throw null; }
bool System.Collections.IStructuralEquatable.Equals(object? other, System.Collections.IEqualityComparer comparer) { throw null; }
int System.Collections.IStructuralEquatable.GetHashCode(System.Collections.IEqualityComparer comparer) { throw null; }
int System.IComparable.CompareTo(object? other) { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class ValueType
{
protected ValueType() { }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public override string? ToString() { throw null; }
}
public sealed partial class Version : System.ICloneable, System.IComparable, System.IComparable<System.Version?>, System.IEquatable<System.Version?>, System.IFormattable, System.ISpanFormattable
{
public Version() { }
public Version(int major, int minor) { }
public Version(int major, int minor, int build) { }
public Version(int major, int minor, int build, int revision) { }
public Version(string version) { }
public int Build { get { throw null; } }
public int Major { get { throw null; } }
public short MajorRevision { get { throw null; } }
public int Minor { get { throw null; } }
public short MinorRevision { get { throw null; } }
public int Revision { get { throw null; } }
public object Clone() { throw null; }
public int CompareTo(object? version) { throw null; }
public int CompareTo(System.Version? value) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Version? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator >(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator >=(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator !=(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator <(System.Version? v1, System.Version? v2) { throw null; }
public static bool operator <=(System.Version? v1, System.Version? v2) { throw null; }
public static System.Version Parse(System.ReadOnlySpan<char> input) { throw null; }
public static System.Version Parse(string input) { throw null; }
string System.IFormattable.ToString(string? format, System.IFormatProvider? formatProvider) { throw null; }
bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw null; }
public override string ToString() { throw null; }
public string ToString(int fieldCount) { throw null; }
public bool TryFormat(System.Span<char> destination, int fieldCount, out int charsWritten) { throw null; }
public bool TryFormat(System.Span<char> destination, out int charsWritten) { throw null; }
public static bool TryParse(System.ReadOnlySpan<char> input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Version? result) { throw null; }
public static bool TryParse([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? input, [System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out System.Version? result) { throw null; }
}
public partial struct Void
{
}
public partial class WeakReference : System.Runtime.Serialization.ISerializable
{
public WeakReference(object? target) { }
public WeakReference(object? target, bool trackResurrection) { }
protected WeakReference(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public virtual bool IsAlive { get { throw null; } }
public virtual object? Target { get { throw null; } set { } }
public virtual bool TrackResurrection { get { throw null; } }
~WeakReference() { }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public sealed partial class WeakReference<T> : System.Runtime.Serialization.ISerializable where T : class?
{
public WeakReference(T target) { }
public WeakReference(T target, bool trackResurrection) { }
~WeakReference() { }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public void SetTarget(T target) { }
public bool TryGetTarget([System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false), System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] out T target) { throw null; }
}
}
namespace System.Buffers
{
public abstract partial class ArrayPool<T>
{
protected ArrayPool() { }
public static System.Buffers.ArrayPool<T> Shared { get { throw null; } }
public static System.Buffers.ArrayPool<T> Create() { throw null; }
public static System.Buffers.ArrayPool<T> Create(int maxArrayLength, int maxArraysPerBucket) { throw null; }
public abstract T[] Rent(int minimumLength);
public abstract void Return(T[] array, bool clearArray = false);
}
public partial interface IMemoryOwner<T> : System.IDisposable
{
System.Memory<T> Memory { get; }
}
public partial interface IPinnable
{
System.Buffers.MemoryHandle Pin(int elementIndex);
void Unpin();
}
public partial struct MemoryHandle : System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
[System.CLSCompliantAttribute(false)]
public unsafe MemoryHandle(void* pointer, System.Runtime.InteropServices.GCHandle handle = default(System.Runtime.InteropServices.GCHandle), System.Buffers.IPinnable? pinnable = null) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe void* Pointer { get { throw null; } }
public void Dispose() { }
}
public abstract partial class MemoryManager<T> : System.Buffers.IMemoryOwner<T>, System.Buffers.IPinnable, System.IDisposable
{
protected MemoryManager() { }
public virtual System.Memory<T> Memory { get { throw null; } }
protected System.Memory<T> CreateMemory(int length) { throw null; }
protected System.Memory<T> CreateMemory(int start, int length) { throw null; }
protected abstract void Dispose(bool disposing);
public abstract System.Span<T> GetSpan();
public abstract System.Buffers.MemoryHandle Pin(int elementIndex = 0);
void System.IDisposable.Dispose() { }
protected internal virtual bool TryGetArray(out System.ArraySegment<T> segment) { throw null; }
public abstract void Unpin();
}
public enum OperationStatus
{
Done = 0,
DestinationTooSmall = 1,
NeedMoreData = 2,
InvalidData = 3,
}
public delegate void ReadOnlySpanAction<T, in TArg>(System.ReadOnlySpan<T> span, TArg arg);
public delegate void SpanAction<T, in TArg>(System.Span<T> span, TArg arg);
}
namespace System.CodeDom.Compiler
{
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false, AllowMultiple=false)]
public sealed partial class GeneratedCodeAttribute : System.Attribute
{
public GeneratedCodeAttribute(string? tool, string? version) { }
public string? Tool { get { throw null; } }
public string? Version { get { throw null; } }
}
public partial class IndentedTextWriter : System.IO.TextWriter
{
public const string DefaultTabString = " ";
public IndentedTextWriter(System.IO.TextWriter writer) { }
public IndentedTextWriter(System.IO.TextWriter writer, string tabString) { }
public override System.Text.Encoding Encoding { get { throw null; } }
public int Indent { get { throw null; } set { } }
public System.IO.TextWriter InnerWriter { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public override string NewLine { get { throw null; } set { } }
public override void Close() { }
public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync() { throw null; }
protected virtual void OutputTabs() { }
protected virtual System.Threading.Tasks.Task OutputTabsAsync() { throw null; }
public override void Write(bool value) { }
public override void Write(char value) { }
public override void Write(char[]? buffer) { }
public override void Write(char[] buffer, int index, int count) { }
public override void Write(double value) { }
public override void Write(int value) { }
public override void Write(long value) { }
public override void Write(object? value) { }
public override void Write(float value) { }
public override void Write(string? s) { }
public override void Write(string format, object? arg0) { }
public override void Write(string format, object? arg0, object? arg1) { }
public override void Write(string format, params object?[] arg) { }
public override System.Threading.Tasks.Task WriteAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(string? value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteLine() { }
public override void WriteLine(bool value) { }
public override void WriteLine(char value) { }
public override void WriteLine(char[]? buffer) { }
public override void WriteLine(char[] buffer, int index, int count) { }
public override void WriteLine(double value) { }
public override void WriteLine(int value) { }
public override void WriteLine(long value) { }
public override void WriteLine(object? value) { }
public override void WriteLine(float value) { }
public override void WriteLine(string? s) { }
public override void WriteLine(string format, object? arg0) { }
public override void WriteLine(string format, object? arg0, object? arg1) { }
public override void WriteLine(string format, params object?[] arg) { }
[System.CLSCompliantAttribute(false)]
public override void WriteLine(uint value) { }
public override System.Threading.Tasks.Task WriteLineAsync() { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(string? value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public void WriteLineNoTabs(string? s) { }
public System.Threading.Tasks.Task WriteLineNoTabsAsync(string? s) { throw null; }
}
}
namespace System.Collections
{
public partial class ArrayList : System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList, System.ICloneable
{
public ArrayList() { }
public ArrayList(System.Collections.ICollection c) { }
public ArrayList(int capacity) { }
public virtual int Capacity { get { throw null; } set { } }
public virtual int Count { get { throw null; } }
public virtual bool IsFixedSize { get { throw null; } }
public virtual bool IsReadOnly { get { throw null; } }
public virtual bool IsSynchronized { get { throw null; } }
public virtual object? this[int index] { get { throw null; } set { } }
public virtual object SyncRoot { get { throw null; } }
public static System.Collections.ArrayList Adapter(System.Collections.IList list) { throw null; }
public virtual int Add(object? value) { throw null; }
public virtual void AddRange(System.Collections.ICollection c) { }
public virtual int BinarySearch(int index, int count, object? value, System.Collections.IComparer? comparer) { throw null; }
public virtual int BinarySearch(object? value) { throw null; }
public virtual int BinarySearch(object? value, System.Collections.IComparer? comparer) { throw null; }
public virtual void Clear() { }
public virtual object Clone() { throw null; }
public virtual bool Contains(object? item) { throw null; }
public virtual void CopyTo(System.Array array) { }
public virtual void CopyTo(System.Array array, int arrayIndex) { }
public virtual void CopyTo(int index, System.Array array, int arrayIndex, int count) { }
public static System.Collections.ArrayList FixedSize(System.Collections.ArrayList list) { throw null; }
public static System.Collections.IList FixedSize(System.Collections.IList list) { throw null; }
public virtual System.Collections.IEnumerator GetEnumerator() { throw null; }
public virtual System.Collections.IEnumerator GetEnumerator(int index, int count) { throw null; }
public virtual System.Collections.ArrayList GetRange(int index, int count) { throw null; }
public virtual int IndexOf(object? value) { throw null; }
public virtual int IndexOf(object? value, int startIndex) { throw null; }
public virtual int IndexOf(object? value, int startIndex, int count) { throw null; }
public virtual void Insert(int index, object? value) { }
public virtual void InsertRange(int index, System.Collections.ICollection c) { }
public virtual int LastIndexOf(object? value) { throw null; }
public virtual int LastIndexOf(object? value, int startIndex) { throw null; }
public virtual int LastIndexOf(object? value, int startIndex, int count) { throw null; }
public static System.Collections.ArrayList ReadOnly(System.Collections.ArrayList list) { throw null; }
public static System.Collections.IList ReadOnly(System.Collections.IList list) { throw null; }
public virtual void Remove(object? obj) { }
public virtual void RemoveAt(int index) { }
public virtual void RemoveRange(int index, int count) { }
public static System.Collections.ArrayList Repeat(object? value, int count) { throw null; }
public virtual void Reverse() { }
public virtual void Reverse(int index, int count) { }
public virtual void SetRange(int index, System.Collections.ICollection c) { }
public virtual void Sort() { }
public virtual void Sort(System.Collections.IComparer? comparer) { }
public virtual void Sort(int index, int count, System.Collections.IComparer? comparer) { }
public static System.Collections.ArrayList Synchronized(System.Collections.ArrayList list) { throw null; }
public static System.Collections.IList Synchronized(System.Collections.IList list) { throw null; }
public virtual object?[] ToArray() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The code for an array of the specified type might not be available.")]
public virtual System.Array ToArray(System.Type type) { throw null; }
public virtual void TrimToSize() { }
}
public sealed partial class Comparer : System.Collections.IComparer, System.Runtime.Serialization.ISerializable
{
public static readonly System.Collections.Comparer Default;
public static readonly System.Collections.Comparer DefaultInvariant;
public Comparer(System.Globalization.CultureInfo culture) { }
public int Compare(object? a, object? b) { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial struct DictionaryEntry
{
private object _dummy;
private int _dummyPrimitive;
public DictionaryEntry(object key, object? value) { throw null; }
public object Key { get { throw null; } set { } }
public object? Value { get { throw null; } set { } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public void Deconstruct(out object key, out object? value) { throw null; }
}
public partial class Hashtable : System.Collections.ICollection, System.Collections.IDictionary, System.Collections.IEnumerable, System.ICloneable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
public Hashtable() { }
public Hashtable(System.Collections.IDictionary d) { }
public Hashtable(System.Collections.IDictionary d, System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(IDictionary, IEqualityComparer) instead.")]
public Hashtable(System.Collections.IDictionary d, System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
public Hashtable(System.Collections.IDictionary d, float loadFactor) { }
public Hashtable(System.Collections.IDictionary d, float loadFactor, System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(IDictionary, float, IEqualityComparer) instead.")]
public Hashtable(System.Collections.IDictionary d, float loadFactor, System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
public Hashtable(System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(IEqualityComparer) instead.")]
public Hashtable(System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
public Hashtable(int capacity) { }
public Hashtable(int capacity, System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(int, IEqualityComparer) instead.")]
public Hashtable(int capacity, System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
public Hashtable(int capacity, float loadFactor) { }
public Hashtable(int capacity, float loadFactor, System.Collections.IEqualityComparer? equalityComparer) { }
[System.ObsoleteAttribute("This constructor has been deprecated. Use Hashtable(int, float, IEqualityComparer) instead.")]
public Hashtable(int capacity, float loadFactor, System.Collections.IHashCodeProvider? hcp, System.Collections.IComparer? comparer) { }
protected Hashtable(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
[System.ObsoleteAttribute("Hashtable.comparer has been deprecated. Use the KeyComparer properties instead.")]
protected System.Collections.IComparer? comparer { get { throw null; } set { } }
public virtual int Count { get { throw null; } }
protected System.Collections.IEqualityComparer? EqualityComparer { get { throw null; } }
[System.ObsoleteAttribute("Hashtable.hcp has been deprecated. Use the EqualityComparer property instead.")]
protected System.Collections.IHashCodeProvider? hcp { get { throw null; } set { } }
public virtual bool IsFixedSize { get { throw null; } }
public virtual bool IsReadOnly { get { throw null; } }
public virtual bool IsSynchronized { get { throw null; } }
public virtual object? this[object key] { get { throw null; } set { } }
public virtual System.Collections.ICollection Keys { get { throw null; } }
public virtual object SyncRoot { get { throw null; } }
public virtual System.Collections.ICollection Values { get { throw null; } }
public virtual void Add(object key, object? value) { }
public virtual void Clear() { }
public virtual object Clone() { throw null; }
public virtual bool Contains(object key) { throw null; }
public virtual bool ContainsKey(object key) { throw null; }
public virtual bool ContainsValue(object? value) { throw null; }
public virtual void CopyTo(System.Array array, int arrayIndex) { }
public virtual System.Collections.IDictionaryEnumerator GetEnumerator() { throw null; }
protected virtual int GetHash(object key) { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
protected virtual bool KeyEquals(object? item, object key) { throw null; }
public virtual void OnDeserialization(object? sender) { }
public virtual void Remove(object key) { }
public static System.Collections.Hashtable Synchronized(System.Collections.Hashtable table) { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public partial interface ICollection : System.Collections.IEnumerable
{
int Count { get; }
bool IsSynchronized { get; }
object SyncRoot { get; }
void CopyTo(System.Array array, int index);
}
public partial interface IComparer
{
int Compare(object? x, object? y);
}
public partial interface IDictionary : System.Collections.ICollection, System.Collections.IEnumerable
{
bool IsFixedSize { get; }
bool IsReadOnly { get; }
object? this[object key] { get; set; }
System.Collections.ICollection Keys { get; }
System.Collections.ICollection Values { get; }
void Add(object key, object? value);
void Clear();
bool Contains(object key);
new System.Collections.IDictionaryEnumerator GetEnumerator();
void Remove(object key);
}
public partial interface IDictionaryEnumerator : System.Collections.IEnumerator
{
System.Collections.DictionaryEntry Entry { get; }
object Key { get; }
object? Value { get; }
}
public partial interface IEnumerable
{
System.Collections.IEnumerator GetEnumerator();
}
public partial interface IEnumerator
{
#nullable disable // explicitly leaving Current as "oblivious" to avoid spurious warnings in foreach over non-generic enumerables
object Current { get; }
#nullable restore
bool MoveNext();
void Reset();
}
public partial interface IEqualityComparer
{
bool Equals(object? x, object? y);
int GetHashCode(object obj);
}
[System.ObsoleteAttribute("IHashCodeProvider has been deprecated. Use IEqualityComparer instead.")]
public partial interface IHashCodeProvider
{
int GetHashCode(object obj);
}
public partial interface IList : System.Collections.ICollection, System.Collections.IEnumerable
{
bool IsFixedSize { get; }
bool IsReadOnly { get; }
object? this[int index] { get; set; }
int Add(object? value);
void Clear();
bool Contains(object? value);
int IndexOf(object? value);
void Insert(int index, object? value);
void Remove(object? value);
void RemoveAt(int index);
}
public partial interface IStructuralComparable
{
int CompareTo(object? other, System.Collections.IComparer comparer);
}
public partial interface IStructuralEquatable
{
bool Equals(object? other, System.Collections.IEqualityComparer comparer);
int GetHashCode(System.Collections.IEqualityComparer comparer);
}
}
namespace System.Collections.Generic
{
public partial interface IAsyncEnumerable<out T>
{
System.Collections.Generic.IAsyncEnumerator<T> GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
}
public partial interface IAsyncEnumerator<out T> : System.IAsyncDisposable
{
T Current { get; }
System.Threading.Tasks.ValueTask<bool> MoveNextAsync();
}
public partial interface ICollection<T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
{
int Count { get; }
bool IsReadOnly { get; }
void Add(T item);
void Clear();
bool Contains(T item);
void CopyTo(T[] array, int arrayIndex);
bool Remove(T item);
}
public partial interface IComparer<in T>
{
int Compare(T? x, T? y);
}
public partial interface IDictionary<TKey, TValue> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable
{
TValue this[TKey key] { get; set; }
System.Collections.Generic.ICollection<TKey> Keys { get; }
System.Collections.Generic.ICollection<TValue> Values { get; }
void Add(TKey key, TValue value);
bool ContainsKey(TKey key);
bool Remove(TKey key);
bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value);
}
public partial interface IEnumerable<out T> : System.Collections.IEnumerable
{
new System.Collections.Generic.IEnumerator<T> GetEnumerator();
}
public partial interface IEnumerator<out T> : System.Collections.IEnumerator, System.IDisposable
{
new T Current { get; }
}
public partial interface IEqualityComparer<in T>
{
bool Equals(T? x, T? y);
int GetHashCode([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T obj);
}
public partial interface IList<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
{
T this[int index] { get; set; }
int IndexOf(T item);
void Insert(int index, T item);
void RemoveAt(int index);
}
public partial interface IReadOnlyCollection<out T> : System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
{
int Count { get; }
}
public partial interface IReadOnlyDictionary<TKey, TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable
{
TValue this[TKey key] { get; }
System.Collections.Generic.IEnumerable<TKey> Keys { get; }
System.Collections.Generic.IEnumerable<TValue> Values { get; }
bool ContainsKey(TKey key);
bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value);
}
public partial interface IReadOnlyList<out T> : System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.IEnumerable
{
T this[int index] { get; }
}
public partial interface IReadOnlySet<T> : System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.IEnumerable
{
bool Contains(T item);
bool IsProperSubsetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsProperSupersetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsSubsetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsSupersetOf(System.Collections.Generic.IEnumerable<T> other);
bool Overlaps(System.Collections.Generic.IEnumerable<T> other);
bool SetEquals(System.Collections.Generic.IEnumerable<T> other);
}
public partial interface ISet<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.IEnumerable
{
new bool Add(T item);
void ExceptWith(System.Collections.Generic.IEnumerable<T> other);
void IntersectWith(System.Collections.Generic.IEnumerable<T> other);
bool IsProperSubsetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsProperSupersetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsSubsetOf(System.Collections.Generic.IEnumerable<T> other);
bool IsSupersetOf(System.Collections.Generic.IEnumerable<T> other);
bool Overlaps(System.Collections.Generic.IEnumerable<T> other);
bool SetEquals(System.Collections.Generic.IEnumerable<T> other);
void SymmetricExceptWith(System.Collections.Generic.IEnumerable<T> other);
void UnionWith(System.Collections.Generic.IEnumerable<T> other);
}
public partial class KeyNotFoundException : System.SystemException
{
public KeyNotFoundException() { }
protected KeyNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public KeyNotFoundException(string? message) { }
public KeyNotFoundException(string? message, System.Exception? innerException) { }
}
public static partial class KeyValuePair
{
public static System.Collections.Generic.KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey key, TValue value) { throw null; }
}
public readonly partial struct KeyValuePair<TKey, TValue>
{
private readonly TKey key;
private readonly TValue value;
private readonly int _dummyPrimitive;
public KeyValuePair(TKey key, TValue value) { throw null; }
public TKey Key { get { throw null; } }
public TValue Value { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public void Deconstruct(out TKey key, out TValue value) { throw null; }
public override string ToString() { throw null; }
}
}
namespace System.Collections.ObjectModel
{
public partial class Collection<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList
{
public Collection() { }
public Collection(System.Collections.Generic.IList<T> list) { }
public int Count { get { throw null; } }
public T this[int index] { get { throw null; } set { } }
protected System.Collections.Generic.IList<T> Items { get { throw null; } }
bool System.Collections.Generic.ICollection<T>.IsReadOnly { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
bool System.Collections.IList.IsFixedSize { get { throw null; } }
bool System.Collections.IList.IsReadOnly { get { throw null; } }
object? System.Collections.IList.this[int index] { get { throw null; } set { } }
public void Add(T item) { }
public void Clear() { }
protected virtual void ClearItems() { }
public bool Contains(T item) { throw null; }
public void CopyTo(T[] array, int index) { }
public System.Collections.Generic.IEnumerator<T> GetEnumerator() { throw null; }
public int IndexOf(T item) { throw null; }
public void Insert(int index, T item) { }
protected virtual void InsertItem(int index, T item) { }
public bool Remove(T item) { throw null; }
public void RemoveAt(int index) { }
protected virtual void RemoveItem(int index) { }
protected virtual void SetItem(int index, T item) { }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
int System.Collections.IList.Add(object? value) { throw null; }
bool System.Collections.IList.Contains(object? value) { throw null; }
int System.Collections.IList.IndexOf(object? value) { throw null; }
void System.Collections.IList.Insert(int index, object? value) { }
void System.Collections.IList.Remove(object? value) { }
}
public partial class ReadOnlyCollection<T> : System.Collections.Generic.ICollection<T>, System.Collections.Generic.IEnumerable<T>, System.Collections.Generic.IList<T>, System.Collections.Generic.IReadOnlyCollection<T>, System.Collections.Generic.IReadOnlyList<T>, System.Collections.ICollection, System.Collections.IEnumerable, System.Collections.IList
{
public ReadOnlyCollection(System.Collections.Generic.IList<T> list) { }
public int Count { get { throw null; } }
public T this[int index] { get { throw null; } }
protected System.Collections.Generic.IList<T> Items { get { throw null; } }
bool System.Collections.Generic.ICollection<T>.IsReadOnly { get { throw null; } }
T System.Collections.Generic.IList<T>.this[int index] { get { throw null; } set { } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
bool System.Collections.IList.IsFixedSize { get { throw null; } }
bool System.Collections.IList.IsReadOnly { get { throw null; } }
object? System.Collections.IList.this[int index] { get { throw null; } set { } }
public bool Contains(T value) { throw null; }
public void CopyTo(T[] array, int index) { }
public System.Collections.Generic.IEnumerator<T> GetEnumerator() { throw null; }
public int IndexOf(T value) { throw null; }
void System.Collections.Generic.ICollection<T>.Add(T value) { }
void System.Collections.Generic.ICollection<T>.Clear() { }
bool System.Collections.Generic.ICollection<T>.Remove(T value) { throw null; }
void System.Collections.Generic.IList<T>.Insert(int index, T value) { }
void System.Collections.Generic.IList<T>.RemoveAt(int index) { }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
int System.Collections.IList.Add(object? value) { throw null; }
void System.Collections.IList.Clear() { }
bool System.Collections.IList.Contains(object? value) { throw null; }
int System.Collections.IList.IndexOf(object? value) { throw null; }
void System.Collections.IList.Insert(int index, object? value) { }
void System.Collections.IList.Remove(object? value) { }
void System.Collections.IList.RemoveAt(int index) { }
}
public partial class ReadOnlyDictionary<TKey, TValue> : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IDictionary<TKey, TValue>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>, System.Collections.ICollection, System.Collections.IDictionary, System.Collections.IEnumerable where TKey : notnull
{
public ReadOnlyDictionary(System.Collections.Generic.IDictionary<TKey, TValue> dictionary) { }
public int Count { get { throw null; } }
protected System.Collections.Generic.IDictionary<TKey, TValue> Dictionary { get { throw null; } }
public TValue this[TKey key] { get { throw null; } }
public System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.KeyCollection Keys { get { throw null; } }
bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.IsReadOnly { get { throw null; } }
TValue System.Collections.Generic.IDictionary<TKey, TValue>.this[TKey key] { get { throw null; } set { } }
System.Collections.Generic.ICollection<TKey> System.Collections.Generic.IDictionary<TKey, TValue>.Keys { get { throw null; } }
System.Collections.Generic.ICollection<TValue> System.Collections.Generic.IDictionary<TKey, TValue>.Values { get { throw null; } }
System.Collections.Generic.IEnumerable<TKey> System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>.Keys { get { throw null; } }
System.Collections.Generic.IEnumerable<TValue> System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>.Values { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
bool System.Collections.IDictionary.IsFixedSize { get { throw null; } }
bool System.Collections.IDictionary.IsReadOnly { get { throw null; } }
object? System.Collections.IDictionary.this[object key] { get { throw null; } set { } }
System.Collections.ICollection System.Collections.IDictionary.Keys { get { throw null; } }
System.Collections.ICollection System.Collections.IDictionary.Values { get { throw null; } }
public System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.ValueCollection Values { get { throw null; } }
public bool ContainsKey(TKey key) { throw null; }
public System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>> GetEnumerator() { throw null; }
void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Add(System.Collections.Generic.KeyValuePair<TKey, TValue> item) { }
void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Clear() { }
bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Contains(System.Collections.Generic.KeyValuePair<TKey, TValue> item) { throw null; }
void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.CopyTo(System.Collections.Generic.KeyValuePair<TKey, TValue>[] array, int arrayIndex) { }
bool System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Remove(System.Collections.Generic.KeyValuePair<TKey, TValue> item) { throw null; }
void System.Collections.Generic.IDictionary<TKey, TValue>.Add(TKey key, TValue value) { }
bool System.Collections.Generic.IDictionary<TKey, TValue>.Remove(TKey key) { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
void System.Collections.IDictionary.Add(object key, object? value) { }
void System.Collections.IDictionary.Clear() { }
bool System.Collections.IDictionary.Contains(object key) { throw null; }
System.Collections.IDictionaryEnumerator System.Collections.IDictionary.GetEnumerator() { throw null; }
void System.Collections.IDictionary.Remove(object key) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; }
public sealed partial class KeyCollection : System.Collections.Generic.ICollection<TKey>, System.Collections.Generic.IEnumerable<TKey>, System.Collections.Generic.IReadOnlyCollection<TKey>, System.Collections.ICollection, System.Collections.IEnumerable
{
internal KeyCollection() { }
public int Count { get { throw null; } }
bool System.Collections.Generic.ICollection<TKey>.IsReadOnly { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
public void CopyTo(TKey[] array, int arrayIndex) { }
public System.Collections.Generic.IEnumerator<TKey> GetEnumerator() { throw null; }
void System.Collections.Generic.ICollection<TKey>.Add(TKey item) { }
void System.Collections.Generic.ICollection<TKey>.Clear() { }
bool System.Collections.Generic.ICollection<TKey>.Contains(TKey item) { throw null; }
bool System.Collections.Generic.ICollection<TKey>.Remove(TKey item) { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public sealed partial class ValueCollection : System.Collections.Generic.ICollection<TValue>, System.Collections.Generic.IEnumerable<TValue>, System.Collections.Generic.IReadOnlyCollection<TValue>, System.Collections.ICollection, System.Collections.IEnumerable
{
internal ValueCollection() { }
public int Count { get { throw null; } }
bool System.Collections.Generic.ICollection<TValue>.IsReadOnly { get { throw null; } }
bool System.Collections.ICollection.IsSynchronized { get { throw null; } }
object System.Collections.ICollection.SyncRoot { get { throw null; } }
public void CopyTo(TValue[] array, int arrayIndex) { }
public System.Collections.Generic.IEnumerator<TValue> GetEnumerator() { throw null; }
void System.Collections.Generic.ICollection<TValue>.Add(TValue item) { }
void System.Collections.Generic.ICollection<TValue>.Clear() { }
bool System.Collections.Generic.ICollection<TValue>.Contains(TValue item) { throw null; }
bool System.Collections.Generic.ICollection<TValue>.Remove(TValue item) { throw null; }
void System.Collections.ICollection.CopyTo(System.Array array, int index) { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
}
}
namespace System.ComponentModel
{
[System.AttributeUsageAttribute(System.AttributeTargets.All)]
public partial class DefaultValueAttribute : System.Attribute
{
public DefaultValueAttribute(bool value) { }
public DefaultValueAttribute(byte value) { }
public DefaultValueAttribute(char value) { }
public DefaultValueAttribute(double value) { }
public DefaultValueAttribute(short value) { }
public DefaultValueAttribute(int value) { }
public DefaultValueAttribute(long value) { }
public DefaultValueAttribute(object? value) { }
[System.CLSCompliantAttribute(false)]
public DefaultValueAttribute(sbyte value) { }
public DefaultValueAttribute(float value) { }
public DefaultValueAttribute(string? value) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Generic TypeConverters may require the generic types to be annotated. For example, NullableConverter requires the underlying type to be DynamicallyAccessedMembers All.")]
public DefaultValueAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type, string? value) { }
[System.CLSCompliantAttribute(false)]
public DefaultValueAttribute(ushort value) { }
[System.CLSCompliantAttribute(false)]
public DefaultValueAttribute(uint value) { }
[System.CLSCompliantAttribute(false)]
public DefaultValueAttribute(ulong value) { }
public virtual object? Value { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
protected void SetValue(object? value) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct)]
public sealed partial class EditorBrowsableAttribute : System.Attribute
{
public EditorBrowsableAttribute() { }
public EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState state) { }
public System.ComponentModel.EditorBrowsableState State { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
}
public enum EditorBrowsableState
{
Always = 0,
Never = 1,
Advanced = 2,
}
}
namespace System.Configuration.Assemblies
{
public enum AssemblyHashAlgorithm
{
None = 0,
MD5 = 32771,
SHA1 = 32772,
SHA256 = 32780,
SHA384 = 32781,
SHA512 = 32782,
}
public enum AssemblyVersionCompatibility
{
SameMachine = 1,
SameProcess = 2,
SameDomain = 3,
}
}
namespace System.Diagnostics
{
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Method, AllowMultiple=true)]
public sealed partial class ConditionalAttribute : System.Attribute
{
public ConditionalAttribute(string conditionString) { }
public string ConditionString { get { throw null; } }
}
public static partial class Debug
{
public static bool AutoFlush { get { throw null; } set { } }
public static int IndentLevel { get { throw null; } set { } }
public static int IndentSize { get { throw null; } set { } }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.AssertInterpolatedStringHandler message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.AssertInterpolatedStringHandler message, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.AssertInterpolatedStringHandler detailMessage) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, string? message, string? detailMessage) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Assert([System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute(false)] bool condition, string? message, string detailMessageFormat, params object?[] args) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Close() { }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Fail(string? message) => throw null;
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Fail(string? message, string? detailMessage) => throw null;
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Flush() { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Indent() { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Print(string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Print(string format, params object?[] args) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Unindent() { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Write(object? value) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Write(object? value, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Write(string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void Write(string? message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.WriteIfInterpolatedStringHandler message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.WriteIfInterpolatedStringHandler message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, object? value) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, object? value, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteIf(bool condition, string? message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(object? value) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(object? value, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(string format, params object?[] args) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLine(string? message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.WriteIfInterpolatedStringHandler message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("condition")] ref System.Diagnostics.Debug.WriteIfInterpolatedStringHandler message, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, object? value) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, object? value, string? category) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, string? message) { }
[System.Diagnostics.ConditionalAttribute("DEBUG")]
public static void WriteLineIf(bool condition, string? message, string? category) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute]
public partial struct AssertInterpolatedStringHandler
{
private object _dummy;
private int _dummyPrimitive;
public AssertInterpolatedStringHandler(int literalLength, int formattedCount, bool condition, out bool shouldAppend) { throw null; }
public void AppendFormatted(object? value, int alignment = 0, string? format = null) { }
public void AppendFormatted(System.ReadOnlySpan<char> value) { }
public void AppendFormatted(System.ReadOnlySpan<char> value, int alignment = 0, string? format = null) { }
public void AppendFormatted(string? value) { }
public void AppendFormatted(string? value, int alignment = 0, string? format = null) { }
public void AppendFormatted<T>(T value) { }
public void AppendFormatted<T>(T value, int alignment) { }
public void AppendFormatted<T>(T value, int alignment, string? format) { }
public void AppendFormatted<T>(T value, string? format) { }
public void AppendLiteral(string value) { }
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute]
public partial struct WriteIfInterpolatedStringHandler
{
private object _dummy;
private int _dummyPrimitive;
public WriteIfInterpolatedStringHandler(int literalLength, int formattedCount, bool condition, out bool shouldAppend) { throw null; }
public void AppendFormatted(object? value, int alignment = 0, string? format = null) { }
public void AppendFormatted(System.ReadOnlySpan<char> value) { }
public void AppendFormatted(System.ReadOnlySpan<char> value, int alignment = 0, string? format = null) { }
public void AppendFormatted(string? value) { }
public void AppendFormatted(string? value, int alignment = 0, string? format = null) { }
public void AppendFormatted<T>(T value) { }
public void AppendFormatted<T>(T value, int alignment) { }
public void AppendFormatted<T>(T value, int alignment, string? format) { }
public void AppendFormatted<T>(T value, string? format) { }
public void AppendLiteral(string value) { }
}
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Module, AllowMultiple=false)]
public sealed partial class DebuggableAttribute : System.Attribute
{
public DebuggableAttribute(bool isJITTrackingEnabled, bool isJITOptimizerDisabled) { }
public DebuggableAttribute(System.Diagnostics.DebuggableAttribute.DebuggingModes modes) { }
public System.Diagnostics.DebuggableAttribute.DebuggingModes DebuggingFlags { get { throw null; } }
public bool IsJITOptimizerDisabled { get { throw null; } }
public bool IsJITTrackingEnabled { get { throw null; } }
[System.FlagsAttribute]
public enum DebuggingModes
{
None = 0,
Default = 1,
IgnoreSymbolStoreSequencePoints = 2,
EnableEditAndContinue = 4,
DisableOptimizations = 256,
}
}
public static partial class Debugger
{
public static readonly string? DefaultCategory;
public static bool IsAttached { get { throw null; } }
public static void Break() { }
public static bool IsLogging() { throw null; }
public static bool Launch() { throw null; }
public static void Log(int level, string? category, string? message) { }
public static void NotifyOfCrossThreadDependency() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false)]
public sealed partial class DebuggerBrowsableAttribute : System.Attribute
{
public DebuggerBrowsableAttribute(System.Diagnostics.DebuggerBrowsableState state) { }
public System.Diagnostics.DebuggerBrowsableState State { get { throw null; } }
}
public enum DebuggerBrowsableState
{
Never = 0,
Collapsed = 2,
RootHidden = 3,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true)]
public sealed partial class DebuggerDisplayAttribute : System.Attribute
{
public DebuggerDisplayAttribute(string? value) { }
public string? Name { get { throw null; } set { } }
public System.Type? Target { get { throw null; } set { } }
public string? TargetTypeName { get { throw null; } set { } }
public string? Type { get { throw null; } set { } }
public string Value { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)]
public sealed partial class DebuggerHiddenAttribute : System.Attribute
{
public DebuggerHiddenAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class DebuggerNonUserCodeAttribute : System.Attribute
{
public DebuggerNonUserCodeAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class DebuggerStepperBoundaryAttribute : System.Attribute
{
public DebuggerStepperBoundaryAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class DebuggerStepThroughAttribute : System.Attribute
{
public DebuggerStepThroughAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=true)]
public sealed partial class DebuggerTypeProxyAttribute : System.Attribute
{
public DebuggerTypeProxyAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string typeName) { }
public DebuggerTypeProxyAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type type) { }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public string ProxyTypeName { get { throw null; } }
public System.Type? Target { get { throw null; } set { } }
public string? TargetTypeName { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=true)]
public sealed partial class DebuggerVisualizerAttribute : System.Attribute
{
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string visualizerTypeName) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string visualizerTypeName, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string? visualizerObjectSourceTypeName) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string visualizerTypeName, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizerObjectSource) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizer) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizer, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] string? visualizerObjectSourceTypeName) { }
public DebuggerVisualizerAttribute([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizer, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type visualizerObjectSource) { }
public string? Description { get { throw null; } set { } }
public System.Type? Target { get { throw null; } set { } }
public string? TargetTypeName { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public string? VisualizerObjectSourceTypeName { get { throw null; } }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public string VisualizerTypeName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class StackTraceHiddenAttribute : System.Attribute
{
public StackTraceHiddenAttribute() { }
}
public partial class Stopwatch
{
public static readonly long Frequency;
public static readonly bool IsHighResolution;
public Stopwatch() { }
public System.TimeSpan Elapsed { get { throw null; } }
public long ElapsedMilliseconds { get { throw null; } }
public long ElapsedTicks { get { throw null; } }
public bool IsRunning { get { throw null; } }
public static long GetTimestamp() { throw null; }
public static System.TimeSpan GetElapsedTime(long startingTimestamp) { throw null; }
public static System.TimeSpan GetElapsedTime(long startingTimestamp, long endingTimestamp) { throw null; }
public void Reset() { }
public void Restart() { }
public void Start() { }
public static System.Diagnostics.Stopwatch StartNew() { throw null; }
public void Stop() { }
}
public sealed partial class UnreachableException : System.Exception
{
public UnreachableException() { }
public UnreachableException(string? message) { }
public UnreachableException(string? message, System.Exception? innerException) { }
}
}
namespace System.Diagnostics.CodeAnalysis
{
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, Inherited=false)]
public sealed partial class AllowNullAttribute : System.Attribute
{
public AllowNullAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class ConstantExpectedAttribute : System.Attribute
{
public ConstantExpectedAttribute() { }
public object? Max { get { throw null; } set { } }
public object? Min { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property, Inherited=false)]
public sealed partial class DisallowNullAttribute : System.Attribute
{
public DisallowNullAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class DoesNotReturnAttribute : System.Attribute
{
public DoesNotReturnAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class DoesNotReturnIfAttribute : System.Attribute
{
public DoesNotReturnIfAttribute(bool parameterValue) { }
public bool ParameterValue { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Field | System.AttributeTargets.GenericParameter | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class DynamicallyAccessedMembersAttribute : System.Attribute
{
public DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes memberTypes) { }
public System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberTypes { get { throw null; } }
}
[System.FlagsAttribute]
public enum DynamicallyAccessedMemberTypes
{
All = -1,
None = 0,
PublicParameterlessConstructor = 1,
PublicConstructors = 3,
NonPublicConstructors = 4,
PublicMethods = 8,
NonPublicMethods = 16,
PublicFields = 32,
NonPublicFields = 64,
PublicNestedTypes = 128,
NonPublicNestedTypes = 256,
PublicProperties = 512,
NonPublicProperties = 1024,
PublicEvents = 2048,
NonPublicEvents = 4096,
Interfaces = 8192,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Field | System.AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
public sealed partial class DynamicDependencyAttribute : System.Attribute
{
public DynamicDependencyAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes memberTypes, string typeName, string assemblyName) { }
public DynamicDependencyAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes memberTypes, System.Type type) { }
public DynamicDependencyAttribute(string memberSignature) { }
public DynamicDependencyAttribute(string memberSignature, string typeName, string assemblyName) { }
public DynamicDependencyAttribute(string memberSignature, System.Type type) { }
public string? AssemblyName { get { throw null; } }
public string? Condition { get { throw null; } set { } }
public string? MemberSignature { get { throw null; } }
public System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes MemberTypes { get { throw null; } }
public System.Type? Type { get { throw null; } }
public string? TypeName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]
public sealed partial class ExcludeFromCodeCoverageAttribute : System.Attribute
{
public ExcludeFromCodeCoverageAttribute() { }
public string? Justification { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, Inherited=false)]
public sealed partial class MaybeNullAttribute : System.Attribute
{
public MaybeNullAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class MaybeNullWhenAttribute : System.Attribute
{
public MaybeNullWhenAttribute(bool returnValue) { }
public bool ReturnValue { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false, AllowMultiple=true)]
public sealed partial class MemberNotNullAttribute : System.Attribute
{
public MemberNotNullAttribute(string member) { }
public MemberNotNullAttribute(params string[] members) { }
public string[] Members { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false, AllowMultiple=true)]
public sealed partial class MemberNotNullWhenAttribute : System.Attribute
{
public MemberNotNullWhenAttribute(bool returnValue, string member) { }
public MemberNotNullWhenAttribute(bool returnValue, params string[] members) { }
public string[] Members { get { throw null; } }
public bool ReturnValue { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, Inherited=false)]
public sealed partial class NotNullAttribute : System.Attribute
{
public NotNullAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue, AllowMultiple=true, Inherited=false)]
public sealed partial class NotNullIfNotNullAttribute : System.Attribute
{
public NotNullIfNotNullAttribute(string parameterName) { }
public string ParameterName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class NotNullWhenAttribute : System.Attribute
{
public NotNullWhenAttribute(bool returnValue) { }
public bool ReturnValue { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false, AllowMultiple=false)]
public sealed partial class RequiresAssemblyFilesAttribute : System.Attribute
{
public RequiresAssemblyFilesAttribute() { }
public RequiresAssemblyFilesAttribute(string message) { }
public string? Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class RequiresDynamicCodeAttribute : System.Attribute
{
public RequiresDynamicCodeAttribute(string message) { }
public string Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class RequiresUnreferencedCodeAttribute : System.Attribute
{
public RequiresUnreferencedCodeAttribute(string message) { }
public string Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsage(System.AttributeTargets.Constructor, AllowMultiple = false, Inherited = false)]
public sealed class SetsRequiredMembersAttribute : System.Attribute
{
public SetsRequiredMembersAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter | System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed partial class StringSyntaxAttribute : System.Attribute
{
public StringSyntaxAttribute(string syntax) { }
public StringSyntaxAttribute(string syntax, params object?[] arguments) { }
public string Syntax { get { throw null; } }
public object?[] Arguments { get { throw null; } }
public const string DateTimeFormat = "DateTimeFormat";
public const string Json = "Json";
public const string Regex = "Regex";
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false, AllowMultiple=true)]
[System.Diagnostics.ConditionalAttribute("CODE_ANALYSIS")]
public sealed partial class SuppressMessageAttribute : System.Attribute
{
public SuppressMessageAttribute(string category, string checkId) { }
public string Category { get { throw null; } }
public string CheckId { get { throw null; } }
public string? Justification { get { throw null; } set { } }
public string? MessageId { get { throw null; } set { } }
public string? Scope { get { throw null; } set { } }
public string? Target { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false, AllowMultiple=true)]
public sealed partial class UnconditionalSuppressMessageAttribute : System.Attribute
{
public UnconditionalSuppressMessageAttribute(string category, string checkId) { }
public string Category { get { throw null; } }
public string CheckId { get { throw null; } }
public string? Justification { get { throw null; } set { } }
public string? MessageId { get { throw null; } set { } }
public string? Scope { get { throw null; } set { } }
public string? Target { get { throw null; } set { } }
}
}
namespace System.Globalization
{
public abstract partial class Calendar : System.ICloneable
{
public const int CurrentEra = 0;
protected Calendar() { }
public virtual System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
protected virtual int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public abstract int[] Eras { get; }
public bool IsReadOnly { get { throw null; } }
public virtual System.DateTime MaxSupportedDateTime { get { throw null; } }
public virtual System.DateTime MinSupportedDateTime { get { throw null; } }
public virtual int TwoDigitYearMax { get { throw null; } set { } }
public virtual System.DateTime AddDays(System.DateTime time, int days) { throw null; }
public virtual System.DateTime AddHours(System.DateTime time, int hours) { throw null; }
public virtual System.DateTime AddMilliseconds(System.DateTime time, double milliseconds) { throw null; }
public virtual System.DateTime AddMinutes(System.DateTime time, int minutes) { throw null; }
public abstract System.DateTime AddMonths(System.DateTime time, int months);
public virtual System.DateTime AddSeconds(System.DateTime time, int seconds) { throw null; }
public virtual System.DateTime AddWeeks(System.DateTime time, int weeks) { throw null; }
public abstract System.DateTime AddYears(System.DateTime time, int years);
public virtual object Clone() { throw null; }
public abstract int GetDayOfMonth(System.DateTime time);
public abstract System.DayOfWeek GetDayOfWeek(System.DateTime time);
public abstract int GetDayOfYear(System.DateTime time);
public virtual int GetDaysInMonth(int year, int month) { throw null; }
public abstract int GetDaysInMonth(int year, int month, int era);
public virtual int GetDaysInYear(int year) { throw null; }
public abstract int GetDaysInYear(int year, int era);
public abstract int GetEra(System.DateTime time);
public virtual int GetHour(System.DateTime time) { throw null; }
public virtual int GetLeapMonth(int year) { throw null; }
public virtual int GetLeapMonth(int year, int era) { throw null; }
public virtual double GetMilliseconds(System.DateTime time) { throw null; }
public virtual int GetMinute(System.DateTime time) { throw null; }
public abstract int GetMonth(System.DateTime time);
public virtual int GetMonthsInYear(int year) { throw null; }
public abstract int GetMonthsInYear(int year, int era);
public virtual int GetSecond(System.DateTime time) { throw null; }
public virtual int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public abstract int GetYear(System.DateTime time);
public virtual bool IsLeapDay(int year, int month, int day) { throw null; }
public abstract bool IsLeapDay(int year, int month, int day, int era);
public virtual bool IsLeapMonth(int year, int month) { throw null; }
public abstract bool IsLeapMonth(int year, int month, int era);
public virtual bool IsLeapYear(int year) { throw null; }
public abstract bool IsLeapYear(int year, int era);
public static System.Globalization.Calendar ReadOnly(System.Globalization.Calendar calendar) { throw null; }
public virtual System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond) { throw null; }
public abstract System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era);
public virtual int ToFourDigitYear(int year) { throw null; }
}
public enum CalendarAlgorithmType
{
Unknown = 0,
SolarCalendar = 1,
LunarCalendar = 2,
LunisolarCalendar = 3,
}
public enum CalendarWeekRule
{
FirstDay = 0,
FirstFullWeek = 1,
FirstFourDayWeek = 2,
}
public static partial class CharUnicodeInfo
{
public static int GetDecimalDigitValue(char ch) { throw null; }
public static int GetDecimalDigitValue(string s, int index) { throw null; }
public static int GetDigitValue(char ch) { throw null; }
public static int GetDigitValue(string s, int index) { throw null; }
public static double GetNumericValue(char ch) { throw null; }
public static double GetNumericValue(string s, int index) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(char ch) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(int codePoint) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(string s, int index) { throw null; }
}
public partial class ChineseLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
{
public const int ChineseEra = 1;
public ChineseLunisolarCalendar() { }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int GetEra(System.DateTime time) { throw null; }
}
public sealed partial class CompareInfo : System.Runtime.Serialization.IDeserializationCallback
{
internal CompareInfo() { }
public int LCID { get { throw null; } }
public string Name { get { throw null; } }
public System.Globalization.SortVersion Version { get { throw null; } }
public int Compare(System.ReadOnlySpan<char> string1, System.ReadOnlySpan<char> string2, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int Compare(string? string1, int offset1, int length1, string? string2, int offset2, int length2) { throw null; }
public int Compare(string? string1, int offset1, int length1, string? string2, int offset2, int length2, System.Globalization.CompareOptions options) { throw null; }
public int Compare(string? string1, int offset1, string? string2, int offset2) { throw null; }
public int Compare(string? string1, int offset1, string? string2, int offset2, System.Globalization.CompareOptions options) { throw null; }
public int Compare(string? string1, string? string2) { throw null; }
public int Compare(string? string1, string? string2, System.Globalization.CompareOptions options) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public static System.Globalization.CompareInfo GetCompareInfo(int culture) { throw null; }
public static System.Globalization.CompareInfo GetCompareInfo(int culture, System.Reflection.Assembly assembly) { throw null; }
public static System.Globalization.CompareInfo GetCompareInfo(string name) { throw null; }
public static System.Globalization.CompareInfo GetCompareInfo(string name, System.Reflection.Assembly assembly) { throw null; }
public override int GetHashCode() { throw null; }
public int GetHashCode(System.ReadOnlySpan<char> source, System.Globalization.CompareOptions options) { throw null; }
public int GetHashCode(string source, System.Globalization.CompareOptions options) { throw null; }
public int GetSortKey(System.ReadOnlySpan<char> source, System.Span<byte> destination, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public System.Globalization.SortKey GetSortKey(string source) { throw null; }
public System.Globalization.SortKey GetSortKey(string source, System.Globalization.CompareOptions options) { throw null; }
public int GetSortKeyLength(System.ReadOnlySpan<char> source, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int IndexOf(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> value, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int IndexOf(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> value, System.Globalization.CompareOptions options, out int matchLength) { throw null; }
public int IndexOf(System.ReadOnlySpan<char> source, System.Text.Rune value, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int IndexOf(string source, char value) { throw null; }
public int IndexOf(string source, char value, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, char value, int startIndex) { throw null; }
public int IndexOf(string source, char value, int startIndex, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, char value, int startIndex, int count) { throw null; }
public int IndexOf(string source, char value, int startIndex, int count, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, string value) { throw null; }
public int IndexOf(string source, string value, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, string value, int startIndex) { throw null; }
public int IndexOf(string source, string value, int startIndex, System.Globalization.CompareOptions options) { throw null; }
public int IndexOf(string source, string value, int startIndex, int count) { throw null; }
public int IndexOf(string source, string value, int startIndex, int count, System.Globalization.CompareOptions options) { throw null; }
public bool IsPrefix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> prefix, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public bool IsPrefix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> prefix, System.Globalization.CompareOptions options, out int matchLength) { throw null; }
public bool IsPrefix(string source, string prefix) { throw null; }
public bool IsPrefix(string source, string prefix, System.Globalization.CompareOptions options) { throw null; }
public static bool IsSortable(char ch) { throw null; }
public static bool IsSortable(System.ReadOnlySpan<char> text) { throw null; }
public static bool IsSortable(string text) { throw null; }
public static bool IsSortable(System.Text.Rune value) { throw null; }
public bool IsSuffix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> suffix, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public bool IsSuffix(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> suffix, System.Globalization.CompareOptions options, out int matchLength) { throw null; }
public bool IsSuffix(string source, string suffix) { throw null; }
public bool IsSuffix(string source, string suffix, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> value, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int LastIndexOf(System.ReadOnlySpan<char> source, System.ReadOnlySpan<char> value, System.Globalization.CompareOptions options, out int matchLength) { throw null; }
public int LastIndexOf(System.ReadOnlySpan<char> source, System.Text.Rune value, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None) { throw null; }
public int LastIndexOf(string source, char value) { throw null; }
public int LastIndexOf(string source, char value, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, char value, int startIndex) { throw null; }
public int LastIndexOf(string source, char value, int startIndex, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, char value, int startIndex, int count) { throw null; }
public int LastIndexOf(string source, char value, int startIndex, int count, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, string value) { throw null; }
public int LastIndexOf(string source, string value, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, string value, int startIndex) { throw null; }
public int LastIndexOf(string source, string value, int startIndex, System.Globalization.CompareOptions options) { throw null; }
public int LastIndexOf(string source, string value, int startIndex, int count) { throw null; }
public int LastIndexOf(string source, string value, int startIndex, int count, System.Globalization.CompareOptions options) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum CompareOptions
{
None = 0,
IgnoreCase = 1,
IgnoreNonSpace = 2,
IgnoreSymbols = 4,
IgnoreKanaType = 8,
IgnoreWidth = 16,
OrdinalIgnoreCase = 268435456,
StringSort = 536870912,
Ordinal = 1073741824,
}
public partial class CultureInfo : System.ICloneable, System.IFormatProvider
{
public CultureInfo(int culture) { }
public CultureInfo(int culture, bool useUserOverride) { }
public CultureInfo(string name) { }
public CultureInfo(string name, bool useUserOverride) { }
public virtual System.Globalization.Calendar Calendar { get { throw null; } }
public virtual System.Globalization.CompareInfo CompareInfo { get { throw null; } }
public System.Globalization.CultureTypes CultureTypes { get { throw null; } }
public static System.Globalization.CultureInfo CurrentCulture { get { throw null; } set { } }
public static System.Globalization.CultureInfo CurrentUICulture { get { throw null; } set { } }
public virtual System.Globalization.DateTimeFormatInfo DateTimeFormat { get { throw null; } set { } }
public static System.Globalization.CultureInfo? DefaultThreadCurrentCulture { get { throw null; } set { } }
public static System.Globalization.CultureInfo? DefaultThreadCurrentUICulture { get { throw null; } set { } }
public virtual string DisplayName { get { throw null; } }
public virtual string EnglishName { get { throw null; } }
public string IetfLanguageTag { get { throw null; } }
public static System.Globalization.CultureInfo InstalledUICulture { get { throw null; } }
public static System.Globalization.CultureInfo InvariantCulture { get { throw null; } }
public virtual bool IsNeutralCulture { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public virtual int KeyboardLayoutId { get { throw null; } }
public virtual int LCID { get { throw null; } }
public virtual string Name { get { throw null; } }
public virtual string NativeName { get { throw null; } }
public virtual System.Globalization.NumberFormatInfo NumberFormat { get { throw null; } set { } }
public virtual System.Globalization.Calendar[] OptionalCalendars { get { throw null; } }
public virtual System.Globalization.CultureInfo Parent { get { throw null; } }
public virtual System.Globalization.TextInfo TextInfo { get { throw null; } }
public virtual string ThreeLetterISOLanguageName { get { throw null; } }
public virtual string ThreeLetterWindowsLanguageName { get { throw null; } }
public virtual string TwoLetterISOLanguageName { get { throw null; } }
public bool UseUserOverride { get { throw null; } }
public void ClearCachedData() { }
public virtual object Clone() { throw null; }
public static System.Globalization.CultureInfo CreateSpecificCulture(string name) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public System.Globalization.CultureInfo GetConsoleFallbackUICulture() { throw null; }
public static System.Globalization.CultureInfo GetCultureInfo(int culture) { throw null; }
public static System.Globalization.CultureInfo GetCultureInfo(string name) { throw null; }
public static System.Globalization.CultureInfo GetCultureInfo(string name, bool predefinedOnly) { throw null; }
public static System.Globalization.CultureInfo GetCultureInfo(string name, string altName) { throw null; }
public static System.Globalization.CultureInfo GetCultureInfoByIetfLanguageTag(string name) { throw null; }
public static System.Globalization.CultureInfo[] GetCultures(System.Globalization.CultureTypes types) { throw null; }
public virtual object? GetFormat(System.Type? formatType) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Globalization.CultureInfo ReadOnly(System.Globalization.CultureInfo ci) { throw null; }
public override string ToString() { throw null; }
}
public partial class CultureNotFoundException : System.ArgumentException
{
public CultureNotFoundException() { }
protected CultureNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public CultureNotFoundException(string? message) { }
public CultureNotFoundException(string? message, System.Exception? innerException) { }
public CultureNotFoundException(string? message, int invalidCultureId, System.Exception? innerException) { }
public CultureNotFoundException(string? paramName, int invalidCultureId, string? message) { }
public CultureNotFoundException(string? paramName, string? message) { }
public CultureNotFoundException(string? message, string? invalidCultureName, System.Exception? innerException) { }
public CultureNotFoundException(string? paramName, string? invalidCultureName, string? message) { }
public virtual int? InvalidCultureId { get { throw null; } }
public virtual string? InvalidCultureName { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
[System.FlagsAttribute]
public enum CultureTypes
{
NeutralCultures = 1,
SpecificCultures = 2,
InstalledWin32Cultures = 4,
AllCultures = 7,
UserCustomCulture = 8,
ReplacementCultures = 16,
[System.ObsoleteAttribute("CultureTypes.WindowsOnlyCultures has been deprecated. Use other values in CultureTypes instead.")]
WindowsOnlyCultures = 32,
[System.ObsoleteAttribute("CultureTypes.FrameworkCultures has been deprecated. Use other values in CultureTypes instead.")]
FrameworkCultures = 64,
}
public sealed partial class DateTimeFormatInfo : System.ICloneable, System.IFormatProvider
{
public DateTimeFormatInfo() { }
public string[] AbbreviatedDayNames { get { throw null; } set { } }
public string[] AbbreviatedMonthGenitiveNames { get { throw null; } set { } }
public string[] AbbreviatedMonthNames { get { throw null; } set { } }
public string AMDesignator { get { throw null; } set { } }
public System.Globalization.Calendar Calendar { get { throw null; } set { } }
public System.Globalization.CalendarWeekRule CalendarWeekRule { get { throw null; } set { } }
public static System.Globalization.DateTimeFormatInfo CurrentInfo { get { throw null; } }
public string DateSeparator { get { throw null; } set { } }
public string[] DayNames { get { throw null; } set { } }
public System.DayOfWeek FirstDayOfWeek { get { throw null; } set { } }
public string FullDateTimePattern { get { throw null; } set { } }
public static System.Globalization.DateTimeFormatInfo InvariantInfo { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public string LongDatePattern { get { throw null; } set { } }
public string LongTimePattern { get { throw null; } set { } }
public string MonthDayPattern { get { throw null; } set { } }
public string[] MonthGenitiveNames { get { throw null; } set { } }
public string[] MonthNames { get { throw null; } set { } }
public string NativeCalendarName { get { throw null; } }
public string PMDesignator { get { throw null; } set { } }
public string RFC1123Pattern { get { throw null; } }
public string ShortDatePattern { get { throw null; } set { } }
public string[] ShortestDayNames { get { throw null; } set { } }
public string ShortTimePattern { get { throw null; } set { } }
public string SortableDateTimePattern { get { throw null; } }
public string TimeSeparator { get { throw null; } set { } }
public string UniversalSortableDateTimePattern { get { throw null; } }
public string YearMonthPattern { get { throw null; } set { } }
public object Clone() { throw null; }
public string GetAbbreviatedDayName(System.DayOfWeek dayofweek) { throw null; }
public string GetAbbreviatedEraName(int era) { throw null; }
public string GetAbbreviatedMonthName(int month) { throw null; }
public string[] GetAllDateTimePatterns() { throw null; }
public string[] GetAllDateTimePatterns(char format) { throw null; }
public string GetDayName(System.DayOfWeek dayofweek) { throw null; }
public int GetEra(string eraName) { throw null; }
public string GetEraName(int era) { throw null; }
public object? GetFormat(System.Type? formatType) { throw null; }
public static System.Globalization.DateTimeFormatInfo GetInstance(System.IFormatProvider? provider) { throw null; }
public string GetMonthName(int month) { throw null; }
public string GetShortestDayName(System.DayOfWeek dayOfWeek) { throw null; }
public static System.Globalization.DateTimeFormatInfo ReadOnly(System.Globalization.DateTimeFormatInfo dtfi) { throw null; }
public void SetAllDateTimePatterns(string[] patterns, char format) { }
}
[System.FlagsAttribute]
public enum DateTimeStyles
{
None = 0,
AllowLeadingWhite = 1,
AllowTrailingWhite = 2,
AllowInnerWhite = 4,
AllowWhiteSpaces = 7,
NoCurrentDateDefault = 8,
AdjustToUniversal = 16,
AssumeLocal = 32,
AssumeUniversal = 64,
RoundtripKind = 128,
}
public partial class DaylightTime
{
public DaylightTime(System.DateTime start, System.DateTime end, System.TimeSpan delta) { }
public System.TimeSpan Delta { get { throw null; } }
public System.DateTime End { get { throw null; } }
public System.DateTime Start { get { throw null; } }
}
public enum DigitShapes
{
Context = 0,
None = 1,
NativeNational = 2,
}
public abstract partial class EastAsianLunisolarCalendar : System.Globalization.Calendar
{
internal EastAsianLunisolarCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public int GetCelestialStem(int sexagenaryYear) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public virtual int GetSexagenaryYear(System.DateTime time) { throw null; }
public int GetTerrestrialBranch(int sexagenaryYear) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public static partial class GlobalizationExtensions
{
public static System.StringComparer GetStringComparer(this System.Globalization.CompareInfo compareInfo, System.Globalization.CompareOptions options) { throw null; }
}
public partial class GregorianCalendar : System.Globalization.Calendar
{
public const int ADEra = 1;
public GregorianCalendar() { }
public GregorianCalendar(System.Globalization.GregorianCalendarTypes type) { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public virtual System.Globalization.GregorianCalendarTypes CalendarType { get { throw null; } set { } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public enum GregorianCalendarTypes
{
Localized = 1,
USEnglish = 2,
MiddleEastFrench = 9,
Arabic = 10,
TransliteratedEnglish = 11,
TransliteratedFrench = 12,
}
public partial class HebrewCalendar : System.Globalization.Calendar
{
public static readonly int HebrewEra;
public HebrewCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class HijriCalendar : System.Globalization.Calendar
{
public static readonly int HijriEra;
public HijriCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public int HijriAdjustment { get { throw null; } set { } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public sealed partial class IdnMapping
{
public IdnMapping() { }
public bool AllowUnassigned { get { throw null; } set { } }
public bool UseStd3AsciiRules { get { throw null; } set { } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public string GetAscii(string unicode) { throw null; }
public string GetAscii(string unicode, int index) { throw null; }
public string GetAscii(string unicode, int index, int count) { throw null; }
public override int GetHashCode() { throw null; }
public string GetUnicode(string ascii) { throw null; }
public string GetUnicode(string ascii, int index) { throw null; }
public string GetUnicode(string ascii, int index, int count) { throw null; }
}
public static partial class ISOWeek
{
public static int GetWeekOfYear(System.DateTime date) { throw null; }
public static int GetWeeksInYear(int year) { throw null; }
public static int GetYear(System.DateTime date) { throw null; }
public static System.DateTime GetYearEnd(int year) { throw null; }
public static System.DateTime GetYearStart(int year) { throw null; }
public static System.DateTime ToDateTime(int year, int week, System.DayOfWeek dayOfWeek) { throw null; }
}
public partial class JapaneseCalendar : System.Globalization.Calendar
{
public JapaneseCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class JapaneseLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
{
public const int JapaneseEra = 1;
public JapaneseLunisolarCalendar() { }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int GetEra(System.DateTime time) { throw null; }
}
public partial class JulianCalendar : System.Globalization.Calendar
{
public static readonly int JulianEra;
public JulianCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class KoreanCalendar : System.Globalization.Calendar
{
public const int KoreanEra = 1;
public KoreanCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class KoreanLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
{
public const int GregorianEra = 1;
public KoreanLunisolarCalendar() { }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int GetEra(System.DateTime time) { throw null; }
}
public sealed partial class NumberFormatInfo : System.ICloneable, System.IFormatProvider
{
public NumberFormatInfo() { }
public int CurrencyDecimalDigits { get { throw null; } set { } }
public string CurrencyDecimalSeparator { get { throw null; } set { } }
public string CurrencyGroupSeparator { get { throw null; } set { } }
public int[] CurrencyGroupSizes { get { throw null; } set { } }
public int CurrencyNegativePattern { get { throw null; } set { } }
public int CurrencyPositivePattern { get { throw null; } set { } }
public string CurrencySymbol { get { throw null; } set { } }
public static System.Globalization.NumberFormatInfo CurrentInfo { get { throw null; } }
public System.Globalization.DigitShapes DigitSubstitution { get { throw null; } set { } }
public static System.Globalization.NumberFormatInfo InvariantInfo { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public string NaNSymbol { get { throw null; } set { } }
public string[] NativeDigits { get { throw null; } set { } }
public string NegativeInfinitySymbol { get { throw null; } set { } }
public string NegativeSign { get { throw null; } set { } }
public int NumberDecimalDigits { get { throw null; } set { } }
public string NumberDecimalSeparator { get { throw null; } set { } }
public string NumberGroupSeparator { get { throw null; } set { } }
public int[] NumberGroupSizes { get { throw null; } set { } }
public int NumberNegativePattern { get { throw null; } set { } }
public int PercentDecimalDigits { get { throw null; } set { } }
public string PercentDecimalSeparator { get { throw null; } set { } }
public string PercentGroupSeparator { get { throw null; } set { } }
public int[] PercentGroupSizes { get { throw null; } set { } }
public int PercentNegativePattern { get { throw null; } set { } }
public int PercentPositivePattern { get { throw null; } set { } }
public string PercentSymbol { get { throw null; } set { } }
public string PerMilleSymbol { get { throw null; } set { } }
public string PositiveInfinitySymbol { get { throw null; } set { } }
public string PositiveSign { get { throw null; } set { } }
public object Clone() { throw null; }
public object? GetFormat(System.Type? formatType) { throw null; }
public static System.Globalization.NumberFormatInfo GetInstance(System.IFormatProvider? formatProvider) { throw null; }
public static System.Globalization.NumberFormatInfo ReadOnly(System.Globalization.NumberFormatInfo nfi) { throw null; }
}
[System.FlagsAttribute]
public enum NumberStyles
{
None = 0,
AllowLeadingWhite = 1,
AllowTrailingWhite = 2,
AllowLeadingSign = 4,
Integer = 7,
AllowTrailingSign = 8,
AllowParentheses = 16,
AllowDecimalPoint = 32,
AllowThousands = 64,
Number = 111,
AllowExponent = 128,
Float = 167,
AllowCurrencySymbol = 256,
Currency = 383,
Any = 511,
AllowHexSpecifier = 512,
HexNumber = 515,
}
public partial class PersianCalendar : System.Globalization.Calendar
{
public static readonly int PersianEra;
public PersianCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class RegionInfo
{
public RegionInfo(int culture) { }
public RegionInfo(string name) { }
public virtual string CurrencyEnglishName { get { throw null; } }
public virtual string CurrencyNativeName { get { throw null; } }
public virtual string CurrencySymbol { get { throw null; } }
public static System.Globalization.RegionInfo CurrentRegion { get { throw null; } }
public virtual string DisplayName { get { throw null; } }
public virtual string EnglishName { get { throw null; } }
public virtual int GeoId { get { throw null; } }
public virtual bool IsMetric { get { throw null; } }
public virtual string ISOCurrencySymbol { get { throw null; } }
public virtual string Name { get { throw null; } }
public virtual string NativeName { get { throw null; } }
public virtual string ThreeLetterISORegionName { get { throw null; } }
public virtual string ThreeLetterWindowsRegionName { get { throw null; } }
public virtual string TwoLetterISORegionName { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public sealed partial class SortKey
{
internal SortKey() { }
public byte[] KeyData { get { throw null; } }
public string OriginalString { get { throw null; } }
public static int Compare(System.Globalization.SortKey sortkey1, System.Globalization.SortKey sortkey2) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public sealed partial class SortVersion : System.IEquatable<System.Globalization.SortVersion?>
{
public SortVersion(int fullVersion, System.Guid sortId) { }
public int FullVersion { get { throw null; } }
public System.Guid SortId { get { throw null; } }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Globalization.SortVersion? other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Globalization.SortVersion? left, System.Globalization.SortVersion? right) { throw null; }
public static bool operator !=(System.Globalization.SortVersion? left, System.Globalization.SortVersion? right) { throw null; }
}
public partial class StringInfo
{
public StringInfo() { }
public StringInfo(string value) { }
public int LengthInTextElements { get { throw null; } }
public string String { get { throw null; } set { } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
public static string GetNextTextElement(string str) { throw null; }
public static string GetNextTextElement(string str, int index) { throw null; }
public static int GetNextTextElementLength(System.ReadOnlySpan<char> str) { throw null; }
public static int GetNextTextElementLength(string str) { throw null; }
public static int GetNextTextElementLength(string str, int index) { throw null; }
public static System.Globalization.TextElementEnumerator GetTextElementEnumerator(string str) { throw null; }
public static System.Globalization.TextElementEnumerator GetTextElementEnumerator(string str, int index) { throw null; }
public static int[] ParseCombiningCharacters(string str) { throw null; }
public string SubstringByTextElements(int startingTextElement) { throw null; }
public string SubstringByTextElements(int startingTextElement, int lengthInTextElements) { throw null; }
}
public partial class TaiwanCalendar : System.Globalization.Calendar
{
public TaiwanCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public partial class TaiwanLunisolarCalendar : System.Globalization.EastAsianLunisolarCalendar
{
public TaiwanLunisolarCalendar() { }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int GetEra(System.DateTime time) { throw null; }
}
public partial class TextElementEnumerator : System.Collections.IEnumerator
{
internal TextElementEnumerator() { }
public object Current { get { throw null; } }
public int ElementIndex { get { throw null; } }
public string GetTextElement() { throw null; }
public bool MoveNext() { throw null; }
public void Reset() { }
}
public sealed partial class TextInfo : System.ICloneable, System.Runtime.Serialization.IDeserializationCallback
{
internal TextInfo() { }
public int ANSICodePage { get { throw null; } }
public string CultureName { get { throw null; } }
public int EBCDICCodePage { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public bool IsRightToLeft { get { throw null; } }
public int LCID { get { throw null; } }
public string ListSeparator { get { throw null; } set { } }
public int MacCodePage { get { throw null; } }
public int OEMCodePage { get { throw null; } }
public object Clone() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static System.Globalization.TextInfo ReadOnly(System.Globalization.TextInfo textInfo) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
public char ToLower(char c) { throw null; }
public string ToLower(string str) { throw null; }
public override string ToString() { throw null; }
public string ToTitleCase(string str) { throw null; }
public char ToUpper(char c) { throw null; }
public string ToUpper(string str) { throw null; }
}
public partial class ThaiBuddhistCalendar : System.Globalization.Calendar
{
public const int ThaiBuddhistEra = 1;
public ThaiBuddhistCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetWeekOfYear(System.DateTime time, System.Globalization.CalendarWeekRule rule, System.DayOfWeek firstDayOfWeek) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
[System.FlagsAttribute]
public enum TimeSpanStyles
{
None = 0,
AssumeNegative = 1,
}
public partial class UmAlQuraCalendar : System.Globalization.Calendar
{
public const int UmAlQuraEra = 1;
public UmAlQuraCalendar() { }
public override System.Globalization.CalendarAlgorithmType AlgorithmType { get { throw null; } }
protected override int DaysInYearBeforeMinSupportedYear { get { throw null; } }
public override int[] Eras { get { throw null; } }
public override System.DateTime MaxSupportedDateTime { get { throw null; } }
public override System.DateTime MinSupportedDateTime { get { throw null; } }
public override int TwoDigitYearMax { get { throw null; } set { } }
public override System.DateTime AddMonths(System.DateTime time, int months) { throw null; }
public override System.DateTime AddYears(System.DateTime time, int years) { throw null; }
public override int GetDayOfMonth(System.DateTime time) { throw null; }
public override System.DayOfWeek GetDayOfWeek(System.DateTime time) { throw null; }
public override int GetDayOfYear(System.DateTime time) { throw null; }
public override int GetDaysInMonth(int year, int month, int era) { throw null; }
public override int GetDaysInYear(int year, int era) { throw null; }
public override int GetEra(System.DateTime time) { throw null; }
public override int GetLeapMonth(int year, int era) { throw null; }
public override int GetMonth(System.DateTime time) { throw null; }
public override int GetMonthsInYear(int year, int era) { throw null; }
public override int GetYear(System.DateTime time) { throw null; }
public override bool IsLeapDay(int year, int month, int day, int era) { throw null; }
public override bool IsLeapMonth(int year, int month, int era) { throw null; }
public override bool IsLeapYear(int year, int era) { throw null; }
public override System.DateTime ToDateTime(int year, int month, int day, int hour, int minute, int second, int millisecond, int era) { throw null; }
public override int ToFourDigitYear(int year) { throw null; }
}
public enum UnicodeCategory
{
UppercaseLetter = 0,
LowercaseLetter = 1,
TitlecaseLetter = 2,
ModifierLetter = 3,
OtherLetter = 4,
NonSpacingMark = 5,
SpacingCombiningMark = 6,
EnclosingMark = 7,
DecimalDigitNumber = 8,
LetterNumber = 9,
OtherNumber = 10,
SpaceSeparator = 11,
LineSeparator = 12,
ParagraphSeparator = 13,
Control = 14,
Format = 15,
Surrogate = 16,
PrivateUse = 17,
ConnectorPunctuation = 18,
DashPunctuation = 19,
OpenPunctuation = 20,
ClosePunctuation = 21,
InitialQuotePunctuation = 22,
FinalQuotePunctuation = 23,
OtherPunctuation = 24,
MathSymbol = 25,
CurrencySymbol = 26,
ModifierSymbol = 27,
OtherSymbol = 28,
OtherNotAssigned = 29,
}
}
namespace System.IO
{
public partial class BinaryReader : System.IDisposable
{
public BinaryReader(System.IO.Stream input) { }
public BinaryReader(System.IO.Stream input, System.Text.Encoding encoding) { }
public BinaryReader(System.IO.Stream input, System.Text.Encoding encoding, bool leaveOpen) { }
public virtual System.IO.Stream BaseStream { get { throw null; } }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
protected virtual void FillBuffer(int numBytes) { }
public virtual int PeekChar() { throw null; }
public virtual int Read() { throw null; }
public virtual int Read(byte[] buffer, int index, int count) { throw null; }
public virtual int Read(char[] buffer, int index, int count) { throw null; }
public virtual int Read(System.Span<byte> buffer) { throw null; }
public virtual int Read(System.Span<char> buffer) { throw null; }
public int Read7BitEncodedInt() { throw null; }
public long Read7BitEncodedInt64() { throw null; }
public virtual bool ReadBoolean() { throw null; }
public virtual byte ReadByte() { throw null; }
public virtual byte[] ReadBytes(int count) { throw null; }
public virtual char ReadChar() { throw null; }
public virtual char[] ReadChars(int count) { throw null; }
public virtual decimal ReadDecimal() { throw null; }
public virtual double ReadDouble() { throw null; }
public virtual System.Half ReadHalf() { throw null; }
public virtual short ReadInt16() { throw null; }
public virtual int ReadInt32() { throw null; }
public virtual long ReadInt64() { throw null; }
[System.CLSCompliantAttribute(false)]
public virtual sbyte ReadSByte() { throw null; }
public virtual float ReadSingle() { throw null; }
public virtual string ReadString() { throw null; }
[System.CLSCompliantAttribute(false)]
public virtual ushort ReadUInt16() { throw null; }
[System.CLSCompliantAttribute(false)]
public virtual uint ReadUInt32() { throw null; }
[System.CLSCompliantAttribute(false)]
public virtual ulong ReadUInt64() { throw null; }
}
public partial class BinaryWriter : System.IAsyncDisposable, System.IDisposable
{
public static readonly System.IO.BinaryWriter Null;
protected System.IO.Stream OutStream;
protected BinaryWriter() { }
public BinaryWriter(System.IO.Stream output) { }
public BinaryWriter(System.IO.Stream output, System.Text.Encoding encoding) { }
public BinaryWriter(System.IO.Stream output, System.Text.Encoding encoding, bool leaveOpen) { }
public virtual System.IO.Stream BaseStream { get { throw null; } }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public virtual void Flush() { }
public virtual long Seek(int offset, System.IO.SeekOrigin origin) { throw null; }
public virtual void Write(bool value) { }
public virtual void Write(byte value) { }
public virtual void Write(byte[] buffer) { }
public virtual void Write(byte[] buffer, int index, int count) { }
public virtual void Write(char ch) { }
public virtual void Write(char[] chars) { }
public virtual void Write(char[] chars, int index, int count) { }
public virtual void Write(decimal value) { }
public virtual void Write(double value) { }
public virtual void Write(System.Half value) { }
public virtual void Write(short value) { }
public virtual void Write(int value) { }
public virtual void Write(long value) { }
public virtual void Write(System.ReadOnlySpan<byte> buffer) { }
public virtual void Write(System.ReadOnlySpan<char> chars) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(sbyte value) { }
public virtual void Write(float value) { }
public virtual void Write(string value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(ushort value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(uint value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(ulong value) { }
public void Write7BitEncodedInt(int value) { }
public void Write7BitEncodedInt64(long value) { }
}
public sealed partial class BufferedStream : System.IO.Stream
{
public BufferedStream(System.IO.Stream stream) { }
public BufferedStream(System.IO.Stream stream, int bufferSize) { }
public int BufferSize { get { throw null; } }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
public override long Length { get { throw null; } }
public override long Position { get { throw null; } set { } }
public System.IO.Stream UnderlyingStream { get { throw null; } }
public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override void CopyTo(System.IO.Stream destination, int bufferSize) { }
public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; }
protected override void Dispose(bool disposing) { }
public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override int EndRead(System.IAsyncResult asyncResult) { throw null; }
public override void EndWrite(System.IAsyncResult asyncResult) { }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public override int Read(byte[] buffer, int offset, int count) { throw null; }
public override int Read(System.Span<byte> destination) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadByte() { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin origin) { throw null; }
public override void SetLength(long value) { }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteByte(byte value) { }
}
public static partial class Directory
{
public static System.IO.DirectoryInfo CreateDirectory(string path) { throw null; }
public static System.IO.FileSystemInfo CreateSymbolicLink(string path, string pathToTarget) { throw null; }
public static void Delete(string path) { }
public static void Delete(string path, bool recursive) { }
public static System.Collections.Generic.IEnumerable<string> EnumerateDirectories(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateDirectories(string path, string searchPattern) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateDirectories(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateDirectories(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFiles(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFiles(string path, string searchPattern) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFiles(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFiles(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFileSystemEntries(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static System.Collections.Generic.IEnumerable<string> EnumerateFileSystemEntries(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static bool Exists([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? path) { throw null; }
public static System.DateTime GetCreationTime(string path) { throw null; }
public static System.DateTime GetCreationTimeUtc(string path) { throw null; }
public static string GetCurrentDirectory() { throw null; }
public static string[] GetDirectories(string path) { throw null; }
public static string[] GetDirectories(string path, string searchPattern) { throw null; }
public static string[] GetDirectories(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static string[] GetDirectories(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static string GetDirectoryRoot(string path) { throw null; }
public static string[] GetFiles(string path) { throw null; }
public static string[] GetFiles(string path, string searchPattern) { throw null; }
public static string[] GetFiles(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static string[] GetFiles(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static string[] GetFileSystemEntries(string path) { throw null; }
public static string[] GetFileSystemEntries(string path, string searchPattern) { throw null; }
public static string[] GetFileSystemEntries(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static string[] GetFileSystemEntries(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public static System.DateTime GetLastAccessTime(string path) { throw null; }
public static System.DateTime GetLastAccessTimeUtc(string path) { throw null; }
public static System.DateTime GetLastWriteTime(string path) { throw null; }
public static System.DateTime GetLastWriteTimeUtc(string path) { throw null; }
public static string[] GetLogicalDrives() { throw null; }
public static System.IO.DirectoryInfo? GetParent(string path) { throw null; }
public static void Move(string sourceDirName, string destDirName) { }
public static System.IO.FileSystemInfo? ResolveLinkTarget(string linkPath, bool returnFinalTarget) { throw null; }
public static void SetCreationTime(string path, System.DateTime creationTime) { }
public static void SetCreationTimeUtc(string path, System.DateTime creationTimeUtc) { }
public static void SetCurrentDirectory(string path) { }
public static void SetLastAccessTime(string path, System.DateTime lastAccessTime) { }
public static void SetLastAccessTimeUtc(string path, System.DateTime lastAccessTimeUtc) { }
public static void SetLastWriteTime(string path, System.DateTime lastWriteTime) { }
public static void SetLastWriteTimeUtc(string path, System.DateTime lastWriteTimeUtc) { }
}
public sealed partial class DirectoryInfo : System.IO.FileSystemInfo
{
public DirectoryInfo(string path) { }
public override bool Exists { get { throw null; } }
public override string Name { get { throw null; } }
public System.IO.DirectoryInfo? Parent { get { throw null; } }
public System.IO.DirectoryInfo Root { get { throw null; } }
public void Create() { }
public System.IO.DirectoryInfo CreateSubdirectory(string path) { throw null; }
public override void Delete() { }
public void Delete(bool recursive) { }
public System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo> EnumerateDirectories() { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo> EnumerateDirectories(string searchPattern) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo> EnumerateDirectories(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.DirectoryInfo> EnumerateDirectories(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileInfo> EnumerateFiles() { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileInfo> EnumerateFiles(string searchPattern) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileInfo> EnumerateFiles(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileInfo> EnumerateFiles(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> EnumerateFileSystemInfos() { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> EnumerateFileSystemInfos(string searchPattern) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> EnumerateFileSystemInfos(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> EnumerateFileSystemInfos(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.IO.DirectoryInfo[] GetDirectories() { throw null; }
public System.IO.DirectoryInfo[] GetDirectories(string searchPattern) { throw null; }
public System.IO.DirectoryInfo[] GetDirectories(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.IO.DirectoryInfo[] GetDirectories(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.IO.FileInfo[] GetFiles() { throw null; }
public System.IO.FileInfo[] GetFiles(string searchPattern) { throw null; }
public System.IO.FileInfo[] GetFiles(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.IO.FileInfo[] GetFiles(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public System.IO.FileSystemInfo[] GetFileSystemInfos() { throw null; }
public System.IO.FileSystemInfo[] GetFileSystemInfos(string searchPattern) { throw null; }
public System.IO.FileSystemInfo[] GetFileSystemInfos(string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public System.IO.FileSystemInfo[] GetFileSystemInfos(string searchPattern, System.IO.SearchOption searchOption) { throw null; }
public void MoveTo(string destDirName) { }
public override string ToString() { throw null; }
}
public partial class DirectoryNotFoundException : System.IO.IOException
{
public DirectoryNotFoundException() { }
protected DirectoryNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public DirectoryNotFoundException(string? message) { }
public DirectoryNotFoundException(string? message, System.Exception? innerException) { }
}
public partial class EndOfStreamException : System.IO.IOException
{
public EndOfStreamException() { }
protected EndOfStreamException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public EndOfStreamException(string? message) { }
public EndOfStreamException(string? message, System.Exception? innerException) { }
}
public partial class EnumerationOptions
{
public EnumerationOptions() { }
public System.IO.FileAttributes AttributesToSkip { get { throw null; } set { } }
public int BufferSize { get { throw null; } set { } }
public bool IgnoreInaccessible { get { throw null; } set { } }
public System.IO.MatchCasing MatchCasing { get { throw null; } set { } }
public System.IO.MatchType MatchType { get { throw null; } set { } }
public int MaxRecursionDepth { get { throw null; } set { } }
public bool RecurseSubdirectories { get { throw null; } set { } }
public bool ReturnSpecialDirectories { get { throw null; } set { } }
}
public static partial class File
{
public static void AppendAllLines(string path, System.Collections.Generic.IEnumerable<string> contents) { }
public static void AppendAllLines(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task AppendAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task AppendAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void AppendAllText(string path, string? contents) { }
public static void AppendAllText(string path, string? contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task AppendAllTextAsync(string path, string? contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task AppendAllTextAsync(string path, string? contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.IO.StreamWriter AppendText(string path) { throw null; }
public static void Copy(string sourceFileName, string destFileName) { }
public static void Copy(string sourceFileName, string destFileName, bool overwrite) { }
public static System.IO.FileStream Create(string path) { throw null; }
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.FileSystemInfo CreateSymbolicLink(string path, string pathToTarget) { throw null; }
public static System.IO.StreamWriter CreateText(string path) { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void Decrypt(string path) { }
public static void Delete(string path) { }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public static void Encrypt(string path) { }
public static bool Exists([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? path) { throw null; }
public static System.IO.FileAttributes GetAttributes(string path) { throw null; }
public static System.DateTime GetCreationTime(string path) { throw null; }
public static System.DateTime GetCreationTimeUtc(string path) { throw null; }
public static System.DateTime GetLastAccessTime(string path) { throw null; }
public static System.DateTime GetLastAccessTimeUtc(string path) { throw null; }
public static System.DateTime GetLastWriteTime(string path) { throw null; }
public static System.DateTime GetLastWriteTimeUtc(string path) { throw null; }
public static void Move(string sourceFileName, string destFileName) { }
public static void Move(string sourceFileName, string destFileName, bool overwrite) { }
public static System.IO.FileStream Open(string path, System.IO.FileMode mode) { throw null; }
public static System.IO.FileStream Open(string path, System.IO.FileMode mode, System.IO.FileAccess access) { throw null; }
public static System.IO.FileStream Open(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) { throw null; }
public static System.IO.FileStream Open(string path, System.IO.FileStreamOptions options) { throw null; }
public static Microsoft.Win32.SafeHandles.SafeFileHandle OpenHandle(string path, System.IO.FileMode mode = System.IO.FileMode.Open, System.IO.FileAccess access = System.IO.FileAccess.Read, System.IO.FileShare share = System.IO.FileShare.Read, System.IO.FileOptions options = System.IO.FileOptions.None, long preallocationSize = (long)0) { throw null; }
public static System.IO.FileStream OpenRead(string path) { throw null; }
public static System.IO.StreamReader OpenText(string path) { throw null; }
public static System.IO.FileStream OpenWrite(string path) { throw null; }
public static byte[] ReadAllBytes(string path) { throw null; }
public static System.Threading.Tasks.Task<byte[]> ReadAllBytesAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static string[] ReadAllLines(string path) { throw null; }
public static string[] ReadAllLines(string path, System.Text.Encoding encoding) { throw null; }
public static System.Threading.Tasks.Task<string[]> ReadAllLinesAsync(string path, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task<string[]> ReadAllLinesAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static string ReadAllText(string path) { throw null; }
public static string ReadAllText(string path, System.Text.Encoding encoding) { throw null; }
public static System.Threading.Tasks.Task<string> ReadAllTextAsync(string path, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task<string> ReadAllTextAsync(string path, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Collections.Generic.IEnumerable<string> ReadLines(string path) { throw null; }
public static System.Collections.Generic.IEnumerable<string> ReadLines(string path, System.Text.Encoding encoding) { throw null; }
public static void Replace(string sourceFileName, string destinationFileName, string? destinationBackupFileName) { }
public static void Replace(string sourceFileName, string destinationFileName, string? destinationBackupFileName, bool ignoreMetadataErrors) { }
public static System.IO.FileSystemInfo? ResolveLinkTarget(string linkPath, bool returnFinalTarget) { throw null; }
public static void SetAttributes(string path, System.IO.FileAttributes fileAttributes) { }
public static void SetCreationTime(string path, System.DateTime creationTime) { }
public static void SetCreationTimeUtc(string path, System.DateTime creationTimeUtc) { }
public static void SetLastAccessTime(string path, System.DateTime lastAccessTime) { }
public static void SetLastAccessTimeUtc(string path, System.DateTime lastAccessTimeUtc) { }
public static void SetLastWriteTime(string path, System.DateTime lastWriteTime) { }
public static void SetLastWriteTimeUtc(string path, System.DateTime lastWriteTimeUtc) { }
public static void WriteAllBytes(string path, byte[] bytes) { }
public static System.Threading.Tasks.Task WriteAllBytesAsync(string path, byte[] bytes, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void WriteAllLines(string path, System.Collections.Generic.IEnumerable<string> contents) { }
public static void WriteAllLines(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding) { }
public static void WriteAllLines(string path, string[] contents) { }
public static void WriteAllLines(string path, string[] contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task WriteAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task WriteAllLinesAsync(string path, System.Collections.Generic.IEnumerable<string> contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void WriteAllText(string path, string? contents) { }
public static void WriteAllText(string path, string? contents, System.Text.Encoding encoding) { }
public static System.Threading.Tasks.Task WriteAllTextAsync(string path, string? contents, System.Text.Encoding encoding, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.Task WriteAllTextAsync(string path, string? contents, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
[System.FlagsAttribute]
public enum FileAccess
{
Read = 1,
Write = 2,
ReadWrite = 3,
}
[System.FlagsAttribute]
public enum FileAttributes
{
ReadOnly = 1,
Hidden = 2,
System = 4,
Directory = 16,
Archive = 32,
Device = 64,
Normal = 128,
Temporary = 256,
SparseFile = 512,
ReparsePoint = 1024,
Compressed = 2048,
Offline = 4096,
NotContentIndexed = 8192,
Encrypted = 16384,
IntegrityStream = 32768,
NoScrubData = 131072,
}
public sealed partial class FileInfo : System.IO.FileSystemInfo
{
public FileInfo(string fileName) { }
public System.IO.DirectoryInfo? Directory { get { throw null; } }
public string? DirectoryName { get { throw null; } }
public override bool Exists { get { throw null; } }
public bool IsReadOnly { get { throw null; } set { } }
public long Length { get { throw null; } }
public override string Name { get { throw null; } }
public System.IO.StreamWriter AppendText() { throw null; }
public System.IO.FileInfo CopyTo(string destFileName) { throw null; }
public System.IO.FileInfo CopyTo(string destFileName, bool overwrite) { throw null; }
public System.IO.FileStream Create() { throw null; }
public System.IO.StreamWriter CreateText() { throw null; }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public void Decrypt() { }
public override void Delete() { }
[System.Runtime.Versioning.SupportedOSPlatformAttribute("windows")]
public void Encrypt() { }
public void MoveTo(string destFileName) { }
public void MoveTo(string destFileName, bool overwrite) { }
public System.IO.FileStream Open(System.IO.FileMode mode) { throw null; }
public System.IO.FileStream Open(System.IO.FileMode mode, System.IO.FileAccess access) { throw null; }
public System.IO.FileStream Open(System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) { throw null; }
public System.IO.FileStream Open(System.IO.FileStreamOptions options) { throw null; }
public System.IO.FileStream OpenRead() { throw null; }
public System.IO.StreamReader OpenText() { throw null; }
public System.IO.FileStream OpenWrite() { throw null; }
public System.IO.FileInfo Replace(string destinationFileName, string? destinationBackupFileName) { throw null; }
public System.IO.FileInfo Replace(string destinationFileName, string? destinationBackupFileName, bool ignoreMetadataErrors) { throw null; }
}
public partial class FileLoadException : System.IO.IOException
{
public FileLoadException() { }
protected FileLoadException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public FileLoadException(string? message) { }
public FileLoadException(string? message, System.Exception? inner) { }
public FileLoadException(string? message, string? fileName) { }
public FileLoadException(string? message, string? fileName, System.Exception? inner) { }
public string? FileName { get { throw null; } }
public string? FusionLog { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
public enum FileMode
{
CreateNew = 1,
Create = 2,
Open = 3,
OpenOrCreate = 4,
Truncate = 5,
Append = 6,
}
public partial class FileNotFoundException : System.IO.IOException
{
public FileNotFoundException() { }
protected FileNotFoundException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public FileNotFoundException(string? message) { }
public FileNotFoundException(string? message, System.Exception? innerException) { }
public FileNotFoundException(string? message, string? fileName) { }
public FileNotFoundException(string? message, string? fileName, System.Exception? innerException) { }
public string? FileName { get { throw null; } }
public string? FusionLog { get { throw null; } }
public override string Message { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum FileOptions
{
WriteThrough = -2147483648,
None = 0,
Encrypted = 16384,
DeleteOnClose = 67108864,
SequentialScan = 134217728,
RandomAccess = 268435456,
Asynchronous = 1073741824,
}
[System.FlagsAttribute]
public enum FileShare
{
None = 0,
Read = 1,
Write = 2,
ReadWrite = 3,
Delete = 4,
Inheritable = 16,
}
public partial class FileStream : System.IO.Stream
{
public FileStream(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access) { }
public FileStream(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access, int bufferSize) { }
public FileStream(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.IO.FileAccess access, int bufferSize, bool isAsync) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use FileStream(SafeFileHandle handle, FileAccess access) instead.")]
public FileStream(System.IntPtr handle, System.IO.FileAccess access) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use FileStream(SafeFileHandle handle, FileAccess access) and optionally make a new SafeFileHandle with ownsHandle=false if needed instead.")]
public FileStream(System.IntPtr handle, System.IO.FileAccess access, bool ownsHandle) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use FileStream(SafeFileHandle handle, FileAccess access, int bufferSize) and optionally make a new SafeFileHandle with ownsHandle=false if needed instead.")]
public FileStream(System.IntPtr handle, System.IO.FileAccess access, bool ownsHandle, int bufferSize) { }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use FileStream(SafeFileHandle handle, FileAccess access, int bufferSize, bool isAsync) and optionally make a new SafeFileHandle with ownsHandle=false if needed instead.")]
public FileStream(System.IntPtr handle, System.IO.FileAccess access, bool ownsHandle, int bufferSize, bool isAsync) { }
public FileStream(string path, System.IO.FileMode mode) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, bool useAsync) { }
public FileStream(string path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, int bufferSize, System.IO.FileOptions options) { }
public FileStream(string path, System.IO.FileStreamOptions options) { }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
[System.ObsoleteAttribute("FileStream.Handle has been deprecated. Use FileStream's SafeFileHandle property instead.")]
public virtual System.IntPtr Handle { get { throw null; } }
public virtual bool IsAsync { get { throw null; } }
public override long Length { get { throw null; } }
public virtual string Name { get { throw null; } }
public override long Position { get { throw null; } set { } }
public virtual Microsoft.Win32.SafeHandles.SafeFileHandle SafeFileHandle { get { throw null; } }
public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; }
protected override void Dispose(bool disposing) { }
public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override int EndRead(System.IAsyncResult asyncResult) { throw null; }
public override void EndWrite(System.IAsyncResult asyncResult) { }
~FileStream() { }
public override void Flush() { }
public virtual void Flush(bool flushToDisk) { }
public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("macos")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
public virtual void Lock(long position, long length) { }
public override int Read(byte[] buffer, int offset, int count) { throw null; }
public override int Read(System.Span<byte> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
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.UnsupportedOSPlatformAttribute("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("macos")]
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("tvos")]
public virtual void Unlock(long position, long length) { }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteByte(byte value) { }
}
public sealed partial class FileStreamOptions
{
public FileStreamOptions() { }
public System.IO.FileAccess Access { get { throw null; } set { } }
public int BufferSize { get { throw null; } set { } }
public System.IO.FileMode Mode { get { throw null; } set { } }
public System.IO.FileOptions Options { get { throw null; } set { } }
public long PreallocationSize { get { throw null; } set { } }
public System.IO.FileShare Share { get { throw null; } set { } }
}
public abstract partial class FileSystemInfo : System.MarshalByRefObject, System.Runtime.Serialization.ISerializable
{
protected string FullPath;
protected string OriginalPath;
protected FileSystemInfo() { }
protected FileSystemInfo(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public System.IO.FileAttributes Attributes { get { throw null; } set { } }
public System.DateTime CreationTime { get { throw null; } set { } }
public System.DateTime CreationTimeUtc { get { throw null; } set { } }
public abstract bool Exists { get; }
public string Extension { get { throw null; } }
public virtual string FullName { get { throw null; } }
public System.DateTime LastAccessTime { get { throw null; } set { } }
public System.DateTime LastAccessTimeUtc { get { throw null; } set { } }
public System.DateTime LastWriteTime { get { throw null; } set { } }
public System.DateTime LastWriteTimeUtc { get { throw null; } set { } }
public string? LinkTarget { get { throw null; } }
public abstract string Name { get; }
public void CreateAsSymbolicLink(string pathToTarget) { }
public abstract void Delete();
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public void Refresh() { }
public System.IO.FileSystemInfo? ResolveLinkTarget(bool returnFinalTarget) { throw null; }
public override string ToString() { throw null; }
}
public enum HandleInheritability
{
None = 0,
Inheritable = 1,
}
public sealed partial class InvalidDataException : System.SystemException
{
public InvalidDataException() { }
public InvalidDataException(string? message) { }
public InvalidDataException(string? message, System.Exception? innerException) { }
}
public partial class IOException : System.SystemException
{
public IOException() { }
protected IOException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public IOException(string? message) { }
public IOException(string? message, System.Exception? innerException) { }
public IOException(string? message, int hresult) { }
}
public enum MatchCasing
{
PlatformDefault = 0,
CaseSensitive = 1,
CaseInsensitive = 2,
}
public enum MatchType
{
Simple = 0,
Win32 = 1,
}
public partial class MemoryStream : System.IO.Stream
{
public MemoryStream() { }
public MemoryStream(byte[] buffer) { }
public MemoryStream(byte[] buffer, bool writable) { }
public MemoryStream(byte[] buffer, int index, int count) { }
public MemoryStream(byte[] buffer, int index, int count, bool writable) { }
public MemoryStream(byte[] buffer, int index, int count, bool writable, bool publiclyVisible) { }
public MemoryStream(int capacity) { }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
public virtual int Capacity { get { throw null; } set { } }
public override long Length { get { throw null; } }
public override long Position { get { throw null; } set { } }
public override System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public override void CopyTo(System.IO.Stream destination, int bufferSize) { }
public override System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; }
protected override void Dispose(bool disposing) { }
public override int EndRead(System.IAsyncResult asyncResult) { throw null; }
public override void EndWrite(System.IAsyncResult asyncResult) { }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual byte[] GetBuffer() { throw null; }
public override int Read(byte[] buffer, int offset, int count) { throw null; }
public override int Read(System.Span<byte> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadByte() { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin loc) { throw null; }
public override void SetLength(long value) { }
public virtual byte[] ToArray() { throw null; }
public virtual bool TryGetBuffer(out System.ArraySegment<byte> buffer) { throw null; }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteByte(byte value) { }
public virtual void WriteTo(System.IO.Stream stream) { }
}
public static partial class Path
{
public static readonly char AltDirectorySeparatorChar;
public static readonly char DirectorySeparatorChar;
[System.ObsoleteAttribute("Path.InvalidPathChars has been deprecated. Use GetInvalidPathChars or GetInvalidFileNameChars instead.")]
public static readonly char[] InvalidPathChars;
public static readonly char PathSeparator;
public static readonly char VolumeSeparatorChar;
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("path")]
public static string? ChangeExtension(string? path, string? extension) { throw null; }
public static string Combine(string path1, string path2) { throw null; }
public static string Combine(string path1, string path2, string path3) { throw null; }
public static string Combine(string path1, string path2, string path3, string path4) { throw null; }
public static string Combine(params string[] paths) { throw null; }
public static bool EndsInDirectorySeparator(System.ReadOnlySpan<char> path) { throw null; }
public static bool EndsInDirectorySeparator(string path) { throw null; }
public static bool Exists([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] string? path) { throw null; }
public static System.ReadOnlySpan<char> GetDirectoryName(System.ReadOnlySpan<char> path) { throw null; }
public static string? GetDirectoryName(string? path) { throw null; }
public static System.ReadOnlySpan<char> GetExtension(System.ReadOnlySpan<char> path) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("path")]
public static string? GetExtension(string? path) { throw null; }
public static System.ReadOnlySpan<char> GetFileName(System.ReadOnlySpan<char> path) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("path")]
public static string? GetFileName(string? path) { throw null; }
public static System.ReadOnlySpan<char> GetFileNameWithoutExtension(System.ReadOnlySpan<char> path) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("path")]
public static string? GetFileNameWithoutExtension(string? path) { throw null; }
public static string GetFullPath(string path) { throw null; }
public static string GetFullPath(string path, string basePath) { throw null; }
public static char[] GetInvalidFileNameChars() { throw null; }
public static char[] GetInvalidPathChars() { throw null; }
public static System.ReadOnlySpan<char> GetPathRoot(System.ReadOnlySpan<char> path) { throw null; }
public static string? GetPathRoot(string? path) { throw null; }
public static string GetRandomFileName() { throw null; }
public static string GetRelativePath(string relativeTo, string path) { throw null; }
public static string GetTempFileName() { throw null; }
public static string GetTempPath() { throw null; }
public static bool HasExtension(System.ReadOnlySpan<char> path) { throw null; }
public static bool HasExtension([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? path) { throw null; }
public static bool IsPathFullyQualified(System.ReadOnlySpan<char> path) { throw null; }
public static bool IsPathFullyQualified(string path) { throw null; }
public static bool IsPathRooted(System.ReadOnlySpan<char> path) { throw null; }
public static bool IsPathRooted([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? path) { throw null; }
public static string Join(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2) { throw null; }
public static string Join(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2, System.ReadOnlySpan<char> path3) { throw null; }
public static string Join(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2, System.ReadOnlySpan<char> path3, System.ReadOnlySpan<char> path4) { throw null; }
public static string Join(string? path1, string? path2) { throw null; }
public static string Join(string? path1, string? path2, string? path3) { throw null; }
public static string Join(string? path1, string? path2, string? path3, string? path4) { throw null; }
public static string Join(params string?[] paths) { throw null; }
public static System.ReadOnlySpan<char> TrimEndingDirectorySeparator(System.ReadOnlySpan<char> path) { throw null; }
public static string TrimEndingDirectorySeparator(string path) { throw null; }
public static bool TryJoin(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2, System.ReadOnlySpan<char> path3, System.Span<char> destination, out int charsWritten) { throw null; }
public static bool TryJoin(System.ReadOnlySpan<char> path1, System.ReadOnlySpan<char> path2, System.Span<char> destination, out int charsWritten) { throw null; }
}
public partial class PathTooLongException : System.IO.IOException
{
public PathTooLongException() { }
protected PathTooLongException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public PathTooLongException(string? message) { }
public PathTooLongException(string? message, System.Exception? innerException) { }
}
public static partial class RandomAccess
{
public static long GetLength(Microsoft.Win32.SafeHandles.SafeFileHandle handle) { throw null; }
public static void SetLength(Microsoft.Win32.SafeHandles.SafeFileHandle handle, long length) { throw null; }
public static long Read(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<System.Memory<byte>> buffers, long fileOffset) { throw null; }
public static int Read(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Span<byte> buffer, long fileOffset) { throw null; }
public static System.Threading.Tasks.ValueTask<long> ReadAsync(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<System.Memory<byte>> buffers, long fileOffset, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.ValueTask<int> ReadAsync(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Memory<byte> buffer, long fileOffset, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static void Write(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<System.ReadOnlyMemory<byte>> buffers, long fileOffset) { }
public static void Write(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.ReadOnlySpan<byte> buffer, long fileOffset) { }
public static System.Threading.Tasks.ValueTask WriteAsync(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.Collections.Generic.IReadOnlyList<System.ReadOnlyMemory<byte>> buffers, long fileOffset, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Threading.Tasks.ValueTask WriteAsync(Microsoft.Win32.SafeHandles.SafeFileHandle handle, System.ReadOnlyMemory<byte> buffer, long fileOffset, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public enum SearchOption
{
TopDirectoryOnly = 0,
AllDirectories = 1,
}
public enum SeekOrigin
{
Begin = 0,
Current = 1,
End = 2,
}
public abstract partial class Stream : System.MarshalByRefObject, System.IAsyncDisposable, System.IDisposable
{
public static readonly System.IO.Stream Null;
protected Stream() { }
public abstract bool CanRead { get; }
public abstract bool CanSeek { get; }
public virtual bool CanTimeout { get { throw null; } }
public abstract bool CanWrite { get; }
public abstract long Length { get; }
public abstract long Position { get; set; }
public virtual int ReadTimeout { get { throw null; } set { } }
public virtual int WriteTimeout { get { throw null; } set { } }
public virtual System.IAsyncResult BeginRead(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public virtual System.IAsyncResult BeginWrite(byte[] buffer, int offset, int count, System.AsyncCallback? callback, object? state) { throw null; }
public virtual void Close() { }
public void CopyTo(System.IO.Stream destination) { }
public virtual void CopyTo(System.IO.Stream destination, int bufferSize) { }
public System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination) { throw null; }
public System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize) { throw null; }
public virtual System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, int bufferSize, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task CopyToAsync(System.IO.Stream destination, System.Threading.CancellationToken cancellationToken) { throw null; }
[System.ObsoleteAttribute("CreateWaitHandle has been deprecated. Use the ManualResetEvent(false) constructor instead.")]
protected virtual System.Threading.WaitHandle CreateWaitHandle() { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public virtual int EndRead(System.IAsyncResult asyncResult) { throw null; }
public virtual void EndWrite(System.IAsyncResult asyncResult) { }
public abstract void Flush();
public System.Threading.Tasks.Task FlushAsync() { throw null; }
public virtual System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
[System.ObsoleteAttribute("Do not call or override this method.")]
protected virtual void ObjectInvariant() { }
public abstract int Read(byte[] buffer, int offset, int count);
public virtual int Read(System.Span<byte> buffer) { throw null; }
public System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count) { throw null; }
public virtual System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual int ReadByte() { throw null; }
public abstract long Seek(long offset, System.IO.SeekOrigin origin);
public abstract void SetLength(long value);
public static System.IO.Stream Synchronized(System.IO.Stream stream) { throw null; }
protected static void ValidateBufferArguments(byte[] buffer, int offset, int count) { }
protected static void ValidateCopyToArguments(System.IO.Stream destination, int bufferSize) { }
public abstract void Write(byte[] buffer, int offset, int count);
public virtual void Write(System.ReadOnlySpan<byte> buffer) { }
public System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual void WriteByte(byte value) { }
}
public partial class StreamReader : System.IO.TextReader
{
public static readonly new System.IO.StreamReader Null;
public StreamReader(System.IO.Stream stream) { }
public StreamReader(System.IO.Stream stream, bool detectEncodingFromByteOrderMarks) { }
public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding) { }
public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks) { }
public StreamReader(System.IO.Stream stream, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) { }
public StreamReader(System.IO.Stream stream, System.Text.Encoding? encoding = null, bool detectEncodingFromByteOrderMarks = true, int bufferSize = -1, bool leaveOpen = false) { }
public StreamReader(string path) { }
public StreamReader(string path, bool detectEncodingFromByteOrderMarks) { }
public StreamReader(string path, System.IO.FileStreamOptions options) { }
public StreamReader(string path, System.Text.Encoding encoding) { }
public StreamReader(string path, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks) { }
public StreamReader(string path, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, int bufferSize) { }
public StreamReader(string path, System.Text.Encoding encoding, bool detectEncodingFromByteOrderMarks, System.IO.FileStreamOptions options) { }
public virtual System.IO.Stream BaseStream { get { throw null; } }
public virtual System.Text.Encoding CurrentEncoding { get { throw null; } }
public bool EndOfStream { get { throw null; } }
public override void Close() { }
public void DiscardBufferedData() { }
protected override void Dispose(bool disposing) { }
public override int Peek() { throw null; }
public override int Read() { throw null; }
public override int Read(char[] buffer, int index, int count) { throw null; }
public override int Read(System.Span<char> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadBlock(char[] buffer, int index, int count) { throw null; }
public override int ReadBlock(System.Span<char> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadBlockAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override string? ReadLine() { throw null; }
public override System.Threading.Tasks.Task<string?> ReadLineAsync() { throw null; }
public override System.Threading.Tasks.ValueTask<string?> ReadLineAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public override string ReadToEnd() { throw null; }
public override System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
public override System.Threading.Tasks.Task<string> ReadToEndAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class StreamWriter : System.IO.TextWriter
{
public static readonly new System.IO.StreamWriter Null;
public StreamWriter(System.IO.Stream stream) { }
public StreamWriter(System.IO.Stream stream, System.Text.Encoding encoding) { }
public StreamWriter(System.IO.Stream stream, System.Text.Encoding encoding, int bufferSize) { }
public StreamWriter(System.IO.Stream stream, System.Text.Encoding? encoding = null, int bufferSize = -1, bool leaveOpen = false) { }
public StreamWriter(string path) { }
public StreamWriter(string path, bool append) { }
public StreamWriter(string path, bool append, System.Text.Encoding encoding) { }
public StreamWriter(string path, bool append, System.Text.Encoding encoding, int bufferSize) { }
public StreamWriter(string path, System.IO.FileStreamOptions options) { }
public StreamWriter(string path, System.Text.Encoding encoding, System.IO.FileStreamOptions options) { }
public virtual bool AutoFlush { get { throw null; } set { } }
public virtual System.IO.Stream BaseStream { get { throw null; } }
public override System.Text.Encoding Encoding { get { throw null; } }
public override void Close() { }
protected override void Dispose(bool disposing) { }
public override System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync() { throw null; }
public override void Write(char value) { }
public override void Write(char[]? buffer) { }
public override void Write(char[] buffer, int index, int count) { }
public override void Write(System.ReadOnlySpan<char> buffer) { }
public override void Write(string? value) { }
public override void Write(string format, object? arg0) { }
public override void Write(string format, object? arg0, object? arg1) { }
public override void Write(string format, object? arg0, object? arg1, object? arg2) { }
public override void Write(string format, params object?[] arg) { }
public override System.Threading.Tasks.Task WriteAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(string? value) { throw null; }
public override void WriteLine(System.ReadOnlySpan<char> buffer) { }
public override void WriteLine(string? value) { }
public override void WriteLine(string format, object? arg0) { }
public override void WriteLine(string format, object? arg0, object? arg1) { }
public override void WriteLine(string format, object? arg0, object? arg1, object? arg2) { }
public override void WriteLine(string format, params object?[] arg) { }
public override System.Threading.Tasks.Task WriteLineAsync() { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(string? value) { throw null; }
}
public partial class StringReader : System.IO.TextReader
{
public StringReader(string s) { }
public override void Close() { }
protected override void Dispose(bool disposing) { }
public override int Peek() { throw null; }
public override int Read() { throw null; }
public override int Read(char[] buffer, int index, int count) { throw null; }
public override int Read(System.Span<char> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadBlock(System.Span<char> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadBlockAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override string? ReadLine() { throw null; }
public override System.Threading.Tasks.Task<string?> ReadLineAsync() { throw null; }
public override System.Threading.Tasks.ValueTask<string?> ReadLineAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public override string ReadToEnd() { throw null; }
public override System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
public override System.Threading.Tasks.Task<string> ReadToEndAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class StringWriter : System.IO.TextWriter
{
public StringWriter() { }
public StringWriter(System.IFormatProvider? formatProvider) { }
public StringWriter(System.Text.StringBuilder sb) { }
public StringWriter(System.Text.StringBuilder sb, System.IFormatProvider? formatProvider) { }
public override System.Text.Encoding Encoding { get { throw null; } }
public override void Close() { }
protected override void Dispose(bool disposing) { }
public override System.Threading.Tasks.Task FlushAsync() { throw null; }
public virtual System.Text.StringBuilder GetStringBuilder() { throw null; }
public override string ToString() { throw null; }
public override void Write(char value) { }
public override void Write(char[] buffer, int index, int count) { }
public override void Write(System.ReadOnlySpan<char> buffer) { }
public override void Write(string? value) { }
public override void Write(System.Text.StringBuilder? value) { }
public override System.Threading.Tasks.Task WriteAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(string? value) { throw null; }
public override System.Threading.Tasks.Task WriteAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteLine(System.ReadOnlySpan<char> buffer) { }
public override void WriteLine(System.Text.StringBuilder? value) { }
public override System.Threading.Tasks.Task WriteLineAsync(char value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(string? value) { throw null; }
public override System.Threading.Tasks.Task WriteLineAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public abstract partial class TextReader : System.MarshalByRefObject, System.IDisposable
{
public static readonly System.IO.TextReader Null;
protected TextReader() { }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual int Peek() { throw null; }
public virtual int Read() { throw null; }
public virtual int Read(char[] buffer, int index, int count) { throw null; }
public virtual int Read(System.Span<char> buffer) { throw null; }
public virtual System.Threading.Tasks.Task<int> ReadAsync(char[] buffer, int index, int count) { throw null; }
public virtual System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual int ReadBlock(char[] buffer, int index, int count) { throw null; }
public virtual int ReadBlock(System.Span<char> buffer) { throw null; }
public virtual System.Threading.Tasks.Task<int> ReadBlockAsync(char[] buffer, int index, int count) { throw null; }
public virtual System.Threading.Tasks.ValueTask<int> ReadBlockAsync(System.Memory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual string? ReadLine() { throw null; }
public virtual System.Threading.Tasks.Task<string?> ReadLineAsync() { throw null; }
public virtual System.Threading.Tasks.ValueTask<string?> ReadLineAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public virtual string ReadToEnd() { throw null; }
public virtual System.Threading.Tasks.Task<string> ReadToEndAsync() { throw null; }
public virtual System.Threading.Tasks.Task<string> ReadToEndAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.IO.TextReader Synchronized(System.IO.TextReader reader) { throw null; }
}
public abstract partial class TextWriter : System.MarshalByRefObject, System.IAsyncDisposable, System.IDisposable
{
protected char[] CoreNewLine;
public static readonly System.IO.TextWriter Null;
protected TextWriter() { }
protected TextWriter(System.IFormatProvider? formatProvider) { }
public abstract System.Text.Encoding Encoding { get; }
public virtual System.IFormatProvider FormatProvider { get { throw null; } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public virtual string NewLine { get { throw null; } set { } }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public virtual void Flush() { }
public virtual System.Threading.Tasks.Task FlushAsync() { throw null; }
public static System.IO.TextWriter Synchronized(System.IO.TextWriter writer) { throw null; }
public virtual void Write(bool value) { }
public virtual void Write(char value) { }
public virtual void Write(char[]? buffer) { }
public virtual void Write(char[] buffer, int index, int count) { }
public virtual void Write(decimal value) { }
public virtual void Write(double value) { }
public virtual void Write(int value) { }
public virtual void Write(long value) { }
public virtual void Write(object? value) { }
public virtual void Write(System.ReadOnlySpan<char> buffer) { }
public virtual void Write(float value) { }
public virtual void Write(string? value) { }
public virtual void Write(string format, object? arg0) { }
public virtual void Write(string format, object? arg0, object? arg1) { }
public virtual void Write(string format, object? arg0, object? arg1, object? arg2) { }
public virtual void Write(string format, params object?[] arg) { }
public virtual void Write(System.Text.StringBuilder? value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(uint value) { }
[System.CLSCompliantAttribute(false)]
public virtual void Write(ulong value) { }
public virtual System.Threading.Tasks.Task WriteAsync(char value) { throw null; }
public System.Threading.Tasks.Task WriteAsync(char[]? buffer) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(char[] buffer, int index, int count) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(string? value) { throw null; }
public virtual System.Threading.Tasks.Task WriteAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual void WriteLine() { }
public virtual void WriteLine(bool value) { }
public virtual void WriteLine(char value) { }
public virtual void WriteLine(char[]? buffer) { }
public virtual void WriteLine(char[] buffer, int index, int count) { }
public virtual void WriteLine(decimal value) { }
public virtual void WriteLine(double value) { }
public virtual void WriteLine(int value) { }
public virtual void WriteLine(long value) { }
public virtual void WriteLine(object? value) { }
public virtual void WriteLine(System.ReadOnlySpan<char> buffer) { }
public virtual void WriteLine(float value) { }
public virtual void WriteLine(string? value) { }
public virtual void WriteLine(string format, object? arg0) { }
public virtual void WriteLine(string format, object? arg0, object? arg1) { }
public virtual void WriteLine(string format, object? arg0, object? arg1, object? arg2) { }
public virtual void WriteLine(string format, params object?[] arg) { }
public virtual void WriteLine(System.Text.StringBuilder? value) { }
[System.CLSCompliantAttribute(false)]
public virtual void WriteLine(uint value) { }
[System.CLSCompliantAttribute(false)]
public virtual void WriteLine(ulong value) { }
public virtual System.Threading.Tasks.Task WriteLineAsync() { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(char value) { throw null; }
public System.Threading.Tasks.Task WriteLineAsync(char[]? buffer) { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(char[] buffer, int index, int count) { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(System.ReadOnlyMemory<char> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(string? value) { throw null; }
public virtual System.Threading.Tasks.Task WriteLineAsync(System.Text.StringBuilder? value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public partial class UnmanagedMemoryStream : System.IO.Stream
{
protected UnmanagedMemoryStream() { }
[System.CLSCompliantAttribute(false)]
public unsafe UnmanagedMemoryStream(byte* pointer, long length) { }
[System.CLSCompliantAttribute(false)]
public unsafe UnmanagedMemoryStream(byte* pointer, long length, long capacity, System.IO.FileAccess access) { }
public UnmanagedMemoryStream(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length) { }
public UnmanagedMemoryStream(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length, System.IO.FileAccess access) { }
public override bool CanRead { get { throw null; } }
public override bool CanSeek { get { throw null; } }
public override bool CanWrite { get { throw null; } }
public long Capacity { get { throw null; } }
public override long Length { get { throw null; } }
public override long Position { get { throw null; } set { } }
[System.CLSCompliantAttribute(false)]
public unsafe byte* PositionPointer { get { throw null; } set { } }
protected override void Dispose(bool disposing) { }
public override void Flush() { }
public override System.Threading.Tasks.Task FlushAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
[System.CLSCompliantAttribute(false)]
protected unsafe void Initialize(byte* pointer, long length, long capacity, System.IO.FileAccess access) { }
protected void Initialize(System.Runtime.InteropServices.SafeBuffer buffer, long offset, long length, System.IO.FileAccess access) { }
public override int Read(byte[] buffer, int offset, int count) { throw null; }
public override int Read(System.Span<byte> buffer) { throw null; }
public override System.Threading.Tasks.Task<int> ReadAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask<int> ReadAsync(System.Memory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override int ReadByte() { throw null; }
public override long Seek(long offset, System.IO.SeekOrigin loc) { throw null; }
public override void SetLength(long value) { }
public override void Write(byte[] buffer, int offset, int count) { }
public override void Write(System.ReadOnlySpan<byte> buffer) { }
public override System.Threading.Tasks.Task WriteAsync(byte[] buffer, int offset, int count, System.Threading.CancellationToken cancellationToken) { throw null; }
public override System.Threading.Tasks.ValueTask WriteAsync(System.ReadOnlyMemory<byte> buffer, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public override void WriteByte(byte value) { }
}
}
namespace System.IO.Enumeration
{
public ref partial struct FileSystemEntry
{
private object _dummy;
private int _dummyPrimitive;
public System.IO.FileAttributes Attributes { get { throw null; } }
public System.DateTimeOffset CreationTimeUtc { get { throw null; } }
public readonly System.ReadOnlySpan<char> Directory { get { throw null; } }
public System.ReadOnlySpan<char> FileName { get { throw null; } }
public bool IsDirectory { get { throw null; } }
public bool IsHidden { get { throw null; } }
public System.DateTimeOffset LastAccessTimeUtc { get { throw null; } }
public System.DateTimeOffset LastWriteTimeUtc { get { throw null; } }
public long Length { get { throw null; } }
public readonly System.ReadOnlySpan<char> OriginalRootDirectory { get { throw null; } }
public readonly System.ReadOnlySpan<char> RootDirectory { get { throw null; } }
public System.IO.FileSystemInfo ToFileSystemInfo() { throw null; }
public string ToFullPath() { throw null; }
public string ToSpecifiedFullPath() { throw null; }
}
public partial class FileSystemEnumerable<TResult> : System.Collections.Generic.IEnumerable<TResult>, System.Collections.IEnumerable
{
public FileSystemEnumerable(string directory, System.IO.Enumeration.FileSystemEnumerable<TResult>.FindTransform transform, System.IO.EnumerationOptions? options = null) { }
public System.IO.Enumeration.FileSystemEnumerable<TResult>.FindPredicate? ShouldIncludePredicate { get { throw null; } set { } }
public System.IO.Enumeration.FileSystemEnumerable<TResult>.FindPredicate? ShouldRecursePredicate { get { throw null; } set { } }
public System.Collections.Generic.IEnumerator<TResult> GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public delegate bool FindPredicate(ref System.IO.Enumeration.FileSystemEntry entry);
public delegate TResult FindTransform(ref System.IO.Enumeration.FileSystemEntry entry);
}
public abstract partial class FileSystemEnumerator<TResult> : System.Runtime.ConstrainedExecution.CriticalFinalizerObject, System.Collections.Generic.IEnumerator<TResult>, System.Collections.IEnumerator, System.IDisposable
{
public FileSystemEnumerator(string directory, System.IO.EnumerationOptions? options = null) { }
public TResult Current { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
protected virtual bool ContinueOnError(int error) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public bool MoveNext() { throw null; }
protected virtual void OnDirectoryFinished(System.ReadOnlySpan<char> directory) { }
public void Reset() { }
protected virtual bool ShouldIncludeEntry(ref System.IO.Enumeration.FileSystemEntry entry) { throw null; }
protected virtual bool ShouldRecurseIntoEntry(ref System.IO.Enumeration.FileSystemEntry entry) { throw null; }
protected abstract TResult TransformEntry(ref System.IO.Enumeration.FileSystemEntry entry);
}
public static partial class FileSystemName
{
public static bool MatchesSimpleExpression(System.ReadOnlySpan<char> expression, System.ReadOnlySpan<char> name, bool ignoreCase = true) { throw null; }
public static bool MatchesWin32Expression(System.ReadOnlySpan<char> expression, System.ReadOnlySpan<char> name, bool ignoreCase = true) { throw null; }
public static string TranslateWin32Expression(string? expression) { throw null; }
}
}
namespace System.Net
{
public static partial class WebUtility
{
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? HtmlDecode(string? value) { throw null; }
public static void HtmlDecode(string? value, System.IO.TextWriter output) { }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? HtmlEncode(string? value) { throw null; }
public static void HtmlEncode(string? value, System.IO.TextWriter output) { }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("encodedValue")]
public static string? UrlDecode(string? encodedValue) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("encodedValue")]
public static byte[]? UrlDecodeToBytes(byte[]? encodedValue, int offset, int count) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static string? UrlEncode(string? value) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("value")]
public static byte[]? UrlEncodeToBytes(byte[]? value, int offset, int count) { throw null; }
}
}
namespace System.Numerics
{
public static partial class BitOperations
{
public static bool IsPow2(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool IsPow2(uint value) { throw null; }
public static bool IsPow2(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool IsPow2(ulong value) { throw null; }
public static bool IsPow2(nint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool IsPow2(nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int LeadingZeroCount(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int LeadingZeroCount(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int LeadingZeroCount(nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int Log2(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int Log2(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int Log2(nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int PopCount(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int PopCount(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int PopCount(nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint RotateLeft(uint value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong RotateLeft(ulong value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint RotateLeft(nuint value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint RotateRight(uint value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong RotateRight(ulong value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint RotateRight(nuint value, int offset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint RoundUpToPowerOf2(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong RoundUpToPowerOf2(ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint RoundUpToPowerOf2(nuint value) { throw null; }
public static int TrailingZeroCount(int value) { throw null; }
public static int TrailingZeroCount(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int TrailingZeroCount(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int TrailingZeroCount(ulong value) { throw null; }
public static int TrailingZeroCount(nint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static int TrailingZeroCount(nuint value) { throw null; }
}
}
namespace System.Reflection
{
public sealed partial class AmbiguousMatchException : System.SystemException
{
public AmbiguousMatchException() { }
public AmbiguousMatchException(string? message) { }
public AmbiguousMatchException(string? message, System.Exception? inner) { }
}
public abstract partial class Assembly : System.Reflection.ICustomAttributeProvider, System.Runtime.Serialization.ISerializable
{
protected Assembly() { }
[System.ObsoleteAttribute("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual string? CodeBase { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo> DefinedTypes { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")] get { throw null; } }
public virtual System.Reflection.MethodInfo? EntryPoint { get { throw null; } }
[System.ObsoleteAttribute("Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location.", DiagnosticId = "SYSLIB0012", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual string EscapedCodeBase { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Type> ExportedTypes { [System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")] get { throw null; } }
public virtual string? FullName { get { throw null; } }
[System.ObsoleteAttribute("The Global Assembly Cache is not supported.", DiagnosticId = "SYSLIB0005", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public virtual bool GlobalAssemblyCache { get { throw null; } }
public virtual long HostContext { get { throw null; } }
public virtual string ImageRuntimeVersion { get { throw null; } }
public virtual bool IsCollectible { get { throw null; } }
public virtual bool IsDynamic { get { throw null; } }
public bool IsFullyTrusted { get { throw null; } }
public virtual string Location { get { throw null; } }
public virtual System.Reflection.Module ManifestModule { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.Module> Modules { get { throw null; } }
public virtual bool ReflectionOnly { get { throw null; } }
public virtual System.Security.SecurityRuleSet SecurityRuleSet { get { throw null; } }
public virtual event System.Reflection.ModuleResolveEventHandler? ModuleResolve { add { } remove { } }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Assembly.CreateInstance is not supported with trimming. Use Type.GetType instead.")]
public object? CreateInstance(string typeName) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Assembly.CreateInstance is not supported with trimming. Use Type.GetType instead.")]
public object? CreateInstance(string typeName, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Assembly.CreateInstance is not supported with trimming. Use Type.GetType instead.")]
public virtual object? CreateInstance(string typeName, bool ignoreCase, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, object[]? args, System.Globalization.CultureInfo? culture, object[]? activationAttributes) { throw null; }
public static string CreateQualifiedName(string? assemblyName, string? typeName) { throw null; }
public override bool Equals(object? o) { throw null; }
public static System.Reflection.Assembly? GetAssembly(System.Type type) { throw null; }
public static System.Reflection.Assembly GetCallingAssembly() { throw null; }
public virtual object[] GetCustomAttributes(bool inherit) { throw null; }
public virtual object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; }
public static System.Reflection.Assembly? GetEntryAssembly() { throw null; }
public static System.Reflection.Assembly GetExecutingAssembly() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] GetExportedTypes() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual System.IO.FileStream? GetFile(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual System.IO.FileStream[] GetFiles() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("This member throws an exception for assemblies embedded in a single-file app")]
public virtual System.IO.FileStream[] GetFiles(bool getResourceModules) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] GetForwardedTypes() { throw null; }
public override int GetHashCode() { throw null; }
public System.Reflection.Module[] GetLoadedModules() { throw null; }
public virtual System.Reflection.Module[] GetLoadedModules(bool getResourceModules) { throw null; }
public virtual System.Reflection.ManifestResourceInfo? GetManifestResourceInfo(string resourceName) { throw null; }
public virtual string[] GetManifestResourceNames() { throw null; }
public virtual System.IO.Stream? GetManifestResourceStream(string name) { throw null; }
public virtual System.IO.Stream? GetManifestResourceStream(System.Type type, string name) { throw null; }
public virtual System.Reflection.Module? GetModule(string name) { throw null; }
public System.Reflection.Module[] GetModules() { throw null; }
public virtual System.Reflection.Module[] GetModules(bool getResourceModules) { throw null; }
public virtual System.Reflection.AssemblyName GetName() { throw null; }
public virtual System.Reflection.AssemblyName GetName(bool copiedName) { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Assembly references might be removed")]
public virtual System.Reflection.AssemblyName[] GetReferencedAssemblies() { throw null; }
public virtual System.Reflection.Assembly GetSatelliteAssembly(System.Globalization.CultureInfo culture) { throw null; }
public virtual System.Reflection.Assembly GetSatelliteAssembly(System.Globalization.CultureInfo culture, System.Version? version) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string name, bool throwOnError) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string name, bool throwOnError, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] GetTypes() { throw null; }
public virtual bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly Load(byte[] rawAssembly) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly Load(byte[] rawAssembly, byte[]? rawSymbolStore) { throw null; }
public static System.Reflection.Assembly Load(System.Reflection.AssemblyName assemblyRef) { throw null; }
public static System.Reflection.Assembly Load(string assemblyString) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly LoadFile(string path) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly LoadFrom(string assemblyFile) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly LoadFrom(string assemblyFile, byte[]? hashValue, System.Configuration.Assemblies.AssemblyHashAlgorithm hashAlgorithm) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded module depends on might be removed")]
public System.Reflection.Module LoadModule(string moduleName, byte[]? rawModule) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded module depends on might be removed")]
public virtual System.Reflection.Module LoadModule(string moduleName, byte[]? rawModule, byte[]? rawSymbolStore) { throw null; }
[System.ObsoleteAttribute("Assembly.LoadWithPartialName has been deprecated. Use Assembly.Load() instead.")]
public static System.Reflection.Assembly? LoadWithPartialName(string partialName) { throw null; }
public static bool operator ==(System.Reflection.Assembly? left, System.Reflection.Assembly? right) { throw null; }
public static bool operator !=(System.Reflection.Assembly? left, System.Reflection.Assembly? right) { throw null; }
[System.ObsoleteAttribute("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0018", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly ReflectionOnlyLoad(byte[] rawAssembly) { throw null; }
[System.ObsoleteAttribute("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0018", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly ReflectionOnlyLoad(string assemblyString) { throw null; }
[System.ObsoleteAttribute("ReflectionOnly loading is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0018", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly ReflectionOnlyLoadFrom(string assemblyFile) { throw null; }
public override string ToString() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types and members the loaded assembly depends on might be removed")]
public static System.Reflection.Assembly UnsafeLoadFrom(string assemblyFile) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyAlgorithmIdAttribute : System.Attribute
{
public AssemblyAlgorithmIdAttribute(System.Configuration.Assemblies.AssemblyHashAlgorithm algorithmId) { }
[System.CLSCompliantAttribute(false)]
public AssemblyAlgorithmIdAttribute(uint algorithmId) { }
[System.CLSCompliantAttribute(false)]
public uint AlgorithmId { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyCompanyAttribute : System.Attribute
{
public AssemblyCompanyAttribute(string company) { }
public string Company { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyConfigurationAttribute : System.Attribute
{
public AssemblyConfigurationAttribute(string configuration) { }
public string Configuration { get { throw null; } }
}
public enum AssemblyContentType
{
Default = 0,
WindowsRuntime = 1,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyCopyrightAttribute : System.Attribute
{
public AssemblyCopyrightAttribute(string copyright) { }
public string Copyright { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyCultureAttribute : System.Attribute
{
public AssemblyCultureAttribute(string culture) { }
public string Culture { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyDefaultAliasAttribute : System.Attribute
{
public AssemblyDefaultAliasAttribute(string defaultAlias) { }
public string DefaultAlias { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyDelaySignAttribute : System.Attribute
{
public AssemblyDelaySignAttribute(bool delaySign) { }
public bool DelaySign { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyDescriptionAttribute : System.Attribute
{
public AssemblyDescriptionAttribute(string description) { }
public string Description { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyFileVersionAttribute : System.Attribute
{
public AssemblyFileVersionAttribute(string version) { }
public string Version { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyFlagsAttribute : System.Attribute
{
[System.ObsoleteAttribute("This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.")]
public AssemblyFlagsAttribute(int assemblyFlags) { }
public AssemblyFlagsAttribute(System.Reflection.AssemblyNameFlags assemblyFlags) { }
[System.CLSCompliantAttribute(false)]
[System.ObsoleteAttribute("This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.")]
public AssemblyFlagsAttribute(uint flags) { }
public int AssemblyFlags { get { throw null; } }
[System.CLSCompliantAttribute(false)]
[System.ObsoleteAttribute("AssemblyFlagsAttribute.Flags has been deprecated. Use AssemblyFlags instead.")]
public uint Flags { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyInformationalVersionAttribute : System.Attribute
{
public AssemblyInformationalVersionAttribute(string informationalVersion) { }
public string InformationalVersion { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyKeyFileAttribute : System.Attribute
{
public AssemblyKeyFileAttribute(string keyFile) { }
public string KeyFile { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyKeyNameAttribute : System.Attribute
{
public AssemblyKeyNameAttribute(string keyName) { }
public string KeyName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed partial class AssemblyMetadataAttribute : System.Attribute
{
public AssemblyMetadataAttribute(string key, string? value) { }
public string Key { get { throw null; } }
public string? Value { get { throw null; } }
}
public sealed partial class AssemblyName : System.ICloneable, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
public AssemblyName() { }
public AssemblyName(string assemblyName) { }
public string? CodeBase { [System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("The code will return an empty string for assemblies embedded in a single-file app")] get { throw null; } set { } }
public System.Reflection.AssemblyContentType ContentType { get { throw null; } set { } }
public System.Globalization.CultureInfo? CultureInfo { get { throw null; } set { } }
public string? CultureName { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("The code will return an empty string for assemblies embedded in a single-file app")]
public string? EscapedCodeBase { get { throw null; } }
public System.Reflection.AssemblyNameFlags Flags { get { throw null; } set { } }
public string FullName { get { throw null; } }
[System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Configuration.Assemblies.AssemblyHashAlgorithm HashAlgorithm { get { throw null; } set { } }
[System.ObsoleteAttribute("Strong name signing is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0017", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Reflection.StrongNameKeyPair? KeyPair { get { throw null; } set { } }
public string? Name { get { throw null; } set { } }
[System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Reflection.ProcessorArchitecture ProcessorArchitecture { get { throw null; } set { } }
public System.Version? Version { get { throw null; } set { } }
[System.ObsoleteAttribute("AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete and not supported.", DiagnosticId = "SYSLIB0037", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public System.Configuration.Assemblies.AssemblyVersionCompatibility VersionCompatibility { get { throw null; } set { } }
public object Clone() { throw null; }
public static System.Reflection.AssemblyName GetAssemblyName(string assemblyFile) { throw null; }
public void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public byte[]? GetPublicKey() { throw null; }
public byte[]? GetPublicKeyToken() { throw null; }
public void OnDeserialization(object? sender) { }
public static bool ReferenceMatchesDefinition(System.Reflection.AssemblyName? reference, System.Reflection.AssemblyName? definition) { throw null; }
public void SetPublicKey(byte[]? publicKey) { }
public void SetPublicKeyToken(byte[]? publicKeyToken) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum AssemblyNameFlags
{
None = 0,
PublicKey = 1,
Retargetable = 256,
EnableJITcompileOptimizer = 16384,
EnableJITcompileTracking = 32768,
}
public partial class AssemblyNameProxy : System.MarshalByRefObject
{
public AssemblyNameProxy() { }
public System.Reflection.AssemblyName GetAssemblyName(string assemblyFile) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyProductAttribute : System.Attribute
{
public AssemblyProductAttribute(string product) { }
public string Product { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false, AllowMultiple=false)]
public sealed partial class AssemblySignatureKeyAttribute : System.Attribute
{
public AssemblySignatureKeyAttribute(string publicKey, string countersignature) { }
public string Countersignature { get { throw null; } }
public string PublicKey { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyTitleAttribute : System.Attribute
{
public AssemblyTitleAttribute(string title) { }
public string Title { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyTrademarkAttribute : System.Attribute
{
public AssemblyTrademarkAttribute(string trademark) { }
public string Trademark { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyVersionAttribute : System.Attribute
{
public AssemblyVersionAttribute(string version) { }
public string Version { get { throw null; } }
}
public abstract partial class Binder
{
protected Binder() { }
public abstract System.Reflection.FieldInfo BindToField(System.Reflection.BindingFlags bindingAttr, System.Reflection.FieldInfo[] match, object value, System.Globalization.CultureInfo? culture);
public abstract System.Reflection.MethodBase BindToMethod(System.Reflection.BindingFlags bindingAttr, System.Reflection.MethodBase[] match, ref object?[] args, System.Reflection.ParameterModifier[]? modifiers, System.Globalization.CultureInfo? culture, string[]? names, out object? state);
public abstract object ChangeType(object value, System.Type type, System.Globalization.CultureInfo? culture);
public abstract void ReorderArgumentArray(ref object?[] args, object state);
public abstract System.Reflection.MethodBase? SelectMethod(System.Reflection.BindingFlags bindingAttr, System.Reflection.MethodBase[] match, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers);
public abstract System.Reflection.PropertyInfo? SelectProperty(System.Reflection.BindingFlags bindingAttr, System.Reflection.PropertyInfo[] match, System.Type? returnType, System.Type[]? indexes, System.Reflection.ParameterModifier[]? modifiers);
}
[System.FlagsAttribute]
public enum BindingFlags
{
Default = 0,
IgnoreCase = 1,
DeclaredOnly = 2,
Instance = 4,
Static = 8,
Public = 16,
NonPublic = 32,
FlattenHierarchy = 64,
InvokeMethod = 256,
CreateInstance = 512,
GetField = 1024,
SetField = 2048,
GetProperty = 4096,
SetProperty = 8192,
PutDispProperty = 16384,
PutRefDispProperty = 32768,
ExactBinding = 65536,
SuppressChangeType = 131072,
OptionalParamBinding = 262144,
IgnoreReturn = 16777216,
DoNotWrapExceptions = 33554432,
}
[System.FlagsAttribute]
public enum CallingConventions
{
Standard = 1,
VarArgs = 2,
Any = 3,
HasThis = 32,
ExplicitThis = 64,
}
public abstract partial class ConstructorInfo : System.Reflection.MethodBase
{
public static readonly string ConstructorName;
public static readonly string TypeConstructorName;
protected ConstructorInfo() { }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public object Invoke(object?[]? parameters) { throw null; }
public abstract object Invoke(System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? parameters, System.Globalization.CultureInfo? culture);
public static bool operator ==(System.Reflection.ConstructorInfo? left, System.Reflection.ConstructorInfo? right) { throw null; }
public static bool operator !=(System.Reflection.ConstructorInfo? left, System.Reflection.ConstructorInfo? right) { throw null; }
}
public partial class CustomAttributeData
{
protected CustomAttributeData() { }
public virtual System.Type AttributeType { get { throw null; } }
public virtual System.Reflection.ConstructorInfo Constructor { get { throw null; } }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeTypedArgument> ConstructorArguments { get { throw null; } }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeNamedArgument> NamedArguments { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public static System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributes(System.Reflection.Assembly target) { throw null; }
public static System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributes(System.Reflection.MemberInfo target) { throw null; }
public static System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributes(System.Reflection.Module target) { throw null; }
public static System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributes(System.Reflection.ParameterInfo target) { throw null; }
public override int GetHashCode() { throw null; }
public override string ToString() { throw null; }
}
public static partial class CustomAttributeExtensions
{
public static System.Attribute? GetCustomAttribute(this System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.Module element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static System.Attribute? GetCustomAttribute(this System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.Assembly element) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.Module element) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.Module element, System.Type attributeType) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Attribute> GetCustomAttributes(this System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.Assembly element) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.MemberInfo element) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.MemberInfo element, bool inherit) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.Module element) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.ParameterInfo element) where T : System.Attribute { throw null; }
public static System.Collections.Generic.IEnumerable<T> GetCustomAttributes<T>(this System.Reflection.ParameterInfo element, bool inherit) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.Assembly element) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.MemberInfo element) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.MemberInfo element, bool inherit) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.Module element) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.ParameterInfo element) where T : System.Attribute { throw null; }
public static T? GetCustomAttribute<T>(this System.Reflection.ParameterInfo element, bool inherit) where T : System.Attribute { throw null; }
public static bool IsDefined(this System.Reflection.Assembly element, System.Type attributeType) { throw null; }
public static bool IsDefined(this System.Reflection.MemberInfo element, System.Type attributeType) { throw null; }
public static bool IsDefined(this System.Reflection.MemberInfo element, System.Type attributeType, bool inherit) { throw null; }
public static bool IsDefined(this System.Reflection.Module element, System.Type attributeType) { throw null; }
public static bool IsDefined(this System.Reflection.ParameterInfo element, System.Type attributeType) { throw null; }
public static bool IsDefined(this System.Reflection.ParameterInfo element, System.Type attributeType, bool inherit) { throw null; }
}
public partial class CustomAttributeFormatException : System.FormatException
{
public CustomAttributeFormatException() { }
protected CustomAttributeFormatException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public CustomAttributeFormatException(string? message) { }
public CustomAttributeFormatException(string? message, System.Exception? inner) { }
}
public readonly partial struct CustomAttributeNamedArgument : System.IEquatable<System.Reflection.CustomAttributeNamedArgument>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, object? value) { throw null; }
public CustomAttributeNamedArgument(System.Reflection.MemberInfo memberInfo, System.Reflection.CustomAttributeTypedArgument typedArgument) { throw null; }
public bool IsField { get { throw null; } }
public System.Reflection.MemberInfo MemberInfo { get { throw null; } }
public string MemberName { get { throw null; } }
public System.Reflection.CustomAttributeTypedArgument TypedValue { get { throw null; } }
public bool Equals(System.Reflection.CustomAttributeNamedArgument other) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Reflection.CustomAttributeNamedArgument left, System.Reflection.CustomAttributeNamedArgument right) { throw null; }
public static bool operator !=(System.Reflection.CustomAttributeNamedArgument left, System.Reflection.CustomAttributeNamedArgument right) { throw null; }
public override string ToString() { throw null; }
}
public readonly partial struct CustomAttributeTypedArgument : System.IEquatable<System.Reflection.CustomAttributeTypedArgument>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public CustomAttributeTypedArgument(object value) { throw null; }
public CustomAttributeTypedArgument(System.Type argumentType, object? value) { throw null; }
public System.Type ArgumentType { get { throw null; } }
public object? Value { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Reflection.CustomAttributeTypedArgument other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Reflection.CustomAttributeTypedArgument left, System.Reflection.CustomAttributeTypedArgument right) { throw null; }
public static bool operator !=(System.Reflection.CustomAttributeTypedArgument left, System.Reflection.CustomAttributeTypedArgument right) { throw null; }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Interface | System.AttributeTargets.Struct)]
public sealed partial class DefaultMemberAttribute : System.Attribute
{
public DefaultMemberAttribute(string memberName) { }
public string MemberName { get { throw null; } }
}
[System.FlagsAttribute]
public enum EventAttributes
{
None = 0,
SpecialName = 512,
ReservedMask = 1024,
RTSpecialName = 1024,
}
public abstract partial class EventInfo : System.Reflection.MemberInfo
{
protected EventInfo() { }
public virtual System.Reflection.MethodInfo? AddMethod { get { throw null; } }
public abstract System.Reflection.EventAttributes Attributes { get; }
public virtual System.Type? EventHandlerType { get { throw null; } }
public virtual bool IsMulticast { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public virtual System.Reflection.MethodInfo? RaiseMethod { get { throw null; } }
public virtual System.Reflection.MethodInfo? RemoveMethod { get { throw null; } }
public virtual void AddEventHandler(object? target, System.Delegate? handler) { }
public override bool Equals(object? obj) { throw null; }
public System.Reflection.MethodInfo? GetAddMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetAddMethod(bool nonPublic);
public override int GetHashCode() { throw null; }
public System.Reflection.MethodInfo[] GetOtherMethods() { throw null; }
public virtual System.Reflection.MethodInfo[] GetOtherMethods(bool nonPublic) { throw null; }
public System.Reflection.MethodInfo? GetRaiseMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetRaiseMethod(bool nonPublic);
public System.Reflection.MethodInfo? GetRemoveMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetRemoveMethod(bool nonPublic);
public static bool operator ==(System.Reflection.EventInfo? left, System.Reflection.EventInfo? right) { throw null; }
public static bool operator !=(System.Reflection.EventInfo? left, System.Reflection.EventInfo? right) { throw null; }
public virtual void RemoveEventHandler(object? target, System.Delegate? handler) { }
}
public partial class ExceptionHandlingClause
{
protected ExceptionHandlingClause() { }
public virtual System.Type? CatchType { get { throw null; } }
public virtual int FilterOffset { get { throw null; } }
public virtual System.Reflection.ExceptionHandlingClauseOptions Flags { get { throw null; } }
public virtual int HandlerLength { get { throw null; } }
public virtual int HandlerOffset { get { throw null; } }
public virtual int TryLength { get { throw null; } }
public virtual int TryOffset { get { throw null; } }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum ExceptionHandlingClauseOptions
{
Clause = 0,
Filter = 1,
Finally = 2,
Fault = 4,
}
[System.FlagsAttribute]
public enum FieldAttributes
{
PrivateScope = 0,
Private = 1,
FamANDAssem = 2,
Assembly = 3,
Family = 4,
FamORAssem = 5,
Public = 6,
FieldAccessMask = 7,
Static = 16,
InitOnly = 32,
Literal = 64,
NotSerialized = 128,
HasFieldRVA = 256,
SpecialName = 512,
RTSpecialName = 1024,
HasFieldMarshal = 4096,
PinvokeImpl = 8192,
HasDefault = 32768,
ReservedMask = 38144,
}
public abstract partial class FieldInfo : System.Reflection.MemberInfo
{
protected FieldInfo() { }
public abstract System.Reflection.FieldAttributes Attributes { get; }
public abstract System.RuntimeFieldHandle FieldHandle { get; }
public abstract System.Type FieldType { get; }
public bool IsAssembly { get { throw null; } }
public bool IsFamily { get { throw null; } }
public bool IsFamilyAndAssembly { get { throw null; } }
public bool IsFamilyOrAssembly { get { throw null; } }
public bool IsInitOnly { get { throw null; } }
public bool IsLiteral { get { throw null; } }
public bool IsNotSerialized { get { throw null; } }
public bool IsPinvokeImpl { get { throw null; } }
public bool IsPrivate { get { throw null; } }
public bool IsPublic { get { throw null; } }
public virtual bool IsSecurityCritical { get { throw null; } }
public virtual bool IsSecuritySafeCritical { get { throw null; } }
public virtual bool IsSecurityTransparent { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public bool IsStatic { get { throw null; } }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public static System.Reflection.FieldInfo GetFieldFromHandle(System.RuntimeFieldHandle handle) { throw null; }
public static System.Reflection.FieldInfo GetFieldFromHandle(System.RuntimeFieldHandle handle, System.RuntimeTypeHandle declaringType) { throw null; }
public override int GetHashCode() { throw null; }
public virtual System.Type[] GetOptionalCustomModifiers() { throw null; }
public virtual object? GetRawConstantValue() { throw null; }
public virtual System.Type[] GetRequiredCustomModifiers() { throw null; }
public abstract object? GetValue(object? obj);
[System.CLSCompliantAttribute(false)]
public virtual object? GetValueDirect(System.TypedReference obj) { throw null; }
public static bool operator ==(System.Reflection.FieldInfo? left, System.Reflection.FieldInfo? right) { throw null; }
public static bool operator !=(System.Reflection.FieldInfo? left, System.Reflection.FieldInfo? right) { throw null; }
public void SetValue(object? obj, object? value) { }
public abstract void SetValue(object? obj, object? value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, System.Globalization.CultureInfo? culture);
[System.CLSCompliantAttribute(false)]
public virtual void SetValueDirect(System.TypedReference obj, object value) { }
}
[System.FlagsAttribute]
public enum GenericParameterAttributes
{
None = 0,
Covariant = 1,
Contravariant = 2,
VarianceMask = 3,
ReferenceTypeConstraint = 4,
NotNullableValueTypeConstraint = 8,
DefaultConstructorConstraint = 16,
SpecialConstraintMask = 28,
}
public partial interface ICustomAttributeProvider
{
object[] GetCustomAttributes(bool inherit);
object[] GetCustomAttributes(System.Type attributeType, bool inherit);
bool IsDefined(System.Type attributeType, bool inherit);
}
public enum ImageFileMachine
{
I386 = 332,
ARM = 452,
IA64 = 512,
AMD64 = 34404,
}
public partial struct InterfaceMapping
{
public System.Reflection.MethodInfo[] InterfaceMethods;
public System.Type InterfaceType;
public System.Reflection.MethodInfo[] TargetMethods;
public System.Type TargetType;
}
public static partial class IntrospectionExtensions
{
public static System.Reflection.TypeInfo GetTypeInfo(this System.Type type) { throw null; }
}
public partial class InvalidFilterCriteriaException : System.ApplicationException
{
public InvalidFilterCriteriaException() { }
protected InvalidFilterCriteriaException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public InvalidFilterCriteriaException(string? message) { }
public InvalidFilterCriteriaException(string? message, System.Exception? inner) { }
}
public partial interface IReflect
{
System.Type UnderlyingSystemType { get; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.MemberInfo[] GetMembers(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.PropertyInfo? GetProperty(string name, System.Reflection.BindingFlags bindingAttr);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
System.Reflection.PropertyInfo? GetProperty(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type? returnType, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers);
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args, System.Reflection.ParameterModifier[]? modifiers, System.Globalization.CultureInfo? culture, string[]? namedParameters);
}
public partial interface IReflectableType
{
System.Reflection.TypeInfo GetTypeInfo();
}
public partial class LocalVariableInfo
{
protected LocalVariableInfo() { }
public virtual bool IsPinned { get { throw null; } }
public virtual int LocalIndex { get { throw null; } }
public virtual System.Type LocalType { get { throw null; } }
public override string ToString() { throw null; }
}
public partial class ManifestResourceInfo
{
public ManifestResourceInfo(System.Reflection.Assembly? containingAssembly, string? containingFileName, System.Reflection.ResourceLocation resourceLocation) { }
public virtual string? FileName { get { throw null; } }
public virtual System.Reflection.Assembly? ReferencedAssembly { get { throw null; } }
public virtual System.Reflection.ResourceLocation ResourceLocation { get { throw null; } }
}
public delegate bool MemberFilter(System.Reflection.MemberInfo m, object? filterCriteria);
public abstract partial class MemberInfo : System.Reflection.ICustomAttributeProvider
{
protected MemberInfo() { }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
public abstract System.Type? DeclaringType { get; }
public virtual bool IsCollectible { get { throw null; } }
public abstract System.Reflection.MemberTypes MemberType { get; }
public virtual int MetadataToken { get { throw null; } }
public virtual System.Reflection.Module Module { get { throw null; } }
public abstract string Name { get; }
public abstract System.Type? ReflectedType { get; }
public override bool Equals(object? obj) { throw null; }
public abstract object[] GetCustomAttributes(bool inherit);
public abstract object[] GetCustomAttributes(System.Type attributeType, bool inherit);
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; }
public override int GetHashCode() { throw null; }
public virtual bool HasSameMetadataDefinitionAs(System.Reflection.MemberInfo other) { throw null; }
public abstract bool IsDefined(System.Type attributeType, bool inherit);
public static bool operator ==(System.Reflection.MemberInfo? left, System.Reflection.MemberInfo? right) { throw null; }
public static bool operator !=(System.Reflection.MemberInfo? left, System.Reflection.MemberInfo? right) { throw null; }
}
[System.FlagsAttribute]
public enum MemberTypes
{
Constructor = 1,
Event = 2,
Field = 4,
Method = 8,
Property = 16,
TypeInfo = 32,
Custom = 64,
NestedType = 128,
All = 191,
}
[System.FlagsAttribute]
public enum MethodAttributes
{
PrivateScope = 0,
ReuseSlot = 0,
Private = 1,
FamANDAssem = 2,
Assembly = 3,
Family = 4,
FamORAssem = 5,
Public = 6,
MemberAccessMask = 7,
UnmanagedExport = 8,
Static = 16,
Final = 32,
Virtual = 64,
HideBySig = 128,
NewSlot = 256,
VtableLayoutMask = 256,
CheckAccessOnOverride = 512,
Abstract = 1024,
SpecialName = 2048,
RTSpecialName = 4096,
PinvokeImpl = 8192,
HasSecurity = 16384,
RequireSecObject = 32768,
ReservedMask = 53248,
}
public abstract partial class MethodBase : System.Reflection.MemberInfo
{
protected MethodBase() { }
public abstract System.Reflection.MethodAttributes Attributes { get; }
public virtual System.Reflection.CallingConventions CallingConvention { get { throw null; } }
public virtual bool ContainsGenericParameters { get { throw null; } }
public bool IsAbstract { get { throw null; } }
public bool IsAssembly { get { throw null; } }
public virtual bool IsConstructedGenericMethod { get { throw null; } }
public bool IsConstructor { get { throw null; } }
public bool IsFamily { get { throw null; } }
public bool IsFamilyAndAssembly { get { throw null; } }
public bool IsFamilyOrAssembly { get { throw null; } }
public bool IsFinal { get { throw null; } }
public virtual bool IsGenericMethod { get { throw null; } }
public virtual bool IsGenericMethodDefinition { get { throw null; } }
public bool IsHideBySig { get { throw null; } }
public bool IsPrivate { get { throw null; } }
public bool IsPublic { get { throw null; } }
public virtual bool IsSecurityCritical { get { throw null; } }
public virtual bool IsSecuritySafeCritical { get { throw null; } }
public virtual bool IsSecurityTransparent { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public bool IsStatic { get { throw null; } }
public bool IsVirtual { get { throw null; } }
public abstract System.RuntimeMethodHandle MethodHandle { get; }
public virtual System.Reflection.MethodImplAttributes MethodImplementationFlags { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Metadata for the method might be incomplete or removed")]
public static System.Reflection.MethodBase? GetCurrentMethod() { throw null; }
public virtual System.Type[] GetGenericArguments() { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming may change method bodies. For example it can change some instructions, remove branches or local variables.")]
public virtual System.Reflection.MethodBody? GetMethodBody() { throw null; }
public static System.Reflection.MethodBase? GetMethodFromHandle(System.RuntimeMethodHandle handle) { throw null; }
public static System.Reflection.MethodBase? GetMethodFromHandle(System.RuntimeMethodHandle handle, System.RuntimeTypeHandle declaringType) { throw null; }
public abstract System.Reflection.MethodImplAttributes GetMethodImplementationFlags();
public abstract System.Reflection.ParameterInfo[] GetParameters();
public object? Invoke(object? obj, object?[]? parameters) { throw null; }
public abstract object? Invoke(object? obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? parameters, System.Globalization.CultureInfo? culture);
public static bool operator ==(System.Reflection.MethodBase? left, System.Reflection.MethodBase? right) { throw null; }
public static bool operator !=(System.Reflection.MethodBase? left, System.Reflection.MethodBase? right) { throw null; }
}
public partial class MethodBody
{
protected MethodBody() { }
public virtual System.Collections.Generic.IList<System.Reflection.ExceptionHandlingClause> ExceptionHandlingClauses { get { throw null; } }
public virtual bool InitLocals { get { throw null; } }
public virtual int LocalSignatureMetadataToken { get { throw null; } }
public virtual System.Collections.Generic.IList<System.Reflection.LocalVariableInfo> LocalVariables { get { throw null; } }
public virtual int MaxStackSize { get { throw null; } }
public virtual byte[]? GetILAsByteArray() { throw null; }
}
public enum MethodImplAttributes
{
IL = 0,
Managed = 0,
Native = 1,
OPTIL = 2,
CodeTypeMask = 3,
Runtime = 3,
ManagedMask = 4,
Unmanaged = 4,
NoInlining = 8,
ForwardRef = 16,
Synchronized = 32,
NoOptimization = 64,
PreserveSig = 128,
AggressiveInlining = 256,
AggressiveOptimization = 512,
InternalCall = 4096,
MaxMethodImplVal = 65535,
}
public abstract partial class MethodInfo : System.Reflection.MethodBase
{
protected MethodInfo() { }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public virtual System.Reflection.ParameterInfo ReturnParameter { get { throw null; } }
public virtual System.Type ReturnType { get { throw null; } }
public abstract System.Reflection.ICustomAttributeProvider ReturnTypeCustomAttributes { get; }
public virtual System.Delegate CreateDelegate(System.Type delegateType) { throw null; }
public virtual System.Delegate CreateDelegate(System.Type delegateType, object? target) { throw null; }
public T CreateDelegate<T>() where T : System.Delegate { throw null; }
public T CreateDelegate<T>(object? target) where T : System.Delegate { throw null; }
public override bool Equals(object? obj) { throw null; }
public abstract System.Reflection.MethodInfo GetBaseDefinition();
public override System.Type[] GetGenericArguments() { throw null; }
public virtual System.Reflection.MethodInfo GetGenericMethodDefinition() { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("The native code for this instantiation might not be available at runtime.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
public virtual System.Reflection.MethodInfo MakeGenericMethod(params System.Type[] typeArguments) { throw null; }
public static bool operator ==(System.Reflection.MethodInfo? left, System.Reflection.MethodInfo? right) { throw null; }
public static bool operator !=(System.Reflection.MethodInfo? left, System.Reflection.MethodInfo? right) { throw null; }
}
public sealed partial class Missing : System.Runtime.Serialization.ISerializable
{
internal Missing() { }
public static readonly System.Reflection.Missing Value;
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public abstract partial class Module : System.Reflection.ICustomAttributeProvider, System.Runtime.Serialization.ISerializable
{
public static readonly System.Reflection.TypeFilter FilterTypeName;
public static readonly System.Reflection.TypeFilter FilterTypeNameIgnoreCase;
protected Module() { }
public virtual System.Reflection.Assembly Assembly { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("Returns <Unknown> for modules with no file path")]
public virtual string FullyQualifiedName { get { throw null; } }
public virtual int MDStreamVersion { get { throw null; } }
public virtual int MetadataToken { get { throw null; } }
public System.ModuleHandle ModuleHandle { get { throw null; } }
public virtual System.Guid ModuleVersionId { get { throw null; } }
[System.Diagnostics.CodeAnalysis.RequiresAssemblyFilesAttribute("Returns <Unknown> for modules with no file path")]
public virtual string Name { get { throw null; } }
public virtual string ScopeName { get { throw null; } }
public override bool Equals(object? o) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] FindTypes(System.Reflection.TypeFilter? filter, object? filterCriteria) { throw null; }
public virtual object[] GetCustomAttributes(bool inherit) { throw null; }
public virtual object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Fields might be removed")]
public System.Reflection.FieldInfo? GetField(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Fields might be removed")]
public virtual System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Fields might be removed")]
public System.Reflection.FieldInfo[] GetFields() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Fields might be removed")]
public virtual System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingFlags) { throw null; }
public override int GetHashCode() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public System.Reflection.MethodInfo? GetMethod(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public System.Reflection.MethodInfo? GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public System.Reflection.MethodInfo? GetMethod(string name, System.Type[] types) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
protected virtual System.Reflection.MethodInfo? GetMethodImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public System.Reflection.MethodInfo[] GetMethods() { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Methods might be removed")]
public virtual System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingFlags) { throw null; }
public virtual void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public virtual void GetPEKind(out System.Reflection.PortableExecutableKinds peKind, out System.Reflection.ImageFileMachine machine) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string className) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string className, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type? GetType(string className, bool throwOnError, bool ignoreCase) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Types might be removed")]
public virtual System.Type[] GetTypes() { throw null; }
public virtual bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
public virtual bool IsResource() { throw null; }
public static bool operator ==(System.Reflection.Module? left, System.Reflection.Module? right) { throw null; }
public static bool operator !=(System.Reflection.Module? left, System.Reflection.Module? right) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.Reflection.FieldInfo? ResolveField(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual System.Reflection.FieldInfo? ResolveField(int metadataToken, System.Type[]? genericTypeArguments, System.Type[]? genericMethodArguments) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.Reflection.MemberInfo? ResolveMember(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual System.Reflection.MemberInfo? ResolveMember(int metadataToken, System.Type[]? genericTypeArguments, System.Type[]? genericMethodArguments) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.Reflection.MethodBase? ResolveMethod(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual System.Reflection.MethodBase? ResolveMethod(int metadataToken, System.Type[]? genericTypeArguments, System.Type[]? genericMethodArguments) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual byte[] ResolveSignature(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual string ResolveString(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public System.Type ResolveType(int metadataToken) { throw null; }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimming changes metadata tokens")]
public virtual System.Type ResolveType(int metadataToken, System.Type[]? genericTypeArguments, System.Type[]? genericMethodArguments) { throw null; }
public override string ToString() { throw null; }
}
public delegate System.Reflection.Module ModuleResolveEventHandler(object sender, System.ResolveEventArgs e);
public sealed partial class NullabilityInfo
{
internal NullabilityInfo() { }
public System.Reflection.NullabilityInfo? ElementType { get { throw null; } }
public System.Reflection.NullabilityInfo[] GenericTypeArguments { get { throw null; } }
public System.Reflection.NullabilityState ReadState { get { throw null; } }
public System.Type Type { get { throw null; } }
public System.Reflection.NullabilityState WriteState { get { throw null; } }
}
public sealed partial class NullabilityInfoContext
{
public NullabilityInfoContext() { }
public System.Reflection.NullabilityInfo Create(System.Reflection.EventInfo eventInfo) { throw null; }
public System.Reflection.NullabilityInfo Create(System.Reflection.FieldInfo fieldInfo) { throw null; }
public System.Reflection.NullabilityInfo Create(System.Reflection.ParameterInfo parameterInfo) { throw null; }
public System.Reflection.NullabilityInfo Create(System.Reflection.PropertyInfo propertyInfo) { throw null; }
}
public enum NullabilityState
{
Unknown = 0,
NotNull = 1,
Nullable = 2,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class ObfuscateAssemblyAttribute : System.Attribute
{
public ObfuscateAssemblyAttribute(bool assemblyIsPrivate) { }
public bool AssemblyIsPrivate { get { throw null; } }
public bool StripAfterObfuscation { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed partial class ObfuscationAttribute : System.Attribute
{
public ObfuscationAttribute() { }
public bool ApplyToMembers { get { throw null; } set { } }
public bool Exclude { get { throw null; } set { } }
public string? Feature { get { throw null; } set { } }
public bool StripAfterObfuscation { get { throw null; } set { } }
}
[System.FlagsAttribute]
public enum ParameterAttributes
{
None = 0,
In = 1,
Out = 2,
Lcid = 4,
Retval = 8,
Optional = 16,
HasDefault = 4096,
HasFieldMarshal = 8192,
Reserved3 = 16384,
Reserved4 = 32768,
ReservedMask = 61440,
}
public partial class ParameterInfo : System.Reflection.ICustomAttributeProvider, System.Runtime.Serialization.IObjectReference
{
protected System.Reflection.ParameterAttributes AttrsImpl;
protected System.Type? ClassImpl;
protected object? DefaultValueImpl;
protected System.Reflection.MemberInfo MemberImpl;
protected string? NameImpl;
protected int PositionImpl;
protected ParameterInfo() { }
public virtual System.Reflection.ParameterAttributes Attributes { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.CustomAttributeData> CustomAttributes { get { throw null; } }
public virtual object? DefaultValue { get { throw null; } }
public virtual bool HasDefaultValue { get { throw null; } }
public bool IsIn { get { throw null; } }
public bool IsLcid { get { throw null; } }
public bool IsOptional { get { throw null; } }
public bool IsOut { get { throw null; } }
public bool IsRetval { get { throw null; } }
public virtual System.Reflection.MemberInfo Member { get { throw null; } }
public virtual int MetadataToken { get { throw null; } }
public virtual string? Name { get { throw null; } }
public virtual System.Type ParameterType { get { throw null; } }
public virtual int Position { get { throw null; } }
public virtual object? RawDefaultValue { get { throw null; } }
public virtual object[] GetCustomAttributes(bool inherit) { throw null; }
public virtual object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
public virtual System.Collections.Generic.IList<System.Reflection.CustomAttributeData> GetCustomAttributesData() { throw null; }
public virtual System.Type[] GetOptionalCustomModifiers() { throw null; }
public object GetRealObject(System.Runtime.Serialization.StreamingContext context) { throw null; }
public virtual System.Type[] GetRequiredCustomModifiers() { throw null; }
public virtual bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
public override string ToString() { throw null; }
}
public readonly partial struct ParameterModifier
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ParameterModifier(int parameterCount) { throw null; }
public bool this[int index] { get { throw null; } set { } }
}
[System.CLSCompliantAttribute(false)]
public sealed partial class Pointer : System.Runtime.Serialization.ISerializable
{
internal Pointer() { }
public unsafe static object Box(void* ptr, System.Type type) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public unsafe static void* Unbox(object ptr) { throw null; }
}
[System.FlagsAttribute]
public enum PortableExecutableKinds
{
NotAPortableExecutableImage = 0,
ILOnly = 1,
Required32Bit = 2,
PE32Plus = 4,
Unmanaged32Bit = 8,
Preferred32Bit = 16,
}
public enum ProcessorArchitecture
{
None = 0,
MSIL = 1,
X86 = 2,
IA64 = 3,
Amd64 = 4,
Arm = 5,
}
[System.FlagsAttribute]
public enum PropertyAttributes
{
None = 0,
SpecialName = 512,
RTSpecialName = 1024,
HasDefault = 4096,
Reserved2 = 8192,
Reserved3 = 16384,
Reserved4 = 32768,
ReservedMask = 62464,
}
public abstract partial class PropertyInfo : System.Reflection.MemberInfo
{
protected PropertyInfo() { }
public abstract System.Reflection.PropertyAttributes Attributes { get; }
public abstract bool CanRead { get; }
public abstract bool CanWrite { get; }
public virtual System.Reflection.MethodInfo? GetMethod { get { throw null; } }
public bool IsSpecialName { get { throw null; } }
public override System.Reflection.MemberTypes MemberType { get { throw null; } }
public abstract System.Type PropertyType { get; }
public virtual System.Reflection.MethodInfo? SetMethod { get { throw null; } }
public override bool Equals(object? obj) { throw null; }
public System.Reflection.MethodInfo[] GetAccessors() { throw null; }
public abstract System.Reflection.MethodInfo[] GetAccessors(bool nonPublic);
public virtual object? GetConstantValue() { throw null; }
public System.Reflection.MethodInfo? GetGetMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetGetMethod(bool nonPublic);
public override int GetHashCode() { throw null; }
public abstract System.Reflection.ParameterInfo[] GetIndexParameters();
public virtual System.Type[] GetOptionalCustomModifiers() { throw null; }
public virtual object? GetRawConstantValue() { throw null; }
public virtual System.Type[] GetRequiredCustomModifiers() { throw null; }
public System.Reflection.MethodInfo? GetSetMethod() { throw null; }
public abstract System.Reflection.MethodInfo? GetSetMethod(bool nonPublic);
public object? GetValue(object? obj) { throw null; }
public virtual object? GetValue(object? obj, object?[]? index) { throw null; }
public abstract object? GetValue(object? obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? index, System.Globalization.CultureInfo? culture);
public static bool operator ==(System.Reflection.PropertyInfo? left, System.Reflection.PropertyInfo? right) { throw null; }
public static bool operator !=(System.Reflection.PropertyInfo? left, System.Reflection.PropertyInfo? right) { throw null; }
public void SetValue(object? obj, object? value) { }
public virtual void SetValue(object? obj, object? value, object?[]? index) { }
public abstract void SetValue(object? obj, object? value, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object?[]? index, System.Globalization.CultureInfo? culture);
}
public abstract partial class ReflectionContext
{
protected ReflectionContext() { }
public virtual System.Reflection.TypeInfo GetTypeForObject(object value) { throw null; }
public abstract System.Reflection.Assembly MapAssembly(System.Reflection.Assembly assembly);
public abstract System.Reflection.TypeInfo MapType(System.Reflection.TypeInfo type);
}
public sealed partial class ReflectionTypeLoadException : System.SystemException, System.Runtime.Serialization.ISerializable
{
public ReflectionTypeLoadException(System.Type?[]? classes, System.Exception?[]? exceptions) { }
public ReflectionTypeLoadException(System.Type?[]? classes, System.Exception?[]? exceptions, string? message) { }
public System.Exception?[] LoaderExceptions { get { throw null; } }
public override string Message { get { throw null; } }
public System.Type?[] Types { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
[System.FlagsAttribute]
public enum ResourceAttributes
{
Public = 1,
Private = 2,
}
[System.FlagsAttribute]
public enum ResourceLocation
{
Embedded = 1,
ContainedInAnotherAssembly = 2,
ContainedInManifestFile = 4,
}
public static partial class RuntimeReflectionExtensions
{
public static System.Reflection.MethodInfo GetMethodInfo(this System.Delegate del) { throw null; }
public static System.Reflection.MethodInfo? GetRuntimeBaseDefinition(this System.Reflection.MethodInfo method) { throw null; }
public static System.Reflection.EventInfo? GetRuntimeEvent([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)] this System.Type type, string name) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Reflection.EventInfo> GetRuntimeEvents([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)] this System.Type type) { throw null; }
public static System.Reflection.FieldInfo? GetRuntimeField([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)] this System.Type type, string name) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo> GetRuntimeFields([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)] this System.Type type) { throw null; }
public static System.Reflection.InterfaceMapping GetRuntimeInterfaceMap(this System.Reflection.TypeInfo typeInfo, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type interfaceType) { throw null; }
public static System.Reflection.MethodInfo? GetRuntimeMethod([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] this System.Type type, string name, System.Type[] parameters) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> GetRuntimeMethods([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] this System.Type type) { throw null; }
public static System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo> GetRuntimeProperties([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] this System.Type type) { throw null; }
public static System.Reflection.PropertyInfo? GetRuntimeProperty([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] this System.Type type, string name) { throw null; }
}
[System.ObsoleteAttribute("Strong name signing is not supported and throws PlatformNotSupportedException.", DiagnosticId = "SYSLIB0017", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public partial class StrongNameKeyPair : System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
{
public StrongNameKeyPair(byte[] keyPairArray) { }
public StrongNameKeyPair(System.IO.FileStream keyPairFile) { }
protected StrongNameKeyPair(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public StrongNameKeyPair(string keyPairContainer) { }
public byte[] PublicKey { get { throw null; } }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public partial class TargetException : System.ApplicationException
{
public TargetException() { }
protected TargetException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TargetException(string? message) { }
public TargetException(string? message, System.Exception? inner) { }
}
public sealed partial class TargetInvocationException : System.ApplicationException
{
public TargetInvocationException(System.Exception? inner) { }
public TargetInvocationException(string? message, System.Exception? inner) { }
}
public sealed partial class TargetParameterCountException : System.ApplicationException
{
public TargetParameterCountException() { }
public TargetParameterCountException(string? message) { }
public TargetParameterCountException(string? message, System.Exception? inner) { }
}
[System.FlagsAttribute]
public enum TypeAttributes
{
AnsiClass = 0,
AutoLayout = 0,
Class = 0,
NotPublic = 0,
Public = 1,
NestedPublic = 2,
NestedPrivate = 3,
NestedFamily = 4,
NestedAssembly = 5,
NestedFamANDAssem = 6,
NestedFamORAssem = 7,
VisibilityMask = 7,
SequentialLayout = 8,
ExplicitLayout = 16,
LayoutMask = 24,
ClassSemanticsMask = 32,
Interface = 32,
Abstract = 128,
Sealed = 256,
SpecialName = 1024,
RTSpecialName = 2048,
Import = 4096,
Serializable = 8192,
WindowsRuntime = 16384,
UnicodeClass = 65536,
AutoClass = 131072,
CustomFormatClass = 196608,
StringFormatMask = 196608,
HasSecurity = 262144,
ReservedMask = 264192,
BeforeFieldInit = 1048576,
CustomFormatMask = 12582912,
}
public partial class TypeDelegator : System.Reflection.TypeInfo
{
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
protected System.Type typeImpl;
protected TypeDelegator() { }
public TypeDelegator([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] System.Type delegatingType) { }
public override System.Reflection.Assembly Assembly { get { throw null; } }
public override string? AssemblyQualifiedName { get { throw null; } }
public override System.Type? BaseType { get { throw null; } }
public override string? FullName { get { throw null; } }
public override System.Guid GUID { get { throw null; } }
public override bool IsByRefLike { get { throw null; } }
public override bool IsCollectible { get { throw null; } }
public override bool IsConstructedGenericType { get { throw null; } }
public override bool IsGenericMethodParameter { get { throw null; } }
public override bool IsGenericTypeParameter { get { throw null; } }
public override bool IsSZArray { get { throw null; } }
public override bool IsTypeDefinition { get { throw null; } }
public override bool IsVariableBoundArray { get { throw null; } }
public override int MetadataToken { get { throw null; } }
public override System.Reflection.Module Module { get { throw null; } }
public override string Name { get { throw null; } }
public override string? Namespace { get { throw null; } }
public override System.RuntimeTypeHandle TypeHandle { get { throw null; } }
public override System.Type UnderlyingSystemType { get { throw null; } }
protected override System.Reflection.TypeAttributes GetAttributeFlagsImpl() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
protected override System.Reflection.ConstructorInfo? GetConstructorImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[] types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public override System.Reflection.ConstructorInfo[] GetConstructors(System.Reflection.BindingFlags bindingAttr) { throw null; }
public override object[] GetCustomAttributes(bool inherit) { throw null; }
public override object[] GetCustomAttributes(System.Type attributeType, bool inherit) { throw null; }
public override System.Type? GetElementType() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo? GetEvent(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo[] GetEvents() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public override System.Reflection.EventInfo[] GetEvents(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public override System.Reflection.FieldInfo? GetField(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public override System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
[return: System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public override System.Type? GetInterface(string name, bool ignoreCase) { throw null; }
public override System.Reflection.InterfaceMapping GetInterfaceMap([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] System.Type interfaceType) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)]
public override System.Type[] GetInterfaces() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public override System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.MemberTypes type, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public override System.Reflection.MemberInfo[] GetMembers(System.Reflection.BindingFlags bindingAttr) { throw null; }
public override System.Reflection.MemberInfo GetMemberWithSameMetadataDefinitionAs(System.Reflection.MemberInfo member) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
protected override System.Reflection.MethodInfo? GetMethodImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Reflection.CallingConventions callConvention, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public override System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public override System.Type? GetNestedType(string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public override System.Type[] GetNestedTypes(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public override System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingAttr) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
protected override System.Reflection.PropertyInfo? GetPropertyImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder? binder, System.Type? returnType, System.Type[]? types, System.Reflection.ParameterModifier[]? modifiers) { throw null; }
protected override bool HasElementTypeImpl() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)]
public override object? InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder? binder, object? target, object?[]? args, System.Reflection.ParameterModifier[]? modifiers, System.Globalization.CultureInfo? culture, string[]? namedParameters) { throw null; }
protected override bool IsArrayImpl() { throw null; }
public override bool IsAssignableFrom([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Reflection.TypeInfo? typeInfo) { throw null; }
protected override bool IsByRefImpl() { throw null; }
protected override bool IsCOMObjectImpl() { throw null; }
public override bool IsDefined(System.Type attributeType, bool inherit) { throw null; }
protected override bool IsPointerImpl() { throw null; }
protected override bool IsPrimitiveImpl() { throw null; }
protected override bool IsValueTypeImpl() { throw null; }
}
public delegate bool TypeFilter(System.Type m, object? filterCriteria);
public abstract partial class TypeInfo : System.Type, System.Reflection.IReflectableType
{
protected TypeInfo() { }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.ConstructorInfo> DeclaredConstructors { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.EventInfo> DeclaredEvents { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.FieldInfo> DeclaredFields { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.MemberInfo> DeclaredMembers { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.All)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> DeclaredMethods { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo> DeclaredNestedTypes { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)] get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Reflection.PropertyInfo> DeclaredProperties { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)] get { throw null; } }
public virtual System.Type[] GenericTypeParameters { get { throw null; } }
public virtual System.Collections.Generic.IEnumerable<System.Type> ImplementedInterfaces { [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.Interfaces)] get { throw null; } }
public virtual System.Type AsType() { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicEvents | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicEvents)]
public virtual System.Reflection.EventInfo? GetDeclaredEvent(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicFields | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicFields)]
public virtual System.Reflection.FieldInfo? GetDeclaredField(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public virtual System.Reflection.MethodInfo? GetDeclaredMethod(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicMethods | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicMethods)]
public virtual System.Collections.Generic.IEnumerable<System.Reflection.MethodInfo> GetDeclaredMethods(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicNestedTypes | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicNestedTypes)]
public virtual System.Reflection.TypeInfo? GetDeclaredNestedType(string name) { throw null; }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicProperties | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicProperties)]
public virtual System.Reflection.PropertyInfo? GetDeclaredProperty(string name) { throw null; }
public virtual bool IsAssignableFrom([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Reflection.TypeInfo? typeInfo) { throw null; }
System.Reflection.TypeInfo System.Reflection.IReflectableType.GetTypeInfo() { throw null; }
}
}
namespace System.Resources
{
public partial interface IResourceReader : System.Collections.IEnumerable, System.IDisposable
{
void Close();
new System.Collections.IDictionaryEnumerator GetEnumerator();
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public partial class MissingManifestResourceException : System.SystemException
{
public MissingManifestResourceException() { }
protected MissingManifestResourceException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingManifestResourceException(string? message) { }
public MissingManifestResourceException(string? message, System.Exception? inner) { }
}
public partial class MissingSatelliteAssemblyException : System.SystemException
{
public MissingSatelliteAssemblyException() { }
protected MissingSatelliteAssemblyException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public MissingSatelliteAssemblyException(string? message) { }
public MissingSatelliteAssemblyException(string? message, System.Exception? inner) { }
public MissingSatelliteAssemblyException(string? message, string? cultureName) { }
public string? CultureName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class NeutralResourcesLanguageAttribute : System.Attribute
{
public NeutralResourcesLanguageAttribute(string cultureName) { }
public NeutralResourcesLanguageAttribute(string cultureName, System.Resources.UltimateResourceFallbackLocation location) { }
public string CultureName { get { throw null; } }
public System.Resources.UltimateResourceFallbackLocation Location { get { throw null; } }
}
public partial class ResourceManager
{
public static readonly int HeaderVersionNumber;
public static readonly int MagicNumber;
protected System.Reflection.Assembly? MainAssembly;
protected ResourceManager() { }
public ResourceManager(string baseName, System.Reflection.Assembly assembly) { }
public ResourceManager(string baseName, System.Reflection.Assembly assembly, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type? usingResourceSet) { }
public ResourceManager(System.Type resourceSource) { }
public virtual string BaseName { get { throw null; } }
protected System.Resources.UltimateResourceFallbackLocation FallbackLocation { get { throw null; } set { } }
public virtual bool IgnoreCase { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)]
public virtual System.Type ResourceSetType { get { throw null; } }
public static System.Resources.ResourceManager CreateFileBasedResourceManager(string baseName, string resourceDir, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type? usingResourceSet) { throw null; }
protected static System.Globalization.CultureInfo GetNeutralResourcesLanguage(System.Reflection.Assembly a) { throw null; }
public virtual object? GetObject(string name) { throw null; }
public virtual object? GetObject(string name, System.Globalization.CultureInfo? culture) { throw null; }
protected virtual string GetResourceFileName(System.Globalization.CultureInfo culture) { throw null; }
public virtual System.Resources.ResourceSet? GetResourceSet(System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) { throw null; }
protected static System.Version? GetSatelliteContractVersion(System.Reflection.Assembly a) { throw null; }
public System.IO.UnmanagedMemoryStream? GetStream(string name) { throw null; }
public System.IO.UnmanagedMemoryStream? GetStream(string name, System.Globalization.CultureInfo? culture) { throw null; }
public virtual string? GetString(string name) { throw null; }
public virtual string? GetString(string name, System.Globalization.CultureInfo? culture) { throw null; }
protected virtual System.Resources.ResourceSet? InternalGetResourceSet(System.Globalization.CultureInfo culture, bool createIfNotExists, bool tryParents) { throw null; }
public virtual void ReleaseAllResources() { }
}
public sealed partial class ResourceReader : System.Collections.IEnumerable, System.IDisposable, System.Resources.IResourceReader
{
public ResourceReader(System.IO.Stream stream) { }
public ResourceReader(string fileName) { }
public void Close() { }
public void Dispose() { }
public System.Collections.IDictionaryEnumerator GetEnumerator() { throw null; }
public void GetResourceData(string resourceName, out string resourceType, out byte[] resourceData) { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
public partial class ResourceSet : System.Collections.IEnumerable, System.IDisposable
{
protected ResourceSet() { }
public ResourceSet(System.IO.Stream stream) { }
public ResourceSet(System.Resources.IResourceReader reader) { }
public ResourceSet(string fileName) { }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public virtual System.Type GetDefaultReader() { throw null; }
public virtual System.Type GetDefaultWriter() { throw null; }
public virtual System.Collections.IDictionaryEnumerator GetEnumerator() { throw null; }
public virtual object? GetObject(string name) { throw null; }
public virtual object? GetObject(string name, bool ignoreCase) { throw null; }
public virtual string? GetString(string name) { throw null; }
public virtual string? GetString(string name, bool ignoreCase) { throw null; }
protected virtual void ReadResources() { }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class SatelliteContractVersionAttribute : System.Attribute
{
public SatelliteContractVersionAttribute(string version) { }
public string Version { get { throw null; } }
}
public enum UltimateResourceFallbackLocation
{
MainAssembly = 0,
Satellite = 1,
}
}
namespace System.Runtime
{
public sealed partial class AmbiguousImplementationException : System.Exception
{
public AmbiguousImplementationException() { }
public AmbiguousImplementationException(string? message) { }
public AmbiguousImplementationException(string? message, System.Exception? innerException) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class AssemblyTargetedPatchBandAttribute : System.Attribute
{
public AssemblyTargetedPatchBandAttribute(string targetedPatchBand) { }
public string TargetedPatchBand { get { throw null; } }
}
public partial struct DependentHandle : System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
public DependentHandle(object? target, object? dependent) { throw null; }
public object? Dependent { get { throw null; } set { } }
public bool IsAllocated { get { throw null; } }
public object? Target { get { throw null; } set { } }
public (object? Target, object? Dependent) TargetAndDependent { get { throw null; } }
public void Dispose() { }
}
public enum GCLargeObjectHeapCompactionMode
{
Default = 1,
CompactOnce = 2,
}
public enum GCLatencyMode
{
Batch = 0,
Interactive = 1,
LowLatency = 2,
SustainedLowLatency = 3,
NoGCRegion = 4,
}
public static partial class GCSettings
{
public static bool IsServerGC { get { throw null; } }
public static System.Runtime.GCLargeObjectHeapCompactionMode LargeObjectHeapCompactionMode { get { throw null; } set { } }
public static System.Runtime.GCLatencyMode LatencyMode { get { throw null; } set { } }
}
public static partial class JitInfo
{
public static System.TimeSpan GetCompilationTime(bool currentThread = false) { throw null; }
public static long GetCompiledILBytes(bool currentThread = false) { throw null; }
public static long GetCompiledMethodCount(bool currentThread = false) { throw null; }
}
public sealed partial class MemoryFailPoint : System.Runtime.ConstrainedExecution.CriticalFinalizerObject, System.IDisposable
{
public MemoryFailPoint(int sizeInMegabytes) { }
public void Dispose() { }
~MemoryFailPoint() { }
}
public static partial class ProfileOptimization
{
public static void SetProfileRoot(string directoryPath) { }
public static void StartProfile(string? profile) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed partial class TargetedPatchingOptOutAttribute : System.Attribute
{
public TargetedPatchingOptOutAttribute(string reason) { }
public string Reason { get { throw null; } }
}
}
namespace System.Runtime.CompilerServices
{
[System.AttributeUsageAttribute(System.AttributeTargets.Field)]
public sealed partial class AccessedThroughPropertyAttribute : System.Attribute
{
public AccessedThroughPropertyAttribute(string propertyName) { }
public string PropertyName { get { throw null; } }
}
public partial struct AsyncIteratorMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void Complete() { }
public static System.Runtime.CompilerServices.AsyncIteratorMethodBuilder Create() { throw null; }
public void MoveNext<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
public sealed partial class AsyncIteratorStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute
{
public AsyncIteratorStateMachineAttribute(System.Type stateMachineType) : base (default(System.Type)) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]
public sealed partial class AsyncMethodBuilderAttribute : System.Attribute
{
public AsyncMethodBuilderAttribute(System.Type builderType) { }
public System.Type BuilderType { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
public sealed partial class AsyncStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute
{
public AsyncStateMachineAttribute(System.Type stateMachineType) : base (default(System.Type)) { }
}
public partial struct AsyncTaskMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.Task Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncTaskMethodBuilder Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct AsyncTaskMethodBuilder<TResult>
{
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.Task<TResult> Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncTaskMethodBuilder<TResult> Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult(TResult result) { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct AsyncValueTaskMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.ValueTask Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct AsyncValueTaskMethodBuilder<TResult>
{
private TResult _result;
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.ValueTask<TResult> Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder<TResult> Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult(TResult result) { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct AsyncVoidMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.AsyncVoidMethodBuilder Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial class CallConvCdecl
{
public CallConvCdecl() { }
}
public partial class CallConvFastcall
{
public CallConvFastcall() { }
}
public partial class CallConvMemberFunction
{
public CallConvMemberFunction() { }
}
public partial class CallConvStdcall
{
public CallConvStdcall() { }
}
public partial class CallConvSuppressGCTransition
{
public CallConvSuppressGCTransition() { }
}
public partial class CallConvThiscall
{
public CallConvThiscall() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)]
public sealed partial class CallerArgumentExpressionAttribute : System.Attribute
{
public CallerArgumentExpressionAttribute(string parameterName) { }
public string ParameterName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class CallerFilePathAttribute : System.Attribute
{
public CallerFilePathAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class CallerLineNumberAttribute : System.Attribute
{
public CallerLineNumberAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class CallerMemberNameAttribute : System.Attribute
{
public CallerMemberNameAttribute() { }
}
[System.FlagsAttribute]
public enum CompilationRelaxations
{
NoStringInterning = 8,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method | System.AttributeTargets.Module)]
public partial class CompilationRelaxationsAttribute : System.Attribute
{
public CompilationRelaxationsAttribute(int relaxations) { }
public CompilationRelaxationsAttribute(System.Runtime.CompilerServices.CompilationRelaxations relaxations) { }
public int CompilationRelaxations { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=true)]
public sealed partial class CompilerGeneratedAttribute : System.Attribute
{
public CompilerGeneratedAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class)]
public partial class CompilerGlobalScopeAttribute : System.Attribute
{
public CompilerGlobalScopeAttribute() { }
}
public sealed partial class ConditionalWeakTable<TKey, [System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]TValue> : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>, System.Collections.IEnumerable where TKey : class where TValue : class?
{
public ConditionalWeakTable() { }
public void Add(TKey key, TValue value) { }
public void AddOrUpdate(TKey key, TValue value) { }
public void Clear() { }
public TValue GetOrCreateValue(TKey key) { throw null; }
public TValue GetValue(TKey key, System.Runtime.CompilerServices.ConditionalWeakTable<TKey, TValue>.CreateValueCallback createValueCallback) { throw null; }
public bool Remove(TKey key) { throw null; }
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>> System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
public bool TryGetValue(TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; }
public delegate TValue CreateValueCallback(TKey key);
}
public readonly partial struct ConfiguredAsyncDisposable
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable DisposeAsync() { throw null; }
}
public readonly partial struct ConfiguredCancelableAsyncEnumerable<T>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T>.Enumerator GetAsyncEnumerator() { throw null; }
public System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation(System.Threading.CancellationToken cancellationToken) { throw null; }
public readonly partial struct Enumerator
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public T Current { get { throw null; } }
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable DisposeAsync() { throw null; }
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<bool> MoveNextAsync() { throw null; }
}
}
public readonly partial struct ConfiguredTaskAwaitable
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredTaskAwaitable.ConfiguredTaskAwaiter GetAwaiter() { throw null; }
public readonly partial struct ConfiguredTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
public readonly partial struct ConfiguredTaskAwaitable<TResult>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult>.ConfiguredTaskAwaiter GetAwaiter() { throw null; }
public readonly partial struct ConfiguredTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public TResult GetResult() { throw null; }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
public readonly partial struct ConfiguredValueTaskAwaitable
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable.ConfiguredValueTaskAwaiter GetAwaiter() { throw null; }
public readonly partial struct ConfiguredValueTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
public readonly partial struct ConfiguredValueTaskAwaitable<TResult>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult>.ConfiguredValueTaskAwaiter GetAwaiter() { throw null; }
public readonly partial struct ConfiguredValueTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public TResult GetResult() { throw null; }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)]
public abstract partial class CustomConstantAttribute : System.Attribute
{
protected CustomConstantAttribute() { }
public abstract object? Value { get; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class DateTimeConstantAttribute : System.Runtime.CompilerServices.CustomConstantAttribute
{
public DateTimeConstantAttribute(long ticks) { }
public override object Value { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class DecimalConstantAttribute : System.Attribute
{
public DecimalConstantAttribute(byte scale, byte sign, int hi, int mid, int low) { }
[System.CLSCompliantAttribute(false)]
public DecimalConstantAttribute(byte scale, byte sign, uint hi, uint mid, uint low) { }
public decimal Value { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly)]
public sealed partial class DefaultDependencyAttribute : System.Attribute
{
public DefaultDependencyAttribute(System.Runtime.CompilerServices.LoadHint loadHintArgument) { }
public System.Runtime.CompilerServices.LoadHint LoadHint { get { throw null; } }
}
[System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute]
public ref partial struct DefaultInterpolatedStringHandler
{
private object _dummy;
private int _dummyPrimitive;
public DefaultInterpolatedStringHandler(int literalLength, int formattedCount) { throw null; }
public DefaultInterpolatedStringHandler(int literalLength, int formattedCount, System.IFormatProvider? provider) { throw null; }
public DefaultInterpolatedStringHandler(int literalLength, int formattedCount, System.IFormatProvider? provider, System.Span<char> initialBuffer) { throw null; }
public void AppendFormatted(object? value, int alignment = 0, string? format = null) { }
public void AppendFormatted(System.ReadOnlySpan<char> value) { }
public void AppendFormatted(System.ReadOnlySpan<char> value, int alignment = 0, string? format = null) { }
public void AppendFormatted(string? value) { }
public void AppendFormatted(string? value, int alignment = 0, string? format = null) { }
public void AppendFormatted<T>(T value) { }
public void AppendFormatted<T>(T value, int alignment) { }
public void AppendFormatted<T>(T value, int alignment, string? format) { }
public void AppendFormatted<T>(T value, string? format) { }
public void AppendLiteral(string value) { }
public override string ToString() { throw null; }
public string ToStringAndClear() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true)]
public sealed partial class DependencyAttribute : System.Attribute
{
public DependencyAttribute(string dependentAssemblyArgument, System.Runtime.CompilerServices.LoadHint loadHintArgument) { }
public string DependentAssembly { get { throw null; } }
public System.Runtime.CompilerServices.LoadHint LoadHint { get { throw null; } }
}
[System.ObsoleteAttribute("DisablePrivateReflectionAttribute has no effect in .NET 6.0+.", DiagnosticId = "SYSLIB0015", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class DisablePrivateReflectionAttribute : System.Attribute
{
public DisablePrivateReflectionAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)]
public sealed class DisableRuntimeMarshallingAttribute : Attribute
{
public DisableRuntimeMarshallingAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.All)]
public partial class DiscardableAttribute : System.Attribute
{
public DiscardableAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class EnumeratorCancellationAttribute : System.Attribute
{
public EnumeratorCancellationAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Method)]
public sealed partial class ExtensionAttribute : System.Attribute
{
public ExtensionAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field)]
public sealed partial class FixedAddressValueTypeAttribute : System.Attribute
{
public FixedAddressValueTypeAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public sealed partial class FixedBufferAttribute : System.Attribute
{
public FixedBufferAttribute(System.Type elementType, int length) { }
public System.Type ElementType { get { throw null; } }
public int Length { get { throw null; } }
}
public static partial class FormattableStringFactory
{
public static System.FormattableString Create(string format, params object?[] arguments) { throw null; }
}
public partial interface IAsyncStateMachine
{
void MoveNext();
void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine);
}
public partial interface ICriticalNotifyCompletion : System.Runtime.CompilerServices.INotifyCompletion
{
void UnsafeOnCompleted(System.Action continuation);
}
[System.AttributeUsageAttribute(System.AttributeTargets.Property, Inherited=true)]
public sealed partial class IndexerNameAttribute : System.Attribute
{
public IndexerNameAttribute(string indexerName) { }
}
public partial interface INotifyCompletion
{
void OnCompleted(System.Action continuation);
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed partial class InternalsVisibleToAttribute : System.Attribute
{
public InternalsVisibleToAttribute(string assemblyName) { }
public bool AllInternalsVisible { get { throw null; } set { } }
public string AssemblyName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, AllowMultiple=false, Inherited=false)]
public sealed partial class InterpolatedStringHandlerArgumentAttribute : System.Attribute
{
public InterpolatedStringHandlerArgumentAttribute(string argument) { }
public InterpolatedStringHandlerArgumentAttribute(params string[] arguments) { }
public string[] Arguments { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed partial class InterpolatedStringHandlerAttribute : System.Attribute
{
public InterpolatedStringHandlerAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Struct)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class IsByRefLikeAttribute : System.Attribute
{
public IsByRefLikeAttribute() { }
}
public static partial class IsConst
{
}
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static partial class IsExternalInit
{
}
[System.AttributeUsageAttribute(System.AttributeTargets.All, Inherited=false)]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed partial class IsReadOnlyAttribute : System.Attribute
{
public IsReadOnlyAttribute() { }
}
public partial interface IStrongBox
{
object? Value { get; set; }
}
public static partial class IsVolatile
{
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
public sealed partial class IteratorStateMachineAttribute : System.Runtime.CompilerServices.StateMachineAttribute
{
public IteratorStateMachineAttribute(System.Type stateMachineType) : base (default(System.Type)) { }
}
public partial interface ITuple
{
object? this[int index] { get; }
int Length { get; }
}
public enum LoadHint
{
Default = 0,
Always = 1,
Sometimes = 2,
}
public enum MethodCodeType
{
IL = 0,
Native = 1,
OPTIL = 2,
Runtime = 3,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class MethodImplAttribute : System.Attribute
{
public System.Runtime.CompilerServices.MethodCodeType MethodCodeType;
public MethodImplAttribute() { }
public MethodImplAttribute(short value) { }
public MethodImplAttribute(System.Runtime.CompilerServices.MethodImplOptions methodImplOptions) { }
public System.Runtime.CompilerServices.MethodImplOptions Value { get { throw null; } }
}
[System.FlagsAttribute]
public enum MethodImplOptions
{
Unmanaged = 4,
NoInlining = 8,
ForwardRef = 16,
Synchronized = 32,
NoOptimization = 64,
PreserveSig = 128,
AggressiveInlining = 256,
AggressiveOptimization = 512,
InternalCall = 4096,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class ModuleInitializerAttribute : System.Attribute
{
public ModuleInitializerAttribute() { }
}
public partial struct PoolingAsyncValueTaskMethodBuilder
{
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.ValueTask Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
public partial struct PoolingAsyncValueTaskMethodBuilder<TResult>
{
private TResult _result;
private object _dummy;
private int _dummyPrimitive;
public System.Threading.Tasks.ValueTask<TResult> Task { get { throw null; } }
public void AwaitOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.INotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public void AwaitUnsafeOnCompleted<TAwaiter, TStateMachine>(ref TAwaiter awaiter, ref TStateMachine stateMachine) where TAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
public static System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder<TResult> Create() { throw null; }
public void SetException(System.Exception exception) { }
public void SetResult(TResult result) { }
public void SetStateMachine(System.Runtime.CompilerServices.IAsyncStateMachine stateMachine) { }
public void Start<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : System.Runtime.CompilerServices.IAsyncStateMachine { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
public sealed partial class PreserveBaseOverridesAttribute : System.Attribute
{
public PreserveBaseOverridesAttribute() { }
}
[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Struct | System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
public sealed class RequiredMemberAttribute : System.Attribute
{
public RequiredMemberAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
public sealed partial class ReferenceAssemblyAttribute : System.Attribute
{
public ReferenceAssemblyAttribute() { }
public ReferenceAssemblyAttribute(string? description) { }
public string? Description { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false, AllowMultiple=false)]
public sealed partial class RuntimeCompatibilityAttribute : System.Attribute
{
public RuntimeCompatibilityAttribute() { }
public bool WrapNonExceptionThrows { get { throw null; } set { } }
}
public static partial class RuntimeFeature
{
public const string ByRefFields = "ByRefFields";
public const string CovariantReturnsOfClasses = "CovariantReturnsOfClasses";
public const string DefaultImplementationsOfInterfaces = "DefaultImplementationsOfInterfaces";
public const string PortablePdb = "PortablePdb";
public const string UnmanagedSignatureCallingConvention = "UnmanagedSignatureCallingConvention";
[System.Runtime.Versioning.RequiresPreviewFeaturesAttribute("Generic Math is in preview.", Url = "https://aka.ms/dotnet-warnings/generic-math-preview")]
public const string VirtualStaticsInInterfaces = "VirtualStaticsInInterfaces";
public static bool IsDynamicCodeCompiled { get { throw null; } }
public static bool IsDynamicCodeSupported { get { throw null; } }
public static bool IsSupported(string feature) { throw null; }
}
public static partial class RuntimeHelpers
{
[System.ObsoleteAttribute("OffsetToStringData has been deprecated. Use string.GetPinnableReference() instead.")]
public static int OffsetToStringData { get { throw null; } }
public static System.IntPtr AllocateTypeAssociatedMemory(System.Type type, int size) { throw null; }
public static System.ReadOnlySpan<T> CreateSpan<T>(System.RuntimeFieldHandle fldHandle) { throw null; }
public static void EnsureSufficientExecutionStack() { }
public static new bool Equals(object? o1, object? o2) { throw null; }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void ExecuteCodeWithGuaranteedCleanup(System.Runtime.CompilerServices.RuntimeHelpers.TryCode code, System.Runtime.CompilerServices.RuntimeHelpers.CleanupCode backoutCode, object? userData) { }
public static int GetHashCode(object? o) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("obj")]
public static object? GetObjectValue(object? obj) { throw null; }
public static T[] GetSubArray<T>(T[] array, System.Range range) { throw null; }
public static object GetUninitializedObject([System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute(System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.NonPublicConstructors | System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes.PublicConstructors)] System.Type type) { throw null; }
public static void InitializeArray(System.Array array, System.RuntimeFieldHandle fldHandle) { }
public static bool IsReferenceOrContainsReferences<T>() { throw null; }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void PrepareConstrainedRegions() { }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void PrepareConstrainedRegionsNoOP() { }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void PrepareContractedDelegate(System.Delegate d) { }
public static void PrepareDelegate(System.Delegate d) { }
public static void PrepareMethod(System.RuntimeMethodHandle method) { }
public static void PrepareMethod(System.RuntimeMethodHandle method, System.RuntimeTypeHandle[]? instantiation) { }
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static void ProbeForSufficientStack() { }
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCodeAttribute("Trimmer can't guarantee existence of class constructor")]
public static void RunClassConstructor(System.RuntimeTypeHandle type) { }
public static void RunModuleConstructor(System.ModuleHandle module) { }
public static bool TryEnsureSufficientExecutionStack() { throw null; }
public delegate void CleanupCode(object? userData, bool exceptionThrown);
public delegate void TryCode(object? userData);
}
public sealed partial class RuntimeWrappedException : System.Exception
{
public RuntimeWrappedException(object thrownObject) { }
public object WrappedException { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class SkipLocalsInitAttribute : System.Attribute
{
public SkipLocalsInitAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct)]
public sealed partial class SpecialNameAttribute : System.Attribute
{
public SpecialNameAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
public partial class StateMachineAttribute : System.Attribute
{
public StateMachineAttribute(System.Type stateMachineType) { }
public System.Type StateMachineType { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, Inherited=false)]
public sealed partial class StringFreezingAttribute : System.Attribute
{
public StringFreezingAttribute() { }
}
public partial class StrongBox<T> : System.Runtime.CompilerServices.IStrongBox
{
[System.Diagnostics.CodeAnalysis.MaybeNullAttribute]
public T Value;
public StrongBox() { }
public StrongBox(T value) { }
object? System.Runtime.CompilerServices.IStrongBox.Value { get { throw null; } set { } }
}
[System.ObsoleteAttribute("SuppressIldasmAttribute has no effect in .NET 6.0+.", DiagnosticId = "SYSLIB0025", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Module)]
public sealed partial class SuppressIldasmAttribute : System.Attribute
{
public SuppressIldasmAttribute() { }
}
public sealed partial class SwitchExpressionException : System.InvalidOperationException
{
public SwitchExpressionException() { }
public SwitchExpressionException(System.Exception? innerException) { }
public SwitchExpressionException(object? unmatchedValue) { }
public SwitchExpressionException(string? message) { }
public SwitchExpressionException(string? message, System.Exception? innerException) { }
public override string Message { get { throw null; } }
public object? UnmatchedValue { get { throw null; } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
}
public readonly partial struct TaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
public readonly partial struct TaskAwaiter<TResult> : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public TResult GetResult() { throw null; }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.Property | System.AttributeTargets.ReturnValue | System.AttributeTargets.Struct)]
[System.CLSCompliantAttribute(false)]
public sealed partial class TupleElementNamesAttribute : System.Attribute
{
public TupleElementNamesAttribute(string?[] transformNames) { }
public System.Collections.Generic.IList<string?> TransformNames { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Interface | System.AttributeTargets.Struct, Inherited=false, AllowMultiple=false)]
public sealed partial class TypeForwardedFromAttribute : System.Attribute
{
public TypeForwardedFromAttribute(string assemblyFullName) { }
public string AssemblyFullName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=true, Inherited=false)]
public sealed partial class TypeForwardedToAttribute : System.Attribute
{
public TypeForwardedToAttribute(System.Type destination) { }
public System.Type Destination { get { throw null; } }
}
public static partial class Unsafe
{
public static ref T AddByteOffset<T>(ref T source, System.IntPtr byteOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ref T AddByteOffset<T>(ref T source, nuint byteOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void* Add<T>(void* source, int elementOffset) { throw null; }
public static ref T Add<T>(ref T source, int elementOffset) { throw null; }
public static ref T Add<T>(ref T source, System.IntPtr elementOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ref T Add<T>(ref T source, nuint elementOffset) { throw null; }
public static bool AreSame<T>([System.Diagnostics.CodeAnalysis.AllowNull] ref T left, [System.Diagnostics.CodeAnalysis.AllowNull] ref T right) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void* AsPointer<T>(ref T value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static ref T AsRef<T>(void* source) { throw null; }
public static ref T AsRef<T>(in T source) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNull("o")]
public static T? As<T>(object? o) where T : class? { throw null; }
public static ref TTo As<TFrom, TTo>(ref TFrom source) { throw null; }
public static System.IntPtr ByteOffset<T>([System.Diagnostics.CodeAnalysis.AllowNull] ref T origin, [System.Diagnostics.CodeAnalysis.AllowNull] ref T target) { throw null; }
[System.CLSCompliantAttribute(false)]
public static void CopyBlock(ref byte destination, ref byte source, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void CopyBlock(void* destination, void* source, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public static void CopyBlockUnaligned(ref byte destination, ref byte source, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void CopyBlockUnaligned(void* destination, void* source, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void Copy<T>(void* destination, ref T source) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void Copy<T>(ref T destination, void* source) { }
[System.CLSCompliantAttribute(false)]
public static void InitBlock(ref byte startAddress, byte value, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void InitBlock(void* startAddress, byte value, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public static void InitBlockUnaligned(ref byte startAddress, byte value, uint byteCount) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount) { }
public static bool IsAddressGreaterThan<T>([System.Diagnostics.CodeAnalysis.AllowNull] ref T left, [System.Diagnostics.CodeAnalysis.AllowNull] ref T right) { throw null; }
public static bool IsAddressLessThan<T>([System.Diagnostics.CodeAnalysis.AllowNull] ref T left, [System.Diagnostics.CodeAnalysis.AllowNull] ref T right) { throw null; }
public static bool IsNullRef<T>(ref T source) { throw null; }
public static ref T NullRef<T>() { throw null; }
public static T ReadUnaligned<T>(ref byte source) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static T ReadUnaligned<T>(void* source) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static T Read<T>(void* source) { throw null; }
public static void SkipInit<T>(out T value) { throw null; }
public static int SizeOf<T>() { throw null; }
public static ref T SubtractByteOffset<T>(ref T source, System.IntPtr byteOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ref T SubtractByteOffset<T>(ref T source, nuint byteOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe static void* Subtract<T>(void* source, int elementOffset) { throw null; }
public static ref T Subtract<T>(ref T source, int elementOffset) { throw null; }
public static ref T Subtract<T>(ref T source, System.IntPtr elementOffset) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ref T Subtract<T>(ref T source, nuint elementOffset) { throw null; }
public static ref T Unbox<T>(object box) where T : struct { throw null; }
public static void WriteUnaligned<T>(ref byte destination, T value) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void WriteUnaligned<T>(void* destination, T value) { }
[System.CLSCompliantAttribute(false)]
public unsafe static void Write<T>(void* destination, T value) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Struct)]
public sealed partial class UnsafeValueTypeAttribute : System.Attribute
{
public UnsafeValueTypeAttribute() { }
}
public readonly partial struct ValueTaskAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
public readonly partial struct ValueTaskAwaiter<TResult> : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public bool IsCompleted { get { throw null; } }
public TResult GetResult() { throw null; }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
public readonly partial struct YieldAwaitable
{
public System.Runtime.CompilerServices.YieldAwaitable.YieldAwaiter GetAwaiter() { throw null; }
public readonly partial struct YieldAwaiter : System.Runtime.CompilerServices.ICriticalNotifyCompletion, System.Runtime.CompilerServices.INotifyCompletion
{
public bool IsCompleted { get { throw null; } }
public void GetResult() { }
public void OnCompleted(System.Action continuation) { }
public void UnsafeOnCompleted(System.Action continuation) { }
}
}
}
namespace System.Runtime.ConstrainedExecution
{
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public enum Cer
{
None = 0,
MayFail = 1,
Success = 2,
}
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public enum Consistency
{
MayCorruptProcess = 0,
MayCorruptAppDomain = 1,
MayCorruptInstance = 2,
WillNotCorruptState = 3,
}
public abstract partial class CriticalFinalizerObject
{
protected CriticalFinalizerObject() { }
~CriticalFinalizerObject() { }
}
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method, Inherited=false)]
public sealed partial class PrePrepareMethodAttribute : System.Attribute
{
public PrePrepareMethodAttribute() { }
}
[System.ObsoleteAttribute("The Constrained Execution Region (CER) feature is not supported.", DiagnosticId = "SYSLIB0004", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class ReliabilityContractAttribute : System.Attribute
{
public ReliabilityContractAttribute(System.Runtime.ConstrainedExecution.Consistency consistencyGuarantee, System.Runtime.ConstrainedExecution.Cer cer) { }
public System.Runtime.ConstrainedExecution.Cer Cer { get { throw null; } }
public System.Runtime.ConstrainedExecution.Consistency ConsistencyGuarantee { get { throw null; } }
}
}
namespace System.Runtime.ExceptionServices
{
public sealed partial class ExceptionDispatchInfo
{
internal ExceptionDispatchInfo() { }
public System.Exception SourceException { get { throw null; } }
public static System.Runtime.ExceptionServices.ExceptionDispatchInfo Capture(System.Exception source) { throw null; }
public static System.Exception SetCurrentStackTrace(System.Exception source) { throw null; }
public static System.Exception SetRemoteStackTrace(System.Exception source, string stackTrace) { throw null; }
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public void Throw() => throw null;
[System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute]
public static void Throw(System.Exception source) => throw null;
}
public partial class FirstChanceExceptionEventArgs : System.EventArgs
{
public FirstChanceExceptionEventArgs(System.Exception exception) { }
public System.Exception Exception { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, AllowMultiple=false, Inherited=false)]
[System.ObsoleteAttribute("Recovery from corrupted process state exceptions is not supported; HandleProcessCorruptedStateExceptionsAttribute is ignored.", DiagnosticId = "SYSLIB0032", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public sealed partial class HandleProcessCorruptedStateExceptionsAttribute : System.Attribute
{
public HandleProcessCorruptedStateExceptionsAttribute() { }
}
}
namespace System.Runtime.InteropServices
{
public enum Architecture
{
X86 = 0,
X64 = 1,
Arm = 2,
Arm64 = 3,
Wasm = 4,
S390x = 5,
LoongArch64 = 6,
Armv6 = 7,
}
public enum CharSet
{
None = 1,
Ansi = 2,
Unicode = 3,
Auto = 4,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class ComVisibleAttribute : System.Attribute
{
public ComVisibleAttribute(bool visibility) { }
public bool Value { get { throw null; } }
}
public abstract partial class CriticalHandle : System.Runtime.ConstrainedExecution.CriticalFinalizerObject, System.IDisposable
{
protected System.IntPtr handle;
protected CriticalHandle(System.IntPtr invalidHandleValue) { }
public bool IsClosed { get { throw null; } }
public abstract bool IsInvalid { get; }
public void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~CriticalHandle() { }
protected abstract bool ReleaseHandle();
protected void SetHandle(System.IntPtr handle) { }
public void SetHandleAsInvalid() { }
}
public partial class ExternalException : System.SystemException
{
public ExternalException() { }
protected ExternalException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public ExternalException(string? message) { }
public ExternalException(string? message, System.Exception? inner) { }
public ExternalException(string? message, int errorCode) { }
public virtual int ErrorCode { get { throw null; } }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public sealed partial class FieldOffsetAttribute : System.Attribute
{
public FieldOffsetAttribute(int offset) { }
public int Value { get { throw null; } }
}
public partial struct GCHandle : System.IEquatable<System.Runtime.InteropServices.GCHandle>
{
private int _dummyPrimitive;
public bool IsAllocated { get { throw null; } }
public object? Target { get { throw null; } set { } }
public System.IntPtr AddrOfPinnedObject() { throw null; }
public static System.Runtime.InteropServices.GCHandle Alloc(object? value) { throw null; }
public static System.Runtime.InteropServices.GCHandle Alloc(object? value, System.Runtime.InteropServices.GCHandleType type) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? o) { throw null; }
public bool Equals(System.Runtime.InteropServices.GCHandle other) { throw null; }
public void Free() { }
public static System.Runtime.InteropServices.GCHandle FromIntPtr(System.IntPtr value) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Runtime.InteropServices.GCHandle a, System.Runtime.InteropServices.GCHandle b) { throw null; }
public static explicit operator System.Runtime.InteropServices.GCHandle (System.IntPtr value) { throw null; }
public static explicit operator System.IntPtr (System.Runtime.InteropServices.GCHandle value) { throw null; }
public static bool operator !=(System.Runtime.InteropServices.GCHandle a, System.Runtime.InteropServices.GCHandle b) { throw null; }
public static System.IntPtr ToIntPtr(System.Runtime.InteropServices.GCHandle value) { throw null; }
}
public enum GCHandleType
{
Weak = 0,
WeakTrackResurrection = 1,
Normal = 2,
Pinned = 3,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class InAttribute : System.Attribute
{
public InAttribute() { }
}
public enum LayoutKind
{
Sequential = 0,
Explicit = 2,
Auto = 3,
}
public readonly partial struct OSPlatform : System.IEquatable<System.Runtime.InteropServices.OSPlatform>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public static System.Runtime.InteropServices.OSPlatform FreeBSD { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Linux { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform OSX { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Windows { get { throw null; } }
public static System.Runtime.InteropServices.OSPlatform Create(string osPlatform) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Runtime.InteropServices.OSPlatform other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Runtime.InteropServices.OSPlatform left, System.Runtime.InteropServices.OSPlatform right) { throw null; }
public static bool operator !=(System.Runtime.InteropServices.OSPlatform left, System.Runtime.InteropServices.OSPlatform right) { throw null; }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Parameter, Inherited=false)]
public sealed partial class OutAttribute : System.Attribute
{
public OutAttribute() { }
}
public static partial class RuntimeInformation
{
public static string FrameworkDescription { get { throw null; } }
public static System.Runtime.InteropServices.Architecture OSArchitecture { get { throw null; } }
public static string OSDescription { get { throw null; } }
public static System.Runtime.InteropServices.Architecture ProcessArchitecture { get { throw null; } }
public static string RuntimeIdentifier { get { throw null; } }
public static bool IsOSPlatform(System.Runtime.InteropServices.OSPlatform osPlatform) { throw null; }
}
public abstract partial class SafeBuffer : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid
{
protected SafeBuffer(bool ownsHandle) : base (default(bool)) { }
[System.CLSCompliantAttribute(false)]
public ulong ByteLength { get { throw null; } }
[System.CLSCompliantAttribute(false)]
public unsafe void AcquirePointer(ref byte* pointer) { }
[System.CLSCompliantAttribute(false)]
public void Initialize(uint numElements, uint sizeOfEachElement) { }
[System.CLSCompliantAttribute(false)]
public void Initialize(ulong numBytes) { }
[System.CLSCompliantAttribute(false)]
public void Initialize<T>(uint numElements) where T : struct { }
[System.CLSCompliantAttribute(false)]
public void ReadArray<T>(ulong byteOffset, T[] array, int index, int count) where T : struct { }
[System.CLSCompliantAttribute(false)]
public void ReadSpan<T>(ulong byteOffset, System.Span<T> buffer) where T : struct { }
[System.CLSCompliantAttribute(false)]
public T Read<T>(ulong byteOffset) where T : struct { throw null; }
public void ReleasePointer() { }
[System.CLSCompliantAttribute(false)]
public void WriteArray<T>(ulong byteOffset, T[] array, int index, int count) where T : struct { }
[System.CLSCompliantAttribute(false)]
public void WriteSpan<T>(ulong byteOffset, System.ReadOnlySpan<T> data) where T : struct { }
[System.CLSCompliantAttribute(false)]
public void Write<T>(ulong byteOffset, T value) where T : struct { }
}
public abstract partial class SafeHandle : System.Runtime.ConstrainedExecution.CriticalFinalizerObject, System.IDisposable
{
protected System.IntPtr handle;
protected SafeHandle(System.IntPtr invalidHandleValue, bool ownsHandle) { }
public bool IsClosed { get { throw null; } }
public abstract bool IsInvalid { get; }
public void Close() { }
public void DangerousAddRef(ref bool success) { }
public System.IntPtr DangerousGetHandle() { throw null; }
public void DangerousRelease() { }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
~SafeHandle() { }
protected abstract bool ReleaseHandle();
protected void SetHandle(System.IntPtr handle) { }
public void SetHandleAsInvalid() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class StructLayoutAttribute : System.Attribute
{
public System.Runtime.InteropServices.CharSet CharSet;
public int Pack;
public int Size;
public StructLayoutAttribute(short layoutKind) { }
public StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind layoutKind) { }
public System.Runtime.InteropServices.LayoutKind Value { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class SuppressGCTransitionAttribute : System.Attribute
{
public SuppressGCTransitionAttribute() { }
}
public enum UnmanagedType
{
Bool = 2,
I1 = 3,
U1 = 4,
I2 = 5,
U2 = 6,
I4 = 7,
U4 = 8,
I8 = 9,
U8 = 10,
R4 = 11,
R8 = 12,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling as Currency may be unavailable in future releases.")]
Currency = 15,
BStr = 19,
LPStr = 20,
LPWStr = 21,
LPTStr = 22,
ByValTStr = 23,
IUnknown = 25,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
IDispatch = 26,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Struct = 27,
Interface = 28,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
SafeArray = 29,
ByValArray = 30,
SysInt = 31,
SysUInt = 32,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling as VBByRefString may be unavailable in future releases.")]
VBByRefStr = 34,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling as AnsiBStr may be unavailable in future releases.")]
AnsiBStr = 35,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling as TBstr may be unavailable in future releases.")]
TBStr = 36,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
VariantBool = 37,
FunctionPtr = 38,
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("Marshalling arbitrary types may be unavailable in future releases. Specify the type you wish to marshal as.")]
AsAny = 40,
LPArray = 42,
LPStruct = 43,
CustomMarshaler = 44,
Error = 45,
IInspectable = 46,
HString = 47,
LPUTF8Str = 48,
}
}
namespace System.Runtime.Remoting
{
public partial class ObjectHandle : System.MarshalByRefObject
{
public ObjectHandle(object? o) { }
public object? Unwrap() { throw null; }
}
}
namespace System.Runtime.Serialization
{
public partial interface IDeserializationCallback
{
void OnDeserialization(object? sender);
}
[System.CLSCompliantAttribute(false)]
public partial interface IFormatterConverter
{
object Convert(object value, System.Type type);
object Convert(object value, System.TypeCode typeCode);
bool ToBoolean(object value);
byte ToByte(object value);
char ToChar(object value);
System.DateTime ToDateTime(object value);
decimal ToDecimal(object value);
double ToDouble(object value);
short ToInt16(object value);
int ToInt32(object value);
long ToInt64(object value);
sbyte ToSByte(object value);
float ToSingle(object value);
string? ToString(object value);
ushort ToUInt16(object value);
uint ToUInt32(object value);
ulong ToUInt64(object value);
}
public partial interface IObjectReference
{
object GetRealObject(System.Runtime.Serialization.StreamingContext context);
}
public partial interface ISafeSerializationData
{
void CompleteDeserialization(object deserialized);
}
public partial interface ISerializable
{
void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class OnDeserializedAttribute : System.Attribute
{
public OnDeserializedAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class OnDeserializingAttribute : System.Attribute
{
public OnDeserializingAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class OnSerializedAttribute : System.Attribute
{
public OnSerializedAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Method, Inherited=false)]
public sealed partial class OnSerializingAttribute : System.Attribute
{
public OnSerializingAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field, Inherited=false)]
public sealed partial class OptionalFieldAttribute : System.Attribute
{
public OptionalFieldAttribute() { }
public int VersionAdded { get { throw null; } set { } }
}
public sealed partial class SafeSerializationEventArgs : System.EventArgs
{
internal SafeSerializationEventArgs() { }
public System.Runtime.Serialization.StreamingContext StreamingContext { get { throw null; } }
public void AddSerializedState(System.Runtime.Serialization.ISafeSerializationData serializedState) { }
}
public readonly partial struct SerializationEntry
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public string Name { get { throw null; } }
public System.Type ObjectType { get { throw null; } }
public object? Value { get { throw null; } }
}
public partial class SerializationException : System.SystemException
{
public SerializationException() { }
protected SerializationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public SerializationException(string? message) { }
public SerializationException(string? message, System.Exception? innerException) { }
}
public sealed partial class SerializationInfo
{
[System.CLSCompliantAttribute(false)]
public SerializationInfo(System.Type type, System.Runtime.Serialization.IFormatterConverter converter) { }
[System.CLSCompliantAttribute(false)]
public SerializationInfo(System.Type type, System.Runtime.Serialization.IFormatterConverter converter, bool requireSameTokenInPartialTrust) { }
public string AssemblyName { get { throw null; } set { } }
public string FullTypeName { get { throw null; } set { } }
public bool IsAssemblyNameSetExplicit { get { throw null; } }
public bool IsFullTypeNameSetExplicit { get { throw null; } }
public int MemberCount { get { throw null; } }
public System.Type ObjectType { get { throw null; } }
public void AddValue(string name, bool value) { }
public void AddValue(string name, byte value) { }
public void AddValue(string name, char value) { }
public void AddValue(string name, System.DateTime value) { }
public void AddValue(string name, decimal value) { }
public void AddValue(string name, double value) { }
public void AddValue(string name, short value) { }
public void AddValue(string name, int value) { }
public void AddValue(string name, long value) { }
public void AddValue(string name, object? value) { }
public void AddValue(string name, object? value, System.Type type) { }
[System.CLSCompliantAttribute(false)]
public void AddValue(string name, sbyte value) { }
public void AddValue(string name, float value) { }
[System.CLSCompliantAttribute(false)]
public void AddValue(string name, ushort value) { }
[System.CLSCompliantAttribute(false)]
public void AddValue(string name, uint value) { }
[System.CLSCompliantAttribute(false)]
public void AddValue(string name, ulong value) { }
public bool GetBoolean(string name) { throw null; }
public byte GetByte(string name) { throw null; }
public char GetChar(string name) { throw null; }
public System.DateTime GetDateTime(string name) { throw null; }
public decimal GetDecimal(string name) { throw null; }
public double GetDouble(string name) { throw null; }
public System.Runtime.Serialization.SerializationInfoEnumerator GetEnumerator() { throw null; }
public short GetInt16(string name) { throw null; }
public int GetInt32(string name) { throw null; }
public long GetInt64(string name) { throw null; }
[System.CLSCompliantAttribute(false)]
public sbyte GetSByte(string name) { throw null; }
public float GetSingle(string name) { throw null; }
public string? GetString(string name) { throw null; }
[System.CLSCompliantAttribute(false)]
public ushort GetUInt16(string name) { throw null; }
[System.CLSCompliantAttribute(false)]
public uint GetUInt32(string name) { throw null; }
[System.CLSCompliantAttribute(false)]
public ulong GetUInt64(string name) { throw null; }
public object? GetValue(string name, System.Type type) { throw null; }
public void SetType(System.Type type) { }
}
public sealed partial class SerializationInfoEnumerator : System.Collections.IEnumerator
{
internal SerializationInfoEnumerator() { }
public System.Runtime.Serialization.SerializationEntry Current { get { throw null; } }
public string Name { get { throw null; } }
public System.Type ObjectType { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
public object? Value { get { throw null; } }
public bool MoveNext() { throw null; }
public void Reset() { }
}
public readonly partial struct StreamingContext
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public StreamingContext(System.Runtime.Serialization.StreamingContextStates state) { throw null; }
public StreamingContext(System.Runtime.Serialization.StreamingContextStates state, object? additional) { throw null; }
public object? Context { get { throw null; } }
public System.Runtime.Serialization.StreamingContextStates State { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public override int GetHashCode() { throw null; }
}
[System.FlagsAttribute]
public enum StreamingContextStates
{
CrossProcess = 1,
CrossMachine = 2,
File = 4,
Persistence = 8,
Remoting = 16,
Other = 32,
Clone = 64,
CrossAppDomain = 128,
All = 255,
}
}
namespace System.Runtime.Versioning
{
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed partial class ComponentGuaranteesAttribute : System.Attribute
{
public ComponentGuaranteesAttribute(System.Runtime.Versioning.ComponentGuaranteesOptions guarantees) { }
public System.Runtime.Versioning.ComponentGuaranteesOptions Guarantees { get { throw null; } }
}
[System.FlagsAttribute]
public enum ComponentGuaranteesOptions
{
None = 0,
Exchange = 1,
Stable = 2,
SideBySide = 4,
}
public sealed partial class FrameworkName : System.IEquatable<System.Runtime.Versioning.FrameworkName?>
{
public FrameworkName(string frameworkName) { }
public FrameworkName(string identifier, System.Version version) { }
public FrameworkName(string identifier, System.Version version, string? profile) { }
public string FullName { get { throw null; } }
public string Identifier { get { throw null; } }
public string Profile { get { throw null; } }
public System.Version Version { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Runtime.Versioning.FrameworkName? other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Runtime.Versioning.FrameworkName? left, System.Runtime.Versioning.FrameworkName? right) { throw null; }
public static bool operator !=(System.Runtime.Versioning.FrameworkName? left, System.Runtime.Versioning.FrameworkName? right) { throw null; }
public override string ToString() { throw null; }
}
public abstract partial class OSPlatformAttribute : System.Attribute
{
private protected OSPlatformAttribute(string platformName) { }
public string PlatformName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, Inherited=false)]
public sealed partial class RequiresPreviewFeaturesAttribute : System.Attribute
{
public RequiresPreviewFeaturesAttribute() { }
public RequiresPreviewFeaturesAttribute(string? message) { }
public string? Message { get { throw null; } }
public string? Url { get { throw null; } set { } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)]
[System.Diagnostics.ConditionalAttribute("RESOURCE_ANNOTATION_WORK")]
public sealed partial class ResourceConsumptionAttribute : System.Attribute
{
public ResourceConsumptionAttribute(System.Runtime.Versioning.ResourceScope resourceScope) { }
public ResourceConsumptionAttribute(System.Runtime.Versioning.ResourceScope resourceScope, System.Runtime.Versioning.ResourceScope consumptionScope) { }
public System.Runtime.Versioning.ResourceScope ConsumptionScope { get { throw null; } }
public System.Runtime.Versioning.ResourceScope ResourceScope { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Constructor | System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, Inherited=false)]
[System.Diagnostics.ConditionalAttribute("RESOURCE_ANNOTATION_WORK")]
public sealed partial class ResourceExposureAttribute : System.Attribute
{
public ResourceExposureAttribute(System.Runtime.Versioning.ResourceScope exposureLevel) { }
public System.Runtime.Versioning.ResourceScope ResourceExposureLevel { get { throw null; } }
}
[System.FlagsAttribute]
public enum ResourceScope
{
None = 0,
Machine = 1,
Process = 2,
AppDomain = 4,
Library = 8,
Private = 16,
Assembly = 32,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed partial class SupportedOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public SupportedOSPlatformAttribute(string platformName) : base(platformName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=true, Inherited=false)]
public sealed partial class SupportedOSPlatformGuardAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public SupportedOSPlatformGuardAttribute(string platformName) : base(platformName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class TargetFrameworkAttribute : System.Attribute
{
public TargetFrameworkAttribute(string frameworkName) { }
public string? FrameworkDisplayName { get { throw null; } set { } }
public string FrameworkName { get { throw null; } }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class TargetPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public TargetPlatformAttribute(string platformName) : base(platformName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Enum | System.AttributeTargets.Event | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Module | System.AttributeTargets.Property | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed partial class UnsupportedOSPlatformAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public UnsupportedOSPlatformAttribute(string platformName) : base(platformName) { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Field | System.AttributeTargets.Method | System.AttributeTargets.Property, AllowMultiple=true, Inherited=false)]
public sealed partial class UnsupportedOSPlatformGuardAttribute : System.Runtime.Versioning.OSPlatformAttribute
{
public UnsupportedOSPlatformGuardAttribute(string platformName) : base(platformName) { }
}
public static partial class VersioningHelper
{
public static string MakeVersionSafeName(string? name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to) { throw null; }
public static string MakeVersionSafeName(string? name, System.Runtime.Versioning.ResourceScope from, System.Runtime.Versioning.ResourceScope to, System.Type? type) { throw null; }
}
}
namespace System.Security
{
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class AllowPartiallyTrustedCallersAttribute : System.Attribute
{
public AllowPartiallyTrustedCallersAttribute() { }
public System.Security.PartialTrustVisibilityLevel PartialTrustVisibilityLevel { get { throw null; } set { } }
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public partial interface IPermission : System.Security.ISecurityEncodable
{
System.Security.IPermission Copy();
void Demand();
System.Security.IPermission? Intersect(System.Security.IPermission? target);
bool IsSubsetOf(System.Security.IPermission? target);
System.Security.IPermission? Union(System.Security.IPermission? target);
}
public partial interface ISecurityEncodable
{
void FromXml(System.Security.SecurityElement e);
System.Security.SecurityElement? ToXml();
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public partial interface IStackWalk
{
void Assert();
void Demand();
void Deny();
void PermitOnly();
}
public enum PartialTrustVisibilityLevel
{
VisibleToAllHosts = 0,
NotVisibleByDefault = 1,
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public partial class PermissionSet : System.Collections.ICollection, System.Collections.IEnumerable, System.Runtime.Serialization.IDeserializationCallback, System.Security.ISecurityEncodable, System.Security.IStackWalk
{
public PermissionSet(System.Security.Permissions.PermissionState state) { }
public PermissionSet(System.Security.PermissionSet? permSet) { }
public virtual int Count { get { throw null; } }
public virtual bool IsReadOnly { get { throw null; } }
public virtual bool IsSynchronized { get { throw null; } }
public virtual object SyncRoot { get { throw null; } }
public System.Security.IPermission? AddPermission(System.Security.IPermission? perm) { throw null; }
protected virtual System.Security.IPermission? AddPermissionImpl(System.Security.IPermission? perm) { throw null; }
public void Assert() { }
public bool ContainsNonCodeAccessPermissions() { throw null; }
[System.ObsoleteAttribute]
public static byte[] ConvertPermissionSet(string inFormat, byte[] inData, string outFormat) { throw null; }
public virtual System.Security.PermissionSet Copy() { throw null; }
public virtual void CopyTo(System.Array array, int index) { }
public void Demand() { }
[System.ObsoleteAttribute]
public void Deny() { }
public override bool Equals(object? o) { throw null; }
public virtual void FromXml(System.Security.SecurityElement et) { }
public System.Collections.IEnumerator GetEnumerator() { throw null; }
protected virtual System.Collections.IEnumerator GetEnumeratorImpl() { throw null; }
public override int GetHashCode() { throw null; }
public System.Security.IPermission? GetPermission(System.Type? permClass) { throw null; }
protected virtual System.Security.IPermission? GetPermissionImpl(System.Type? permClass) { throw null; }
public System.Security.PermissionSet? Intersect(System.Security.PermissionSet? other) { throw null; }
public bool IsEmpty() { throw null; }
public bool IsSubsetOf(System.Security.PermissionSet? target) { throw null; }
public bool IsUnrestricted() { throw null; }
public void PermitOnly() { }
public System.Security.IPermission? RemovePermission(System.Type? permClass) { throw null; }
protected virtual System.Security.IPermission? RemovePermissionImpl(System.Type? permClass) { throw null; }
public static void RevertAssert() { }
public System.Security.IPermission? SetPermission(System.Security.IPermission? perm) { throw null; }
protected virtual System.Security.IPermission? SetPermissionImpl(System.Security.IPermission? perm) { throw null; }
void System.Runtime.Serialization.IDeserializationCallback.OnDeserialization(object? sender) { }
public override string ToString() { throw null; }
public virtual System.Security.SecurityElement? ToXml() { throw null; }
public System.Security.PermissionSet? Union(System.Security.PermissionSet? other) { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed partial class SecurityCriticalAttribute : System.Attribute
{
public SecurityCriticalAttribute() { }
public SecurityCriticalAttribute(System.Security.SecurityCriticalScope scope) { }
[System.ObsoleteAttribute("SecurityCriticalScope is only used for .NET 2.0 transparency compatibility.")]
public System.Security.SecurityCriticalScope Scope { get { throw null; } }
}
[System.ObsoleteAttribute("SecurityCriticalScope is only used for .NET 2.0 transparency compatibility.")]
public enum SecurityCriticalScope
{
Explicit = 0,
Everything = 1,
}
public sealed partial class SecurityElement
{
public SecurityElement(string tag) { }
public SecurityElement(string tag, string? text) { }
public System.Collections.Hashtable? Attributes { get { throw null; } set { } }
public System.Collections.ArrayList? Children { get { throw null; } set { } }
public string Tag { get { throw null; } set { } }
public string? Text { get { throw null; } set { } }
public void AddAttribute(string name, string value) { }
public void AddChild(System.Security.SecurityElement child) { }
public string? Attribute(string name) { throw null; }
public System.Security.SecurityElement Copy() { throw null; }
public bool Equal([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Security.SecurityElement? other) { throw null; }
[return: System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute("str")]
public static string? Escape(string? str) { throw null; }
public static System.Security.SecurityElement? FromString(string xml) { throw null; }
public static bool IsValidAttributeName([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? name) { throw null; }
public static bool IsValidAttributeValue([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? value) { throw null; }
public static bool IsValidTag([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? tag) { throw null; }
public static bool IsValidText([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] string? text) { throw null; }
public System.Security.SecurityElement? SearchForChildByTag(string tag) { throw null; }
public string? SearchForTextOfTag(string tag) { throw null; }
public override string ToString() { throw null; }
}
public partial class SecurityException : System.SystemException
{
public SecurityException() { }
protected SecurityException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public SecurityException(string? message) { }
public SecurityException(string? message, System.Exception? inner) { }
public SecurityException(string? message, System.Type? type) { }
public SecurityException(string? message, System.Type? type, string? state) { }
public object? Demanded { get { throw null; } set { } }
public object? DenySetInstance { get { throw null; } set { } }
public System.Reflection.AssemblyName? FailedAssemblyInfo { get { throw null; } set { } }
public string? GrantedSet { get { throw null; } set { } }
public System.Reflection.MethodInfo? Method { get { throw null; } set { } }
public string? PermissionState { get { throw null; } set { } }
public System.Type? PermissionType { get { throw null; } set { } }
public object? PermitOnlySetInstance { get { throw null; } set { } }
public string? RefusedSet { get { throw null; } set { } }
public string? Url { get { throw null; } set { } }
public override void GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false)]
public sealed partial class SecurityRulesAttribute : System.Attribute
{
public SecurityRulesAttribute(System.Security.SecurityRuleSet ruleSet) { }
public System.Security.SecurityRuleSet RuleSet { get { throw null; } }
public bool SkipVerificationInFullTrust { get { throw null; } set { } }
}
public enum SecurityRuleSet : byte
{
None = (byte)0,
Level1 = (byte)1,
Level2 = (byte)2,
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
public sealed partial class SecuritySafeCriticalAttribute : System.Attribute
{
public SecuritySafeCriticalAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly, AllowMultiple=false, Inherited=false)]
public sealed partial class SecurityTransparentAttribute : System.Attribute
{
public SecurityTransparentAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Delegate | System.AttributeTargets.Enum | System.AttributeTargets.Field | System.AttributeTargets.Interface | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=false, Inherited=false)]
[System.ObsoleteAttribute("SecurityTreatAsSafe is only used for .NET 2.0 transparency compatibility. Use the SecuritySafeCriticalAttribute instead.")]
public sealed partial class SecurityTreatAsSafeAttribute : System.Attribute
{
public SecurityTreatAsSafeAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Class | System.AttributeTargets.Delegate | System.AttributeTargets.Interface | System.AttributeTargets.Method, AllowMultiple=true, Inherited=false)]
public sealed partial class SuppressUnmanagedCodeSecurityAttribute : System.Attribute
{
public SuppressUnmanagedCodeSecurityAttribute() { }
}
[System.AttributeUsageAttribute(System.AttributeTargets.Module, AllowMultiple=true, Inherited=false)]
public sealed partial class UnverifiableCodeAttribute : System.Attribute
{
public UnverifiableCodeAttribute() { }
}
public partial class VerificationException : System.SystemException
{
public VerificationException() { }
protected VerificationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public VerificationException(string? message) { }
public VerificationException(string? message, System.Exception? innerException) { }
}
}
namespace System.Security.Cryptography
{
public partial class CryptographicException : System.SystemException
{
public CryptographicException() { }
public CryptographicException(int hr) { }
protected CryptographicException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public CryptographicException(string? message) { }
public CryptographicException(string? message, System.Exception? inner) { }
public CryptographicException(string format, string? insert) { }
}
}
namespace System.Security.Permissions
{
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public abstract partial class CodeAccessSecurityAttribute : System.Security.Permissions.SecurityAttribute
{
protected CodeAccessSecurityAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public enum PermissionState
{
None = 0,
Unrestricted = 1,
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public enum SecurityAction
{
Demand = 2,
Assert = 3,
Deny = 4,
PermitOnly = 5,
LinkDemand = 6,
InheritanceDemand = 7,
RequestMinimum = 8,
RequestOptional = 9,
RequestRefuse = 10,
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public abstract partial class SecurityAttribute : System.Attribute
{
protected SecurityAttribute(System.Security.Permissions.SecurityAction action) { }
public System.Security.Permissions.SecurityAction Action { get { throw null; } set { } }
public bool Unrestricted { get { throw null; } set { } }
public abstract System.Security.IPermission? CreatePermission();
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.AttributeUsageAttribute(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed partial class SecurityPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
{
public SecurityPermissionAttribute(System.Security.Permissions.SecurityAction action) : base (default(System.Security.Permissions.SecurityAction)) { }
public bool Assertion { get { throw null; } set { } }
public bool BindingRedirects { get { throw null; } set { } }
public bool ControlAppDomain { get { throw null; } set { } }
public bool ControlDomainPolicy { get { throw null; } set { } }
public bool ControlEvidence { get { throw null; } set { } }
public bool ControlPolicy { get { throw null; } set { } }
public bool ControlPrincipal { get { throw null; } set { } }
public bool ControlThread { get { throw null; } set { } }
public bool Execution { get { throw null; } set { } }
public System.Security.Permissions.SecurityPermissionFlag Flags { get { throw null; } set { } }
public bool Infrastructure { get { throw null; } set { } }
public bool RemotingConfiguration { get { throw null; } set { } }
public bool SerializationFormatter { get { throw null; } set { } }
public bool SkipVerification { get { throw null; } set { } }
public bool UnmanagedCode { get { throw null; } set { } }
public override System.Security.IPermission? CreatePermission() { throw null; }
}
[System.ObsoleteAttribute("Code Access Security is not supported or honored by the runtime.", DiagnosticId = "SYSLIB0003", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
[System.FlagsAttribute]
public enum SecurityPermissionFlag
{
NoFlags = 0,
Assertion = 1,
UnmanagedCode = 2,
SkipVerification = 4,
Execution = 8,
ControlThread = 16,
ControlEvidence = 32,
ControlPolicy = 64,
SerializationFormatter = 128,
ControlDomainPolicy = 256,
ControlPrincipal = 512,
ControlAppDomain = 1024,
RemotingConfiguration = 2048,
Infrastructure = 4096,
BindingRedirects = 8192,
AllFlags = 16383,
}
}
namespace System.Security.Principal
{
public partial interface IIdentity
{
string? AuthenticationType { get; }
bool IsAuthenticated { get; }
string? Name { get; }
}
public partial interface IPrincipal
{
System.Security.Principal.IIdentity? Identity { get; }
bool IsInRole(string role);
}
public enum PrincipalPolicy
{
UnauthenticatedPrincipal = 0,
NoPrincipal = 1,
WindowsPrincipal = 2,
}
public enum TokenImpersonationLevel
{
None = 0,
Anonymous = 1,
Identification = 2,
Impersonation = 3,
Delegation = 4,
}
}
namespace System.Text
{
public abstract partial class Decoder
{
protected Decoder() { }
public System.Text.DecoderFallback? Fallback { get { throw null; } set { } }
public System.Text.DecoderFallbackBuffer FallbackBuffer { get { throw null; } }
[System.CLSCompliantAttribute(false)]
public unsafe virtual void Convert(byte* bytes, int byteCount, char* chars, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; }
public virtual void Convert(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, int charCount, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; }
public virtual void Convert(System.ReadOnlySpan<byte> bytes, System.Span<char> chars, bool flush, out int bytesUsed, out int charsUsed, out bool completed) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetCharCount(byte* bytes, int count, bool flush) { throw null; }
public abstract int GetCharCount(byte[] bytes, int index, int count);
public virtual int GetCharCount(byte[] bytes, int index, int count, bool flush) { throw null; }
public virtual int GetCharCount(System.ReadOnlySpan<byte> bytes, bool flush) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetChars(byte* bytes, int byteCount, char* chars, int charCount, bool flush) { throw null; }
public abstract int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex);
public virtual int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex, bool flush) { throw null; }
public virtual int GetChars(System.ReadOnlySpan<byte> bytes, System.Span<char> chars, bool flush) { throw null; }
public virtual void Reset() { }
}
public sealed partial class DecoderExceptionFallback : System.Text.DecoderFallback
{
public DecoderExceptionFallback() { }
public override int MaxCharCount { get { throw null; } }
public override System.Text.DecoderFallbackBuffer CreateFallbackBuffer() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
}
public sealed partial class DecoderExceptionFallbackBuffer : System.Text.DecoderFallbackBuffer
{
public DecoderExceptionFallbackBuffer() { }
public override int Remaining { get { throw null; } }
public override bool Fallback(byte[] bytesUnknown, int index) { throw null; }
public override char GetNextChar() { throw null; }
public override bool MovePrevious() { throw null; }
}
public abstract partial class DecoderFallback
{
protected DecoderFallback() { }
public static System.Text.DecoderFallback ExceptionFallback { get { throw null; } }
public abstract int MaxCharCount { get; }
public static System.Text.DecoderFallback ReplacementFallback { get { throw null; } }
public abstract System.Text.DecoderFallbackBuffer CreateFallbackBuffer();
}
public abstract partial class DecoderFallbackBuffer
{
protected DecoderFallbackBuffer() { }
public abstract int Remaining { get; }
public abstract bool Fallback(byte[] bytesUnknown, int index);
public abstract char GetNextChar();
public abstract bool MovePrevious();
public virtual void Reset() { }
}
public sealed partial class DecoderFallbackException : System.ArgumentException
{
public DecoderFallbackException() { }
public DecoderFallbackException(string? message) { }
public DecoderFallbackException(string? message, byte[]? bytesUnknown, int index) { }
public DecoderFallbackException(string? message, System.Exception? innerException) { }
public byte[]? BytesUnknown { get { throw null; } }
public int Index { get { throw null; } }
}
public sealed partial class DecoderReplacementFallback : System.Text.DecoderFallback
{
public DecoderReplacementFallback() { }
public DecoderReplacementFallback(string replacement) { }
public string DefaultString { get { throw null; } }
public override int MaxCharCount { get { throw null; } }
public override System.Text.DecoderFallbackBuffer CreateFallbackBuffer() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
}
public sealed partial class DecoderReplacementFallbackBuffer : System.Text.DecoderFallbackBuffer
{
public DecoderReplacementFallbackBuffer(System.Text.DecoderReplacementFallback fallback) { }
public override int Remaining { get { throw null; } }
public override bool Fallback(byte[] bytesUnknown, int index) { throw null; }
public override char GetNextChar() { throw null; }
public override bool MovePrevious() { throw null; }
public override void Reset() { }
}
public abstract partial class Encoder
{
protected Encoder() { }
public System.Text.EncoderFallback? Fallback { get { throw null; } set { } }
public System.Text.EncoderFallbackBuffer FallbackBuffer { get { throw null; } }
[System.CLSCompliantAttribute(false)]
public unsafe virtual void Convert(char* chars, int charCount, byte* bytes, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; }
public virtual void Convert(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, int byteCount, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; }
public virtual void Convert(System.ReadOnlySpan<char> chars, System.Span<byte> bytes, bool flush, out int charsUsed, out int bytesUsed, out bool completed) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetByteCount(char* chars, int count, bool flush) { throw null; }
public abstract int GetByteCount(char[] chars, int index, int count, bool flush);
public virtual int GetByteCount(System.ReadOnlySpan<char> chars, bool flush) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetBytes(char* chars, int charCount, byte* bytes, int byteCount, bool flush) { throw null; }
public abstract int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex, bool flush);
public virtual int GetBytes(System.ReadOnlySpan<char> chars, System.Span<byte> bytes, bool flush) { throw null; }
public virtual void Reset() { }
}
public sealed partial class EncoderExceptionFallback : System.Text.EncoderFallback
{
public EncoderExceptionFallback() { }
public override int MaxCharCount { get { throw null; } }
public override System.Text.EncoderFallbackBuffer CreateFallbackBuffer() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
}
public sealed partial class EncoderExceptionFallbackBuffer : System.Text.EncoderFallbackBuffer
{
public EncoderExceptionFallbackBuffer() { }
public override int Remaining { get { throw null; } }
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index) { throw null; }
public override bool Fallback(char charUnknown, int index) { throw null; }
public override char GetNextChar() { throw null; }
public override bool MovePrevious() { throw null; }
}
public abstract partial class EncoderFallback
{
protected EncoderFallback() { }
public static System.Text.EncoderFallback ExceptionFallback { get { throw null; } }
public abstract int MaxCharCount { get; }
public static System.Text.EncoderFallback ReplacementFallback { get { throw null; } }
public abstract System.Text.EncoderFallbackBuffer CreateFallbackBuffer();
}
public abstract partial class EncoderFallbackBuffer
{
protected EncoderFallbackBuffer() { }
public abstract int Remaining { get; }
public abstract bool Fallback(char charUnknownHigh, char charUnknownLow, int index);
public abstract bool Fallback(char charUnknown, int index);
public abstract char GetNextChar();
public abstract bool MovePrevious();
public virtual void Reset() { }
}
public sealed partial class EncoderFallbackException : System.ArgumentException
{
public EncoderFallbackException() { }
public EncoderFallbackException(string? message) { }
public EncoderFallbackException(string? message, System.Exception? innerException) { }
public char CharUnknown { get { throw null; } }
public char CharUnknownHigh { get { throw null; } }
public char CharUnknownLow { get { throw null; } }
public int Index { get { throw null; } }
public bool IsUnknownSurrogate() { throw null; }
}
public sealed partial class EncoderReplacementFallback : System.Text.EncoderFallback
{
public EncoderReplacementFallback() { }
public EncoderReplacementFallback(string replacement) { }
public string DefaultString { get { throw null; } }
public override int MaxCharCount { get { throw null; } }
public override System.Text.EncoderFallbackBuffer CreateFallbackBuffer() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public override int GetHashCode() { throw null; }
}
public sealed partial class EncoderReplacementFallbackBuffer : System.Text.EncoderFallbackBuffer
{
public EncoderReplacementFallbackBuffer(System.Text.EncoderReplacementFallback fallback) { }
public override int Remaining { get { throw null; } }
public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index) { throw null; }
public override bool Fallback(char charUnknown, int index) { throw null; }
public override char GetNextChar() { throw null; }
public override bool MovePrevious() { throw null; }
public override void Reset() { }
}
public abstract partial class Encoding : System.ICloneable
{
protected Encoding() { }
protected Encoding(int codePage) { }
protected Encoding(int codePage, System.Text.EncoderFallback? encoderFallback, System.Text.DecoderFallback? decoderFallback) { }
public static System.Text.Encoding ASCII { get { throw null; } }
public static System.Text.Encoding BigEndianUnicode { get { throw null; } }
public virtual string BodyName { get { throw null; } }
public virtual int CodePage { get { throw null; } }
public System.Text.DecoderFallback DecoderFallback { get { throw null; } set { } }
public static System.Text.Encoding Default { get { throw null; } }
public System.Text.EncoderFallback EncoderFallback { get { throw null; } set { } }
public virtual string EncodingName { get { throw null; } }
public virtual string HeaderName { get { throw null; } }
public virtual bool IsBrowserDisplay { get { throw null; } }
public virtual bool IsBrowserSave { get { throw null; } }
public virtual bool IsMailNewsDisplay { get { throw null; } }
public virtual bool IsMailNewsSave { get { throw null; } }
public bool IsReadOnly { get { throw null; } }
public virtual bool IsSingleByte { get { throw null; } }
public static System.Text.Encoding Latin1 { get { throw null; } }
public virtual System.ReadOnlySpan<byte> Preamble { get { throw null; } }
public static System.Text.Encoding Unicode { get { throw null; } }
public static System.Text.Encoding UTF32 { get { throw null; } }
[System.ObsoleteAttribute("The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.", DiagnosticId = "SYSLIB0001", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Text.Encoding UTF7 { get { throw null; } }
public static System.Text.Encoding UTF8 { get { throw null; } }
public virtual string WebName { get { throw null; } }
public virtual int WindowsCodePage { get { throw null; } }
public virtual object Clone() { throw null; }
public static byte[] Convert(System.Text.Encoding srcEncoding, System.Text.Encoding dstEncoding, byte[] bytes) { throw null; }
public static byte[] Convert(System.Text.Encoding srcEncoding, System.Text.Encoding dstEncoding, byte[] bytes, int index, int count) { throw null; }
public static System.IO.Stream CreateTranscodingStream(System.IO.Stream innerStream, System.Text.Encoding innerStreamEncoding, System.Text.Encoding outerStreamEncoding, bool leaveOpen = false) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetByteCount(char* chars, int count) { throw null; }
public virtual int GetByteCount(char[] chars) { throw null; }
public abstract int GetByteCount(char[] chars, int index, int count);
public virtual int GetByteCount(System.ReadOnlySpan<char> chars) { throw null; }
public virtual int GetByteCount(string s) { throw null; }
public int GetByteCount(string s, int index, int count) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetBytes(char* chars, int charCount, byte* bytes, int byteCount) { throw null; }
public virtual byte[] GetBytes(char[] chars) { throw null; }
public virtual byte[] GetBytes(char[] chars, int index, int count) { throw null; }
public abstract int GetBytes(char[] chars, int charIndex, int charCount, byte[] bytes, int byteIndex);
public virtual int GetBytes(System.ReadOnlySpan<char> chars, System.Span<byte> bytes) { throw null; }
public virtual byte[] GetBytes(string s) { throw null; }
public byte[] GetBytes(string s, int index, int count) { throw null; }
public virtual int GetBytes(string s, int charIndex, int charCount, byte[] bytes, int byteIndex) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetCharCount(byte* bytes, int count) { throw null; }
public virtual int GetCharCount(byte[] bytes) { throw null; }
public abstract int GetCharCount(byte[] bytes, int index, int count);
public virtual int GetCharCount(System.ReadOnlySpan<byte> bytes) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe virtual int GetChars(byte* bytes, int byteCount, char* chars, int charCount) { throw null; }
public virtual char[] GetChars(byte[] bytes) { throw null; }
public virtual char[] GetChars(byte[] bytes, int index, int count) { throw null; }
public abstract int GetChars(byte[] bytes, int byteIndex, int byteCount, char[] chars, int charIndex);
public virtual int GetChars(System.ReadOnlySpan<byte> bytes, System.Span<char> chars) { throw null; }
public virtual System.Text.Decoder GetDecoder() { throw null; }
public virtual System.Text.Encoder GetEncoder() { throw null; }
public static System.Text.Encoding GetEncoding(int codepage) { throw null; }
public static System.Text.Encoding GetEncoding(int codepage, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) { throw null; }
public static System.Text.Encoding GetEncoding(string name) { throw null; }
public static System.Text.Encoding GetEncoding(string name, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) { throw null; }
public static System.Text.EncodingInfo[] GetEncodings() { throw null; }
public override int GetHashCode() { throw null; }
public abstract int GetMaxByteCount(int charCount);
public abstract int GetMaxCharCount(int byteCount);
public virtual byte[] GetPreamble() { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe string GetString(byte* bytes, int byteCount) { throw null; }
public virtual string GetString(byte[] bytes) { throw null; }
public virtual string GetString(byte[] bytes, int index, int count) { throw null; }
public string GetString(System.ReadOnlySpan<byte> bytes) { throw null; }
public bool IsAlwaysNormalized() { throw null; }
public virtual bool IsAlwaysNormalized(System.Text.NormalizationForm form) { throw null; }
public static void RegisterProvider(System.Text.EncodingProvider provider) { }
}
public sealed partial class EncodingInfo
{
public EncodingInfo(System.Text.EncodingProvider provider, int codePage, string name, string displayName) { }
public int CodePage { get { throw null; } }
public string DisplayName { get { throw null; } }
public string Name { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? value) { throw null; }
public System.Text.Encoding GetEncoding() { throw null; }
public override int GetHashCode() { throw null; }
}
public abstract partial class EncodingProvider
{
public EncodingProvider() { }
public abstract System.Text.Encoding? GetEncoding(int codepage);
public virtual System.Text.Encoding? GetEncoding(int codepage, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) { throw null; }
public abstract System.Text.Encoding? GetEncoding(string name);
public virtual System.Text.Encoding? GetEncoding(string name, System.Text.EncoderFallback encoderFallback, System.Text.DecoderFallback decoderFallback) { throw null; }
public virtual System.Collections.Generic.IEnumerable<System.Text.EncodingInfo> GetEncodings() { throw null; }
}
public enum NormalizationForm
{
FormC = 1,
FormD = 2,
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
FormKC = 5,
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
FormKD = 6,
}
public readonly partial struct Rune : System.IComparable, System.IComparable<System.Text.Rune>, System.IEquatable<System.Text.Rune>, System.IFormattable, System.ISpanFormattable
{
private readonly int _dummyPrimitive;
public Rune(char ch) { throw null; }
public Rune(char highSurrogate, char lowSurrogate) { throw null; }
public Rune(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public Rune(uint value) { throw null; }
public bool IsAscii { get { throw null; } }
public bool IsBmp { get { throw null; } }
public int Plane { get { throw null; } }
public static System.Text.Rune ReplacementChar { get { throw null; } }
public int Utf16SequenceLength { get { throw null; } }
public int Utf8SequenceLength { get { throw null; } }
public int Value { get { throw null; } }
public int CompareTo(System.Text.Rune other) { throw null; }
public static System.Buffers.OperationStatus DecodeFromUtf16(System.ReadOnlySpan<char> source, out System.Text.Rune result, out int charsConsumed) { throw null; }
public static System.Buffers.OperationStatus DecodeFromUtf8(System.ReadOnlySpan<byte> source, out System.Text.Rune result, out int bytesConsumed) { throw null; }
public static System.Buffers.OperationStatus DecodeLastFromUtf16(System.ReadOnlySpan<char> source, out System.Text.Rune result, out int charsConsumed) { throw null; }
public static System.Buffers.OperationStatus DecodeLastFromUtf8(System.ReadOnlySpan<byte> source, out System.Text.Rune value, out int bytesConsumed) { throw null; }
public int EncodeToUtf16(System.Span<char> destination) { throw null; }
public int EncodeToUtf8(System.Span<byte> destination) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Text.Rune other) { throw null; }
public override int GetHashCode() { throw null; }
public static double GetNumericValue(System.Text.Rune value) { throw null; }
public static System.Text.Rune GetRuneAt(string input, int index) { throw null; }
public static System.Globalization.UnicodeCategory GetUnicodeCategory(System.Text.Rune value) { throw null; }
public static bool IsControl(System.Text.Rune value) { throw null; }
public static bool IsDigit(System.Text.Rune value) { throw null; }
public static bool IsLetter(System.Text.Rune value) { throw null; }
public static bool IsLetterOrDigit(System.Text.Rune value) { throw null; }
public static bool IsLower(System.Text.Rune value) { throw null; }
public static bool IsNumber(System.Text.Rune value) { throw null; }
public static bool IsPunctuation(System.Text.Rune value) { throw null; }
public static bool IsSeparator(System.Text.Rune value) { throw null; }
public static bool IsSymbol(System.Text.Rune value) { throw null; }
public static bool IsUpper(System.Text.Rune value) { throw null; }
public static bool IsValid(int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool IsValid(uint value) { throw null; }
public static bool IsWhiteSpace(System.Text.Rune value) { throw null; }
public static bool operator ==(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static explicit operator System.Text.Rune (char ch) { throw null; }
public static explicit operator System.Text.Rune (int value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static explicit operator System.Text.Rune (uint value) { throw null; }
public static bool operator >(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static bool operator >=(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static bool operator !=(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static bool operator <(System.Text.Rune left, System.Text.Rune right) { throw null; }
public static bool operator <=(System.Text.Rune left, System.Text.Rune right) { throw null; }
int System.IComparable.CompareTo(object? obj) { throw null; }
string System.IFormattable.ToString(string? format, System.IFormatProvider? formatProvider) { throw null; }
bool System.ISpanFormattable.TryFormat(System.Span<char> destination, out int charsWritten, System.ReadOnlySpan<char> format, System.IFormatProvider? provider) { throw null; }
public static System.Text.Rune ToLower(System.Text.Rune value, System.Globalization.CultureInfo culture) { throw null; }
public static System.Text.Rune ToLowerInvariant(System.Text.Rune value) { throw null; }
public override string ToString() { throw null; }
public static System.Text.Rune ToUpper(System.Text.Rune value, System.Globalization.CultureInfo culture) { throw null; }
public static System.Text.Rune ToUpperInvariant(System.Text.Rune value) { throw null; }
public static bool TryCreate(char highSurrogate, char lowSurrogate, out System.Text.Rune result) { throw null; }
public static bool TryCreate(char ch, out System.Text.Rune result) { throw null; }
public static bool TryCreate(int value, out System.Text.Rune result) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryCreate(uint value, out System.Text.Rune result) { throw null; }
public bool TryEncodeToUtf16(System.Span<char> destination, out int charsWritten) { throw null; }
public bool TryEncodeToUtf8(System.Span<byte> destination, out int bytesWritten) { throw null; }
public static bool TryGetRuneAt(string input, int index, out System.Text.Rune value) { throw null; }
}
public sealed partial class StringBuilder : System.Runtime.Serialization.ISerializable
{
public StringBuilder() { }
public StringBuilder(int capacity) { }
public StringBuilder(int capacity, int maxCapacity) { }
public StringBuilder(string? value) { }
public StringBuilder(string? value, int capacity) { }
public StringBuilder(string? value, int startIndex, int length, int capacity) { }
public int Capacity { get { throw null; } set { } }
[System.Runtime.CompilerServices.IndexerName("Chars")]
public char this[int index] { get { throw null; } set { } }
public int Length { get { throw null; } set { } }
public int MaxCapacity { get { throw null; } }
public System.Text.StringBuilder Append(bool value) { throw null; }
public System.Text.StringBuilder Append(byte value) { throw null; }
public System.Text.StringBuilder Append(char value) { throw null; }
[System.CLSCompliantAttribute(false)]
public unsafe System.Text.StringBuilder Append(char* value, int valueCount) { throw null; }
public System.Text.StringBuilder Append(char value, int repeatCount) { throw null; }
public System.Text.StringBuilder Append(char[]? value) { throw null; }
public System.Text.StringBuilder Append(char[]? value, int startIndex, int charCount) { throw null; }
public System.Text.StringBuilder Append(decimal value) { throw null; }
public System.Text.StringBuilder Append(double value) { throw null; }
public System.Text.StringBuilder Append(System.IFormatProvider? provider, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute(new string[]{ "", "provider"})] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; }
public System.Text.StringBuilder Append(short value) { throw null; }
public System.Text.StringBuilder Append(int value) { throw null; }
public System.Text.StringBuilder Append(long value) { throw null; }
public System.Text.StringBuilder Append(object? value) { throw null; }
public System.Text.StringBuilder Append(System.ReadOnlyMemory<char> value) { throw null; }
public System.Text.StringBuilder Append(System.ReadOnlySpan<char> value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Append(sbyte value) { throw null; }
public System.Text.StringBuilder Append(float value) { throw null; }
public System.Text.StringBuilder Append(string? value) { throw null; }
public System.Text.StringBuilder Append(string? value, int startIndex, int count) { throw null; }
public System.Text.StringBuilder Append(System.Text.StringBuilder? value) { throw null; }
public System.Text.StringBuilder Append(System.Text.StringBuilder? value, int startIndex, int count) { throw null; }
public System.Text.StringBuilder Append([System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("")] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Append(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Append(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Append(ulong value) { throw null; }
public System.Text.StringBuilder AppendFormat(System.IFormatProvider? provider, string format, object? arg0) { throw null; }
public System.Text.StringBuilder AppendFormat(System.IFormatProvider? provider, string format, object? arg0, object? arg1) { throw null; }
public System.Text.StringBuilder AppendFormat(System.IFormatProvider? provider, string format, object? arg0, object? arg1, object? arg2) { throw null; }
public System.Text.StringBuilder AppendFormat(System.IFormatProvider? provider, string format, params object?[] args) { throw null; }
public System.Text.StringBuilder AppendFormat(string format, object? arg0) { throw null; }
public System.Text.StringBuilder AppendFormat(string format, object? arg0, object? arg1) { throw null; }
public System.Text.StringBuilder AppendFormat(string format, object? arg0, object? arg1, object? arg2) { throw null; }
public System.Text.StringBuilder AppendFormat(string format, params object?[] args) { throw null; }
public System.Text.StringBuilder AppendJoin(char separator, params object?[] values) { throw null; }
public System.Text.StringBuilder AppendJoin(char separator, params string?[] values) { throw null; }
public System.Text.StringBuilder AppendJoin(string? separator, params object?[] values) { throw null; }
public System.Text.StringBuilder AppendJoin(string? separator, params string?[] values) { throw null; }
public System.Text.StringBuilder AppendJoin<T>(char separator, System.Collections.Generic.IEnumerable<T> values) { throw null; }
public System.Text.StringBuilder AppendJoin<T>(string? separator, System.Collections.Generic.IEnumerable<T> values) { throw null; }
public System.Text.StringBuilder AppendLine() { throw null; }
public System.Text.StringBuilder AppendLine(System.IFormatProvider? provider, [System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute(new string[]{ "", "provider"})] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; }
public System.Text.StringBuilder AppendLine(string? value) { throw null; }
public System.Text.StringBuilder AppendLine([System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute("")] ref System.Text.StringBuilder.AppendInterpolatedStringHandler handler) { throw null; }
public System.Text.StringBuilder Clear() { throw null; }
public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count) { }
public void CopyTo(int sourceIndex, System.Span<char> destination, int count) { }
public int EnsureCapacity(int capacity) { throw null; }
public bool Equals(System.ReadOnlySpan<char> span) { throw null; }
public bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] System.Text.StringBuilder? sb) { throw null; }
public System.Text.StringBuilder.ChunkEnumerator GetChunks() { throw null; }
public System.Text.StringBuilder Insert(int index, bool value) { throw null; }
public System.Text.StringBuilder Insert(int index, byte value) { throw null; }
public System.Text.StringBuilder Insert(int index, char value) { throw null; }
public System.Text.StringBuilder Insert(int index, char[]? value) { throw null; }
public System.Text.StringBuilder Insert(int index, char[]? value, int startIndex, int charCount) { throw null; }
public System.Text.StringBuilder Insert(int index, decimal value) { throw null; }
public System.Text.StringBuilder Insert(int index, double value) { throw null; }
public System.Text.StringBuilder Insert(int index, short value) { throw null; }
public System.Text.StringBuilder Insert(int index, int value) { throw null; }
public System.Text.StringBuilder Insert(int index, long value) { throw null; }
public System.Text.StringBuilder Insert(int index, object? value) { throw null; }
public System.Text.StringBuilder Insert(int index, System.ReadOnlySpan<char> value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Insert(int index, sbyte value) { throw null; }
public System.Text.StringBuilder Insert(int index, float value) { throw null; }
public System.Text.StringBuilder Insert(int index, string? value) { throw null; }
public System.Text.StringBuilder Insert(int index, string? value, int count) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Insert(int index, ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Insert(int index, uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public System.Text.StringBuilder Insert(int index, ulong value) { throw null; }
public System.Text.StringBuilder Remove(int startIndex, int length) { throw null; }
public System.Text.StringBuilder Replace(char oldChar, char newChar) { throw null; }
public System.Text.StringBuilder Replace(char oldChar, char newChar, int startIndex, int count) { throw null; }
public System.Text.StringBuilder Replace(string oldValue, string? newValue) { throw null; }
public System.Text.StringBuilder Replace(string oldValue, string? newValue, int startIndex, int count) { throw null; }
void System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public override string ToString() { throw null; }
public string ToString(int startIndex, int length) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute]
public partial struct AppendInterpolatedStringHandler
{
private object _dummy;
private int _dummyPrimitive;
public AppendInterpolatedStringHandler(int literalLength, int formattedCount, System.Text.StringBuilder stringBuilder) { throw null; }
public AppendInterpolatedStringHandler(int literalLength, int formattedCount, System.Text.StringBuilder stringBuilder, System.IFormatProvider? provider) { throw null; }
public void AppendFormatted(object? value, int alignment = 0, string? format = null) { }
public void AppendFormatted(System.ReadOnlySpan<char> value) { }
public void AppendFormatted(System.ReadOnlySpan<char> value, int alignment = 0, string? format = null) { }
public void AppendFormatted(string? value) { }
public void AppendFormatted(string? value, int alignment = 0, string? format = null) { }
public void AppendFormatted<T>(T value) { }
public void AppendFormatted<T>(T value, int alignment) { }
public void AppendFormatted<T>(T value, int alignment, string? format) { }
public void AppendFormatted<T>(T value, string? format) { }
public void AppendLiteral(string value) { }
}
public partial struct ChunkEnumerator
{
private object _dummy;
private int _dummyPrimitive;
public System.ReadOnlyMemory<char> Current { get { throw null; } }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public System.Text.StringBuilder.ChunkEnumerator GetEnumerator() { throw null; }
public bool MoveNext() { throw null; }
}
}
public partial struct StringRuneEnumerator : System.Collections.Generic.IEnumerable<System.Text.Rune>, System.Collections.Generic.IEnumerator<System.Text.Rune>, System.Collections.IEnumerable, System.Collections.IEnumerator, System.IDisposable
{
private object _dummy;
private int _dummyPrimitive;
public System.Text.Rune Current { get { throw null; } }
object? System.Collections.IEnumerator.Current { get { throw null; } }
public System.Text.StringRuneEnumerator GetEnumerator() { throw null; }
public bool MoveNext() { throw null; }
System.Collections.Generic.IEnumerator<System.Text.Rune> System.Collections.Generic.IEnumerable<System.Text.Rune>.GetEnumerator() { throw null; }
System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; }
void System.Collections.IEnumerator.Reset() { }
void System.IDisposable.Dispose() { }
}
}
namespace System.Text.Unicode
{
public static partial class Utf8
{
public static System.Buffers.OperationStatus FromUtf16(System.ReadOnlySpan<char> source, System.Span<byte> destination, out int charsRead, out int bytesWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; }
public static System.Buffers.OperationStatus ToUtf16(System.ReadOnlySpan<byte> source, System.Span<char> destination, out int bytesRead, out int charsWritten, bool replaceInvalidSequences = true, bool isFinalBlock = true) { throw null; }
}
}
namespace System.Threading
{
public readonly partial struct CancellationToken : System.IEquatable<System.Threading.CancellationToken>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public CancellationToken(bool canceled) { throw null; }
public bool CanBeCanceled { get { throw null; } }
public bool IsCancellationRequested { get { throw null; } }
public static System.Threading.CancellationToken None { get { throw null; } }
public System.Threading.WaitHandle WaitHandle { get { throw null; } }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? other) { throw null; }
public bool Equals(System.Threading.CancellationToken other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Threading.CancellationToken left, System.Threading.CancellationToken right) { throw null; }
public static bool operator !=(System.Threading.CancellationToken left, System.Threading.CancellationToken right) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action callback) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action callback, bool useSynchronizationContext) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action<object?, System.Threading.CancellationToken> callback, object? state) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action<object?> callback, object? state) { throw null; }
public System.Threading.CancellationTokenRegistration Register(System.Action<object?> callback, object? state, bool useSynchronizationContext) { throw null; }
public void ThrowIfCancellationRequested() { }
public System.Threading.CancellationTokenRegistration UnsafeRegister(System.Action<object?, System.Threading.CancellationToken> callback, object? state) { throw null; }
public System.Threading.CancellationTokenRegistration UnsafeRegister(System.Action<object?> callback, object? state) { throw null; }
}
public readonly partial struct CancellationTokenRegistration : System.IAsyncDisposable, System.IDisposable, System.IEquatable<System.Threading.CancellationTokenRegistration>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public System.Threading.CancellationToken Token { get { throw null; } }
public void Dispose() { }
public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Threading.CancellationTokenRegistration other) { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Threading.CancellationTokenRegistration left, System.Threading.CancellationTokenRegistration right) { throw null; }
public static bool operator !=(System.Threading.CancellationTokenRegistration left, System.Threading.CancellationTokenRegistration right) { throw null; }
public bool Unregister() { throw null; }
}
public partial class CancellationTokenSource : System.IDisposable
{
public CancellationTokenSource() { }
public CancellationTokenSource(int millisecondsDelay) { }
public CancellationTokenSource(System.TimeSpan delay) { }
public bool IsCancellationRequested { get { throw null; } }
public System.Threading.CancellationToken Token { get { throw null; } }
public void Cancel() { }
public void Cancel(bool throwOnFirstException) { }
public void CancelAfter(int millisecondsDelay) { }
public void CancelAfter(System.TimeSpan delay) { }
public static System.Threading.CancellationTokenSource CreateLinkedTokenSource(System.Threading.CancellationToken token) { throw null; }
public static System.Threading.CancellationTokenSource CreateLinkedTokenSource(System.Threading.CancellationToken token1, System.Threading.CancellationToken token2) { throw null; }
public static System.Threading.CancellationTokenSource CreateLinkedTokenSource(params System.Threading.CancellationToken[] tokens) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public bool TryReset() { throw null; }
}
public enum LazyThreadSafetyMode
{
None = 0,
PublicationOnly = 1,
ExecutionAndPublication = 2,
}
public sealed partial class PeriodicTimer : System.IDisposable
{
public PeriodicTimer(System.TimeSpan period) { }
public void Dispose() { }
~PeriodicTimer() { }
public System.Threading.Tasks.ValueTask<bool> WaitForNextTickAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
}
public static partial class Timeout
{
public const int Infinite = -1;
public static readonly System.TimeSpan InfiniteTimeSpan;
}
public sealed partial class Timer : System.MarshalByRefObject, System.IAsyncDisposable, System.IDisposable
{
public Timer(System.Threading.TimerCallback callback) { }
public Timer(System.Threading.TimerCallback callback, object? state, int dueTime, int period) { }
public Timer(System.Threading.TimerCallback callback, object? state, long dueTime, long period) { }
public Timer(System.Threading.TimerCallback callback, object? state, System.TimeSpan dueTime, System.TimeSpan period) { }
[System.CLSCompliantAttribute(false)]
public Timer(System.Threading.TimerCallback callback, object? state, uint dueTime, uint period) { }
public static long ActiveCount { get { throw null; } }
public bool Change(int dueTime, int period) { throw null; }
public bool Change(long dueTime, long period) { throw null; }
public bool Change(System.TimeSpan dueTime, System.TimeSpan period) { throw null; }
[System.CLSCompliantAttribute(false)]
public bool Change(uint dueTime, uint period) { throw null; }
public void Dispose() { }
public bool Dispose(System.Threading.WaitHandle notifyObject) { throw null; }
public System.Threading.Tasks.ValueTask DisposeAsync() { throw null; }
}
public delegate void TimerCallback(object? state);
public abstract partial class WaitHandle : System.MarshalByRefObject, System.IDisposable
{
protected static readonly System.IntPtr InvalidHandle;
public const int WaitTimeout = 258;
protected WaitHandle() { }
[System.ObsoleteAttribute("WaitHandle.Handle has been deprecated. Use the SafeWaitHandle property instead.")]
public virtual System.IntPtr Handle { get { throw null; } set { } }
[System.Diagnostics.CodeAnalysis.AllowNullAttribute]
public Microsoft.Win32.SafeHandles.SafeWaitHandle SafeWaitHandle { get { throw null; } set { } }
public virtual void Close() { }
public void Dispose() { }
protected virtual void Dispose(bool explicitDisposing) { }
public static bool SignalAndWait(System.Threading.WaitHandle toSignal, System.Threading.WaitHandle toWaitOn) { throw null; }
public static bool SignalAndWait(System.Threading.WaitHandle toSignal, System.Threading.WaitHandle toWaitOn, int millisecondsTimeout, bool exitContext) { throw null; }
public static bool SignalAndWait(System.Threading.WaitHandle toSignal, System.Threading.WaitHandle toWaitOn, System.TimeSpan timeout, bool exitContext) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles, System.TimeSpan timeout) { throw null; }
public static bool WaitAll(System.Threading.WaitHandle[] waitHandles, System.TimeSpan timeout, bool exitContext) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles, int millisecondsTimeout, bool exitContext) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles, System.TimeSpan timeout) { throw null; }
public static int WaitAny(System.Threading.WaitHandle[] waitHandles, System.TimeSpan timeout, bool exitContext) { throw null; }
public virtual bool WaitOne() { throw null; }
public virtual bool WaitOne(int millisecondsTimeout) { throw null; }
public virtual bool WaitOne(int millisecondsTimeout, bool exitContext) { throw null; }
public virtual bool WaitOne(System.TimeSpan timeout) { throw null; }
public virtual bool WaitOne(System.TimeSpan timeout, bool exitContext) { throw null; }
}
public static partial class WaitHandleExtensions
{
public static Microsoft.Win32.SafeHandles.SafeWaitHandle GetSafeWaitHandle(this System.Threading.WaitHandle waitHandle) { throw null; }
public static void SetSafeWaitHandle(this System.Threading.WaitHandle waitHandle, Microsoft.Win32.SafeHandles.SafeWaitHandle? value) { }
}
}
namespace System.Threading.Tasks
{
public partial class ConcurrentExclusiveSchedulerPair
{
public ConcurrentExclusiveSchedulerPair() { }
public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler) { }
public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler, int maxConcurrencyLevel) { }
public ConcurrentExclusiveSchedulerPair(System.Threading.Tasks.TaskScheduler taskScheduler, int maxConcurrencyLevel, int maxItemsPerTask) { }
public System.Threading.Tasks.Task Completion { get { throw null; } }
public System.Threading.Tasks.TaskScheduler ConcurrentScheduler { get { throw null; } }
public System.Threading.Tasks.TaskScheduler ExclusiveScheduler { get { throw null; } }
public void Complete() { }
}
public partial class Task : System.IAsyncResult, System.IDisposable
{
public Task(System.Action action) { }
public Task(System.Action action, System.Threading.CancellationToken cancellationToken) { }
public Task(System.Action action, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public Task(System.Action action, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public Task(System.Action<object?> action, object? state) { }
public Task(System.Action<object?> action, object? state, System.Threading.CancellationToken cancellationToken) { }
public Task(System.Action<object?> action, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public Task(System.Action<object?> action, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public object? AsyncState { get { throw null; } }
public static System.Threading.Tasks.Task CompletedTask { get { throw null; } }
public System.Threading.Tasks.TaskCreationOptions CreationOptions { get { throw null; } }
public static int? CurrentId { get { throw null; } }
public System.AggregateException? Exception { get { throw null; } }
public static System.Threading.Tasks.TaskFactory Factory { get { throw null; } }
public int Id { get { throw null; } }
public bool IsCanceled { get { throw null; } }
public bool IsCompleted { get { throw null; } }
public bool IsCompletedSuccessfully { get { throw null; } }
public bool IsFaulted { get { throw null; } }
public System.Threading.Tasks.TaskStatus Status { get { throw null; } }
System.Threading.WaitHandle System.IAsyncResult.AsyncWaitHandle { get { throw null; } }
bool System.IAsyncResult.CompletedSynchronously { get { throw null; } }
public System.Runtime.CompilerServices.ConfiguredTaskAwaitable ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task, object?> continuationAction, object? state, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, object?, TResult> continuationFunction, object? state, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWith<TResult>(System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public static System.Threading.Tasks.Task Delay(int millisecondsDelay) { throw null; }
public static System.Threading.Tasks.Task Delay(int millisecondsDelay, System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task Delay(System.TimeSpan delay) { throw null; }
public static System.Threading.Tasks.Task Delay(System.TimeSpan delay, System.Threading.CancellationToken cancellationToken) { throw null; }
public void Dispose() { }
protected virtual void Dispose(bool disposing) { }
public static System.Threading.Tasks.Task FromCanceled(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task<TResult> FromCanceled<TResult>(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task FromException(System.Exception exception) { throw null; }
public static System.Threading.Tasks.Task<TResult> FromException<TResult>(System.Exception exception) { throw null; }
public static System.Threading.Tasks.Task<TResult> FromResult<TResult>(TResult result) { throw null; }
public System.Runtime.CompilerServices.TaskAwaiter GetAwaiter() { throw null; }
public static System.Threading.Tasks.Task Run(System.Action action) { throw null; }
public static System.Threading.Tasks.Task Run(System.Action action, System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task Run(System.Func<System.Threading.Tasks.Task?> function) { throw null; }
public static System.Threading.Tasks.Task Run(System.Func<System.Threading.Tasks.Task?> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public void RunSynchronously() { }
public void RunSynchronously(System.Threading.Tasks.TaskScheduler scheduler) { }
public static System.Threading.Tasks.Task<TResult> Run<TResult>(System.Func<System.Threading.Tasks.Task<TResult>?> function) { throw null; }
public static System.Threading.Tasks.Task<TResult> Run<TResult>(System.Func<System.Threading.Tasks.Task<TResult>?> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task<TResult> Run<TResult>(System.Func<TResult> function) { throw null; }
public static System.Threading.Tasks.Task<TResult> Run<TResult>(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public void Start() { }
public void Start(System.Threading.Tasks.TaskScheduler scheduler) { }
public void Wait() { }
public bool Wait(int millisecondsTimeout) { throw null; }
public bool Wait(int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; }
public void Wait(System.Threading.CancellationToken cancellationToken) { }
public bool Wait(System.TimeSpan timeout) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static void WaitAll(params System.Threading.Tasks.Task[] tasks) { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static bool WaitAll(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static bool WaitAll(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static void WaitAll(System.Threading.Tasks.Task[] tasks, System.Threading.CancellationToken cancellationToken) { }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static bool WaitAll(System.Threading.Tasks.Task[] tasks, System.TimeSpan timeout) { throw null; }
public static int WaitAny(params System.Threading.Tasks.Task[] tasks) { throw null; }
public static int WaitAny(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout) { throw null; }
public static int WaitAny(System.Threading.Tasks.Task[] tasks, int millisecondsTimeout, System.Threading.CancellationToken cancellationToken) { throw null; }
public static int WaitAny(System.Threading.Tasks.Task[] tasks, System.Threading.CancellationToken cancellationToken) { throw null; }
public static int WaitAny(System.Threading.Tasks.Task[] tasks, System.TimeSpan timeout) { throw null; }
public System.Threading.Tasks.Task WaitAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task WaitAsync(System.TimeSpan timeout) { throw null; }
public System.Threading.Tasks.Task WaitAsync(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.Task WhenAll(System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task> tasks) { throw null; }
public static System.Threading.Tasks.Task WhenAll(params System.Threading.Tasks.Task[] tasks) { throw null; }
public static System.Threading.Tasks.Task<TResult[]> WhenAll<TResult>(System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task<TResult>> tasks) { throw null; }
public static System.Threading.Tasks.Task<TResult[]> WhenAll<TResult>(params System.Threading.Tasks.Task<TResult>[] tasks) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task> WhenAny(System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task> tasks) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task> WhenAny(System.Threading.Tasks.Task task1, System.Threading.Tasks.Task task2) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task> WhenAny(params System.Threading.Tasks.Task[] tasks) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> WhenAny<TResult>(System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task<TResult>> tasks) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> WhenAny<TResult>(System.Threading.Tasks.Task<TResult> task1, System.Threading.Tasks.Task<TResult> task2) { throw null; }
public static System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> WhenAny<TResult>(params System.Threading.Tasks.Task<TResult>[] tasks) { throw null; }
public static System.Runtime.CompilerServices.YieldAwaitable Yield() { throw null; }
}
public static partial class TaskAsyncEnumerableExtensions
{
public static System.Runtime.CompilerServices.ConfiguredAsyncDisposable ConfigureAwait(this System.IAsyncDisposable source, bool continueOnCapturedContext) { throw null; }
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> ConfigureAwait<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, bool continueOnCapturedContext) { throw null; }
[System.Runtime.Versioning.UnsupportedOSPlatformAttribute("browser")]
public static System.Collections.Generic.IEnumerable<T> ToBlockingEnumerable<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
public static System.Runtime.CompilerServices.ConfiguredCancelableAsyncEnumerable<T> WithCancellation<T>(this System.Collections.Generic.IAsyncEnumerable<T> source, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class TaskCanceledException : System.OperationCanceledException
{
public TaskCanceledException() { }
protected TaskCanceledException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TaskCanceledException(string? message) { }
public TaskCanceledException(string? message, System.Exception? innerException) { }
public TaskCanceledException(string? message, System.Exception? innerException, System.Threading.CancellationToken token) { }
public TaskCanceledException(System.Threading.Tasks.Task? task) { }
public System.Threading.Tasks.Task? Task { get { throw null; } }
}
public partial class TaskCompletionSource
{
public TaskCompletionSource() { }
public TaskCompletionSource(object? state) { }
public TaskCompletionSource(object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public TaskCompletionSource(System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public System.Threading.Tasks.Task Task { get { throw null; } }
public void SetCanceled() { }
public void SetCanceled(System.Threading.CancellationToken cancellationToken) { }
public void SetException(System.Collections.Generic.IEnumerable<System.Exception> exceptions) { }
public void SetException(System.Exception exception) { }
public void SetResult() { }
public bool TrySetCanceled() { throw null; }
public bool TrySetCanceled(System.Threading.CancellationToken cancellationToken) { throw null; }
public bool TrySetException(System.Collections.Generic.IEnumerable<System.Exception> exceptions) { throw null; }
public bool TrySetException(System.Exception exception) { throw null; }
public bool TrySetResult() { throw null; }
}
public partial class TaskCompletionSource<TResult>
{
public TaskCompletionSource() { }
public TaskCompletionSource(object? state) { }
public TaskCompletionSource(object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public TaskCompletionSource(System.Threading.Tasks.TaskCreationOptions creationOptions) { }
public System.Threading.Tasks.Task<TResult> Task { get { throw null; } }
public void SetCanceled() { }
public void SetCanceled(System.Threading.CancellationToken cancellationToken) { }
public void SetException(System.Collections.Generic.IEnumerable<System.Exception> exceptions) { }
public void SetException(System.Exception exception) { }
public void SetResult(TResult result) { }
public bool TrySetCanceled() { throw null; }
public bool TrySetCanceled(System.Threading.CancellationToken cancellationToken) { throw null; }
public bool TrySetException(System.Collections.Generic.IEnumerable<System.Exception> exceptions) { throw null; }
public bool TrySetException(System.Exception exception) { throw null; }
public bool TrySetResult(TResult result) { throw null; }
}
[System.FlagsAttribute]
public enum TaskContinuationOptions
{
None = 0,
PreferFairness = 1,
LongRunning = 2,
AttachedToParent = 4,
DenyChildAttach = 8,
HideScheduler = 16,
LazyCancellation = 32,
RunContinuationsAsynchronously = 64,
NotOnRanToCompletion = 65536,
NotOnFaulted = 131072,
OnlyOnCanceled = 196608,
NotOnCanceled = 262144,
OnlyOnFaulted = 327680,
OnlyOnRanToCompletion = 393216,
ExecuteSynchronously = 524288,
}
[System.FlagsAttribute]
public enum TaskCreationOptions
{
None = 0,
PreferFairness = 1,
LongRunning = 2,
AttachedToParent = 4,
DenyChildAttach = 8,
HideScheduler = 16,
RunContinuationsAsynchronously = 64,
}
public static partial class TaskExtensions
{
public static System.Threading.Tasks.Task Unwrap(this System.Threading.Tasks.Task<System.Threading.Tasks.Task> task) { throw null; }
public static System.Threading.Tasks.Task<TResult> Unwrap<TResult>(this System.Threading.Tasks.Task<System.Threading.Tasks.Task<TResult>> task) { throw null; }
}
public partial class TaskFactory
{
public TaskFactory() { }
public TaskFactory(System.Threading.CancellationToken cancellationToken) { }
public TaskFactory(System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler? scheduler) { }
public TaskFactory(System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { }
public TaskFactory(System.Threading.Tasks.TaskScheduler? scheduler) { }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
public System.Threading.Tasks.TaskContinuationOptions ContinuationOptions { get { throw null; } }
public System.Threading.Tasks.TaskCreationOptions CreationOptions { get { throw null; } }
public System.Threading.Tasks.TaskScheduler? Scheduler { get { throw null; } }
public System.Threading.Tasks.Task ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task[]> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task[]> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task[]> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task[]> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>[]> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>[]> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>[]> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>[]> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Action<System.Threading.Tasks.Task> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TResult>(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Action<System.Threading.Tasks.Task<TAntecedentResult>> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult, TResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, object? state) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.IAsyncResult asyncResult, System.Action<System.IAsyncResult> endMethod) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.IAsyncResult asyncResult, System.Action<System.IAsyncResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync(System.IAsyncResult asyncResult, System.Action<System.IAsyncResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, object? state) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TResult>(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TResult>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TResult>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1, TArg2>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, object? state) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1, TArg2>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TResult>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TResult>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1, TArg2, TArg3>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state) { throw null; }
public System.Threading.Tasks.Task FromAsync<TArg1, TArg2, TArg3>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Action<System.IAsyncResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TArg3, TResult>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TArg3, TResult>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action action) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action action, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action action, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action action, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action<object?> action, object? state) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action<object?> action, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action<object?> action, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task StartNew(System.Action<object?> action, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<object?, TResult> function, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<object?, TResult> function, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<TResult> function) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew<TResult>(System.Func<TResult> function, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
}
public partial class TaskFactory<TResult>
{
public TaskFactory() { }
public TaskFactory(System.Threading.CancellationToken cancellationToken) { }
public TaskFactory(System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler? scheduler) { }
public TaskFactory(System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { }
public TaskFactory(System.Threading.Tasks.TaskScheduler? scheduler) { }
public System.Threading.CancellationToken CancellationToken { get { throw null; } }
public System.Threading.Tasks.TaskContinuationOptions ContinuationOptions { get { throw null; } }
public System.Threading.Tasks.TaskCreationOptions CreationOptions { get { throw null; } }
public System.Threading.Tasks.TaskScheduler? Scheduler { get { throw null; } }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task[], TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAll<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>[], TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny(System.Threading.Tasks.Task[] tasks, System.Func<System.Threading.Tasks.Task, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> ContinueWhenAny<TAntecedentResult>(System.Threading.Tasks.Task<TAntecedentResult>[] tasks, System.Func<System.Threading.Tasks.Task<TAntecedentResult>, TResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.Func<System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync(System.IAsyncResult asyncResult, System.Func<System.IAsyncResult, TResult> endMethod, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1>(System.Func<TArg1, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2>(System.Func<TArg1, TArg2, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TArg3>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> FromAsync<TArg1, TArg2, TArg3>(System.Func<TArg1, TArg2, TArg3, System.AsyncCallback, object?, System.IAsyncResult> beginMethod, System.Func<System.IAsyncResult, TResult> endMethod, TArg1 arg1, TArg2 arg2, TArg3 arg3, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<object?, TResult> function, object? state) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<object?, TResult> function, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<TResult> function) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TResult> StartNew(System.Func<TResult> function, System.Threading.Tasks.TaskCreationOptions creationOptions) { throw null; }
}
public abstract partial class TaskScheduler
{
protected TaskScheduler() { }
public static System.Threading.Tasks.TaskScheduler Current { get { throw null; } }
public static System.Threading.Tasks.TaskScheduler Default { get { throw null; } }
public int Id { get { throw null; } }
public virtual int MaximumConcurrencyLevel { get { throw null; } }
public static event System.EventHandler<System.Threading.Tasks.UnobservedTaskExceptionEventArgs>? UnobservedTaskException { add { } remove { } }
public static System.Threading.Tasks.TaskScheduler FromCurrentSynchronizationContext() { throw null; }
protected abstract System.Collections.Generic.IEnumerable<System.Threading.Tasks.Task>? GetScheduledTasks();
protected internal abstract void QueueTask(System.Threading.Tasks.Task task);
protected internal virtual bool TryDequeue(System.Threading.Tasks.Task task) { throw null; }
protected bool TryExecuteTask(System.Threading.Tasks.Task task) { throw null; }
protected abstract bool TryExecuteTaskInline(System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued);
}
public partial class TaskSchedulerException : System.Exception
{
public TaskSchedulerException() { }
public TaskSchedulerException(System.Exception? innerException) { }
protected TaskSchedulerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
public TaskSchedulerException(string? message) { }
public TaskSchedulerException(string? message, System.Exception? innerException) { }
}
public enum TaskStatus
{
Created = 0,
WaitingForActivation = 1,
WaitingToRun = 2,
Running = 3,
WaitingForChildrenToComplete = 4,
RanToCompletion = 5,
Canceled = 6,
Faulted = 7,
}
public partial class Task<TResult> : System.Threading.Tasks.Task
{
public Task(System.Func<object?, TResult> function, object? state) : base (default(System.Action)) { }
public Task(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken) : base (default(System.Action)) { }
public Task(System.Func<object?, TResult> function, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions) : base (default(System.Action)) { }
public Task(System.Func<object?, TResult> function, object? state, System.Threading.Tasks.TaskCreationOptions creationOptions) : base (default(System.Action)) { }
public Task(System.Func<TResult> function) : base (default(System.Action)) { }
public Task(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken) : base (default(System.Action)) { }
public Task(System.Func<TResult> function, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskCreationOptions creationOptions) : base (default(System.Action)) { }
public Task(System.Func<TResult> function, System.Threading.Tasks.TaskCreationOptions creationOptions) : base (default(System.Action)) { }
public static new System.Threading.Tasks.TaskFactory<TResult> Factory { get { throw null; } }
public TResult Result { get { throw null; } }
public new System.Runtime.CompilerServices.ConfiguredTaskAwaitable<TResult> ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>, object?> continuationAction, object? state, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task ContinueWith(System.Action<System.Threading.Tasks.Task<TResult>> continuationAction, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, object?, TNewResult> continuationFunction, object? state, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction, System.Threading.CancellationToken cancellationToken) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction, System.Threading.CancellationToken cancellationToken, System.Threading.Tasks.TaskContinuationOptions continuationOptions, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction, System.Threading.Tasks.TaskContinuationOptions continuationOptions) { throw null; }
public System.Threading.Tasks.Task<TNewResult> ContinueWith<TNewResult>(System.Func<System.Threading.Tasks.Task<TResult>, TNewResult> continuationFunction, System.Threading.Tasks.TaskScheduler scheduler) { throw null; }
public new System.Runtime.CompilerServices.TaskAwaiter<TResult> GetAwaiter() { throw null; }
public new System.Threading.Tasks.Task<TResult> WaitAsync(System.Threading.CancellationToken cancellationToken) { throw null; }
public new System.Threading.Tasks.Task<TResult> WaitAsync(System.TimeSpan timeout) { throw null; }
public new System.Threading.Tasks.Task<TResult> WaitAsync(System.TimeSpan timeout, System.Threading.CancellationToken cancellationToken) { throw null; }
}
public partial class UnobservedTaskExceptionEventArgs : System.EventArgs
{
public UnobservedTaskExceptionEventArgs(System.AggregateException exception) { }
public System.AggregateException Exception { get { throw null; } }
public bool Observed { get { throw null; } }
public void SetObserved() { }
}
[System.Runtime.CompilerServices.AsyncMethodBuilderAttribute(typeof(System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder))]
public readonly partial struct ValueTask : System.IEquatable<System.Threading.Tasks.ValueTask>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ValueTask(System.Threading.Tasks.Sources.IValueTaskSource source, short token) { throw null; }
public ValueTask(System.Threading.Tasks.Task task) { throw null; }
public static System.Threading.Tasks.ValueTask CompletedTask { get { throw null; } }
public bool IsCanceled { get { throw null; } }
public bool IsCompleted { get { throw null; } }
public bool IsCompletedSuccessfully { get { throw null; } }
public bool IsFaulted { get { throw null; } }
public System.Threading.Tasks.Task AsTask() { throw null; }
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Threading.Tasks.ValueTask other) { throw null; }
public static System.Threading.Tasks.ValueTask FromCanceled(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.ValueTask<TResult> FromCanceled<TResult>(System.Threading.CancellationToken cancellationToken) { throw null; }
public static System.Threading.Tasks.ValueTask FromException(System.Exception exception) { throw null; }
public static System.Threading.Tasks.ValueTask<TResult> FromException<TResult>(System.Exception exception) { throw null; }
public static System.Threading.Tasks.ValueTask<TResult> FromResult<TResult>(TResult result) { throw null; }
public System.Runtime.CompilerServices.ValueTaskAwaiter GetAwaiter() { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Threading.Tasks.ValueTask left, System.Threading.Tasks.ValueTask right) { throw null; }
public static bool operator !=(System.Threading.Tasks.ValueTask left, System.Threading.Tasks.ValueTask right) { throw null; }
public System.Threading.Tasks.ValueTask Preserve() { throw null; }
}
[System.Runtime.CompilerServices.AsyncMethodBuilderAttribute(typeof(System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder<>))]
public readonly partial struct ValueTask<TResult> : System.IEquatable<System.Threading.Tasks.ValueTask<TResult>>
{
private readonly TResult _result;
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ValueTask(System.Threading.Tasks.Sources.IValueTaskSource<TResult> source, short token) { throw null; }
public ValueTask(System.Threading.Tasks.Task<TResult> task) { throw null; }
public ValueTask(TResult result) { throw null; }
public bool IsCanceled { get { throw null; } }
public bool IsCompleted { get { throw null; } }
public bool IsCompletedSuccessfully { get { throw null; } }
public bool IsFaulted { get { throw null; } }
public TResult Result { get { throw null; } }
public System.Threading.Tasks.Task<TResult> AsTask() { throw null; }
public System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable<TResult> ConfigureAwait(bool continueOnCapturedContext) { throw null; }
public override bool Equals([System.Diagnostics.CodeAnalysis.NotNullWhenAttribute(true)] object? obj) { throw null; }
public bool Equals(System.Threading.Tasks.ValueTask<TResult> other) { throw null; }
public System.Runtime.CompilerServices.ValueTaskAwaiter<TResult> GetAwaiter() { throw null; }
public override int GetHashCode() { throw null; }
public static bool operator ==(System.Threading.Tasks.ValueTask<TResult> left, System.Threading.Tasks.ValueTask<TResult> right) { throw null; }
public static bool operator !=(System.Threading.Tasks.ValueTask<TResult> left, System.Threading.Tasks.ValueTask<TResult> right) { throw null; }
public System.Threading.Tasks.ValueTask<TResult> Preserve() { throw null; }
public override string? ToString() { throw null; }
}
}
namespace System.Threading.Tasks.Sources
{
public partial interface IValueTaskSource
{
void GetResult(short token);
System.Threading.Tasks.Sources.ValueTaskSourceStatus GetStatus(short token);
void OnCompleted(System.Action<object?> continuation, object? state, short token, System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags flags);
}
public partial interface IValueTaskSource<out TResult>
{
TResult GetResult(short token);
System.Threading.Tasks.Sources.ValueTaskSourceStatus GetStatus(short token);
void OnCompleted(System.Action<object?> continuation, object? state, short token, System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags flags);
}
public partial struct ManualResetValueTaskSourceCore<TResult>
{
private TResult _result;
private object _dummy;
private int _dummyPrimitive;
public bool RunContinuationsAsynchronously { readonly get { throw null; } set { } }
public short Version { get { throw null; } }
public TResult GetResult(short token) { throw null; }
public System.Threading.Tasks.Sources.ValueTaskSourceStatus GetStatus(short token) { throw null; }
public void OnCompleted(System.Action<object?> continuation, object? state, short token, System.Threading.Tasks.Sources.ValueTaskSourceOnCompletedFlags flags) { }
public void Reset() { }
public void SetException(System.Exception error) { }
public void SetResult(TResult result) { }
}
[System.FlagsAttribute]
public enum ValueTaskSourceOnCompletedFlags
{
None = 0,
UseSchedulingContext = 1,
FlowExecutionContext = 2,
}
public enum ValueTaskSourceStatus
{
Pending = 0,
Succeeded = 1,
Faulted = 2,
Canceled = 3,
}
}
| 1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Private.Xml/src/System/Xml/Serialization/ReflectionXmlSerializationWriter.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Text;
using System.Xml.Schema;
namespace System.Xml.Serialization
{
internal sealed class ReflectionXmlSerializationWriter : XmlSerializationWriter
{
private readonly XmlMapping _mapping;
public ReflectionXmlSerializationWriter(XmlMapping xmlMapping, XmlWriter xmlWriter, XmlSerializerNamespaces namespaces, string? encodingStyle, string? id)
{
Init(xmlWriter, namespaces, encodingStyle, id, null);
if (!xmlMapping.IsWriteable || !xmlMapping.GenerateSerializer)
{
throw new ArgumentException(SR.Format(SR.XmlInternalError, nameof(xmlMapping)));
}
if (xmlMapping is XmlTypeMapping || xmlMapping is XmlMembersMapping)
{
_mapping = xmlMapping;
}
else
{
throw new ArgumentException(SR.Format(SR.XmlInternalError, nameof(xmlMapping)));
}
}
[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
protected override void InitCallbacks()
{
TypeScope scope = _mapping.Scope!;
foreach (TypeMapping mapping in scope.TypeMappings)
{
if (mapping.IsSoap &&
(mapping is StructMapping || mapping is EnumMapping) &&
!mapping.TypeDesc!.IsRoot)
{
AddWriteCallback(
mapping.TypeDesc.Type!,
mapping.TypeName!,
mapping.Namespace,
CreateXmlSerializationWriteCallback(mapping, mapping.TypeName!, mapping.Namespace, mapping.TypeDesc.IsNullable)
);
}
}
}
[RequiresUnreferencedCode("calls WriteObjectOfTypeElement")]
public void WriteObject(object? o)
{
XmlMapping xmlMapping = _mapping;
if (xmlMapping is XmlTypeMapping xmlTypeMapping)
{
WriteObjectOfTypeElement(o, xmlTypeMapping);
}
else if (xmlMapping is XmlMembersMapping xmlMembersMapping)
{
GenerateMembersElement(o!, xmlMembersMapping);
}
}
[RequiresUnreferencedCode("calls GenerateTypeElement")]
private void WriteObjectOfTypeElement(object? o, XmlTypeMapping mapping)
{
GenerateTypeElement(o, mapping);
}
[RequiresUnreferencedCode("calls WriteReferencedElements")]
private void GenerateTypeElement(object? o, XmlTypeMapping xmlMapping)
{
ElementAccessor element = xmlMapping.Accessor;
TypeMapping mapping = element.Mapping!;
WriteStartDocument();
if (o == null)
{
string? ns = (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty);
if (element.IsNullable)
{
if (mapping.IsSoap)
{
WriteNullTagEncoded(element.Name, ns);
}
else
{
WriteNullTagLiteral(element.Name, ns);
}
}
else
{
WriteEmptyTag(element.Name, ns);
}
return;
}
if (!mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.Type!.IsPrimitive)
{
TopLevelElement();
}
WriteMember(o, null, new ElementAccessor[] { element }, null, null, mapping.TypeDesc, !element.IsSoap);
if (mapping.IsSoap)
{
WriteReferencedElements();
}
}
[RequiresUnreferencedCode("calls WriteElements")]
private void WriteMember(object? o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc memberTypeDesc, bool writeAccessors)
{
if (memberTypeDesc.IsArrayLike &&
!(elements.Length == 1 && elements[0].Mapping is ArrayMapping))
{
WriteArray(o!, choiceSource, elements, text, choice, memberTypeDesc);
}
else
{
WriteElements(o, choiceSource, elements, text, choice, writeAccessors, memberTypeDesc.IsNullable);
}
}
[RequiresUnreferencedCode("calls WriteArrayItems")]
private void WriteArray(object o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc arrayTypeDesc)
{
if (elements.Length == 0 && text == null)
{
return;
}
if (arrayTypeDesc.IsNullable && o == null)
{
return;
}
if (choice != null)
{
if (choiceSource == null || ((Array)choiceSource).Length < ((Array)o).Length)
{
throw CreateInvalidChoiceIdentifierValueException(choice.Mapping!.TypeDesc!.FullName, choice.MemberName!);
}
}
WriteArrayItems(elements, text, choice, arrayTypeDesc, o);
}
[RequiresUnreferencedCode("calls WriteElements")]
private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc? arrayTypeDesc, object o)
{
var arr = o as IList;
if (arr != null)
{
for (int i = 0; i < arr.Count; i++)
{
object? ai = arr[i];
WriteElements(ai, null/*choiceName + "i"*/, elements, text, choice, true, true);
}
}
else
{
var a = o as IEnumerable;
Debug.Assert(a != null);
IEnumerator e = a.GetEnumerator();
if (e != null)
{
while (e.MoveNext())
{
object ai = e.Current;
WriteElements(ai, null/*choiceName + "i"*/, elements, text, choice, true, true);
}
}
}
}
[RequiresUnreferencedCode("calls CreateUnknownTypeException")]
private void WriteElements(object? o, object? enumSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, bool writeAccessors, bool isNullable)
{
if (elements.Length == 0 && text == null)
return;
if (elements.Length == 1 && text == null)
{
WriteElement(o, elements[0], writeAccessors);
}
else
{
if (isNullable && choice == null && o == null)
{
return;
}
int anyCount = 0;
var namedAnys = new List<ElementAccessor>();
ElementAccessor? unnamedAny = null; // can only have one
for (int i = 0; i < elements.Length; i++)
{
ElementAccessor element = elements[i];
if (element.Any)
{
anyCount++;
if (element.Name != null && element.Name.Length > 0)
namedAnys.Add(element);
else if (unnamedAny == null)
unnamedAny = element;
}
else if (choice != null)
{
if (o != null && o.GetType() == element.Mapping!.TypeDesc!.Type)
{
WriteElement(o, element, writeAccessors);
return;
}
}
else
{
TypeDesc td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
if (o!.GetType() == td.Type)
{
WriteElement(o, element, writeAccessors);
return;
}
}
}
if (anyCount > 0)
{
if (o is XmlElement elem)
{
foreach (ElementAccessor element in namedAnys)
{
if (element.Name == elem.Name && element.Namespace == elem.NamespaceURI)
{
WriteElement(elem, element, writeAccessors);
return;
}
}
if (choice != null)
{
throw CreateChoiceIdentifierValueException(choice.Mapping!.TypeDesc!.FullName, choice.MemberName!, elem.Name, elem.NamespaceURI);
}
if (unnamedAny != null)
{
WriteElement(elem, unnamedAny, writeAccessors);
return;
}
throw CreateUnknownAnyElementException(elem.Name, elem.NamespaceURI);
}
}
if (text != null)
{
WriteText(o!, text);
return;
}
if (elements.Length > 0 && o != null)
{
throw CreateUnknownTypeException(o);
}
}
}
private void WriteText(object o, TextAccessor text)
{
if (text.Mapping is PrimitiveMapping primitiveMapping)
{
string? stringValue;
if (text.Mapping is EnumMapping enumMapping)
{
stringValue = WriteEnumMethod(enumMapping, o);
}
else
{
if (!WritePrimitiveValue(primitiveMapping.TypeDesc!, o, false, out stringValue))
{
Debug.Assert(o is byte[]);
}
}
if (o is byte[] byteArray)
{
WriteValue(byteArray);
}
else
{
WriteValue(stringValue);
}
}
else if (text.Mapping is SpecialMapping specialMapping)
{
switch (specialMapping.TypeDesc!.Kind)
{
case TypeKind.Node:
((XmlNode)o).WriteTo(Writer);
break;
default:
throw new InvalidOperationException(SR.XmlInternalError);
}
}
}
[RequiresUnreferencedCode("calls WritePotentiallyReferencingElement")]
private void WriteElement(object? o, ElementAccessor element, bool writeAccessor)
{
string name = writeAccessor ? element.Name : element.Mapping!.TypeName!;
string? ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : string.Empty);
if (element.Mapping is NullableMapping nullableMapping)
{
if (o != null)
{
ElementAccessor e = element.Clone();
e.Mapping = nullableMapping.BaseMapping;
WriteElement(o, e, writeAccessor);
}
else if (element.IsNullable)
{
WriteNullTagLiteral(element.Name, ns);
}
}
else if (element.Mapping is ArrayMapping)
{
var mapping = element.Mapping as ArrayMapping;
if (element.IsNullable && o == null)
{
WriteNullTagLiteral(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty);
}
else if (mapping!.IsSoap)
{
if (mapping.Elements == null || mapping.Elements.Length != 1)
{
throw new InvalidOperationException(SR.XmlInternalError);
}
if (!writeAccessor)
{
WritePotentiallyReferencingElement(name, ns, o, mapping.TypeDesc!.Type, true, element.IsNullable);
}
else
{
WritePotentiallyReferencingElement(name, ns, o, null, false, element.IsNullable);
}
}
else if (element.IsUnbounded)
{
var enumerable = (IEnumerable)o!;
foreach (var e in enumerable)
{
element.IsUnbounded = false;
WriteElement(e, element, writeAccessor);
element.IsUnbounded = true;
}
}
else
{
if (o != null)
{
WriteStartElement(name, ns, false);
WriteArrayItems(mapping.ElementsSortedByDerivation!, null, null, mapping.TypeDesc, o);
WriteEndElement();
}
}
}
else if (element.Mapping is EnumMapping)
{
if (element.Mapping.IsSoap)
{
Writer.WriteStartElement(name, ns);
WriteEnumMethod((EnumMapping)element.Mapping, o!);
WriteEndElement();
}
else
{
WritePrimitive(WritePrimitiveMethodRequirement.WriteElementString, name, ns!, element.Default, o!, element.Mapping, false, true, element.IsNullable);
}
}
else if (element.Mapping is PrimitiveMapping)
{
var mapping = element.Mapping as PrimitiveMapping;
if (mapping!.TypeDesc == ReflectionXmlSerializationReader.QnameTypeDesc)
{
WriteQualifiedNameElement(name, ns!, element.Default, (XmlQualifiedName)o!, element.IsNullable, mapping.IsSoap, mapping);
}
else if (o == null && element.IsNullable)
{
if (mapping.IsSoap)
{
WriteNullTagEncoded(element.Name, ns);
}
else
{
WriteNullTagLiteral(element.Name, ns);
}
}
else
{
WritePrimitiveMethodRequirement suffixNullable = mapping.IsSoap ? WritePrimitiveMethodRequirement.Encoded : WritePrimitiveMethodRequirement.None;
WritePrimitiveMethodRequirement suffixRaw = mapping.TypeDesc!.XmlEncodingNotRequired ? WritePrimitiveMethodRequirement.Raw : WritePrimitiveMethodRequirement.None;
WritePrimitive(element.IsNullable
? WritePrimitiveMethodRequirement.WriteNullableStringLiteral | suffixNullable | suffixRaw
: WritePrimitiveMethodRequirement.WriteElementString | suffixRaw,
name, ns!, element.Default, o!, mapping, mapping.IsSoap, true, element.IsNullable);
}
}
else if (element.Mapping is StructMapping)
{
var mapping = element.Mapping as StructMapping;
if (mapping!.IsSoap)
{
WritePotentiallyReferencingElement(name, ns, o, !writeAccessor ? mapping.TypeDesc!.Type : null, !writeAccessor, element.IsNullable);
}
else
{
WriteStructMethod(mapping, name, ns, o, element.IsNullable, needType: false);
}
}
else if (element.Mapping is SpecialMapping)
{
if (element.Mapping is SerializableMapping)
{
WriteSerializable((IXmlSerializable)o!, name, ns, element.IsNullable, !element.Any);
}
else
{
// XmlNode, XmlElement
if (o is XmlNode node)
{
WriteElementLiteral(node, name, ns, element.IsNullable, element.Any);
}
else
{
throw CreateInvalidAnyTypeException(o!);
}
}
}
else
{
throw new InvalidOperationException(SR.XmlInternalError);
}
}
[RequiresUnreferencedCode("calls WriteStructMethod")]
private XmlSerializationWriteCallback CreateXmlSerializationWriteCallback(TypeMapping mapping, string name, string? ns, bool isNullable)
{
if (mapping is StructMapping structMapping)
{
return Wrapper;
[RequiresUnreferencedCode("calls WriteStructMethod")]
void Wrapper(object o)
{
WriteStructMethod(structMapping, name, ns, o, isNullable, needType: false);
}
}
else if (mapping is EnumMapping enumMapping)
{
return (o) =>
{
WriteEnumMethod(enumMapping, o);
};
}
else
{
throw new InvalidOperationException(SR.XmlInternalError);
}
}
private void WriteQualifiedNameElement(string name, string ns, object? defaultValue, XmlQualifiedName o, bool nullable, bool isSoap, PrimitiveMapping mapping)
{
bool hasDefault = defaultValue != null && defaultValue != DBNull.Value && mapping.TypeDesc!.HasDefaultSupport;
if (hasDefault && IsDefaultValue(mapping, o, defaultValue!, nullable))
return;
if (isSoap)
{
if (nullable)
{
WriteNullableQualifiedNameEncoded(name, ns, o, new XmlQualifiedName(mapping.TypeName, mapping.Namespace));
}
else
{
WriteElementQualifiedName(name, ns, o, new XmlQualifiedName(mapping.TypeName, mapping.Namespace));
}
}
else
{
if (nullable)
{
WriteNullableQualifiedNameLiteral(name, ns, o);
}
else
{
WriteElementQualifiedName(name, ns, o);
}
}
}
[RequiresUnreferencedCode("calls WriteTypedPrimitive")]
private void WriteStructMethod(StructMapping mapping, string n, string? ns, object? o, bool isNullable, bool needType)
{
if (mapping.IsSoap && mapping.TypeDesc!.IsRoot) return;
if (!mapping.IsSoap)
{
if (o == null)
{
if (isNullable) WriteNullTagLiteral(n, ns);
return;
}
if (!needType
&& o.GetType() != mapping.TypeDesc!.Type)
{
if (WriteDerivedTypes(mapping, n, ns, o, isNullable))
{
return;
}
if (mapping.TypeDesc.IsRoot)
{
if (WriteEnumAndArrayTypes(mapping, o, n!, ns))
{
return;
}
WriteTypedPrimitive(n, ns, o, true);
return;
}
throw CreateUnknownTypeException(o);
}
}
if (!mapping.TypeDesc!.IsAbstract)
{
if (mapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.Type))
{
EscapeName = false;
}
XmlSerializerNamespaces? xmlnsSource = null;
MemberMapping[] members = TypeScope.GetAllMembers(mapping);
int xmlnsMember = FindXmlnsIndex(members);
if (xmlnsMember >= 0)
{
MemberMapping member = members[xmlnsMember];
xmlnsSource = (XmlSerializerNamespaces?)GetMemberValue(o!, member.Name);
}
if (!mapping.IsSoap)
{
WriteStartElement(n, ns, o, false, xmlnsSource);
if (!mapping.TypeDesc.IsRoot)
{
if (needType)
{
WriteXsiType(mapping.TypeName!, mapping.Namespace);
}
}
}
else if (xmlnsSource != null)
{
WriteNamespaceDeclarations(xmlnsSource);
}
for (int i = 0; i < members.Length; i++)
{
MemberMapping m = members[i];
bool isSpecified = true;
bool shouldPersist = true;
if (m.CheckSpecified != SpecifiedAccessor.None)
{
string specifiedMemberName = $"{m.Name}Specified";
isSpecified = (bool)GetMemberValue(o!, specifiedMemberName)!;
}
if (m.CheckShouldPersist)
{
string methodInvoke = $"ShouldSerialize{m.Name}";
MethodInfo method = o!.GetType().GetMethod(methodInvoke, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)!;
shouldPersist = (bool)method.Invoke(o, Array.Empty<object>())!;
}
if (m.Attribute != null)
{
if (isSpecified && shouldPersist)
{
object? memberValue = GetMemberValue(o!, m.Name);
WriteMember(memberValue, m.Attribute, m.TypeDesc!, o);
}
}
}
for (int i = 0; i < members.Length; i++)
{
MemberMapping m = members[i];
if (m.Xmlns != null)
continue;
bool isSpecified = true;
bool shouldPersist = true;
if (m.CheckSpecified != SpecifiedAccessor.None)
{
string specifiedMemberName = $"{m.Name}Specified";
isSpecified = (bool)GetMemberValue(o!, specifiedMemberName)!;
}
if (m.CheckShouldPersist)
{
string methodInvoke = $"ShouldSerialize{m.Name}";
MethodInfo method = o!.GetType().GetMethod(methodInvoke, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)!;
shouldPersist = (bool)method.Invoke(o, Array.Empty<object>())!;
}
bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null);
if (!checkShouldPersist)
{
shouldPersist = true;
}
if (isSpecified && shouldPersist)
{
object? choiceSource = null;
if (m.ChoiceIdentifier != null)
{
choiceSource = GetMemberValue(o!, m.ChoiceIdentifier.MemberName!);
}
object? memberValue = GetMemberValue(o!, m.Name);
WriteMember(memberValue, choiceSource, m.ElementsSortedByDerivation!, m.Text, m.ChoiceIdentifier, m.TypeDesc!, true);
}
}
if (!mapping.IsSoap)
{
WriteEndElement(o);
}
}
}
[RequiresUnreferencedCode("Calls GetType on object")]
private object? GetMemberValue(object o, string memberName)
{
MemberInfo memberInfo = ReflectionXmlSerializationHelper.GetEffectiveGetInfo(o.GetType(), memberName);
object? memberValue = GetMemberValue(o, memberInfo);
return memberValue;
}
[RequiresUnreferencedCode("calls WriteMember")]
private bool WriteEnumAndArrayTypes(StructMapping structMapping, object o, string n, string? ns)
{
Type objType = o.GetType();
foreach (var m in _mapping.Scope!.TypeMappings)
{
if (m is EnumMapping em && em.TypeDesc!.Type == objType)
{
Writer.WriteStartElement(n, ns);
WriteXsiType(em.TypeName!, ns);
Writer.WriteString(WriteEnumMethod(em, o));
Writer.WriteEndElement();
return true;
}
if (m is ArrayMapping am && am.TypeDesc!.Type == objType)
{
Writer.WriteStartElement(n, ns);
WriteXsiType(am.TypeName!, ns);
WriteMember(o, null, am.ElementsSortedByDerivation!, null, null, am.TypeDesc!, true);
Writer.WriteEndElement();
return true;
}
}
return false;
}
private string? WriteEnumMethod(EnumMapping mapping, object v)
{
string? returnString = null;
if (mapping != null)
{
ConstantMapping[] constants = mapping.Constants!;
if (constants.Length > 0)
{
bool foundValue = false;
var enumValue = Convert.ToInt64(v);
for (int i = 0; i < constants.Length; i++)
{
ConstantMapping c = constants[i];
if (enumValue == c.Value)
{
returnString = c.XmlName;
foundValue = true;
break;
}
}
if (!foundValue)
{
if (mapping.IsFlags)
{
string[] xmlNames = new string[constants.Length];
long[] valueIds = new long[constants.Length];
for (int i = 0; i < constants.Length; i++)
{
xmlNames[i] = constants[i].XmlName;
valueIds[i] = constants[i].Value;
}
returnString = FromEnum(enumValue, xmlNames, valueIds);
}
else
{
throw CreateInvalidEnumValueException(v, mapping.TypeDesc!.FullName);
}
}
}
}
else
{
returnString = v.ToString();
}
if (mapping!.IsSoap)
{
WriteXsiType(mapping.TypeName!, mapping.Namespace);
Writer.WriteString(returnString);
return null;
}
else
{
return returnString;
}
}
private object? GetMemberValue(object? o, MemberInfo memberInfo)
{
if (memberInfo is PropertyInfo memberProperty)
{
return memberProperty.GetValue(o);
}
else if (memberInfo is FieldInfo memberField)
{
return memberField.GetValue(o);
}
throw new InvalidOperationException(SR.XmlInternalError);
}
private void WriteMember(object? memberValue, AttributeAccessor attribute, TypeDesc memberTypeDesc, object? container)
{
if (memberTypeDesc.IsAbstract) return;
if (memberTypeDesc.IsArrayLike)
{
var sb = new StringBuilder();
TypeDesc? arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc;
bool canOptimizeWriteListSequence = CanOptimizeWriteListSequence(arrayElementTypeDesc);
if (attribute.IsList)
{
if (canOptimizeWriteListSequence)
{
Writer.WriteStartAttribute(null, attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty);
}
}
if (memberValue != null)
{
var a = (IEnumerable)memberValue;
IEnumerator e = a.GetEnumerator();
bool shouldAppendWhitespace = false;
if (e != null)
{
while (e.MoveNext())
{
object ai = e.Current;
if (attribute.IsList)
{
string? stringValue;
if (attribute.Mapping is EnumMapping enumMapping)
{
stringValue = WriteEnumMethod(enumMapping, ai);
}
else
{
if (!WritePrimitiveValue(arrayElementTypeDesc!, ai, true, out stringValue))
{
Debug.Assert(ai is byte[]);
}
}
// check to see if we can write values of the attribute sequentially
if (canOptimizeWriteListSequence)
{
if (shouldAppendWhitespace)
{
Writer.WriteString(" ");
}
if (ai is byte[])
{
WriteValue((byte[])ai);
}
else
{
WriteValue(stringValue);
}
}
else
{
if (shouldAppendWhitespace)
{
sb.Append(' ');
}
sb.Append(stringValue);
}
}
else
{
WriteAttribute(ai, attribute, container);
}
shouldAppendWhitespace = true;
}
if (attribute.IsList)
{
// check to see if we can write values of the attribute sequentially
if (canOptimizeWriteListSequence)
{
Writer.WriteEndAttribute();
}
else
{
if (sb.Length != 0)
{
string? ns = attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty;
WriteAttribute(attribute.Name, ns, sb.ToString());
}
}
}
}
}
}
else
{
WriteAttribute(memberValue!, attribute, container);
}
}
private bool CanOptimizeWriteListSequence(TypeDesc? listElementTypeDesc)
{
// check to see if we can write values of the attribute sequentially
// currently we have only one data type (XmlQualifiedName) that we can not write "inline",
// because we need to output xmlns:qx="..." for each of the qnames
return (listElementTypeDesc != null && listElementTypeDesc != ReflectionXmlSerializationReader.QnameTypeDesc);
}
private void WriteAttribute(object memberValue, AttributeAccessor attribute, object? container)
{
// TODO: this block is never hit by our tests.
if (attribute.Mapping is SpecialMapping special)
{
if (special.TypeDesc!.Kind == TypeKind.Attribute || special.TypeDesc.CanBeAttributeValue)
{
WriteXmlAttribute((XmlNode)memberValue, container);
}
else
{
throw new InvalidOperationException(SR.XmlInternalError);
}
}
else
{
string? ns = attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty;
WritePrimitive(WritePrimitiveMethodRequirement.WriteAttribute, attribute.Name, ns, attribute.Default, memberValue, attribute.Mapping!, false, false, false);
}
}
private int FindXmlnsIndex(MemberMapping[] members)
{
for (int i = 0; i < members.Length; i++)
{
if (members[i].Xmlns == null)
continue;
return i;
}
return -1;
}
[RequiresUnreferencedCode("calls WriteStructMethod")]
private bool WriteDerivedTypes(StructMapping mapping, string n, string? ns, object o, bool isNullable)
{
Type t = o.GetType();
for (StructMapping? derived = mapping.DerivedMappings; derived != null; derived = derived.NextDerivedMapping)
{
if (t == derived.TypeDesc!.Type)
{
WriteStructMethod(derived, n, ns, o, isNullable, needType: true);
return true;
}
if (WriteDerivedTypes(derived, n, ns, o, isNullable))
{
return true;
}
}
return false;
}
private void WritePrimitive(WritePrimitiveMethodRequirement method, string name, string? ns, object? defaultValue, object o, TypeMapping mapping, bool writeXsiType, bool isElement, bool isNullable)
{
TypeDesc typeDesc = mapping.TypeDesc!;
bool hasDefault = defaultValue != null && defaultValue != DBNull.Value && mapping.TypeDesc!.HasDefaultSupport;
if (hasDefault)
{
if (mapping is EnumMapping)
{
if (((EnumMapping)mapping).IsFlags)
{
IEnumerable<string> defaultEnumFlagValues = defaultValue!.ToString()!.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries);
string defaultEnumFlagString = string.Join(", ", defaultEnumFlagValues);
if (o.ToString() == defaultEnumFlagString)
return;
}
else
{
if (o.ToString() == defaultValue!.ToString())
return;
}
}
else
{
if (IsDefaultValue(mapping, o, defaultValue!, isNullable))
{
return;
}
}
}
XmlQualifiedName? xmlQualifiedName = null;
if (writeXsiType)
{
xmlQualifiedName = new XmlQualifiedName(mapping.TypeName, mapping.Namespace);
}
string? stringValue;
bool hasValidStringValue;
if (mapping is EnumMapping enumMapping)
{
stringValue = WriteEnumMethod(enumMapping, o);
hasValidStringValue = true;
}
else
{
hasValidStringValue = WritePrimitiveValue(typeDesc, o, isElement, out stringValue);
}
if (hasValidStringValue)
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteElementString))
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.Raw))
{
WriteElementStringRaw(name, ns, stringValue, xmlQualifiedName);
}
else
{
WriteElementString(name, ns, stringValue, xmlQualifiedName);
}
}
else if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteNullableStringLiteral))
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.Encoded))
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.Raw))
{
WriteNullableStringEncodedRaw(name, ns, stringValue, xmlQualifiedName);
}
else
{
WriteNullableStringEncoded(name, ns, stringValue, xmlQualifiedName);
}
}
else
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.Raw))
{
WriteNullableStringLiteralRaw(name, ns, stringValue);
}
else
{
WriteNullableStringLiteral(name, ns, stringValue);
}
}
}
else if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteAttribute))
{
WriteAttribute(name, ns, stringValue);
}
else
{
Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code");
}
}
else if (o is byte[] a)
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteElementString | WritePrimitiveMethodRequirement.Raw))
{
WriteElementStringRaw(name, ns, FromByteArrayBase64(a));
}
else if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteNullableStringLiteral | WritePrimitiveMethodRequirement.Raw))
{
WriteNullableStringLiteralRaw(name, ns, FromByteArrayBase64(a));
}
else if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteAttribute))
{
WriteAttribute(name, ns!, a);
}
else
{
Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code");
}
}
else
{
Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code");
}
}
private bool hasRequirement(WritePrimitiveMethodRequirement value, WritePrimitiveMethodRequirement requirement)
{
return (value & requirement) == requirement;
}
private bool IsDefaultValue(TypeMapping mapping, object o, object value, bool isNullable)
{
if (value is string && ((string)value).Length == 0)
{
string str = (string)o;
return str == null || str.Length == 0;
}
else
{
return value.Equals(o);
}
}
private bool WritePrimitiveValue(TypeDesc typeDesc, object? o, bool isElement, out string? stringValue)
{
if (typeDesc == ReflectionXmlSerializationReader.StringTypeDesc || typeDesc.FormatterName == "String")
{
stringValue = (string?)o;
return true;
}
else
{
if (!typeDesc.HasCustomFormatter)
{
stringValue = ConvertPrimitiveToString(o!, typeDesc);
return true;
}
else if (o is byte[] && typeDesc.FormatterName == "ByteArrayHex")
{
stringValue = FromByteArrayHex((byte[])o);
return true;
}
else if (o is DateTime)
{
if (typeDesc.FormatterName == "DateTime")
{
stringValue = FromDateTime((DateTime)o);
return true;
}
else if (typeDesc.FormatterName == "Date")
{
stringValue = FromDate((DateTime)o);
return true;
}
else if (typeDesc.FormatterName == "Time")
{
stringValue = FromTime((DateTime)o);
return true;
}
else
{
throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Invalid DateTime"));
}
}
else if (typeDesc == ReflectionXmlSerializationReader.QnameTypeDesc)
{
stringValue = FromXmlQualifiedName((XmlQualifiedName?)o);
return true;
}
else if (o is string)
{
switch (typeDesc.FormatterName)
{
case "XmlName":
stringValue = FromXmlName((string)o);
break;
case "XmlNCName":
stringValue = FromXmlNCName((string)o);
break;
case "XmlNmToken":
stringValue = FromXmlNmToken((string)o);
break;
case "XmlNmTokens":
stringValue = FromXmlNmTokens((string)o);
break;
default:
stringValue = null;
return false;
}
return true;
}
else if (o is char && typeDesc.FormatterName == "Char")
{
stringValue = FromChar((char)o);
return true;
}
else if (o is byte[])
{
// we deal with byte[] specially in WritePrimitive()
}
else
{
throw new InvalidOperationException(SR.XmlInternalError);
}
}
stringValue = null;
return false;
}
private string ConvertPrimitiveToString(object o, TypeDesc typeDesc)
{
string stringValue = typeDesc.FormatterName switch
{
"Boolean" => XmlConvert.ToString((bool)o),
"Int32" => XmlConvert.ToString((int)o),
"Int16" => XmlConvert.ToString((short)o),
"Int64" => XmlConvert.ToString((long)o),
"Single" => XmlConvert.ToString((float)o),
"Double" => XmlConvert.ToString((double)o),
"Decimal" => XmlConvert.ToString((decimal)o),
"Byte" => XmlConvert.ToString((byte)o),
"SByte" => XmlConvert.ToString((sbyte)o),
"UInt16" => XmlConvert.ToString((ushort)o),
"UInt32" => XmlConvert.ToString((uint)o),
"UInt64" => XmlConvert.ToString((ulong)o),
// Types without direct mapping (ambiguous)
"Guid" => XmlConvert.ToString((Guid)o),
"Char" => XmlConvert.ToString((char)o),
"TimeSpan" => XmlConvert.ToString((TimeSpan)o),
"DateTimeOffset" => XmlConvert.ToString((DateTimeOffset)o),
_ => o.ToString()!,
};
return stringValue;
}
[RequiresUnreferencedCode("calls WritePotentiallyReferencingElement")]
private void GenerateMembersElement(object o, XmlMembersMapping xmlMembersMapping)
{
ElementAccessor element = xmlMembersMapping.Accessor;
MembersMapping mapping = (MembersMapping)element.Mapping!;
bool hasWrapperElement = mapping.HasWrapperElement;
bool writeAccessors = mapping.WriteAccessors;
bool isRpc = xmlMembersMapping.IsSoap && writeAccessors;
WriteStartDocument();
if (!mapping.IsSoap)
{
TopLevelElement();
}
object[] p = (object[])o;
int pLength = p.Length;
if (hasWrapperElement)
{
WriteStartElement(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty), mapping.IsSoap);
int xmlnsMember = FindXmlnsIndex(mapping.Members!);
if (xmlnsMember >= 0)
{
var source = (XmlSerializerNamespaces)p[xmlnsMember];
if (pLength > xmlnsMember)
{
WriteNamespaceDeclarations(source);
}
}
for (int i = 0; i < mapping.Members!.Length; i++)
{
MemberMapping member = mapping.Members[i];
if (member.Attribute != null && !member.Ignore)
{
object source = p[i];
bool? specifiedSource = null;
if (member.CheckSpecified != SpecifiedAccessor.None)
{
string memberNameSpecified = $"{member.Name}Specified";
for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++)
{
if (mapping.Members[j].Name == memberNameSpecified)
{
specifiedSource = (bool)p[j];
break;
}
}
}
if (pLength > i && (specifiedSource == null || specifiedSource.Value))
{
WriteMember(source, member.Attribute, member.TypeDesc!, null);
}
}
}
}
for (int i = 0; i < mapping.Members!.Length; i++)
{
MemberMapping member = mapping.Members[i];
if (member.Xmlns != null)
continue;
if (member.Ignore)
continue;
bool? specifiedSource = null;
if (member.CheckSpecified != SpecifiedAccessor.None)
{
string memberNameSpecified = $"{member.Name}Specified";
for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++)
{
if (mapping.Members[j].Name == memberNameSpecified)
{
specifiedSource = (bool)p[j];
break;
}
}
}
if (pLength > i)
{
if (specifiedSource == null || specifiedSource.Value)
{
object source = p[i];
object? enumSource = null;
if (member.ChoiceIdentifier != null)
{
for (int j = 0; j < mapping.Members.Length; j++)
{
if (mapping.Members[j].Name == member.ChoiceIdentifier.MemberName)
{
enumSource = p[j];
break;
}
}
}
if (isRpc && member.IsReturnValue && member.Elements!.Length > 0)
{
WriteRpcResult(member.Elements[0].Name, string.Empty);
}
// override writeAccessors choice when we've written a wrapper element
WriteMember(source, enumSource, member.ElementsSortedByDerivation!, member.Text, member.ChoiceIdentifier, member.TypeDesc!, writeAccessors || hasWrapperElement);
}
}
}
if (hasWrapperElement)
{
WriteEndElement();
}
if (element.IsSoap)
{
if (!hasWrapperElement && !writeAccessors)
{
// doc/bare case -- allow extra members
if (pLength > mapping.Members.Length)
{
for (int i = mapping.Members.Length; i < pLength; i++)
{
if (p[i] != null)
{
WritePotentiallyReferencingElement(null, null, p[i], p[i].GetType(), true, false);
}
}
}
}
WriteReferencedElements();
}
}
[Flags]
private enum WritePrimitiveMethodRequirement
{
None = 0,
Raw = 1,
WriteAttribute = 2,
WriteElementString = 4,
WriteNullableStringLiteral = 8,
Encoded = 16
}
}
internal static class ReflectionXmlSerializationHelper
{
[RequiresUnreferencedCode("Reflects over base members")]
public static MemberInfo? GetMember(Type declaringType, string memberName, bool throwOnNotFound)
{
MemberInfo[] memberInfos = declaringType.GetMember(memberName);
if (memberInfos == null || memberInfos.Length == 0)
{
bool foundMatchedMember = false;
Type? currentType = declaringType.BaseType;
while (currentType != null)
{
memberInfos = currentType.GetMember(memberName);
if (memberInfos != null && memberInfos.Length != 0)
{
foundMatchedMember = true;
break;
}
currentType = currentType.BaseType;
}
if (!foundMatchedMember)
{
if (throwOnNotFound)
{
throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, $"Could not find member named {memberName} of type {declaringType}"));
}
return null;
}
declaringType = currentType!;
}
MemberInfo memberInfo = memberInfos![0];
if (memberInfos.Length != 1)
{
foreach (MemberInfo mi in memberInfos)
{
if (declaringType == mi.DeclaringType)
{
memberInfo = mi;
break;
}
}
}
return memberInfo;
}
[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
public static MemberInfo GetEffectiveGetInfo(Type declaringType, string memberName)
{
MemberInfo memberInfo = GetMember(declaringType, memberName, true)!;
// For properties, we might have a PropertyInfo that does not have a valid
// getter at this level of inheritance. If that's the case, we need to look
// up the chain to find the right PropertyInfo for the getter.
if (memberInfo is PropertyInfo propInfo && propInfo.GetMethod == null)
{
var parent = declaringType.BaseType;
while (parent != null)
{
var mi = GetMember(parent, memberName, false);
if (mi is PropertyInfo pi && pi.GetMethod != null && pi.PropertyType == propInfo.PropertyType)
{
return pi;
}
parent = parent.BaseType;
}
}
return memberInfo;
}
[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
public static MemberInfo GetEffectiveSetInfo(Type declaringType, string memberName)
{
MemberInfo memberInfo = GetMember(declaringType, memberName, true)!;
// For properties, we might have a PropertyInfo that does not have a valid
// setter at this level of inheritance. If that's the case, we need to look
// up the chain to find the right PropertyInfo for the setter.
if (memberInfo is PropertyInfo propInfo && propInfo.SetMethod == null)
{
var parent = declaringType.BaseType;
while (parent != null)
{
var mi = GetMember(parent, memberName, false);
if (mi is PropertyInfo pi && pi.SetMethod != null && pi.PropertyType == propInfo.PropertyType)
{
return pi;
}
parent = parent.BaseType;
}
}
return memberInfo;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Text;
using System.Xml.Schema;
namespace System.Xml.Serialization
{
internal sealed class ReflectionXmlSerializationWriter : XmlSerializationWriter
{
private readonly XmlMapping _mapping;
public ReflectionXmlSerializationWriter(XmlMapping xmlMapping, XmlWriter xmlWriter, XmlSerializerNamespaces namespaces, string? encodingStyle, string? id)
{
Init(xmlWriter, namespaces, encodingStyle, id, null);
if (!xmlMapping.IsWriteable || !xmlMapping.GenerateSerializer)
{
throw new ArgumentException(SR.Format(SR.XmlInternalError, nameof(xmlMapping)));
}
if (xmlMapping is XmlTypeMapping || xmlMapping is XmlMembersMapping)
{
_mapping = xmlMapping;
}
else
{
throw new ArgumentException(SR.Format(SR.XmlInternalError, nameof(xmlMapping)));
}
}
[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
protected override void InitCallbacks()
{
TypeScope scope = _mapping.Scope!;
foreach (TypeMapping mapping in scope.TypeMappings)
{
if (mapping.IsSoap &&
(mapping is StructMapping || mapping is EnumMapping) &&
!mapping.TypeDesc!.IsRoot)
{
AddWriteCallback(
mapping.TypeDesc.Type!,
mapping.TypeName!,
mapping.Namespace,
CreateXmlSerializationWriteCallback(mapping, mapping.TypeName!, mapping.Namespace, mapping.TypeDesc.IsNullable)
);
}
}
}
[RequiresUnreferencedCode("calls WriteObjectOfTypeElement")]
public void WriteObject(object? o)
{
XmlMapping xmlMapping = _mapping;
if (xmlMapping is XmlTypeMapping xmlTypeMapping)
{
WriteObjectOfTypeElement(o, xmlTypeMapping);
}
else if (xmlMapping is XmlMembersMapping xmlMembersMapping)
{
GenerateMembersElement(o!, xmlMembersMapping);
}
}
[RequiresUnreferencedCode("calls GenerateTypeElement")]
private void WriteObjectOfTypeElement(object? o, XmlTypeMapping mapping)
{
GenerateTypeElement(o, mapping);
}
[RequiresUnreferencedCode("calls WriteReferencedElements")]
private void GenerateTypeElement(object? o, XmlTypeMapping xmlMapping)
{
ElementAccessor element = xmlMapping.Accessor;
TypeMapping mapping = element.Mapping!;
WriteStartDocument();
if (o == null)
{
string? ns = (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty);
if (element.IsNullable)
{
if (mapping.IsSoap)
{
WriteNullTagEncoded(element.Name, ns);
}
else
{
WriteNullTagLiteral(element.Name, ns);
}
}
else
{
WriteEmptyTag(element.Name, ns);
}
return;
}
if (!mapping.TypeDesc!.IsValueType && !mapping.TypeDesc.Type!.IsPrimitive)
{
TopLevelElement();
}
WriteMember(o, null, new ElementAccessor[] { element }, null, null, mapping.TypeDesc, !element.IsSoap);
if (mapping.IsSoap)
{
WriteReferencedElements();
}
}
[RequiresUnreferencedCode("calls WriteElements")]
private void WriteMember(object? o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc memberTypeDesc, bool writeAccessors)
{
if (memberTypeDesc.IsArrayLike &&
!(elements.Length == 1 && elements[0].Mapping is ArrayMapping))
{
WriteArray(o!, choiceSource, elements, text, choice, memberTypeDesc);
}
else
{
WriteElements(o, choiceSource, elements, text, choice, writeAccessors, memberTypeDesc.IsNullable);
}
}
[RequiresUnreferencedCode("calls WriteArrayItems")]
private void WriteArray(object o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc arrayTypeDesc)
{
if (elements.Length == 0 && text == null)
{
return;
}
if (arrayTypeDesc.IsNullable && o == null)
{
return;
}
if (choice != null)
{
if (choiceSource == null || ((Array)choiceSource).Length < ((Array)o).Length)
{
throw CreateInvalidChoiceIdentifierValueException(choice.Mapping!.TypeDesc!.FullName, choice.MemberName!);
}
}
WriteArrayItems(elements, text, choice, arrayTypeDesc, o);
}
[RequiresUnreferencedCode("calls WriteElements")]
private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, TypeDesc? arrayTypeDesc, object o)
{
var arr = o as IList;
if (arr != null)
{
for (int i = 0; i < arr.Count; i++)
{
object? ai = arr[i];
WriteElements(ai, null/*choiceName + "i"*/, elements, text, choice, true, true);
}
}
else
{
var a = o as IEnumerable;
Debug.Assert(a != null);
IEnumerator e = a.GetEnumerator();
if (e != null)
{
while (e.MoveNext())
{
object ai = e.Current;
WriteElements(ai, null/*choiceName + "i"*/, elements, text, choice, true, true);
}
}
}
}
[RequiresUnreferencedCode("calls CreateUnknownTypeException")]
private void WriteElements(object? o, object? enumSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, bool writeAccessors, bool isNullable)
{
if (elements.Length == 0 && text == null)
return;
if (elements.Length == 1 && text == null)
{
WriteElement(o, elements[0], writeAccessors);
}
else
{
if (isNullable && choice == null && o == null)
{
return;
}
int anyCount = 0;
var namedAnys = new List<ElementAccessor>();
ElementAccessor? unnamedAny = null; // can only have one
for (int i = 0; i < elements.Length; i++)
{
ElementAccessor element = elements[i];
if (element.Any)
{
anyCount++;
if (element.Name != null && element.Name.Length > 0)
namedAnys.Add(element);
else if (unnamedAny == null)
unnamedAny = element;
}
else if (choice != null)
{
if (o != null && o.GetType() == element.Mapping!.TypeDesc!.Type)
{
WriteElement(o, element, writeAccessors);
return;
}
}
else
{
TypeDesc td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
if (o!.GetType() == td.Type)
{
WriteElement(o, element, writeAccessors);
return;
}
}
}
if (anyCount > 0)
{
if (o is XmlElement elem)
{
foreach (ElementAccessor element in namedAnys)
{
if (element.Name == elem.Name && element.Namespace == elem.NamespaceURI)
{
WriteElement(elem, element, writeAccessors);
return;
}
}
if (choice != null)
{
throw CreateChoiceIdentifierValueException(choice.Mapping!.TypeDesc!.FullName, choice.MemberName!, elem.Name, elem.NamespaceURI);
}
if (unnamedAny != null)
{
WriteElement(elem, unnamedAny, writeAccessors);
return;
}
throw CreateUnknownAnyElementException(elem.Name, elem.NamespaceURI);
}
}
if (text != null)
{
WriteText(o!, text);
return;
}
if (elements.Length > 0 && o != null)
{
throw CreateUnknownTypeException(o);
}
}
}
private void WriteText(object o, TextAccessor text)
{
if (text.Mapping is PrimitiveMapping primitiveMapping)
{
string? stringValue;
if (text.Mapping is EnumMapping enumMapping)
{
stringValue = WriteEnumMethod(enumMapping, o);
}
else
{
if (!WritePrimitiveValue(primitiveMapping.TypeDesc!, o, false, out stringValue))
{
Debug.Assert(o is byte[]);
}
}
if (o is byte[] byteArray)
{
WriteValue(byteArray);
}
else
{
WriteValue(stringValue);
}
}
else if (text.Mapping is SpecialMapping specialMapping)
{
switch (specialMapping.TypeDesc!.Kind)
{
case TypeKind.Node:
((XmlNode)o).WriteTo(Writer);
break;
default:
throw new InvalidOperationException(SR.XmlInternalError);
}
}
}
[RequiresUnreferencedCode("calls WritePotentiallyReferencingElement")]
private void WriteElement(object? o, ElementAccessor element, bool writeAccessor)
{
string name = writeAccessor ? element.Name : element.Mapping!.TypeName!;
string? ns = element.Any && element.Name.Length == 0 ? null : (element.Form == XmlSchemaForm.Qualified ? (writeAccessor ? element.Namespace : element.Mapping!.Namespace) : string.Empty);
if (element.Mapping is NullableMapping nullableMapping)
{
if (o != null)
{
ElementAccessor e = element.Clone();
e.Mapping = nullableMapping.BaseMapping;
WriteElement(o, e, writeAccessor);
}
else if (element.IsNullable)
{
WriteNullTagLiteral(element.Name, ns);
}
}
else if (element.Mapping is ArrayMapping)
{
var mapping = element.Mapping as ArrayMapping;
if (element.IsNullable && o == null)
{
WriteNullTagLiteral(element.Name, element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty);
}
else if (mapping!.IsSoap)
{
if (mapping.Elements == null || mapping.Elements.Length != 1)
{
throw new InvalidOperationException(SR.XmlInternalError);
}
if (!writeAccessor)
{
WritePotentiallyReferencingElement(name, ns, o, mapping.TypeDesc!.Type, true, element.IsNullable);
}
else
{
WritePotentiallyReferencingElement(name, ns, o, null, false, element.IsNullable);
}
}
else if (element.IsUnbounded)
{
var enumerable = (IEnumerable)o!;
foreach (var e in enumerable)
{
element.IsUnbounded = false;
WriteElement(e, element, writeAccessor);
element.IsUnbounded = true;
}
}
else
{
if (o != null)
{
WriteStartElement(name, ns, false);
WriteArrayItems(mapping.ElementsSortedByDerivation!, null, null, mapping.TypeDesc, o);
WriteEndElement();
}
}
}
else if (element.Mapping is EnumMapping)
{
if (element.Mapping.IsSoap)
{
Writer.WriteStartElement(name, ns);
WriteEnumMethod((EnumMapping)element.Mapping, o!);
WriteEndElement();
}
else
{
WritePrimitive(WritePrimitiveMethodRequirement.WriteElementString, name, ns!, element.Default, o!, element.Mapping, false, true, element.IsNullable);
}
}
else if (element.Mapping is PrimitiveMapping)
{
var mapping = element.Mapping as PrimitiveMapping;
if (mapping!.TypeDesc == ReflectionXmlSerializationReader.QnameTypeDesc)
{
WriteQualifiedNameElement(name, ns!, element.Default, (XmlQualifiedName)o!, element.IsNullable, mapping.IsSoap, mapping);
}
else if (o == null && element.IsNullable)
{
if (mapping.IsSoap)
{
WriteNullTagEncoded(element.Name, ns);
}
else
{
WriteNullTagLiteral(element.Name, ns);
}
}
else
{
WritePrimitiveMethodRequirement suffixNullable = mapping.IsSoap ? WritePrimitiveMethodRequirement.Encoded : WritePrimitiveMethodRequirement.None;
WritePrimitiveMethodRequirement suffixRaw = mapping.TypeDesc!.XmlEncodingNotRequired ? WritePrimitiveMethodRequirement.Raw : WritePrimitiveMethodRequirement.None;
WritePrimitive(element.IsNullable
? WritePrimitiveMethodRequirement.WriteNullableStringLiteral | suffixNullable | suffixRaw
: WritePrimitiveMethodRequirement.WriteElementString | suffixRaw,
name, ns!, element.Default, o!, mapping, mapping.IsSoap, true, element.IsNullable);
}
}
else if (element.Mapping is StructMapping)
{
var mapping = element.Mapping as StructMapping;
if (mapping!.IsSoap)
{
WritePotentiallyReferencingElement(name, ns, o, !writeAccessor ? mapping.TypeDesc!.Type : null, !writeAccessor, element.IsNullable);
}
else
{
WriteStructMethod(mapping, name, ns, o, element.IsNullable, needType: false);
}
}
else if (element.Mapping is SpecialMapping)
{
if (element.Mapping is SerializableMapping)
{
WriteSerializable((IXmlSerializable)o!, name, ns, element.IsNullable, !element.Any);
}
else
{
// XmlNode, XmlElement
if (o is XmlNode node)
{
WriteElementLiteral(node, name, ns, element.IsNullable, element.Any);
}
else
{
throw CreateInvalidAnyTypeException(o!);
}
}
}
else
{
throw new InvalidOperationException(SR.XmlInternalError);
}
}
[RequiresUnreferencedCode("calls WriteStructMethod")]
private XmlSerializationWriteCallback CreateXmlSerializationWriteCallback(TypeMapping mapping, string name, string? ns, bool isNullable)
{
if (mapping is StructMapping structMapping)
{
return Wrapper;
[RequiresUnreferencedCode("calls WriteStructMethod")]
void Wrapper(object o)
{
WriteStructMethod(structMapping, name, ns, o, isNullable, needType: false);
}
}
else if (mapping is EnumMapping enumMapping)
{
return (o) =>
{
WriteEnumMethod(enumMapping, o);
};
}
else
{
throw new InvalidOperationException(SR.XmlInternalError);
}
}
private void WriteQualifiedNameElement(string name, string ns, object? defaultValue, XmlQualifiedName o, bool nullable, bool isSoap, PrimitiveMapping mapping)
{
bool hasDefault = defaultValue != null && defaultValue != DBNull.Value && mapping.TypeDesc!.HasDefaultSupport;
if (hasDefault && IsDefaultValue(mapping, o, defaultValue!, nullable))
return;
if (isSoap)
{
if (nullable)
{
WriteNullableQualifiedNameEncoded(name, ns, o, new XmlQualifiedName(mapping.TypeName, mapping.Namespace));
}
else
{
WriteElementQualifiedName(name, ns, o, new XmlQualifiedName(mapping.TypeName, mapping.Namespace));
}
}
else
{
if (nullable)
{
WriteNullableQualifiedNameLiteral(name, ns, o);
}
else
{
WriteElementQualifiedName(name, ns, o);
}
}
}
[RequiresUnreferencedCode("calls WriteTypedPrimitive")]
private void WriteStructMethod(StructMapping mapping, string n, string? ns, object? o, bool isNullable, bool needType)
{
if (mapping.IsSoap && mapping.TypeDesc!.IsRoot) return;
if (!mapping.IsSoap)
{
if (o == null)
{
if (isNullable) WriteNullTagLiteral(n, ns);
return;
}
if (!needType
&& o.GetType() != mapping.TypeDesc!.Type)
{
if (WriteDerivedTypes(mapping, n, ns, o, isNullable))
{
return;
}
if (mapping.TypeDesc.IsRoot)
{
if (WriteEnumAndArrayTypes(mapping, o, n!, ns))
{
return;
}
WriteTypedPrimitive(n, ns, o, true);
return;
}
throw CreateUnknownTypeException(o);
}
}
if (!mapping.TypeDesc!.IsAbstract)
{
if (mapping.TypeDesc.Type != null && typeof(XmlSchemaObject).IsAssignableFrom(mapping.TypeDesc.Type))
{
EscapeName = false;
}
XmlSerializerNamespaces? xmlnsSource = null;
MemberMapping[] members = TypeScope.GetAllMembers(mapping);
int xmlnsMember = FindXmlnsIndex(members);
if (xmlnsMember >= 0)
{
MemberMapping member = members[xmlnsMember];
xmlnsSource = (XmlSerializerNamespaces?)GetMemberValue(o!, member.Name);
}
if (!mapping.IsSoap)
{
WriteStartElement(n, ns, o, false, xmlnsSource);
if (!mapping.TypeDesc.IsRoot)
{
if (needType)
{
WriteXsiType(mapping.TypeName!, mapping.Namespace);
}
}
}
else if (xmlnsSource != null)
{
WriteNamespaceDeclarations(xmlnsSource);
}
for (int i = 0; i < members.Length; i++)
{
MemberMapping m = members[i];
bool isSpecified = true;
bool shouldPersist = true;
if (m.CheckSpecified != SpecifiedAccessor.None)
{
string specifiedMemberName = $"{m.Name}Specified";
isSpecified = (bool)GetMemberValue(o!, specifiedMemberName)!;
}
if (m.CheckShouldPersist)
{
string methodInvoke = $"ShouldSerialize{m.Name}";
MethodInfo method = o!.GetType().GetMethod(methodInvoke, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)!;
shouldPersist = (bool)method.Invoke(o, Array.Empty<object>())!;
}
if (m.Attribute != null)
{
if (isSpecified && shouldPersist)
{
object? memberValue = GetMemberValue(o!, m.Name);
WriteMember(memberValue, m.Attribute, m.TypeDesc!, o);
}
}
}
for (int i = 0; i < members.Length; i++)
{
MemberMapping m = members[i];
if (m.Xmlns != null)
continue;
bool isSpecified = true;
bool shouldPersist = true;
if (m.CheckSpecified != SpecifiedAccessor.None)
{
string specifiedMemberName = $"{m.Name}Specified";
isSpecified = (bool)GetMemberValue(o!, specifiedMemberName)!;
}
if (m.CheckShouldPersist)
{
string methodInvoke = $"ShouldSerialize{m.Name}";
MethodInfo method = o!.GetType().GetMethod(methodInvoke, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly)!;
shouldPersist = (bool)method.Invoke(o, Array.Empty<object>())!;
}
bool checkShouldPersist = m.CheckShouldPersist && (m.Elements!.Length > 0 || m.Text != null);
if (!checkShouldPersist)
{
shouldPersist = true;
}
if (isSpecified && shouldPersist)
{
object? choiceSource = null;
if (m.ChoiceIdentifier != null)
{
choiceSource = GetMemberValue(o!, m.ChoiceIdentifier.MemberName!);
}
object? memberValue = GetMemberValue(o!, m.Name);
WriteMember(memberValue, choiceSource, m.ElementsSortedByDerivation!, m.Text, m.ChoiceIdentifier, m.TypeDesc!, true);
}
}
if (!mapping.IsSoap)
{
WriteEndElement(o);
}
}
}
[RequiresUnreferencedCode("Calls GetType on object")]
private object? GetMemberValue(object o, string memberName)
{
MemberInfo memberInfo = ReflectionXmlSerializationHelper.GetEffectiveGetInfo(o.GetType(), memberName);
object? memberValue = GetMemberValue(o, memberInfo);
return memberValue;
}
[RequiresUnreferencedCode("calls WriteMember")]
private bool WriteEnumAndArrayTypes(StructMapping structMapping, object o, string n, string? ns)
{
Type objType = o.GetType();
foreach (var m in _mapping.Scope!.TypeMappings)
{
if (m is EnumMapping em && em.TypeDesc!.Type == objType)
{
Writer.WriteStartElement(n, ns);
WriteXsiType(em.TypeName!, ns);
Writer.WriteString(WriteEnumMethod(em, o));
Writer.WriteEndElement();
return true;
}
if (m is ArrayMapping am && am.TypeDesc!.Type == objType)
{
Writer.WriteStartElement(n, ns);
WriteXsiType(am.TypeName!, ns);
WriteMember(o, null, am.ElementsSortedByDerivation!, null, null, am.TypeDesc!, true);
Writer.WriteEndElement();
return true;
}
}
return false;
}
private string? WriteEnumMethod(EnumMapping mapping, object v)
{
string? returnString = null;
if (mapping != null)
{
ConstantMapping[] constants = mapping.Constants!;
if (constants.Length > 0)
{
bool foundValue = false;
var enumValue = Convert.ToInt64(v);
for (int i = 0; i < constants.Length; i++)
{
ConstantMapping c = constants[i];
if (enumValue == c.Value)
{
returnString = c.XmlName;
foundValue = true;
break;
}
}
if (!foundValue)
{
if (mapping.IsFlags)
{
string[] xmlNames = new string[constants.Length];
long[] valueIds = new long[constants.Length];
for (int i = 0; i < constants.Length; i++)
{
xmlNames[i] = constants[i].XmlName;
valueIds[i] = constants[i].Value;
}
returnString = FromEnum(enumValue, xmlNames, valueIds);
}
else
{
throw CreateInvalidEnumValueException(v, mapping.TypeDesc!.FullName);
}
}
}
}
else
{
returnString = v.ToString();
}
if (mapping!.IsSoap)
{
WriteXsiType(mapping.TypeName!, mapping.Namespace);
Writer.WriteString(returnString);
return null;
}
else
{
return returnString;
}
}
private object? GetMemberValue(object? o, MemberInfo memberInfo)
{
if (memberInfo is PropertyInfo memberProperty)
{
return memberProperty.GetValue(o);
}
else if (memberInfo is FieldInfo memberField)
{
return memberField.GetValue(o);
}
throw new InvalidOperationException(SR.XmlInternalError);
}
private void WriteMember(object? memberValue, AttributeAccessor attribute, TypeDesc memberTypeDesc, object? container)
{
if (memberTypeDesc.IsAbstract) return;
if (memberTypeDesc.IsArrayLike)
{
var sb = new StringBuilder();
TypeDesc? arrayElementTypeDesc = memberTypeDesc.ArrayElementTypeDesc;
bool canOptimizeWriteListSequence = CanOptimizeWriteListSequence(arrayElementTypeDesc);
if (attribute.IsList)
{
if (canOptimizeWriteListSequence)
{
Writer.WriteStartAttribute(null, attribute.Name, attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty);
}
}
if (memberValue != null)
{
var a = (IEnumerable)memberValue;
IEnumerator e = a.GetEnumerator();
bool shouldAppendWhitespace = false;
if (e != null)
{
while (e.MoveNext())
{
object ai = e.Current;
if (attribute.IsList)
{
string? stringValue;
if (attribute.Mapping is EnumMapping enumMapping)
{
stringValue = WriteEnumMethod(enumMapping, ai);
}
else
{
if (!WritePrimitiveValue(arrayElementTypeDesc!, ai, true, out stringValue))
{
Debug.Assert(ai is byte[]);
}
}
// check to see if we can write values of the attribute sequentially
if (canOptimizeWriteListSequence)
{
if (shouldAppendWhitespace)
{
Writer.WriteString(" ");
}
if (ai is byte[])
{
WriteValue((byte[])ai);
}
else
{
WriteValue(stringValue);
}
}
else
{
if (shouldAppendWhitespace)
{
sb.Append(' ');
}
sb.Append(stringValue);
}
}
else
{
WriteAttribute(ai, attribute, container);
}
shouldAppendWhitespace = true;
}
if (attribute.IsList)
{
// check to see if we can write values of the attribute sequentially
if (canOptimizeWriteListSequence)
{
Writer.WriteEndAttribute();
}
else
{
if (sb.Length != 0)
{
string? ns = attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty;
WriteAttribute(attribute.Name, ns, sb.ToString());
}
}
}
}
}
}
else
{
WriteAttribute(memberValue!, attribute, container);
}
}
private bool CanOptimizeWriteListSequence(TypeDesc? listElementTypeDesc)
{
// check to see if we can write values of the attribute sequentially
// currently we have only one data type (XmlQualifiedName) that we can not write "inline",
// because we need to output xmlns:qx="..." for each of the qnames
return (listElementTypeDesc != null && listElementTypeDesc != ReflectionXmlSerializationReader.QnameTypeDesc);
}
private void WriteAttribute(object memberValue, AttributeAccessor attribute, object? container)
{
// TODO: this block is never hit by our tests.
if (attribute.Mapping is SpecialMapping special)
{
if (special.TypeDesc!.Kind == TypeKind.Attribute || special.TypeDesc.CanBeAttributeValue)
{
WriteXmlAttribute((XmlNode)memberValue, container);
}
else
{
throw new InvalidOperationException(SR.XmlInternalError);
}
}
else
{
string? ns = attribute.Form == XmlSchemaForm.Qualified ? attribute.Namespace : string.Empty;
WritePrimitive(WritePrimitiveMethodRequirement.WriteAttribute, attribute.Name, ns, attribute.Default, memberValue, attribute.Mapping!, false, false, false);
}
}
private int FindXmlnsIndex(MemberMapping[] members)
{
for (int i = 0; i < members.Length; i++)
{
if (members[i].Xmlns == null)
continue;
return i;
}
return -1;
}
[RequiresUnreferencedCode("calls WriteStructMethod")]
private bool WriteDerivedTypes(StructMapping mapping, string n, string? ns, object o, bool isNullable)
{
Type t = o.GetType();
for (StructMapping? derived = mapping.DerivedMappings; derived != null; derived = derived.NextDerivedMapping)
{
if (t == derived.TypeDesc!.Type)
{
WriteStructMethod(derived, n, ns, o, isNullable, needType: true);
return true;
}
if (WriteDerivedTypes(derived, n, ns, o, isNullable))
{
return true;
}
}
return false;
}
private void WritePrimitive(WritePrimitiveMethodRequirement method, string name, string? ns, object? defaultValue, object o, TypeMapping mapping, bool writeXsiType, bool isElement, bool isNullable)
{
TypeDesc typeDesc = mapping.TypeDesc!;
bool hasDefault = defaultValue != null && defaultValue != DBNull.Value && mapping.TypeDesc!.HasDefaultSupport;
if (hasDefault)
{
if (mapping is EnumMapping)
{
if (((EnumMapping)mapping).IsFlags)
{
IEnumerable<string> defaultEnumFlagValues = defaultValue!.ToString()!.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries);
string defaultEnumFlagString = string.Join(", ", defaultEnumFlagValues);
if (o.ToString() == defaultEnumFlagString)
return;
}
else
{
if (o.ToString() == defaultValue!.ToString())
return;
}
}
else
{
if (IsDefaultValue(mapping, o, defaultValue!, isNullable))
{
return;
}
}
}
XmlQualifiedName? xmlQualifiedName = null;
if (writeXsiType)
{
xmlQualifiedName = new XmlQualifiedName(mapping.TypeName, mapping.Namespace);
}
string? stringValue;
bool hasValidStringValue;
if (mapping is EnumMapping enumMapping)
{
stringValue = WriteEnumMethod(enumMapping, o);
hasValidStringValue = true;
}
else
{
hasValidStringValue = WritePrimitiveValue(typeDesc, o, isElement, out stringValue);
}
if (hasValidStringValue)
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteElementString))
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.Raw))
{
WriteElementStringRaw(name, ns, stringValue, xmlQualifiedName);
}
else
{
WriteElementString(name, ns, stringValue, xmlQualifiedName);
}
}
else if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteNullableStringLiteral))
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.Encoded))
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.Raw))
{
WriteNullableStringEncodedRaw(name, ns, stringValue, xmlQualifiedName);
}
else
{
WriteNullableStringEncoded(name, ns, stringValue, xmlQualifiedName);
}
}
else
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.Raw))
{
WriteNullableStringLiteralRaw(name, ns, stringValue);
}
else
{
WriteNullableStringLiteral(name, ns, stringValue);
}
}
}
else if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteAttribute))
{
WriteAttribute(name, ns, stringValue);
}
else
{
Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code");
}
}
else if (o is byte[] a)
{
if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteElementString | WritePrimitiveMethodRequirement.Raw))
{
WriteElementStringRaw(name, ns, FromByteArrayBase64(a));
}
else if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteNullableStringLiteral | WritePrimitiveMethodRequirement.Raw))
{
WriteNullableStringLiteralRaw(name, ns, FromByteArrayBase64(a));
}
else if (hasRequirement(method, WritePrimitiveMethodRequirement.WriteAttribute))
{
WriteAttribute(name, ns!, a);
}
else
{
Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code");
}
}
else
{
Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code");
}
}
private bool hasRequirement(WritePrimitiveMethodRequirement value, WritePrimitiveMethodRequirement requirement)
{
return (value & requirement) == requirement;
}
private bool IsDefaultValue(TypeMapping mapping, object o, object value, bool isNullable)
{
if (value is string && ((string)value).Length == 0)
{
string str = (string)o;
return str == null || str.Length == 0;
}
else
{
return value.Equals(o);
}
}
private bool WritePrimitiveValue(TypeDesc typeDesc, object? o, bool isElement, out string? stringValue)
{
if (typeDesc == ReflectionXmlSerializationReader.StringTypeDesc || typeDesc.FormatterName == "String")
{
stringValue = (string?)o;
return true;
}
else
{
if (!typeDesc.HasCustomFormatter)
{
stringValue = ConvertPrimitiveToString(o!, typeDesc);
return true;
}
else if (o is byte[] && typeDesc.FormatterName == "ByteArrayHex")
{
stringValue = FromByteArrayHex((byte[])o);
return true;
}
else if (o is DateTime)
{
if (typeDesc.FormatterName == "DateTime")
{
stringValue = FromDateTime((DateTime)o);
return true;
}
else if (typeDesc.FormatterName == "Date")
{
stringValue = FromDate((DateTime)o);
return true;
}
else if (typeDesc.FormatterName == "Time")
{
stringValue = FromTime((DateTime)o);
return true;
}
else
{
throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, "Invalid DateTime"));
}
}
else if (typeDesc == ReflectionXmlSerializationReader.QnameTypeDesc)
{
stringValue = FromXmlQualifiedName((XmlQualifiedName?)o);
return true;
}
else if (o is string)
{
switch (typeDesc.FormatterName)
{
case "XmlName":
stringValue = FromXmlName((string)o);
break;
case "XmlNCName":
stringValue = FromXmlNCName((string)o);
break;
case "XmlNmToken":
stringValue = FromXmlNmToken((string)o);
break;
case "XmlNmTokens":
stringValue = FromXmlNmTokens((string)o);
break;
default:
stringValue = null;
return false;
}
return true;
}
else if (o is char && typeDesc.FormatterName == "Char")
{
stringValue = FromChar((char)o);
return true;
}
else if (o is byte[])
{
// we deal with byte[] specially in WritePrimitive()
}
else
{
throw new InvalidOperationException(SR.XmlInternalError);
}
}
stringValue = null;
return false;
}
private string ConvertPrimitiveToString(object o, TypeDesc typeDesc)
{
string stringValue = typeDesc.FormatterName switch
{
"Boolean" => XmlConvert.ToString((bool)o),
"Int32" => XmlConvert.ToString((int)o),
"Int16" => XmlConvert.ToString((short)o),
"Int64" => XmlConvert.ToString((long)o),
"Single" => XmlConvert.ToString((float)o),
"Double" => XmlConvert.ToString((double)o),
"Decimal" => XmlConvert.ToString((decimal)o),
"Byte" => XmlConvert.ToString((byte)o),
"SByte" => XmlConvert.ToString((sbyte)o),
"UInt16" => XmlConvert.ToString((ushort)o),
"UInt32" => XmlConvert.ToString((uint)o),
"UInt64" => XmlConvert.ToString((ulong)o),
// Types without direct mapping (ambiguous)
"Guid" => XmlConvert.ToString((Guid)o),
"Char" => XmlConvert.ToString((char)o),
"TimeSpan" => XmlConvert.ToString((TimeSpan)o),
"DateTimeOffset" => XmlConvert.ToString((DateTimeOffset)o),
_ => o.ToString()!,
};
return stringValue;
}
[RequiresUnreferencedCode("calls WritePotentiallyReferencingElement")]
private void GenerateMembersElement(object o, XmlMembersMapping xmlMembersMapping)
{
ElementAccessor element = xmlMembersMapping.Accessor;
MembersMapping mapping = (MembersMapping)element.Mapping!;
bool hasWrapperElement = mapping.HasWrapperElement;
bool writeAccessors = mapping.WriteAccessors;
bool isRpc = xmlMembersMapping.IsSoap && writeAccessors;
WriteStartDocument();
if (!mapping.IsSoap)
{
TopLevelElement();
}
object[] p = (object[])o;
int pLength = p.Length;
if (hasWrapperElement)
{
WriteStartElement(element.Name, (element.Form == XmlSchemaForm.Qualified ? element.Namespace : string.Empty), mapping.IsSoap);
int xmlnsMember = FindXmlnsIndex(mapping.Members!);
if (xmlnsMember >= 0)
{
var source = (XmlSerializerNamespaces)p[xmlnsMember];
if (pLength > xmlnsMember)
{
WriteNamespaceDeclarations(source);
}
}
for (int i = 0; i < mapping.Members!.Length; i++)
{
MemberMapping member = mapping.Members[i];
if (member.Attribute != null && !member.Ignore)
{
object source = p[i];
bool? specifiedSource = null;
if (member.CheckSpecified != SpecifiedAccessor.None)
{
string memberNameSpecified = $"{member.Name}Specified";
for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++)
{
if (mapping.Members[j].Name == memberNameSpecified)
{
specifiedSource = (bool)p[j];
break;
}
}
}
if (pLength > i && (specifiedSource == null || specifiedSource.Value))
{
WriteMember(source, member.Attribute, member.TypeDesc!, null);
}
}
}
}
for (int i = 0; i < mapping.Members!.Length; i++)
{
MemberMapping member = mapping.Members[i];
if (member.Xmlns != null)
continue;
if (member.Ignore)
continue;
bool? specifiedSource = null;
if (member.CheckSpecified != SpecifiedAccessor.None)
{
string memberNameSpecified = $"{member.Name}Specified";
for (int j = 0; j < Math.Min(pLength, mapping.Members.Length); j++)
{
if (mapping.Members[j].Name == memberNameSpecified)
{
specifiedSource = (bool)p[j];
break;
}
}
}
if (pLength > i)
{
if (specifiedSource == null || specifiedSource.Value)
{
object source = p[i];
object? enumSource = null;
if (member.ChoiceIdentifier != null)
{
for (int j = 0; j < mapping.Members.Length; j++)
{
if (mapping.Members[j].Name == member.ChoiceIdentifier.MemberName)
{
enumSource = p[j];
break;
}
}
}
if (isRpc && member.IsReturnValue && member.Elements!.Length > 0)
{
WriteRpcResult(member.Elements[0].Name, string.Empty);
}
// override writeAccessors choice when we've written a wrapper element
WriteMember(source, enumSource, member.ElementsSortedByDerivation!, member.Text, member.ChoiceIdentifier, member.TypeDesc!, writeAccessors || hasWrapperElement);
}
}
}
if (hasWrapperElement)
{
WriteEndElement();
}
if (element.IsSoap)
{
if (!hasWrapperElement && !writeAccessors)
{
// doc/bare case -- allow extra members
if (pLength > mapping.Members.Length)
{
for (int i = mapping.Members.Length; i < pLength; i++)
{
if (p[i] != null)
{
WritePotentiallyReferencingElement(null, null, p[i], p[i].GetType(), true, false);
}
}
}
}
WriteReferencedElements();
}
}
[Flags]
private enum WritePrimitiveMethodRequirement
{
None = 0,
Raw = 1,
WriteAttribute = 2,
WriteElementString = 4,
WriteNullableStringLiteral = 8,
Encoded = 16
}
}
internal static class ReflectionXmlSerializationHelper
{
[RequiresUnreferencedCode("Reflects over base members")]
public static MemberInfo? GetMember(Type declaringType, string memberName, bool throwOnNotFound)
{
MemberInfo[] memberInfos = declaringType.GetMember(memberName);
if (memberInfos == null || memberInfos.Length == 0)
{
bool foundMatchedMember = false;
Type? currentType = declaringType.BaseType;
while (currentType != null)
{
memberInfos = currentType.GetMember(memberName);
if (memberInfos != null && memberInfos.Length != 0)
{
foundMatchedMember = true;
break;
}
currentType = currentType.BaseType;
}
if (!foundMatchedMember)
{
if (throwOnNotFound)
{
throw new InvalidOperationException(SR.Format(SR.XmlInternalErrorDetails, $"Could not find member named {memberName} of type {declaringType}"));
}
return null;
}
declaringType = currentType!;
}
MemberInfo memberInfo = memberInfos![0];
if (memberInfos.Length != 1)
{
foreach (MemberInfo mi in memberInfos)
{
if (declaringType == mi.DeclaringType)
{
memberInfo = mi;
break;
}
}
}
return memberInfo;
}
[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
public static MemberInfo GetEffectiveGetInfo(Type declaringType, string memberName)
{
MemberInfo memberInfo = GetMember(declaringType, memberName, true)!;
// For properties, we might have a PropertyInfo that does not have a valid
// getter at this level of inheritance. If that's the case, we need to look
// up the chain to find the right PropertyInfo for the getter.
if (memberInfo is PropertyInfo propInfo && propInfo.GetMethod == null)
{
var parent = declaringType.BaseType;
while (parent != null)
{
var mi = GetMember(parent, memberName, false);
if (mi is PropertyInfo pi && pi.GetMethod != null && pi.PropertyType == propInfo.PropertyType)
{
return pi;
}
parent = parent.BaseType;
}
}
return memberInfo;
}
[RequiresUnreferencedCode(XmlSerializer.TrimSerializationWarning)]
public static MemberInfo GetEffectiveSetInfo(Type declaringType, string memberName)
{
MemberInfo memberInfo = GetMember(declaringType, memberName, true)!;
// For properties, we might have a PropertyInfo that does not have a valid
// setter at this level of inheritance. If that's the case, we need to look
// up the chain to find the right PropertyInfo for the setter.
if (memberInfo is PropertyInfo propInfo && propInfo.SetMethod == null)
{
var parent = declaringType.BaseType;
while (parent != null)
{
var mi = GetMember(parent, memberName, false);
if (mi is PropertyInfo pi && pi.SetMethod != null && pi.PropertyType == propInfo.PropertyType)
{
return pi;
}
parent = parent.BaseType;
}
}
return memberInfo;
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Linq.Queryable/tests/TakeWhileTests.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Linq.Expressions;
using Xunit;
namespace System.Linq.Tests
{
public class TakeWhileTests : EnumerableBasedTests
{
[Fact]
public void SourceNonEmptyPredicateTrueSomeFalseSecond()
{
int[] source = { 8, 3, 12, 4, 6, 10 };
int[] expected = { 8 };
Assert.Equal(expected, source.AsQueryable().TakeWhile(x => x % 2 == 0));
}
[Fact]
public void SourceNonEmptyPredicateTrueSomeFalseSecondWithIndex()
{
int[] source = { 8, 3, 12, 4, 6, 10 };
int[] expected = { 8 };
Assert.Equal(expected, source.AsQueryable().TakeWhile((x, i) => x % 2 == 0));
}
[Fact]
public void ThrowsOnNullSource()
{
IQueryable<int> source = null;
AssertExtensions.Throws<ArgumentNullException>("source", () => source.TakeWhile(x => true));
}
[Fact]
public void ThrowsOnNullPredicate()
{
IQueryable<int> source = new[] { 1, 2, 3 }.AsQueryable();
Expression<Func<int, bool>> nullPredicate = null;
AssertExtensions.Throws<ArgumentNullException>("predicate", () => source.TakeWhile(nullPredicate));
}
[Fact]
public void ThrowsOnNullSourceIndexed()
{
IQueryable<int> source = null;
AssertExtensions.Throws<ArgumentNullException>("source", () => source.TakeWhile((x, i) => true));
}
[Fact]
public void ThrowsOnNullPredicateIndexed()
{
IQueryable<int> source = new[] { 1, 2, 3 }.AsQueryable();
Expression<Func<int, int, bool>> nullPredicate = null;
AssertExtensions.Throws<ArgumentNullException>("predicate", () => source.TakeWhile(nullPredicate));
}
[Fact]
public void TakeWhile1()
{
var count = (new int[] { 0, 1, 2 }).AsQueryable().TakeWhile(n => n < 2).Count();
Assert.Equal(2, count);
}
[Fact]
public void TakeWhile2()
{
var count = (new int[] { 0, 1, 2 }).AsQueryable().TakeWhile((n, i) => n + i < 4).Count();
Assert.Equal(2, count);
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Linq.Expressions;
using Xunit;
namespace System.Linq.Tests
{
public class TakeWhileTests : EnumerableBasedTests
{
[Fact]
public void SourceNonEmptyPredicateTrueSomeFalseSecond()
{
int[] source = { 8, 3, 12, 4, 6, 10 };
int[] expected = { 8 };
Assert.Equal(expected, source.AsQueryable().TakeWhile(x => x % 2 == 0));
}
[Fact]
public void SourceNonEmptyPredicateTrueSomeFalseSecondWithIndex()
{
int[] source = { 8, 3, 12, 4, 6, 10 };
int[] expected = { 8 };
Assert.Equal(expected, source.AsQueryable().TakeWhile((x, i) => x % 2 == 0));
}
[Fact]
public void ThrowsOnNullSource()
{
IQueryable<int> source = null;
AssertExtensions.Throws<ArgumentNullException>("source", () => source.TakeWhile(x => true));
}
[Fact]
public void ThrowsOnNullPredicate()
{
IQueryable<int> source = new[] { 1, 2, 3 }.AsQueryable();
Expression<Func<int, bool>> nullPredicate = null;
AssertExtensions.Throws<ArgumentNullException>("predicate", () => source.TakeWhile(nullPredicate));
}
[Fact]
public void ThrowsOnNullSourceIndexed()
{
IQueryable<int> source = null;
AssertExtensions.Throws<ArgumentNullException>("source", () => source.TakeWhile((x, i) => true));
}
[Fact]
public void ThrowsOnNullPredicateIndexed()
{
IQueryable<int> source = new[] { 1, 2, 3 }.AsQueryable();
Expression<Func<int, int, bool>> nullPredicate = null;
AssertExtensions.Throws<ArgumentNullException>("predicate", () => source.TakeWhile(nullPredicate));
}
[Fact]
public void TakeWhile1()
{
var count = (new int[] { 0, 1, 2 }).AsQueryable().TakeWhile(n => n < 2).Count();
Assert.Equal(2, count);
}
[Fact]
public void TakeWhile2()
{
var count = (new int[] { 0, 1, 2 }).AsQueryable().TakeWhile((n, i) => n + i < 4).Count();
Assert.Equal(2, count);
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Mail/tests/Functional/SmtpClientCredentialsTest.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace System.Net.Mail.Functional.Tests
{
[SkipOnPlatform(TestPlatforms.Browser, "SmtpClient is not supported on Browser")]
public class SmtpClientCredentialsTest
{
private readonly string UserName = "user";
private readonly string Password = Guid.NewGuid().ToString();
[Fact]
public void Credentials_Unset_Null()
{
SmtpClient client = new SmtpClient();
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Null(client.Credentials);
Assert.Null(transportCredentials);
}
[Fact]
public void DefaultCredentials_True_DefaultCredentials()
{
NetworkCredential expectedCredentials = CredentialCache.DefaultNetworkCredentials;
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = true;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
[Fact]
public void UseDefaultCredentials_False_Null()
{
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = false;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Null(client.Credentials);
Assert.Null(transportCredentials);
}
[Fact]
public void Credentials_UseDefaultCredentialsSetFalseBeforeCredentials_Credentials()
{
NetworkCredential expectedCredentials = new NetworkCredential(UserName, Password);
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = false;
client.Credentials = expectedCredentials;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.NotNull(client.Credentials);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
[Fact]
public void Credentials_UseDefaultCredentialsSetFalseAfterCredentials_Credentials()
{
NetworkCredential expectedCredentials = new NetworkCredential(UserName, Password);
SmtpClient client = new SmtpClient();
client.Credentials = expectedCredentials;
client.UseDefaultCredentials = false;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.NotNull(client.Credentials);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
[Fact]
public void Credentials_UseDefaultCredentialsSetTrueBeforeCredentials_DefaultNetworkCredentials()
{
NetworkCredential expectedCredentials = CredentialCache.DefaultNetworkCredentials;
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = true;
client.Credentials = new NetworkCredential(UserName, Password);
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
[Fact]
public void Credentials_UseDefaultCredentialsSetTrueAfterCredentials_DefaultNetworkCredentials()
{
NetworkCredential expectedCredentials = CredentialCache.DefaultNetworkCredentials;
SmtpClient client = new SmtpClient();
client.Credentials = new NetworkCredential(UserName, Password);
client.UseDefaultCredentials = true;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
private ICredentialsByHost GetTransportCredentials(SmtpClient client)
{
Type smtpTransportType = (typeof(SmtpClient)).Assembly.GetType("System.Net.Mail.SmtpTransport");
var transport = typeof(SmtpClient)
.GetField("_transport", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance)
.GetValue(client);
var transportCredentials = smtpTransportType
.GetProperty("Credentials", BindingFlags.NonPublic | BindingFlags.GetProperty | BindingFlags.Instance)
.GetValue(transport);
return (ICredentialsByHost)transportCredentials;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace System.Net.Mail.Functional.Tests
{
[SkipOnPlatform(TestPlatforms.Browser, "SmtpClient is not supported on Browser")]
public class SmtpClientCredentialsTest
{
private readonly string UserName = "user";
private readonly string Password = Guid.NewGuid().ToString();
[Fact]
public void Credentials_Unset_Null()
{
SmtpClient client = new SmtpClient();
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Null(client.Credentials);
Assert.Null(transportCredentials);
}
[Fact]
public void DefaultCredentials_True_DefaultCredentials()
{
NetworkCredential expectedCredentials = CredentialCache.DefaultNetworkCredentials;
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = true;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
[Fact]
public void UseDefaultCredentials_False_Null()
{
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = false;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Null(client.Credentials);
Assert.Null(transportCredentials);
}
[Fact]
public void Credentials_UseDefaultCredentialsSetFalseBeforeCredentials_Credentials()
{
NetworkCredential expectedCredentials = new NetworkCredential(UserName, Password);
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = false;
client.Credentials = expectedCredentials;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.NotNull(client.Credentials);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
[Fact]
public void Credentials_UseDefaultCredentialsSetFalseAfterCredentials_Credentials()
{
NetworkCredential expectedCredentials = new NetworkCredential(UserName, Password);
SmtpClient client = new SmtpClient();
client.Credentials = expectedCredentials;
client.UseDefaultCredentials = false;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.NotNull(client.Credentials);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
[Fact]
public void Credentials_UseDefaultCredentialsSetTrueBeforeCredentials_DefaultNetworkCredentials()
{
NetworkCredential expectedCredentials = CredentialCache.DefaultNetworkCredentials;
SmtpClient client = new SmtpClient();
client.UseDefaultCredentials = true;
client.Credentials = new NetworkCredential(UserName, Password);
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
[Fact]
public void Credentials_UseDefaultCredentialsSetTrueAfterCredentials_DefaultNetworkCredentials()
{
NetworkCredential expectedCredentials = CredentialCache.DefaultNetworkCredentials;
SmtpClient client = new SmtpClient();
client.Credentials = new NetworkCredential(UserName, Password);
client.UseDefaultCredentials = true;
ICredentialsByHost transportCredentials = GetTransportCredentials(client);
Assert.Equal(expectedCredentials, client.Credentials);
Assert.Equal(expectedCredentials, transportCredentials);
}
private ICredentialsByHost GetTransportCredentials(SmtpClient client)
{
Type smtpTransportType = (typeof(SmtpClient)).Assembly.GetType("System.Net.Mail.SmtpTransport");
var transport = typeof(SmtpClient)
.GetField("_transport", BindingFlags.NonPublic | BindingFlags.GetField | BindingFlags.Instance)
.GetValue(client);
var transportCredentials = smtpTransportType
.GetProperty("Credentials", BindingFlags.NonPublic | BindingFlags.GetProperty | BindingFlags.Instance)
.GetValue(transport);
return (ICredentialsByHost)transportCredentials;
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Net.Security/src/System/Net/CertificateValidationPal.OSX.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Win32.SafeHandles;
namespace System.Net
{
internal static partial class CertificateValidationPal
{
internal static SslPolicyErrors VerifyCertificateProperties(
SafeDeleteContext securityContext,
X509Chain chain,
X509Certificate2? remoteCertificate,
bool checkCertName,
bool isServer,
string? hostName)
{
SslPolicyErrors errors = SslPolicyErrors.None;
if (remoteCertificate == null)
{
errors |= SslPolicyErrors.RemoteCertificateNotAvailable;
}
else
{
if (!chain.Build(remoteCertificate))
{
errors |= SslPolicyErrors.RemoteCertificateChainErrors;
}
if (!isServer && checkCertName)
{
SafeDeleteSslContext sslContext = (SafeDeleteSslContext)securityContext;
if (!Interop.AppleCrypto.SslCheckHostnameMatch(sslContext.SslContext, hostName!, remoteCertificate.NotBefore, out int osStatus))
{
errors |= SslPolicyErrors.RemoteCertificateNameMismatch;
if (NetEventSource.Log.IsEnabled())
NetEventSource.Error(sslContext, $"Cert name validation for '{hostName}' failed with status '{osStatus}'");
}
}
}
return errors;
}
//
// Extracts a remote certificate upon request.
//
internal static X509Certificate2? GetRemoteCertificate(SafeDeleteContext securityContext)
{
return GetRemoteCertificate(securityContext, null);
}
internal static X509Certificate2? GetRemoteCertificate(
SafeDeleteContext? securityContext,
out X509Certificate2Collection? remoteCertificateStore)
{
if (securityContext == null)
{
remoteCertificateStore = null;
return null;
}
remoteCertificateStore = new X509Certificate2Collection();
return GetRemoteCertificate(securityContext, remoteCertificateStore);
}
private static X509Certificate2? GetRemoteCertificate(
SafeDeleteContext securityContext,
X509Certificate2Collection? remoteCertificateStore)
{
if (securityContext == null)
{
return null;
}
SafeSslHandle sslContext = ((SafeDeleteSslContext)securityContext).SslContext;
if (sslContext == null)
{
return null;
}
X509Certificate2? result = null;
using (SafeX509ChainHandle chainHandle = Interop.AppleCrypto.SslCopyCertChain(sslContext))
{
long chainSize = Interop.AppleCrypto.X509ChainGetChainSize(chainHandle);
if (remoteCertificateStore != null)
{
for (int i = 0; i < chainSize; i++)
{
IntPtr certHandle = Interop.AppleCrypto.X509ChainGetCertificateAtIndex(chainHandle, i);
remoteCertificateStore.Add(new X509Certificate2(certHandle));
}
}
// This will be a distinct object than remoteCertificateStore[0] (if applicable),
// to match what the Windows and Unix PALs do.
if (chainSize > 0)
{
IntPtr certHandle = Interop.AppleCrypto.X509ChainGetCertificateAtIndex(chainHandle, 0);
result = new X509Certificate2(certHandle);
}
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Log.RemoteCertificate(result);
return result;
}
//
// Used only by client SSL code, never returns null.
//
internal static string[] GetRequestCertificateAuthorities(SafeDeleteContext securityContext)
{
SafeSslHandle sslContext = ((SafeDeleteSslContext)securityContext).SslContext;
if (sslContext == null)
{
return Array.Empty<string>();
}
using (SafeCFArrayHandle dnArray = Interop.AppleCrypto.SslCopyCADistinguishedNames(sslContext))
{
if (dnArray.IsInvalid)
{
return Array.Empty<string>();
}
long size = Interop.CoreFoundation.CFArrayGetCount(dnArray);
if (size == 0)
{
return Array.Empty<string>();
}
string[] distinguishedNames = new string[size];
for (int i = 0; i < size; i++)
{
IntPtr element = Interop.CoreFoundation.CFArrayGetValueAtIndex(dnArray, i);
using (SafeCFDataHandle cfData = new SafeCFDataHandle(element, ownsHandle: false))
{
byte[] dnData = Interop.CoreFoundation.CFGetData(cfData);
X500DistinguishedName dn = new X500DistinguishedName(dnData);
distinguishedNames[i] = dn.Name;
}
}
return distinguishedNames;
}
}
private static X509Store OpenStore(StoreLocation storeLocation)
{
X509Store store = new X509Store(StoreName.My, storeLocation);
store.Open(OpenFlags.ReadOnly);
return store;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Win32.SafeHandles;
namespace System.Net
{
internal static partial class CertificateValidationPal
{
internal static SslPolicyErrors VerifyCertificateProperties(
SafeDeleteContext securityContext,
X509Chain chain,
X509Certificate2? remoteCertificate,
bool checkCertName,
bool isServer,
string? hostName)
{
SslPolicyErrors errors = SslPolicyErrors.None;
if (remoteCertificate == null)
{
errors |= SslPolicyErrors.RemoteCertificateNotAvailable;
}
else
{
if (!chain.Build(remoteCertificate))
{
errors |= SslPolicyErrors.RemoteCertificateChainErrors;
}
if (!isServer && checkCertName)
{
SafeDeleteSslContext sslContext = (SafeDeleteSslContext)securityContext;
if (!Interop.AppleCrypto.SslCheckHostnameMatch(sslContext.SslContext, hostName!, remoteCertificate.NotBefore, out int osStatus))
{
errors |= SslPolicyErrors.RemoteCertificateNameMismatch;
if (NetEventSource.Log.IsEnabled())
NetEventSource.Error(sslContext, $"Cert name validation for '{hostName}' failed with status '{osStatus}'");
}
}
}
return errors;
}
//
// Extracts a remote certificate upon request.
//
internal static X509Certificate2? GetRemoteCertificate(SafeDeleteContext securityContext)
{
return GetRemoteCertificate(securityContext, null);
}
internal static X509Certificate2? GetRemoteCertificate(
SafeDeleteContext? securityContext,
out X509Certificate2Collection? remoteCertificateStore)
{
if (securityContext == null)
{
remoteCertificateStore = null;
return null;
}
remoteCertificateStore = new X509Certificate2Collection();
return GetRemoteCertificate(securityContext, remoteCertificateStore);
}
private static X509Certificate2? GetRemoteCertificate(
SafeDeleteContext securityContext,
X509Certificate2Collection? remoteCertificateStore)
{
if (securityContext == null)
{
return null;
}
SafeSslHandle sslContext = ((SafeDeleteSslContext)securityContext).SslContext;
if (sslContext == null)
{
return null;
}
X509Certificate2? result = null;
using (SafeX509ChainHandle chainHandle = Interop.AppleCrypto.SslCopyCertChain(sslContext))
{
long chainSize = Interop.AppleCrypto.X509ChainGetChainSize(chainHandle);
if (remoteCertificateStore != null)
{
for (int i = 0; i < chainSize; i++)
{
IntPtr certHandle = Interop.AppleCrypto.X509ChainGetCertificateAtIndex(chainHandle, i);
remoteCertificateStore.Add(new X509Certificate2(certHandle));
}
}
// This will be a distinct object than remoteCertificateStore[0] (if applicable),
// to match what the Windows and Unix PALs do.
if (chainSize > 0)
{
IntPtr certHandle = Interop.AppleCrypto.X509ChainGetCertificateAtIndex(chainHandle, 0);
result = new X509Certificate2(certHandle);
}
}
if (NetEventSource.Log.IsEnabled()) NetEventSource.Log.RemoteCertificate(result);
return result;
}
//
// Used only by client SSL code, never returns null.
//
internal static string[] GetRequestCertificateAuthorities(SafeDeleteContext securityContext)
{
SafeSslHandle sslContext = ((SafeDeleteSslContext)securityContext).SslContext;
if (sslContext == null)
{
return Array.Empty<string>();
}
using (SafeCFArrayHandle dnArray = Interop.AppleCrypto.SslCopyCADistinguishedNames(sslContext))
{
if (dnArray.IsInvalid)
{
return Array.Empty<string>();
}
long size = Interop.CoreFoundation.CFArrayGetCount(dnArray);
if (size == 0)
{
return Array.Empty<string>();
}
string[] distinguishedNames = new string[size];
for (int i = 0; i < size; i++)
{
IntPtr element = Interop.CoreFoundation.CFArrayGetValueAtIndex(dnArray, i);
using (SafeCFDataHandle cfData = new SafeCFDataHandle(element, ownsHandle: false))
{
byte[] dnData = Interop.CoreFoundation.CFGetData(cfData);
X500DistinguishedName dn = new X500DistinguishedName(dnData);
distinguishedNames[i] = dn.Name;
}
}
return distinguishedNames;
}
}
private static X509Store OpenStore(StoreLocation storeLocation)
{
X509Store store = new X509Store(StoreName.My, storeLocation);
store.Open(OpenFlags.ReadOnly);
return store;
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/DuplicateToVector64.Single.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void DuplicateToVector64_Single()
{
var test = new DuplicateUnaryOpTest__DuplicateToVector64_Single();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.ReadUnaligned
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.ReadUnaligned
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.ReadUnaligned
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class DuplicateUnaryOpTest__DuplicateToVector64_Single
{
private struct DataTable
{
private byte[] outArray;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Single[] outArray, int alignment)
{
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.outArray = new byte[alignment * 2];
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
}
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Single _fld;
public static TestStruct Create()
{
var testStruct = new TestStruct();
testStruct._fld = TestLibrary.Generator.GetSingle();
return testStruct;
}
public void RunStructFldScenario(DuplicateUnaryOpTest__DuplicateToVector64_Single testClass)
{
var result = AdvSimd.DuplicateToVector64(_fld);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static Single _data;
private static Single _clsVar;
private Single _fld;
private DataTable _dataTable;
static DuplicateUnaryOpTest__DuplicateToVector64_Single()
{
_clsVar = TestLibrary.Generator.GetSingle();
}
public DuplicateUnaryOpTest__DuplicateToVector64_Single()
{
Succeeded = true;
_fld = TestLibrary.Generator.GetSingle();
_data = TestLibrary.Generator.GetSingle();
_dataTable = new DataTable(new Single[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.DuplicateToVector64(
Unsafe.ReadUnaligned<Single>(ref Unsafe.As<Single, byte>(ref _data))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_data, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.DuplicateToVector64), new Type[] { typeof(Single) })
.Invoke(null, new object[] {
Unsafe.ReadUnaligned<Single>(ref Unsafe.As<Single, byte>(ref _data))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_data, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.DuplicateToVector64(
_clsVar
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var data = Unsafe.ReadUnaligned<Single>(ref Unsafe.As<Single, byte>(ref _data));
var result = AdvSimd.DuplicateToVector64(data);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(data, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new DuplicateUnaryOpTest__DuplicateToVector64_Single();
var result = AdvSimd.DuplicateToVector64(test._fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.DuplicateToVector64(_fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.DuplicateToVector64(test._fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Single data, void* result, [CallerMemberName] string method = "")
{
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(data, outArray, method);
}
private void ValidateResult(Single data, Single[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != data)
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != data)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.DuplicateToVector64)}<Single>(Single): DuplicateToVector64 failed:");
TestLibrary.TestFramework.LogInformation($" data: {data}");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void DuplicateToVector64_Single()
{
var test = new DuplicateUnaryOpTest__DuplicateToVector64_Single();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.ReadUnaligned
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.ReadUnaligned
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.ReadUnaligned
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class DuplicateUnaryOpTest__DuplicateToVector64_Single
{
private struct DataTable
{
private byte[] outArray;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Single[] outArray, int alignment)
{
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.outArray = new byte[alignment * 2];
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
}
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Single _fld;
public static TestStruct Create()
{
var testStruct = new TestStruct();
testStruct._fld = TestLibrary.Generator.GetSingle();
return testStruct;
}
public void RunStructFldScenario(DuplicateUnaryOpTest__DuplicateToVector64_Single testClass)
{
var result = AdvSimd.DuplicateToVector64(_fld);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Single>>() / sizeof(Single);
private static Single _data;
private static Single _clsVar;
private Single _fld;
private DataTable _dataTable;
static DuplicateUnaryOpTest__DuplicateToVector64_Single()
{
_clsVar = TestLibrary.Generator.GetSingle();
}
public DuplicateUnaryOpTest__DuplicateToVector64_Single()
{
Succeeded = true;
_fld = TestLibrary.Generator.GetSingle();
_data = TestLibrary.Generator.GetSingle();
_dataTable = new DataTable(new Single[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.DuplicateToVector64(
Unsafe.ReadUnaligned<Single>(ref Unsafe.As<Single, byte>(ref _data))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_data, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.DuplicateToVector64), new Type[] { typeof(Single) })
.Invoke(null, new object[] {
Unsafe.ReadUnaligned<Single>(ref Unsafe.As<Single, byte>(ref _data))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Single>)(result));
ValidateResult(_data, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.DuplicateToVector64(
_clsVar
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var data = Unsafe.ReadUnaligned<Single>(ref Unsafe.As<Single, byte>(ref _data));
var result = AdvSimd.DuplicateToVector64(data);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(data, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new DuplicateUnaryOpTest__DuplicateToVector64_Single();
var result = AdvSimd.DuplicateToVector64(test._fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.DuplicateToVector64(_fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.DuplicateToVector64(test._fld);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Single data, void* result, [CallerMemberName] string method = "")
{
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Single>>());
ValidateResult(data, outArray, method);
}
private void ValidateResult(Single data, Single[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != data)
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != data)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.DuplicateToVector64)}<Single>(Single): DuplicateToVector64 failed:");
TestLibrary.TestFramework.LogInformation($" data: {data}");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlMapping.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.ComponentModel;
using System.Globalization;
using System.Reflection;
using System.Xml.Serialization;
namespace System.Xml.Serialization
{
[Flags]
public enum XmlMappingAccess
{
None = 0x00,
Read = 0x01,
Write = 0x02,
}
///<internalonly/>
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public abstract class XmlMapping
{
private readonly TypeScope? _scope;
private bool _generateSerializer;
private bool _isSoap;
private readonly ElementAccessor _accessor;
private string? _key;
private readonly bool _shallow;
private readonly XmlMappingAccess _access;
internal XmlMapping(TypeScope? scope, ElementAccessor accessor) : this(scope, accessor, XmlMappingAccess.Read | XmlMappingAccess.Write)
{
}
internal XmlMapping(TypeScope? scope, ElementAccessor accessor, XmlMappingAccess access)
{
_scope = scope;
_accessor = accessor;
_access = access;
_shallow = scope == null;
}
internal ElementAccessor Accessor
{
get { return _accessor; }
}
internal TypeScope? Scope
{
get { return _scope; }
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public string ElementName
{
get { return System.Xml.Serialization.Accessor.UnescapeName(Accessor.Name); }
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public string XsdElementName
{
get { return Accessor.Name; }
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public string? Namespace
{
get { return _accessor.Namespace; }
}
internal bool GenerateSerializer
{
get { return _generateSerializer; }
set { _generateSerializer = value; }
}
internal bool IsReadable
{
get { return ((_access & XmlMappingAccess.Read) != 0); }
}
internal bool IsWriteable
{
get { return ((_access & XmlMappingAccess.Write) != 0); }
}
internal bool IsSoap
{
get { return _isSoap; }
set { _isSoap = value; }
}
///<internalonly/>
public void SetKey(string? key)
{
SetKeyInternal(key);
}
///<internalonly/>
internal void SetKeyInternal(string? key)
{
_key = key;
}
internal static string GenerateKey(Type type, XmlRootAttribute? root, string? ns)
{
if (root == null)
{
root = (XmlRootAttribute?)XmlAttributes.GetAttr(type, typeof(XmlRootAttribute));
}
return $"{type.FullName}:{(root == null ? string.Empty : root.GetKey())}:{(ns == null ? string.Empty : ns)}";
}
internal string? Key { get { return _key; } }
internal void CheckShallow()
{
if (_shallow)
{
throw new InvalidOperationException(SR.XmlMelformMapping);
}
}
internal static bool IsShallow(XmlMapping[] mappings)
{
for (int i = 0; i < mappings.Length; i++)
{
if (mappings[i] == null || mappings[i]._shallow)
return true;
}
return false;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.ComponentModel;
using System.Globalization;
using System.Reflection;
using System.Xml.Serialization;
namespace System.Xml.Serialization
{
[Flags]
public enum XmlMappingAccess
{
None = 0x00,
Read = 0x01,
Write = 0x02,
}
///<internalonly/>
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public abstract class XmlMapping
{
private readonly TypeScope? _scope;
private bool _generateSerializer;
private bool _isSoap;
private readonly ElementAccessor _accessor;
private string? _key;
private readonly bool _shallow;
private readonly XmlMappingAccess _access;
internal XmlMapping(TypeScope? scope, ElementAccessor accessor) : this(scope, accessor, XmlMappingAccess.Read | XmlMappingAccess.Write)
{
}
internal XmlMapping(TypeScope? scope, ElementAccessor accessor, XmlMappingAccess access)
{
_scope = scope;
_accessor = accessor;
_access = access;
_shallow = scope == null;
}
internal ElementAccessor Accessor
{
get { return _accessor; }
}
internal TypeScope? Scope
{
get { return _scope; }
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public string ElementName
{
get { return System.Xml.Serialization.Accessor.UnescapeName(Accessor.Name); }
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public string XsdElementName
{
get { return Accessor.Name; }
}
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
public string? Namespace
{
get { return _accessor.Namespace; }
}
internal bool GenerateSerializer
{
get { return _generateSerializer; }
set { _generateSerializer = value; }
}
internal bool IsReadable
{
get { return ((_access & XmlMappingAccess.Read) != 0); }
}
internal bool IsWriteable
{
get { return ((_access & XmlMappingAccess.Write) != 0); }
}
internal bool IsSoap
{
get { return _isSoap; }
set { _isSoap = value; }
}
///<internalonly/>
public void SetKey(string? key)
{
SetKeyInternal(key);
}
///<internalonly/>
internal void SetKeyInternal(string? key)
{
_key = key;
}
internal static string GenerateKey(Type type, XmlRootAttribute? root, string? ns)
{
if (root == null)
{
root = (XmlRootAttribute?)XmlAttributes.GetAttr(type, typeof(XmlRootAttribute));
}
return $"{type.FullName}:{(root == null ? string.Empty : root.GetKey())}:{(ns == null ? string.Empty : ns)}";
}
internal string? Key { get { return _key; } }
internal void CheckShallow()
{
if (_shallow)
{
throw new InvalidOperationException(SR.XmlMelformMapping);
}
}
internal static bool IsShallow(XmlMapping[] mappings)
{
for (int i = 0; i < mappings.Length; i++)
{
if (mappings[i] == null || mappings[i]._shallow)
return true;
}
return false;
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/jit64/valuetypes/nullable/castclass/castclass/castclass003.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="castclass003.cs" />
<Compile Include="..\structdef.cs" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="castclass003.cs" />
<Compile Include="..\structdef.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Security.Cryptography.Xml/src/System/Security/Cryptography/Xml/XmlDsigExcC14NWithCommentsTransform.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Security.Cryptography.Xml
{
// <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
// <ec:InclusiveNamespaces PrefixList="dsig soap #default" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
// </ds:Transform>
public class XmlDsigExcC14NWithCommentsTransform : XmlDsigExcC14NTransform
{
public XmlDsigExcC14NWithCommentsTransform() : base(true)
{
Algorithm = SignedXml.XmlDsigExcC14NWithCommentsTransformUrl;
}
public XmlDsigExcC14NWithCommentsTransform(string inclusiveNamespacesPrefixList) : base(true, inclusiveNamespacesPrefixList)
{
Algorithm = SignedXml.XmlDsigExcC14NWithCommentsTransformUrl;
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Security.Cryptography.Xml
{
// <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
// <ec:InclusiveNamespaces PrefixList="dsig soap #default" xmlns:ec="http://www.w3.org/2001/10/xml-exc-c14n#"/>
// </ds:Transform>
public class XmlDsigExcC14NWithCommentsTransform : XmlDsigExcC14NTransform
{
public XmlDsigExcC14NWithCommentsTransform() : base(true)
{
Algorithm = SignedXml.XmlDsigExcC14NWithCommentsTransformUrl;
}
public XmlDsigExcC14NWithCommentsTransform(string inclusiveNamespacesPrefixList) : base(true, inclusiveNamespacesPrefixList)
{
Algorithm = SignedXml.XmlDsigExcC14NWithCommentsTransformUrl;
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/ECDiffieHellman.Create.SecurityTransforms.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Security.Cryptography
{
public abstract partial class ECDiffieHellman : ECAlgorithm
{
public static new partial ECDiffieHellman Create()
{
return new ECDiffieHellmanImplementation.ECDiffieHellmanSecurityTransforms();
}
public static partial ECDiffieHellman Create(ECCurve curve)
{
ECDiffieHellman ecdh = Create();
try
{
ecdh.GenerateKey(curve);
return ecdh;
}
catch
{
ecdh.Dispose();
throw;
}
}
public static partial ECDiffieHellman Create(ECParameters parameters)
{
ECDiffieHellman ecdh = Create();
try
{
ecdh.ImportParameters(parameters);
return ecdh;
}
catch
{
ecdh.Dispose();
throw;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace System.Security.Cryptography
{
public abstract partial class ECDiffieHellman : ECAlgorithm
{
public static new partial ECDiffieHellman Create()
{
return new ECDiffieHellmanImplementation.ECDiffieHellmanSecurityTransforms();
}
public static partial ECDiffieHellman Create(ECCurve curve)
{
ECDiffieHellman ecdh = Create();
try
{
ecdh.GenerateKey(curve);
return ecdh;
}
catch
{
ecdh.Dispose();
throw;
}
}
public static partial ECDiffieHellman Create(ECParameters parameters)
{
ECDiffieHellman ecdh = Create();
try
{
ecdh.ImportParameters(parameters);
return ecdh;
}
catch
{
ecdh.Dispose();
throw;
}
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Reflection.Emit/tests/PropertyBuilder/PropertyBuilderGetIndexParameters.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.Reflection.Emit.Tests
{
public class PropertyBuilderTest7
{
[Fact]
public void GetIndexParameters_ThrowsNotSupportedException()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Class | TypeAttributes.Public);
PropertyBuilder property = type.DefineProperty("TestProperty", PropertyAttributes.None, typeof(int), null);
MethodBuilder method = type.DefineMethod("TestProperty", MethodAttributes.Public, CallingConventions.HasThis, typeof(int), null);
ILGenerator methodILGenerator = method.GetILGenerator();
methodILGenerator.Emit(OpCodes.Ldarg_0);
methodILGenerator.Emit(OpCodes.Ret);
property.AddOtherMethod(method);
Type myType = type.CreateTypeInfo().AsType();
Assert.Throws<NotSupportedException>(() => property.GetIndexParameters());
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.Reflection.Emit.Tests
{
public class PropertyBuilderTest7
{
[Fact]
public void GetIndexParameters_ThrowsNotSupportedException()
{
TypeBuilder type = Helpers.DynamicType(TypeAttributes.Class | TypeAttributes.Public);
PropertyBuilder property = type.DefineProperty("TestProperty", PropertyAttributes.None, typeof(int), null);
MethodBuilder method = type.DefineMethod("TestProperty", MethodAttributes.Public, CallingConventions.HasThis, typeof(int), null);
ILGenerator methodILGenerator = method.GetILGenerator();
methodILGenerator.Emit(OpCodes.Ldarg_0);
methodILGenerator.Emit(OpCodes.Ret);
property.AddOtherMethod(method);
Type myType = type.CreateTypeInfo().AsType();
Assert.Throws<NotSupportedException>(() => property.GetIndexParameters());
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/Generics/Exceptions/general_struct_instance01.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="general_struct_instance01.cs" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
</PropertyGroup>
<ItemGroup>
<Compile Include="general_struct_instance01.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd.Arm64/MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate.Vector64.Int32.Vector128.Int32.3.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3()
{
var test = new SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] inArray3;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle inHandle3;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int64[] inArray1, Int32[] inArray2, Int32[] inArray3, Int64[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int64>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int64>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.inArray3 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int32, byte>(ref inArray3[0]), (uint)sizeOfinArray3);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
inHandle3.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Int64> _fld1;
public Vector64<Int32> _fld2;
public Vector128<Int32> _fld3;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int64>, byte>(ref testStruct._fld1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3 testClass)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(_fld1, _fld2, _fld3, 3);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3 testClass)
{
fixed (Vector64<Int64>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
fixed (Vector128<Int32>* pFld3 = &_fld3)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int64>>() / sizeof(Int64);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int64>>() / sizeof(Int64);
private static readonly byte Imm = 3;
private static Int64[] _data1 = new Int64[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Int32[] _data3 = new Int32[Op3ElementCount];
private static Vector64<Int64> _clsVar1;
private static Vector64<Int32> _clsVar2;
private static Vector128<Int32> _clsVar3;
private Vector64<Int64> _fld1;
private Vector64<Int32> _fld2;
private Vector128<Int32> _fld3;
private DataTable _dataTable;
static SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int64>, byte>(ref _clsVar1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
}
public SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int64>, byte>(ref _fld1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, _data3, new Int64[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
Unsafe.Read<Vector64<Int64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate), new Type[] { typeof(Vector64<Int64>), typeof(Vector64<Int32>), typeof(Vector128<Int32>), typeof(byte) })
.Invoke(null, new object[] {
Unsafe.Read<Vector64<Int64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr),
(byte)3
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate), new Type[] { typeof(Vector64<Int64>), typeof(Vector64<Int32>), typeof(Vector128<Int32>), typeof(byte) })
.Invoke(null, new object[] {
AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)),
(byte)3
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
_clsVar1,
_clsVar2,
_clsVar3,
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Int64>* pClsVar1 = &_clsVar1)
fixed (Vector64<Int32>* pClsVar2 = &_clsVar2)
fixed (Vector128<Int32>* pClsVar3 = &_clsVar3)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(pClsVar1)),
AdvSimd.LoadVector64((Int32*)(pClsVar2)),
AdvSimd.LoadVector128((Int32*)(pClsVar3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Int64>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
var op3 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr);
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(op1, op2, op3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr));
var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(op1, op2, op3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3();
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(test._fld1, test._fld2, test._fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3();
fixed (Vector64<Int64>* pFld1 = &test._fld1)
fixed (Vector64<Int32>* pFld2 = &test._fld2)
fixed (Vector128<Int32>* pFld3 = &test._fld3)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(_fld1, _fld2, _fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Int64>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
fixed (Vector128<Int32>* pFld3 = &_fld3)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(test._fld1, test._fld2, test._fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(&test._fld1)),
AdvSimd.LoadVector64((Int32*)(&test._fld2)),
AdvSimd.LoadVector128((Int32*)(&test._fld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector64<Int64> op1, Vector64<Int32> op2, Vector128<Int32> op3, void* result, [CallerMemberName] string method = "")
{
Int64[] inArray1 = new Int64[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] inArray3 = new Int32[Op3ElementCount];
Int64[] outArray = new Int64[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), op3);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int64>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "")
{
Int64[] inArray1 = new Int64[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] inArray3 = new Int32[Op3ElementCount];
Int64[] outArray = new Int64[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int64>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(Int64[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int64[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0])
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != 0)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate)}<Int64>(Vector64<Int64>, Vector64<Int32>, Vector128<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})");
TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3()
{
var test = new SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] inArray3;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle inHandle3;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int64[] inArray1, Int32[] inArray2, Int32[] inArray3, Int64[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int64>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray3 = inArray3.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int64>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfinArray3 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.inArray3 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.inHandle3 = GCHandle.Alloc(this.inArray3, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int64, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray3Ptr), ref Unsafe.As<Int32, byte>(ref inArray3[0]), (uint)sizeOfinArray3);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray3Ptr => Align((byte*)(inHandle3.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
inHandle3.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Int64> _fld1;
public Vector64<Int32> _fld2;
public Vector128<Int32> _fld3;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int64>, byte>(ref testStruct._fld1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref testStruct._fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3 testClass)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(_fld1, _fld2, _fld3, 3);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3 testClass)
{
fixed (Vector64<Int64>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
fixed (Vector128<Int32>* pFld3 = &_fld3)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, _fld3, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int64>>() / sizeof(Int64);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op3ElementCount = Unsafe.SizeOf<Vector128<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int64>>() / sizeof(Int64);
private static readonly byte Imm = 3;
private static Int64[] _data1 = new Int64[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Int32[] _data3 = new Int32[Op3ElementCount];
private static Vector64<Int64> _clsVar1;
private static Vector64<Int32> _clsVar2;
private static Vector128<Int32> _clsVar3;
private Vector64<Int64> _fld1;
private Vector64<Int32> _fld2;
private Vector128<Int32> _fld3;
private DataTable _dataTable;
static SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int64>, byte>(ref _clsVar1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _clsVar3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
}
public SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int64>, byte>(ref _fld1), ref Unsafe.As<Int64, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int64>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<Int32>, byte>(ref _fld3), ref Unsafe.As<Int32, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector128<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt64(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, _data3, new Int64[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.Arm64.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
Unsafe.Read<Vector64<Int64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate), new Type[] { typeof(Vector64<Int64>), typeof(Vector64<Int32>), typeof(Vector128<Int32>), typeof(byte) })
.Invoke(null, new object[] {
Unsafe.Read<Vector64<Int64>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr),
Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr),
(byte)3
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd.Arm64).GetMethod(nameof(AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate), new Type[] { typeof(Vector64<Int64>), typeof(Vector64<Int32>), typeof(Vector128<Int32>), typeof(byte) })
.Invoke(null, new object[] {
AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr)),
AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr)),
(byte)3
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int64>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.inArray3Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
_clsVar1,
_clsVar2,
_clsVar3,
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Int64>* pClsVar1 = &_clsVar1)
fixed (Vector64<Int32>* pClsVar2 = &_clsVar2)
fixed (Vector128<Int32>* pClsVar3 = &_clsVar3)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(pClsVar1)),
AdvSimd.LoadVector64((Int32*)(pClsVar2)),
AdvSimd.LoadVector128((Int32*)(pClsVar3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _clsVar3, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Int64>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
var op3 = Unsafe.Read<Vector128<Int32>>(_dataTable.inArray3Ptr);
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(op1, op2, op3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Int64*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr));
var op3 = AdvSimd.LoadVector128((Int32*)(_dataTable.inArray3Ptr));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(op1, op2, op3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, op3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3();
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(test._fld1, test._fld2, test._fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleTernaryOpTest__MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate_Vector64_Int32_Vector128_Int32_3();
fixed (Vector64<Int64>* pFld1 = &test._fld1)
fixed (Vector64<Int32>* pFld2 = &test._fld2)
fixed (Vector128<Int32>* pFld3 = &test._fld3)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(_fld1, _fld2, _fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Int64>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
fixed (Vector128<Int32>* pFld3 = &_fld3)
{
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2)),
AdvSimd.LoadVector128((Int32*)(pFld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _fld3, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(test._fld1, test._fld2, test._fld3, 3);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate(
AdvSimd.LoadVector64((Int64*)(&test._fld1)),
AdvSimd.LoadVector64((Int32*)(&test._fld2)),
AdvSimd.LoadVector128((Int32*)(&test._fld3)),
3
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, test._fld3, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector64<Int64> op1, Vector64<Int32> op2, Vector128<Int32> op3, void* result, [CallerMemberName] string method = "")
{
Int64[] inArray1 = new Int64[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] inArray3 = new Int32[Op3ElementCount];
Int64[] outArray = new Int64[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int64, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), op3);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int64>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* op3, void* result, [CallerMemberName] string method = "")
{
Int64[] inArray1 = new Int64[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] inArray3 = new Int32[Op3ElementCount];
Int64[] outArray = new Int64[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int64>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray3[0]), ref Unsafe.AsRef<byte>(op3), (uint)Unsafe.SizeOf<Vector128<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int64>>());
ValidateResult(inArray1, inArray2, inArray3, outArray, method);
}
private void ValidateResult(Int64[] firstOp, Int32[] secondOp, Int32[] thirdOp, Int64[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (Helpers.MultiplyDoublingWideningAndAddSaturate(firstOp[0], secondOp[0], thirdOp[Imm]) != result[0])
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != 0)
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd.Arm64)}.{nameof(AdvSimd.Arm64.MultiplyDoublingWideningScalarBySelectedScalarAndAddSaturate)}<Int64>(Vector64<Int64>, Vector64<Int32>, Vector128<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" firstOp: ({string.Join(", ", firstOp)})");
TestLibrary.TestFramework.LogInformation($"secondOp: ({string.Join(", ", secondOp)})");
TestLibrary.TestFramework.LogInformation($" thirdOp: ({string.Join(", ", thirdOp)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/ApplicationSettingsBase.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
namespace System.Configuration
{
/// <summary>
/// Base settings class for client applications.
/// </summary>
public abstract class ApplicationSettingsBase : SettingsBase, INotifyPropertyChanged
{
private bool _explicitSerializeOnClass;
private object[] _classAttributes;
private readonly IComponent _owner;
private PropertyChangedEventHandler _onPropertyChanged;
private SettingsContext _context;
private SettingsProperty _init;
private SettingsPropertyCollection _settings;
private SettingsProviderCollection _providers;
private SettingChangingEventHandler _onSettingChanging;
private SettingsLoadedEventHandler _onSettingsLoaded;
private SettingsSavingEventHandler _onSettingsSaving;
private string _settingsKey = string.Empty;
private bool _firstLoad = true;
private bool _initialized;
/// <summary>
/// Default constructor without a concept of "owner" component.
/// </summary>
protected ApplicationSettingsBase() : base()
{
}
/// <summary>
/// Constructor that takes an IComponent. The IComponent acts as the "owner" of this settings class. One
/// of the things we do is query the component's site to see if it has a SettingsProvider service. If it
/// does, we allow it to override the providers specified in the metadata.
/// </summary>
protected ApplicationSettingsBase(IComponent owner) : this(owner, string.Empty)
{
}
/// <summary>
/// Convenience overload that takes the settings key
/// </summary>
protected ApplicationSettingsBase(string settingsKey)
{
_settingsKey = settingsKey;
}
/// <summary>
/// Convenience overload that takes the owner component and settings key.
/// </summary>
protected ApplicationSettingsBase(IComponent owner!!, string settingsKey) : this(settingsKey)
{
_owner = owner;
if (owner.Site != null)
{
ISettingsProviderService providerService = owner.Site.GetService(typeof(ISettingsProviderService)) as ISettingsProviderService;
if (providerService != null)
{
// The component's site has a settings provider service. We pass each SettingsProperty to it
// to see if it wants to override the current provider.
foreach (SettingsProperty property in Properties)
{
SettingsProvider provider = providerService.GetSettingsProvider(property);
if (provider != null)
{
property.Provider = provider;
}
}
ResetProviders();
}
}
}
/// <summary>
/// The Context to pass on to the provider. Currently, this will just contain the settings group name.
/// </summary>
[Browsable(false)]
public override SettingsContext Context
{
get
{
if (_context == null)
{
if (IsSynchronized)
{
lock (this)
{
if (_context == null)
{
_context = new SettingsContext();
EnsureInitialized();
}
}
}
else
{
_context = new SettingsContext();
EnsureInitialized();
}
}
return _context;
}
}
/// <summary>
/// The SettingsBase class queries this to get the collection of SettingsProperty objects. We reflect over
/// the properties defined on the current object's type and use the metadata on those properties to form
/// this collection.
/// </summary>
[Browsable(false)]
public override SettingsPropertyCollection Properties
{
get
{
if (_settings == null)
{
if (IsSynchronized)
{
lock (this)
{
if (_settings == null)
{
_settings = new SettingsPropertyCollection();
EnsureInitialized();
}
}
}
else
{
_settings = new SettingsPropertyCollection();
EnsureInitialized();
}
}
return _settings;
}
}
/// <summary>
/// Just overriding to add attributes.
/// </summary>
[Browsable(false)]
public override SettingsPropertyValueCollection PropertyValues
{
get
{
return base.PropertyValues;
}
}
/// <summary>
/// Provider collection
/// </summary>
[Browsable(false)]
public override SettingsProviderCollection Providers
{
get
{
if (_providers == null)
{
if (IsSynchronized)
{
lock (this)
{
if (_providers == null)
{
_providers = new SettingsProviderCollection();
EnsureInitialized();
}
}
}
else
{
_providers = new SettingsProviderCollection();
EnsureInitialized();
}
}
return _providers;
}
}
/// <summary>
/// Derived classes should use this to uniquely identify separate instances of settings classes.
/// </summary>
[Browsable(false)]
public string SettingsKey
{
get
{
return _settingsKey;
}
set
{
_settingsKey = value;
Context["SettingsKey"] = _settingsKey;
}
}
/// <summary>
/// Fires when the value of a setting is changed. (INotifyPropertyChanged implementation.)
/// </summary>
public event PropertyChangedEventHandler PropertyChanged
{
add
{
_onPropertyChanged += value;
}
remove
{
_onPropertyChanged -= value;
}
}
/// <summary>
/// Fires when the value of a setting is about to change. This is a cancellable event.
/// </summary>
public event SettingChangingEventHandler SettingChanging
{
add
{
_onSettingChanging += value;
}
remove
{
_onSettingChanging -= value;
}
}
/// <summary>
/// Fires when settings are retrieved from a provider. It fires once for each provider.
/// </summary>
public event SettingsLoadedEventHandler SettingsLoaded
{
add
{
_onSettingsLoaded += value;
}
remove
{
_onSettingsLoaded -= value;
}
}
/// <summary>
/// Fires when Save() is called. This is a cancellable event.
/// </summary>
public event SettingsSavingEventHandler SettingsSaving
{
add
{
_onSettingsSaving += value;
}
remove
{
_onSettingsSaving -= value;
}
}
/// <summary>
/// Used in conjunction with Upgrade - retrieves the previous value of a setting from the provider.
/// Provider must implement IApplicationSettingsProvider to support this.
/// </summary>
public object GetPreviousVersion(string propertyName)
{
if (Properties.Count == 0)
throw new SettingsPropertyNotFoundException();
SettingsProperty sp = Properties[propertyName];
SettingsPropertyValue value = null;
if (sp == null)
throw new SettingsPropertyNotFoundException();
IApplicationSettingsProvider clientProv = sp.Provider as IApplicationSettingsProvider;
if (clientProv != null)
{
value = clientProv.GetPreviousVersion(Context, sp);
}
if (value != null)
{
return value.PropertyValue;
}
return null;
}
/// <summary>
/// Fires the PropertyChanged event.
/// </summary>
protected virtual void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
_onPropertyChanged?.Invoke(this, e);
}
/// <summary>
/// Fires the SettingChanging event.
/// </summary>
protected virtual void OnSettingChanging(object sender, SettingChangingEventArgs e)
{
_onSettingChanging?.Invoke(this, e);
}
/// <summary>
/// Fires the SettingsLoaded event.
/// </summary>
protected virtual void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
{
_onSettingsLoaded?.Invoke(this, e);
}
/// <summary>
/// Fires the SettingsSaving event.
/// </summary>
protected virtual void OnSettingsSaving(object sender, CancelEventArgs e)
{
_onSettingsSaving?.Invoke(this, e);
}
/// <summary>
/// Causes a reload to happen on next setting access, by clearing the cached values.
/// </summary>
public void Reload()
{
if (PropertyValues != null)
{
PropertyValues.Clear();
}
foreach (SettingsProperty sp in Properties)
{
PropertyChangedEventArgs pe = new PropertyChangedEventArgs(sp.Name);
OnPropertyChanged(this, pe);
}
}
/// <summary>
/// Calls Reset on the providers.
/// Providers must implement IApplicationSettingsProvider to support this.
/// </summary>
public void Reset()
{
if (Properties != null)
{
foreach (SettingsProvider provider in Providers)
{
IApplicationSettingsProvider clientProv = provider as IApplicationSettingsProvider;
if (clientProv != null)
{
clientProv.Reset(Context);
}
}
}
Reload();
}
/// <summary>
/// Overridden from SettingsBase to support validation event.
/// </summary>
public override void Save()
{
CancelEventArgs e = new CancelEventArgs(false);
OnSettingsSaving(this, e);
if (!e.Cancel)
{
base.Save();
}
}
/// <summary>
/// Overridden from SettingsBase to support validation event.
/// </summary>
public override object this[string propertyName]
{
get
{
if (IsSynchronized)
{
lock (this)
{
return GetPropertyValue(propertyName);
}
}
else
{
return GetPropertyValue(propertyName);
}
}
set
{
SettingChangingEventArgs e = new SettingChangingEventArgs(propertyName, this.GetType().FullName, SettingsKey, value, false);
OnSettingChanging(this, e);
if (!e.Cancel)
{
base[propertyName] = value;
// CONSIDER: Should we call this even if canceled?
PropertyChangedEventArgs pe = new PropertyChangedEventArgs(propertyName);
OnPropertyChanged(this, pe);
}
}
}
/// <summary>
/// Called when the app is upgraded so that we can instruct the providers to upgrade their settings.
/// Providers must implement IApplicationSettingsProvider to support this.
/// </summary>
public virtual void Upgrade()
{
if (Properties != null)
{
foreach (SettingsProvider provider in Providers)
{
IApplicationSettingsProvider clientProv = provider as IApplicationSettingsProvider;
if (clientProv != null)
{
clientProv.Upgrade(Context, GetPropertiesForProvider(provider));
}
}
}
Reload();
}
/// <summary>
/// Creates a SettingsProperty object using the metadata on the given property
/// and returns it.
/// </summary>
private SettingsProperty CreateSetting(PropertyInfo propertyInfo)
{
// Initialization method -
// be careful not to access properties here to prevent stack overflow.
object[] attributes = propertyInfo.GetCustomAttributes(false);
SettingsProperty settingsProperty = new SettingsProperty(Initializer);
bool explicitSerialize = _explicitSerializeOnClass;
settingsProperty.Name = propertyInfo.Name;
settingsProperty.PropertyType = propertyInfo.PropertyType;
for (int i = 0; i < attributes.Length; i++)
{
Attribute attribute = attributes[i] as Attribute;
if (attribute == null)
continue;
if (attribute is DefaultSettingValueAttribute)
{
settingsProperty.DefaultValue = ((DefaultSettingValueAttribute)attribute).Value;
}
else if (attribute is ReadOnlyAttribute)
{
settingsProperty.IsReadOnly = true;
}
else if (attribute is SettingsProviderAttribute)
{
string providerTypeName = ((SettingsProviderAttribute)attribute).ProviderTypeName;
Type providerType = Type.GetType(providerTypeName);
if (providerType == null)
{
throw new ConfigurationErrorsException(SR.Format(SR.ProviderTypeLoadFailed, providerTypeName));
}
SettingsProvider settingsProvider = TypeUtil.CreateInstance(providerType) as SettingsProvider;
if (settingsProvider == null)
{
throw new ConfigurationErrorsException(SR.Format(SR.ProviderInstantiationFailed, providerTypeName));
}
settingsProvider.Initialize(null, null);
settingsProvider.ApplicationName = ConfigurationManagerInternalFactory.Instance.ExeProductName;
// See if we already have a provider of the same name in our collection. If so,
// re-use the existing instance, since we cannot have multiple providers of the same name.
SettingsProvider existing = _providers[settingsProvider.Name];
if (existing != null)
{
settingsProvider = existing;
}
settingsProperty.Provider = settingsProvider;
}
else if (attribute is SettingsSerializeAsAttribute)
{
settingsProperty.SerializeAs = ((SettingsSerializeAsAttribute)attribute).SerializeAs;
explicitSerialize = true;
}
else
{
// This isn't an attribute we care about, so simply pass it on
// to the SettingsProvider.
//
// NOTE: The key is the type. So if an attribute was found at class
// level and also property level, the latter overrides the former
// for a given setting. This is exactly the behavior we want.
settingsProperty.Attributes[attribute.GetType()] = attribute;
}
}
if (!explicitSerialize)
{
// Serialization method was not explicitly attributed.
TypeConverter tc = TypeDescriptor.GetConverter(propertyInfo.PropertyType);
if (tc.CanConvertTo(typeof(string)) && tc.CanConvertFrom(typeof(string)))
{
// We can use string
settingsProperty.SerializeAs = SettingsSerializeAs.String;
}
else
{
// Fallback is Xml
settingsProperty.SerializeAs = SettingsSerializeAs.Xml;
}
}
return settingsProperty;
}
/// <summary>
/// Ensures this class is initialized. Initialization involves reflecting over properties and building
/// a list of SettingsProperty's.
/// </summary>
private void EnsureInitialized()
{
// Initialization method -
// be careful not to access properties here to prevent stack overflow.
if (!_initialized)
{
_initialized = true;
Type type = GetType();
if (_context == null)
{
_context = new SettingsContext();
}
_context["GroupName"] = type.FullName;
_context["SettingsKey"] = SettingsKey;
_context["SettingsClassType"] = type;
PropertyInfo[] properties = SettingsFilter(type.GetProperties(BindingFlags.Instance | BindingFlags.Public));
_classAttributes = type.GetCustomAttributes(false);
if (_settings == null)
{
_settings = new SettingsPropertyCollection();
}
if (_providers == null)
{
_providers = new SettingsProviderCollection();
}
for (int i = 0; i < properties.Length; i++)
{
SettingsProperty sp = CreateSetting(properties[i]);
if (sp != null)
{
_settings.Add(sp);
if (sp.Provider != null && _providers[sp.Provider.Name] == null)
{
_providers.Add(sp.Provider);
}
}
}
}
}
/// <summary>
/// Returns a SettingsProperty used to initialize settings. We initialize a setting with values
/// derived from class level attributes, if present. Otherwise, we initialize to
/// reasonable defaults.
/// </summary>
private SettingsProperty Initializer
{
// Initialization method -
// be careful not to access properties here to prevent stack overflow.
get
{
if (_init == null)
{
_init = new SettingsProperty("");
_init.DefaultValue = null;
_init.IsReadOnly = false;
_init.PropertyType = null;
SettingsProvider provider = new LocalFileSettingsProvider();
if (_classAttributes != null)
{
for (int i = 0; i < _classAttributes.Length; i++)
{
Attribute attr = _classAttributes[i] as Attribute;
if (attr != null)
{
if (attr is ReadOnlyAttribute)
{
_init.IsReadOnly = true;
}
else if (attr is SettingsGroupNameAttribute)
{
if (_context == null)
{
_context = new SettingsContext();
}
_context["GroupName"] = ((SettingsGroupNameAttribute)attr).GroupName;
}
else if (attr is SettingsProviderAttribute)
{
string providerTypeName = ((SettingsProviderAttribute)attr).ProviderTypeName;
Type providerType = Type.GetType(providerTypeName);
if (providerType != null)
{
SettingsProvider spdr = TypeUtil.CreateInstance(providerType) as SettingsProvider;
if (spdr != null)
{
provider = spdr;
}
else
{
throw new ConfigurationErrorsException(SR.Format(SR.ProviderInstantiationFailed, providerTypeName));
}
}
else
{
throw new ConfigurationErrorsException(SR.Format(SR.ProviderTypeLoadFailed, providerTypeName));
}
}
else if (attr is SettingsSerializeAsAttribute)
{
_init.SerializeAs = ((SettingsSerializeAsAttribute)attr).SerializeAs;
_explicitSerializeOnClass = true;
}
else
{
// This isn't an attribute we care about, so simply pass it on
// to the SettingsProvider.
// NOTE: The key is the type. So if an attribute was found at class
// level and also property level, the latter overrides the former
// for a given setting. This is exactly the behavior we want.
_init.Attributes.Add(attr.GetType(), attr);
}
}
}
}
//Initialize the SettingsProvider
provider.Initialize(null, null);
provider.ApplicationName = ConfigurationManagerInternalFactory.Instance.ExeProductName;
_init.Provider = provider;
}
return _init;
}
}
/// <summary>
/// Gets all the settings properties for this provider.
/// </summary>
private SettingsPropertyCollection GetPropertiesForProvider(SettingsProvider provider)
{
SettingsPropertyCollection properties = new SettingsPropertyCollection();
foreach (SettingsProperty sp in Properties)
{
if (sp.Provider == provider)
{
properties.Add(sp);
}
}
return properties;
}
/// <summary>
/// Retrieves the value of a setting. We need this method so we can fire the SettingsLoaded event
/// when settings are loaded from the providers.Ideally, this should be fired from SettingsBase,
/// but unfortunately that will not happen in Whidbey. Instead, we check to see if the value has already
/// been retrieved. If not, we fire the load event, since we expect SettingsBase to load all the settings
/// from this setting's provider.
/// </summary>
private object GetPropertyValue(string propertyName)
{
if (PropertyValues[propertyName] == null)
{
// If this is our first load and we are part of a Clickonce app, call Upgrade.
if (_firstLoad)
{
_firstLoad = false;
if (IsFirstRunOfClickOnceApp())
{
Upgrade();
}
}
// we query the value first so that we initialize all values from value providers and so that we don't end up
// on an infinite recursion when calling Properties[propertyName] as that calls this.
_ = base[propertyName];
SettingsProperty setting = Properties[propertyName];
SettingsProvider provider = setting != null ? setting.Provider : null;
Debug.Assert(provider != null, "Could not determine provider from which settings were loaded");
SettingsLoadedEventArgs e = new SettingsLoadedEventArgs(provider);
OnSettingsLoaded(this, e);
// Note: we need to requery the value here in case someone changed it while
// handling SettingsLoaded.
return base[propertyName];
}
else
{
return base[propertyName];
}
}
/// <summary>
/// Returns true if this is a clickonce deployed app and this is the first run of the app
/// since deployment or last upgrade.
/// </summary>
private bool IsFirstRunOfClickOnceApp()
{
// Always false for .NET Core
return false;
}
/// <summary>
/// Returns true if this is a clickonce deployed app.
/// </summary>
internal static bool IsClickOnceDeployed(AppDomain appDomain)
{
// Always false for .NET Core
return false;
}
/// <summary>
/// Only those settings class properties that have a SettingAttribute on them are
/// treated as settings. This routine filters out other properties.
/// </summary>
private PropertyInfo[] SettingsFilter(PropertyInfo[] allProps)
{
var settingProps = new List<PropertyInfo>();
object[] attributes;
Attribute attr;
for (int i = 0; i < allProps.Length; i++)
{
attributes = allProps[i].GetCustomAttributes(false);
for (int j = 0; j < attributes.Length; j++)
{
attr = attributes[j] as Attribute;
if (attr is SettingAttribute)
{
settingProps.Add(allProps[i]);
break;
}
}
}
return settingProps.ToArray();
}
/// <summary>
/// Resets the provider collection. This needs to be called when providers change after
/// first being set.
/// </summary>
private void ResetProviders()
{
Providers.Clear();
foreach (SettingsProperty sp in Properties)
{
if (Providers[sp.Provider.Name] == null)
{
Providers.Add(sp.Provider);
}
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Reflection;
namespace System.Configuration
{
/// <summary>
/// Base settings class for client applications.
/// </summary>
public abstract class ApplicationSettingsBase : SettingsBase, INotifyPropertyChanged
{
private bool _explicitSerializeOnClass;
private object[] _classAttributes;
private readonly IComponent _owner;
private PropertyChangedEventHandler _onPropertyChanged;
private SettingsContext _context;
private SettingsProperty _init;
private SettingsPropertyCollection _settings;
private SettingsProviderCollection _providers;
private SettingChangingEventHandler _onSettingChanging;
private SettingsLoadedEventHandler _onSettingsLoaded;
private SettingsSavingEventHandler _onSettingsSaving;
private string _settingsKey = string.Empty;
private bool _firstLoad = true;
private bool _initialized;
/// <summary>
/// Default constructor without a concept of "owner" component.
/// </summary>
protected ApplicationSettingsBase() : base()
{
}
/// <summary>
/// Constructor that takes an IComponent. The IComponent acts as the "owner" of this settings class. One
/// of the things we do is query the component's site to see if it has a SettingsProvider service. If it
/// does, we allow it to override the providers specified in the metadata.
/// </summary>
protected ApplicationSettingsBase(IComponent owner) : this(owner, string.Empty)
{
}
/// <summary>
/// Convenience overload that takes the settings key
/// </summary>
protected ApplicationSettingsBase(string settingsKey)
{
_settingsKey = settingsKey;
}
/// <summary>
/// Convenience overload that takes the owner component and settings key.
/// </summary>
protected ApplicationSettingsBase(IComponent owner!!, string settingsKey) : this(settingsKey)
{
_owner = owner;
if (owner.Site != null)
{
ISettingsProviderService providerService = owner.Site.GetService(typeof(ISettingsProviderService)) as ISettingsProviderService;
if (providerService != null)
{
// The component's site has a settings provider service. We pass each SettingsProperty to it
// to see if it wants to override the current provider.
foreach (SettingsProperty property in Properties)
{
SettingsProvider provider = providerService.GetSettingsProvider(property);
if (provider != null)
{
property.Provider = provider;
}
}
ResetProviders();
}
}
}
/// <summary>
/// The Context to pass on to the provider. Currently, this will just contain the settings group name.
/// </summary>
[Browsable(false)]
public override SettingsContext Context
{
get
{
if (_context == null)
{
if (IsSynchronized)
{
lock (this)
{
if (_context == null)
{
_context = new SettingsContext();
EnsureInitialized();
}
}
}
else
{
_context = new SettingsContext();
EnsureInitialized();
}
}
return _context;
}
}
/// <summary>
/// The SettingsBase class queries this to get the collection of SettingsProperty objects. We reflect over
/// the properties defined on the current object's type and use the metadata on those properties to form
/// this collection.
/// </summary>
[Browsable(false)]
public override SettingsPropertyCollection Properties
{
get
{
if (_settings == null)
{
if (IsSynchronized)
{
lock (this)
{
if (_settings == null)
{
_settings = new SettingsPropertyCollection();
EnsureInitialized();
}
}
}
else
{
_settings = new SettingsPropertyCollection();
EnsureInitialized();
}
}
return _settings;
}
}
/// <summary>
/// Just overriding to add attributes.
/// </summary>
[Browsable(false)]
public override SettingsPropertyValueCollection PropertyValues
{
get
{
return base.PropertyValues;
}
}
/// <summary>
/// Provider collection
/// </summary>
[Browsable(false)]
public override SettingsProviderCollection Providers
{
get
{
if (_providers == null)
{
if (IsSynchronized)
{
lock (this)
{
if (_providers == null)
{
_providers = new SettingsProviderCollection();
EnsureInitialized();
}
}
}
else
{
_providers = new SettingsProviderCollection();
EnsureInitialized();
}
}
return _providers;
}
}
/// <summary>
/// Derived classes should use this to uniquely identify separate instances of settings classes.
/// </summary>
[Browsable(false)]
public string SettingsKey
{
get
{
return _settingsKey;
}
set
{
_settingsKey = value;
Context["SettingsKey"] = _settingsKey;
}
}
/// <summary>
/// Fires when the value of a setting is changed. (INotifyPropertyChanged implementation.)
/// </summary>
public event PropertyChangedEventHandler PropertyChanged
{
add
{
_onPropertyChanged += value;
}
remove
{
_onPropertyChanged -= value;
}
}
/// <summary>
/// Fires when the value of a setting is about to change. This is a cancellable event.
/// </summary>
public event SettingChangingEventHandler SettingChanging
{
add
{
_onSettingChanging += value;
}
remove
{
_onSettingChanging -= value;
}
}
/// <summary>
/// Fires when settings are retrieved from a provider. It fires once for each provider.
/// </summary>
public event SettingsLoadedEventHandler SettingsLoaded
{
add
{
_onSettingsLoaded += value;
}
remove
{
_onSettingsLoaded -= value;
}
}
/// <summary>
/// Fires when Save() is called. This is a cancellable event.
/// </summary>
public event SettingsSavingEventHandler SettingsSaving
{
add
{
_onSettingsSaving += value;
}
remove
{
_onSettingsSaving -= value;
}
}
/// <summary>
/// Used in conjunction with Upgrade - retrieves the previous value of a setting from the provider.
/// Provider must implement IApplicationSettingsProvider to support this.
/// </summary>
public object GetPreviousVersion(string propertyName)
{
if (Properties.Count == 0)
throw new SettingsPropertyNotFoundException();
SettingsProperty sp = Properties[propertyName];
SettingsPropertyValue value = null;
if (sp == null)
throw new SettingsPropertyNotFoundException();
IApplicationSettingsProvider clientProv = sp.Provider as IApplicationSettingsProvider;
if (clientProv != null)
{
value = clientProv.GetPreviousVersion(Context, sp);
}
if (value != null)
{
return value.PropertyValue;
}
return null;
}
/// <summary>
/// Fires the PropertyChanged event.
/// </summary>
protected virtual void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
{
_onPropertyChanged?.Invoke(this, e);
}
/// <summary>
/// Fires the SettingChanging event.
/// </summary>
protected virtual void OnSettingChanging(object sender, SettingChangingEventArgs e)
{
_onSettingChanging?.Invoke(this, e);
}
/// <summary>
/// Fires the SettingsLoaded event.
/// </summary>
protected virtual void OnSettingsLoaded(object sender, SettingsLoadedEventArgs e)
{
_onSettingsLoaded?.Invoke(this, e);
}
/// <summary>
/// Fires the SettingsSaving event.
/// </summary>
protected virtual void OnSettingsSaving(object sender, CancelEventArgs e)
{
_onSettingsSaving?.Invoke(this, e);
}
/// <summary>
/// Causes a reload to happen on next setting access, by clearing the cached values.
/// </summary>
public void Reload()
{
if (PropertyValues != null)
{
PropertyValues.Clear();
}
foreach (SettingsProperty sp in Properties)
{
PropertyChangedEventArgs pe = new PropertyChangedEventArgs(sp.Name);
OnPropertyChanged(this, pe);
}
}
/// <summary>
/// Calls Reset on the providers.
/// Providers must implement IApplicationSettingsProvider to support this.
/// </summary>
public void Reset()
{
if (Properties != null)
{
foreach (SettingsProvider provider in Providers)
{
IApplicationSettingsProvider clientProv = provider as IApplicationSettingsProvider;
if (clientProv != null)
{
clientProv.Reset(Context);
}
}
}
Reload();
}
/// <summary>
/// Overridden from SettingsBase to support validation event.
/// </summary>
public override void Save()
{
CancelEventArgs e = new CancelEventArgs(false);
OnSettingsSaving(this, e);
if (!e.Cancel)
{
base.Save();
}
}
/// <summary>
/// Overridden from SettingsBase to support validation event.
/// </summary>
public override object this[string propertyName]
{
get
{
if (IsSynchronized)
{
lock (this)
{
return GetPropertyValue(propertyName);
}
}
else
{
return GetPropertyValue(propertyName);
}
}
set
{
SettingChangingEventArgs e = new SettingChangingEventArgs(propertyName, this.GetType().FullName, SettingsKey, value, false);
OnSettingChanging(this, e);
if (!e.Cancel)
{
base[propertyName] = value;
// CONSIDER: Should we call this even if canceled?
PropertyChangedEventArgs pe = new PropertyChangedEventArgs(propertyName);
OnPropertyChanged(this, pe);
}
}
}
/// <summary>
/// Called when the app is upgraded so that we can instruct the providers to upgrade their settings.
/// Providers must implement IApplicationSettingsProvider to support this.
/// </summary>
public virtual void Upgrade()
{
if (Properties != null)
{
foreach (SettingsProvider provider in Providers)
{
IApplicationSettingsProvider clientProv = provider as IApplicationSettingsProvider;
if (clientProv != null)
{
clientProv.Upgrade(Context, GetPropertiesForProvider(provider));
}
}
}
Reload();
}
/// <summary>
/// Creates a SettingsProperty object using the metadata on the given property
/// and returns it.
/// </summary>
private SettingsProperty CreateSetting(PropertyInfo propertyInfo)
{
// Initialization method -
// be careful not to access properties here to prevent stack overflow.
object[] attributes = propertyInfo.GetCustomAttributes(false);
SettingsProperty settingsProperty = new SettingsProperty(Initializer);
bool explicitSerialize = _explicitSerializeOnClass;
settingsProperty.Name = propertyInfo.Name;
settingsProperty.PropertyType = propertyInfo.PropertyType;
for (int i = 0; i < attributes.Length; i++)
{
Attribute attribute = attributes[i] as Attribute;
if (attribute == null)
continue;
if (attribute is DefaultSettingValueAttribute)
{
settingsProperty.DefaultValue = ((DefaultSettingValueAttribute)attribute).Value;
}
else if (attribute is ReadOnlyAttribute)
{
settingsProperty.IsReadOnly = true;
}
else if (attribute is SettingsProviderAttribute)
{
string providerTypeName = ((SettingsProviderAttribute)attribute).ProviderTypeName;
Type providerType = Type.GetType(providerTypeName);
if (providerType == null)
{
throw new ConfigurationErrorsException(SR.Format(SR.ProviderTypeLoadFailed, providerTypeName));
}
SettingsProvider settingsProvider = TypeUtil.CreateInstance(providerType) as SettingsProvider;
if (settingsProvider == null)
{
throw new ConfigurationErrorsException(SR.Format(SR.ProviderInstantiationFailed, providerTypeName));
}
settingsProvider.Initialize(null, null);
settingsProvider.ApplicationName = ConfigurationManagerInternalFactory.Instance.ExeProductName;
// See if we already have a provider of the same name in our collection. If so,
// re-use the existing instance, since we cannot have multiple providers of the same name.
SettingsProvider existing = _providers[settingsProvider.Name];
if (existing != null)
{
settingsProvider = existing;
}
settingsProperty.Provider = settingsProvider;
}
else if (attribute is SettingsSerializeAsAttribute)
{
settingsProperty.SerializeAs = ((SettingsSerializeAsAttribute)attribute).SerializeAs;
explicitSerialize = true;
}
else
{
// This isn't an attribute we care about, so simply pass it on
// to the SettingsProvider.
//
// NOTE: The key is the type. So if an attribute was found at class
// level and also property level, the latter overrides the former
// for a given setting. This is exactly the behavior we want.
settingsProperty.Attributes[attribute.GetType()] = attribute;
}
}
if (!explicitSerialize)
{
// Serialization method was not explicitly attributed.
TypeConverter tc = TypeDescriptor.GetConverter(propertyInfo.PropertyType);
if (tc.CanConvertTo(typeof(string)) && tc.CanConvertFrom(typeof(string)))
{
// We can use string
settingsProperty.SerializeAs = SettingsSerializeAs.String;
}
else
{
// Fallback is Xml
settingsProperty.SerializeAs = SettingsSerializeAs.Xml;
}
}
return settingsProperty;
}
/// <summary>
/// Ensures this class is initialized. Initialization involves reflecting over properties and building
/// a list of SettingsProperty's.
/// </summary>
private void EnsureInitialized()
{
// Initialization method -
// be careful not to access properties here to prevent stack overflow.
if (!_initialized)
{
_initialized = true;
Type type = GetType();
if (_context == null)
{
_context = new SettingsContext();
}
_context["GroupName"] = type.FullName;
_context["SettingsKey"] = SettingsKey;
_context["SettingsClassType"] = type;
PropertyInfo[] properties = SettingsFilter(type.GetProperties(BindingFlags.Instance | BindingFlags.Public));
_classAttributes = type.GetCustomAttributes(false);
if (_settings == null)
{
_settings = new SettingsPropertyCollection();
}
if (_providers == null)
{
_providers = new SettingsProviderCollection();
}
for (int i = 0; i < properties.Length; i++)
{
SettingsProperty sp = CreateSetting(properties[i]);
if (sp != null)
{
_settings.Add(sp);
if (sp.Provider != null && _providers[sp.Provider.Name] == null)
{
_providers.Add(sp.Provider);
}
}
}
}
}
/// <summary>
/// Returns a SettingsProperty used to initialize settings. We initialize a setting with values
/// derived from class level attributes, if present. Otherwise, we initialize to
/// reasonable defaults.
/// </summary>
private SettingsProperty Initializer
{
// Initialization method -
// be careful not to access properties here to prevent stack overflow.
get
{
if (_init == null)
{
_init = new SettingsProperty("");
_init.DefaultValue = null;
_init.IsReadOnly = false;
_init.PropertyType = null;
SettingsProvider provider = new LocalFileSettingsProvider();
if (_classAttributes != null)
{
for (int i = 0; i < _classAttributes.Length; i++)
{
Attribute attr = _classAttributes[i] as Attribute;
if (attr != null)
{
if (attr is ReadOnlyAttribute)
{
_init.IsReadOnly = true;
}
else if (attr is SettingsGroupNameAttribute)
{
if (_context == null)
{
_context = new SettingsContext();
}
_context["GroupName"] = ((SettingsGroupNameAttribute)attr).GroupName;
}
else if (attr is SettingsProviderAttribute)
{
string providerTypeName = ((SettingsProviderAttribute)attr).ProviderTypeName;
Type providerType = Type.GetType(providerTypeName);
if (providerType != null)
{
SettingsProvider spdr = TypeUtil.CreateInstance(providerType) as SettingsProvider;
if (spdr != null)
{
provider = spdr;
}
else
{
throw new ConfigurationErrorsException(SR.Format(SR.ProviderInstantiationFailed, providerTypeName));
}
}
else
{
throw new ConfigurationErrorsException(SR.Format(SR.ProviderTypeLoadFailed, providerTypeName));
}
}
else if (attr is SettingsSerializeAsAttribute)
{
_init.SerializeAs = ((SettingsSerializeAsAttribute)attr).SerializeAs;
_explicitSerializeOnClass = true;
}
else
{
// This isn't an attribute we care about, so simply pass it on
// to the SettingsProvider.
// NOTE: The key is the type. So if an attribute was found at class
// level and also property level, the latter overrides the former
// for a given setting. This is exactly the behavior we want.
_init.Attributes.Add(attr.GetType(), attr);
}
}
}
}
//Initialize the SettingsProvider
provider.Initialize(null, null);
provider.ApplicationName = ConfigurationManagerInternalFactory.Instance.ExeProductName;
_init.Provider = provider;
}
return _init;
}
}
/// <summary>
/// Gets all the settings properties for this provider.
/// </summary>
private SettingsPropertyCollection GetPropertiesForProvider(SettingsProvider provider)
{
SettingsPropertyCollection properties = new SettingsPropertyCollection();
foreach (SettingsProperty sp in Properties)
{
if (sp.Provider == provider)
{
properties.Add(sp);
}
}
return properties;
}
/// <summary>
/// Retrieves the value of a setting. We need this method so we can fire the SettingsLoaded event
/// when settings are loaded from the providers.Ideally, this should be fired from SettingsBase,
/// but unfortunately that will not happen in Whidbey. Instead, we check to see if the value has already
/// been retrieved. If not, we fire the load event, since we expect SettingsBase to load all the settings
/// from this setting's provider.
/// </summary>
private object GetPropertyValue(string propertyName)
{
if (PropertyValues[propertyName] == null)
{
// If this is our first load and we are part of a Clickonce app, call Upgrade.
if (_firstLoad)
{
_firstLoad = false;
if (IsFirstRunOfClickOnceApp())
{
Upgrade();
}
}
// we query the value first so that we initialize all values from value providers and so that we don't end up
// on an infinite recursion when calling Properties[propertyName] as that calls this.
_ = base[propertyName];
SettingsProperty setting = Properties[propertyName];
SettingsProvider provider = setting != null ? setting.Provider : null;
Debug.Assert(provider != null, "Could not determine provider from which settings were loaded");
SettingsLoadedEventArgs e = new SettingsLoadedEventArgs(provider);
OnSettingsLoaded(this, e);
// Note: we need to requery the value here in case someone changed it while
// handling SettingsLoaded.
return base[propertyName];
}
else
{
return base[propertyName];
}
}
/// <summary>
/// Returns true if this is a clickonce deployed app and this is the first run of the app
/// since deployment or last upgrade.
/// </summary>
private bool IsFirstRunOfClickOnceApp()
{
// Always false for .NET Core
return false;
}
/// <summary>
/// Returns true if this is a clickonce deployed app.
/// </summary>
internal static bool IsClickOnceDeployed(AppDomain appDomain)
{
// Always false for .NET Core
return false;
}
/// <summary>
/// Only those settings class properties that have a SettingAttribute on them are
/// treated as settings. This routine filters out other properties.
/// </summary>
private PropertyInfo[] SettingsFilter(PropertyInfo[] allProps)
{
var settingProps = new List<PropertyInfo>();
object[] attributes;
Attribute attr;
for (int i = 0; i < allProps.Length; i++)
{
attributes = allProps[i].GetCustomAttributes(false);
for (int j = 0; j < attributes.Length; j++)
{
attr = attributes[j] as Attribute;
if (attr is SettingAttribute)
{
settingProps.Add(allProps[i]);
break;
}
}
}
return settingProps.ToArray();
}
/// <summary>
/// Resets the provider collection. This needs to be called when providers change after
/// first being set.
/// </summary>
private void ResetProviders()
{
Providers.Clear();
foreach (SettingsProperty sp in Properties)
{
if (Providers[sp.Provider.Name] == null)
{
Providers.Add(sp.Provider);
}
}
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/mono/mono/tests/metadata-verifier/assembly-with-params.cs
|
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.ComponentModel;
public class SimpleArgs
{
public static int DefaultParam ([DefaultParameterValue (99)] int a, int b) { return 0; }
[DllImport ("foo.so")]
public static extern void MarshalParam ([MarshalAs (UnmanagedType.LPWStr)] string a);
}
public class LastClass
{
public static void Main ()
{
}
}
|
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.ComponentModel;
public class SimpleArgs
{
public static int DefaultParam ([DefaultParameterValue (99)] int a, int b) { return 0; }
[DllImport ("foo.so")]
public static extern void MarshalParam ([MarshalAs (UnmanagedType.LPWStr)] string a);
}
public class LastClass
{
public static void Main ()
{
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/Common/src/Interop/OSX/Interop.libc.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class @libc
{
[StructLayout(LayoutKind.Sequential)]
internal struct AttrList
{
public ushort bitmapCount;
public ushort reserved;
public uint commonAttr;
public uint volAttr;
public uint dirAttr;
public uint fileAttr;
public uint forkAttr;
public const ushort ATTR_BIT_MAP_COUNT = 5;
public const uint ATTR_CMN_CRTIME = 0x00000200;
}
[GeneratedDllImport(Libraries.libc, EntryPoint = "setattrlist", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static unsafe partial int setattrlist(string path, AttrList* attrList, void* attrBuf, nint attrBufSize, CULong options);
internal const uint FSOPT_NOFOLLOW = 0x00000001;
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Runtime.InteropServices;
internal static partial class Interop
{
internal static partial class @libc
{
[StructLayout(LayoutKind.Sequential)]
internal struct AttrList
{
public ushort bitmapCount;
public ushort reserved;
public uint commonAttr;
public uint volAttr;
public uint dirAttr;
public uint fileAttr;
public uint forkAttr;
public const ushort ATTR_BIT_MAP_COUNT = 5;
public const uint ATTR_CMN_CRTIME = 0x00000200;
}
[GeneratedDllImport(Libraries.libc, EntryPoint = "setattrlist", StringMarshalling = StringMarshalling.Utf8, SetLastError = true)]
internal static unsafe partial int setattrlist(string path, AttrList* attrList, void* attrBuf, nint attrBufSize, CULong options);
internal const uint FSOPT_NOFOLLOW = 0x00000001;
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/HardwareIntrinsics/General/Vector256_1/op_Multiply.Single.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void op_MultiplySingle()
{
var test = new VectorBinaryOpTest__op_MultiplySingle();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__op_MultiplySingle
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Single>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Single, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector256<Single> _fld1;
public Vector256<Single> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref testStruct._fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplySingle testClass)
{
var result = _fld1 * _fld2;
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 32;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector256<Single>>() / sizeof(Single);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector256<Single>>() / sizeof(Single);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector256<Single>>() / sizeof(Single);
private static Single[] _data1 = new Single[Op1ElementCount];
private static Single[] _data2 = new Single[Op2ElementCount];
private static Vector256<Single> _clsVar1;
private static Vector256<Single> _clsVar2;
private Vector256<Single> _fld1;
private Vector256<Single> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__op_MultiplySingle()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
}
public VectorBinaryOpTest__op_MultiplySingle()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
_dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Unsafe.Read<Vector256<Single>>(_dataTable.inArray1Ptr) * Unsafe.Read<Vector256<Single>>(_dataTable.inArray2Ptr);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Vector256<Single>).GetMethod("op_Multiply", new Type[] { typeof(Vector256<Single>), typeof(Vector256<Single>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector256<Single>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector256<Single>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector256<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = _clsVar1 * _clsVar2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector256<Single>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector256<Single>>(_dataTable.inArray2Ptr);
var result = op1 * op2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__op_MultiplySingle();
var result = test._fld1 * test._fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = _fld1 * _fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = test._fld1 * test._fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector256<Single> op1, Vector256<Single> op2, void* result, [CallerMemberName] string method = "")
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] inArray2 = new Single[Op2ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Single>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] inArray2 = new Single[Op2ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector256<Single>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector256<Single>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Single>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (float)(left[0] * right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (float)(left[i] * right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector256)}.op_Multiply<Single>(Vector256<Single>, Vector256<Single>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void op_MultiplySingle()
{
var test = new VectorBinaryOpTest__op_MultiplySingle();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__op_MultiplySingle
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Single[] inArray1, Single[] inArray2, Single[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Single>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Single>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Single>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Single, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Single, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector256<Single> _fld1;
public Vector256<Single> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref testStruct._fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__op_MultiplySingle testClass)
{
var result = _fld1 * _fld2;
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 32;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector256<Single>>() / sizeof(Single);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector256<Single>>() / sizeof(Single);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector256<Single>>() / sizeof(Single);
private static Single[] _data1 = new Single[Op1ElementCount];
private static Single[] _data2 = new Single[Op2ElementCount];
private static Vector256<Single> _clsVar1;
private static Vector256<Single> _clsVar2;
private Vector256<Single> _fld1;
private Vector256<Single> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__op_MultiplySingle()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
}
public VectorBinaryOpTest__op_MultiplySingle()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); }
_dataTable = new DataTable(_data1, _data2, new Single[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Unsafe.Read<Vector256<Single>>(_dataTable.inArray1Ptr) * Unsafe.Read<Vector256<Single>>(_dataTable.inArray2Ptr);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(Vector256<Single>).GetMethod("op_Multiply", new Type[] { typeof(Vector256<Single>), typeof(Vector256<Single>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector256<Single>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector256<Single>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector256<Single>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = _clsVar1 * _clsVar2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector256<Single>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector256<Single>>(_dataTable.inArray2Ptr);
var result = op1 * op2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__op_MultiplySingle();
var result = test._fld1 * test._fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = _fld1 * _fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = test._fld1 * test._fld2;
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector256<Single> op1, Vector256<Single> op2, void* result, [CallerMemberName] string method = "")
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] inArray2 = new Single[Op2ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Single>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Single[] inArray1 = new Single[Op1ElementCount];
Single[] inArray2 = new Single[Op2ElementCount];
Single[] outArray = new Single[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector256<Single>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector256<Single>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Single, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Single>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Single[] left, Single[] right, Single[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != (float)(left[0] * right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != (float)(left[i] * right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector256)}.op_Multiply<Single>(Vector256<Single>, Vector256<Single>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/CodeGenBringUpTests/DblAvg2_r.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="DblAvg2.cs" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<PropertyGroup>
<DebugType>PdbOnly</DebugType>
<Optimize>False</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="DblAvg2.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.IO.IsolatedStorage/tests/System/IO/IsolatedStorage/DeleteDirectoryTests.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.IO.IsolatedStorage
{
public class DeleteDirectoryTests : IsoStorageTest
{
[Fact]
public void DeleteDirectory_ThrowsArgumentNull()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<ArgumentNullException>(() => isf.DeleteDirectory(null));
}
}
[Fact]
public void DeleteDirectory_ThrowsObjectDisposed()
{
IsolatedStorageFile isf;
using (isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
}
Assert.Throws<ObjectDisposedException>(() => isf.DeleteDirectory("foo"));
}
[Fact]
public void DeleteRemovedDirectory_ThrowsInvalidOperationException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
isf.Remove();
Assert.Throws<InvalidOperationException>(() => isf.DeleteDirectory("foo"));
}
}
[Fact]
public void DeleteClosedDirectory_ThrowsInvalidOperationException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
isf.Close();
Assert.Throws<InvalidOperationException>(() => isf.DeleteDirectory("foo"));
}
}
[Fact]
public void DeleteDirectory_RaisesInvalidPath()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<IsolatedStorageException>(() => isf.DeleteDirectory("\0bad"));
}
}
[Fact]
public void DeleteDirectory_DeleteNested()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
string directory = "DeleteDirectory_DeleteNested";
string subdirectory = Path.Combine(directory, "Subdirectory");
isf.CreateDirectory(subdirectory);
Assert.True(isf.DirectoryExists(subdirectory));
// Shouldn't be recursive
Assert.Throws<IsolatedStorageException>(() => isf.DeleteDirectory(directory));
isf.DeleteDirectory(subdirectory);
isf.DeleteDirectory(directory);
Assert.False(isf.DirectoryExists(directory));
}
}
[Theory, MemberData(nameof(ValidStores))]
public void DeleteDirectory_DeletesDirectory(PresetScopes scope)
{
TestHelper.WipeStores();
using (var isf = GetPresetScope(scope))
{
string directory = "DeleteDirectory_DeletesDirectory";
string subdirectory = Path.Combine(directory, directory);
isf.CreateDirectory(directory);
Assert.True(isf.DirectoryExists(directory), "directory exists");
isf.CreateDirectory(subdirectory);
Assert.True(isf.DirectoryExists(subdirectory), "subdirectory exists");
// Can't delete a directory with content
Assert.Throws<IsolatedStorageException>(() => isf.DeleteDirectory(directory));
Assert.True(isf.DirectoryExists(directory));
isf.DeleteDirectory(subdirectory);
Assert.False(isf.DirectoryExists(subdirectory));
isf.DeleteDirectory(directory);
Assert.False(isf.DirectoryExists(directory));
}
}
[Theory, MemberData(nameof(ValidStores))]
public void DeleteDirectory_CannotDeleteWithContent(PresetScopes scope)
{
TestHelper.WipeStores();
// Validating that we aren't passing recursive:true
using (var isf = GetPresetScope(scope))
{
string directory = "DeleteDirectory_CannotDeleteWithContent";
isf.CreateDirectory(directory);
Assert.True(isf.DirectoryExists(directory), "directory exists");
string testFile = Path.Combine(directory, "content.file");
isf.CreateTestFile(testFile);
Assert.Throws<IsolatedStorageException>(() => isf.DeleteDirectory(directory));
isf.DeleteFile(testFile);
isf.DeleteDirectory(directory);
Assert.False(isf.DirectoryExists(directory));
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.IO.IsolatedStorage
{
public class DeleteDirectoryTests : IsoStorageTest
{
[Fact]
public void DeleteDirectory_ThrowsArgumentNull()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<ArgumentNullException>(() => isf.DeleteDirectory(null));
}
}
[Fact]
public void DeleteDirectory_ThrowsObjectDisposed()
{
IsolatedStorageFile isf;
using (isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
}
Assert.Throws<ObjectDisposedException>(() => isf.DeleteDirectory("foo"));
}
[Fact]
public void DeleteRemovedDirectory_ThrowsInvalidOperationException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
isf.Remove();
Assert.Throws<InvalidOperationException>(() => isf.DeleteDirectory("foo"));
}
}
[Fact]
public void DeleteClosedDirectory_ThrowsInvalidOperationException()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
isf.Close();
Assert.Throws<InvalidOperationException>(() => isf.DeleteDirectory("foo"));
}
}
[Fact]
public void DeleteDirectory_RaisesInvalidPath()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
Assert.Throws<IsolatedStorageException>(() => isf.DeleteDirectory("\0bad"));
}
}
[Fact]
public void DeleteDirectory_DeleteNested()
{
using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForAssembly())
{
string directory = "DeleteDirectory_DeleteNested";
string subdirectory = Path.Combine(directory, "Subdirectory");
isf.CreateDirectory(subdirectory);
Assert.True(isf.DirectoryExists(subdirectory));
// Shouldn't be recursive
Assert.Throws<IsolatedStorageException>(() => isf.DeleteDirectory(directory));
isf.DeleteDirectory(subdirectory);
isf.DeleteDirectory(directory);
Assert.False(isf.DirectoryExists(directory));
}
}
[Theory, MemberData(nameof(ValidStores))]
public void DeleteDirectory_DeletesDirectory(PresetScopes scope)
{
TestHelper.WipeStores();
using (var isf = GetPresetScope(scope))
{
string directory = "DeleteDirectory_DeletesDirectory";
string subdirectory = Path.Combine(directory, directory);
isf.CreateDirectory(directory);
Assert.True(isf.DirectoryExists(directory), "directory exists");
isf.CreateDirectory(subdirectory);
Assert.True(isf.DirectoryExists(subdirectory), "subdirectory exists");
// Can't delete a directory with content
Assert.Throws<IsolatedStorageException>(() => isf.DeleteDirectory(directory));
Assert.True(isf.DirectoryExists(directory));
isf.DeleteDirectory(subdirectory);
Assert.False(isf.DirectoryExists(subdirectory));
isf.DeleteDirectory(directory);
Assert.False(isf.DirectoryExists(directory));
}
}
[Theory, MemberData(nameof(ValidStores))]
public void DeleteDirectory_CannotDeleteWithContent(PresetScopes scope)
{
TestHelper.WipeStores();
// Validating that we aren't passing recursive:true
using (var isf = GetPresetScope(scope))
{
string directory = "DeleteDirectory_CannotDeleteWithContent";
isf.CreateDirectory(directory);
Assert.True(isf.DirectoryExists(directory), "directory exists");
string testFile = Path.Combine(directory, "content.file");
isf.CreateTestFile(testFile);
Assert.Throws<IsolatedStorageException>(() => isf.DeleteDirectory(directory));
isf.DeleteFile(testFile);
isf.DeleteDirectory(directory);
Assert.False(isf.DirectoryExists(directory));
}
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/HardwareIntrinsics/General/Vector128/Max.UInt32.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void MaxUInt32()
{
var test = new VectorBinaryOpTest__MaxUInt32();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__MaxUInt32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt32>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt32> _fld1;
public Vector128<UInt32> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__MaxUInt32 testClass)
{
var result = Vector128.Max(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static UInt32[] _data1 = new UInt32[Op1ElementCount];
private static UInt32[] _data2 = new UInt32[Op2ElementCount];
private static Vector128<UInt32> _clsVar1;
private static Vector128<UInt32> _clsVar2;
private Vector128<UInt32> _fld1;
private Vector128<UInt32> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__MaxUInt32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
}
public VectorBinaryOpTest__MaxUInt32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
_dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector128.Max(
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector128).GetMethod(nameof(Vector128.Max), new Type[] {
typeof(Vector128<UInt32>),
typeof(Vector128<UInt32>)
});
if (method is null)
{
method = typeof(Vector128).GetMethod(nameof(Vector128.Max), 1, new Type[] {
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0)),
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(UInt32));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector128.Max(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr);
var result = Vector128.Max(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__MaxUInt32();
var result = Vector128.Max(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector128.Max(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector128.Max(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector128<UInt32> op1, Vector128<UInt32> op2, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray1 = new UInt32[Op1ElementCount];
UInt32[] inArray2 = new UInt32[Op2ElementCount];
UInt32[] outArray = new UInt32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray1 = new UInt32[Op1ElementCount];
UInt32[] inArray2 = new UInt32[Op2ElementCount];
UInt32[] outArray = new UInt32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != ((left[0] > right[0]) ? left[0] : right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != ((left[i] > right[i]) ? left[i] : right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector128)}.{nameof(Vector128.Max)}<UInt32>(Vector128<UInt32>, Vector128<UInt32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
namespace JIT.HardwareIntrinsics.General
{
public static partial class Program
{
private static void MaxUInt32()
{
var test = new VectorBinaryOpTest__MaxUInt32();
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
// Validates passing a static member works
test.RunClsVarScenario();
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
// Validates passing an instance member of a class works
test.RunClassFldScenario();
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class VectorBinaryOpTest__MaxUInt32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(UInt32[] inArray1, UInt32[] inArray2, UInt32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<UInt32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<UInt32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<UInt32>();
if ((alignment != 32 && alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<UInt32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<UInt32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector128<UInt32> _fld1;
public Vector128<UInt32> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref testStruct._fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref testStruct._fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
return testStruct;
}
public void RunStructFldScenario(VectorBinaryOpTest__MaxUInt32 testClass)
{
var result = Vector128.Max(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
private static readonly int LargestVectorSize = 16;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector128<UInt32>>() / sizeof(UInt32);
private static UInt32[] _data1 = new UInt32[Op1ElementCount];
private static UInt32[] _data2 = new UInt32[Op2ElementCount];
private static Vector128<UInt32> _clsVar1;
private static Vector128<UInt32> _clsVar2;
private Vector128<UInt32> _fld1;
private Vector128<UInt32> _fld2;
private DataTable _dataTable;
static VectorBinaryOpTest__MaxUInt32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _clsVar2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
}
public VectorBinaryOpTest__MaxUInt32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld1), ref Unsafe.As<UInt32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt32>, byte>(ref _fld2), ref Unsafe.As<UInt32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetUInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetUInt32(); }
_dataTable = new DataTable(_data1, _data2, new UInt32[RetElementCount], LargestVectorSize);
}
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = Vector128.Max(
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var method = typeof(Vector128).GetMethod(nameof(Vector128.Max), new Type[] {
typeof(Vector128<UInt32>),
typeof(Vector128<UInt32>)
});
if (method is null)
{
method = typeof(Vector128).GetMethod(nameof(Vector128.Max), 1, new Type[] {
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0)),
typeof(Vector128<>).MakeGenericType(Type.MakeGenericMethodParameter(0))
});
}
if (method.IsGenericMethodDefinition)
{
method = method.MakeGenericMethod(typeof(UInt32));
}
var result = method.Invoke(null, new object[] {
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector128<UInt32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = Vector128.Max(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector128<UInt32>>(_dataTable.inArray2Ptr);
var result = Vector128.Max(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new VectorBinaryOpTest__MaxUInt32();
var result = Vector128.Max(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = Vector128.Max(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = Vector128.Max(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
private void ValidateResult(Vector128<UInt32> op1, Vector128<UInt32> op2, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray1 = new UInt32[Op1ElementCount];
UInt32[] inArray2 = new UInt32[Op2ElementCount];
UInt32[] outArray = new UInt32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
UInt32[] inArray1 = new UInt32[Op1ElementCount];
UInt32[] inArray2 = new UInt32[Op2ElementCount];
UInt32[] outArray = new UInt32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector128<UInt32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(UInt32[] left, UInt32[] right, UInt32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
if (result[0] != ((left[0] > right[0]) ? left[0] : right[0]))
{
succeeded = false;
}
else
{
for (var i = 1; i < RetElementCount; i++)
{
if (result[i] != ((left[i] > right[i]) ? left[i] : right[i]))
{
succeeded = false;
break;
}
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(Vector128)}.{nameof(Vector128.Max)}<UInt32>(Vector128<UInt32>, Vector128<UInt32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.IO/tests/StreamWriter/StreamWriter.FlushTests.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.IO;
using Xunit;
namespace System.IO.Tests
{
public class FlushTests
{
protected virtual Stream CreateStream()
{
return new MemoryStream();
}
[Fact]
public void AutoFlushSetTrue()
{
// [] Set the autoflush to true
var sw2 = new StreamWriter(CreateStream());
sw2.AutoFlush = true;
Assert.True(sw2.AutoFlush);
}
[Fact]
public void AutoFlushSetFalse()
{
// [] Set autoflush to false
var sw2 = new StreamWriter(CreateStream());
sw2.AutoFlush = false;
Assert.False(sw2.AutoFlush);
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.IO;
using Xunit;
namespace System.IO.Tests
{
public class FlushTests
{
protected virtual Stream CreateStream()
{
return new MemoryStream();
}
[Fact]
public void AutoFlushSetTrue()
{
// [] Set the autoflush to true
var sw2 = new StreamWriter(CreateStream());
sw2.AutoFlush = true;
Assert.True(sw2.AutoFlush);
}
[Fact]
public void AutoFlushSetFalse()
{
// [] Set autoflush to false
var sw2 = new StreamWriter(CreateStream());
sw2.AutoFlush = false;
Assert.False(sw2.AutoFlush);
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/System.Private.Uri/tests/FunctionalTests/UriMailToTest.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.PrivateUri.Tests
{
/// <summary>
/// Summary description for UriMailToParsing
/// </summary>
public class UriMailToTest
{
[Fact]
public void UriMailTo_SchemeOnly_Success()
{
Uri uri = new Uri("mailto:");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:", uri.AbsoluteUri);
Assert.Equal("mailto:", uri.ToString());
Assert.Equal("", uri.Host);
}
[Fact]
public void UriMailTo_SchemeAndBackslash_Throws()
{
Assert.ThrowsAny<FormatException>(() => new Uri(@"mailto:\"));
}
[Fact]
public void UriMailTo_SchemeAndForwardSlash_Success()
{
Uri uri = new Uri("mailto:/");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:/", uri.AbsoluteUri);
Assert.Equal("mailto:/", uri.ToString());
Assert.Equal("", uri.Host);
Assert.Equal("/", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeAndDoubleForwardSlash_Success()
{
Uri uri = new Uri("mailto://");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto://", uri.AbsoluteUri);
Assert.Equal("mailto://", uri.ToString());
Assert.Equal("", uri.Host);
Assert.Equal("//", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeAndQuery_Success()
{
Uri uri = new Uri("mailto:[email protected];cc=User3@Host3com");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:[email protected];cc=User3@Host3com", uri.AbsoluteUri);
Assert.Equal("mailto:[email protected];cc=User3@Host3com", uri.ToString());
Assert.Equal("", uri.Host);
Assert.Equal("", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
Assert.Equal("[email protected];cc=User3@Host3com", uri.Query);
}
[Fact]
public void UriMailTo_SchemeUserAt_Throws()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@"));
}
[Fact]
public void UriMailTo_SchemeUserColonPasswordAt_Throws()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User:Password@"));
}
[Fact]
public void UriMailTo_SchemeUserAtQuery_Throws()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@[email protected];cc=User3@Host3com"));
}
[Fact]
public void UriMailTo_SchemeUserAtHost_Success()
{
Uri uri = new Uri("mailto:User@Host");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@host", uri.AbsoluteUri);
Assert.Equal("mailto:User@host", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeUserColonPasswordAtHost_Success()
{
Uri uri = new Uri("mailto:User:Password@Host");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User:Password@host", uri.AbsoluteUri);
Assert.Equal("mailto:User:Password@host", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User:Password", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeUserAtHostPort_Success()
{
Uri uri = new Uri("mailto:User@Host:3555");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@host:3555", uri.AbsoluteUri);
Assert.Equal("mailto:User@host:3555", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal(3555, uri.Port);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_TwoSemiColonSepratedAddresses_Success()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@Host;User@Host"));
}
[Fact]
public void UriMailTo_TwoCommaSepratedAddresses_Success()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@Host,User@Host"));
}
[Fact]
public void UriMailTo_SchemeUserAtHostPath_Success()
{
Uri uri = new Uri("mailto:User@Host/Path1/./Path2/../...");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@host/Path1/./Path2/../...", uri.AbsoluteUri);
Assert.Equal("mailto:User@host/Path1/./Path2/../...", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("/Path1/./Path2/../...", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeUserAtHostQuery_Success()
{
Uri uri = new Uri("mailto:User@[email protected];cc=User3@Host3com");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@[email protected];cc=User3@Host3com", uri.AbsoluteUri);
Assert.Equal("mailto:User@[email protected];cc=User3@Host3com", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
Assert.Equal("[email protected];cc=User3@Host3com", uri.Query);
}
[Fact]
public void UriMailTo_SchemeUserAtHostPathQuery_Success()
{
Uri uri = new Uri("mailto:User@Host/Path1/./Path2/../[email protected];cc=User3@Host3com");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@host/Path1/./Path2/../[email protected];cc=User3@Host3com", uri.AbsoluteUri);
Assert.Equal("mailto:User@host/Path1/./Path2/../[email protected];cc=User3@Host3com", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("/Path1/./Path2/../...", uri.AbsolutePath);
Assert.Equal("[email protected];cc=User3@Host3com", uri.Query);
}
[Fact]
public void UriMailTo_EAI_SomeEscaping()
{
Uri uri = new Uri("mailto:\u30AF@\u30AF");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:%E3%82%AF@\u30AF", uri.AbsoluteUri);
Assert.Equal("mailto:\u30AF@\u30AF", uri.ToString());
Assert.Equal("%E3%82%AF", uri.UserInfo);
Assert.Equal("\u30AF", uri.Host);
Assert.Equal("", uri.AbsolutePath);
Assert.Equal("\u30AF@\u30AF", uri.GetComponents(UriComponents.UserInfo | UriComponents.Host, UriFormat.SafeUnescaped));
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
namespace System.PrivateUri.Tests
{
/// <summary>
/// Summary description for UriMailToParsing
/// </summary>
public class UriMailToTest
{
[Fact]
public void UriMailTo_SchemeOnly_Success()
{
Uri uri = new Uri("mailto:");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:", uri.AbsoluteUri);
Assert.Equal("mailto:", uri.ToString());
Assert.Equal("", uri.Host);
}
[Fact]
public void UriMailTo_SchemeAndBackslash_Throws()
{
Assert.ThrowsAny<FormatException>(() => new Uri(@"mailto:\"));
}
[Fact]
public void UriMailTo_SchemeAndForwardSlash_Success()
{
Uri uri = new Uri("mailto:/");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:/", uri.AbsoluteUri);
Assert.Equal("mailto:/", uri.ToString());
Assert.Equal("", uri.Host);
Assert.Equal("/", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeAndDoubleForwardSlash_Success()
{
Uri uri = new Uri("mailto://");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto://", uri.AbsoluteUri);
Assert.Equal("mailto://", uri.ToString());
Assert.Equal("", uri.Host);
Assert.Equal("//", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeAndQuery_Success()
{
Uri uri = new Uri("mailto:[email protected];cc=User3@Host3com");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:[email protected];cc=User3@Host3com", uri.AbsoluteUri);
Assert.Equal("mailto:[email protected];cc=User3@Host3com", uri.ToString());
Assert.Equal("", uri.Host);
Assert.Equal("", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
Assert.Equal("[email protected];cc=User3@Host3com", uri.Query);
}
[Fact]
public void UriMailTo_SchemeUserAt_Throws()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@"));
}
[Fact]
public void UriMailTo_SchemeUserColonPasswordAt_Throws()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User:Password@"));
}
[Fact]
public void UriMailTo_SchemeUserAtQuery_Throws()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@[email protected];cc=User3@Host3com"));
}
[Fact]
public void UriMailTo_SchemeUserAtHost_Success()
{
Uri uri = new Uri("mailto:User@Host");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@host", uri.AbsoluteUri);
Assert.Equal("mailto:User@host", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeUserColonPasswordAtHost_Success()
{
Uri uri = new Uri("mailto:User:Password@Host");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User:Password@host", uri.AbsoluteUri);
Assert.Equal("mailto:User:Password@host", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User:Password", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeUserAtHostPort_Success()
{
Uri uri = new Uri("mailto:User@Host:3555");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@host:3555", uri.AbsoluteUri);
Assert.Equal("mailto:User@host:3555", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal(3555, uri.Port);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_TwoSemiColonSepratedAddresses_Success()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@Host;User@Host"));
}
[Fact]
public void UriMailTo_TwoCommaSepratedAddresses_Success()
{
Assert.ThrowsAny<FormatException>(() => new Uri("mailto:User@Host,User@Host"));
}
[Fact]
public void UriMailTo_SchemeUserAtHostPath_Success()
{
Uri uri = new Uri("mailto:User@Host/Path1/./Path2/../...");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@host/Path1/./Path2/../...", uri.AbsoluteUri);
Assert.Equal("mailto:User@host/Path1/./Path2/../...", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("/Path1/./Path2/../...", uri.AbsolutePath);
}
[Fact]
public void UriMailTo_SchemeUserAtHostQuery_Success()
{
Uri uri = new Uri("mailto:User@[email protected];cc=User3@Host3com");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@[email protected];cc=User3@Host3com", uri.AbsoluteUri);
Assert.Equal("mailto:User@[email protected];cc=User3@Host3com", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("", uri.AbsolutePath);
Assert.Equal("[email protected];cc=User3@Host3com", uri.Query);
}
[Fact]
public void UriMailTo_SchemeUserAtHostPathQuery_Success()
{
Uri uri = new Uri("mailto:User@Host/Path1/./Path2/../[email protected];cc=User3@Host3com");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:User@host/Path1/./Path2/../[email protected];cc=User3@Host3com", uri.AbsoluteUri);
Assert.Equal("mailto:User@host/Path1/./Path2/../[email protected];cc=User3@Host3com", uri.ToString());
Assert.Equal("host", uri.Host);
Assert.Equal("User", uri.UserInfo);
Assert.Equal("/Path1/./Path2/../...", uri.AbsolutePath);
Assert.Equal("[email protected];cc=User3@Host3com", uri.Query);
}
[Fact]
public void UriMailTo_EAI_SomeEscaping()
{
Uri uri = new Uri("mailto:\u30AF@\u30AF");
Assert.Equal("mailto", uri.Scheme);
Assert.Equal("mailto:%E3%82%AF@\u30AF", uri.AbsoluteUri);
Assert.Equal("mailto:\u30AF@\u30AF", uri.ToString());
Assert.Equal("%E3%82%AF", uri.UserInfo);
Assert.Equal("\u30AF", uri.Host);
Assert.Equal("", uri.AbsolutePath);
Assert.Equal("\u30AF@\u30AF", uri.GetComponents(UriComponents.UserInfo | UriComponents.Host, UriFormat.SafeUnescaped));
}
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/opt/LocAlloc/inloop.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ensure localloc in a loop is not converted
// to local buffer
using System;
unsafe class Program
{
struct Element
{
public Element* Next;
public int Value;
}
static int foo(int n)
{
Element* root = null;
for (int i = 0; i < n; i++)
{
byte* pb = stackalloc byte[16];
Element* p = (Element*)pb;
p->Value = i;
p->Next = root;
root = p;
}
int sum = 0;
while (root != null)
{
sum += root->Value;
root = root->Next;
}
return sum;
}
static int Main(string[] args)
{
return foo(10) + 55;
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// ensure localloc in a loop is not converted
// to local buffer
using System;
unsafe class Program
{
struct Element
{
public Element* Next;
public int Value;
}
static int foo(int n)
{
Element* root = null;
for (int i = 0; i < n; i++)
{
byte* pb = stackalloc byte[16];
Element* p = (Element*)pb;
p->Value = i;
p->Next = root;
root = p;
}
int sum = 0;
while (root != null)
{
sum += root->Value;
root = root->Next;
}
return sum;
}
static int Main(string[] args)
{
return foo(10) + 55;
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/libraries/Common/tests/System/Xml/ModuleCore/ModuleCore.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="cattrbase.cs" />
<Compile Include="ccommon.cs" />
<Compile Include="cerror.cs" />
<Compile Include="cltmconsole.cs" />
<Compile Include="cmodinfo.cs" />
<Compile Include="cparser.cs" />
<Compile Include="ctestbase.cs" />
<Compile Include="ctestcase.cs" />
<Compile Include="ctestexception.cs" />
<Compile Include="ctestmodule.cs" />
<Compile Include="cvariation.cs" />
<Compile Include="interop.cs" />
<Compile Include="XunitRunner.cs" />
<Compile Include="XunitTestCase.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit.extensibility.execution" Version="$(XUnitVersion)" />
<PackageReference Include="xunit.assert" Version="$(XUnitVersion)" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="cattrbase.cs" />
<Compile Include="ccommon.cs" />
<Compile Include="cerror.cs" />
<Compile Include="cltmconsole.cs" />
<Compile Include="cmodinfo.cs" />
<Compile Include="cparser.cs" />
<Compile Include="ctestbase.cs" />
<Compile Include="ctestcase.cs" />
<Compile Include="ctestexception.cs" />
<Compile Include="ctestmodule.cs" />
<Compile Include="cvariation.cs" />
<Compile Include="interop.cs" />
<Compile Include="XunitRunner.cs" />
<Compile Include="XunitTestCase.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit.extensibility.execution" Version="$(XUnitVersion)" />
<PackageReference Include="xunit.assert" Version="$(XUnitVersion)" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// This class generates most of the implementation of the MetadataReader for the ProjectN format,
// ensuring that the contract defined by CsPublicGen2 is implemented.The generated file is
// 'NativeFormatReaderGen.cs', and any missing implementation is the supplied in the human-authored
// source counterpart 'NativeFormatReader.cs'.
//
class ReaderGen : CsWriter
{
public ReaderGen(string fileName)
: base(fileName)
{
}
public void EmitSource()
{
WriteLine("#pragma warning disable 649");
WriteLine("#pragma warning disable 169");
WriteLine("#pragma warning disable 282 // There is no defined ordering between fields in multiple declarations of partial class or struct");
WriteLine("#pragma warning disable CA1066 // IEquatable<T> implementations aren't used");
WriteLine("#pragma warning disable IDE0059");
WriteLine();
WriteLine("using System;");
WriteLine("using System.Reflection;");
WriteLine("using System.Collections.Generic;");
WriteLine("using Internal.NativeFormat;");
WriteLine();
OpenScope("namespace Internal.Metadata.NativeFormat");
foreach (var record in SchemaDef.RecordSchema)
{
EmitRecord(record);
EmitHandle(record);
}
foreach (var typeName in SchemaDef.TypeNamesWithCollectionTypes)
{
EmitCollection(typeName + "HandleCollection", typeName + "Handle");
}
foreach (var primitiveType in SchemaDef.PrimitiveTypes)
{
EmitCollection(primitiveType.TypeName + "Collection", primitiveType.Name);
}
EmitOpaqueHandle();
EmitCollection("HandleCollection", "Handle");
EmitMetadataReader();
CloseScope("Internal.Metadata.NativeFormat");
}
private void EmitRecord(RecordDef record)
{
OpenScope($"public partial struct {record.Name}");
WriteLine("internal MetadataReader _reader;");
WriteLine($"internal {record.Name}Handle _handle;");
OpenScope($"public {record.Name}Handle Handle");
OpenScope("get");
WriteLine("return _handle;");
CloseScope();
CloseScope("Handle");
foreach (var member in record.Members)
{
if ((member.Flags & MemberDefFlags.NotPersisted) != 0)
continue;
string memberType = member.GetMemberType();
string fieldType = member.GetMemberType(MemberTypeKind.ReaderField);
string fieldName = member.GetMemberFieldName();
string description = member.GetMemberDescription();
if (description != null)
WriteDocComment(description);
OpenScope($"public {memberType} {member.Name}");
OpenScope("get");
if (fieldType != memberType)
WriteLine($"return ({memberType}){fieldName};");
else
WriteLine($"return {fieldName};");
CloseScope();
CloseScope(member.Name);
WriteLineIfNeeded();
WriteLine($"internal {fieldType} {fieldName};");
}
CloseScope(record.Name);
}
private void EmitHandle(RecordDef record)
{
string handleName = $"{record.Name}Handle";
OpenScope($"public partial struct {handleName}");
OpenScope("public override bool Equals(object obj)");
WriteLine($"if (obj is {handleName})");
WriteLine($" return _value == (({handleName})obj)._value;");
WriteLine("else if (obj is Handle)");
WriteLine(" return _value == ((Handle)obj)._value;");
WriteLine("else");
WriteLine(" return false;");
CloseScope("Equals");
OpenScope($"public bool Equals({handleName} handle)");
WriteLine("return _value == handle._value;");
CloseScope("Equals");
OpenScope("public bool Equals(Handle handle)");
WriteLine("return _value == handle._value;");
CloseScope("Equals");
OpenScope("public override int GetHashCode()");
WriteLine("return (int)_value;");
CloseScope("GetHashCode");
WriteLineIfNeeded();
WriteLine("internal int _value;");
OpenScope($"internal {handleName}(Handle handle) : this(handle._value)");
CloseScope();
OpenScope($"internal {handleName}(int value)");
WriteLine("HandleType hType = (HandleType)(value >> 24);");
WriteLine($"if (!(hType == 0 || hType == HandleType.{record.Name} || hType == HandleType.Null))");
WriteLine(" throw new ArgumentException();");
WriteLine($"_value = (value & 0x00FFFFFF) | (((int)HandleType.{record.Name}) << 24);");
WriteLine("_Validate();");
CloseScope();
OpenScope($"public static implicit operator Handle({handleName} handle)");
WriteLine("return new Handle(handle._value);");
CloseScope("Handle");
OpenScope("internal int Offset");
OpenScope("get");
WriteLine("return (this._value & 0x00FFFFFF);");
CloseScope();
CloseScope("Offset");
OpenScope($"public {record.Name} Get{record.Name}(MetadataReader reader)");
WriteLine($"return reader.Get{record.Name}(this);");
CloseScope($"Get{record.Name}");
OpenScope("public bool IsNull(MetadataReader reader)");
WriteLine("return reader.IsNull(this);");
CloseScope("IsNull");
OpenScope("public Handle ToHandle(MetadataReader reader)");
WriteLine("return reader.ToHandle(this);");
CloseScope("ToHandle");
WriteScopeAttribute("[System.Diagnostics.Conditional(\"DEBUG\")]");
OpenScope("internal void _Validate()");
WriteLine($"if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.{record.Name})");
WriteLine(" throw new ArgumentException();");
CloseScope("_Validate");
OpenScope("public override string ToString()");
WriteLine("return string.Format(\"{0:X8}\", _value);");
CloseScope("ToString");
CloseScope(handleName);
}
private void EmitCollection(string collectionTypeName, string elementTypeName)
{
OpenScope($"public partial struct {collectionTypeName}");
WriteLine("private NativeReader _reader;");
WriteLine("private uint _offset;");
OpenScope($"internal {collectionTypeName}(NativeReader reader, uint offset)");
WriteLine("_offset = offset;");
WriteLine("_reader = reader;");
CloseScope();
OpenScope("public int Count");
OpenScope("get");
WriteLine("uint count;");
WriteLine("_reader.DecodeUnsigned(_offset, out count);");
WriteLine("return (int)count;");
CloseScope();
CloseScope("Count");
OpenScope($"public Enumerator GetEnumerator()");
WriteLine($"return new Enumerator(_reader, _offset);");
CloseScope("GetEnumerator");
OpenScope($"public struct Enumerator");
WriteLine("private NativeReader _reader;");
WriteLine("private uint _offset;");
WriteLine("private uint _remaining;");
WriteLine($"private {elementTypeName} _current;");
OpenScope($"internal Enumerator(NativeReader reader, uint offset)");
WriteLine("_reader = reader;");
WriteLine("_offset = reader.DecodeUnsigned(offset, out _remaining);");
WriteLine($"_current = default({elementTypeName});");
CloseScope();
OpenScope($"public {elementTypeName} Current");
OpenScope("get");
WriteLine("return _current;");
CloseScope();
CloseScope("Current");
OpenScope("public bool MoveNext()");
WriteLine("if (_remaining == 0)");
WriteLine(" return false;");
WriteLine("_remaining--;");
WriteLine("_offset = _reader.Read(_offset, out _current);");
WriteLine("return true;");
CloseScope("MoveNext");
OpenScope("public void Dispose()");
CloseScope("Dispose");
CloseScope("Enumerator");
CloseScope(collectionTypeName);
}
private void EmitOpaqueHandle()
{
OpenScope("public partial struct Handle");
foreach (var record in SchemaDef.RecordSchema)
{
string handleName = $"{record.Name}Handle";
OpenScope($"public {handleName} To{handleName}(MetadataReader reader)");
WriteLine($"return new {handleName}(this);");
CloseScope($"To{handleName}");
}
CloseScope("Handle");
}
private void EmitMetadataReader()
{
OpenScope("public partial class MetadataReader");
foreach (var record in SchemaDef.RecordSchema)
{
OpenScope($"public {record.Name} Get{record.Name}({record.Name}Handle handle)");
if (record.Name == "ConstantStringValue")
{
WriteLine("if (IsNull(handle))");
WriteLine(" return new ConstantStringValue();");
}
WriteLine($"{record.Name} record;");
WriteLine("record._reader = this;");
WriteLine("record._handle = handle;");
WriteLine("var offset = (uint)handle.Offset;");
foreach (var member in record.Members)
{
if ((member.Flags & MemberDefFlags.NotPersisted) != 0)
continue;
WriteLine($"offset = _streamReader.Read(offset, out record.{member.GetMemberFieldName()});");
}
WriteLine("return record;");
CloseScope($"Get{record.Name}");
}
foreach (var record in SchemaDef.RecordSchema)
{
OpenScope($"internal Handle ToHandle({record.Name}Handle handle)");
WriteLine("return new Handle(handle._value);");
CloseScope("ToHandle");
}
foreach (var record in SchemaDef.RecordSchema)
{
string handleName = $"{record.Name}Handle";
OpenScope($"internal {handleName} To{handleName}(Handle handle)");
WriteLine($"return new {handleName}(handle._value);");
CloseScope($"To{handleName}");
}
foreach (var record in SchemaDef.RecordSchema)
{
OpenScope($"internal bool IsNull({record.Name}Handle handle)");
WriteLine("return (handle._value & 0x00FFFFFF) == 0;");
CloseScope("IsNull");
}
CloseScope("MetadataReader");
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//
// This class generates most of the implementation of the MetadataReader for the ProjectN format,
// ensuring that the contract defined by CsPublicGen2 is implemented.The generated file is
// 'NativeFormatReaderGen.cs', and any missing implementation is the supplied in the human-authored
// source counterpart 'NativeFormatReader.cs'.
//
class ReaderGen : CsWriter
{
public ReaderGen(string fileName)
: base(fileName)
{
}
public void EmitSource()
{
WriteLine("#pragma warning disable 649");
WriteLine("#pragma warning disable 169");
WriteLine("#pragma warning disable 282 // There is no defined ordering between fields in multiple declarations of partial class or struct");
WriteLine("#pragma warning disable CA1066 // IEquatable<T> implementations aren't used");
WriteLine("#pragma warning disable IDE0059");
WriteLine();
WriteLine("using System;");
WriteLine("using System.Reflection;");
WriteLine("using System.Collections.Generic;");
WriteLine("using Internal.NativeFormat;");
WriteLine();
OpenScope("namespace Internal.Metadata.NativeFormat");
foreach (var record in SchemaDef.RecordSchema)
{
EmitRecord(record);
EmitHandle(record);
}
foreach (var typeName in SchemaDef.TypeNamesWithCollectionTypes)
{
EmitCollection(typeName + "HandleCollection", typeName + "Handle");
}
foreach (var primitiveType in SchemaDef.PrimitiveTypes)
{
EmitCollection(primitiveType.TypeName + "Collection", primitiveType.Name);
}
EmitOpaqueHandle();
EmitCollection("HandleCollection", "Handle");
EmitMetadataReader();
CloseScope("Internal.Metadata.NativeFormat");
}
private void EmitRecord(RecordDef record)
{
OpenScope($"public partial struct {record.Name}");
WriteLine("internal MetadataReader _reader;");
WriteLine($"internal {record.Name}Handle _handle;");
OpenScope($"public {record.Name}Handle Handle");
OpenScope("get");
WriteLine("return _handle;");
CloseScope();
CloseScope("Handle");
foreach (var member in record.Members)
{
if ((member.Flags & MemberDefFlags.NotPersisted) != 0)
continue;
string memberType = member.GetMemberType();
string fieldType = member.GetMemberType(MemberTypeKind.ReaderField);
string fieldName = member.GetMemberFieldName();
string description = member.GetMemberDescription();
if (description != null)
WriteDocComment(description);
OpenScope($"public {memberType} {member.Name}");
OpenScope("get");
if (fieldType != memberType)
WriteLine($"return ({memberType}){fieldName};");
else
WriteLine($"return {fieldName};");
CloseScope();
CloseScope(member.Name);
WriteLineIfNeeded();
WriteLine($"internal {fieldType} {fieldName};");
}
CloseScope(record.Name);
}
private void EmitHandle(RecordDef record)
{
string handleName = $"{record.Name}Handle";
OpenScope($"public partial struct {handleName}");
OpenScope("public override bool Equals(object obj)");
WriteLine($"if (obj is {handleName})");
WriteLine($" return _value == (({handleName})obj)._value;");
WriteLine("else if (obj is Handle)");
WriteLine(" return _value == ((Handle)obj)._value;");
WriteLine("else");
WriteLine(" return false;");
CloseScope("Equals");
OpenScope($"public bool Equals({handleName} handle)");
WriteLine("return _value == handle._value;");
CloseScope("Equals");
OpenScope("public bool Equals(Handle handle)");
WriteLine("return _value == handle._value;");
CloseScope("Equals");
OpenScope("public override int GetHashCode()");
WriteLine("return (int)_value;");
CloseScope("GetHashCode");
WriteLineIfNeeded();
WriteLine("internal int _value;");
OpenScope($"internal {handleName}(Handle handle) : this(handle._value)");
CloseScope();
OpenScope($"internal {handleName}(int value)");
WriteLine("HandleType hType = (HandleType)(value >> 24);");
WriteLine($"if (!(hType == 0 || hType == HandleType.{record.Name} || hType == HandleType.Null))");
WriteLine(" throw new ArgumentException();");
WriteLine($"_value = (value & 0x00FFFFFF) | (((int)HandleType.{record.Name}) << 24);");
WriteLine("_Validate();");
CloseScope();
OpenScope($"public static implicit operator Handle({handleName} handle)");
WriteLine("return new Handle(handle._value);");
CloseScope("Handle");
OpenScope("internal int Offset");
OpenScope("get");
WriteLine("return (this._value & 0x00FFFFFF);");
CloseScope();
CloseScope("Offset");
OpenScope($"public {record.Name} Get{record.Name}(MetadataReader reader)");
WriteLine($"return reader.Get{record.Name}(this);");
CloseScope($"Get{record.Name}");
OpenScope("public bool IsNull(MetadataReader reader)");
WriteLine("return reader.IsNull(this);");
CloseScope("IsNull");
OpenScope("public Handle ToHandle(MetadataReader reader)");
WriteLine("return reader.ToHandle(this);");
CloseScope("ToHandle");
WriteScopeAttribute("[System.Diagnostics.Conditional(\"DEBUG\")]");
OpenScope("internal void _Validate()");
WriteLine($"if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.{record.Name})");
WriteLine(" throw new ArgumentException();");
CloseScope("_Validate");
OpenScope("public override string ToString()");
WriteLine("return string.Format(\"{0:X8}\", _value);");
CloseScope("ToString");
CloseScope(handleName);
}
private void EmitCollection(string collectionTypeName, string elementTypeName)
{
OpenScope($"public partial struct {collectionTypeName}");
WriteLine("private NativeReader _reader;");
WriteLine("private uint _offset;");
OpenScope($"internal {collectionTypeName}(NativeReader reader, uint offset)");
WriteLine("_offset = offset;");
WriteLine("_reader = reader;");
CloseScope();
OpenScope("public int Count");
OpenScope("get");
WriteLine("uint count;");
WriteLine("_reader.DecodeUnsigned(_offset, out count);");
WriteLine("return (int)count;");
CloseScope();
CloseScope("Count");
OpenScope($"public Enumerator GetEnumerator()");
WriteLine($"return new Enumerator(_reader, _offset);");
CloseScope("GetEnumerator");
OpenScope($"public struct Enumerator");
WriteLine("private NativeReader _reader;");
WriteLine("private uint _offset;");
WriteLine("private uint _remaining;");
WriteLine($"private {elementTypeName} _current;");
OpenScope($"internal Enumerator(NativeReader reader, uint offset)");
WriteLine("_reader = reader;");
WriteLine("_offset = reader.DecodeUnsigned(offset, out _remaining);");
WriteLine($"_current = default({elementTypeName});");
CloseScope();
OpenScope($"public {elementTypeName} Current");
OpenScope("get");
WriteLine("return _current;");
CloseScope();
CloseScope("Current");
OpenScope("public bool MoveNext()");
WriteLine("if (_remaining == 0)");
WriteLine(" return false;");
WriteLine("_remaining--;");
WriteLine("_offset = _reader.Read(_offset, out _current);");
WriteLine("return true;");
CloseScope("MoveNext");
OpenScope("public void Dispose()");
CloseScope("Dispose");
CloseScope("Enumerator");
CloseScope(collectionTypeName);
}
private void EmitOpaqueHandle()
{
OpenScope("public partial struct Handle");
foreach (var record in SchemaDef.RecordSchema)
{
string handleName = $"{record.Name}Handle";
OpenScope($"public {handleName} To{handleName}(MetadataReader reader)");
WriteLine($"return new {handleName}(this);");
CloseScope($"To{handleName}");
}
CloseScope("Handle");
}
private void EmitMetadataReader()
{
OpenScope("public partial class MetadataReader");
foreach (var record in SchemaDef.RecordSchema)
{
OpenScope($"public {record.Name} Get{record.Name}({record.Name}Handle handle)");
if (record.Name == "ConstantStringValue")
{
WriteLine("if (IsNull(handle))");
WriteLine(" return new ConstantStringValue();");
}
WriteLine($"{record.Name} record;");
WriteLine("record._reader = this;");
WriteLine("record._handle = handle;");
WriteLine("var offset = (uint)handle.Offset;");
foreach (var member in record.Members)
{
if ((member.Flags & MemberDefFlags.NotPersisted) != 0)
continue;
WriteLine($"offset = _streamReader.Read(offset, out record.{member.GetMemberFieldName()});");
}
WriteLine("return record;");
CloseScope($"Get{record.Name}");
}
foreach (var record in SchemaDef.RecordSchema)
{
OpenScope($"internal Handle ToHandle({record.Name}Handle handle)");
WriteLine("return new Handle(handle._value);");
CloseScope("ToHandle");
}
foreach (var record in SchemaDef.RecordSchema)
{
string handleName = $"{record.Name}Handle";
OpenScope($"internal {handleName} To{handleName}(Handle handle)");
WriteLine($"return new {handleName}(handle._value);");
CloseScope($"To{handleName}");
}
foreach (var record in SchemaDef.RecordSchema)
{
OpenScope($"internal bool IsNull({record.Name}Handle handle)");
WriteLine("return (handle._value & 0x00FFFFFF) == 0;");
CloseScope("IsNull");
}
CloseScope("MetadataReader");
}
}
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/Loader/lowlevel/regress/105736/Exception.csproj
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="exception.cs" />
</ItemGroup>
</Project>
|
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CLRTestPriority>1</CLRTestPriority>
</PropertyGroup>
<ItemGroup>
<Compile Include="exception.cs" />
</ItemGroup>
</Project>
| -1 |
dotnet/runtime
| 66,372 |
Add Stopwatch.GetElapsedTime
|
Fixes https://github.com/dotnet/runtime/issues/65858
|
stephentoub
| 2022-03-09T01:52:28Z | 2022-03-09T12:42:15Z |
ca731545a58307870a0baebb0ee43eeea61f175f
|
c9f7f7389e8e9a00d501aef696333b67d218baac
|
Add Stopwatch.GetElapsedTime. Fixes https://github.com/dotnet/runtime/issues/65858
|
./src/tests/JIT/HardwareIntrinsics/Arm/AdvSimd/CompareLessThanOrEqual.Vector64.Int32.cs
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void CompareLessThanOrEqual_Vector64_Int32()
{
var test = new SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Int32> _fld1;
public Vector64<Int32> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32 testClass)
{
var result = AdvSimd.CompareLessThanOrEqual(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32 testClass)
{
fixed (Vector64<Int32>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
{
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Vector64<Int32> _clsVar1;
private static Vector64<Int32> _clsVar2;
private Vector64<Int32> _fld1;
private Vector64<Int32> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
}
public SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.CompareLessThanOrEqual(
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.CompareLessThanOrEqual), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.CompareLessThanOrEqual), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.CompareLessThanOrEqual(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Int32>* pClsVar1 = &_clsVar1)
fixed (Vector64<Int32>* pClsVar2 = &_clsVar2)
{
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(pClsVar1)),
AdvSimd.LoadVector64((Int32*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
var result = AdvSimd.CompareLessThanOrEqual(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr));
var result = AdvSimd.CompareLessThanOrEqual(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32();
var result = AdvSimd.CompareLessThanOrEqual(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32();
fixed (Vector64<Int32>* pFld1 = &test._fld1)
fixed (Vector64<Int32>* pFld2 = &test._fld2)
{
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.CompareLessThanOrEqual(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Int32>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
{
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.CompareLessThanOrEqual(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(&test._fld1)),
AdvSimd.LoadVector64((Int32*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector64<Int32> op1, Vector64<Int32> op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.CompareLessThanOrEqual)}<Int32>(Vector64<Int32>, Vector64<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
/******************************************************************************
* This file is auto-generated from a template file by the GenerateTests.csx *
* script in tests\src\JIT\HardwareIntrinsics.Arm\Shared. In order to make *
* changes, please update the corresponding template and run according to the *
* directions listed in the file. *
******************************************************************************/
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.Arm;
namespace JIT.HardwareIntrinsics.Arm
{
public static partial class Program
{
private static void CompareLessThanOrEqual_Vector64_Int32()
{
var test = new SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32();
if (test.IsSupported)
{
// Validates basic functionality works, using Unsafe.Read
test.RunBasicScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates basic functionality works, using Load
test.RunBasicScenario_Load();
}
// Validates calling via reflection works, using Unsafe.Read
test.RunReflectionScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates calling via reflection works, using Load
test.RunReflectionScenario_Load();
}
// Validates passing a static member works
test.RunClsVarScenario();
if (AdvSimd.IsSupported)
{
// Validates passing a static member works, using pinning and Load
test.RunClsVarScenario_Load();
}
// Validates passing a local works, using Unsafe.Read
test.RunLclVarScenario_UnsafeRead();
if (AdvSimd.IsSupported)
{
// Validates passing a local works, using Load
test.RunLclVarScenario_Load();
}
// Validates passing the field of a local class works
test.RunClassLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local class works, using pinning and Load
test.RunClassLclFldScenario_Load();
}
// Validates passing an instance member of a class works
test.RunClassFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a class works, using pinning and Load
test.RunClassFldScenario_Load();
}
// Validates passing the field of a local struct works
test.RunStructLclFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing the field of a local struct works, using pinning and Load
test.RunStructLclFldScenario_Load();
}
// Validates passing an instance member of a struct works
test.RunStructFldScenario();
if (AdvSimd.IsSupported)
{
// Validates passing an instance member of a struct works, using pinning and Load
test.RunStructFldScenario_Load();
}
}
else
{
// Validates we throw on unsupported hardware
test.RunUnsupportedScenario();
}
if (!test.Succeeded)
{
throw new Exception("One or more scenarios did not complete as expected.");
}
}
}
public sealed unsafe class SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32
{
private struct DataTable
{
private byte[] inArray1;
private byte[] inArray2;
private byte[] outArray;
private GCHandle inHandle1;
private GCHandle inHandle2;
private GCHandle outHandle;
private ulong alignment;
public DataTable(Int32[] inArray1, Int32[] inArray2, Int32[] outArray, int alignment)
{
int sizeOfinArray1 = inArray1.Length * Unsafe.SizeOf<Int32>();
int sizeOfinArray2 = inArray2.Length * Unsafe.SizeOf<Int32>();
int sizeOfoutArray = outArray.Length * Unsafe.SizeOf<Int32>();
if ((alignment != 16 && alignment != 8) || (alignment * 2) < sizeOfinArray1 || (alignment * 2) < sizeOfinArray2 || (alignment * 2) < sizeOfoutArray)
{
throw new ArgumentException("Invalid value of alignment");
}
this.inArray1 = new byte[alignment * 2];
this.inArray2 = new byte[alignment * 2];
this.outArray = new byte[alignment * 2];
this.inHandle1 = GCHandle.Alloc(this.inArray1, GCHandleType.Pinned);
this.inHandle2 = GCHandle.Alloc(this.inArray2, GCHandleType.Pinned);
this.outHandle = GCHandle.Alloc(this.outArray, GCHandleType.Pinned);
this.alignment = (ulong)alignment;
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray1Ptr), ref Unsafe.As<Int32, byte>(ref inArray1[0]), (uint)sizeOfinArray1);
Unsafe.CopyBlockUnaligned(ref Unsafe.AsRef<byte>(inArray2Ptr), ref Unsafe.As<Int32, byte>(ref inArray2[0]), (uint)sizeOfinArray2);
}
public void* inArray1Ptr => Align((byte*)(inHandle1.AddrOfPinnedObject().ToPointer()), alignment);
public void* inArray2Ptr => Align((byte*)(inHandle2.AddrOfPinnedObject().ToPointer()), alignment);
public void* outArrayPtr => Align((byte*)(outHandle.AddrOfPinnedObject().ToPointer()), alignment);
public void Dispose()
{
inHandle1.Free();
inHandle2.Free();
outHandle.Free();
}
private static unsafe void* Align(byte* buffer, ulong expectedAlignment)
{
return (void*)(((ulong)buffer + expectedAlignment - 1) & ~(expectedAlignment - 1));
}
}
private struct TestStruct
{
public Vector64<Int32> _fld1;
public Vector64<Int32> _fld2;
public static TestStruct Create()
{
var testStruct = new TestStruct();
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref testStruct._fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
return testStruct;
}
public void RunStructFldScenario(SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32 testClass)
{
var result = AdvSimd.CompareLessThanOrEqual(_fld1, _fld2);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
public void RunStructFldScenario_Load(SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32 testClass)
{
fixed (Vector64<Int32>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
{
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2))
);
Unsafe.Write(testClass._dataTable.outArrayPtr, result);
testClass.ValidateResult(_fld1, _fld2, testClass._dataTable.outArrayPtr);
}
}
}
private static readonly int LargestVectorSize = 8;
private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int Op2ElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static readonly int RetElementCount = Unsafe.SizeOf<Vector64<Int32>>() / sizeof(Int32);
private static Int32[] _data1 = new Int32[Op1ElementCount];
private static Int32[] _data2 = new Int32[Op2ElementCount];
private static Vector64<Int32> _clsVar1;
private static Vector64<Int32> _clsVar2;
private Vector64<Int32> _fld1;
private Vector64<Int32> _fld2;
private DataTable _dataTable;
static SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32()
{
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _clsVar2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
}
public SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32()
{
Succeeded = true;
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld1), ref Unsafe.As<Int32, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector64<Int32>, byte>(ref _fld2), ref Unsafe.As<Int32, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector64<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetInt32(); }
for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetInt32(); }
_dataTable = new DataTable(_data1, _data2, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => AdvSimd.IsSupported;
public bool Succeeded { get; set; }
public void RunBasicScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_UnsafeRead));
var result = AdvSimd.CompareLessThanOrEqual(
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr)
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunBasicScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunBasicScenario_Load));
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_UnsafeRead));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.CompareLessThanOrEqual), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>) })
.Invoke(null, new object[] {
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr),
Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr)
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunReflectionScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunReflectionScenario_Load));
var result = typeof(AdvSimd).GetMethod(nameof(AdvSimd.CompareLessThanOrEqual), new Type[] { typeof(Vector64<Int32>), typeof(Vector64<Int32>) })
.Invoke(null, new object[] {
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr)),
AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr))
});
Unsafe.Write(_dataTable.outArrayPtr, (Vector64<Int32>)(result));
ValidateResult(_dataTable.inArray1Ptr, _dataTable.inArray2Ptr, _dataTable.outArrayPtr);
}
public void RunClsVarScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario));
var result = AdvSimd.CompareLessThanOrEqual(
_clsVar1,
_clsVar2
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
public void RunClsVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClsVarScenario_Load));
fixed (Vector64<Int32>* pClsVar1 = &_clsVar1)
fixed (Vector64<Int32>* pClsVar2 = &_clsVar2)
{
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(pClsVar1)),
AdvSimd.LoadVector64((Int32*)(pClsVar2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_clsVar1, _clsVar2, _dataTable.outArrayPtr);
}
}
public void RunLclVarScenario_UnsafeRead()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_UnsafeRead));
var op1 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray1Ptr);
var op2 = Unsafe.Read<Vector64<Int32>>(_dataTable.inArray2Ptr);
var result = AdvSimd.CompareLessThanOrEqual(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunLclVarScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunLclVarScenario_Load));
var op1 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray1Ptr));
var op2 = AdvSimd.LoadVector64((Int32*)(_dataTable.inArray2Ptr));
var result = AdvSimd.CompareLessThanOrEqual(op1, op2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(op1, op2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario));
var test = new SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32();
var result = AdvSimd.CompareLessThanOrEqual(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunClassLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassLclFldScenario_Load));
var test = new SimpleBinaryOpTest__CompareLessThanOrEqual_Vector64_Int32();
fixed (Vector64<Int32>* pFld1 = &test._fld1)
fixed (Vector64<Int32>* pFld2 = &test._fld2)
{
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
}
public void RunClassFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario));
var result = AdvSimd.CompareLessThanOrEqual(_fld1, _fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
public void RunClassFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunClassFldScenario_Load));
fixed (Vector64<Int32>* pFld1 = &_fld1)
fixed (Vector64<Int32>* pFld2 = &_fld2)
{
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(pFld1)),
AdvSimd.LoadVector64((Int32*)(pFld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(_fld1, _fld2, _dataTable.outArrayPtr);
}
}
public void RunStructLclFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario));
var test = TestStruct.Create();
var result = AdvSimd.CompareLessThanOrEqual(test._fld1, test._fld2);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructLclFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructLclFldScenario_Load));
var test = TestStruct.Create();
var result = AdvSimd.CompareLessThanOrEqual(
AdvSimd.LoadVector64((Int32*)(&test._fld1)),
AdvSimd.LoadVector64((Int32*)(&test._fld2))
);
Unsafe.Write(_dataTable.outArrayPtr, result);
ValidateResult(test._fld1, test._fld2, _dataTable.outArrayPtr);
}
public void RunStructFldScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario));
var test = TestStruct.Create();
test.RunStructFldScenario(this);
}
public void RunStructFldScenario_Load()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunStructFldScenario_Load));
var test = TestStruct.Create();
test.RunStructFldScenario_Load(this);
}
public void RunUnsupportedScenario()
{
TestLibrary.TestFramework.BeginScenario(nameof(RunUnsupportedScenario));
bool succeeded = false;
try
{
RunBasicScenario_UnsafeRead();
}
catch (PlatformNotSupportedException)
{
succeeded = true;
}
if (!succeeded)
{
Succeeded = false;
}
}
private void ValidateResult(Vector64<Int32> op1, Vector64<Int32> op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), op1);
Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), op2);
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(void* op1, void* op2, void* result, [CallerMemberName] string method = "")
{
Int32[] inArray1 = new Int32[Op1ElementCount];
Int32[] inArray2 = new Int32[Op2ElementCount];
Int32[] outArray = new Int32[RetElementCount];
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray1[0]), ref Unsafe.AsRef<byte>(op1), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray2[0]), ref Unsafe.AsRef<byte>(op2), (uint)Unsafe.SizeOf<Vector64<Int32>>());
Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector64<Int32>>());
ValidateResult(inArray1, inArray2, outArray, method);
}
private void ValidateResult(Int32[] left, Int32[] right, Int32[] result, [CallerMemberName] string method = "")
{
bool succeeded = true;
for (var i = 0; i < RetElementCount; i++)
{
if (Helpers.CompareLessThanOrEqual(left[i], right[i]) != result[i])
{
succeeded = false;
break;
}
}
if (!succeeded)
{
TestLibrary.TestFramework.LogInformation($"{nameof(AdvSimd)}.{nameof(AdvSimd.CompareLessThanOrEqual)}<Int32>(Vector64<Int32>, Vector64<Int32>): {method} failed:");
TestLibrary.TestFramework.LogInformation($" left: ({string.Join(", ", left)})");
TestLibrary.TestFramework.LogInformation($" right: ({string.Join(", ", right)})");
TestLibrary.TestFramework.LogInformation($" result: ({string.Join(", ", result)})");
TestLibrary.TestFramework.LogInformation(string.Empty);
Succeeded = false;
}
}
}
}
| -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.