Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

EventSource.EventData Structure

.NET Framework (current version)

Provides the event data for creating fast WriteEvent overloads by using the WriteEventCore method.

Namespace:   System.Diagnostics.Tracing
Assembly:  mscorlib (in mscorlib.dll)

protected internal struct EventData


Gets or sets the pointer to the data for the new WriteEvent overload.


Gets or sets the number of payload items in the new WriteEvent overload.


Indicates whether this instance and a specified object are equal.(Inherited from ValueType.)


Returns the hash code for this instance.(Inherited from ValueType.)


Gets the Type of the current instance.(Inherited from Object.)


Returns the fully qualified type name of this instance.(Inherited from ValueType.)

The following example shows how to use the EventSource.EventData structure.

public unsafe void WriteEvent(int eventId, int arg1, int arg2, int arg3, int arg4) {
    EventData* dataDesc = stackalloc EventProvider.EventData[4];

    dataDesc[0].DataPointer = (IntPtr)(&arg1);
    dataDesc[0].Size = 4;
    dataDesc[1].DataPointer = (IntPtr)(&arg2);
    dataDesc[1].Size = 4;
    dataDesc[2].DataPointer = (IntPtr)(&arg3);
    dataDesc[2].Size = 4;
    dataDesc[3].DataPointer = (IntPtr)(&arg4);
    dataDesc[3].Size = 4;

    WriteEventCore(eventId, 4, (IntPtr)dataDesc);

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.5
Portable Class Library
Supported in: portable .NET platforms
Windows Phone
Available since 8.1

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
© 2017 Microsoft