GetTraceEnableLevel function

The GetTraceEnableLevel function retrieves the severity level passed by the controller to indicate the level of logging the provider should perform.

Providers can only call this function from their ControlCallback function.

Syntax

UCHAR WMIAPI GetTraceEnableLevel(
  TRACEHANDLE TraceHandle
);

Parameters

TraceHandle

Handle to an event tracing session, obtained by calling the GetTraceLoggerHandle function.

Return Value

Returns the value the controller specified in the EnableLevel parameter when calling the EnableTrace function.

To determine if the function failed or the controller set the enable flags to 0, follow these steps:

  • Call the SetLastError function to set the last error to ERROR_SUCCESS.
  • Call the GetTraceEnableLevel function to retrieve the enable level.
  • If the enable level value is 0, call the GetLastError function to retrieve the last known error.
  • If the last known error is ERROR_SUCCESS, the controller set the enable level to 0; otherwise, the GetTraceEnableLevel function failed with the last known error.

Remarks

Providers use this value to control the severity of events that it generates. For example, providers can use this value to determine if it should generate informational, warning, or error events.

Examples

For an example that uses GetTraceEnableLevel, 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]
Target Platform Windows
Header evntrace.h
Library Advapi32.lib
DLL Advapi32.dll

See Also

GetTraceEnableFlags

GetTraceLoggerHandle