diff --git a/src/host/_stream.cpp b/src/host/_stream.cpp index 899228a9dc..5a6671dd74 100644 --- a/src/host/_stream.cpp +++ b/src/host/_stream.cpp @@ -615,7 +615,6 @@ using Microsoft::Console::VirtualTerminal::StateMachine; return STATUS_SUCCESS; } - FAIL_FAST_IF(!(WI_IsFlagSet(screenInfo.OutputMode, ENABLE_PROCESSED_OUTPUT))); switch (*lpString) { case UNICODE_BACKSPACE: diff --git a/src/server/IoDispatchers.cpp b/src/server/IoDispatchers.cpp index 8c032a90b2..81be061f76 100644 --- a/src/server/IoDispatchers.cpp +++ b/src/server/IoDispatchers.cpp @@ -178,12 +178,6 @@ static bool _shouldAttemptHandoff(const Globals& globals, #else - // If we do not have a registered handoff, do not attempt. - if (!globals.delegationPair.IsCustom()) - { - return false; - } - // If we're already a target for receiving another handoff, // do not chain. if (globals.handoffTarget) @@ -271,8 +265,31 @@ static bool _shouldAttemptHandoff(const Globals& globals, static void attemptHandoff(Globals& Globals, const CONSOLE_INFORMATION& gci, CONSOLE_API_CONNECTINFO& cac, PCONSOLE_API_MSG pReceiveMsg) { - if (!_shouldAttemptHandoff(Globals, gci, cac)) + // _shouldAttemptHandoff does not check if there is a handoff target. + // this lets us break apart the check for logging purposes. + const bool shouldAttemptHandoff = _shouldAttemptHandoff(Globals, gci, cac); + if (!shouldAttemptHandoff) { + // Non-interactive session, don't hand it off; emit no log + return; + } + + // This session is interactive on the right desktop and window station + + const bool hasHandoffTarget = Globals.delegationPair.IsCustom(); + const bool handoffTargetChosenByWindows = Globals.defaultTerminalMarkerCheckRequired; + + TraceLoggingWrite(g_hConhostV2EventTraceProvider, + "ConsoleHandoffSessionStarted", + TraceLoggingDescription("a new interactive console session was started"), + TraceLoggingGuid(Globals.delegationPair.console, "handoffCLSID"), + TraceLoggingBool(handoffTargetChosenByWindows, "handoffTargetChosenByWindows"), + TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), + TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); + + if (!hasHandoffTarget) + { + // Nobody to hand off to. We emitted the log, so we're done here. return; }