From 9c2b49448338d4ecb7e885488b68cd5b282a1414 Mon Sep 17 00:00:00 2001 From: Vance Morrison Date: Mon, 6 Aug 2018 09:00:07 -0700 Subject: [PATCH] Review feedback Commit migrated from https://github.com/dotnet/coreclr/commit/ba567402151b15ddd858dd1ab9b35e29c8e79b6d --- .../src/System/Diagnostics/Tracing/EventSource.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs index 4670cc6..9899afe 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs @@ -1780,10 +1780,11 @@ namespace System.Diagnostics.Tracing if (dataType.IsEnum()) { dataType = Enum.GetUnderlyingType(dataType); + if (Runtime.InteropServices.Marshal.SizeOf(dataType) < sizeof(int)) + dataType = typeof(int); goto Again; } - // Everything else is marshaled as a string. // ETW strings are NULL-terminated, so marshal everything up to the first // null in the string. @@ -1794,7 +1795,6 @@ namespace System.Diagnostics.Tracing } return new string((char *)dataPointer); - } finally { @@ -5479,7 +5479,7 @@ namespace System.Diagnostics.Tracing } } - // the OS requrires that bitmaps and valuemaps have at least one value or it reject the whole manifest. + // the OS requires that bitmaps and valuemaps have at least one value or it reject the whole manifest. // To avoid that put a 'None' entry if there are no other values. if (!anyValuesWritten) { -- 2.7.4