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

ETW session. More...

#include <WinStd/ETW.h>

Inheritance diagram for winstd::event_session:
winstd::handle< TRACEHANDLE, 0 >

Public Member Functions

 event_session ()
 Initializes a new empty session.
 
 event_session (handle_type h, const EVENT_TRACE_PROPERTIES *prop)
 Initializes a new session with an already available object handle.
 
 event_session (event_session &&other) noexcept
 Move constructor.
 
virtual ~event_session ()
 Closes the session.
 
event_sessionoperator= (event_session &&other) noexcept
 Move assignment.
 
 operator const EVENT_TRACE_PROPERTIES * () const
 Auto-typecasting operator.
 
LPCTSTR name () const
 Gets session name.
 
void attach (handle_type h, EVENT_TRACE_PROPERTIES *prop)
 Sets a new session handle for the class.
 
ULONG create (LPCTSTR SessionName, const EVENT_TRACE_PROPERTIES *Properties)
 Registers and starts an event tracing session.
 
ULONG enable_trace (LPCGUID ProviderId, UCHAR Level, ULONGLONG MatchAnyKeyword=0, ULONGLONG MatchAllKeyword=0, ULONG EnableProperty=0, PEVENT_FILTER_DESCRIPTOR EnableFilterDesc=NULL)
 Enables the specified event trace provider.
 
ULONG disable_trace (LPCGUID ProviderId, UCHAR Level, ULONGLONG MatchAnyKeyword=0, ULONGLONG MatchAllKeyword=0, ULONG EnableProperty=0, PEVENT_FILTER_DESCRIPTOR EnableFilterDesc=NULL)
 Disables the specified event trace provider.
 
- Public Member Functions inherited from winstd::handle< TRACEHANDLE, 0 >
 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 session.
 
- Protected Member Functions inherited from winstd::handle< TRACEHANDLE, 0 >

Protected Attributes

std::unique_ptr< EVENT_TRACE_PROPERTIES > m_prop
 Session properties.
 
- Protected Attributes inherited from winstd::handle< TRACEHANDLE, 0 >
handle_type m_h
 Object handle.
 

Additional Inherited Members

- Public Types inherited from winstd::handle< TRACEHANDLE, 0 >
typedef TRACEHANDLE handle_type
 Datatype of the object handle this template class handles.
 
- Static Public Attributes inherited from winstd::handle< TRACEHANDLE, 0 >
static const TRACEHANDLE invalid
 Invalid handle value.
 

Detailed Description

ETW session.

Constructor & Destructor Documentation

◆ event_session() [1/2]

winstd::event_session::event_session ( handle_type h,
const EVENT_TRACE_PROPERTIES * prop )
inline

Initializes a new session with an already available object handle.

Parameters
[in]hInitial session handle value
[in]propSession properties

◆ event_session() [2/2]

winstd::event_session::event_session ( event_session && other)
inlinenoexcept

Move constructor.

Parameters
[in,out]otherA rvalue reference of another session

◆ ~event_session()

virtual winstd::event_session::~event_session ( )
inlinevirtual

Closes the session.

See also
ControlTrace function

Member Function Documentation

◆ attach()

void winstd::event_session::attach ( handle_type h,
EVENT_TRACE_PROPERTIES * prop )
inline

Sets a new session handle for the class.

When the current session handle of the class is non-NULL, the session is destroyed first.

Parameters
[in]hNew session handle
[in]propSession properties

◆ create()

ULONG winstd::event_session::create ( LPCTSTR SessionName,
const EVENT_TRACE_PROPERTIES * Properties )
inline

Registers and starts an event tracing session.

Returns
  • ERROR_SUCCESS when creation succeeds;
  • error code otherwise.
See also
StartTrace function

◆ disable_trace()

ULONG winstd::event_session::disable_trace ( LPCGUID ProviderId,
UCHAR Level,
ULONGLONG MatchAnyKeyword = 0,
ULONGLONG MatchAllKeyword = 0,
ULONG EnableProperty = 0,
PEVENT_FILTER_DESCRIPTOR EnableFilterDesc = NULL )
inline

Disables the specified event trace provider.

Returns
  • ERROR_SUCCESS when succeeds;
  • error code otherwise.
See also
EnableTraceEx function

◆ enable_trace()

ULONG winstd::event_session::enable_trace ( LPCGUID ProviderId,
UCHAR Level,
ULONGLONG MatchAnyKeyword = 0,
ULONGLONG MatchAllKeyword = 0,
ULONG EnableProperty = 0,
PEVENT_FILTER_DESCRIPTOR EnableFilterDesc = NULL )
inline

Enables the specified event trace provider.

Returns
  • ERROR_SUCCESS when succeeds;
  • error code otherwise.
See also
EnableTraceEx function

◆ free_internal()

void winstd::event_session::free_internal ( )
inlineoverrideprotectedvirtualnoexcept

Releases the session.

See also
ControlTrace function

Implements winstd::handle< TRACEHANDLE, 0 >.

◆ name()

LPCTSTR winstd::event_session::name ( ) const
inline

Gets session name.

Returns
Session name

◆ operator const EVENT_TRACE_PROPERTIES *()

winstd::event_session::operator const EVENT_TRACE_PROPERTIES * ( ) const
inline

Auto-typecasting operator.

Returns
Session properties

◆ operator=()

event_session & winstd::event_session::operator= ( event_session && other)
inlinenoexcept

Move assignment.

Parameters
[in,out]otherA rvalue reference of another object

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