Additional fix for ETW failure in 32 process on 64 bit machines. (dotnet/coreclr...
authorVance Morrison <vancem@microsoft.com>
Sat, 3 Jun 2017 15:30:36 +0000 (08:30 -0700)
committerJan Kotas <jkotas@microsoft.com>
Sat, 3 Jun 2017 15:30:36 +0000 (08:30 -0700)
* Addtional fix for ETW failure in 32 process on 64 bit machines.

The commit associated with Pull Request
    Fix failures in ETW logging on 4GB aware 32 bit processes dotnet/coreclr#11941

Was incorrect.   Some long were changed to ulong, but the critical casting an IntPtr to ulong still does
sign extention and not zero extension.   Need to cast to a void* first.  This fixes this.

Commit migrated from https://github.com/dotnet/coreclr/commit/170c8257ea663d95f8ea61b146473be54090905e

src/coreclr/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs

index a4b9d4b..881a929 100755 (executable)
@@ -1134,7 +1134,7 @@ namespace System.Diagnostics.Tracing
             /// Address where the one argument lives (if this points to managed memory you must ensure the
             /// managed object is pinned.
             /// </summary>
-            public IntPtr DataPointer { get { return (IntPtr)m_Ptr; } set { m_Ptr = unchecked((ulong)value); } }
+            public unsafe IntPtr DataPointer { get { return (IntPtr)(void*)m_Ptr; } set { m_Ptr = unchecked((ulong)(void*)value); } }
             /// <summary>
             /// Size of the argument referenced by DataPointer
             /// </summary>