mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-24 02:00:24 +07:00
format code
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user