TraceQueryInformation function

The TraceQueryInformation function queries event tracing session settings for the specified information class.

Syntax

ULONG WMIAPI TraceQueryInformation(
  TRACEHANDLE      SessionHandle,
  TRACE_INFO_CLASS InformationClass,
  PVOID            TraceInformation,
  ULONG            InformationLength,
  PULONG           ReturnLength
);

Parameters

SessionHandle

A handle of the event tracing session that wants to capture the specified information. The StartTrace function returns this handle.

InformationClass

The information class to query. The information that the class captures is included in the extended data section of the event. For a list of information classes that you can query, see the TRACE_QUERY_INFO_CLASS enumeration.

TraceInformation

A pointer to a buffer to receive the returned information class specific data. The information class determines the contents of this parameter. For example, for the TraceStackTracingInfo information class, this parameter is an array of CLASSIC_EVENT_ID structures. The structures specify the event GUIDs for which stack tracing is enabled. The array is limited to 256 elements.

InformationLength

The size, in bytes, of the data returned in the TraceInformation buffer. If the function fails, this value indicates the required size of the TraceInformation buffer that is needed.

ReturnLength

A pointer a value that receives the size, in bytes, of the specific data returned in the TraceInformation buffer.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is one of the following error codes.

Return code Description
ERROR_BAD_LENGTH
The program issued a command but the command length is incorrect. This error is returned if the InformationLength parameter is less than a minimum size.
ERROR_INVALID_PARAMETER
The parameter is incorrect.
ERROR_NOT_SUPPORTED
The request is not supported.
Other
Use FormatMessage to obtain the message string for the returned error.

Remarks

The TraceQueryInformation function queries event tracing session settings for the specified information class. Call this function after calling StartTrace.

Requirements

   
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header evntrace.h
Library Sechost.lib on Windows 8.1 and Windows Server 2012 R2; Advapi32.lib on Windows 8 and Windows Server 2012
DLL Sechost.dll on Windows 8.1 and Windows Server 2012 R2; Advapi32.dll on Windows 8 and Windows Server 2012

See also

TRACE_QUERY_INFO_CLASS

TraceSetInformation