GetTraceLoggerHandle function (evntrace.h)

A RegisterTraceGuids-based ("Classic") event provider uses the GetTraceLoggerHandle function to retrieve the handle of the event tracing session to which it should write events.

Providers call this function from their ControlCallback function.

Syntax

TRACELOGGER_HANDLE WMIAPI GetTraceLoggerHandle(
  [in] PVOID Buffer
);

Parameters

[in] Buffer

Pointer to a WNODE_HEADER structure. ETW passes this structure to the provider's ControlCallback function in the Buffer parameter.

The HistoricalContext member of WNODE_HEADER contains the session's handle.

Return value

If the function succeeds, it returns the event tracing session handle.

If the function fails, it returns INVALID_HANDLE_VALUE. To get extended error information, call the GetLastError function.

Remarks

You use the handle when calling the GetTraceEnableFlags and GetTraceEnableLevel functions to retrieve the enable flags and level values passed to the EnableTrace function.

Examples

For an example that uses GetTraceLoggerHandle, see Retrieving Event Data Using MOF.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header evntrace.h
Library Advapi32.lib
DLL Advapi32.dll

See also

GetTraceEnableFlags

GetTraceEnableLevel