diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs
index 357e3575812e5c..3c821a5ea2f824 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.CoreCLR.cs
@@ -6,10 +6,35 @@
namespace System.Runtime.InteropServices.Java
{
+ ///
+ /// Provides helpers to create and manage GC handles used for tracking references
+ /// between the managed runtime and a Java VM. These APIs allow managed objects
+ /// to be referenced from native Java code so the runtime can participate in
+ /// cross-reference processing and correctly control object lifetime across
+ /// the managed/native boundary.
+ ///
[CLSCompliant(false)]
[SupportedOSPlatform("android")]
public static partial class JavaMarshal
{
+ ///
+ /// Initializes the Java marshal subsystem with a callback used when the runtime
+ /// needs to mark managed objects that are referenced from Java during cross-
+ /// reference processing.
+ ///
+ /// A pointer to an unmanaged callback that
+ /// will be invoked to enumerate or mark managed objects referenced from Java
+ /// during a cross-reference sweep. The callback is expected to accept a
+ /// pointer describing the objects to mark.
+ /// Thrown when is null.
+ /// Thrown when the subsystem cannot be initialized or is reinitialized.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
+ ///
+ /// Only a single initialization is supported for the process. The runtime
+ /// stores the provided function pointer and will invoke it from internal
+ /// runtime code when cross-reference marking is required.
+ /// Additionally, this callback must be implemented in unmanaged code.
+ ///
public static unsafe void Initialize(delegate* unmanaged markCrossReferences)
{
ArgumentNullException.ThrowIfNull(markCrossReferences);
@@ -20,6 +45,20 @@ public static unsafe void Initialize(delegate* unmanaged
+ /// Creates a GC handle that native Java code can hold to reference a managed
+ /// object. The handle prevents the object from being reclaimed while the
+ /// native side holds the reference, and an opaque
+ /// value can be associated with the handle for later retrieval.
+ ///
+ /// The managed object to be referenced from native code.
+ /// An opaque pointer-sized value that will be associated
+ /// with the handle and can be retrieved by the runtime via .
+ /// Callers may use this to store native-side state or identifiers alongside
+ /// the handle.
+ /// A that represents the allocated reference-tracking handle.
+ /// Thrown when is null.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* context)
{
ArgumentNullException.ThrowIfNull(obj);
@@ -28,6 +67,18 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co
return GCHandle.FromIntPtr(handle);
}
+ ///
+ /// Retrieves the opaque context pointer associated with a reference-tracking
+ /// GC handle previously created using .
+ ///
+ /// The whose context should be returned.
+ /// The opaque context pointer associated with the handle.
+ /// Thrown when the provided handle is null or does not represent a reference-tracking handle.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
+ ///
+ /// The returned pointer is the exact value that was originally provided as
+ /// the context parameter when the handle was created.
+ ///
public static unsafe void* GetContext(GCHandle obj)
{
IntPtr handle = GCHandle.ToIntPtr(obj);
@@ -40,6 +91,15 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co
return context;
}
+ ///
+ /// Completes processing of cross references after the runtime has invoked the
+ /// callback provided to . This notifies the runtime of
+ /// handles that are no longer reachable from native Java code so the runtime
+ /// can release or update them accordingly.
+ ///
+ /// A pointer to the structure containing cross-reference information produced during marking.
+ /// A span of values that were determined to be unreachable from the native side.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
public static unsafe void FinishCrossReferenceProcessing(
MarkCrossReferencesArgs* crossReferences,
ReadOnlySpan unreachableObjectHandles)
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.NativeAot.cs
index c253114be4602d..a2393ed9eff14f 100644
--- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.NativeAot.cs
+++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.NativeAot.cs
@@ -6,10 +6,35 @@
namespace System.Runtime.InteropServices.Java
{
+ ///
+ /// Provides helpers to create and manage GC handles used for tracking references
+ /// between the managed runtime and a Java VM. These APIs allow managed objects
+ /// to be referenced from native Java code so the runtime can participate in
+ /// cross-reference processing and correctly control object lifetime across
+ /// the managed/native boundary.
+ ///
[CLSCompliant(false)]
[SupportedOSPlatform("android")]
public static partial class JavaMarshal
{
+ ///
+ /// Initializes the Java marshal subsystem with a callback used when the runtime
+ /// needs to mark managed objects that are referenced from Java during cross-
+ /// reference processing.
+ ///
+ /// A pointer to an unmanaged callback that
+ /// will be invoked to enumerate or mark managed objects referenced from Java
+ /// during a cross-reference sweep. The callback is expected to accept a
+ /// pointer describing the objects to mark.
+ /// Thrown when is null.
+ /// Thrown when the subsystem cannot be initialized or is reinitialized.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
+ ///
+ /// Only a single initialization is supported for the process. The runtime
+ /// stores the provided function pointer and will invoke it from internal
+ /// runtime code when cross-reference marking is required.
+ /// Additionally, this callback must be implemented in unmanaged code.
+ ///
public static unsafe void Initialize(delegate* unmanaged markCrossReferences)
{
ArgumentNullException.ThrowIfNull(markCrossReferences);
@@ -20,12 +45,38 @@ public static unsafe void Initialize(delegate* unmanaged
+ /// Creates a GC handle that native Java code can hold to reference a managed
+ /// object. The handle prevents the object from being reclaimed while the
+ /// native side holds the reference, and an opaque
+ /// value can be associated with the handle for later retrieval.
+ ///
+ /// The managed object to be referenced from native code.
+ /// An opaque pointer-sized value that will be associated
+ /// with the handle and can be retrieved by the runtime via .
+ /// Callers may use this to store native-side state or identifiers alongside
+ /// the handle.
+ /// A that represents the allocated reference-tracking handle.
+ /// Thrown when is null.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* context)
{
ArgumentNullException.ThrowIfNull(obj);
return GCHandle.FromIntPtr(RuntimeImports.RhHandleAllocCrossReference(obj, (IntPtr)context));
}
+ ///
+ /// Retrieves the opaque context pointer associated with a reference-tracking
+ /// GC handle previously created using .
+ ///
+ /// The whose context should be returned.
+ /// The opaque context pointer associated with the handle.
+ /// Thrown when the provided handle is null or does not represent a reference-tracking handle.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
+ ///
+ /// The returned pointer is the exact value that was originally provided as
+ /// the context parameter when the handle was created.
+ ///
public static unsafe void* GetContext(GCHandle obj)
{
IntPtr handle = GCHandle.ToIntPtr(obj);
@@ -37,6 +88,15 @@ public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* co
return (void*)context;
}
+ ///
+ /// Completes processing of cross references after the runtime has invoked the
+ /// callback provided to . This notifies the runtime of
+ /// handles that are no longer reachable from native Java code so the runtime
+ /// can release or update them accordingly.
+ ///
+ /// A pointer to the structure containing cross-reference information produced during marking.
+ /// A span of values that were determined to be unreachable from the native side.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
public static unsafe void FinishCrossReferenceProcessing(
MarkCrossReferencesArgs* crossReferences,
ReadOnlySpan unreachableObjectHandles)
diff --git a/src/libraries/System.Console/src/System/Console.cs b/src/libraries/System.Console/src/System/Console.cs
index 8664567c051666..f52a76011621a2 100644
--- a/src/libraries/System.Console/src/System/Console.cs
+++ b/src/libraries/System.Console/src/System/Console.cs
@@ -813,6 +813,10 @@ public static void WriteLine(string? value)
Out.WriteLine(value);
}
+ ///
+ /// Writes the specified read-only span of characters, followed by the current line terminator, to the standard output stream.
+ ///
+ /// The span of characters to write.
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public static void WriteLine(ReadOnlySpan value)
{
@@ -975,6 +979,10 @@ public static void Write(string? value)
Out.Write(value);
}
+ ///
+ /// Writes the specified read-only span of characters to the standard output stream.
+ ///
+ /// The span of characters to write.
[MethodImplAttribute(MethodImplOptions.NoInlining)]
public static void Write(ReadOnlySpan value)
{
diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.Async.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.Async.cs
index cfda985a0a4013..3ddd4623675765 100644
--- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.Async.cs
+++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Create.Async.cs
@@ -32,6 +32,7 @@ public static partial class ZipFile
/// A string specifying the path on the filesystem to open the archive on. The path is permitted
/// to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous operation. The task result is an opened in mode.
public static Task OpenReadAsync(string archiveFileName, CancellationToken cancellationToken = default) => OpenAsync(archiveFileName, ZipArchiveMode.Read, cancellationToken);
///
@@ -71,6 +72,7 @@ public static partial class ZipFile
/// If the file exists and is empty or does not exist, a new Zip file will be created.
/// Note that creating a Zip file with the ZipArchiveMode.Create
mode is more efficient when creating a new Zip file.
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous operation. The task result is an opened in the requested .
public static Task OpenAsync(string archiveFileName, ZipArchiveMode mode, CancellationToken cancellationToken = default) => OpenAsync(archiveFileName, mode, entryNameEncoding: null, cancellationToken);
///
@@ -149,6 +151,7 @@ public static partial class ZipFile
/// otherwise an is thrown.
///
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous operation. The task result is an opened in the requested .
public static async Task OpenAsync(string archiveFileName, ZipArchiveMode mode, Encoding? entryNameEncoding, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -212,6 +215,7 @@ public static async Task OpenAsync(string archiveFileName, ZipArchiv
/// The path to the directory on the file system to be archived.
/// The name of the archive to be created.
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous create operation. The task completes when the archive has been written to disk.
public static Task CreateFromDirectoryAsync(string sourceDirectoryName, string destinationArchiveFileName, CancellationToken cancellationToken = default) =>
DoCreateFromDirectoryAsync(sourceDirectoryName, destinationArchiveFileName, compressionLevel: null, includeBaseDirectory: false, entryNameEncoding: null, cancellationToken);
diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.Async.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.Async.cs
index 7c10cf783cf757..c77cdc2e242e36 100644
--- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.Async.cs
+++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFile.Extract.Async.cs
@@ -40,6 +40,7 @@ public static partial class ZipFile
/// The path to the archive on the file system that is to be extracted.
/// The path to the directory in which to place the extracted files, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous extract operation. The task completes when all entries have been extracted or an error occurs.
public static Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, CancellationToken cancellationToken = default) =>
ExtractToDirectoryAsync(sourceArchiveFileName, destinationDirectoryName, entryNameEncoding: null, overwriteFiles: false, cancellationToken);
@@ -75,6 +76,7 @@ public static Task ExtractToDirectoryAsync(string sourceArchiveFileName, string
/// The path to the directory in which to place the extracted files, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory.
/// True to indicate overwrite.
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous extract operation. The task completes when all entries have been extracted or an error occurs.
public static Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default) =>
ExtractToDirectoryAsync(sourceArchiveFileName, destinationDirectoryName, entryNameEncoding: null, overwriteFiles: overwriteFiles, cancellationToken);
@@ -188,6 +190,7 @@ public static Task ExtractToDirectoryAsync(string sourceArchiveFileName, string
/// otherwise an is thrown.
///
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous extract operation. The task completes when all entries have been extracted or an error occurs.
public static async Task ExtractToDirectoryAsync(string sourceArchiveFileName, string destinationDirectoryName, Encoding? entryNameEncoding, bool overwriteFiles, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Create.Async.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Create.Async.cs
index 189b3a9076535e..dd60c9c768986e 100644
--- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Create.Async.cs
+++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Create.Async.cs
@@ -42,7 +42,7 @@ public static partial class ZipFileExtensions
/// relative or absolute path information. Relative path information is interpreted as relative to the current working directory.
/// The name of the entry to be created.
/// The cancellation token to monitor for cancellation requests.
- /// A wrapper for the newly created entry.
+ /// A task that represents the asynchronous operation. The value of the task is the newly created entry.
public static Task CreateEntryFromFileAsync(this ZipArchive destination, string sourceFileName, string entryName, CancellationToken cancellationToken = default) =>
DoCreateEntryFromFileAsync(destination, sourceFileName, entryName, null, cancellationToken);
@@ -75,7 +75,7 @@ public static Task CreateEntryFromFileAsync(this ZipArchive des
/// The name of the entry to be created.
/// The level of the compression (speed/memory vs. compressed size trade-off).
/// The cancellation token to monitor for cancellation requests.
- /// A wrapper for the newly created entry.
+ /// A task that represents the asynchronous operation. The value of the task is the newly created entry.
public static Task CreateEntryFromFileAsync(this ZipArchive destination,
string sourceFileName, string entryName, CompressionLevel compressionLevel, CancellationToken cancellationToken = default) =>
DoCreateEntryFromFileAsync(destination, sourceFileName, entryName, compressionLevel, cancellationToken);
diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Extract.Async.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Extract.Async.cs
index f4be66987a5ec5..8b42376813a2da 100644
--- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Extract.Async.cs
+++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchive.Extract.Async.cs
@@ -36,6 +36,7 @@ public static partial class ZipFileExtensions
/// The directory specified must not exist. The path is permitted to specify relative or absolute path information.
/// Relative path information is interpreted as relative to the current working directory.
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous extract operation. The task completes when all entries have been extracted or an error occurs.
public static Task ExtractToDirectoryAsync(this ZipArchive source, string destinationDirectoryName, CancellationToken cancellationToken = default) =>
ExtractToDirectoryAsync(source, destinationDirectoryName, overwriteFiles: false, cancellationToken);
@@ -68,6 +69,7 @@ public static Task ExtractToDirectoryAsync(this ZipArchive source, string destin
/// Relative path information is interpreted as relative to the current working directory.
/// True to indicate overwrite.
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous extract operation. The task completes when all entries have been extracted or an error occurs.
public static async Task ExtractToDirectoryAsync(this ZipArchive source, string destinationDirectoryName, bool overwriteFiles, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
diff --git a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs
index c311d8d84bc690..188f1542af3834 100644
--- a/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs
+++ b/src/libraries/System.IO.Compression.ZipFile/src/System/IO/Compression/ZipFileExtensions.ZipArchiveEntry.Extract.Async.cs
@@ -33,7 +33,8 @@ public static partial class ZipFileExtensions
/// The name of the file that will hold the contents of the entry.
/// The path is permitted to specify relative or absolute path information.
/// Relative path information is interpreted as relative to the current working directory.
- /// /// The cancellation token to monitor for cancellation requests.
+ /// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous extract operation. The task completes when the entry contents have been written to the destination file.
public static Task ExtractToFileAsync(this ZipArchiveEntry source, string destinationFileName, CancellationToken cancellationToken = default) =>
ExtractToFileAsync(source, destinationFileName, false, cancellationToken);
@@ -65,6 +66,7 @@ public static Task ExtractToFileAsync(this ZipArchiveEntry source, string destin
/// Relative path information is interpreted as relative to the current working directory.
/// True to indicate overwrite.
/// The cancellation token to monitor for cancellation requests.
+ /// A task that represents the asynchronous extract operation. The task completes when the entry contents have been written to the destination file.
public static async Task ExtractToFileAsync(this ZipArchiveEntry source, string destinationFileName, bool overwrite, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchive.Async.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchive.Async.cs
index 19b025473e39b6..3144ee3f2096e6 100644
--- a/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchive.Async.cs
+++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/ZipArchive.Async.cs
@@ -62,6 +62,7 @@ public partial class ZipArchive : IDisposable, IAsyncDisposable
/// mode specified an invalid value.
/// The contents of the stream could not be interpreted as a Zip file. -or- mode is Update and an entry is missing from the archive or is corrupt and cannot be read. -or- mode is Update and an entry is too large to fit into memory.
/// If a Unicode encoding other than UTF-8 is specified for the entryNameEncoding
.
+ /// A task that represents the asynchronous initialization. The task result is a instance opened on the provided stream.
public static async Task CreateAsync(Stream stream, ZipArchiveMode mode, bool leaveOpen, Encoding? entryNameEncoding, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -125,6 +126,10 @@ public static async Task CreateAsync(Stream stream, ZipArchiveMode m
}
}
+ ///
+ /// Asynchronously releases the resources used by the .
+ ///
+ /// A that represents the asynchronous dispose operation.
public async ValueTask DisposeAsync() => await DisposeAsyncCore().ConfigureAwait(false);
protected virtual async ValueTask DisposeAsyncCore()
diff --git a/src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs b/src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs
index 5d36b227a7e9c5..7b857b4bf41d49 100644
--- a/src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs
+++ b/src/libraries/System.Linq.Queryable/src/System/Linq/Queryable.cs
@@ -2178,6 +2178,12 @@ public static bool SequenceEqual(this IQueryable source1, IEnu
}
[DynamicDependency("Shuffle`1", typeof(Enumerable))]
+ ///
+ /// Returns an whose ordering of elements is randomized.
+ ///
+ /// The type of the elements of .
+ /// The sequence to shuffle.
+ /// An representing a randomized ordering of .
public static IQueryable Shuffle(this IQueryable source)
{
ArgumentNullException.ThrowIfNull(source);
diff --git a/src/libraries/System.Linq/src/System/Linq/Reverse.cs b/src/libraries/System.Linq/src/System/Linq/Reverse.cs
index 657a18a1bf8f9a..b6b587849f99f0 100644
--- a/src/libraries/System.Linq/src/System/Linq/Reverse.cs
+++ b/src/libraries/System.Linq/src/System/Linq/Reverse.cs
@@ -8,6 +8,12 @@ namespace System.Linq
{
public static partial class Enumerable
{
+ ///
+ /// Returns a sequence with the elements of in reverse order.
+ ///
+ /// The type of the elements of .
+ /// The sequence whose elements should be reversed.
+ /// An that enumerates the elements of in reverse.
public static IEnumerable Reverse(this IEnumerable source)
{
if (source is null)
@@ -23,6 +29,12 @@ public static IEnumerable Reverse(this IEnumerable so
return new ReverseIterator(source);
}
+ ///
+ /// Returns a sequence with the elements of in reverse order.
+ ///
+ /// The type of the elements of .
+ /// The array whose elements should be reversed.
+ /// An that enumerates the elements of in reverse.
public static IEnumerable Reverse(this TSource[] source)
{
if (source is null)
diff --git a/src/libraries/System.Net.Primitives/src/System/Net/IPAddress.cs b/src/libraries/System.Net.Primitives/src/System/Net/IPAddress.cs
index e8a28bde6be3b3..b53353cdf18edc 100644
--- a/src/libraries/System.Net.Primitives/src/System/Net/IPAddress.cs
+++ b/src/libraries/System.Net.Primitives/src/System/Net/IPAddress.cs
@@ -230,6 +230,7 @@ internal IPAddress(int newAddress)
/// Determines whether the provided span contains a valid .
/// The text to parse.
+ /// if contains a valid IP address; otherwise, .
public static bool IsValidUtf8(ReadOnlySpan utf8Text) => IPAddressParser.IsValid(utf8Text);
///
diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs
index 7c2897d0e9b139..c64402cf89ea3b 100644
--- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs
+++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.cs
@@ -776,6 +776,7 @@ public override int ReadByte()
return bytesRead == 1 ? oneByte : -1;
}
+ ///
public override unsafe int Read(Span buffer)
{
ThrowIfExceptionalOrNotAuthenticated();
@@ -797,6 +798,7 @@ public override unsafe int Read(Span buffer)
}
}
+ ///
public override int Read(byte[] buffer, int offset, int count)
{
ThrowIfExceptionalOrNotAuthenticated();
@@ -806,8 +808,10 @@ public override int Read(byte[] buffer, int offset, int count)
return vt.GetAwaiter().GetResult();
}
+ ///
public override void WriteByte(byte value) => Write(new ReadOnlySpan(ref value));
+ ///
public override unsafe void Write(ReadOnlySpan buffer)
{
ThrowIfExceptionalOrNotAuthenticated();
@@ -831,6 +835,7 @@ public override unsafe void Write(ReadOnlySpan buffer)
public void Write(byte[] buffer) => Write(buffer, 0, buffer.Length);
+ ///
public override void Write(byte[] buffer, int offset, int count)
{
ThrowIfExceptionalOrNotAuthenticated();
diff --git a/src/libraries/System.Private.CoreLib/src/System/Guid.cs b/src/libraries/System.Private.CoreLib/src/System/Guid.cs
index fbb3c4a2922090..91ffb1504ee112 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Guid.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Guid.cs
@@ -345,6 +345,11 @@ public static Guid Parse(ReadOnlySpan input)
return result.ToGuid();
}
+ ///
+ /// Parses the specified sequence of UTF-8 encoded bytes and returns a new .
+ ///
+ /// A span containing the UTF-8 encoded representation of the GUID to parse.
+ /// The parsed .
public static Guid Parse(ReadOnlySpan utf8Text)
{
var result = new GuidResult(GuidParseThrowStyle.AllButOverflow);
@@ -380,6 +385,12 @@ public static bool TryParse(ReadOnlySpan input, out Guid result)
}
}
+ ///
+ /// Tries to parse the specified sequence of UTF-8 encoded bytes as a GUID.
+ ///
+ /// A span containing the UTF-8 encoded representation of the GUID to parse.
+ /// When this method returns, contains the parsed , if the parse succeeded; otherwise, the default value.
+ /// if the parse operation succeeded; otherwise, .
public static bool TryParse(ReadOnlySpan utf8Text, out Guid result)
{
var parseResult = new GuidResult(GuidParseThrowStyle.None);
diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs
index 91e596ea815f74..9184ab722c6b1c 100644
--- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs
@@ -365,7 +365,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(span)),
///
/// Searches for the specified value and returns true if found. If not found, returns false.
///
- ///
+ /// The type of the elements in the span.
/// The span to search.
/// The value to search for.
/// The implementation to use when comparing elements, or to use the default for the type of an element.
@@ -448,6 +448,7 @@ public static bool ContainsAnyExceptInRange(this Span span, T lowInclusive
///
/// Searches for any occurrence of the specified or , and returns true if found. If not found, returns false.
///
+ /// The type of the elements in the span.
/// The span to search.
/// One of the values to search for.
/// One of the values to search for.
@@ -458,6 +459,7 @@ public static bool ContainsAny(this ReadOnlySpan span, T value0, T value1)
///
/// Searches for any occurrence of the specified or , and returns true if found. If not found, returns false.
///
+ /// The type of the elements in the span.
/// The span to search.
/// One of the values to search for.
/// One of the values to search for.
@@ -492,6 +494,7 @@ public static bool ContainsAny(this ReadOnlySpan span, T value0, T value1,
///
/// Searches for any occurrence of any of the specified and returns true if found. If not found, returns false.
///
+ /// The type of the elements in the span.
/// The span to search.
/// The set of values to search for.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
@@ -501,6 +504,7 @@ public static bool ContainsAny(this ReadOnlySpan span, ReadOnlySpan val
///
/// Searches for any occurrence of any of the specified and returns true if found. If not found, returns false.
///
+ /// The type of the elements in the span.
/// The span to search.
/// The set of values to search for.
/// The comparer to use. If , is used.
@@ -3574,11 +3578,13 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(value)),
}
///
- /// Determines whether a specified sequence appears at the start of a read-only span.
+ /// Determines whether the beginning of this span matches the specified sequence.
///
- /// The source span.
+ /// The span to search.
/// The sequence to compare to the start of .
- /// The implementation to use when comparing elements, or to use the default for the type of an element.
+ /// An optional comparer to use for element equality checks.
+ /// The type of elements in the span and value.
+ /// if starts with ; otherwise, .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool StartsWith(this ReadOnlySpan span, ReadOnlySpan value, IEqualityComparer? comparer = null) =>
value.Length <= span.Length &&
@@ -3619,11 +3625,13 @@ ref MemoryMarshal.GetReference(value),
}
///
- /// Determines whether the specified sequence appears at the end of the read-only span.
+ /// Determines whether the end of this span matches the specified sequence.
///
- /// The source span.
+ /// The span to search.
/// The sequence to compare to the end of .
- /// The implementation to use when comparing elements, or to use the default for the type of an element.
+ /// An optional comparer to use for element equality checks.
+ /// The type of elements in the span and value.
+ /// if ends with ; otherwise, .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool EndsWith(this ReadOnlySpan span, ReadOnlySpan value, IEqualityComparer? comparer = null) =>
value.Length <= span.Length &&
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs
index 7b2a94ce56b175..4a5d4224f3cba2 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncHelpers.cs
@@ -18,6 +18,12 @@ public static partial class AsyncHelpers
// "BypassReadyToRun" is until AOT/R2R typesystem has support for MethodImpl.Async
// Must be NoInlining because we use AsyncSuspend to manufacture an explicit suspension point.
// It will not capture/restore any local state that is live across it.
+
+ ///
+ /// Awaits the specified awaiter and returns when the awaiter has completed.
+ ///
+ /// The awaiter type.
+ /// The awaiter to await.
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)]
[RequiresPreviewFeatures]
@@ -34,6 +40,12 @@ public static void AwaitAwaiter(TAwaiter awaiter) where TAwaiter : INo
// Must be NoInlining because we use AsyncSuspend to manufacture an explicit suspension point.
// It will not capture/restore any local state that is live across it.
+
+ ///
+ /// Awaits the specified awaiter without capturing the execution context and returns when the awaiter has completed.
+ ///
+ /// The awaiter type.
+ /// The awaiter to await.
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Async)]
[RequiresPreviewFeatures]
@@ -48,6 +60,12 @@ public static void UnsafeAwaitAwaiter(TAwaiter awaiter) where TAwaiter
AsyncSuspend(sentinelContinuation);
}
+
+ ///
+ /// Awaits the specified and returns its result, throwing any exception produced by the task.
+ ///
+ /// The result type produced by the task.
+ /// The task to await.
[Intrinsic]
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.Async)]
@@ -63,6 +81,10 @@ public static T Await(Task task)
return awaiter.GetResult();
}
+ ///
+ /// Awaits the specified and throws any exception produced by the operation.
+ ///
+ /// The value task to await.
[Intrinsic]
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.Async)]
@@ -78,6 +100,11 @@ public static void Await(Task task)
awaiter.GetResult();
}
+ ///
+ /// Awaits the specified and returns its result, throwing any exception produced by the operation.
+ ///
+ /// The result type produced by the value task.
+ /// The value task to await.
[Intrinsic]
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.Async)]
@@ -93,6 +120,10 @@ public static T Await(ValueTask task)
return awaiter.GetResult();
}
+ ///
+ /// Awaits the specified and throws any exception produced by the task.
+ ///
+ /// The task to await.
[Intrinsic]
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.Async)]
@@ -108,6 +139,10 @@ public static void Await(ValueTask task)
awaiter.GetResult();
}
+ ///
+ /// Awaits the specified configured task awaitable without capturing the execution context and throws any exception produced by the operation.
+ ///
+ /// The configured awaitable to await.
[Intrinsic]
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.Async)]
@@ -123,6 +158,10 @@ public static void Await(ConfiguredTaskAwaitable configuredAwaitable)
awaiter.GetResult();
}
+ ///
+ /// Awaits the specified configured value task awaitable without capturing the execution context and throws any exception produced by the operation.
+ ///
+ /// The configured value task awaitable to await.
[Intrinsic]
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.Async)]
@@ -138,6 +177,11 @@ public static void Await(ConfiguredValueTaskAwaitable configuredAwaitable)
awaiter.GetResult();
}
+ ///
+ /// Awaits the specified configured task awaitable and returns its result, throwing any exception produced by the operation.
+ ///
+ /// The result type produced by the awaitable.
+ /// The configured awaitable to await.
[Intrinsic]
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.Async)]
@@ -153,6 +197,11 @@ public static T Await(ConfiguredTaskAwaitable configuredAwaitable)
return awaiter.GetResult();
}
+ ///
+ /// Awaits the specified configured value task awaitable and returns its result, throwing any exception produced by the operation.
+ ///
+ /// The result type produced by the awaitable.
+ /// The configured awaitable to await.
[Intrinsic]
[BypassReadyToRun]
[MethodImpl(MethodImplOptions.Async)]
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs
index ad8ac43e906869..154cd64a421e88 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/Unsafe.cs
@@ -19,6 +19,7 @@ public static unsafe partial class Unsafe
///
/// Returns a pointer to the given by-ref parameter.
///
+ /// The type referenced by the byref parameter.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__AS_POINTER
// AOT:AsPointer
@@ -39,6 +40,7 @@ public static unsafe partial class Unsafe
///
/// Returns the size of an object of the given type parameter.
///
+ /// The type whose size is returned.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__SIZEOF
// AOT:SizeOf
@@ -54,6 +56,7 @@ public static int SizeOf()
///
/// Casts the given object to the specified type, performs no dynamic type checking.
///
+ /// The target reference type. The return value will be of this type.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__OBJECT_AS
// AOT:As
@@ -72,6 +75,8 @@ public static int SizeOf()
///
/// Reinterprets the given reference as a reference to a value of type .
///
+ /// The source type of the reference to reinterpret.
+ /// The destination type to reinterpret the reference as.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_AS
// AOT:As
@@ -91,6 +96,7 @@ public static ref TTo As(ref TFrom source)
///
/// Adds an element offset to the given reference.
///
+ /// The element type referenced by .
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_ADD
// AOT:Add
@@ -118,6 +124,7 @@ public static ref T Add(ref T source, int elementOffset)
///
/// Adds an element offset to the given reference.
///
+ /// The element type referenced by .
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_INTPTR_ADD
// AOT:Add
@@ -145,6 +152,7 @@ public static ref T Add(ref T source, nint elementOffset)
///
/// Adds an element offset to the given pointer.
///
+ /// The element type referenced by the pointer.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__PTR_ADD
// AOT:Add
@@ -174,6 +182,7 @@ public static ref T Add(ref T source, nint elementOffset)
///
/// Adds an element offset to the given reference.
///
+ /// The element type referenced by .
[Intrinsic]
// CoreCLR:
[NonVersionable]
@@ -200,6 +209,7 @@ public static ref T Add(ref T source, nuint elementOffset)
///
/// Adds an byte offset to the given reference.
///
+ /// The element type referenced by the source.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_ADD_BYTE_OFFSET_UINTPTR
// AOT:AddByteOffset
@@ -226,6 +236,7 @@ public static ref T AddByteOffset(ref T source, nuint byteOffset)
///
/// Determines whether the specified references point to the same location.
///
+ /// The element type referenced by the inputs.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_ARE_SAME
// AOT:AreSame
@@ -652,6 +663,7 @@ public static void WriteUnaligned(ref byte destination, T value)
///
/// Adds an byte offset to the given reference.
///
+ /// The element type referenced by the source.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_ADD_BYTE_OFFSET_INTPTR
// AOT:AddByteOffset
@@ -809,6 +821,7 @@ public static void SkipInit(out T value)
///
/// Subtracts an element offset from the given reference.
///
+ /// The element type referenced by .
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_INT_SUBTRACT
[NonVersionable]
@@ -835,6 +848,7 @@ public static ref T Subtract(ref T source, int elementOffset)
///
/// Subtracts an element offset from the given void pointer.
///
+ /// The element type referenced by the pointer.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__PTR_INT_SUBTRACT
[NonVersionable]
@@ -862,6 +876,7 @@ public static ref T Subtract(ref T source, int elementOffset)
///
/// Subtracts an element offset from the given reference.
///
+ /// The element type referenced by .
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_INTPTR_SUBTRACT
[NonVersionable]
@@ -887,6 +902,7 @@ public static ref T Subtract(ref T source, nint elementOffset)
///
/// Subtracts an element offset from the given reference.
///
+ /// The element type referenced by .
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_UINTPTR_SUBTRACT
[NonVersionable]
@@ -913,6 +929,7 @@ public static ref T Subtract(ref T source, nuint elementOffset)
///
/// Subtracts a byte offset from the given reference.
///
+ /// The element type referenced by the source.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_INTPTR_SUBTRACT_BYTE_OFFSET
[NonVersionable]
@@ -931,6 +948,7 @@ public static ref T SubtractByteOffset(ref T source, nint byteOffset)
///
/// Subtracts a byte offset from the given reference.
///
+ /// The element type referenced by the source.
[Intrinsic]
// CoreCLR:METHOD__UNSAFE__BYREF_UINTPTR_SUBTRACT_BYTE_OFFSET
[NonVersionable]
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/ExceptionHandling.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/ExceptionHandling.cs
index da598532381607..f8f6d6b22de547 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/ExceptionHandling.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/ExceptionServices/ExceptionHandling.cs
@@ -5,6 +5,9 @@
namespace System.Runtime.ExceptionServices
{
+ ///
+ /// Provides helpers for configuring and raising global unhandled exception handlers.
+ ///
public static class ExceptionHandling
{
private static Func? s_handler;
@@ -17,8 +20,9 @@ internal static bool IsHandledByGlobalHandler(Exception ex)
///
/// Sets a handler for unhandled exceptions.
///
- /// If handler is null
- /// If a handler is already set
+ /// A callback that will be invoked for unhandled exceptions. Return if the exception was handled; otherwise .
+ /// If handler is null.
+ /// If a handler is already set.
///
/// The handler will be called when an unhandled exception occurs.
/// The handler should return true if the exception was handled, or false if it was not.
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs
index e52270a905fc43..cad13fa67e9bfc 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/CollectionsMarshal.cs
@@ -46,6 +46,10 @@ public static Span AsSpan(List? list)
/// Get a view over a 's data.
///
/// The whose backing storage should be viewed.
+ ///
+ /// A representing the underlying byte storage for the given ,
+ /// or an empty span if is .
+ ///
///
///
/// The may have more capacity than is required to store the number of bits represented by
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs
index 121c6490b9e0dd..630d8b19b82d53 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/GCHandleExtensions.cs
@@ -22,6 +22,7 @@ public static class GCHandleExtensions
/// or if the handle doesn't point to any object.
///
/// If the handle is not initialized or already disposed.
+ /// The element type of the pinned array.
[CLSCompliant(false)]
public static unsafe T* GetAddressOfArrayData(
#nullable disable // Nullable oblivious because no covariance between PinnedGCHandle and PinnedGCHandle
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.Unsupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.Unsupported.cs
index 3914d81c2e6ab7..77b19803879b4a 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.Unsupported.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Java/JavaMarshal.Unsupported.cs
@@ -6,25 +6,85 @@
namespace System.Runtime.InteropServices.Java
{
+ ///
+ /// Provides helpers to create and manage GC handles used for tracking references
+ /// between the managed runtime and a Java VM. These APIs allow managed objects
+ /// to be referenced from native Java code so the runtime can participate in
+ /// cross-reference processing and correctly control object lifetime across
+ /// the managed/native boundary.
+ ///
[CLSCompliant(false)]
[SupportedOSPlatform("android")]
public static partial class JavaMarshal
{
+ ///
+ /// Initializes the Java marshal subsystem with a callback used when the runtime
+ /// needs to mark managed objects that are referenced from Java during cross-
+ /// reference processing.
+ ///
+ /// A pointer to an unmanaged callback that
+ /// will be invoked to enumerate or mark managed objects referenced from Java
+ /// during a cross-reference sweep. The callback is expected to accept a
+ /// pointer describing the objects to mark.
+ /// Thrown when is null.
+ /// Thrown when the subsystem cannot be initialized or is reinitialized.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
+ ///
+ /// Only a single initialization is supported for the process. The runtime
+ /// stores the provided function pointer and will invoke it from internal
+ /// runtime code when cross-reference marking is required.
+ /// Additionally, this callback must be implemented in unmanaged code.
+ ///
public static unsafe void Initialize(delegate* unmanaged markCrossReferences)
{
throw new PlatformNotSupportedException();
}
+ ///
+ /// Creates a GC handle that native Java code can hold to reference a managed
+ /// object. The handle prevents the object from being reclaimed while the
+ /// native side holds the reference, and an opaque
+ /// value can be associated with the handle for later retrieval.
+ ///
+ /// The managed object to be referenced from native code.
+ /// An opaque pointer-sized value that will be associated
+ /// with the handle and can be retrieved by the runtime via .
+ /// Callers may use this to store native-side state or identifiers alongside
+ /// the handle.
+ /// A that represents the allocated reference-tracking handle.
+ /// Thrown when is null.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
public static unsafe GCHandle CreateReferenceTrackingHandle(object obj, void* context)
{
throw new PlatformNotSupportedException();
}
+ ///
+ /// Retrieves the opaque context pointer associated with a reference-tracking
+ /// GC handle previously created using .
+ ///
+ /// The whose context should be returned.
+ /// The opaque context pointer associated with the handle.
+ /// Thrown when the provided handle is null or does not represent a reference-tracking handle.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
+ ///
+ /// The returned pointer is the exact value that was originally provided as
+ /// the context parameter when the handle was created.
+ ///
public static unsafe void* GetContext(GCHandle obj)
{
throw new PlatformNotSupportedException();
}
+ ///
+ /// Completes processing of cross references after the runtime has invoked the
+ /// callback provided to . This notifies the runtime of
+ /// handles that are no longer reachable from native Java code so the runtime
+ /// can release or update them accordingly.
+ ///
+ /// A pointer to the structure containing cross-reference information produced during marking.
+ /// A span of values that were determined to be unreachable from the native side.
+ /// Thrown when the runtime or platform does not support Java cross-reference marshalling.
public static unsafe void FinishCrossReferenceProcessing(
MarkCrossReferencesArgs* crossReferences,
ReadOnlySpan unreachableObjectHandles)
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs
index be6e089fc7b9bb..5678c6d60931b8 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs
@@ -635,10 +635,24 @@ public static IntPtr GetHINSTANCE(Module m)
#endif
///
- /// Converts the HRESULT to a CLR exception.
+ /// Converts an HRESULT value to a corresponding CLR .
///
+ /// The HRESULT value to convert.
+ ///
+ /// An that represents the supplied HRESULT, or
+ /// if indicates success (non-negative HRESULT).
+ ///
public static Exception? GetExceptionForHR(int errorCode) => GetExceptionForHR(errorCode, IntPtr.Zero);
+ ///
+ /// Converts an HRESULT value and optional error information into a CLR .
+ ///
+ /// The HRESULT value to convert.
+ /// Optional platform-specific error information (for example IErrorInfo on COM platforms), or when not provided.
+ ///
+ /// An that represents the supplied HRESULT and error information, or
+ /// if indicates success (non-negative HRESULT).
+ ///
public static Exception? GetExceptionForHR(int errorCode, IntPtr errorInfo)
{
if (errorCode >= 0)
@@ -649,6 +663,16 @@ public static IntPtr GetHINSTANCE(Module m)
return GetExceptionForHRInternal(errorCode, errorInfo);
}
+ ///
+ /// Converts an HRESULT value that is associated with a COM interface call into a CLR , using extended COM error information if the provided COM object supports it.
+ ///
+ /// The HRESULT value to convert.
+ /// The interface ID that was involved in the failing call. This may be used when probing for additional error info.
+ /// A pointer to the COM object involved in the failing call, or if unavailable.
+ ///
+ /// An that represents the supplied HRESULT and COM context, or
+ /// if indicates success (non-negative HRESULT).
+ ///
public static Exception? GetExceptionForHR(int errorCode, in Guid iid, IntPtr pUnk)
{
if (errorCode >= 0)
@@ -900,8 +924,10 @@ public static IntPtr GetHINSTANCE(Module m)
#endif
///
- /// Throws a CLR exception based on the HRESULT.
+ /// Throws a CLR exception that corresponds to the given HRESULT if it represents a failure.
///
+ /// The HRESULT value to evaluate.
+ /// An exception corresponding to when it is a failure (negative HRESULT).
public static void ThrowExceptionForHR(int errorCode)
{
if (errorCode < 0)
@@ -910,6 +936,12 @@ public static void ThrowExceptionForHR(int errorCode)
}
}
+ ///
+ /// Throws a CLR exception that corresponds to the given HRESULT and error information if it represents a failure.
+ ///
+ /// The HRESULT value to evaluate.
+ /// Optional platform-specific error information to be used when constructing the exception.
+ /// An exception corresponding to when it is a failure (negative HRESULT).
public static void ThrowExceptionForHR(int errorCode, IntPtr errorInfo)
{
if (errorCode < 0)
@@ -918,6 +950,13 @@ public static void ThrowExceptionForHR(int errorCode, IntPtr errorInfo)
}
}
+ ///
+ /// Throws a CLR exception that corresponds to the given HRESULT and COM context if it represents a failure, using extended COM error information if the provided COM object supports it.
+ ///
+ /// The HRESULT value to evaluate.
+ /// The interface ID that was involved in the failing call.
+ /// A pointer to the COM object involved in the failing call, or if unavailable.
+ /// An exception corresponding to when it is a failure (negative HRESULT).
public static void ThrowExceptionForHR(int errorCode, in Guid iid, IntPtr pUnk)
{
if (errorCode < 0)
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/WeakGCHandle.T.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/WeakGCHandle.T.cs
index b71f99c0d2f10d..348dfc7657d82b 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/WeakGCHandle.T.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/WeakGCHandle.T.cs
@@ -59,6 +59,7 @@ public readonly bool TryGetTarget([NotNullWhen(true)] out T? target)
}
/// Sets the object this handle represents.
+ /// The object to assign to this handle.
/// If the handle is not initialized or already disposed.
public readonly void SetTarget(T target)
{
diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs
index 632288f66d6b87..12a5499501edaa 100644
--- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs
+++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs
@@ -2090,6 +2090,7 @@ internal static void CheckAndAdd(Type type, Dictionary typesChecked,
ImportKnownTypeAttributes(type, typesChecked, ref nameToDataContractTable);
}
+ ///
public sealed override bool Equals(object? obj)
{
if ((object)this == obj)
@@ -2125,6 +2126,7 @@ internal bool IsEqualOrChecked(object? other, HashSet? chec
return false;
}
+ ///
public override int GetHashCode()
{
return base.GetHashCode();
diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/DeserializationEventHandler.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/DeserializationEventHandler.cs
index 8b5c5dd8c4405e..d3f4c727a627d5 100644
--- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/DeserializationEventHandler.cs
+++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/DeserializationEventHandler.cs
@@ -5,5 +5,6 @@ namespace System.Runtime.Serialization
{
internal delegate void DeserializationEventHandler(object? sender);
+ ///
public delegate void SerializationEventHandler(StreamingContext context);
}
diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs
index 6fac98c14aea1a..6d94a23dc8fcd3 100644
--- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs
+++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs
@@ -1611,6 +1611,7 @@ internal ObjectHolder Current
}
}
+ ///
public sealed class TypeLoadExceptionHolder
{
internal TypeLoadExceptionHolder(string? typeName)