diff options
Diffstat (limited to 'src/libs/dutil/WixToolset.DUtil/dutil.cpp')
-rw-r--r-- | src/libs/dutil/WixToolset.DUtil/dutil.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/libs/dutil/WixToolset.DUtil/dutil.cpp b/src/libs/dutil/WixToolset.DUtil/dutil.cpp index 56b85207..dd4fa8bf 100644 --- a/src/libs/dutil/WixToolset.DUtil/dutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/dutil.cpp | |||
@@ -30,6 +30,8 @@ static REPORT_LEVEL Dutil_rlCurrentTrace = REPORT_STANDARD; | |||
30 | static BOOL Dutil_fTraceFilenames = FALSE; | 30 | static BOOL Dutil_fTraceFilenames = FALSE; |
31 | static DUTIL_CALLBACK_TRACEERROR vpfnTraceErrorCallback = NULL; | 31 | static DUTIL_CALLBACK_TRACEERROR vpfnTraceErrorCallback = NULL; |
32 | 32 | ||
33 | thread_local static DWORD vtdwSuppressTraceErrorSource = 0; | ||
34 | |||
33 | 35 | ||
34 | DAPI_(HRESULT) DutilInitialize( | 36 | DAPI_(HRESULT) DutilInitialize( |
35 | __in_opt DUTIL_CALLBACK_TRACEERROR pfnTraceErrorCallback | 37 | __in_opt DUTIL_CALLBACK_TRACEERROR pfnTraceErrorCallback |
@@ -48,6 +50,28 @@ DAPI_(void) DutilUninitialize() | |||
48 | vpfnTraceErrorCallback = NULL; | 50 | vpfnTraceErrorCallback = NULL; |
49 | } | 51 | } |
50 | 52 | ||
53 | DAPI_(BOOL) DutilSuppressTraceErrorSource() | ||
54 | { | ||
55 | if (DWORD_MAX == vtdwSuppressTraceErrorSource) | ||
56 | { | ||
57 | return FALSE; | ||
58 | } | ||
59 | |||
60 | ++vtdwSuppressTraceErrorSource; | ||
61 | return TRUE; | ||
62 | } | ||
63 | |||
64 | DAPI_(BOOL) DutilUnsuppressTraceErrorSource() | ||
65 | { | ||
66 | if (0 == vtdwSuppressTraceErrorSource) | ||
67 | { | ||
68 | return FALSE; | ||
69 | } | ||
70 | |||
71 | --vtdwSuppressTraceErrorSource; | ||
72 | return TRUE; | ||
73 | } | ||
74 | |||
51 | /******************************************************************* | 75 | /******************************************************************* |
52 | Dutil_SetAssertModule | 76 | Dutil_SetAssertModule |
53 | 77 | ||
@@ -427,8 +451,9 @@ DAPIV_(void) Dutil_TraceErrorSource( | |||
427 | ... | 451 | ... |
428 | ) | 452 | ) |
429 | { | 453 | { |
454 | // if this callback is currently suppressed, or | ||
430 | // if this is NOT an error report and we're not logging at this level, bail | 455 | // if this is NOT an error report and we're not logging at this level, bail |
431 | if (REPORT_ERROR != rl && Dutil_rlCurrentTrace < rl) | 456 | if (vtdwSuppressTraceErrorSource || REPORT_ERROR != rl && Dutil_rlCurrentTrace < rl) |
432 | { | 457 | { |
433 | return; | 458 | return; |
434 | } | 459 | } |