diff --git a/testing/stconsole.cpp b/testing/stconsole.cpp index 9a1c5c8..554c1b4 100644 --- a/testing/stconsole.cpp +++ b/testing/stconsole.cpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include #include #include #include @@ -600,6 +602,19 @@ void DisplaySplittingErrorEvent(const ST_SPLITTING_ERROR_EVENT *evt, size_t /*ev std::wcout << L"Imagename: " << imageName << std::endl; } +void DisplayErrorMessageEvent(const ST_ERROR_MESSAGE_EVENT *evt, size_t /*eventSize*/) +{ + std::wstringstream ss; + + ss << L"Status: 0x" << std::setw(8) << std::setfill(L'0') << std::hex << evt->Status; + + std::wcout << ss.str() << std::endl; + + std::wstring message(&evt->ErrorMessage[0], &evt->ErrorMessage[0] + (evt->ErrorMessageLength / sizeof(wchar_t))); + + std::wcout << L"Error message: " << message << std::endl; +} + void ParseDisplayEvent(const uint8_t *evt, size_t eventSize) { if (!g_DisplayEvents) @@ -647,6 +662,14 @@ void ParseDisplayEvent(const uint8_t *evt, size_t eventSize) break; } + case ST_EVENT_ID_ERROR_MESSAGE: + { + std::wcout << L"Type: ST_EVENT_ID_ERROR_MESSAGE" << std::endl; + + DisplayErrorMessageEvent((ST_ERROR_MESSAGE_EVENT*)&header->EventData[0], header->EventSize); + + break; + } default: { std::wcout << L"Unsupported event" << std::endl;