format code

This commit is contained in:
dranik
2026-05-29 22:57:54 +03:00
parent 446e7b6a8e
commit 7eecc3667f
+6 -5
View File
@@ -12,8 +12,7 @@
#include "logger.h"
namespace
{
namespace {
Logger logger("WindowsUtils");
constexpr const wchar_t kThemeWatcherClassName[] = L"AmneziaVpnThemeWatcher";
@@ -56,9 +55,11 @@ constexpr const int WINDOWS_11_BUILD =
QString WindowsUtils::getErrorMessage(quint32 code) {
LPSTR messageBuffer = nullptr;
size_t size =
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, nullptr);
size_t size = FormatMessageA(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
nullptr, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPSTR)&messageBuffer, 0, nullptr);
std::string message(messageBuffer, size);
QString result(message.c_str());