diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/DUtilUnitTest/error.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/DUtilUnitTest/error.h b/src/test/DUtilUnitTest/error.h new file mode 100644 index 00000000..a52db56d --- /dev/null +++ b/src/test/DUtilUnitTest/error.h | |||
@@ -0,0 +1,8 @@ | |||
1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
2 | |||
3 | const int ERROR_STRING_BUFFER = 1024; | ||
4 | |||
5 | static char szMsg[ERROR_STRING_BUFFER]; | ||
6 | static WCHAR wzMsg[ERROR_STRING_BUFFER]; | ||
7 | |||
8 | #define ExitTrace(x, f, ...) { HRESULT hrTemp = x; hr = ::StringCchPrintfA(szMsg, countof(szMsg), f, __VA_ARGS__); MultiByteToWideChar(CP_ACP, 0, szMsg, -1, wzMsg, countof(wzMsg)); throw gcnew System::Exception(System::String::Format("hr = 0x{0:X8}, message = {1}", hrTemp, gcnew System::String(wzMsg))); } | ||