PEVENT_TRACE_BUFFER_CALLBACKW callback function (evntrace.h)

ETW event consumers implement this function to receive statistics about each buffer of events that ETW delivers during a trace processing session. ETW calls this function after the events for each buffer are delivered.

The PEVENT_TRACE_BUFFER_CALLBACK type defines a pointer to this callback function. BufferCallback is a placeholder for the application-defined function name.

Syntax

PEVENT_TRACE_BUFFER_CALLBACKW PeventTraceBufferCallbackw;

ULONG PeventTraceBufferCallbackw(
  PEVENT_TRACE_LOGFILEW Logfile
)
{...}

Parameters

Logfile

Pointer to an EVENT_TRACE_LOGFILE structure that contains information about the buffer.

Return value

To continue processing events, return TRUE. Otherwise, return FALSE. Returning FALSE will terminate the ProcessTrace function.

Remarks

To specify the function that ETW calls to deliver the buffer statistics, set the BufferCallback member of the EVENT_TRACE_LOGFILE structure that you pass to the OpenTrace function.

Examples

For an example implementation of a BufferCallback function, see Retrieving Event Data Using MOF.

Note

The evntrace.h header defines PEVENT_TRACE_BUFFER_CALLBACK as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header evntrace.h

See also

EVENT_TRACE_LOGFILE

OpenTrace

ProcessTrace