From def1bdd693046fc40ada9e9f004f1001adf0160b Mon Sep 17 00:00:00 2001 From: Leonard Hecker Date: Tue, 26 Oct 2021 21:08:49 +0200 Subject: [PATCH 1/8] Compile OpenConsoleProxy without CRT (#11610) After this commit OpenConsoleProxy will be built without a CRT. This cuts down its binary size and DLL dependency bloat. We hope that this fixes a COM server activation bug if the user doesn't have a CRT installed globally on their system. Fixes #11529 --- .github/actions/spelling/expect/expect.txt | 3 +++ src/common.build.pre.props | 3 ++- src/cppwinrt.build.pre.props | 2 +- src/host/proxy/Host.Proxy.vcxproj | 19 +++++++++++++++---- src/host/proxy/Host.Proxy.vcxproj.filters | 3 +++ src/host/proxy/nodefaultlib_shim.h | 18 ++++++++++++++++++ 6 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 src/host/proxy/nodefaultlib_shim.h diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index dccd6d740..c18d880e4 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -938,6 +938,7 @@ GTP guc gui guidatom +guiddef GValue GWL GWLP @@ -1535,6 +1536,7 @@ NOCOLOR NOCOMM NOCONTEXTHELP NOCOPYBITS +nodefaultlib nodiscard NODUP noexcept @@ -2232,6 +2234,7 @@ STARTWPARMSW Statusline stdafx STDAPI +stdc stdcall stdcpp stderr diff --git a/src/common.build.pre.props b/src/common.build.pre.props index ca15b0a04..1ec821e3f 100644 --- a/src/common.build.pre.props +++ b/src/common.build.pre.props @@ -107,7 +107,7 @@ C4467: usage of ATL attributes is deprecated Conhost code still uses ATL. --> - 4103;4201;4312;4467;%(DisableSpecificWarnings) + 4103;4201;4312;4467;5105;%(DisableSpecificWarnings) _WINDOWS;EXTERNAL_BUILD;%(PreprocessorDefinitions) true precomp.h @@ -117,6 +117,7 @@ false false stdcpp17 + stdc17 /utf-8 %(AdditionalOptions) Guard Fast diff --git a/src/cppwinrt.build.pre.props b/src/cppwinrt.build.pre.props index 4587ab3ea..2022dbc7f 100644 --- a/src/cppwinrt.build.pre.props +++ b/src/cppwinrt.build.pre.props @@ -75,7 +75,7 @@ true true %(AdditionalOptions) /bigobj /Zc:twoPhase- - 5104;5105;28204;%(DisableSpecificWarnings) + 5104;28204;%(DisableSpecificWarnings) $(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories) diff --git a/src/host/proxy/Host.Proxy.vcxproj b/src/host/proxy/Host.Proxy.vcxproj index 45fc697f2..5888ce0c3 100644 --- a/src/host/proxy/Host.Proxy.vcxproj +++ b/src/host/proxy/Host.Proxy.vcxproj @@ -11,7 +11,7 @@ - REGISTER_PROXY_DLL;WIN32;%(PreprocessorDefinitions) NotUsing + false + false + nodefaultlib_shim.h;%(ForcedIncludeFiles) OpenConsoleProxy.def + + + true + DllMain - \ No newline at end of file + diff --git a/src/host/proxy/Host.Proxy.vcxproj.filters b/src/host/proxy/Host.Proxy.vcxproj.filters index df6bcbd10..1cdf7ca25 100644 --- a/src/host/proxy/Host.Proxy.vcxproj.filters +++ b/src/host/proxy/Host.Proxy.vcxproj.filters @@ -41,6 +41,9 @@ Header Files + + Header Files + diff --git a/src/host/proxy/nodefaultlib_shim.h b/src/host/proxy/nodefaultlib_shim.h new file mode 100644 index 000000000..09c0ad53c --- /dev/null +++ b/src/host/proxy/nodefaultlib_shim.h @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +#include + +#if !defined(_M_IX86) && !defined(_M_X64) + +// ARM64 doesn't define a (__builtin_)memcmp function without CRT, +// but we need one to compile IID_GENERIC_CHECK_IID. +// Luckily we only ever use memcmp for IIDs. +#pragma function(memcmp) +inline int memcmp(const IID* a, const IID* b, size_t count) +{ + (void)(count); + return 1 - InlineIsEqualGUID(a, b); +} + +#endif From a916a5d9de450bc6a008d257d3c5c5cfd27e07ec Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Tue, 26 Oct 2021 15:12:22 -0500 Subject: [PATCH 2/8] Make sure the infobar is inserted before the tab content, not on top of (#11609) Fixes #11606 This is weird, but the infobars would appear totally on top of the TerminalPage when `showTabsInTitlebar:false`. This would result in the infobar obscuring the tabs. Now, the infobars are strictly inserted after the tabs, before the content. So when they appear, they will reduce the amount of space usable for the control. That is a little annoying, but preferable to the tabs totally not existing. Relevant conversation notes from #10798: > > If the info bar is not local to the tab, then its location between the tab > > bar (when the title bar is hidden) and the terminal panes feels > > misleading. Should it instead be above the tab bar or below the terminal > > panes? > > You're... not wrong here. It's maybe not the best place for it, but _on top_ > of the tabs would look insane, and probably wouldn't even work easily, given > the way we reparent the tab row into the titlebar. > > In the pane itself would make more sense, but that runs abreast of all sorts > of things like #9024, #4998, which might make more sense. I'm just gonna go with this now, because it's _better_ than before, while we work out what's _best_. ![gh-11606-fix](https://user-images.githubusercontent.com/18356694/138729178-b96b7003-0dd2-4521-8fff-0fd2a5989f22.gif) --- src/cascadia/TerminalApp/TerminalPage.xaml | 87 +++++++++++----------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/src/cascadia/TerminalApp/TerminalPage.xaml b/src/cascadia/TerminalApp/TerminalPage.xaml index ef16f6a7a..6c0705437 100644 --- a/src/cascadia/TerminalApp/TerminalPage.xaml +++ b/src/cascadia/TerminalApp/TerminalPage.xaml @@ -15,6 +15,7 @@ + @@ -22,8 +23,50 @@ + + + +