From dc558da002794cc07013e8376f3c55c73391aa0e Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 12 Jul 2020 17:07:55 +1000 Subject: Update Dutil_TraceErrorSource to filter based on the report level. --- src/test/DUtilUnitTest/error.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/test/DUtilUnitTest/error.h') diff --git a/src/test/DUtilUnitTest/error.h b/src/test/DUtilUnitTest/error.h index a52db56d..b973acaf 100644 --- a/src/test/DUtilUnitTest/error.h +++ b/src/test/DUtilUnitTest/error.h @@ -1,8 +1,14 @@ +#pragma once // 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. -const int ERROR_STRING_BUFFER = 1024; +#define DUTIL_SOURCE_DEFAULT DUTIL_SOURCE_EXTERNAL -static char szMsg[ERROR_STRING_BUFFER]; -static WCHAR wzMsg[ERROR_STRING_BUFFER]; - -#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))); } +void CALLBACK DutilTestTraceError( + __in_z LPCSTR szFile, + __in int iLine, + __in REPORT_LEVEL rl, + __in UINT source, + __in HRESULT hrError, + __in_z __format_string LPCSTR szFormat, + __in va_list args + ); -- cgit v1.2.3-55-g6feb