From e9b4e2e18fb1b9cee6839969d42cd0f95d228926 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 8 Apr 2022 14:06:40 -0500 Subject: [PATCH] Remove `default_interface` from Monarch (#12856) This is all of course, conjecture. This crash is totally wild and makes no sense at all. But, we're hoping that this fixes it. This should also make calls to the Monarch a little easier. You may be asking yourself - why aren't I doing this for the Peasant too? Well, because the Peasant simply doesn't crash like the monarch does. I'm not gonna touch something that's not broken _during ask mode_. References #12774. We can close the bug if it is verified fixed. (cherry picked from commit b64fd774ce48d8f10c88ac171b134a43cc2791a2) Service-Card-Id: 80383092 Service-Version: 1.12 --- src/cascadia/Remoting/Monarch.idl | 2 +- src/cascadia/Remoting/WindowManager.cpp | 4 ++-- src/cascadia/Remoting/WindowManager.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cascadia/Remoting/Monarch.idl b/src/cascadia/Remoting/Monarch.idl index 08c7b63cbda..2ef09807080 100644 --- a/src/cascadia/Remoting/Monarch.idl +++ b/src/cascadia/Remoting/Monarch.idl @@ -68,7 +68,7 @@ namespace Microsoft.Terminal.Remoting event Windows.Foundation.TypedEventHandler QuitAllRequested; }; - [default_interface] runtimeclass Monarch : IMonarch + runtimeclass Monarch : [default] IMonarch { Monarch(); }; diff --git a/src/cascadia/Remoting/WindowManager.cpp b/src/cascadia/Remoting/WindowManager.cpp index 3e500da01cb..d67e279fd70 100644 --- a/src/cascadia/Remoting/WindowManager.cpp +++ b/src/cascadia/Remoting/WindowManager.cpp @@ -341,8 +341,8 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation // // * If we're running unpackaged: the .winmd must be a sibling of the .exe // * If we're running packaged: the .winmd must be in the package root - _monarch = create_instance(Monarch_clsid, - CLSCTX_LOCAL_SERVER); + _monarch = create_instance(Monarch_clsid, + CLSCTX_LOCAL_SERVER); } // NOTE: This can throw! Callers include: diff --git a/src/cascadia/Remoting/WindowManager.h b/src/cascadia/Remoting/WindowManager.h index b3d480c5259..7ecf36a5df6 100644 --- a/src/cascadia/Remoting/WindowManager.h +++ b/src/cascadia/Remoting/WindowManager.h @@ -65,7 +65,7 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation bool _shouldCreateWindow{ false }; bool _isKing{ false }; DWORD _registrationHostClass{ 0 }; - winrt::Microsoft::Terminal::Remoting::Monarch _monarch{ nullptr }; + winrt::Microsoft::Terminal::Remoting::IMonarch _monarch{ nullptr }; winrt::Microsoft::Terminal::Remoting::Peasant _peasant{ nullptr }; wil::unique_event _monarchWaitInterrupt;