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. ///