From 98114c91c6acbbd3a2108202454b00ce85071886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 19 Jan 2022 14:11:07 +0100 Subject: [PATCH] Report CNG error codes in hex (#16465) --- src/openrct2/core/Crypt.CNG.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2/core/Crypt.CNG.cpp b/src/openrct2/core/Crypt.CNG.cpp index d510bb8026..bb7a620078 100644 --- a/src/openrct2/core/Crypt.CNG.cpp +++ b/src/openrct2/core/Crypt.CNG.cpp @@ -14,6 +14,7 @@ # include "../platform/Platform2.h" # include "IStream.hpp" +# include # include # include # include @@ -34,7 +35,9 @@ static void CngThrowOnBadStatus(std::string_view name, NTSTATUS status) { if (!NT_SUCCESS(status)) { - throw std::runtime_error(std::string(name) + " failed: " + std::to_string(status)); + std::stringstream stream; + stream << "0x" << std::setfill('0') << std::setw(8) << std::hex << status; + throw std::runtime_error(std::string(name) + " failed: " + stream.str()); } }