From 5c03df0d74a3984c7ba23398b10ea061cffafc84 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Thu, 23 Jun 2016 15:43:23 +0200 Subject: [PATCH] Additional winstd::event_data constructors added, since generic template was too aggressively selected --- include/WinStd/ETW.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/WinStd/ETW.h b/include/WinStd/ETW.h index 0ae6611d..c30db127 100644 --- a/include/WinStd/ETW.h +++ b/include/WinStd/ETW.h @@ -177,6 +177,20 @@ namespace winstd } + /// + /// Construct class with string. + /// + /// \note This class is saves a reference to the data only. Therefore, data must be kept available. + /// + inline event_data(_In_ char *data) + { + if (data) + EventDataDescCreate(this, data, (ULONG)((strlen(data) + 1) * sizeof(*data))); + else + EventDataDescCreate(this, NULL, 0); + } + + /// /// Construct class with wide string. /// @@ -191,6 +205,20 @@ namespace winstd } + /// + /// Construct class with wide string. + /// + /// \note This class is saves a reference to the data only. Therefore, data must be kept available. + /// + inline event_data(_In_ wchar_t *data) + { + if (data) + EventDataDescCreate(this, data, (ULONG)((wcslen(data) + 1) * sizeof(*data))); + else + EventDataDescCreate(this, NULL, 0); + } + + /// /// Template to construct class with string. ///