GetTraceLoggerHandle function

The GetTraceLoggerHandle function retrieves the handle of the event tracing session.

Providers can only call this function from their ControlCallback function.

Syntax

TRACEHANDLE GetTraceLoggerHandle(
  _In_ PVOID Buffer
);

Parameters

Buffer [in]

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

Minimum supported client
Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server
Windows 2000 Server [desktop apps | UWP apps]
Minimum supported phone
Windows Phone 8.1
Header
Evntrace.h
Library
Advapi32.lib
DLL
Advapi32.dll

See also

GetTraceEnableFlags

GetTraceEnableLevel