terminal/src/host/handle.cpp
Dustin Howett d4d59fa339 Initial release of the Windows Terminal source code
This commit introduces all of the Windows Terminal and Console Host source,
under the MIT license.
2019-05-02 15:29:04 -07:00

29 lines
594 B
C++

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
#include "precomp.h"
#include "handle.h"
#include "..\interactivity\inc\ServiceLocator.hpp"
#pragma hdrstop
void LockConsole()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
gci.LockConsole();
}
void UnlockConsole()
{
CONSOLE_INFORMATION& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
if (gci.GetCSRecursionCount() == 1)
{
ProcessCtrlEvents();
}
else
{
gci.UnlockConsole();
}
}