[DEBUG] Suppress XamlUiaTextRange throw from debug output

This commit is contained in:
Carlos Zamora
2026-03-16 15:58:53 -07:00
parent 0f75840a0b
commit 2279495b00
2 changed files with 13 additions and 5 deletions

View File

@@ -347,11 +347,6 @@ bool Terminal::IsVtInputEnabled() const noexcept
return false;
}
void Terminal::NotifyAccessibilityChange(const til::rect& /*changedRect*/) noexcept
{
// This is only needed in conhost. Terminal handles accessibility in another way.
}
void Terminal::SetAccessibilityEngineState(bool enable)
{
if (_pfnSetAccessibilityEngineState)

View File

@@ -57,11 +57,24 @@ namespace Microsoft::Console::ErrorReporting
// Don't log anything. We just failed to trace, where will we go now?
}
// Suppress debug output (OutputDebugString) for XAML_E_NOT_SUPPORTED (0x80131515).
// ReportFailureToFallbackProvider already suppresses this from telemetry, but that
// doesn't cover the debugger output path. Setting RequestSuppressTelemetry on the
// FailureInfo prevents WIL from emitting an OutputDebugString for this expected error.
inline void __stdcall SuppressExpectedFailures(_Inout_ wil::FailureInfo* pFailure) noexcept
{
if (pFailure && pFailure->hr == 0x80131515L)
{
WI_SetFlag(pFailure->flags, wil::FailureFlags::RequestSuppressTelemetry);
}
}
__declspec(noinline) inline void EnableFallbackFailureReporting(TraceLoggingHProvider provider) noexcept
try
{
FallbackProvider = provider;
::wil::SetResultTelemetryFallback(::Microsoft::Console::ErrorReporting::ReportFailureToFallbackProvider);
::wil::details::g_pfnNotifyFailure = &SuppressExpectedFailures;
}
catch (...)
{