Removed using namespace directive from header files (#955)

* Removed using namespace directive from header files and put these in cpp files where they are used

* Fixed tabbing issues by replacing them with spaces.
Also regrouped the using directives.

* Update src/host/exemain.cpp

Co-Authored-By: Mike Griese <migrie@microsoft.com>

* Update src/interactivity/win32/find.cpp

Co-Authored-By: Mike Griese <migrie@microsoft.com>
This commit is contained in:
MelulekiDube 2019-05-30 20:14:21 +02:00 committed by adiviness
parent c3e32eb1ca
commit 1c16b2c06b
96 changed files with 303 additions and 182 deletions

View file

@ -345,7 +345,7 @@ void CommandListPopup::_drawList()
WriteCoord.Y += 1i16;
}
auto& api = ServiceLocator::LocateGlobals().api;
auto& api = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().api;
WriteCoord.Y = _region.Top + 1i16;
SHORT i = std::max(gsl::narrow<SHORT>(_bottomIndex - Height() + 1), 0i16);

View file

@ -5,7 +5,9 @@
#include "../host/scrolling.hpp"
#include "../interactivity/inc/ServiceLocator.hpp"
#pragma hdrstop
using namespace Microsoft::Console;
using namespace Microsoft::Console::Interactivity;
CursorBlinker::CursorBlinker() :
_hCaretBlinkTimer(INVALID_HANDLE_VALUE),

View file

@ -20,6 +20,7 @@ struct PTY_SIGNAL_RESIZE
using namespace Microsoft::Console;
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::VirtualTerminal;
// Constructor Description:
// - Creates the PTY Signal Input Thread.

View file

@ -5,6 +5,7 @@
#include "ScreenBufferRenderTarget.hpp"
#include "../interactivity/inc/ServiceLocator.hpp"
using Microsoft::Console::Interactivity::ServiceLocator;
ScreenBufferRenderTarget::ScreenBufferRenderTarget(SCREEN_INFORMATION& owner) :
_owner{ owner }
{
@ -12,6 +13,7 @@ ScreenBufferRenderTarget::ScreenBufferRenderTarget(SCREEN_INFORMATION& owner) :
void ScreenBufferRenderTarget::TriggerRedraw(const Microsoft::Console::Types::Viewport& region)
{
auto* pRenderer = ServiceLocator::LocateGlobals().pRender;
const auto* pActive = &ServiceLocator::LocateGlobals().getConsoleInformation().GetActiveOutputBuffer().GetActiveBuffer();
if (pRenderer != nullptr && pActive == &_owner)

View file

@ -16,7 +16,8 @@
#include "handle.h"
using namespace Microsoft::Console;
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::VirtualTerminal;
// Constructor Description:
// - Creates the VT Input Thread.
// Arguments:

View file

@ -41,7 +41,7 @@ namespace Microsoft::Console
bool _exitRequested;
HRESULT _exitResult;
std::unique_ptr<StateMachine> _pInputStateMachine;
std::unique_ptr<Microsoft::Console::VirtualTerminal::StateMachine> _pInputStateMachine;
Utf8ToWideCharParser _utf8Parser;
};
}

View file

@ -15,9 +15,11 @@
#include "output.h" // CloseConsoleProcessState
using namespace Microsoft::Console;
using namespace Microsoft::Console::Render;
using namespace Microsoft::Console::VirtualTerminal;
using namespace Microsoft::Console::Types;
using namespace Microsoft::Console::Utils;
using namespace Microsoft::Console::Interactivity;
VtIo::VtIo() :
_initialized(false),

View file

@ -22,6 +22,7 @@
#pragma hdrstop
using namespace Microsoft::Console::Types;
using Microsoft::Console::Interactivity::ServiceLocator;
// Routine Description:
// - This routine writes a screen buffer region to the screen.

View file

@ -24,7 +24,8 @@
#pragma hdrstop
using namespace Microsoft::Console::Types;
using Microsoft::Console::Interactivity::ServiceLocator;
using Microsoft::Console::VirtualTerminal::StateMachine;
// Used by WriteCharsLegacy.
#define IS_GLYPH_CHAR(wch) (((wch) < L' ') || ((wch) == 0x007F))

View file

@ -22,6 +22,8 @@
#pragma hdrstop
using Microsoft::Console::Interactivity::ServiceLocator;
struct case_insensitive_hash
{
std::size_t operator()(const std::wstring& key) const

View file

@ -25,7 +25,7 @@
#include "..\interactivity\inc\ServiceLocator.hpp"
#pragma hdrstop
using Microsoft::Console::Interactivity::ServiceLocator;
// Routine Description:
// - This routine is called when the user changes the screen/popup colors.
// - It goes through the popup structures and changes the saved contents to reflect the new screen/popup colors.

View file

@ -13,6 +13,7 @@
#pragma hdrstop
using namespace Microsoft::Console::Types;
using Microsoft::Console::Interactivity::ServiceLocator;
ConversionAreaBufferInfo::ConversionAreaBufferInfo(const COORD coordBufferSize) :
coordCaBuffer(coordBufferSize),

View file

@ -16,6 +16,8 @@
// Attributes flags:
#define COMMON_LVB_GRID_SINGLEFLAG 0x2000 // DBCS: Grid attribute: use for ime cursor.
using Microsoft::Console::Interactivity::ServiceLocator;
ConsoleImeInfo::ConsoleImeInfo() :
_isSavedCursorVisible(false)
{

View file

@ -11,6 +11,9 @@
#include "..\interactivity\inc\ServiceLocator.hpp"
#include "..\types\inc\convert.hpp"
using Microsoft::Console::Interactivity::ServiceLocator;
using Microsoft::Console::VirtualTerminal::VtIo;
CONSOLE_INFORMATION::CONSOLE_INFORMATION() :
// ProcessHandleList initializes itself
pInputBuffer(nullptr),

View file

@ -10,6 +10,7 @@
#pragma hdrstop
using namespace Microsoft::Console::Types;
using Microsoft::Console::Interactivity::ServiceLocator;
bool IsValidSmallRect(_In_ PSMALL_RECT const Rect)
{

View file

@ -12,6 +12,7 @@
#pragma hdrstop
using Microsoft::Console::Interactivity::ServiceLocator;
// Routine Description:
// - This routine check bisected on Ascii string end.
// Arguments:

View file

@ -23,6 +23,7 @@
#pragma hdrstop
using namespace Microsoft::Console::Types;
using Microsoft::Console::Interactivity::ServiceLocator;
class CONSOLE_INFORMATION;

View file

@ -152,7 +152,7 @@ int CALLBACK wWinMain(
_In_ PWSTR /*pwszCmdLine*/,
_In_ int /*nCmdShow*/)
{
ServiceLocator::LocateGlobals().hInstance = hInstance;
Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().hInstance = hInstance;
ConsoleCheckDebug();

View file

@ -28,6 +28,9 @@
// This class is intended to test:
// GetConsoleAlias
using namespace WEX::TestExecution;
using namespace WEX::Common;
using WEX::Logging::Log;
class AliasTests
{

View file

@ -1,3 +1,4 @@
#include "Common.hpp"
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
@ -72,11 +73,11 @@ void TestGetConsoleAliasHelper(TCH* ptszSourceGiven,
{
case 0:
ptszSource = nullptr;
Log::Comment(L"Using null source arg.");
WEX::Logging::Log::Comment(L"Using null source arg.");
break;
case 1:
ptszSource = ptszSourceGiven;
Log::Comment(String().Format(L"Using source arg: '" TSTRFORMAT "'", ptszSource));
WEX::Logging::Log::Comment(WEX::Common::String().Format(L"Using source arg: '" TSTRFORMAT "'", ptszSource));
break;
default:
VERIFY_FAIL(L"Unknown type.");
@ -86,11 +87,11 @@ void TestGetConsoleAliasHelper(TCH* ptszSourceGiven,
{
case 0:
ptszExeName = nullptr;
Log::Comment(L"Using null exe name.");
WEX::Logging::Log::Comment(L"Using null exe name.");
break;
case 1:
ptszExeName = ptszExeNameGiven;
Log::Comment(String().Format(L"Using exe name arg: '" TSTRFORMAT "'", ptszExeName));
WEX::Logging::Log::Comment(WEX::Common::String().Format(L"Using exe name arg: '" TSTRFORMAT "'", ptszExeName));
break;
default:
VERIFY_FAIL(L"Unknown type.");
@ -143,7 +144,7 @@ void TestGetConsoleAliasHelper(TCH* ptszSourceGiven,
}
});
Log::Comment(String().Format(L"Using target buffer size: '%d'", cbTargetBuffer));
WEX::Logging::Log::Comment(WEX::Common::String().Format(L"Using target buffer size: '%d'", cbTargetBuffer));
// Set the alias if we're supposed to and prepare for cleanup later.
if (bSetFirst)
@ -245,12 +246,12 @@ void TestGetConsoleAliasHelper(TCH* ptszSourceGiven,
VERIFY_ARE_EQUAL(dwExpectedResult, dwActualResult, L"Ensure result code/return value matches expected.");
VERIFY_ARE_EQUAL(dwExpectedLastError, dwActualLastError, L"Ensure last error code matches expected.");
Log::Comment(L"Compare target buffer character by character...");
WEX::Logging::Log::Comment(L"Compare target buffer character by character...");
for (size_t i = 0; i < (cbTargetBuffer / sizeof(TCH)); i++)
{
if (ptchExpectedTarget[i] != ptchTargetBuffer[i])
{
VERIFY_FAIL(String().Format(L"Target mismatch at %d. Expected: '" TCHFORMAT "' Actual: '" TCHFORMAT "'", i, ptchExpectedTarget[i], ptchTargetBuffer[i]));
VERIFY_FAIL(WEX::Common::String().Format(L"Target mismatch at %d. Expected: '" TCHFORMAT "' Actual: '" TCHFORMAT "'", i, ptchExpectedTarget[i], ptchTargetBuffer[i]));
}
}
}

View file

@ -5,6 +5,9 @@
extern "C" IMAGE_DOS_HEADER __ImageBase;
using WEX::Logging::Log;
using namespace WEX::Common;
// This class is intended to test boundary conditions for:
// SetConsoleActiveScreenBuffer
class BufferTests
@ -38,7 +41,7 @@ void BufferTests::TestSetConsoleActiveScreenBufferInvalid()
void BufferTests::TestWritingInactiveScreenBuffer()
{
bool useVtOutput;
VERIFY_SUCCEEDED_RETURN(TestData::TryGetValue(L"UseVtOutput", useVtOutput), L"Get whether this test should check VT output mode.");
VERIFY_SUCCEEDED_RETURN(WEX::TestExecution::TestData::TryGetValue(L"UseVtOutput", useVtOutput), L"Get whether this test should check VT output mode.");
const std::wstring primary(L"You should see me");
const std::wstring alternative(L"You should NOT see me!");

View file

@ -46,6 +46,7 @@ bool CursorTests::TestCleanup()
void CursorTests::TestGetSetConsoleCursorInfo()
{
using namespace WEX::TestExecution;
DWORD dwSize;
bool bVisible;

View file

@ -3,6 +3,10 @@
#include "precomp.h"
using namespace WEX::TestExecution;
using WEX::Logging::Log;
using namespace WEX::Common;
// This class is intended to test:
// GetConsoleScreenBufferInfo
// GetConsoleScreenBufferInfoEx

View file

@ -7,6 +7,10 @@
#include <future>
using WEX::TestExecution::TestData;
using WEX::Logging::Log;
using namespace WEX::Common;
// This class is intended to test:
// WriteFile

View file

@ -3,6 +3,10 @@
#include "precomp.h"
using namespace WEX::TestExecution;
using namespace WEX::Common;
using WEX::Logging::Log;
static const COORD c_coordZero = {0,0};
static const PCWSTR pwszLongFontPath = L"%WINDIR%\\Fonts\\ltype.ttf";

View file

@ -11,6 +11,9 @@
#define NUMBER_OF_SCENARIO_INPUTS 10
#define READ_BATCH 3
using WEX::Logging::Log;
using namespace WEX::Common;
// This class is intended to test:
// FlushConsoleInputBuffer
// PeekConsoleInput
@ -61,7 +64,7 @@ class InputTests
void VerifyNumberOfInputRecords(const HANDLE hConsoleInput, _In_ DWORD nInputs)
{
SetVerifyOutput verifySettings(VerifyOutputSettings::LogOnlyFailures);
WEX::TestExecution::SetVerifyOutput verifySettings(WEX::TestExecution::VerifyOutputSettings::LogOnlyFailures);
DWORD nInputEvents = (DWORD)-1;
VERIFY_WIN32_BOOL_SUCCEEDED(GetNumberOfConsoleInputEvents(hConsoleInput, &nInputEvents));
VERIFY_ARE_EQUAL(nInputEvents,

View file

@ -3,6 +3,8 @@
#include "precomp.h"
using namespace WEX::Logging;
// This class is intended to test:
// GetConsoleMode
// SetConsoleMode

View file

@ -10,6 +10,9 @@
#include <algorithm>
using namespace Microsoft::Console::Types;
using namespace WEX::TestExecution;
using WEX::Logging::Log;
using namespace WEX::Common;
class OutputTests
{

View file

@ -3,6 +3,8 @@
#include "precomp.h"
using WEX::Logging::Log;
// This class is intended to test restrictions placed on APIs from within a UWP application context
class PolicyTests
{

View file

@ -3,6 +3,8 @@
#include "precomp.h"
using namespace WEX::Common;
HANDLE g_hOut = INVALID_HANDLE_VALUE;
CONSOLE_SCREEN_BUFFER_INFOEX g_sbiex_backup = { 0 };
COORD g_cWriteSize = {16, 16};

View file

@ -3,6 +3,9 @@
#include "precomp.h"
using WEX::Logging::Log;
using namespace WEX::Common;
// This class is intended to test:
// GetConsoleTitle
class TitleTests

View file

@ -10,6 +10,10 @@
#define ENGLISH_US_CP 437u
#define JAPANESE_CP 932u
using WEX::TestExecution::TestData;
using WEX::Logging::Log;
using namespace WEX::Common;
namespace DbcsWriteRead
{
enum WriteMode

View file

@ -3,6 +3,9 @@
#include "precomp.h"
using WEX::Logging::Log;
using namespace WEX::Common;
// This class is intended to provide a canary (simple launch test)
// to ensure that activation of the console still works.
class CanaryTests

View file

@ -3,6 +3,9 @@
#include "precomp.h"
using WEX::Logging::Log;
using namespace WEX::Common;
HANDLE Common::_hConsole = INVALID_HANDLE_VALUE;
void VerifySucceededGLE(BOOL bResult)

View file

@ -3,6 +3,9 @@
#include "precomp.h"
using namespace WEX::TestExecution;
using namespace WEX::Common;
const DWORD _dwMaxMillisecondsToWaitOnStartup = 120 * 1000;
const DWORD _dwStartupWaitPollingIntervalInMilliseconds = 200;

View file

@ -23,6 +23,10 @@
#define SLEEP_WAIT_TIME (2 * 1000)
#define GERMAN_KEYBOARD_LAYOUT (MAKELANGID(LANG_GERMAN, SUBLANG_GERMAN))
using namespace WEX::TestExecution;
using namespace WEX::Common;
using WEX::Logging::Log;
class KeyPressTests
{
BEGIN_TEST_CLASS(KeyPressTests)

View file

@ -9,10 +9,6 @@
#include "WexTestClass.h"
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
// This includes support libraries from the CRT, STL, WIL, and GSL
#include "LibraryIncludes.h"

View file

@ -30,6 +30,7 @@
#define PRIVATE_MODES (ENABLE_INSERT_MODE | ENABLE_QUICK_EDIT_MODE | ENABLE_AUTO_POSITION | ENABLE_EXTENDED_FLAGS)
using namespace Microsoft::Console::Types;
using namespace Microsoft::Console::Interactivity;
// Routine Description:
// - Retrieves the console input mode (settings that apply when manipulating the input buffer)

View file

@ -33,8 +33,6 @@ Revision History:
#include <winmeta.h>
TRACELOGGING_DECLARE_PROVIDER(g_hConhostV2EventTraceProvider);
using namespace Microsoft::Console::Render;
class Globals
{
public:
@ -63,9 +61,9 @@ public:
std::vector<wchar_t> WordDelimiters;
IRenderer* pRender;
Microsoft::Console::Render::IRenderer* pRender;
IFontDefaultList* pFontDefaultList;
Microsoft::Console::Render::IFontDefaultList* pFontDefaultList;
bool IsHeadless() const;

View file

@ -8,6 +8,8 @@
#pragma hdrstop
using Microsoft::Console::Interactivity::ServiceLocator;
void LockConsole()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();

View file

@ -22,6 +22,8 @@
#pragma hdrstop
using Microsoft::Console::Interactivity::ServiceLocator;
// I need to be a list because we rearrange elements inside to maintain a
// "least recently used" state. Doing many rearrangement operations with
// a list will maintain the iterator pointers as valid to the elements

View file

@ -16,6 +16,8 @@
#define KEY_ENHANCED 0x01000000
using Microsoft::Console::Interactivity::ServiceLocator;
bool IsInProcessedInputMode()
{
const CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();

View file

@ -13,6 +13,9 @@
#define INPUT_BUFFER_DEFAULT_INPUT_MODE (ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT)
using Microsoft::Console::Interactivity::ServiceLocator;
using Microsoft::Console::VirtualTerminal::TerminalInput;
// Routine Description:
// - This method creates an input buffer.
// Arguments:

View file

@ -15,6 +15,7 @@
#define CHAR_NULL ((char)0)
using Microsoft::Console::Interactivity::ServiceLocator;
WCHAR CharToWchar(_In_reads_(cch) const char * const pch, const UINT cch)
{

View file

@ -15,7 +15,9 @@
#include "../types/inc/convert.hpp"
#pragma hdrstop
using namespace Microsoft::Console::Types;
using namespace Microsoft::Console::Interactivity;
// This routine figures out what parameters to pass to CreateScreenBuffer based on the data from STARTUPINFO and the
// registry defaults, and then calls CreateScreenBuffer.

View file

@ -12,7 +12,9 @@
#include "../interactivity/inc/ServiceLocator.hpp"
#pragma hdrstop
using namespace Microsoft::Console;
using Microsoft::Console::Interactivity::ServiceLocator;
WriteBuffer::WriteBuffer(_In_ Microsoft::Console::IIoProvider& io) :
_io{ io },

View file

@ -21,7 +21,7 @@
#pragma hdrstop
using namespace Microsoft::Console::Types;
using Microsoft::Console::Interactivity::ServiceLocator;
// Routine Description:
// - Creates an object representing an interactive popup overlay during cooked mode command line editing.
// - NOTE: Modifies global popup count (and adjusts cursor visibility as appropriate.)

View file

@ -16,6 +16,8 @@
#define LINE_INPUT_BUFFER_SIZE (256 * sizeof(WCHAR))
using Microsoft::Console::Interactivity::ServiceLocator;
// Routine Description:
// - Constructs cooked read data class to hold context across key presses while a user is modifying their 'input line'.
// Arguments:

View file

@ -75,7 +75,7 @@ bool DirectReadData::Notify(const WaitTerminationReason TerminationReason,
FAIL_FAST_IF(_pInputReadHandleData->GetReadCount() == 0);
const CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
const CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
FAIL_FAST_IF(!gci.IsConsoleLocked());
*pReplyStatus = STATUS_SUCCESS;

View file

@ -79,7 +79,7 @@ bool RAW_READ_DATA::Notify(const WaitTerminationReason TerminationReason,
// on the same console as we're reading from.
FAIL_FAST_IF(_pInputReadHandleData->GetReadCount() == 0);
FAIL_FAST_IF(!ServiceLocator::LocateGlobals().getConsoleInformation().IsConsoleLocked());
FAIL_FAST_IF(!Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation().IsConsoleLocked());
*pReplyStatus = STATUS_SUCCESS;
*pControlKeyState = 0;

View file

@ -14,6 +14,8 @@
#define SET_FIELD_AND_SIZE(x) FIELD_OFFSET(Settings, (x)), RTL_FIELD_SIZE(Settings, (x))
using Microsoft::Console::Interactivity::ServiceLocator;
Registry::Registry(_In_ Settings* const pSettings) :
_pSettings(pSettings)
{

View file

@ -13,7 +13,7 @@
#pragma hdrstop
using namespace Microsoft::Console::Types;
using Microsoft::Console::Interactivity::ServiceLocator;
// Routine Description:
// - Retrieves the viewport that applies over the data available in the GetTextBuffer() call
// Return Value:
@ -177,9 +177,9 @@ COLORREF RenderData::GetCursorColor() const noexcept
// (the highest overlay should be given last)
// Return Value:
// - Iterable set of overlays
const std::vector<RenderOverlay> RenderData::GetOverlays() const noexcept
const std::vector<Microsoft::Console::Render::RenderOverlay> RenderData::GetOverlays() const noexcept
{
std::vector<RenderOverlay> overlays;
std::vector<Microsoft::Console::Render::RenderOverlay> overlays;
try
{
@ -203,7 +203,7 @@ const std::vector<RenderOverlay> RenderData::GetOverlays() const noexcept
// (e.g. 0,0 is the origin of the text buffer above, not the placement within the visible viewport)
const auto used = Viewport::FromInclusive(composition.GetAreaBufferInfo().rcViewCaWindow);
overlays.emplace_back(RenderOverlay{ textBuffer, origin, used });
overlays.emplace_back(Microsoft::Console::Render::RenderOverlay{ textBuffer, origin, used });
}
}
}

View file

@ -16,9 +16,7 @@ Author(s):
#include "..\renderer\inc\IRenderData.hpp"
using namespace Microsoft::Console::Render;
class RenderData final : public IRenderData
class RenderData final : public Microsoft::Console::Render::IRenderData
{
public:
Microsoft::Console::Types::Viewport GetViewport() noexcept override;
@ -38,7 +36,7 @@ public:
COLORREF GetCursorColor() const noexcept override;
bool IsCursorDoubleWidth() const noexcept override;
const std::vector<RenderOverlay> GetOverlays() const noexcept override;
const std::vector<Microsoft::Console::Render::RenderOverlay> GetOverlays() const noexcept override;
const bool IsGridLineDrawingAllowed() noexcept override;

View file

@ -16,9 +16,7 @@ Author(s):
#include "..\renderer\inc\IFontDefaultList.hpp"
using namespace Microsoft::Console::Render;
class RenderFontDefaults sealed : public IFontDefaultList
class RenderFontDefaults sealed : public Microsoft::Console::Render::IFontDefaultList
{
public:
RenderFontDefaults();

View file

@ -19,12 +19,16 @@
#include "../types/inc/convert.hpp"
#pragma hdrstop
#pragma region Construct/Destruct
using namespace Microsoft::Console;
using namespace Microsoft::Console::Types;
using namespace Microsoft::Console::Render;
#pragma region Construct/Destruct
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::VirtualTerminal;
SCREEN_INFORMATION::SCREEN_INFORMATION(
_In_ IWindowMetrics *pMetrics,

View file

@ -48,10 +48,6 @@ Revision History:
#include "../renderer/inc/FontInfoDesired.hpp"
#include "../types/inc/Viewport.hpp"
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::VirtualTerminal;
class ConversionAreaInfo; // forward decl window. circular reference
class SCREEN_INFORMATION : public ConsoleObjectHeader, public Microsoft::Console::IIoProvider
@ -188,8 +184,8 @@ public:
bool IsActiveScreenBuffer() const;
const StateMachine& GetStateMachine() const;
StateMachine& GetStateMachine();
const Microsoft::Console::VirtualTerminal::StateMachine& GetStateMachine() const;
Microsoft::Console::VirtualTerminal::StateMachine& GetStateMachine();
void SetCursorInformation(const ULONG Size,
const bool Visible) noexcept;
@ -255,13 +251,13 @@ public:
void InitializeCursorRowAttributes();
private:
SCREEN_INFORMATION(_In_ IWindowMetrics *pMetrics,
_In_ IAccessibilityNotifier *pNotifier,
SCREEN_INFORMATION(_In_ Microsoft::Console::Interactivity::IWindowMetrics *pMetrics,
_In_ Microsoft::Console::Interactivity::IAccessibilityNotifier *pNotifier,
const TextAttribute popupAttributes,
const FontInfo fontInfo);
IWindowMetrics *_pConsoleWindowMetrics;
IAccessibilityNotifier *_pAccessibilityNotifier;
Microsoft::Console::Interactivity::IWindowMetrics *_pConsoleWindowMetrics;
Microsoft::Console::Interactivity::IAccessibilityNotifier *_pAccessibilityNotifier;
[[nodiscard]]
HRESULT _AdjustScreenBufferHelper(const RECT* const prcClientNew,
@ -294,7 +290,7 @@ private:
bool _IsAltBuffer() const;
bool _IsInPtyMode() const;
std::shared_ptr<StateMachine> _stateMachine;
std::shared_ptr<Microsoft::Console::VirtualTerminal::StateMachine> _stateMachine;
Microsoft::Console::Types::Viewport _scrollMargins; //The margins of the VT specified scroll region. Left and Right are currently unused, but could be in the future.

View file

@ -9,6 +9,9 @@
#include "..\interactivity\inc\ServiceLocator.hpp"
using Microsoft::Console::VirtualTerminal::StateMachine;
using namespace Microsoft::Console::Interactivity;
ULONG Scrolling::s_ucWheelScrollLines = 0;
ULONG Scrolling::s_ucWheelScrollChars = 0;

View file

@ -9,6 +9,7 @@
#include "../interactivity/inc/ServiceLocator.hpp"
using namespace Microsoft::Console::Interactivity;
std::unique_ptr<Selection> Selection::_instance;

View file

@ -23,8 +23,6 @@ Revision History:
#include "..\interactivity\inc\IAccessibilityNotifier.hpp"
#include "..\interactivity\inc\IConsoleWindow.hpp"
using namespace Microsoft::Console::Interactivity;
class Selection
{
public:

View file

@ -11,7 +11,7 @@
#include <algorithm>
using namespace Microsoft::Console::Types;
using Microsoft::Console::Interactivity::ServiceLocator;
// Routine Description:
// - Handles a keyboard event for extending the current selection
// - Must be called when the console is in selecting state.

View file

@ -8,7 +8,7 @@
#include "../types/inc/viewport.hpp"
using namespace Microsoft::Console::Types;
using namespace Microsoft::Console::Interactivity;
// Routine Description:
// - Determines whether the console is in a selecting state

View file

@ -12,6 +12,8 @@
#define DEFAULT_NUMBER_OF_COMMANDS 25
#define DEFAULT_NUMBER_OF_BUFFERS 4
using Microsoft::Console::Interactivity::ServiceLocator;
Settings::Settings() :
_dwHotKey(0),
_dwStartupFlags(0),

View file

@ -25,6 +25,9 @@
#pragma hdrstop
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::Render;
const UINT CONSOLE_EVENT_FAILURE_ID = 21790;
const UINT CONSOLE_LPC_PORT_FAILURE_ID = 21791;

View file

@ -19,6 +19,8 @@
#pragma hdrstop
using Microsoft::Console::Interactivity::ServiceLocator;
// Routine Description:
// - This routine is used in stream input. It gets input and filters it for unicode characters.
// Arguments:

View file

@ -217,6 +217,7 @@ void Telemetry::FindDialogClosed()
// disconnect when the conhost process exits. So we have to remember the last process that connected.
void Telemetry::TotalCodesForPreviousProcess()
{
using namespace Microsoft::Console::VirtualTerminal;
// Get the values even if we aren't recording the previously connected process, since we want to reset them to 0.
unsigned int _uiTimesUsedCurrent = TermTelemetry::Instance().GetAndResetTimesUsedCurrent();
unsigned int _uiTimesFailedCurrent = TermTelemetry::Instance().GetAndResetTimesFailedCurrent();
@ -352,14 +353,14 @@ void Telemetry::LogProcessConnected(const HANDLE hProcess)
// so we don't overwhelm our servers by sending a constant stream of telemetry while the console is being used.
void Telemetry::WriteFinalTraceLog()
{
const CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
const CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
// This is a bit of processing, so don't do it for the 95% of machines that aren't being sampled.
if (TraceLoggingProviderEnabled(g_hConhostV2EventTraceProvider, 0, MICROSOFT_KEYWORD_MEASURES))
{
// Normally we would set the activity Id earlier, but since we know the parser only sends
// one final log at the end, setting the activity this late should be fine.
TermTelemetry::Instance().SetActivityId(_activity.Id());
TermTelemetry::Instance().SetShouldWriteFinalLog(_fUserInteractiveForTelemetry);
Microsoft::Console::VirtualTerminal::TermTelemetry::Instance().SetActivityId(_activity.Id());
Microsoft::Console::VirtualTerminal::TermTelemetry::Instance().SetShouldWriteFinalLog(_fUserInteractiveForTelemetry);
if (_fUserInteractiveForTelemetry)
{

View file

@ -17,6 +17,7 @@
using namespace Microsoft::Console::Types;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
class ApiRoutinesTests
{

View file

@ -19,13 +19,14 @@
#include "..\..\interactivity\inc\VtApiRedirection.hpp"
#endif
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
#include "UnicodeLiteral.hpp"
#include "../../inc/consoletaeftemplates.hpp"
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::Interactivity::Win32;
static const WORD altScanCode = 0x38;

View file

@ -15,6 +15,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
constexpr size_t PROMPT_SIZE = 512;

View file

@ -15,7 +15,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
static constexpr size_t BUFFER_SIZE = 256;
static constexpr UINT s_NumberOfHistoryBuffers = 4;
static constexpr UINT s_HistoryBufferSize = 50;

View file

@ -17,6 +17,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
static constexpr size_t BUFFER_SIZE = 256;

View file

@ -16,6 +16,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
static constexpr size_t BUFFER_SIZE = 256;

View file

@ -12,7 +12,7 @@
#include "../CopyToCharPopup.hpp"
using Microsoft::Console::Interactivity::ServiceLocator;
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;

View file

@ -12,6 +12,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
class HistoryTests
{

View file

@ -34,6 +34,7 @@ class InitTests
// See the LOAD BEARING CODE comment inside GetConsoleLangId or the investigation results in MSFT: 9808579 for more detail.
TEST_METHOD(TestGetConsoleLangId)
{
using Microsoft::Console::Interactivity::ServiceLocator;
BEGIN_TEST_METHOD_PROPERTIES()
// https://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx
// The interesting ones for us are:

View file

@ -10,6 +10,7 @@
#include "..\types\inc\IInputEvent.hpp"
using namespace WEX::Logging;
using Microsoft::Console::Interactivity::ServiceLocator;
class InputBufferTests
{

View file

@ -15,6 +15,7 @@
#include <memory>
using namespace WEX::Logging;
using Microsoft::Console::Interactivity::ServiceLocator;
class InputRecordConversionTests
{

View file

@ -24,6 +24,8 @@ using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using namespace Microsoft::Console::Types;
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::VirtualTerminal;
class ScreenBufferTests
{

View file

@ -12,6 +12,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
class SearchTests
{

View file

@ -17,6 +17,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
class SelectionTests
{

View file

@ -20,6 +20,7 @@
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;
using Microsoft::Console::Interactivity::ServiceLocator;
class TextBufferIteratorTests
{

View file

@ -18,6 +18,8 @@
#include "../renderer/inc/DummyRenderTarget.hpp"
using namespace Microsoft::Console::Types;
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::VirtualTerminal;
using namespace WEX::Common;
using namespace WEX::Logging;
using namespace WEX::TestExecution;

View file

@ -9,6 +9,8 @@
#include "srvinit.h"
using Microsoft::Console::Interactivity::ServiceLocator;
short CalcWindowSizeX(const SMALL_RECT& rect) noexcept
{
return rect.Right - rect.Left + 1;

View file

@ -117,7 +117,7 @@ bool WriteData::Notify(const WaitTerminationReason TerminationReason,
// This routine should be called by a thread owning the same lock on the
// same console as we're reading from.
FAIL_FAST_IF(!(ServiceLocator::LocateGlobals().getConsoleInformation().IsConsoleLocked()));
FAIL_FAST_IF(!(Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation().IsConsoleLocked()));
std::unique_ptr<WriteData> waiter;
size_t cbContext = _cbContext;

View file

@ -53,7 +53,7 @@ public:
void InitEvents()
{
ServiceLocator::LocateGlobals().hInputEvent.create(wil::EventOptions::ManualReset);
Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().hInputEvent.create(wil::EventOptions::ManualReset);
}
void PrepareReadHandle()
@ -84,7 +84,7 @@ public:
void PrepareGlobalScreenBuffer()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
COORD coordWindowSize;
coordWindowSize.X = s_csWindowWidth;
coordWindowSize.Y = s_csWindowHeight;
@ -106,25 +106,25 @@ public:
void CleanupGlobalScreenBuffer()
{
const CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
const CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
delete gci.pCurrentScreenBuffer;
}
void PrepareGlobalInputBuffer()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
gci.pInputBuffer = new InputBuffer();
}
void CleanupGlobalInputBuffer()
{
const CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
const CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
delete gci.pInputBuffer;
}
void PrepareCookedReadData()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
auto* readData = new COOKED_READ_DATA(gci.pInputBuffer,
m_readHandle.get(),
gci.GetActiveOutputBuffer(),
@ -139,14 +139,14 @@ public:
void CleanupCookedReadData()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
delete &gci.CookedReadData();
gci.SetCookedReadData(nullptr);
}
void PrepareNewTextBufferInfo()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
COORD coordScreenBufferSize;
coordScreenBufferSize.X = s_csBufferWidth;
coordScreenBufferSize.Y = s_csBufferHeight;
@ -178,7 +178,7 @@ public:
void CleanupNewTextBufferInfo()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
VERIFY_IS_TRUE(gci.HasActiveOutputBuffer());
gci.pCurrentScreenBuffer->_textBuffer.swap(m_backupTextBufferInfo);
@ -186,7 +186,7 @@ public:
void FillTextBuffer()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
// fill with some assorted text that doesn't consume the whole row
const SHORT cRowsToFill = 4;
@ -205,7 +205,7 @@ public:
void FillTextBufferBisect()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
// fill with some text that fills the whole row and has bisecting double byte characters
const SHORT cRowsToFill = s_csBufferHeight;
@ -290,7 +290,7 @@ private:
void FillBisect(ROW *pRow)
{
const CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
const CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
// length 80 string of text with bisecting characters at the beginning and end.
// positions of き(\x304d) are at 0, 27-28, 39-40, 67-68, 79
PWCHAR pwszText =

View file

@ -15,6 +15,7 @@
using namespace Microsoft::Console::Interactivity::Win32;
using namespace Microsoft::Console::Interactivity::Win32::UiaTextRangeTracing;
using namespace Microsoft::Console::Interactivity;
// toggle these for additional logging in a debug build
//#define UIATEXTRANGE_DEBUG_MSGS 1
@ -1227,8 +1228,9 @@ const Microsoft::Console::Types::Viewport& UiaTextRange::_getViewport()
// Return Value:
// - The current window. May return nullptr if there is no current
// window.
IConsoleWindow* const UiaTextRange::_getIConsoleWindow()
Microsoft::Console::Interactivity::IConsoleWindow* const UiaTextRange::_getIConsoleWindow()
{
using namespace Microsoft::Console::Interactivity;
IConsoleWindow* const pIConsoleWindow = ServiceLocator::LocateConsoleWindow();
THROW_HR_IF_NULL(E_POINTER, pIConsoleWindow);
return pIConsoleWindow;

View file

@ -18,6 +18,7 @@
// - Rectangle specifying current command line edit area.
RECT GetImeSuggestionWindowPos()
{
using Microsoft::Console::Interactivity::ServiceLocator;
const CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
const auto& screenBuffer = gci.GetActiveOutputBuffer();

View file

@ -1,98 +1,100 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "precomp.h"
#include "find.h"
#include "resource.h"
#include "window.hpp"
#include "..\..\host\dbcs.h"
#include "..\..\host\handle.h"
#include "..\..\host\search.h"
#include "..\inc\ServiceLocator.hpp"
#pragma hdrstop
INT_PTR CALLBACK FindDialogProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
// This bool is used to track which option - up or down - was used to perform the last search. That way, the next time the
// find dialog is opened, it will default to the last used option.
static bool fFindSearchUp = true;
WCHAR szBuf[SEARCH_STRING_LENGTH + 1];
switch (Message)
{
case WM_INITDIALOG:
SetWindowLongPtrW(hWnd, DWLP_USER, lParam);
SendDlgItemMessageW(hWnd, ID_CONSOLE_FINDSTR, EM_LIMITTEXT, ARRAYSIZE(szBuf) - 1, 0);
CheckRadioButton(hWnd, ID_CONSOLE_FINDUP, ID_CONSOLE_FINDDOWN, (fFindSearchUp? ID_CONSOLE_FINDUP : ID_CONSOLE_FINDDOWN));
return TRUE;
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case IDOK:
{
USHORT const StringLength = (USHORT) GetDlgItemTextW(hWnd, ID_CONSOLE_FINDSTR, szBuf, ARRAYSIZE(szBuf));
if (StringLength == 0)
{
break;
}
bool const IgnoreCase = IsDlgButtonChecked(hWnd, ID_CONSOLE_FINDCASE) == 0;
bool const Reverse = IsDlgButtonChecked(hWnd, ID_CONSOLE_FINDDOWN) == 0;
fFindSearchUp = !!Reverse;
SCREEN_INFORMATION& ScreenInfo = gci.GetActiveOutputBuffer();
std::wstring wstr(szBuf, StringLength);
LockConsole();
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
Search search(ScreenInfo,
wstr,
Reverse ? Search::Direction::Backward : Search::Direction::Forward,
IgnoreCase ? Search::Sensitivity::CaseInsensitive : Search::Sensitivity::CaseSensitive);
if (search.FindNext())
{
Telemetry::Instance().LogFindDialogNextClicked(StringLength, (Reverse != 0), (IgnoreCase == 0));
search.Select();
return TRUE;
}
else
{
// The string wasn't found.
ScreenInfo.SendNotifyBeep();
}
break;
}
case IDCANCEL:
Telemetry::Instance().FindDialogClosed();
EndDialog(hWnd, 0);
return TRUE;
}
break;
}
default:
break;
}
return FALSE;
}
void DoFind()
{
Globals& g = ServiceLocator::LocateGlobals();
IConsoleWindow* const pWindow = ServiceLocator::LocateConsoleWindow();
UnlockConsole();
if (pWindow != nullptr)
{
HWND const hwnd = pWindow->GetWindowHandle();
++g.uiDialogBoxCount;
DialogBoxParamW(g.hInstance, MAKEINTRESOURCE(ID_CONSOLE_FINDDLG), hwnd, FindDialogProc, (LPARAM) nullptr);
--g.uiDialogBoxCount;
}
}
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "precomp.h"
#include "find.h"
#include "resource.h"
#include "window.hpp"
#include "..\..\host\dbcs.h"
#include "..\..\host\handle.h"
#include "..\..\host\search.h"
#include "..\inc\ServiceLocator.hpp"
#pragma hdrstop
using namespace Microsoft::Console::Interactivity;
INT_PTR CALLBACK FindDialogProc(HWND hWnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
// This bool is used to track which option - up or down - was used to perform the last search. That way, the next time the
// find dialog is opened, it will default to the last used option.
static bool fFindSearchUp = true;
WCHAR szBuf[SEARCH_STRING_LENGTH + 1];
switch (Message)
{
case WM_INITDIALOG:
SetWindowLongPtrW(hWnd, DWLP_USER, lParam);
SendDlgItemMessageW(hWnd, ID_CONSOLE_FINDSTR, EM_LIMITTEXT, ARRAYSIZE(szBuf) - 1, 0);
CheckRadioButton(hWnd, ID_CONSOLE_FINDUP, ID_CONSOLE_FINDDOWN, (fFindSearchUp? ID_CONSOLE_FINDUP : ID_CONSOLE_FINDDOWN));
return TRUE;
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case IDOK:
{
USHORT const StringLength = (USHORT) GetDlgItemTextW(hWnd, ID_CONSOLE_FINDSTR, szBuf, ARRAYSIZE(szBuf));
if (StringLength == 0)
{
break;
}
bool const IgnoreCase = IsDlgButtonChecked(hWnd, ID_CONSOLE_FINDCASE) == 0;
bool const Reverse = IsDlgButtonChecked(hWnd, ID_CONSOLE_FINDDOWN) == 0;
fFindSearchUp = !!Reverse;
SCREEN_INFORMATION& ScreenInfo = gci.GetActiveOutputBuffer();
std::wstring wstr(szBuf, StringLength);
LockConsole();
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
Search search(ScreenInfo,
wstr,
Reverse ? Search::Direction::Backward : Search::Direction::Forward,
IgnoreCase ? Search::Sensitivity::CaseInsensitive : Search::Sensitivity::CaseSensitive);
if (search.FindNext())
{
Telemetry::Instance().LogFindDialogNextClicked(StringLength, (Reverse != 0), (IgnoreCase == 0));
search.Select();
return TRUE;
}
else
{
// The string wasn't found.
ScreenInfo.SendNotifyBeep();
}
break;
}
case IDCANCEL:
Telemetry::Instance().FindDialogClosed();
EndDialog(hWnd, 0);
return TRUE;
}
break;
}
default:
break;
}
return FALSE;
}
void DoFind()
{
Globals& g = ServiceLocator::LocateGlobals();
IConsoleWindow* const pWindow = ServiceLocator::LocateConsoleWindow();
UnlockConsole();
if (pWindow != nullptr)
{
HWND const hwnd = pWindow->GetWindowHandle();
++g.uiDialogBoxCount;
DialogBoxParamW(g.hInstance, MAKEINTRESOURCE(ID_CONSOLE_FINDDLG), hwnd, FindDialogProc, (LPARAM) nullptr);
--g.uiDialogBoxCount;
}
}

View file

@ -15,7 +15,7 @@
using namespace Microsoft::Console::Interactivity::Win32;
using namespace Microsoft::Console::Interactivity::Win32::ScreenInfoUiaProviderTracing;
using namespace Microsoft::Console::Interactivity;
// A helper function to create a SafeArray Version of an int array of a specified length
SAFEARRAY* BuildIntSafeArray(_In_reads_(length) const int* const data, const int length)
{

View file

@ -71,7 +71,7 @@ class UiaTextRangeTests
TEST_METHOD_SETUP(MethodSetup)
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
// set up common state
_state = new CommonState();
_state->PrepareGlobalFont();

View file

@ -44,6 +44,8 @@
using namespace Microsoft::Console::Interactivity::Win32;
using namespace Microsoft::Console::Types;
using namespace Microsoft::Console::Interactivity;
using namespace Microsoft::Console::Render;
ATOM Window::s_atomWindowClass = 0;
Window* Window::s_Instance = nullptr;

View file

@ -391,7 +391,7 @@ HRESULT WindowUiaProvider::_EnsureValidHwnd() const
return S_OK;
}
IConsoleWindow* const WindowUiaProvider::_getIConsoleWindow()
Microsoft::Console::Interactivity::IConsoleWindow* const WindowUiaProvider::_getIConsoleWindow()
{
return ServiceLocator::LocateConsoleWindow();
return Microsoft::Console::Interactivity::ServiceLocator::LocateConsoleWindow();
}

View file

@ -23,7 +23,7 @@
#pragma hdrstop
using namespace Microsoft::Console::Interactivity::Win32;
using Microsoft::Console::Interactivity::ServiceLocator;
// For usage with WM_SYSKEYDOWN message processing.
// See https://msdn.microsoft.com/en-us/library/windows/desktop/ms646286(v=vs.85).aspx
// Bit 29 is whether ALT was held when the message was posted.

View file

@ -14,6 +14,8 @@
#include "..\interactivity\inc\ServiceLocator.hpp"
using Microsoft::Console::Interactivity::ServiceLocator;
[[nodiscard]]
HRESULT ApiDispatchers::ServerDeprecatedApi(_Inout_ CONSOLE_API_MSG * const m, _Inout_ BOOL* const /*pbReplyPending*/)
{

View file

@ -164,7 +164,7 @@ HRESULT ConsoleHandleData::GetScreenBuffer(const ACCESS_MASK amRequested,
[[nodiscard]]
HRESULT ConsoleHandleData::GetWaitQueue(_Outptr_ ConsoleWaitQueue** const ppWaitQueue) const
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
CONSOLE_INFORMATION& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
if (_IsInput())
{
InputBuffer* const pObj = static_cast<InputBuffer*>(_pvClientPointer);

View file

@ -11,6 +11,8 @@
#include "..\interactivity\inc\ServiceLocator.hpp"
using namespace Microsoft::Console::Interactivity;
// Routine Description:
// - Allocates and stores in a list the process information given.
// - Will not create a new entry in the list given information matches a known process. Will instead return existing entry.

View file

@ -213,7 +213,7 @@ bool ConsoleWaitBlock::Notify(const WaitTerminationReason TerminationReason)
LOG_IF_FAILED(_WaitReplyMessage.ReleaseMessageBuffers());
LOG_IF_FAILED(ServiceLocator::LocateGlobals().pDeviceComm->CompleteIo(&_WaitReplyMessage.Complete));
LOG_IF_FAILED(Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().pDeviceComm->CompleteIo(&_WaitReplyMessage.Complete));
fRetVal = true;
}