From 22f514aabfadacace2ed0f611d78f1a905689bbd Mon Sep 17 00:00:00 2001 From: Amir Alperin Date: Sun, 13 Dec 2020 23:11:25 +0200 Subject: [PATCH] restore ident format --- include/spdlog/sinks/win_eventlog_sink.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/spdlog/sinks/win_eventlog_sink.h b/include/spdlog/sinks/win_eventlog_sink.h index ef4de59e..5d028744 100644 --- a/include/spdlog/sinks/win_eventlog_sink.h +++ b/include/spdlog/sinks/win_eventlog_sink.h @@ -226,14 +226,15 @@ protected: formatted.push_back('\0'); #ifdef SPDLOG_WCHAR_TO_UTF8_SUPPORT - auto buf = std::wstring_convert>().from_bytes(formatted.data()); + auto buf = std::wstring_convert>().from_bytes(formatted.data()); + LPCWSTR lp_wstr = reinterpret_cast(buf.c_str()); - succeeded = ::ReportEventW(event_log_handle(), eventlog::get_event_type(msg), eventlog::get_event_category(msg), event_id_, - current_user_sid_.as_sid(), 1, 0, (LPCWSTR*)buf.c_str(), nullptr); + succeeded = ::ReportEventW(event_log_handle(), eventlog::get_event_type(msg), eventlog::get_event_category(msg), event_id_, + current_user_sid_.as_sid(), 1, 0, &lp_wstr, nullptr); #else - LPCSTR lp_str = reinterpret_cast(formatted.data()); + LPCSTR lp_str = reinterpret_cast(formatted.data()); - succeeded = ::ReportEventA(event_log_handle(), eventlog::get_event_type(msg), eventlog::get_event_category(msg), event_id_, + succeeded = ::ReportEventA(event_log_handle(), eventlog::get_event_type(msg), eventlog::get_event_category(msg), event_id_, current_user_sid_.as_sid(), 1, 0, &lp_str, nullptr); #endif