mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-25 18:11:33 +08:00
revert last commit
This commit is contained in:
parent
5da9818676
commit
9f24f4bc69
@ -194,23 +194,23 @@ template<typename Mutex>
|
|||||||
class win_eventlog_sink : public base_sink<Mutex>
|
class win_eventlog_sink : public base_sink<Mutex>
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
HANDLE h_eventlog_{NULL};
|
HANDLE hEventLog_{NULL};
|
||||||
internal::sid_t current_user_sid_;
|
internal::sid_t current_user_sid_;
|
||||||
std::string source_;
|
std::string source_;
|
||||||
WORD event_id_;
|
WORD event_id_;
|
||||||
|
|
||||||
HANDLE event_log_handle()
|
HANDLE event_log_handle()
|
||||||
{
|
{
|
||||||
if (!h_eventlog_)
|
if (!hEventLog_)
|
||||||
{
|
{
|
||||||
h_eventlog_ = ::RegisterEventSource(nullptr, source_.c_str());
|
hEventLog_ = ::RegisterEventSource(nullptr, source_.c_str());
|
||||||
if (!h_eventlog_ || h_eventlog_ == (HANDLE)ERROR_ACCESS_DENIED)
|
if (!hEventLog_ || hEventLog_ == (HANDLE)ERROR_ACCESS_DENIED)
|
||||||
{
|
{
|
||||||
SPDLOG_THROW(internal::win32_error("RegisterEventSource"));
|
SPDLOG_THROW(internal::win32_error("RegisterEventSource"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return h_eventlog_;
|
return hEventLog_;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -241,7 +241,7 @@ public:
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
current_user_sid_ = internal::sid_t::sid_t();
|
current_user_sid_ = internal::sid_t::get_current_user_sid();
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -250,11 +250,10 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~win_eventlog_sink() override
|
~win_eventlog_sink()
|
||||||
{
|
{
|
||||||
if (h_eventlog_) {
|
if (hEventLog_)
|
||||||
DeregisterEventSource(h_eventlog_);
|
DeregisterEventSource(hEventLog_);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user