// Write an event. unsafe int IEventProvider.EventWriteTransferWrapper( long registrationHandle, ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid *activityId, Guid *relatedActivityId, int userDataCount, EventProvider.EventData *userData) { uint eventID = (uint)eventDescriptor.EventId; if (eventID != 0 && eventHandle != IntPtr.Zero) { if (userDataCount == 0) { EventPipeInternal.WriteEventData(eventHandle, eventID, null, 0, activityId, relatedActivityId); return(0); } // If Channel == 11, this is a TraceLogging event. // The first 3 descriptors contain event metadata that is emitted for ETW and should be discarded on EventPipe. // EventPipe metadata is provided via the EventPipeEventProvider.DefineEventHandle. if (eventDescriptor.Channel == 11) { userData = userData + 3; userDataCount = userDataCount - 3; Debug.Assert(userDataCount >= 0); } EventPipeInternal.WriteEventData(eventHandle, eventID, &userData, (uint)userDataCount, activityId, relatedActivityId); } return(0); }
// Write an event. unsafe int IEventProvider.EventWriteTransferWrapper( long registrationHandle, ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid *activityId, Guid *relatedActivityId, int userDataCount, EventProvider.EventData *userData) { uint eventID = (uint)eventDescriptor.EventId; if (eventID != 0 && eventHandle != IntPtr.Zero) { if (userDataCount == 0) { EventPipeInternal.WriteEventData(eventHandle, eventID, null, 0, activityId, relatedActivityId); return(0); } EventPipeInternal.WriteEventData(eventHandle, eventID, &userData, (uint)userDataCount, activityId, relatedActivityId); } return(0); }