Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@

using System;
using System.Runtime.InteropServices;
#if ES_BUILD_STANDALONE
using Microsoft.Diagnostics.Tracing;
#else
using System.Diagnostics.Tracing;
#endif

internal static partial class Interop
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ namespace System.Net
/// <summary>Provides logging facilities for System.Net libraries.</summary>
internal sealed partial class NetEventSource : EventSource
{
#if !ES_BUILD_STANDALONE
private const string EventSourceSuppressMessage = "Parameters to this method are primitive and are trimmer safe";
#endif

/// <summary>The single event source instance to use for all logging.</summary>
public static readonly NetEventSource Log = new NetEventSource();
Expand Down Expand Up @@ -373,10 +371,8 @@ private static string Format(FormattableString s)

#region Custom WriteEvent overloads

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, string? arg4)
{
Expand Down Expand Up @@ -421,10 +417,8 @@ private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string?
}
}

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, byte[]? arg3)
{
Expand Down Expand Up @@ -468,10 +462,8 @@ private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, byte[]?
}
}

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, string? arg1, int arg2, int arg3, int arg4)
{
Expand Down Expand Up @@ -510,10 +502,8 @@ private unsafe void WriteEvent(int eventId, string? arg1, int arg2, int arg3, in
}
}

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, string? arg1, int arg2, string? arg3)
{
Expand Down Expand Up @@ -549,10 +539,8 @@ private unsafe void WriteEvent(int eventId, string? arg1, int arg2, string? arg3
}
}

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, int arg3)
{
Expand Down Expand Up @@ -588,10 +576,8 @@ private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, int arg3
}
}

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string? arg3, int arg4)
{
Expand Down Expand Up @@ -634,10 +620,8 @@ private unsafe void WriteEvent(int eventId, string? arg1, string? arg2, string?
}
}

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, string arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8)
{
Expand Down Expand Up @@ -696,10 +680,8 @@ private unsafe void WriteEvent(int eventId, string arg1, int arg2, int arg3, int
}
}

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern",
Justification = EventSourceSuppressMessage)]
#endif
[NonEvent]
private unsafe void WriteEvent(int eventId, string arg1, string arg2, int arg3, int arg4, int arg5)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ namespace System.Net
{
internal sealed partial class NetEventSource
{
#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification = "parameter intent is an enum and is trimmer safe")]
#endif
[Event(AcquireDefaultCredentialId, Keywords = Keywords.Default, Level = EventLevel.Informational)]
public void AcquireDefaultCredential(string packageName, Interop.SspiCli.CredentialUse intent)
{
Expand Down Expand Up @@ -64,10 +62,8 @@ public void AcceptSecurityContext(SafeFreeCredentials? credential, SafeDeleteCon
private void AcceptSecurityContext(string credential, string context, Interop.SspiCli.ContextFlags inFlags) =>
WriteEvent(AcceptSecuritContextId, credential, context, (int)inFlags);

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification = "parameter errorCode is an enum and is trimmer safe")]
#endif
[Event(OperationReturnedSomethingId, Keywords = Keywords.Default, Level = EventLevel.Informational)]
public void OperationReturnedSomething(string operation, Interop.SECURITY_STATUS errorCode)
{
Expand All @@ -77,10 +73,8 @@ public void OperationReturnedSomething(string operation, Interop.SECURITY_STATUS
}
}

#if !ES_BUILD_STANDALONE
[UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:RequiresUnreferencedCode",
Justification = "parameter errorCode is an enum and is trimmer safe")]
#endif
[Event(SecurityContextInputBufferId, Keywords = Keywords.Default, Level = EventLevel.Informational)]
public void SecurityContextInputBuffer(string context, int inputBufferSize, int outputBufferSize, Interop.SECURITY_STATUS errorCode)
{
Expand Down
8 changes: 0 additions & 8 deletions src/libraries/Common/src/System/Sha1ForNonSecretPurposes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,7 @@ public void Append(byte input)
/// <param name="input">
/// Data to include in the hash. Must not be null.
/// </param>
#if ES_BUILD_STANDALONE
public void Append(byte[] input)
#else
public void Append(ReadOnlySpan<byte> input)
#endif
{
foreach (byte b in input)
{
Expand All @@ -79,11 +75,7 @@ public void Append(ReadOnlySpan<byte> input)
/// bytes will be lost. If the buffer is larger than 20 bytes, the
/// rest of the buffer is left unmodified.
/// </param>
#if ES_BUILD_STANDALONE
public void Finish(byte[] output)
#else
public void Finish(Span<byte> output)
#endif
{
long l = _length + 8 * _pos;
Append(0x80);
Expand Down

This file was deleted.

This file was deleted.

Loading