17 if (last_error == 0) {
21 const DWORD flags = FORMAT_MESSAGE_ALLOCATE_BUFFER |
22 FORMAT_MESSAGE_FROM_SYSTEM |
23 FORMAT_MESSAGE_IGNORE_INSERTS;
25 wchar_t* buffer =
nullptr;
26 size_t size = ::FormatMessage(
30 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
36 std::wstring
message(buffer, size);
40 std::wstringstream stream;
41 stream <<
message <<
" (" << last_error <<
").";