/// 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((long)value); } }
+ public IntPtr DataPointer { get { return (IntPtr)m_Ptr; } set { m_Ptr = unchecked((ulong)value); } }
/// <summary>
/// Size of the argument referenced by DataPointer
/// </summary>
/// <param name="reserved">Value for reserved: 2 for per-provider metadata, 1 for per-event metadata</param>
internal unsafe void SetMetadata(byte* pointer, int size, int reserved)
{
- this.m_Ptr = (long)(ulong)(UIntPtr)pointer;
+ this.m_Ptr = (ulong)pointer;
this.m_Size = size;
this.m_Reserved = reserved; // Mark this descriptor as containing tracelogging-compatible metadata.
}
//Important, we pass this structure directly to the Win32 EventWrite API, so this structure must be layed out exactly
// the way EventWrite wants it.
- internal long m_Ptr;
+ internal ulong m_Ptr;
internal int m_Size;
#pragma warning disable 0649
internal int m_Reserved; // Used to pad the size to match the Win32 API
this.datas = datasTemp + 1;
*pinsTemp = GCHandle.Alloc(value, GCHandleType.Pinned);
- datasTemp->m_Ptr = (long)(ulong)(UIntPtr)(void*)pinsTemp->AddrOfPinnedObject();
+ datasTemp->DataPointer = pinsTemp->AddrOfPinnedObject();
datasTemp->m_Size = size;
}
throw new IndexOutOfRangeException(Resources.GetResourceString("EventSource_DataDescriptorsOutOfRange"));
}
- datasTemp->m_Ptr = (long)(ulong)(UIntPtr)this.scratch;
+ datasTemp->DataPointer = (IntPtr) this.scratch;
this.writingScalars = true;
}
}
if (eventTypes.typeInfos[i].DataType == typeof(string))
{
// Write out the size of the string
- descriptors[numDescrs].m_Ptr = (long)&descriptors[numDescrs + 1].m_Size;
+ descriptors[numDescrs].DataPointer = (IntPtr) (&descriptors[numDescrs + 1].m_Size);
descriptors[numDescrs].m_Size = 2;
numDescrs++;