mirror of
https://github.com/microsoft/terminal.git
synced 2026-04-06 14:19:45 +00:00
Compare commits
1 Commits
dev/duhowe
...
dev/lhecke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a4cdb2e2a |
@@ -34,22 +34,22 @@ public:
|
||||
|
||||
void GetConsoleOutputCodePageImpl(ULONG& codepage) noexcept override;
|
||||
|
||||
void GetConsoleInputModeImpl(InputBuffer& context,
|
||||
void GetConsoleInputModeImpl(InputBuffer& inputBuffer,
|
||||
ULONG& mode) noexcept override;
|
||||
|
||||
void GetConsoleOutputModeImpl(SCREEN_INFORMATION& context,
|
||||
void GetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& mode) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleInputModeImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT SetConsoleInputModeImpl(InputBuffer& inputBuffer,
|
||||
const ULONG mode) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleOutputModeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG Mode) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT GetNumberOfConsoleInputEventsImpl(const InputBuffer& context,
|
||||
[[nodiscard]] HRESULT GetNumberOfConsoleInputEventsImpl(const InputBuffer& inputBuffer,
|
||||
ULONG& events) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT GetConsoleInputImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] HRESULT GetConsoleInputImpl(InputBuffer& inputBuffer,
|
||||
InputEventQueue& outEvents,
|
||||
const size_t eventReadCount,
|
||||
INPUT_READ_HANDLE_DATA& readHandleState,
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
const bool IsPeek,
|
||||
std::unique_ptr<IWaitRoutine>& waiter) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleImpl(InputBuffer& inputBuffer,
|
||||
std::span<char> buffer,
|
||||
size_t& written,
|
||||
std::unique_ptr<IWaitRoutine>& waiter,
|
||||
@@ -69,13 +69,13 @@ public:
|
||||
const DWORD controlWakeupMask,
|
||||
DWORD& controlKeyState) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleAImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::string_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
std::unique_ptr<IWaitRoutine>& waiter) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleWImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::wstring_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
@@ -89,19 +89,19 @@ public:
|
||||
|
||||
#pragma region L2
|
||||
|
||||
[[nodiscard]] HRESULT FillConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT FillConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const WORD attribute,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
size_t& cellsModified) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT FillConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT FillConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const char character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
size_t& cellsModified) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT FillConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT FillConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const wchar_t character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
@@ -114,44 +114,44 @@ public:
|
||||
|
||||
void SetConsoleActiveScreenBufferImpl(SCREEN_INFORMATION& newContext) noexcept override;
|
||||
|
||||
void FlushConsoleInputBuffer(InputBuffer& context) noexcept override;
|
||||
void FlushConsoleInputBuffer(InputBuffer& inputBuffer) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleInputCodePageImpl(const ULONG codepage) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleOutputCodePageImpl(const ULONG codepage) noexcept override;
|
||||
|
||||
void GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& context,
|
||||
void GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& size,
|
||||
bool& isVisible) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleCursorInfoImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleCursorInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG size,
|
||||
const bool isVisible) noexcept override;
|
||||
|
||||
//// driver will pare down for non-Ex method
|
||||
void GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& context,
|
||||
void GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::size size) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleCursorPositionImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleCursorPositionImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::point position) noexcept override;
|
||||
|
||||
void GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& context,
|
||||
void GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
til::size& size) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
const char fillCharacter,
|
||||
const WORD fillAttribute) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
@@ -159,69 +159,69 @@ public:
|
||||
const WORD fillAttribute,
|
||||
const bool enableCmdShim = false) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleTextAttributeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleTextAttributeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const WORD attribute) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleWindowInfoImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleWindowInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isAbsolute,
|
||||
const til::inclusive_rect& windowRect) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<WORD> buffer,
|
||||
size_t& written) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<char> buffer,
|
||||
size_t& written) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<wchar_t> buffer,
|
||||
size_t& written) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleInputAImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleInputAImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleInputWImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleInputWImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputAImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& writtenRectangle) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputWImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& writtenRectangle) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::span<const WORD> attrs,
|
||||
const til::point target,
|
||||
size_t& used) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::string_view text,
|
||||
const til::point target,
|
||||
size_t& used) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::wstring_view text,
|
||||
const til::point target,
|
||||
size_t& used) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputAImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputWImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept override;
|
||||
@@ -251,16 +251,16 @@ public:
|
||||
#pragma region L3
|
||||
void GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT GetConsoleFontSizeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT GetConsoleFontSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const DWORD index,
|
||||
til::size& size) noexcept override;
|
||||
|
||||
//// driver will pare down for non-Ex method
|
||||
[[nodiscard]] HRESULT GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleDisplayModeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleDisplayModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG flags,
|
||||
til::size& newSize) noexcept override;
|
||||
|
||||
@@ -344,7 +344,7 @@ public:
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleHistoryInfoImpl(const CONSOLE_HISTORY_INFO& consoleHistoryInfo) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetCurrentConsoleFontExImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT SetCurrentConsoleFontExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
const CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept override;
|
||||
|
||||
|
||||
@@ -58,38 +58,38 @@ void VtApiRoutines::GetConsoleOutputCodePageImpl(ULONG& codepage) noexcept
|
||||
return;
|
||||
}
|
||||
|
||||
void VtApiRoutines::GetConsoleInputModeImpl(InputBuffer& context,
|
||||
void VtApiRoutines::GetConsoleInputModeImpl(InputBuffer& inputBuffer,
|
||||
ULONG& mode) noexcept
|
||||
{
|
||||
mode = m_inputMode;
|
||||
return;
|
||||
}
|
||||
|
||||
void VtApiRoutines::GetConsoleOutputModeImpl(SCREEN_INFORMATION& context,
|
||||
void VtApiRoutines::GetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& mode) noexcept
|
||||
{
|
||||
mode = m_outputMode;
|
||||
return;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleInputModeImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleInputModeImpl(InputBuffer& inputBuffer,
|
||||
const ULONG mode) noexcept
|
||||
{
|
||||
m_inputMode = mode;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleOutputModeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG Mode) noexcept
|
||||
{
|
||||
m_outputMode = Mode;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::GetNumberOfConsoleInputEventsImpl(const InputBuffer& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::GetNumberOfConsoleInputEventsImpl(const InputBuffer& inputBuffer,
|
||||
ULONG& events) noexcept
|
||||
{
|
||||
return m_pUsualRoutines->GetNumberOfConsoleInputEventsImpl(context, events);
|
||||
return m_pUsualRoutines->GetNumberOfConsoleInputEventsImpl(inputBuffer, events);
|
||||
}
|
||||
|
||||
void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) noexcept
|
||||
@@ -106,7 +106,7 @@ void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) no
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::GetConsoleInputImpl(
|
||||
IConsoleInputObject& context,
|
||||
InputBuffer& inputBuffer,
|
||||
InputEventQueue& outEvents,
|
||||
const size_t eventReadCount,
|
||||
INPUT_READ_HANDLE_DATA& readHandleState,
|
||||
@@ -114,12 +114,12 @@ void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) no
|
||||
const bool IsPeek,
|
||||
std::unique_ptr<IWaitRoutine>& waiter) noexcept
|
||||
{
|
||||
const auto hr = m_pUsualRoutines->GetConsoleInputImpl(context, outEvents, eventReadCount, readHandleState, IsUnicode, IsPeek, waiter);
|
||||
const auto hr = m_pUsualRoutines->GetConsoleInputImpl(inputBuffer, outEvents, eventReadCount, readHandleState, IsUnicode, IsPeek, waiter);
|
||||
_SynchronizeCursor(waiter);
|
||||
return hr;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleImpl(InputBuffer& inputBuffer,
|
||||
std::span<char> buffer,
|
||||
size_t& written,
|
||||
std::unique_ptr<IWaitRoutine>& waiter,
|
||||
@@ -131,7 +131,7 @@ void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) no
|
||||
const DWORD controlWakeupMask,
|
||||
DWORD& controlKeyState) noexcept
|
||||
{
|
||||
const auto hr = m_pUsualRoutines->ReadConsoleImpl(context, buffer, written, waiter, initialData, exeName, readHandleState, IsUnicode, clientHandle, controlWakeupMask, controlKeyState);
|
||||
const auto hr = m_pUsualRoutines->ReadConsoleImpl(inputBuffer, buffer, written, waiter, initialData, exeName, readHandleState, IsUnicode, clientHandle, controlWakeupMask, controlKeyState);
|
||||
// If we're about to tell the caller to wait, let's synchronize the cursor we have with what
|
||||
// the terminal is presenting in case there's a cooked read going on.
|
||||
// TODO GH10001: we only need to do this in cooked read mode.
|
||||
@@ -144,7 +144,7 @@ void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) no
|
||||
return hr;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleAImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::string_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
@@ -164,7 +164,7 @@ void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) no
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleWImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::wstring_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
@@ -181,7 +181,7 @@ void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) no
|
||||
return m_pUsualRoutines->GetConsoleLangIdImpl(langId);
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::FillConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::FillConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const WORD attribute,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
@@ -196,7 +196,7 @@ void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) no
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::FillConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::FillConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const char character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
@@ -219,7 +219,7 @@ void VtApiRoutines::_SynchronizeCursor(std::unique_ptr<IWaitRoutine>& waiter) no
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::FillConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::FillConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const wchar_t character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
@@ -250,9 +250,9 @@ void VtApiRoutines::SetConsoleActiveScreenBufferImpl(SCREEN_INFORMATION& newCont
|
||||
return;
|
||||
}
|
||||
|
||||
void VtApiRoutines::FlushConsoleInputBuffer(InputBuffer& context) noexcept
|
||||
void VtApiRoutines::FlushConsoleInputBuffer(InputBuffer& inputBuffer) noexcept
|
||||
{
|
||||
m_pUsualRoutines->FlushConsoleInputBuffer(context);
|
||||
m_pUsualRoutines->FlushConsoleInputBuffer(inputBuffer);
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleInputCodePageImpl(const ULONG codepage) noexcept
|
||||
@@ -267,7 +267,7 @@ void VtApiRoutines::FlushConsoleInputBuffer(InputBuffer& context) noexcept
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void VtApiRoutines::GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& context,
|
||||
void VtApiRoutines::GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& size,
|
||||
bool& isVisible) noexcept
|
||||
{
|
||||
@@ -276,7 +276,7 @@ void VtApiRoutines::GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& context,
|
||||
return;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleCursorInfoImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleCursorInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG size,
|
||||
const bool isVisible) noexcept
|
||||
{
|
||||
@@ -286,14 +286,14 @@ void VtApiRoutines::GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& context,
|
||||
}
|
||||
|
||||
//// driver will pare down for non-Ex method
|
||||
void VtApiRoutines::GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& context,
|
||||
void VtApiRoutines::GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept
|
||||
{
|
||||
// TODO GH10001: this is technically full of potentially incorrect data. do we care? should we store it in here with set?
|
||||
return m_pUsualRoutines->GetConsoleScreenBufferInfoExImpl(context, data);
|
||||
return m_pUsualRoutines->GetConsoleScreenBufferInfoExImpl(screenInfo, data);
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept
|
||||
{
|
||||
(void)m_pVtEngine->_ResizeWindow(data.srWindow.Right - data.srWindow.Left, data.srWindow.Bottom - data.srWindow.Top);
|
||||
@@ -307,19 +307,19 @@ void VtApiRoutines::GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& c
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::size size) noexcept
|
||||
{
|
||||
// Don't transmit. The terminal figures out its own buffer size.
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleCursorPositionImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleCursorPositionImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::point position) noexcept
|
||||
{
|
||||
if (m_listeningForDSR)
|
||||
{
|
||||
context.GetActiveBuffer().GetTextBuffer().GetCursor().SetPosition(position);
|
||||
screenInfo.GetActiveBuffer().GetTextBuffer().GetCursor().SetPosition(position);
|
||||
m_pVtEngine->SetTerminalCursorTextPosition(position);
|
||||
}
|
||||
else
|
||||
@@ -330,14 +330,14 @@ void VtApiRoutines::GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& c
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& context,
|
||||
void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
til::size& size) noexcept
|
||||
{
|
||||
m_pUsualRoutines->GetLargestConsoleWindowSizeImpl(context, size); // This is likely super weird but not weirder than existing ConPTY answers.
|
||||
m_pUsualRoutines->GetLargestConsoleWindowSizeImpl(screenInfo, size); // This is likely super weird but not weirder than existing ConPTY answers.
|
||||
return;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
@@ -348,7 +348,7 @@ void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& co
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
@@ -360,7 +360,7 @@ void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& co
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleTextAttributeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleTextAttributeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const WORD attribute) noexcept
|
||||
{
|
||||
(void)m_pVtEngine->_SetGraphicsRendition16Color(static_cast<BYTE>(attribute), true);
|
||||
@@ -369,7 +369,7 @@ void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& co
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleWindowInfoImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleWindowInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isAbsolute,
|
||||
const til::inclusive_rect& windowRect) noexcept
|
||||
{
|
||||
@@ -378,7 +378,7 @@ void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& co
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<WORD> buffer,
|
||||
size_t& written) noexcept
|
||||
@@ -388,7 +388,7 @@ void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& co
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<char> buffer,
|
||||
size_t& written) noexcept
|
||||
@@ -398,7 +398,7 @@ void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& co
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<wchar_t> buffer,
|
||||
size_t& written) noexcept
|
||||
@@ -408,27 +408,27 @@ void VtApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& co
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleInputAImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleInputAImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept
|
||||
{
|
||||
return m_pUsualRoutines->WriteConsoleInputAImpl(context, buffer, written, append);
|
||||
return m_pUsualRoutines->WriteConsoleInputAImpl(inputBuffer, buffer, written, append);
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleInputWImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleInputWImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept
|
||||
{
|
||||
return m_pUsualRoutines->WriteConsoleInputWImpl(context, buffer, written, append);
|
||||
return m_pUsualRoutines->WriteConsoleInputWImpl(inputBuffer, buffer, written, append);
|
||||
}
|
||||
|
||||
extern HRESULT _ConvertCellsToWInplace(const UINT codepage,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Viewport& rectangle) noexcept;
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputAImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& writtenRectangle) noexcept
|
||||
@@ -437,10 +437,10 @@ extern HRESULT _ConvertCellsToWInplace(const UINT codepage,
|
||||
// with up to 4 bytes per cell...or more!
|
||||
|
||||
RETURN_IF_FAILED(_ConvertCellsToWInplace(m_outputCodepage, buffer, requestRectangle));
|
||||
return WriteConsoleOutputWImpl(context, buffer, requestRectangle, writtenRectangle);
|
||||
return WriteConsoleOutputWImpl(screenInfo, buffer, requestRectangle, writtenRectangle);
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputWImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& writtenRectangle) noexcept
|
||||
@@ -474,7 +474,7 @@ extern HRESULT _ConvertCellsToWInplace(const UINT codepage,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::span<const WORD> attrs,
|
||||
const til::point target,
|
||||
size_t& used) noexcept
|
||||
@@ -494,7 +494,7 @@ extern HRESULT _ConvertCellsToWInplace(const UINT codepage,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::string_view text,
|
||||
const til::point target,
|
||||
size_t& used) noexcept
|
||||
@@ -512,7 +512,7 @@ extern HRESULT _ConvertCellsToWInplace(const UINT codepage,
|
||||
}
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::WriteConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::wstring_view text,
|
||||
const til::point target,
|
||||
size_t& used) noexcept
|
||||
@@ -523,7 +523,7 @@ extern HRESULT _ConvertCellsToWInplace(const UINT codepage,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputAImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept
|
||||
@@ -533,7 +533,7 @@ extern HRESULT _ConvertCellsToWInplace(const UINT codepage,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputWImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::ReadConsoleOutputWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept
|
||||
@@ -621,7 +621,7 @@ void VtApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
return;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::GetConsoleFontSizeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::GetConsoleFontSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const DWORD index,
|
||||
til::size& size) noexcept
|
||||
{
|
||||
@@ -631,14 +631,14 @@ void VtApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
}
|
||||
|
||||
//// driver will pare down for non-Ex method
|
||||
[[nodiscard]] HRESULT VtApiRoutines::GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleDisplayModeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetConsoleDisplayModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG flags,
|
||||
til::size& newSize) noexcept
|
||||
{
|
||||
@@ -800,7 +800,7 @@ void VtApiRoutines::GetConsoleHistoryInfoImpl(CONSOLE_HISTORY_INFO& consoleHisto
|
||||
return m_pUsualRoutines->SetConsoleHistoryInfoImpl(consoleHistoryInfo);
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetCurrentConsoleFontExImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT VtApiRoutines::SetCurrentConsoleFontExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
const CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept
|
||||
{
|
||||
|
||||
@@ -37,22 +37,22 @@ public:
|
||||
|
||||
void GetConsoleOutputCodePageImpl(ULONG& codepage) noexcept override;
|
||||
|
||||
void GetConsoleInputModeImpl(InputBuffer& context,
|
||||
void GetConsoleInputModeImpl(InputBuffer& inputBuffer,
|
||||
ULONG& mode) noexcept override;
|
||||
|
||||
void GetConsoleOutputModeImpl(SCREEN_INFORMATION& context,
|
||||
void GetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& mode) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleInputModeImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT SetConsoleInputModeImpl(InputBuffer& inputBuffer,
|
||||
const ULONG mode) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleOutputModeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG Mode) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT GetNumberOfConsoleInputEventsImpl(const InputBuffer& context,
|
||||
[[nodiscard]] HRESULT GetNumberOfConsoleInputEventsImpl(const InputBuffer& inputBuffer,
|
||||
ULONG& events) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT GetConsoleInputImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] HRESULT GetConsoleInputImpl(InputBuffer& inputBuffer,
|
||||
InputEventQueue& outEvents,
|
||||
const size_t eventReadCount,
|
||||
INPUT_READ_HANDLE_DATA& readHandleState,
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
const bool IsPeek,
|
||||
std::unique_ptr<IWaitRoutine>& waiter) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleImpl(InputBuffer& inputBuffer,
|
||||
std::span<char> buffer,
|
||||
size_t& written,
|
||||
std::unique_ptr<IWaitRoutine>& waiter,
|
||||
@@ -72,13 +72,13 @@ public:
|
||||
const DWORD controlWakeupMask,
|
||||
DWORD& controlKeyState) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleAImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::string_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
std::unique_ptr<IWaitRoutine>& waiter) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleWImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::wstring_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
@@ -92,19 +92,19 @@ public:
|
||||
|
||||
#pragma region L2
|
||||
|
||||
[[nodiscard]] HRESULT FillConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT FillConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const WORD attribute,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
size_t& cellsModified) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT FillConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT FillConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const char character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
size_t& cellsModified) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT FillConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT FillConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const wchar_t character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
@@ -117,44 +117,44 @@ public:
|
||||
|
||||
void SetConsoleActiveScreenBufferImpl(SCREEN_INFORMATION& newContext) noexcept override;
|
||||
|
||||
void FlushConsoleInputBuffer(InputBuffer& context) noexcept override;
|
||||
void FlushConsoleInputBuffer(InputBuffer& inputBuffer) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleInputCodePageImpl(const ULONG codepage) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleOutputCodePageImpl(const ULONG codepage) noexcept override;
|
||||
|
||||
void GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& context,
|
||||
void GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& size,
|
||||
bool& isVisible) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleCursorInfoImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleCursorInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG size,
|
||||
const bool isVisible) noexcept override;
|
||||
|
||||
//// driver will pare down for non-Ex method
|
||||
void GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& context,
|
||||
void GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::size size) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleCursorPositionImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleCursorPositionImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::point position) noexcept override;
|
||||
|
||||
void GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& context,
|
||||
void GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
til::size& size) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
const char fillCharacter,
|
||||
const WORD fillAttribute) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
@@ -162,69 +162,69 @@ public:
|
||||
const WORD fillAttribute,
|
||||
const bool enableCmdShim = false) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleTextAttributeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleTextAttributeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const WORD attribute) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleWindowInfoImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleWindowInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isAbsolute,
|
||||
const til::inclusive_rect& windowRect) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<WORD> buffer,
|
||||
size_t& written) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<char> buffer,
|
||||
size_t& written) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<wchar_t> buffer,
|
||||
size_t& written) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleInputAImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleInputAImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleInputWImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleInputWImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputAImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& writtenRectangle) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputWImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& writtenRectangle) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::span<const WORD> attrs,
|
||||
const til::point target,
|
||||
size_t& used) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::string_view text,
|
||||
const til::point target,
|
||||
size_t& used) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT WriteConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::wstring_view text,
|
||||
const til::point target,
|
||||
size_t& used) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputAImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputWImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ReadConsoleOutputWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept override;
|
||||
@@ -254,16 +254,16 @@ public:
|
||||
#pragma region L3
|
||||
void GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT GetConsoleFontSizeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT GetConsoleFontSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const DWORD index,
|
||||
til::size& size) noexcept override;
|
||||
|
||||
//// driver will pare down for non-Ex method
|
||||
[[nodiscard]] HRESULT GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleDisplayModeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT SetConsoleDisplayModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG flags,
|
||||
til::size& newSize) noexcept override;
|
||||
|
||||
@@ -347,7 +347,7 @@ public:
|
||||
|
||||
[[nodiscard]] HRESULT SetConsoleHistoryInfoImpl(const CONSOLE_HISTORY_INFO& consoleHistoryInfo) noexcept override;
|
||||
|
||||
[[nodiscard]] HRESULT SetCurrentConsoleFontExImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT SetCurrentConsoleFontExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
const CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept override;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ void WriteToScreen(SCREEN_INFORMATION& screenInfo, const Viewport& region)
|
||||
// - used - number of elements written
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG or similar HRESULT error.
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::span<const WORD> attrs,
|
||||
const til::point target,
|
||||
size_t& used) noexcept
|
||||
@@ -105,7 +105,7 @@ void WriteToScreen(SCREEN_INFORMATION& screenInfo, const Viewport& region)
|
||||
// - used - number of elements written
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG or similar HRESULT error.
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::wstring_view chars,
|
||||
const til::point target,
|
||||
size_t& used) noexcept
|
||||
@@ -148,7 +148,7 @@ void WriteToScreen(SCREEN_INFORMATION& screenInfo, const Viewport& region)
|
||||
// - used - number of elements written
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG or similar HRESULT error.
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::string_view chars,
|
||||
const til::point target,
|
||||
size_t& used) noexcept
|
||||
@@ -189,7 +189,7 @@ void WriteToScreen(SCREEN_INFORMATION& screenInfo, const Viewport& region)
|
||||
// - cellsModified - the number of elements written
|
||||
// Return Value:
|
||||
// - S_OK or suitable HRESULT code from failure to write (memory issues, invalid arg, etc.)
|
||||
[[nodiscard]] HRESULT ApiRoutines::FillConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT ApiRoutines::FillConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const WORD attribute,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
@@ -248,7 +248,7 @@ void WriteToScreen(SCREEN_INFORMATION& screenInfo, const Viewport& region)
|
||||
// conpty mode. See GH#3126.
|
||||
// Return Value:
|
||||
// - S_OK or suitable HRESULT code from failure to write (memory issues, invalid arg, etc.)
|
||||
[[nodiscard]] HRESULT ApiRoutines::FillConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT ApiRoutines::FillConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const wchar_t character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
@@ -334,7 +334,7 @@ void WriteToScreen(SCREEN_INFORMATION& screenInfo, const Viewport& region)
|
||||
// - cellsModified - the number of elements written
|
||||
// Return Value:
|
||||
// - S_OK or suitable HRESULT code from failure to write (memory issues, invalid arg, etc.)
|
||||
[[nodiscard]] HRESULT ApiRoutines::FillConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] HRESULT ApiRoutines::FillConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const char character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
|
||||
@@ -337,7 +337,7 @@ NT_CATCH_RETURN()
|
||||
// - S_OK if successful.
|
||||
// - S_OK if we need to wait (check if ppWaiter is not nullptr).
|
||||
// - Or a suitable HRESULT code for math/string/memory failures.
|
||||
[[nodiscard]] HRESULT WriteConsoleWImplHelper(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT WriteConsoleWImplHelper(SCREEN_INFORMATION& screenInfo,
|
||||
const std::wstring_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
@@ -353,7 +353,7 @@ NT_CATCH_RETURN()
|
||||
size_t cbTextBufferLength;
|
||||
RETURN_IF_FAILED(SizeTMult(buffer.size(), sizeof(wchar_t), &cbTextBufferLength));
|
||||
|
||||
auto Status = DoWriteConsole(const_cast<wchar_t*>(buffer.data()), &cbTextBufferLength, context, requiresVtQuirk, waiter);
|
||||
auto Status = DoWriteConsole(const_cast<wchar_t*>(buffer.data()), &cbTextBufferLength, screenInfo, requiresVtQuirk, waiter);
|
||||
|
||||
// Convert back from bytes to characters for the resulting string length written.
|
||||
read = cbTextBufferLength / sizeof(wchar_t);
|
||||
@@ -375,7 +375,7 @@ NT_CATCH_RETURN()
|
||||
// It uses the current Output Codepage for conversions (set via SetConsoleOutputCP).
|
||||
// - NOTE: This may be blocked for various console states and will return a wait context pointer if necessary.
|
||||
// Arguments:
|
||||
// - context - the console output object to write the new text into
|
||||
// - screenInfo - the console output object to write the new text into
|
||||
// - buffer - char/byte text buffer provided by client application to insert
|
||||
// - read - character count of the number of characters (also bytes because A version) we were able to insert before returning
|
||||
// - waiter - If we are blocked from writing now and need to wait, this is filled with contextual data for the server to restore the call later
|
||||
@@ -383,7 +383,7 @@ NT_CATCH_RETURN()
|
||||
// - S_OK if successful.
|
||||
// - S_OK if we need to wait (check if ppWaiter is not nullptr).
|
||||
// - Or a suitable HRESULT code for math/string/memory failures.
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleAImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::string_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
@@ -403,7 +403,7 @@ NT_CATCH_RETURN()
|
||||
LockConsole();
|
||||
auto unlock{ wil::scope_exit([&] { UnlockConsole(); }) };
|
||||
|
||||
auto& screenInfo{ context.GetActiveBuffer() };
|
||||
auto& activeScreenInfo{ screenInfo.GetActiveBuffer() };
|
||||
const auto& consoleInfo{ ServiceLocator::LocateGlobals().getConsoleInformation() };
|
||||
const auto codepage{ consoleInfo.OutputCP };
|
||||
auto leadByteCaptured{ false };
|
||||
@@ -434,17 +434,17 @@ NT_CATCH_RETURN()
|
||||
auto wcPtr{ wstr.data() };
|
||||
auto mbPtr{ buffer.data() };
|
||||
size_t dbcsLength{};
|
||||
if (screenInfo.WriteConsoleDbcsLeadByte[0] != 0 && gsl::narrow_cast<byte>(*mbPtr) >= byte{ ' ' })
|
||||
if (activeScreenInfo.WriteConsoleDbcsLeadByte[0] != 0 && gsl::narrow_cast<byte>(*mbPtr) >= byte{ ' ' })
|
||||
{
|
||||
// there was a portion of a dbcs character stored from a previous
|
||||
// call so we take the 2nd half from mbPtr[0], put them together
|
||||
// and write the wide char to wcPtr[0]
|
||||
screenInfo.WriteConsoleDbcsLeadByte[1] = gsl::narrow_cast<byte>(*mbPtr);
|
||||
activeScreenInfo.WriteConsoleDbcsLeadByte[1] = gsl::narrow_cast<byte>(*mbPtr);
|
||||
|
||||
try
|
||||
{
|
||||
const auto wFromComplemented{
|
||||
ConvertToW(codepage, { reinterpret_cast<const char*>(screenInfo.WriteConsoleDbcsLeadByte), ARRAYSIZE(screenInfo.WriteConsoleDbcsLeadByte) })
|
||||
ConvertToW(codepage, { reinterpret_cast<const char*>(activeScreenInfo.WriteConsoleDbcsLeadByte), ARRAYSIZE(activeScreenInfo.WriteConsoleDbcsLeadByte) })
|
||||
};
|
||||
|
||||
FAIL_FAST_IF(wFromComplemented.size() != 1);
|
||||
@@ -468,14 +468,14 @@ NT_CATCH_RETURN()
|
||||
leadByteConsumed = true;
|
||||
}
|
||||
|
||||
screenInfo.WriteConsoleDbcsLeadByte[0] = 0;
|
||||
activeScreenInfo.WriteConsoleDbcsLeadByte[0] = 0;
|
||||
|
||||
// if the last byte in mbPtr is a lead byte for the current code page,
|
||||
// save it for the next time this function is called and we can piece it
|
||||
// back together then
|
||||
if (mbPtrLength != 0 && CheckBisectStringA(const_cast<char*>(mbPtr), mbPtrLength, &consoleInfo.OutputCPInfo))
|
||||
{
|
||||
screenInfo.WriteConsoleDbcsLeadByte[0] = gsl::narrow_cast<byte>(mbPtr[mbPtrLength - 1]);
|
||||
activeScreenInfo.WriteConsoleDbcsLeadByte[0] = gsl::narrow_cast<byte>(mbPtr[mbPtrLength - 1]);
|
||||
mbPtrLength--;
|
||||
|
||||
// Note that we captured a lead byte during this call, but won't actually draw it until later.
|
||||
@@ -498,7 +498,7 @@ NT_CATCH_RETURN()
|
||||
|
||||
// Make the W version of the call
|
||||
size_t wcBufferWritten{};
|
||||
const auto hr{ WriteConsoleWImplHelper(screenInfo, wstr, wcBufferWritten, requiresVtQuirk, writeDataWaiter) };
|
||||
const auto hr{ WriteConsoleWImplHelper(activeScreenInfo, wstr, wcBufferWritten, requiresVtQuirk, writeDataWaiter) };
|
||||
|
||||
// If there is no waiter, process the byte count now.
|
||||
if (nullptr == writeDataWaiter.get())
|
||||
@@ -573,7 +573,7 @@ NT_CATCH_RETURN()
|
||||
// - S_OK if successful.
|
||||
// - S_OK if we need to wait (check if ppWaiter is not nullptr).
|
||||
// - Or a suitable HRESULT code for math/string/memory failures.
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleWImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::wstring_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
@@ -585,7 +585,7 @@ NT_CATCH_RETURN()
|
||||
auto unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
std::unique_ptr<WriteData> writeDataWaiter;
|
||||
RETURN_IF_FAILED(WriteConsoleWImplHelper(context.GetActiveBuffer(), buffer, read, requiresVtQuirk, writeDataWaiter));
|
||||
RETURN_IF_FAILED(WriteConsoleWImplHelper(screenInfo.GetActiveBuffer(), buffer, read, requiresVtQuirk, writeDataWaiter));
|
||||
|
||||
// Transfer specific waiter pointer into the generic interface wrapper.
|
||||
waiter.reset(writeDataWaiter.release());
|
||||
|
||||
@@ -50,7 +50,7 @@ using Microsoft::Console::Interactivity::ServiceLocator;
|
||||
// - CONSOLE_STATUS_WAIT - If we didn't have enough data or needed to
|
||||
// block, this will be returned along with context in *ppWaiter.
|
||||
// - Or an out of memory/math/string error message in NTSTATUS format.
|
||||
[[nodiscard]] HRESULT ApiRoutines::GetConsoleInputImpl(IConsoleInputObject& inputBuffer,
|
||||
[[nodiscard]] HRESULT ApiRoutines::GetConsoleInputImpl(InputBuffer& inputBuffer,
|
||||
InputEventQueue& outEvents,
|
||||
const size_t eventReadCount,
|
||||
INPUT_READ_HANDLE_DATA& readHandleState,
|
||||
@@ -93,14 +93,14 @@ using Microsoft::Console::Interactivity::ServiceLocator;
|
||||
// Routine Description:
|
||||
// - Writes events to the input buffer
|
||||
// Arguments:
|
||||
// - context - the input buffer to write to
|
||||
// - inputBuffer - the input buffer to write to
|
||||
// - events - the events to written
|
||||
// - written - on output, the number of events written
|
||||
// - append - true if events should be written to the end of the input
|
||||
// buffer, false if they should be written to the front
|
||||
// Return Value:
|
||||
// - HRESULT indicating success or failure
|
||||
[[nodiscard]] static HRESULT _WriteConsoleInputWImplHelper(InputBuffer& context,
|
||||
[[nodiscard]] static HRESULT _WriteConsoleInputWImplHelper(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD>& events,
|
||||
size_t& written,
|
||||
const bool append) noexcept
|
||||
@@ -112,11 +112,11 @@ using Microsoft::Console::Interactivity::ServiceLocator;
|
||||
// add to InputBuffer
|
||||
if (append)
|
||||
{
|
||||
written = context.Write(events);
|
||||
written = inputBuffer.Write(events);
|
||||
}
|
||||
else
|
||||
{
|
||||
written = context.Prepend(events);
|
||||
written = inputBuffer.Prepend(events);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
@@ -127,14 +127,14 @@ using Microsoft::Console::Interactivity::ServiceLocator;
|
||||
// Routine Description:
|
||||
// - Writes events to the input buffer, translating from codepage to unicode first
|
||||
// Arguments:
|
||||
// - context - the input buffer to write to
|
||||
// - inputBuffer - the input buffer to write to
|
||||
// - buffer - the events to written
|
||||
// - written - on output, the number of events written
|
||||
// - append - true if events should be written to the end of the input
|
||||
// buffer, false if they should be written to the front
|
||||
// Return Value:
|
||||
// - HRESULT indicating success or failure
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleInputAImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleInputAImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept
|
||||
@@ -158,9 +158,9 @@ try
|
||||
|
||||
// Check out the loop below. When a previous call ended on a leading DBCS we store it for
|
||||
// the next call to WriteConsoleInputAImpl to join it with the now available trailing DBCS.
|
||||
if (context.IsWritePartialByteSequenceAvailable())
|
||||
if (inputBuffer.IsWritePartialByteSequenceAvailable())
|
||||
{
|
||||
auto lead = context.FetchWritePartialByteSequence();
|
||||
auto lead = inputBuffer.FetchWritePartialByteSequence();
|
||||
const auto& trail = *it;
|
||||
|
||||
if (trail.EventType == KEY_EVENT)
|
||||
@@ -200,7 +200,7 @@ try
|
||||
if (it == end)
|
||||
{
|
||||
// Missing trailing DBCS -> Store the lead for the next call to WriteConsoleInputAImpl.
|
||||
context.StoreWritePartialByteSequence(lead);
|
||||
inputBuffer.StoreWritePartialByteSequence(lead);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -225,21 +225,21 @@ try
|
||||
}
|
||||
}
|
||||
|
||||
return _WriteConsoleInputWImplHelper(context, events, written, append);
|
||||
return _WriteConsoleInputWImplHelper(inputBuffer, events, written, append);
|
||||
}
|
||||
CATCH_RETURN();
|
||||
|
||||
// Routine Description:
|
||||
// - Writes events to the input buffer
|
||||
// Arguments:
|
||||
// - context - the input buffer to write to
|
||||
// - inputBuffer - the input buffer to write to
|
||||
// - buffer - the events to written
|
||||
// - written - on output, the number of events written
|
||||
// - append - true if events should be written to the end of the input
|
||||
// buffer, false if they should be written to the front
|
||||
// Return Value:
|
||||
// - HRESULT indicating success or failure
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleInputWImpl(InputBuffer& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleInputWImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept
|
||||
@@ -251,7 +251,7 @@ CATCH_RETURN();
|
||||
|
||||
try
|
||||
{
|
||||
return _WriteConsoleInputWImplHelper(context, buffer, written, append);
|
||||
return _WriteConsoleInputWImplHelper(inputBuffer, buffer, written, append);
|
||||
}
|
||||
CATCH_RETURN();
|
||||
}
|
||||
@@ -463,7 +463,7 @@ CATCH_RETURN();
|
||||
return result;
|
||||
}
|
||||
|
||||
[[nodiscard]] static HRESULT _ReadConsoleOutputWImplHelper(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] static HRESULT _ReadConsoleOutputWImplHelper(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> targetBuffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept
|
||||
@@ -471,7 +471,7 @@ CATCH_RETURN();
|
||||
try
|
||||
{
|
||||
const auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
|
||||
const auto& storageBuffer = context.GetActiveBuffer().GetTextBuffer();
|
||||
const auto& storageBuffer = screenInfo.GetActiveBuffer().GetTextBuffer();
|
||||
const auto storageSize = storageBuffer.GetSize().Dimensions();
|
||||
|
||||
const auto targetSize = requestRectangle.Dimensions();
|
||||
@@ -553,7 +553,7 @@ CATCH_RETURN();
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputAImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept
|
||||
@@ -566,7 +566,7 @@ CATCH_RETURN();
|
||||
const auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
|
||||
const auto codepage = gci.OutputCP;
|
||||
|
||||
RETURN_IF_FAILED(_ReadConsoleOutputWImplHelper(context, buffer, sourceRectangle, readRectangle));
|
||||
RETURN_IF_FAILED(_ReadConsoleOutputWImplHelper(screenInfo, buffer, sourceRectangle, readRectangle));
|
||||
|
||||
LOG_IF_FAILED(_ConvertCellsToAInplace(codepage, buffer, readRectangle));
|
||||
|
||||
@@ -575,7 +575,7 @@ CATCH_RETURN();
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputWImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept
|
||||
@@ -585,9 +585,9 @@ CATCH_RETURN();
|
||||
|
||||
try
|
||||
{
|
||||
RETURN_IF_FAILED(_ReadConsoleOutputWImplHelper(context, buffer, sourceRectangle, readRectangle));
|
||||
RETURN_IF_FAILED(_ReadConsoleOutputWImplHelper(screenInfo, buffer, sourceRectangle, readRectangle));
|
||||
|
||||
if (!context.GetActiveBuffer().GetCurrentFont().IsTrueTypeFont())
|
||||
if (!screenInfo.GetActiveBuffer().GetCurrentFont().IsTrueTypeFont())
|
||||
{
|
||||
// For compatibility reasons, we must maintain the behavior that munges the data if we are writing while a raster font is enabled.
|
||||
// This can be removed when raster font support is removed.
|
||||
@@ -599,14 +599,14 @@ CATCH_RETURN();
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] static HRESULT _WriteConsoleOutputWImplHelper(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] static HRESULT _WriteConsoleOutputWImplHelper(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Viewport& requestRectangle,
|
||||
Viewport& writtenRectangle) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
auto& storageBuffer = context.GetActiveBuffer();
|
||||
auto& storageBuffer = screenInfo.GetActiveBuffer();
|
||||
const auto storageRectangle = storageBuffer.GetBufferSize();
|
||||
const auto storageSize = storageRectangle.Dimensions();
|
||||
|
||||
@@ -699,7 +699,7 @@ CATCH_RETURN();
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputAImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Viewport& requestRectangle,
|
||||
Viewport& writtenRectangle) noexcept
|
||||
@@ -713,14 +713,14 @@ CATCH_RETURN();
|
||||
const auto codepage = gci.OutputCP;
|
||||
LOG_IF_FAILED(_ConvertCellsToWInplace(codepage, buffer, requestRectangle));
|
||||
|
||||
RETURN_IF_FAILED(_WriteConsoleOutputWImplHelper(context, buffer, requestRectangle, writtenRectangle));
|
||||
RETURN_IF_FAILED(_WriteConsoleOutputWImplHelper(screenInfo, buffer, requestRectangle, writtenRectangle));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputWImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::WriteConsoleOutputWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Viewport& requestRectangle,
|
||||
Viewport& writtenRectangle) noexcept
|
||||
@@ -730,16 +730,16 @@ CATCH_RETURN();
|
||||
|
||||
try
|
||||
{
|
||||
if (!context.GetActiveBuffer().GetCurrentFont().IsTrueTypeFont())
|
||||
if (!screenInfo.GetActiveBuffer().GetCurrentFont().IsTrueTypeFont())
|
||||
{
|
||||
// For compatibility reasons, we must maintain the behavior that munges the data if we are writing while a raster font is enabled.
|
||||
// This can be removed when raster font support is removed.
|
||||
auto translated = _ConvertCellsToMungedW(buffer, requestRectangle);
|
||||
RETURN_IF_FAILED(_WriteConsoleOutputWImplHelper(context, translated, requestRectangle, writtenRectangle));
|
||||
RETURN_IF_FAILED(_WriteConsoleOutputWImplHelper(screenInfo, translated, requestRectangle, writtenRectangle));
|
||||
}
|
||||
else
|
||||
{
|
||||
RETURN_IF_FAILED(_WriteConsoleOutputWImplHelper(context, buffer, requestRectangle, writtenRectangle));
|
||||
RETURN_IF_FAILED(_WriteConsoleOutputWImplHelper(screenInfo, buffer, requestRectangle, writtenRectangle));
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
@@ -747,7 +747,7 @@ CATCH_RETURN();
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<WORD> buffer,
|
||||
size_t& written) noexcept
|
||||
@@ -759,7 +759,7 @@ CATCH_RETURN();
|
||||
|
||||
try
|
||||
{
|
||||
const auto attrs = ReadOutputAttributes(context.GetActiveBuffer(), origin, buffer.size());
|
||||
const auto attrs = ReadOutputAttributes(screenInfo.GetActiveBuffer(), origin, buffer.size());
|
||||
std::copy(attrs.cbegin(), attrs.cend(), buffer.begin());
|
||||
written = attrs.size();
|
||||
|
||||
@@ -768,7 +768,7 @@ CATCH_RETURN();
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<char> buffer,
|
||||
size_t& written) noexcept
|
||||
@@ -780,7 +780,7 @@ CATCH_RETURN();
|
||||
|
||||
try
|
||||
{
|
||||
const auto chars = ReadOutputStringA(context.GetActiveBuffer(),
|
||||
const auto chars = ReadOutputStringA(screenInfo.GetActiveBuffer(),
|
||||
origin,
|
||||
buffer.size());
|
||||
|
||||
@@ -797,7 +797,7 @@ CATCH_RETURN();
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<wchar_t> buffer,
|
||||
size_t& written) noexcept
|
||||
@@ -809,7 +809,7 @@ CATCH_RETURN();
|
||||
|
||||
try
|
||||
{
|
||||
const auto chars = ReadOutputStringW(context.GetActiveBuffer(),
|
||||
const auto chars = ReadOutputStringW(screenInfo.GetActiveBuffer(),
|
||||
origin,
|
||||
buffer.size());
|
||||
|
||||
|
||||
@@ -35,9 +35,9 @@ using namespace Microsoft::Console::Interactivity;
|
||||
// Routine Description:
|
||||
// - Retrieves the console input mode (settings that apply when manipulating the input buffer)
|
||||
// Arguments:
|
||||
// - context - The input buffer concerned
|
||||
// - inputBuffer - The input buffer concerned
|
||||
// - mode - Receives the mode flags set
|
||||
void ApiRoutines::GetConsoleInputModeImpl(InputBuffer& context, ULONG& mode) noexcept
|
||||
void ApiRoutines::GetConsoleInputModeImpl(InputBuffer& inputBuffer, ULONG& mode) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -45,7 +45,7 @@ void ApiRoutines::GetConsoleInputModeImpl(InputBuffer& context, ULONG& mode) noe
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
mode = context.InputMode;
|
||||
mode = inputBuffer.InputMode;
|
||||
|
||||
if (WI_IsFlagSet(gci.Flags, CONSOLE_USE_PRIVATE_FLAGS))
|
||||
{
|
||||
@@ -61,16 +61,16 @@ void ApiRoutines::GetConsoleInputModeImpl(InputBuffer& context, ULONG& mode) noe
|
||||
// Routine Description:
|
||||
// - Retrieves the console output mode (settings that apply when manipulating the output buffer)
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - mode - Receives the mode flags set
|
||||
void ApiRoutines::GetConsoleOutputModeImpl(SCREEN_INFORMATION& context, ULONG& mode) noexcept
|
||||
void ApiRoutines::GetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo, ULONG& mode) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
mode = context.GetActiveBuffer().OutputMode;
|
||||
mode = screenInfo.GetActiveBuffer().OutputMode;
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -78,18 +78,18 @@ void ApiRoutines::GetConsoleOutputModeImpl(SCREEN_INFORMATION& context, ULONG& m
|
||||
// Routine Description:
|
||||
// - Retrieves the number of console event items in the input queue right now
|
||||
// Arguments:
|
||||
// - context - The input buffer concerned
|
||||
// - inputBuffer - The input buffer concerned
|
||||
// - event - The count of events in the queue
|
||||
// Return Value:
|
||||
// - S_OK or math failure.
|
||||
[[nodiscard]] HRESULT ApiRoutines::GetNumberOfConsoleInputEventsImpl(const InputBuffer& context, ULONG& events) noexcept
|
||||
[[nodiscard]] HRESULT ApiRoutines::GetNumberOfConsoleInputEventsImpl(const InputBuffer& inputBuffer, ULONG& events) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
const auto readyEventCount = context.GetNumberOfReadyEvents();
|
||||
const auto readyEventCount = inputBuffer.GetNumberOfReadyEvents();
|
||||
RETURN_IF_FAILED(SizeTToULong(readyEventCount, &events));
|
||||
|
||||
return S_OK;
|
||||
@@ -100,9 +100,9 @@ void ApiRoutines::GetConsoleOutputModeImpl(SCREEN_INFORMATION& context, ULONG& m
|
||||
// Routine Description:
|
||||
// - Retrieves metadata associated with the output buffer (size, default colors, etc.)
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - data - Receives structure filled with metadata about the output buffer
|
||||
void ApiRoutines::GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& context,
|
||||
void ApiRoutines::GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept
|
||||
{
|
||||
try
|
||||
@@ -124,7 +124,7 @@ void ApiRoutines::GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& con
|
||||
til::inclusive_rect srWindow;
|
||||
til::size dwMaximumWindowSize;
|
||||
|
||||
context.GetActiveBuffer().GetScreenBufferInformation(&dwSize,
|
||||
screenInfo.GetActiveBuffer().GetScreenBufferInformation(&dwSize,
|
||||
&dwCursorPosition,
|
||||
&srWindow,
|
||||
&data.wAttributes,
|
||||
@@ -152,10 +152,10 @@ void ApiRoutines::GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& con
|
||||
// Routine Description:
|
||||
// - Retrieves information about the console cursor's display state
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - size - The size as a percentage of the total possible height (0-100 for percentages).
|
||||
// - isVisible - Whether the cursor is displayed or hidden
|
||||
void ApiRoutines::GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& context,
|
||||
void ApiRoutines::GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& size,
|
||||
bool& isVisible) noexcept
|
||||
{
|
||||
@@ -164,8 +164,8 @@ void ApiRoutines::GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& context,
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
size = context.GetActiveBuffer().GetTextBuffer().GetCursor().GetSize();
|
||||
isVisible = context.GetTextBuffer().GetCursor().IsVisible();
|
||||
size = screenInfo.GetActiveBuffer().GetTextBuffer().GetCursor().GetSize();
|
||||
isVisible = screenInfo.GetTextBuffer().GetCursor().IsVisible();
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -218,12 +218,12 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
// Routine Description:
|
||||
// - Retrieves information about a known font based on index
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - index - We only accept 0 now as we don't keep a list of fonts in memory.
|
||||
// - size - The X by Y pixel size of the font
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG or code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::GetConsoleFontSizeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::GetConsoleFontSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const DWORD index,
|
||||
til::size& size) noexcept
|
||||
{
|
||||
@@ -235,7 +235,7 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
if (index == 0)
|
||||
{
|
||||
// As of the November 2015 renderer system, we only have a single font at index 0.
|
||||
size = context.GetActiveBuffer().GetCurrentFont().GetUnscaledSize();
|
||||
size = screenInfo.GetActiveBuffer().GetCurrentFont().GetUnscaledSize();
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
@@ -251,12 +251,12 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
// Routine Description:
|
||||
// - Retrieves information about the console cursor's display state
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - isForMaximumWindowSize - Returns the maximum number of characters in the largest window size if true. Otherwise, it's the size of the font.
|
||||
// - consoleFontInfoEx - structure containing font information like size, family, weight, etc.
|
||||
// Return Value:
|
||||
// - S_OK, string copy failure code or code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept
|
||||
{
|
||||
@@ -265,7 +265,7 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
const auto& activeScreenInfo = context.GetActiveBuffer();
|
||||
const auto& activeScreenInfo = screenInfo.GetActiveBuffer();
|
||||
|
||||
til::size WindowSize;
|
||||
if (isForMaximumWindowSize)
|
||||
@@ -293,12 +293,12 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
// Routine Description:
|
||||
// - Sets the current font to be used for drawing
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - isForMaximumWindowSize - Obsolete.
|
||||
// - consoleFontInfoEx - structure containing font information like size, family, weight, etc.
|
||||
// Return Value:
|
||||
// - S_OK, string copy failure code or code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetCurrentConsoleFontExImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetCurrentConsoleFontExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool /*isForMaximumWindowSize*/,
|
||||
const CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept
|
||||
{
|
||||
@@ -308,7 +308,7 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
auto& activeScreenInfo = context.GetActiveBuffer();
|
||||
auto& activeScreenInfo = screenInfo.GetActiveBuffer();
|
||||
|
||||
WCHAR FaceName[ARRAYSIZE(consoleFontInfoEx.FaceName)];
|
||||
RETURN_IF_FAILED(StringCchCopyW(FaceName, ARRAYSIZE(FaceName), consoleFontInfoEx.FaceName));
|
||||
@@ -330,11 +330,11 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
// Routine Description:
|
||||
// - Sets the input mode for the console
|
||||
// Arguments:
|
||||
// - context - The input buffer concerned
|
||||
// - inputBuffer - The input buffer concerned
|
||||
// - mode - flags that change behavior of the buffer
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleInputModeImpl(InputBuffer& context, const ULONG mode) noexcept
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleInputModeImpl(InputBuffer& inputBuffer, const ULONG mode) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -373,7 +373,7 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
// (for more information regarding the quirks of mouse mode and why/how it relates
|
||||
// to quick edit mode, see GH#9970)
|
||||
const auto newQuickEditMode{ WI_IsFlagSet(gci.Flags, CONSOLE_QUICK_EDIT_MODE) };
|
||||
const auto oldMouseMode{ !oldQuickEditMode && WI_IsFlagSet(context.InputMode, ENABLE_MOUSE_INPUT) };
|
||||
const auto oldMouseMode{ !oldQuickEditMode && WI_IsFlagSet(inputBuffer.InputMode, ENABLE_MOUSE_INPUT) };
|
||||
const auto newMouseMode{ !newQuickEditMode && WI_IsFlagSet(mode, ENABLE_MOUSE_INPUT) };
|
||||
|
||||
if (oldMouseMode != newMouseMode)
|
||||
@@ -382,8 +382,8 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
}
|
||||
}
|
||||
|
||||
context.InputMode = mode;
|
||||
WI_ClearAllFlags(context.InputMode, PRIVATE_MODES);
|
||||
inputBuffer.InputMode = mode;
|
||||
WI_ClearAllFlags(inputBuffer.InputMode, PRIVATE_MODES);
|
||||
|
||||
// NOTE: For compatibility reasons, we need to set the modes and then return the error codes, not the other way around
|
||||
// as might be expected.
|
||||
@@ -408,11 +408,11 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
// Routine Description:
|
||||
// - Sets the output mode for the console
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - mode - flags that change behavior of the buffer
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleOutputModeImpl(SCREEN_INFORMATION& context, const ULONG mode) noexcept
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo, const ULONG mode) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -423,18 +423,18 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
// Flags we don't understand are invalid.
|
||||
RETURN_HR_IF(E_INVALIDARG, WI_IsAnyFlagSet(mode, ~OUTPUT_MODES));
|
||||
|
||||
auto& screenInfo = context.GetActiveBuffer();
|
||||
const auto dwOldMode = screenInfo.OutputMode;
|
||||
auto& activeScreenInfo = screenInfo.GetActiveBuffer();
|
||||
const auto dwOldMode = activeScreenInfo.OutputMode;
|
||||
const auto dwNewMode = mode;
|
||||
|
||||
screenInfo.OutputMode = dwNewMode;
|
||||
activeScreenInfo.OutputMode = dwNewMode;
|
||||
|
||||
// if we're moving from VT on->off
|
||||
if (WI_IsFlagClear(dwNewMode, ENABLE_VIRTUAL_TERMINAL_PROCESSING) &&
|
||||
WI_IsFlagSet(dwOldMode, ENABLE_VIRTUAL_TERMINAL_PROCESSING))
|
||||
{
|
||||
// jiggle the handle
|
||||
screenInfo.GetStateMachine().ResetState();
|
||||
activeScreenInfo.GetStateMachine().ResetState();
|
||||
}
|
||||
|
||||
// if we changed rendering modes then redraw the output buffer,
|
||||
@@ -458,7 +458,7 @@ void ApiRoutines::GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept
|
||||
// Routine Description:
|
||||
// - Sets the given output buffer as the active one
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
void ApiRoutines::SetConsoleActiveScreenBufferImpl(SCREEN_INFORMATION& newContext) noexcept
|
||||
{
|
||||
try
|
||||
@@ -474,15 +474,15 @@ void ApiRoutines::SetConsoleActiveScreenBufferImpl(SCREEN_INFORMATION& newContex
|
||||
// Routine Description:
|
||||
// - Clears all items out of the input buffer queue
|
||||
// Arguments:
|
||||
// - context - The input buffer concerned
|
||||
void ApiRoutines::FlushConsoleInputBuffer(InputBuffer& context) noexcept
|
||||
// - inputBuffer - The input buffer concerned
|
||||
void ApiRoutines::FlushConsoleInputBuffer(InputBuffer& inputBuffer) noexcept
|
||||
{
|
||||
try
|
||||
{
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
context.Flush();
|
||||
inputBuffer.Flush();
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -490,9 +490,9 @@ void ApiRoutines::FlushConsoleInputBuffer(InputBuffer& context) noexcept
|
||||
// Routine Description:
|
||||
// - Gets the largest possible window size in characters.
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - size - receives the size in character count (rows/columns)
|
||||
void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& context,
|
||||
void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
til::size& size) noexcept
|
||||
{
|
||||
try
|
||||
@@ -500,9 +500,9 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
const auto& screenInfo = context.GetActiveBuffer();
|
||||
const auto& activeScreenInfo = screenInfo.GetActiveBuffer();
|
||||
|
||||
size = screenInfo.GetLargestWindowSizeInCharacters();
|
||||
size = activeScreenInfo.GetLargestWindowSizeInCharacters();
|
||||
}
|
||||
CATCH_LOG();
|
||||
}
|
||||
@@ -510,11 +510,11 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Routine Description:
|
||||
// - Sets the size of the output buffer (screen buffer) in rows/columns
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - size - size in character rows and columns
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::size size) noexcept
|
||||
{
|
||||
try
|
||||
@@ -522,18 +522,18 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
auto& screenInfo = context.GetActiveBuffer();
|
||||
auto& activeScreenInfo = screenInfo.GetActiveBuffer();
|
||||
|
||||
// microsoft/terminal#3907 - We shouldn't resize the buffer to be
|
||||
// smaller than the viewport. This was previously erroneously checked
|
||||
// when the host was not in conpty mode.
|
||||
RETURN_HR_IF(E_INVALIDARG, (size.width < screenInfo.GetViewport().Width() || size.height < screenInfo.GetViewport().Height()));
|
||||
RETURN_HR_IF(E_INVALIDARG, (size.width < activeScreenInfo.GetViewport().Width() || size.height < activeScreenInfo.GetViewport().Height()));
|
||||
|
||||
// see MSFT:17415266
|
||||
// We only really care about the minimum window size if we have a head.
|
||||
if (!ServiceLocator::LocateGlobals().IsHeadless())
|
||||
{
|
||||
const auto coordMin = screenInfo.GetMinWindowSizeInCharacters();
|
||||
const auto coordMin = activeScreenInfo.GetMinWindowSizeInCharacters();
|
||||
// Make sure requested screen buffer size isn't smaller than the window.
|
||||
RETURN_HR_IF(E_INVALIDARG, (size.height < coordMin.height || size.width < coordMin.width));
|
||||
}
|
||||
@@ -542,24 +542,24 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
RETURN_HR_IF(E_INVALIDARG, (size.width == SHORT_MAX || size.height == SHORT_MAX));
|
||||
|
||||
// Only do the resize if we're actually changing one of the dimensions
|
||||
const auto coordScreenBufferSize = screenInfo.GetBufferSize().Dimensions();
|
||||
const auto coordScreenBufferSize = activeScreenInfo.GetBufferSize().Dimensions();
|
||||
if (size.width != coordScreenBufferSize.width || size.height != coordScreenBufferSize.height)
|
||||
{
|
||||
RETURN_IF_NTSTATUS_FAILED(screenInfo.ResizeScreenBuffer(size, TRUE));
|
||||
RETURN_IF_NTSTATUS_FAILED(activeScreenInfo.ResizeScreenBuffer(size, TRUE));
|
||||
}
|
||||
|
||||
// Make sure the viewport doesn't now overflow the buffer dimensions.
|
||||
auto overflow = screenInfo.GetViewport().BottomRightExclusive() - screenInfo.GetBufferSize().Dimensions();
|
||||
auto overflow = activeScreenInfo.GetViewport().BottomRightExclusive() - activeScreenInfo.GetBufferSize().Dimensions();
|
||||
if (overflow.x > 0 || overflow.y > 0)
|
||||
{
|
||||
overflow = { -std::max(overflow.x, 0), -std::max(overflow.y, 0) };
|
||||
RETURN_IF_NTSTATUS_FAILED(screenInfo.SetViewportOrigin(false, overflow, false));
|
||||
RETURN_IF_NTSTATUS_FAILED(activeScreenInfo.SetViewportOrigin(false, overflow, false));
|
||||
}
|
||||
|
||||
// And also that the cursor position is clamped within the buffer boundaries.
|
||||
auto& cursor = screenInfo.GetTextBuffer().GetCursor();
|
||||
auto& cursor = activeScreenInfo.GetTextBuffer().GetCursor();
|
||||
auto clampedCursorPosition = cursor.GetPosition();
|
||||
screenInfo.GetBufferSize().Clamp(clampedCursorPosition);
|
||||
activeScreenInfo.GetBufferSize().Clamp(clampedCursorPosition);
|
||||
if (clampedCursorPosition != cursor.GetPosition())
|
||||
{
|
||||
cursor.SetPosition(clampedCursorPosition);
|
||||
@@ -573,11 +573,11 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Routine Description:
|
||||
// - Sets metadata information on the output buffer
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - data - metadata information structure like buffer size, viewport size, colors, and more.
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept
|
||||
{
|
||||
try
|
||||
@@ -595,13 +595,13 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
auto& g = ServiceLocator::LocateGlobals();
|
||||
auto& gci = g.getConsoleInformation();
|
||||
|
||||
const auto coordScreenBufferSize = context.GetBufferSize().Dimensions();
|
||||
const auto coordScreenBufferSize = screenInfo.GetBufferSize().Dimensions();
|
||||
const auto requestedBufferSize = til::wrap_coord_size(data.dwSize);
|
||||
if (requestedBufferSize != coordScreenBufferSize)
|
||||
{
|
||||
LOG_IF_FAILED(context.ResizeScreenBuffer(requestedBufferSize, TRUE));
|
||||
LOG_IF_FAILED(screenInfo.ResizeScreenBuffer(requestedBufferSize, TRUE));
|
||||
}
|
||||
const auto newBufferSize = context.GetBufferSize().Dimensions();
|
||||
const auto newBufferSize = screenInfo.GetBufferSize().Dimensions();
|
||||
|
||||
bool changedOneTableEntry = false;
|
||||
for (size_t i = 0; i < std::size(data.ColorTable); i++)
|
||||
@@ -629,7 +629,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
}
|
||||
}
|
||||
|
||||
context.SetDefaultAttributes(TextAttribute{ data.wAttributes }, TextAttribute{ data.wPopupAttributes });
|
||||
screenInfo.SetDefaultAttributes(TextAttribute{ data.wAttributes }, TextAttribute{ data.wPopupAttributes });
|
||||
|
||||
const auto requestedViewport = Viewport::FromExclusive(til::wrap_exclusive_small_rect(data.srWindow));
|
||||
|
||||
@@ -647,10 +647,10 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
NewSize.width = newBufferSize.width;
|
||||
}
|
||||
|
||||
if (NewSize.width != context.GetViewport().Width() ||
|
||||
NewSize.height != context.GetViewport().Height())
|
||||
if (NewSize.width != screenInfo.GetViewport().Width() ||
|
||||
NewSize.height != screenInfo.GetViewport().Height())
|
||||
{
|
||||
context.SetViewportSize(&NewSize);
|
||||
screenInfo.SetViewportSize(&NewSize);
|
||||
|
||||
const auto pWindow = ServiceLocator::LocateConsoleWindow();
|
||||
if (pWindow != nullptr)
|
||||
@@ -665,17 +665,17 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Note that it also doesn't set cursor position.
|
||||
|
||||
// However, we do need to make sure the viewport doesn't now overflow the buffer dimensions.
|
||||
auto overflow = context.GetViewport().BottomRightExclusive() - context.GetBufferSize().Dimensions();
|
||||
auto overflow = screenInfo.GetViewport().BottomRightExclusive() - screenInfo.GetBufferSize().Dimensions();
|
||||
if (overflow.x > 0 || overflow.y > 0)
|
||||
{
|
||||
overflow = { -std::max(overflow.x, 0), -std::max(overflow.y, 0) };
|
||||
RETURN_IF_NTSTATUS_FAILED(context.SetViewportOrigin(false, overflow, false));
|
||||
RETURN_IF_NTSTATUS_FAILED(screenInfo.SetViewportOrigin(false, overflow, false));
|
||||
}
|
||||
|
||||
// And also that the cursor position is clamped within the buffer boundaries.
|
||||
auto& cursor = context.GetTextBuffer().GetCursor();
|
||||
auto& cursor = screenInfo.GetTextBuffer().GetCursor();
|
||||
auto clampedCursorPosition = cursor.GetPosition();
|
||||
context.GetBufferSize().Clamp(clampedCursorPosition);
|
||||
screenInfo.GetBufferSize().Clamp(clampedCursorPosition);
|
||||
if (clampedCursorPosition != cursor.GetPosition())
|
||||
{
|
||||
cursor.SetPosition(clampedCursorPosition);
|
||||
@@ -689,11 +689,11 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Routine Description:
|
||||
// - Sets the cursor position in the given output buffer
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - position - The X/Y (row/column) position in the buffer to place the cursor
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleCursorPositionImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleCursorPositionImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::point position) noexcept
|
||||
{
|
||||
try
|
||||
@@ -701,7 +701,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
auto& buffer = context.GetActiveBuffer();
|
||||
auto& buffer = screenInfo.GetActiveBuffer();
|
||||
|
||||
const auto coordScreenBufferSize = buffer.GetBufferSize().Dimensions();
|
||||
// clang-format off
|
||||
@@ -772,12 +772,12 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Routine Description:
|
||||
// - Sets metadata on the cursor
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - size - Height percentage of the displayed cursor (when visible)
|
||||
// - isVisible - Whether or not the cursor should be displayed
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleCursorInfoImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleCursorInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG size,
|
||||
const bool isVisible) noexcept
|
||||
{
|
||||
@@ -789,7 +789,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// If more than 100% or less than 0% cursor height, reject it.
|
||||
RETURN_HR_IF(E_INVALIDARG, (size > 100 || size == 0));
|
||||
|
||||
context.SetCursorInformation(size, isVisible);
|
||||
screenInfo.SetCursorInformation(size, isVisible);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -799,13 +799,13 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Routine Description:
|
||||
// - Sets the viewport/window information for displaying a portion of the output buffer visually
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - isAbsolute - Coordinates are based on the entire screen buffer (origin 0,0) if true.
|
||||
// - If false, coordinates are a delta from the existing viewport position
|
||||
// - windowRect - Updated viewport rectangle information
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleWindowInfoImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleWindowInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isAbsolute,
|
||||
const til::inclusive_rect& windowRect) noexcept
|
||||
{
|
||||
@@ -819,7 +819,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
|
||||
if (!isAbsolute)
|
||||
{
|
||||
auto currentViewport = context.GetViewport().ToInclusive();
|
||||
auto currentViewport = screenInfo.GetViewport().ToInclusive();
|
||||
Window.left += currentViewport.left;
|
||||
Window.right += currentViewport.right;
|
||||
Window.top += currentViewport.top;
|
||||
@@ -840,20 +840,20 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
if (g.getConsoleInformation().IsInVtIoMode())
|
||||
{
|
||||
// SetViewportRect doesn't cause the buffer to resize. Manually resize the buffer.
|
||||
RETURN_IF_NTSTATUS_FAILED(context.ResizeScreenBuffer(Viewport::FromInclusive(Window).Dimensions(), false));
|
||||
RETURN_IF_NTSTATUS_FAILED(screenInfo.ResizeScreenBuffer(Viewport::FromInclusive(Window).Dimensions(), false));
|
||||
}
|
||||
if (!g.IsHeadless())
|
||||
{
|
||||
const auto coordMax = context.GetMaxWindowSizeInCharacters();
|
||||
const auto coordMax = screenInfo.GetMaxWindowSizeInCharacters();
|
||||
RETURN_HR_IF(E_INVALIDARG, (NewWindowSize.width > coordMax.width || NewWindowSize.height > coordMax.height));
|
||||
}
|
||||
|
||||
// Even if it's the same size, we need to post an update in case the scroll bars need to go away.
|
||||
context.SetViewport(Viewport::FromInclusive(Window), true);
|
||||
if (context.IsActiveScreenBuffer())
|
||||
screenInfo.SetViewport(Viewport::FromInclusive(Window), true);
|
||||
if (screenInfo.IsActiveScreenBuffer())
|
||||
{
|
||||
// TODO: MSFT: 9574827 - shouldn't we be looking at or at least logging the failure codes here? (Or making them non-void?)
|
||||
context.PostUpdateWindowSize();
|
||||
screenInfo.PostUpdateWindowSize();
|
||||
|
||||
// Use WriteToScreen to invalidate the viewport with the renderer.
|
||||
// GH#3490 - If we're in conpty mode, don't invalidate the entire
|
||||
@@ -861,7 +861,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// part of the buffer actually needs to be re-sent to the terminal.
|
||||
if (!(g.getConsoleInformation().IsInVtIoMode() && g.getConsoleInformation().GetVtIo()->IsResizeQuirkEnabled()))
|
||||
{
|
||||
WriteToScreen(context, context.GetViewport());
|
||||
WriteToScreen(screenInfo, screenInfo.GetViewport());
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
@@ -872,7 +872,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Routine Description:
|
||||
// - Moves a portion of text from one part of the output buffer to another
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - source - The rectangular region to copy from
|
||||
// - target - The top left corner of the destination to paste the copy (source)
|
||||
// - clip - The rectangle inside which all operations should be bounded (or no bounds if not given)
|
||||
@@ -880,7 +880,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// - fillAttribute - Fills in the region left behind when the source is "lifted" out of its original location. The color to use.
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
@@ -891,7 +891,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
{
|
||||
const auto unicodeFillCharacter = CharToWchar(&fillCharacter, 1);
|
||||
|
||||
return ScrollConsoleScreenBufferWImpl(context, source, target, clip, unicodeFillCharacter, fillAttribute);
|
||||
return ScrollConsoleScreenBufferWImpl(screenInfo, source, target, clip, unicodeFillCharacter, fillAttribute);
|
||||
}
|
||||
CATCH_RETURN();
|
||||
}
|
||||
@@ -899,7 +899,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Routine Description:
|
||||
// - Moves a portion of text from one part of the output buffer to another
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - source - The rectangular region to copy from
|
||||
// - target - The top left corner of the destination to paste the copy (source)
|
||||
// - clip - The rectangle inside which all operations should be bounded (or no bounds if not given)
|
||||
@@ -910,7 +910,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// conpty mode. See GH#3126.
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
@@ -923,7 +923,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
LockConsole();
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
auto& buffer = context.GetActiveBuffer();
|
||||
auto& buffer = screenInfo.GetActiveBuffer();
|
||||
|
||||
TextAttribute useThisAttr(fillAttribute);
|
||||
ScrollRegion(buffer, source, clip, target, fillCharacter, useThisAttr);
|
||||
@@ -968,11 +968,11 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
// Routine Description:
|
||||
// - Adjusts the default color used for future text written to this output buffer
|
||||
// Arguments:
|
||||
// - context - The output buffer concerned
|
||||
// - screenInfo - The output buffer concerned
|
||||
// - attribute - Color information
|
||||
// Return Value:
|
||||
// - S_OK, E_INVALIDARG, or failure code from thrown exception
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleTextAttributeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleTextAttributeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const WORD attribute) noexcept
|
||||
{
|
||||
auto& gci = ServiceLocator::LocateGlobals().getConsoleInformation();
|
||||
@@ -984,7 +984,7 @@ void ApiRoutines::GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& cont
|
||||
RETURN_HR_IF(E_INVALIDARG, WI_IsAnyFlagSet(attribute, ~VALID_TEXT_ATTRIBUTES));
|
||||
|
||||
const TextAttribute attr{ attribute };
|
||||
context.SetAttributes(attr);
|
||||
screenInfo.SetAttributes(attr);
|
||||
|
||||
gci.ConsoleIme.RefreshAreaAttributes();
|
||||
|
||||
@@ -1203,7 +1203,7 @@ void ApiRoutines::GetConsoleDisplayModeImpl(ULONG& flags) noexcept
|
||||
// - This routine sets the console display mode for an output buffer.
|
||||
// - This API is only supported on x86 machines.
|
||||
// Parameters:
|
||||
// - context - Supplies a console output handle.
|
||||
// - screenInfo - Supplies a console output handle.
|
||||
// - flags - Specifies the display mode. Options are:
|
||||
// CONSOLE_FULLSCREEN_MODE - data is displayed fullscreen
|
||||
// CONSOLE_WINDOWED_MODE - data is displayed in a window
|
||||
@@ -1214,7 +1214,7 @@ void ApiRoutines::GetConsoleDisplayModeImpl(ULONG& flags) noexcept
|
||||
// NOTE:
|
||||
// - This was in private.c, but turns out to be a public API:
|
||||
// - See: http://msdn.microsoft.com/en-us/library/windows/desktop/ms686028(v=vs.85).aspx
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleDisplayModeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::SetConsoleDisplayModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG flags,
|
||||
til::size& newSize) noexcept
|
||||
{
|
||||
@@ -1227,10 +1227,8 @@ void ApiRoutines::GetConsoleDisplayModeImpl(ULONG& flags) noexcept
|
||||
{
|
||||
auto Unlock = wil::scope_exit([&] { UnlockConsole(); });
|
||||
|
||||
auto& screenInfo = context.GetActiveBuffer();
|
||||
|
||||
newSize = screenInfo.GetBufferSize().Dimensions();
|
||||
RETURN_HR_IF(E_INVALIDARG, !(screenInfo.IsActiveScreenBuffer()));
|
||||
auto& activeScreenInfo = screenInfo.GetActiveBuffer();
|
||||
newSize = activeScreenInfo.GetBufferSize().Dimensions();
|
||||
}
|
||||
|
||||
const auto pWindow = ServiceLocator::LocateConsoleWindow();
|
||||
|
||||
@@ -533,7 +533,7 @@ NT_CATCH_RETURN()
|
||||
CATCH_RETURN();
|
||||
}
|
||||
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] HRESULT ApiRoutines::ReadConsoleImpl(InputBuffer& inputBuffer,
|
||||
std::span<char> buffer,
|
||||
size_t& written,
|
||||
std::unique_ptr<IWaitRoutine>& waiter,
|
||||
@@ -545,7 +545,7 @@ NT_CATCH_RETURN()
|
||||
const DWORD controlWakeupMask,
|
||||
DWORD& controlKeyState) noexcept
|
||||
{
|
||||
return HRESULT_FROM_NT(DoReadConsole(context,
|
||||
return HRESULT_FROM_NT(DoReadConsole(inputBuffer,
|
||||
clientHandle,
|
||||
buffer,
|
||||
written,
|
||||
|
||||
@@ -20,11 +20,7 @@ Revision History:
|
||||
// TODO: 9115192 - Temporarily forward declare the real objects until I create an interface representing a console object
|
||||
// This will be required so the server doesn't actually need to understand the implementation of a console object, just the few methods it needs to call.
|
||||
class SCREEN_INFORMATION;
|
||||
typedef SCREEN_INFORMATION IConsoleOutputObject;
|
||||
|
||||
class InputBuffer;
|
||||
typedef InputBuffer IConsoleInputObject;
|
||||
|
||||
class INPUT_READ_HANDLE_DATA;
|
||||
|
||||
#include "IWaitRoutine.h"
|
||||
@@ -38,8 +34,8 @@ class IApiRoutines
|
||||
public:
|
||||
#pragma region ObjectManagement
|
||||
// TODO: 9115192 - We will need to make the objects via an interface eventually. This represents that idea.
|
||||
/*virtual HRESULT CreateInitialObjects(_Out_ IConsoleInputObject** const ppInputObject,
|
||||
_Out_ IConsoleOutputObject** const ppOutputObject);
|
||||
/*virtual HRESULT CreateInitialObjects(_Out_ InputBuffer** const ppInputObject,
|
||||
_Out_ SCREEN_INFORMATION** const ppOutputObject);
|
||||
*/
|
||||
|
||||
#pragma endregion
|
||||
@@ -51,22 +47,22 @@ public:
|
||||
|
||||
virtual void GetConsoleOutputCodePageImpl(ULONG& codepage) noexcept = 0;
|
||||
|
||||
virtual void GetConsoleInputModeImpl(InputBuffer& context,
|
||||
virtual void GetConsoleInputModeImpl(InputBuffer& inputBuffer,
|
||||
ULONG& mode) noexcept = 0;
|
||||
|
||||
virtual void GetConsoleOutputModeImpl(SCREEN_INFORMATION& context,
|
||||
virtual void GetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& mode) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleInputModeImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleInputModeImpl(InputBuffer& inputBuffer,
|
||||
const ULONG mode) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleOutputModeImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleOutputModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG mode) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT GetNumberOfConsoleInputEventsImpl(const IConsoleInputObject& context,
|
||||
[[nodiscard]] virtual HRESULT GetNumberOfConsoleInputEventsImpl(const InputBuffer& inputBuffer,
|
||||
ULONG& events) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT GetConsoleInputImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] virtual HRESULT GetConsoleInputImpl(InputBuffer& inputBuffer,
|
||||
InputEventQueue& outEvents,
|
||||
const size_t eventReadCount,
|
||||
INPUT_READ_HANDLE_DATA& readHandleState,
|
||||
@@ -74,7 +70,7 @@ public:
|
||||
const bool IsPeek,
|
||||
std::unique_ptr<IWaitRoutine>& waiter) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleImpl(InputBuffer& inputBuffer,
|
||||
std::span<char> buffer,
|
||||
size_t& written,
|
||||
std::unique_ptr<IWaitRoutine>& waiter,
|
||||
@@ -86,13 +82,13 @@ public:
|
||||
const DWORD controlWakeupMask,
|
||||
DWORD& controlKeyState) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleAImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::string_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
std::unique_ptr<IWaitRoutine>& waiter) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleWImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const std::wstring_view buffer,
|
||||
size_t& read,
|
||||
bool requiresVtQuirk,
|
||||
@@ -106,65 +102,65 @@ public:
|
||||
|
||||
#pragma region L2
|
||||
|
||||
[[nodiscard]] virtual HRESULT FillConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] virtual HRESULT FillConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const WORD attribute,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
size_t& cellsModified) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT FillConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] virtual HRESULT FillConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const char character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
size_t& cellsModified) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT FillConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] virtual HRESULT FillConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const wchar_t character,
|
||||
const size_t lengthToWrite,
|
||||
const til::point startingCoordinate,
|
||||
size_t& cellsModified,
|
||||
const bool enablePowershellShim = false) noexcept = 0;
|
||||
|
||||
virtual void SetConsoleActiveScreenBufferImpl(IConsoleOutputObject& newContext) noexcept = 0;
|
||||
virtual void SetConsoleActiveScreenBufferImpl(SCREEN_INFORMATION& newContext) noexcept = 0;
|
||||
|
||||
virtual void FlushConsoleInputBuffer(IConsoleInputObject& context) noexcept = 0;
|
||||
virtual void FlushConsoleInputBuffer(InputBuffer& inputBuffer) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleInputCodePageImpl(const ULONG codepage) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleOutputCodePageImpl(const ULONG codepage) noexcept = 0;
|
||||
|
||||
virtual void GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& context,
|
||||
virtual void GetConsoleCursorInfoImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
ULONG& size,
|
||||
bool& isVisible) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleCursorInfoImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleCursorInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG size,
|
||||
const bool isVisible) noexcept = 0;
|
||||
|
||||
// driver will pare down for non-Ex method
|
||||
virtual void GetConsoleScreenBufferInfoExImpl(const IConsoleOutputObject& context,
|
||||
virtual void GetConsoleScreenBufferInfoExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleScreenBufferInfoExImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleScreenBufferInfoExImpl(SCREEN_INFORMATION& OutContext,
|
||||
const CONSOLE_SCREEN_BUFFER_INFOEX& data) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleScreenBufferSizeImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleScreenBufferSizeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::size size) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleCursorPositionImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleCursorPositionImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::point position) noexcept = 0;
|
||||
|
||||
virtual void GetLargestConsoleWindowSizeImpl(const IConsoleOutputObject& context,
|
||||
virtual void GetLargestConsoleWindowSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
til::size& size) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT ScrollConsoleScreenBufferAImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT ScrollConsoleScreenBufferAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
const char fillCharacter,
|
||||
const WORD fillAttribute) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT ScrollConsoleScreenBufferWImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT ScrollConsoleScreenBufferWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const til::inclusive_rect& source,
|
||||
const til::point target,
|
||||
std::optional<til::inclusive_rect> clip,
|
||||
@@ -172,69 +168,69 @@ public:
|
||||
const WORD fillAttribute,
|
||||
const bool enableCmdShim = false) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleTextAttributeImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleTextAttributeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const WORD attribute) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleWindowInfoImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleWindowInfoImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isAbsolute,
|
||||
const til::inclusive_rect& windowRect) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputAttributeImpl(const IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputAttributeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<WORD> buffer,
|
||||
size_t& written) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputCharacterAImpl(const IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputCharacterAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<char> buffer,
|
||||
size_t& written) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputCharacterWImpl(const IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputCharacterWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const til::point origin,
|
||||
std::span<wchar_t> buffer,
|
||||
size_t& written) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleInputAImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleInputAImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleInputWImpl(IConsoleInputObject& context,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleInputWImpl(InputBuffer& inputBuffer,
|
||||
const std::span<const INPUT_RECORD> buffer,
|
||||
size_t& written,
|
||||
const bool append) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputAImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputAImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& writtenRectangle) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputWImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputWImpl(SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& requestRectangle,
|
||||
Microsoft::Console::Types::Viewport& writtenRectangle) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputAttributeImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputAttributeImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::span<const WORD> attrs,
|
||||
const til::point target,
|
||||
size_t& used) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputCharacterAImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputCharacterAImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::string_view text,
|
||||
const til::point target,
|
||||
size_t& used) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputCharacterWImpl(IConsoleOutputObject& OutContext,
|
||||
[[nodiscard]] virtual HRESULT WriteConsoleOutputCharacterWImpl(SCREEN_INFORMATION& OutContext,
|
||||
const std::wstring_view text,
|
||||
const til::point target,
|
||||
size_t& used) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputAImpl(const IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputAImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputWImpl(const IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT ReadConsoleOutputWImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
std::span<CHAR_INFO> buffer,
|
||||
const Microsoft::Console::Types::Viewport& sourceRectangle,
|
||||
Microsoft::Console::Types::Viewport& readRectangle) noexcept = 0;
|
||||
@@ -264,16 +260,16 @@ public:
|
||||
#pragma region L3
|
||||
virtual void GetNumberOfConsoleMouseButtonsImpl(ULONG& buttons) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT GetConsoleFontSizeImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] virtual HRESULT GetConsoleFontSizeImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const DWORD index,
|
||||
til::size& size) noexcept = 0;
|
||||
|
||||
// driver will pare down for non-Ex method
|
||||
[[nodiscard]] virtual HRESULT GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] virtual HRESULT GetCurrentConsoleFontExImpl(const SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleDisplayModeImpl(SCREEN_INFORMATION& context,
|
||||
[[nodiscard]] virtual HRESULT SetConsoleDisplayModeImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const ULONG flags,
|
||||
til::size& newSize) noexcept = 0;
|
||||
|
||||
@@ -357,7 +353,7 @@ public:
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetConsoleHistoryInfoImpl(const CONSOLE_HISTORY_INFO& consoleHistoryInfo) noexcept = 0;
|
||||
|
||||
[[nodiscard]] virtual HRESULT SetCurrentConsoleFontExImpl(IConsoleOutputObject& context,
|
||||
[[nodiscard]] virtual HRESULT SetCurrentConsoleFontExImpl(SCREEN_INFORMATION& screenInfo,
|
||||
const bool isForMaximumWindowSize,
|
||||
const CONSOLE_FONT_INFOEX& consoleFontInfoEx) noexcept = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user