Commit e2789531 authored by Gabi Melman's avatar Gabi Melman Committed by GitHub

Update win_eventlog_sink.h

parent 573ddf8a
......@@ -137,10 +137,9 @@ public:
// Get the required size, this is expected to fail with ERROR_INSUFFICIENT_BUFFER and return the token size
DWORD tusize = 0;
::GetTokenInformation(current_process_token.token_handle_, TokenUser, NULL, 0, &tusize);
if (::GetLastError() != ERROR_INSUFFICIENT_BUFFER)
if(::GetTokenInformation(current_process_token.token_handle_, TokenUser, NULL, 0, &tusize))
{
SPDLOG_THROW(win32_error("GetTokenInformation"));
SPDLOG_THROW(win32_error("GetTokenInformation should fail"));
}
// get user token
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment