winstd::event_provider Class Reference
Event Tracing for Windows API

ETW event provider. More...

`#include <WinStd/ETW.h>`

Inheritance diagram for winstd::event_provider:

## Public Member Functions

virtual | ~event_provider ()
| Closes the event provider. More...
ULONG | create (LPCGUID ProviderId)
| Registers the event provider. More...
ULONG | write (PCEVENT_DESCRIPTOR EventDescriptor)
| Writes an event with no parameters. More...
ULONG | write (PCEVENT_DESCRIPTOR EventDescriptor, ULONG UserDataCount=0, PEVENT_DATA_DESCRIPTOR UserData=NULL)
| Writes an event with parameters stored in array. More...
ULONG | write (PCEVENT_DESCRIPTOR EventDescriptor, const EVENT_DATA_DESCRIPTOR param1,...)
| Writes an event with one or more parameter. More...
ULONG | write (PCEVENT_DESCRIPTOR EventDescriptor, va_list arg)
| Writes an event with variable number of parameters. More...
ULONG | write (UCHAR Level, ULONGLONG Keyword, PCWSTR String,...)
| Writes a string event. More...
Public Member Functions inherited from winstd::handle< REGHANDLE, NULL >
| handle () noexcept
| Initializes a new class instance with the object handle set to INVAL.
| handle (handle_type h) noexcept
| Initializes a new class instance with an already available object handle. More...
| handle (handle< handle_type, INVAL > &&h) noexcept
| Move constructor. More...
handle< handle_type, INVAL > & | operator= (handle_type h) noexcept
| Attaches already available object handle. More...
handle< handle_type, INVAL > & | operator= (handle< handle_type, INVAL > &&h) noexcept
| Move assignment. More...
| operator handle_type () const
| Auto-typecasting operator. More...
handle_type *& | operator* () const
| Returns the object handle value when the object handle is a pointer to a value (class, struct, etc.). More...
handle_type * | operator& ()
| Returns the object handle reference. More...
handle_type | operator-> () const
| Provides object handle member access when the object handle is a pointer to a class or struct. More...
bool | operator! () const
| Tests if the object handle is INVAL. More...
bool | operator< (handle_type h) const
| Is handle less than? More...
bool | operator<= (handle_type h) const
| Is handle less than or equal to? More...
bool | operator>= (handle_type h) const
| Is handle greater than or equal to? More...
bool | operator> (handle_type h) const
| Is handle greater than? More...
bool | operator!= (handle_type h) const
| Is handle not equal to? More...
bool | operator== (handle_type h) const
| Is handle equal to? More...
void | attach (handle_type h) noexcept
| Sets a new object handle for the class. More...
handle_type | detach ()
| Dismisses the object handle from this class. More...
void | free ()
| Destroys the object.

## Protected Member Functions

void | free_internal () noexcept override
| Releases the event provider. More...
virtual void | enable_callback (LPCGUID SourceId, ULONG IsEnabled, UCHAR Level, ULONGLONG MatchAnyKeyword, ULONGLONG MatchAllKeyword, PEVENT_FILTER_DESCRIPTOR FilterData)
| Receive enable or disable notification requests. More...
virtual void | free_internal () noexcept=0
| Abstract member function that must be implemented by child classes to do the actual object destruction. More...

## Static Protected Member Functions

static VOID NTAPI | enable_callback (LPCGUID SourceId, ULONG IsEnabled, UCHAR Level, ULONGLONG MatchAnyKeyword, ULONGLONG MatchAllKeyword, PEVENT_FILTER_DESCRIPTOR FilterData, PVOID CallbackContext)
| Receive enable or disable notification requests. More...

## Additional Inherited Members

Public Types inherited from winstd::handle< REGHANDLE, NULL >
typedef REGHANDLE | handle_type
| Datatype of the object handle this template class handles.
Static Public Attributes inherited from winstd::handle< REGHANDLE, NULL >
static const REGHANDLE | invalid
| Invalid handle value.
Protected Attributes inherited from winstd::handle< REGHANDLE, NULL >
handle_type | m_h
| Object handle.

## Detailed Description

ETW event provider.

## Constructor & Destructor Documentation

## ~event_provider()

virtual winstd::event_provider::~event_provider | ( |  | ) |

inlinevirtual

Closes the event provider.

See also
  EventUnregister function

## Member Function Documentation

## create()

ULONG winstd::event_provider::create | ( | LPCGUID | ProviderId | ) |

inline

Registers the event provider.

Returns
  - `ERROR_SUCCESS` when creation succeeds;
  - error code otherwise.

See also
  EventRegister function

## enable_callback() [1/2]

virtual void winstd::event_provider::enable_callback | ( | LPCGUID | SourceId,
|  | ULONG | IsEnabled,
|  | UCHAR | Level,
|  | ULONGLONG | MatchAnyKeyword,
|  | ULONGLONG | MatchAllKeyword,
|  | PEVENT_FILTER_DESCRIPTOR | FilterData
| ) |  |

inlineprotectedvirtual

Receive enable or disable notification requests.

See also
  EnableCallback callback function

## enable_callback() [2/2]

static VOID NTAPI winstd::event_provider::enable_callback | ( | LPCGUID | SourceId,
|  | ULONG | IsEnabled,
|  | UCHAR | Level,
|  | ULONGLONG | MatchAnyKeyword,
|  | ULONGLONG | MatchAllKeyword,
|  | PEVENT_FILTER_DESCRIPTOR | FilterData,
|  | PVOID | CallbackContext
| ) |  |

inlinestaticprotected

Receive enable or disable notification requests.

See also
  EnableCallback callback function

## free_internal()

void winstd::event_provider::free_internal | ( |  | ) |

inlineoverrideprotectedvirtualnoexcept

Releases the event provider.

See also
  EventUnregister function

Implements winstd::handle< REGHANDLE, NULL >.

## write() [1/5]

ULONG winstd::event_provider::write | ( | PCEVENT_DESCRIPTOR | EventDescriptor | ) |

inline

Writes an event with no parameters.

Returns
  - `ERROR_SUCCESS` when write succeeds;
  - error code otherwise.

See also
  EventWrite function

## write() [2/5]

ULONG winstd::event_provider::write | ( | PCEVENT_DESCRIPTOR | EventDescriptor,
|  | const EVENT_DATA_DESCRIPTOR | param1,
|  |  | ...
| ) |  |

inline

Writes an event with one or more parameter.

Note
  The list must be terminated with `winstd::blank_event_data`.

Returns
  - `ERROR_SUCCESS` when write succeeds;
  - error code otherwise.

See also
  EventWrite function

## write() [3/5]

ULONG winstd::event_provider::write | ( | PCEVENT_DESCRIPTOR | EventDescriptor,
|  | ULONG | UserDataCount = `0`,
|  | PEVENT_DATA_DESCRIPTOR | UserData = `NULL`
| ) |  |

inline

Writes an event with parameters stored in array.

Returns
  - `ERROR_SUCCESS` when write succeeds;
  - error code otherwise.

See also
  EventWrite function

## write() [4/5]

ULONG winstd::event_provider::write | ( | PCEVENT_DESCRIPTOR | EventDescriptor,
|  | va_list | arg
| ) |  |

inline

Writes an event with variable number of parameters.

Note
  The list must be terminated with `winstd::blank_event_data`.

Returns
  - `ERROR_SUCCESS` when write succeeds;
  - error code otherwise.

See also
  EventWrite function

## write() [5/5]

ULONG winstd::event_provider::write | ( | UCHAR | Level,
|  | ULONGLONG | Keyword,
|  | PCWSTR | String,
|  |  | ...
| ) |  |

inline

Writes a string event.

Returns
  - `ERROR_SUCCESS` when write succeeds;
  - error code otherwise.

See also
  EventWriteString function

The documentation for this class was generated from the following file:

- include/WinStd/ETW.h