EventEnabled function

Determines if the event is enabled for any session.

Syntax

BOOLEAN EVNTAPI EventEnabled(
  REGHANDLE          RegHandle,
  PCEVENT_DESCRIPTOR EventDescriptor
);

Parameters

RegHandle

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

Note  A valid registration handle must be used.
 

EventDescriptor

Describes the event. For details, see EVENT_DESCRIPTOR.

Return Value

Returns TRUE if the event is enabled for a session; otherwise, 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. 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 generated an EVENT_DESCRIPTOR structure for the event from the manifest. If the event descriptor is not available, call the EventProviderEnabled 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

EventProviderEnabled