WinStd
Windows Win32 API using Standard C++
Loading...
Searching...
No Matches
winstd::event_provider Class Reference

ETW event provider. More...

#include <WinStd/ETW.h>

Inheritance diagram for winstd::event_provider:
winstd::handle< REGHANDLE, NULL >

Public Member Functions

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

Protected Member Functions

void free_internal () noexcept override
 Releases the event provider.
 
virtual void enable_callback (LPCGUID SourceId, ULONG IsEnabled, UCHAR Level, ULONGLONG MatchAnyKeyword, ULONGLONG MatchAllKeyword, PEVENT_FILTER_DESCRIPTOR FilterData)
 Receive enable or disable notification requests.
 
- Protected Member Functions inherited from winstd::handle< REGHANDLE, NULL >

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.
 

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: