EtwEventEnabled function (wdm.h)

The EtwEventEnabled function verifies whether an event is enabled.


BOOLEAN EtwEventEnabled(
  [in] REGHANDLE          RegHandle,
  [in] PCEVENT_DESCRIPTOR EventDescriptor


[in] RegHandle

A pointer to the event provider registration handle, which is returned by the EtwRegister function if the event provider registration is successful.

[in] EventDescriptor

A pointer to a constant EVENT_DESCRIPTOR.

Return value

The EtwEventEnabled function returns TRUE if the event is enabled and FALSE if the event is not enabled.


If logging an event requires additional computing, the EtwEventEnabled function can be used to determine whether the event is going to be logged, which will minimize the overhead when logging is disabled.

If the event descriptor is not available, use the EtwProviderEnabled function instead.


Minimum supported client Available in Windows Vista and later versions of Windows.
Target Platform Universal
Header wdm.h (include Wdm.h, Ntddk.h)
Library NtosKrnl.lib
DLL NtosKrnl.exe
IRQL Any level

See also