The TraceMessageVa function sends an informational message with variable arguments to an event tracing session.
ULONG TraceMessageVa( TRACEHANDLE LoggerHandle, ULONG MessageFlags, LPCGUID MessageGuid, USHORT MessageNumber, va_list MessageArgList );
Adds additional information to the beginning of the provider-specific data section of the event. The provider-specific data section of the event will contain data only for those flags that are set. The variable list of argument data will follow this information. This parameter can be one or more of the following values.
The information is included in the event data in the following order:
- Sequence number
- Event trace class GUID
- Time stamp
- Thread identifier
- Process identifier
Class GUID that identifies the event trace message.
Number that uniquely identifies each occurrence of the message. You must define the value specified for this parameter; the value should be meaningful to the application.
List of variable arguments to be appended to the message. The list must be composed of pairs of arguments, as described in the following table.
||Pointer to the argument data.|
||The size of the argument data, in bytes.|
Terminate the list using an argument pair consisting of a pointer to NULL and zero.
The caller must ensure that the sum of the sizes of the arguments + 72 does not exceed the size of the event tracing session's buffer.
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is one of the system error codes. The following table includes some common errors and their causes.
||Either the SessionHandle is NULL or specifies the NT Kernel Logger session handle.|
The session ran out of free buffers to write to. This can occur during high event rates because the disk subsystem is overloaded or the number of buffers is too small. Rather than blocking until more buffers become available, TraceMessage discards the event.
Windows 2000 and Windows XP: Not supported.
||The event is discarded because, although the buffer pool has not reached its maximum size, there is insufficient available memory to allocate an additional buffer and there is no buffer available to receive the event.|
||MessageFlags contains a value that is not valid.|
||Data from a single event cannot span multiple buffers. A trace event is limited to the size of the event tracing session's buffer minus the size of the EVENT_TRACE_HEADER structure.|
Providers call this function.
The trace events are written in the order in which they occur.
If you do not need to access the message tracing functionality from a wrapper function, you can call the TraceMessage version of this function.
Consumers will have to use the EventCallback callback to receive and process the events if the MessageFlags parameter does not contain the TRACE_MESSAGE_GUID flag. If you do not specify the TRACE_MESSAGE_GUID flag, the consumer will not be able to use the EventClassCallback because the Header.Guid member of the EVENT_TRACE structure will not contain the event trace class GUID.
Note that the members of the EVENT_TRACE and EVENT_TRACE_HEADER structures that correspond to the MessageFlags flags are set only if the corresponding flag is specified. For example, the ThreadId and ProcessId members of EVENT_TRACE_HEADER are populated only if you specify the TRACE_MESSAGE_SYSTEMINFO flag.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|