diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index dd4342d9d25..6e4f259dcea 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -959,7 +959,6 @@ guardxfg guc gui guidatom -guiddef GValue GWL GWLP @@ -1567,7 +1566,6 @@ NOCOLOR NOCOMM NOCONTEXTHELP NOCOPYBITS -nodefaultlib nodiscard NODUP noexcept diff --git a/src/host/proxy/Host.Proxy.vcxproj b/src/host/proxy/Host.Proxy.vcxproj index dd0551e104d..fc8ff483073 100644 --- a/src/host/proxy/Host.Proxy.vcxproj +++ b/src/host/proxy/Host.Proxy.vcxproj @@ -21,7 +21,7 @@ - REGISTER_PROXY_DLL;WIN32;%(PreprocessorDefinitions) NotUsing - Default - false - false - nodefaultlib_shim.h;%(ForcedIncludeFiles) OpenConsoleProxy.def - - - true - DllMain + + + + + + MultiThreadedDebug + + + + %(IgnoreSpecificDefaultLibraries);libucrtd.lib + %(AdditionalOptions) /defaultlib:ucrtd.lib + + + + + + MultiThreaded + + + + %(IgnoreSpecificDefaultLibraries);libucrt.lib + %(AdditionalOptions) /defaultlib:ucrt.lib + + + diff --git a/src/host/proxy/Host.Proxy.vcxproj.filters b/src/host/proxy/Host.Proxy.vcxproj.filters index 1cdf7ca2512..df6bcbd10c6 100644 --- a/src/host/proxy/Host.Proxy.vcxproj.filters +++ b/src/host/proxy/Host.Proxy.vcxproj.filters @@ -41,9 +41,6 @@ Header Files - - Header Files - diff --git a/src/host/proxy/nodefaultlib_shim.h b/src/host/proxy/nodefaultlib_shim.h deleted file mode 100644 index 4face4e49f2..00000000000 --- a/src/host/proxy/nodefaultlib_shim.h +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -#pragma once - -#include - -#define memcmp(a, b, c) (!InlineIsEqualGUID(a, b)) diff --git a/src/host/scrolling.cpp b/src/host/scrolling.cpp index 6d211a0fd3d..8e7b122733b 100644 --- a/src/host/scrolling.cpp +++ b/src/host/scrolling.cpp @@ -13,13 +13,13 @@ using Microsoft::Console::VirtualTerminal::StateMachine; using namespace Microsoft::Console::Interactivity; using namespace Microsoft::Console::Types; -ULONG Scrolling::s_ucWheelScrollLines = 0; -ULONG Scrolling::s_ucWheelScrollChars = 0; +til::CoordType Scrolling::s_ucWheelScrollLines = 0; +til::CoordType Scrolling::s_ucWheelScrollChars = 0; void Scrolling::s_UpdateSystemMetrics() { - s_ucWheelScrollLines = ServiceLocator::LocateSystemConfigurationProvider()->GetNumberOfWheelScrollLines(); - s_ucWheelScrollChars = ServiceLocator::LocateSystemConfigurationProvider()->GetNumberOfWheelScrollCharacters(); + s_ucWheelScrollLines = ::base::saturated_cast(ServiceLocator::LocateSystemConfigurationProvider()->GetNumberOfWheelScrollLines()); + s_ucWheelScrollChars = ::base::saturated_cast(ServiceLocator::LocateSystemConfigurationProvider()->GetNumberOfWheelScrollCharacters()); } bool Scrolling::s_IsInScrollMode() @@ -112,7 +112,7 @@ void Scrolling::s_HandleMouseWheel(_In_ bool isMouseWheel, if (isMouseWheel && s_ucWheelScrollLines > 0) { // Rounding could cause this to be zero if gucWSL is bigger than 240 or so. - const auto ulActualDelta = std::max(WHEEL_DELTA / s_ucWheelScrollLines, 1ul); + const auto ulActualDelta = std::max(WHEEL_DELTA / s_ucWheelScrollLines, 1); // If we change direction we need to throw away any remainder we may have in the other direction. if ((ScreenInfo.WheelDelta > 0) == (wheelDelta > 0)) @@ -124,7 +124,7 @@ void Scrolling::s_HandleMouseWheel(_In_ bool isMouseWheel, ScreenInfo.WheelDelta = wheelDelta; } - if ((ULONG)abs(ScreenInfo.WheelDelta) >= ulActualDelta) + if (abs(ScreenInfo.WheelDelta) >= ulActualDelta) { /* * By default, SHIFT + WM_MOUSEWHEEL will scroll 1/2 the @@ -134,7 +134,7 @@ void Scrolling::s_HandleMouseWheel(_In_ bool isMouseWheel, til::CoordType delta = 1; if (hasShift) { - delta = std::max((ScreenInfo.GetViewport().Height() * ScreenInfo.ScrollScale) / 2, 1u); + delta = std::max((ScreenInfo.GetViewport().Height() * ::base::saturated_cast(ScreenInfo.ScrollScale)) / 2, 1); // Account for scroll direction changes by adjusting delta if there was a direction change. delta *= (ScreenInfo.WheelDelta < 0 ? -1 : 1); @@ -161,7 +161,7 @@ void Scrolling::s_HandleMouseWheel(_In_ bool isMouseWheel, } else if (isMouseHWheel && s_ucWheelScrollChars > 0) { - const auto ulActualDelta = std::max(WHEEL_DELTA / s_ucWheelScrollChars, 1ul); + const auto ulActualDelta = std::max(WHEEL_DELTA / s_ucWheelScrollChars, 1); if ((ScreenInfo.HWheelDelta > 0) == (wheelDelta > 0)) { @@ -172,7 +172,7 @@ void Scrolling::s_HandleMouseWheel(_In_ bool isMouseWheel, ScreenInfo.HWheelDelta = wheelDelta; } - if ((ULONG)abs(ScreenInfo.HWheelDelta) >= ulActualDelta) + if (abs(ScreenInfo.HWheelDelta) >= ulActualDelta) { til::CoordType delta = 1; diff --git a/src/host/scrolling.hpp b/src/host/scrolling.hpp index a082fa21a15..63956660fa1 100644 --- a/src/host/scrolling.hpp +++ b/src/host/scrolling.hpp @@ -41,6 +41,6 @@ class Scrolling private: static BOOL s_IsPointInRectangle(const til::rect* prc, const til::point pt); - static ULONG s_ucWheelScrollLines; - static ULONG s_ucWheelScrollChars; + static til::CoordType s_ucWheelScrollLines; + static til::CoordType s_ucWheelScrollChars; };