EventProviderEnabled function (evntprov.h)

Determines if the event is enabled for any session.

Syntax

BOOLEAN EVNTAPI EventProviderEnabled(
  REGHANDLE RegHandle,
  UCHAR     Level,
  ULONGLONG Keyword
);

Parameters

RegHandle

Registration handle of the provider. The handle comes from EventRegister.

Level

Level of detail included in the event. Specify one of the following levels that are defined in Winmeta.h. Higher numbers imply that you get lower levels as well. For example, if you specify TRACE_LEVEL_WARNING, you also receive all warning, error, and fatal events.

Value Meaning
WINEVENT_LEVEL_CRITICAL
1
Abnormal exit or termination events.
WINEVENT_LEVEL_ERROR
2
Severe error events.
WINEVENT_LEVEL_WARNING
3
Warning events such as allocation failures.
WINEVENT_LEVEL_INFO
4
Non-error events such as entry or exit events.
WINEVENT_LEVEL_VERBOSE
5
Detailed trace events.

Keyword

Bitmask that specifies the event category. This mask should be the same keyword mask that you defined in the manifest for the event.

Return value

Returns TRUE if the event is enabled for a session; otherwise, returns FALSE.

Remarks

Typically, providers do not call this function to determine if a session is expecting this event; they simply write the event and ETW determines if the event is logged to the session.

Providers may want to call this function if they need to perform extra work to generate the event. In this case, calling this function first (to determine if a session is expecting this event or not) may save resources and time.

The provider would call this function if the provider did not generate an EVENT_DESCRIPTOR structure for the event from the manifest. If the event descriptor is available, call the EventEnabled function.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header evntprov.h
Library Advapi32.lib
DLL Advapi32.dll

See also

EVENT_DESCRIPTOR

EventEnabled

EventRegister