From 973890b11b3ec8125b9756318dd694f8093608c2 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Fri, 31 Jan 2020 08:40:26 +0100 Subject: [PATCH] Add (unsigned) char event_data constructors Signed-off-by: Simon Rozman --- include/WinStd/ETW.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/WinStd/ETW.h b/include/WinStd/ETW.h index e6e4be7d..da3f9f5e 100644 --- a/include/WinStd/ETW.h +++ b/include/WinStd/ETW.h @@ -98,6 +98,34 @@ namespace winstd } + /// + /// Construct class pointing to an `char`. + /// + /// \param[in] data Event data + /// + /// \note This class saves a reference to the data only. Therefore, data must be kept available. + /// + #pragma warning(suppress: 26495) // EventDataDescCreate() initializes all members of EVENT_DATA_DESCRIPTOR + inline event_data(_In_ const char &data) + { + EventDataDescCreate(this, &data, (ULONG)(sizeof(data))); + } + + + /// + /// Construct class pointing to an `unsigned char`. + /// + /// \param[in] data Event data + /// + /// \note This class saves a reference to the data only. Therefore, data must be kept available. + /// + #pragma warning(suppress: 26495) // EventDataDescCreate() initializes all members of EVENT_DATA_DESCRIPTOR + inline event_data(_In_ const unsigned char &data) + { + EventDataDescCreate(this, &data, (ULONG)(sizeof(data))); + } + + /// /// Construct class pointing to an `int`. ///