mirror of
https://github.com/microsoft/terminal.git
synced 2026-05-18 01:39:55 +00:00
Compare commits
38 Commits
dev/cazamo
...
dev/duhowe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f6173e925 | ||
|
|
4e29eef477 | ||
|
|
d6353cf580 | ||
|
|
6a5aae76a0 | ||
|
|
400fb0cc9c | ||
|
|
268d5f74e2 | ||
|
|
d395ef57cc | ||
|
|
e55957dcfd | ||
|
|
c306414273 | ||
|
|
681b6cdc3b | ||
|
|
65e033687a | ||
|
|
fd26214d95 | ||
|
|
32b3687619 | ||
|
|
1af0ed0fb3 | ||
|
|
615f85e33c | ||
|
|
3e0441b47c | ||
|
|
91903d7916 | ||
|
|
14a1b1d2b1 | ||
|
|
e6dcf8f271 | ||
|
|
32c4dde0f1 | ||
|
|
5070bdc0b4 | ||
|
|
0c60502855 | ||
|
|
a53b7a8ddd | ||
|
|
a6cea559b2 | ||
|
|
d649b50fb0 | ||
|
|
0179a59a4f | ||
|
|
9b7cc69229 | ||
|
|
b61a2c67b1 | ||
|
|
e42429333d | ||
|
|
b973a8f647 | ||
|
|
200fca3be5 | ||
|
|
1a0ff53734 | ||
|
|
af5146f973 | ||
|
|
8c23e74bea | ||
|
|
b3c8458741 | ||
|
|
cefb894861 | ||
|
|
3f25afdb97 | ||
|
|
5310127d3a |
73
CMakeLists.txt
Normal file
73
CMakeLists.txt
Normal file
@@ -0,0 +1,73 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
# We use the BYPRODUCTS feature for improved Ninja integration
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||
endif()
|
||||
|
||||
cmake_policy(SET CMP0092 NEW)
|
||||
|
||||
project(conhost
|
||||
VERSION 1.0.0
|
||||
DESCRIPTION "Windows Console Host"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
# Some projects (like the COM proxy) generate C files.
|
||||
list(APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS c)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON)
|
||||
|
||||
# Hybrid CRT (runtime library is static, crt is dynamic)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded$<$<CONFIG:Debug>:Debug>)
|
||||
|
||||
execute_process(
|
||||
COMMAND pwsh -NoProfile -Command "${CMAKE_SOURCE_DIR}/tools/Generate-FeatureStagingHeader.ps1" -Branding Dev -Path "${CMAKE_CURRENT_LIST_DIR}\\src\\features.xml" -OutputPath "${CMAKE_BINARY_DIR}\\features.h"
|
||||
)
|
||||
|
||||
add_compile_definitions(
|
||||
UNICODE
|
||||
_UNICODE
|
||||
EXTERNAL_BUILD
|
||||
)
|
||||
|
||||
add_compile_options(
|
||||
/W3 /WX /utf-8
|
||||
/wd4201 /wd4702
|
||||
/permissive-
|
||||
/Zc:preprocessor
|
||||
/Zc:__cplusplus /Zc:__STDC__ /Zc:enumTypes /Zc:externConstexpr /Zc:templateScope /Zc:throwingNew
|
||||
/guard:cf
|
||||
/FI${CMAKE_BINARY_DIR}\\features.h
|
||||
$<$<NOT:$<CONFIG:DEBUG>>:/GL>
|
||||
)
|
||||
|
||||
add_link_options(
|
||||
$<$<NOT:$<CONFIG:DEBUG>>:/LTCG>
|
||||
$<$<NOT:$<CONFIG:DEBUG>>:/OPT:REF>
|
||||
$<$<NOT:$<CONFIG:DEBUG>>:/OPT:ICF>
|
||||
# Hybrid CRT (switch the static crt for the dynaimc one)
|
||||
/nodefaultlib:libucrt$<$<CONFIG:Debug>:d>.lib
|
||||
/defaultlib:ucrt$<$<CONFIG:Debug>:d>.lib
|
||||
/guard:cf
|
||||
)
|
||||
|
||||
add_compile_definitions(
|
||||
"$<$<CONFIG:DEBUG>:DEBUG>"
|
||||
"$<$<CONFIG:DEBUG>:_DEBUG>"
|
||||
"$<$<CONFIG:DEBUG>:DBG>"
|
||||
)
|
||||
|
||||
cmake_policy(SET CMP0091 NEW)
|
||||
set(
|
||||
CMAKE_MSVC_RUNTIME_LIBRARY
|
||||
# Statically link the C++ runtime libraries, but partially override this below
|
||||
"MultiThreaded$<$<CONFIG:Debug>:Debug>"
|
||||
)
|
||||
add_link_options(
|
||||
"/DEFAULTLIB:ucrt$<$<CONFIG:Debug>:d>.lib" # include the dynamic UCRT
|
||||
"/NODEFAULTLIB:libucrt$<$<CONFIG:Debug>:d>.lib" # ignore the static UCRT
|
||||
)
|
||||
|
||||
add_subdirectory(src)
|
||||
34
src/CMakeLists.txt
Normal file
34
src/CMakeLists.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
find_package(Microsoft.GSL CONFIG REQUIRED)
|
||||
find_package(wil CONFIG REQUIRED)
|
||||
|
||||
get_target_property(WIL_INCLUDE_DIR WIL::WIL INTERFACE_INCLUDE_DIRECTORIES)
|
||||
get_target_property(GSL_INCLUDE_DIR Microsoft.GSL::GSL INTERFACE_INCLUDE_DIRECTORIES)
|
||||
|
||||
find_path(FMT_INCLUDE_DIR NAMES format.h)
|
||||
|
||||
include_directories(
|
||||
inc
|
||||
${WIL_INCLUDE_DIR}
|
||||
../oss/stb
|
||||
../oss/chromium
|
||||
../oss/interval_tree
|
||||
../dep/Console
|
||||
../dep/NT
|
||||
../dep/Win32K
|
||||
../dep
|
||||
)
|
||||
|
||||
add_subdirectory(audio)
|
||||
add_subdirectory(buffer)
|
||||
add_subdirectory(host)
|
||||
add_subdirectory(interactivity)
|
||||
add_subdirectory(propsheet)
|
||||
add_subdirectory(propslib)
|
||||
add_subdirectory(renderer)
|
||||
add_subdirectory(server)
|
||||
add_subdirectory(terminal)
|
||||
#add_subdirectory(til)
|
||||
add_subdirectory(tsf)
|
||||
add_subdirectory(types)
|
||||
add_subdirectory(internal)
|
||||
add_subdirectory(winconpty)
|
||||
1
src/audio/CMakeLists.txt
Normal file
1
src/audio/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_subdirectory(midi)
|
||||
10
src/audio/midi/CMakeLists.txt
Normal file
10
src/audio/midi/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
add_library(ConAudioMidi)
|
||||
target_sources(ConAudioMidi
|
||||
PRIVATE
|
||||
MidiAudio.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConAudioMidi
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
1
src/buffer/CMakeLists.txt
Normal file
1
src/buffer/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
add_subdirectory(out)
|
||||
23
src/buffer/out/CMakeLists.txt
Normal file
23
src/buffer/out/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
add_library(ConBufferOut)
|
||||
target_sources(ConBufferOut
|
||||
PRIVATE
|
||||
cursor.cpp
|
||||
ImageSlice.cpp
|
||||
OutputCell.cpp
|
||||
OutputCellIterator.cpp
|
||||
OutputCellRect.cpp
|
||||
OutputCellView.cpp
|
||||
Row.cpp
|
||||
search.cpp
|
||||
TextAttribute.cpp
|
||||
textBuffer.cpp
|
||||
textBufferCellIterator.cpp
|
||||
textBufferTextIterator.cpp
|
||||
TextColor.cpp
|
||||
UTextAdapter.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConBufferOut
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
94
src/host/CMakeLists.txt
Normal file
94
src/host/CMakeLists.txt
Normal file
@@ -0,0 +1,94 @@
|
||||
add_library(ConHostLib)
|
||||
target_sources(ConHostLib
|
||||
PRIVATE
|
||||
_output.cpp
|
||||
_stream.cpp
|
||||
AccessibilityNotifier.cpp
|
||||
alias.cpp
|
||||
cmdline.cpp
|
||||
ConsoleArguments.cpp
|
||||
consoleInformation.cpp
|
||||
dbcs.cpp
|
||||
directio.cpp
|
||||
getset.cpp
|
||||
globals.cpp
|
||||
handle.cpp
|
||||
history.cpp
|
||||
init.cpp
|
||||
input.cpp
|
||||
inputBuffer.cpp
|
||||
inputKeyInfo.cpp
|
||||
inputReadHandleData.cpp
|
||||
misc.cpp
|
||||
ntprivapi.cpp
|
||||
output.cpp
|
||||
outputStream.cpp
|
||||
PtySignalInputThread.cpp
|
||||
readData.cpp
|
||||
readDataCooked.cpp
|
||||
readDataDirect.cpp
|
||||
readDataRaw.cpp
|
||||
registry.cpp
|
||||
renderData.cpp
|
||||
renderFontDefaults.cpp
|
||||
screenInfo.cpp
|
||||
scrolling.cpp
|
||||
selection.cpp
|
||||
selectionInput.cpp
|
||||
selectionState.cpp
|
||||
settings.cpp
|
||||
srvinit.cpp
|
||||
stream.cpp
|
||||
tracing.cpp
|
||||
utils.cpp
|
||||
VtInputThread.cpp
|
||||
VtIo.cpp
|
||||
writeData.cpp
|
||||
)
|
||||
|
||||
target_include_directories(ConHostLib
|
||||
PRIVATE
|
||||
.
|
||||
"$<TARGET_PROPERTY:ConCOMProxy,INTERFACE_INCLUDE_DIRECTORIES>"
|
||||
)
|
||||
|
||||
target_precompile_headers(ConHostLib
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
|
||||
find_package(fmt CONFIG REQUIRED)
|
||||
|
||||
target_link_libraries(ConHostLib
|
||||
INTERFACE
|
||||
ConCOMProxy
|
||||
ConAudioMidi
|
||||
ConBufferOut
|
||||
ConInteractivityBase
|
||||
ConInteractivityWin32
|
||||
ConInternalStubs
|
||||
ConPropsLib
|
||||
ConTermInput
|
||||
ConTermParser
|
||||
ConTermAdapt
|
||||
ConTSF
|
||||
ConServer
|
||||
|
||||
ConRenderBase
|
||||
ConRenderGdi
|
||||
ConRenderAtlas
|
||||
|
||||
ConTypes
|
||||
|
||||
fmt::fmt
|
||||
|
||||
onecoreuap_apiset.lib
|
||||
usp10.lib
|
||||
imm32.lib
|
||||
winmm.lib
|
||||
ntdll.lib
|
||||
)
|
||||
|
||||
add_subdirectory(proxy)
|
||||
add_subdirectory(exe)
|
||||
add_subdirectory(ft_fuzzer)
|
||||
34
src/host/exe/CMakeLists.txt
Normal file
34
src/host/exe/CMakeLists.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
add_executable(conhost WIN32)
|
||||
|
||||
target_sources(conhost
|
||||
PRIVATE
|
||||
CConsoleHandoff.cpp
|
||||
exemain.cpp
|
||||
Host.EXE.rc
|
||||
OpenConsole.exe.manifest
|
||||
)
|
||||
|
||||
target_include_directories(conhost
|
||||
PRIVATE
|
||||
.
|
||||
..
|
||||
)
|
||||
|
||||
target_link_libraries(conhost
|
||||
PRIVATE
|
||||
ConHostLib
|
||||
ConCOMProxy
|
||||
)
|
||||
|
||||
target_link_options(conhost PRIVATE /entry:wWinMainCRTStartup)
|
||||
|
||||
target_precompile_headers(conhost
|
||||
PRIVATE
|
||||
../precomp.h
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS
|
||||
conhost
|
||||
DESTINATION bin
|
||||
)
|
||||
31
src/host/ft_fuzzer/CMakeLists.txt
Normal file
31
src/host/ft_fuzzer/CMakeLists.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
add_executable(confuzz)
|
||||
|
||||
target_sources(confuzz
|
||||
PRIVATE
|
||||
fuzzmain.cpp
|
||||
../exe/Host.EXE.rc
|
||||
../exe/openconsole.exe.manifest
|
||||
)
|
||||
|
||||
target_include_directories(confuzz
|
||||
PRIVATE
|
||||
.
|
||||
..
|
||||
)
|
||||
|
||||
target_link_libraries(confuzz
|
||||
PRIVATE
|
||||
ConHostLib
|
||||
winunixptybridge
|
||||
delayimp.lib
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS
|
||||
confuzz
|
||||
DESTINATION bin
|
||||
)
|
||||
|
||||
target_link_options(confuzz PRIVATE /DELAYLOAD:icu.dll)
|
||||
|
||||
add_subdirectory(PtyBridge)
|
||||
16
src/host/ft_fuzzer/PtyBridge/CMakeLists.txt
Normal file
16
src/host/ft_fuzzer/PtyBridge/CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
add_library(winunixptybridge SHARED)
|
||||
target_sources(winunixptybridge
|
||||
PRIVATE
|
||||
file.cpp
|
||||
bridge.def
|
||||
)
|
||||
|
||||
target_include_directories(winunixptybridge
|
||||
PUBLIC
|
||||
PtyBridge.h
|
||||
)
|
||||
|
||||
target_compile_definitions(winunixptybridge
|
||||
PRIVATE
|
||||
"PTYB_IMPEXP=__declspec(dllexport)"
|
||||
)
|
||||
21
src/host/ft_fuzzer/PtyBridge/PtyBridge.h
Normal file
21
src/host/ft_fuzzer/PtyBridge/PtyBridge.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef PTYB_IMPEXP
|
||||
#define PTYB_IMPEXP __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#ifndef PTYB_EXPORT
|
||||
#ifdef __cplusplus
|
||||
#define PTYB_EXPORT extern "C" PTYB_IMPEXP
|
||||
#else
|
||||
#define PTYB_EXPORT extern PTYB_IMPEXP
|
||||
#endif
|
||||
#endif
|
||||
|
||||
PTYB_EXPORT int WINAPI PtyRead(int arg0, void * arg1, int arg2);
|
||||
PTYB_EXPORT int WINAPI PtyWrite(int arg0, void * arg1, int arg2);
|
||||
PTYB_EXPORT int WINAPI OpenPty(int* pmaster, int* pslave, int width, int height);
|
||||
PTYB_EXPORT int WINAPI ResizePty(int pmaster, int width, int height);
|
||||
PTYB_EXPORT int WINAPI SpawnChild(int pmaster, int pslave, const char* child);
|
||||
7
src/host/ft_fuzzer/PtyBridge/bridge.def
Normal file
7
src/host/ft_fuzzer/PtyBridge/bridge.def
Normal file
@@ -0,0 +1,7 @@
|
||||
LIBRARY winunixptybridge
|
||||
EXPORTS
|
||||
PtyRead
|
||||
PtyWrite
|
||||
OpenPty
|
||||
ResizePty
|
||||
SpawnChild
|
||||
6
src/host/ft_fuzzer/PtyBridge/file.cpp
Normal file
6
src/host/ft_fuzzer/PtyBridge/file.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "PtyBridge.h"
|
||||
int WINAPI PtyRead(int arg0, void * arg1, int arg2) { return -1; }
|
||||
int WINAPI PtyWrite(int arg0, void * arg1, int arg2) { return -1; }
|
||||
int WINAPI OpenPty(int* pmaster, int* pslave, int width, int height) { return -1; }
|
||||
int WINAPI ResizePty(int pmaster, int width, int height) { return -1; }
|
||||
int WINAPI SpawnChild(int pmaster, int pslave, const char* child) { return -1; }
|
||||
127
src/host/ft_fuzzer/conmsg.h
Normal file
127
src/host/ft_fuzzer/conmsg.h
Normal file
@@ -0,0 +1,127 @@
|
||||
#pragma once
|
||||
|
||||
template<int I>
|
||||
struct ConsoleMessageTypeOracle
|
||||
{
|
||||
using type = void;
|
||||
};
|
||||
|
||||
#define CONSOLE_API_L(Number, InputBuffers, OutputBuffers) \
|
||||
template<> \
|
||||
struct ConsoleMessageTypeOracle<Number> \
|
||||
{ \
|
||||
using has_body = std::false_type; \
|
||||
static constexpr int input_buffers = InputBuffers; \
|
||||
static constexpr int output_buffers = OutputBuffers; \
|
||||
};
|
||||
|
||||
#define CONSOLE_API_Z(Number) CONSOLE_API_L(Number, 0, 0)
|
||||
|
||||
#define CONSOLE_API_B(Number, Struct, Member, InputBuffers, OutputBuffers) \
|
||||
template<> \
|
||||
struct ConsoleMessageTypeOracle<Number> \
|
||||
{ \
|
||||
using type = Struct; \
|
||||
using has_body = std::true_type; \
|
||||
static constexpr int input_buffers = InputBuffers; \
|
||||
static constexpr int output_buffers = OutputBuffers; \
|
||||
static auto& rwmem(CONSOLE_API_MSG& message) { return message.u.Member = {}; } \
|
||||
static const auto& romem(const CONSOLE_API_MSG& message) { return message.u.Member; } \
|
||||
};
|
||||
|
||||
#define CONSOLE_API_T(Number, Struct, Member) \
|
||||
CONSOLE_API_B(Number, Struct, Member, 0, 0)
|
||||
|
||||
#define CONSOLE_API_I(Number, Struct, Member) \
|
||||
CONSOLE_API_B(Number, Struct, Member, 1, 0)
|
||||
|
||||
#define CONSOLE_API_O(Number, Struct, Member) \
|
||||
CONSOLE_API_B(Number, Struct, Member, 0, 1)
|
||||
|
||||
CONSOLE_API_T(ConsolepGetCP, CONSOLE_GETCP_MSG, consoleMsgL1.GetConsoleCP)
|
||||
CONSOLE_API_T(ConsolepGetMode, CONSOLE_MODE_MSG, consoleMsgL1.GetConsoleMode)
|
||||
CONSOLE_API_T(ConsolepSetMode, CONSOLE_MODE_MSG, consoleMsgL1.SetConsoleMode)
|
||||
CONSOLE_API_T(ConsolepGetNumberOfInputEvents, CONSOLE_GETNUMBEROFINPUTEVENTS_MSG, consoleMsgL1.GetNumberOfConsoleInputEvents)
|
||||
CONSOLE_API_O(ConsolepGetConsoleInput, CONSOLE_GETCONSOLEINPUT_MSG, consoleMsgL1.GetConsoleInput)
|
||||
CONSOLE_API_O(ConsolepReadConsole, CONSOLE_READCONSOLE_MSG, consoleMsgL1.ReadConsole)
|
||||
CONSOLE_API_I(ConsolepWriteConsole, CONSOLE_WRITECONSOLE_MSG, consoleMsgL1.WriteConsole)
|
||||
CONSOLE_API_T(ConsolepGetLangId, CONSOLE_LANGID_MSG, consoleMsgL1.GetConsoleLangId)
|
||||
CONSOLE_API_T(ConsolepGenerateCtrlEvent, CONSOLE_CTRLEVENT_MSG, consoleMsgL2.GenerateConsoleCtrlEvent)
|
||||
CONSOLE_API_T(ConsolepFillConsoleOutput, CONSOLE_FILLCONSOLEOUTPUT_MSG, consoleMsgL2.FillConsoleOutput)
|
||||
CONSOLE_API_Z(ConsolepSetActiveScreenBuffer)
|
||||
CONSOLE_API_Z(ConsolepFlushInputBuffer)
|
||||
CONSOLE_API_T(ConsolepSetCP, CONSOLE_SETCP_MSG, consoleMsgL2.SetConsoleCP)
|
||||
CONSOLE_API_T(ConsolepGetCursorInfo, CONSOLE_GETCURSORINFO_MSG, consoleMsgL2.GetConsoleCursorInfo)
|
||||
CONSOLE_API_T(ConsolepSetCursorInfo, CONSOLE_SETCURSORINFO_MSG, consoleMsgL2.SetConsoleCursorInfo)
|
||||
CONSOLE_API_T(ConsolepGetScreenBufferInfo, CONSOLE_SCREENBUFFERINFO_MSG, consoleMsgL2.GetConsoleScreenBufferInfo)
|
||||
CONSOLE_API_T(ConsolepSetScreenBufferInfo, CONSOLE_SCREENBUFFERINFO_MSG, consoleMsgL2.SetConsoleScreenBufferInfo)
|
||||
CONSOLE_API_T(ConsolepSetScreenBufferSize, CONSOLE_SETSCREENBUFFERSIZE_MSG, consoleMsgL2.SetConsoleScreenBufferSize)
|
||||
CONSOLE_API_T(ConsolepSetCursorPosition, CONSOLE_SETCURSORPOSITION_MSG, consoleMsgL2.SetConsoleCursorPosition)
|
||||
CONSOLE_API_T(ConsolepGetLargestWindowSize, CONSOLE_GETLARGESTWINDOWSIZE_MSG, consoleMsgL2.GetLargestConsoleWindowSize)
|
||||
CONSOLE_API_T(ConsolepScrollScreenBuffer, CONSOLE_SCROLLSCREENBUFFER_MSG, consoleMsgL2.ScrollConsoleScreenBuffer)
|
||||
CONSOLE_API_T(ConsolepSetTextAttribute, CONSOLE_SETTEXTATTRIBUTE_MSG, consoleMsgL2.SetConsoleTextAttribute)
|
||||
CONSOLE_API_T(ConsolepSetWindowInfo, CONSOLE_SETWINDOWINFO_MSG, consoleMsgL2.SetConsoleWindowInfo)
|
||||
CONSOLE_API_O(ConsolepReadConsoleOutputString, CONSOLE_READCONSOLEOUTPUTSTRING_MSG, consoleMsgL2.ReadConsoleOutputString)
|
||||
CONSOLE_API_I(ConsolepWriteConsoleInput, CONSOLE_WRITECONSOLEINPUT_MSG, consoleMsgL2.WriteConsoleInput)
|
||||
CONSOLE_API_I(ConsolepWriteConsoleOutput, CONSOLE_WRITECONSOLEOUTPUT_MSG, consoleMsgL2.WriteConsoleOutput)
|
||||
CONSOLE_API_I(ConsolepWriteConsoleOutputString, CONSOLE_WRITECONSOLEOUTPUTSTRING_MSG, consoleMsgL2.WriteConsoleOutputString)
|
||||
CONSOLE_API_O(ConsolepReadConsoleOutput, CONSOLE_READCONSOLEOUTPUT_MSG, consoleMsgL2.ReadConsoleOutput)
|
||||
CONSOLE_API_O(ConsolepGetTitle, CONSOLE_GETTITLE_MSG, consoleMsgL2.GetConsoleTitle)
|
||||
CONSOLE_API_I(ConsolepSetTitle, CONSOLE_SETTITLE_MSG, consoleMsgL2.SetConsoleTitle)
|
||||
CONSOLE_API_T(ConsolepGetMouseInfo, CONSOLE_GETMOUSEINFO_MSG, consoleMsgL3.GetConsoleMouseInfo)
|
||||
CONSOLE_API_T(ConsolepGetFontSize, CONSOLE_GETFONTSIZE_MSG, consoleMsgL3.GetConsoleFontSize)
|
||||
CONSOLE_API_L(ConsolepGetCurrentFont, 0, 1)
|
||||
CONSOLE_API_T(ConsolepSetDisplayMode, CONSOLE_SETDISPLAYMODE_MSG, consoleMsgL3.SetConsoleDisplayMode)
|
||||
CONSOLE_API_T(ConsolepGetDisplayMode, CONSOLE_GETDISPLAYMODE_MSG, consoleMsgL3.GetConsoleDisplayMode)
|
||||
CONSOLE_API_I(ConsolepAddAlias, CONSOLE_ADDALIAS_MSG, consoleMsgL3.AddConsoleAlias)
|
||||
CONSOLE_API_B(ConsolepGetAlias, CONSOLE_GETALIAS_MSG, consoleMsgL3.GetConsoleAlias, 1, 1)
|
||||
CONSOLE_API_I(ConsolepGetAliasesLength, CONSOLE_GETALIASESLENGTH_MSG, consoleMsgL3.GetConsoleAliasesLength)
|
||||
CONSOLE_API_T(ConsolepGetAliasExesLength, CONSOLE_GETALIASEXESLENGTH_MSG, consoleMsgL3.GetConsoleAliasExesLength)
|
||||
CONSOLE_API_B(ConsolepGetAliases, CONSOLE_GETALIASES_MSG, consoleMsgL3.GetConsoleAliases, 1, 1)
|
||||
CONSOLE_API_O(ConsolepGetAliasExes, CONSOLE_GETALIASEXES_MSG, consoleMsgL3.GetConsoleAliasExes)
|
||||
CONSOLE_API_I(ConsolepExpungeCommandHistory, CONSOLE_EXPUNGECOMMANDHISTORY_MSG, consoleMsgL3.ExpungeConsoleCommandHistory)
|
||||
CONSOLE_API_I(ConsolepSetNumberOfCommands, CONSOLE_SETNUMBEROFCOMMANDS_MSG, consoleMsgL3.SetConsoleNumberOfCommands)
|
||||
CONSOLE_API_I(ConsolepGetCommandHistoryLength, CONSOLE_GETCOMMANDHISTORYLENGTH_MSG, consoleMsgL3.GetConsoleCommandHistoryLength)
|
||||
CONSOLE_API_B(ConsolepGetCommandHistory, CONSOLE_GETCOMMANDHISTORY_MSG, consoleMsgL3.GetConsoleCommandHistory, 1, 1)
|
||||
CONSOLE_API_T(ConsolepGetConsoleWindow, CONSOLE_GETCONSOLEWINDOW_MSG, consoleMsgL3.GetConsoleWindow)
|
||||
CONSOLE_API_T(ConsolepGetSelectionInfo, CONSOLE_GETSELECTIONINFO_MSG, consoleMsgL3.GetConsoleSelectionInfo)
|
||||
CONSOLE_API_T(ConsolepGetConsoleProcessList, CONSOLE_GETCONSOLEPROCESSLIST_MSG, consoleMsgL3.GetConsoleProcessList)
|
||||
CONSOLE_API_T(ConsolepGetHistory, CONSOLE_HISTORY_MSG, consoleMsgL3.GetConsoleHistory)
|
||||
CONSOLE_API_T(ConsolepSetHistory, CONSOLE_HISTORY_MSG, consoleMsgL3.SetConsoleHistory)
|
||||
CONSOLE_API_T(ConsolepSetCurrentFont, CONSOLE_CURRENTFONT_MSG, consoleMsgL3.SetCurrentConsoleFont)
|
||||
|
||||
template<int Id>
|
||||
auto& PrepareConsoleMessage(ULONG_PTR targetObject, auto& message)
|
||||
{
|
||||
message.Descriptor.Function = CONSOLE_IO_USER_DEFINED;
|
||||
message.Descriptor.Object = targetObject;
|
||||
using orl = ConsoleMessageTypeOracle<Id>;
|
||||
message.msgHeader.ApiNumber = Id;
|
||||
if constexpr (orl::has_body::value)
|
||||
{
|
||||
using t = typename orl::type;
|
||||
message.Descriptor.InputSize = sizeof(t) + sizeof(CONSOLE_MSG_HEADER);
|
||||
message.msgHeader.ApiDescriptorSize = sizeof(t);
|
||||
return orl::rwmem(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
message.Descriptor.InputSize = sizeof(CONSOLE_MSG_HEADER);
|
||||
message.msgHeader.ApiDescriptorSize = 0;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
template<int Id>
|
||||
const auto& ReadConsoleMessage(const auto& message)
|
||||
{
|
||||
using orl = ConsoleMessageTypeOracle<Id>;
|
||||
if constexpr (orl::has_body::value)
|
||||
{
|
||||
return orl::romem(message);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "precomp.h"
|
||||
|
||||
#include <til/u8u16convert.h>
|
||||
#include <ranges>
|
||||
#include <fmt/ranges.h>
|
||||
|
||||
#include "../ConsoleArguments.hpp"
|
||||
#include "../srvinit.h"
|
||||
@@ -11,48 +13,393 @@
|
||||
#include "../../interactivity/inc/ServiceLocator.hpp"
|
||||
#include "../../server/IoThread.h"
|
||||
|
||||
#include "conmsg.h"
|
||||
#include <til/spsc.h>
|
||||
#include <til/mutex.h>
|
||||
#include "PtyBridge/PtyBridge.h"
|
||||
|
||||
template<typename... Ts>
|
||||
void debug_log(fmt::wformat_string<Ts...> fs, Ts&&... args)
|
||||
{
|
||||
fmt::print(stderr, fs, std::forward<Ts>(args)...);
|
||||
}
|
||||
|
||||
struct EnqueuedMessage
|
||||
{
|
||||
std::unique_ptr<uint8_t[]> outputBuffer;
|
||||
std::unique_ptr<uint8_t[]> inputBuffer;
|
||||
CD_IO_DESCRIPTOR Descriptor;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
CD_CREATE_OBJECT_INFORMATION CreateObject;
|
||||
CONSOLE_CREATESCREENBUFFER_MSG CreateScreenBuffer;
|
||||
};
|
||||
struct
|
||||
{
|
||||
CONSOLE_MSG_HEADER msgHeader;
|
||||
union
|
||||
{
|
||||
CONSOLE_MSG_BODY_L1 consoleMsgL1;
|
||||
CONSOLE_MSG_BODY_L2 consoleMsgL2;
|
||||
CONSOLE_MSG_BODY_L3 consoleMsgL3;
|
||||
} u;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
struct Rd
|
||||
{
|
||||
std::unique_ptr<uint8_t[]> buf;
|
||||
size_t len;
|
||||
uint64_t seq; // assigned at queue time
|
||||
};
|
||||
|
||||
struct Owc
|
||||
{
|
||||
std::list<Rd> q;
|
||||
};
|
||||
|
||||
static LUID
|
||||
ToLuid(uint64_t seq)
|
||||
{
|
||||
return LUID{
|
||||
.LowPart = static_cast<DWORD>(seq & DWORD_MAX),
|
||||
.HighPart = static_cast<LONG>((seq & 0xFFFFFFFF00000000ULL) >> 32ULL),
|
||||
};
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
FromLuid(const LUID& l)
|
||||
{
|
||||
return static_cast<uint64_t>(l.HighPart) << 32ULL | static_cast<uint64_t>(l.LowPart);
|
||||
}
|
||||
|
||||
struct NullDeviceComm : public IDeviceComm
|
||||
{
|
||||
mutable uint64_t _seq{ 0 };
|
||||
static constexpr uint64_t InitialConnectMessage = 0xA0000000;
|
||||
static constexpr uint64_t EnqueuedReadInputMessage = 0xAA000000;
|
||||
mutable std::atomic<BOOL> signal{ TRUE }; // start out true to kick off an enqueue
|
||||
mutable BOOL enqueueInput{ TRUE };
|
||||
mutable Owc _outgoingWriteConsole;
|
||||
|
||||
mutable int pmas, pslv;
|
||||
|
||||
void handleInputRecords(std::span<INPUT_RECORD> buffer) const
|
||||
{
|
||||
std::optional<wchar_t> _highSurrogate;
|
||||
std::wstring _convertedString;
|
||||
for (auto it = buffer.begin(); it != buffer.end(); ++it)
|
||||
{
|
||||
if (it->EventType == WINDOW_BUFFER_SIZE_EVENT)
|
||||
{
|
||||
auto& we = it->Event.WindowBufferSizeEvent.dwSize;
|
||||
debug_log(L"<- TIOCSWINSZ {}x{}\n", we.X, we.Y);
|
||||
// TIOCSWINSZ
|
||||
//_windowSizeChangedCallback();
|
||||
}
|
||||
else if (it->EventType == KEY_EVENT)
|
||||
{
|
||||
const auto& keyEvent = it->Event.KeyEvent;
|
||||
if (keyEvent.bKeyDown || (!keyEvent.bKeyDown && keyEvent.wVirtualKeyCode == VK_MENU))
|
||||
{
|
||||
// Got a high surrogate at the end of the buffer
|
||||
if (IS_HIGH_SURROGATE(keyEvent.uChar.UnicodeChar))
|
||||
{
|
||||
_highSurrogate.emplace(keyEvent.uChar.UnicodeChar);
|
||||
continue; // we've consumed it -- only dispatch it if we get a low
|
||||
}
|
||||
|
||||
if (IS_LOW_SURROGATE(keyEvent.uChar.UnicodeChar))
|
||||
{
|
||||
// No matter what we do, we want to destructively consume the high surrogate
|
||||
if (const auto oldHighSurrogate{ std::exchange(_highSurrogate, std::nullopt) })
|
||||
{
|
||||
_convertedString.push_back(*oldHighSurrogate);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If we get a low without a high surrogate, we've done everything we can.
|
||||
// This is an illegal state.
|
||||
_convertedString.push_back(UNICODE_REPLACEMENT);
|
||||
continue; // onto the next event
|
||||
}
|
||||
}
|
||||
|
||||
// (\0 with a scancode is probably a modifier key, not a VT input key)
|
||||
if (keyEvent.uChar.UnicodeChar != L'\0' || keyEvent.wVirtualScanCode == 0)
|
||||
{
|
||||
if (_highSurrogate) // non-destructive: we don't want to set it to nullopt needlessly for every character
|
||||
{
|
||||
// If we get a high surrogate *here*, we didn't find a low surrogate.
|
||||
// This state is also illegal.
|
||||
_convertedString.push_back(UNICODE_REPLACEMENT);
|
||||
_highSurrogate.reset();
|
||||
}
|
||||
_convertedString.push_back(keyEvent.uChar.UnicodeChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
auto eightString = til::u16u8(_convertedString);
|
||||
//WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), eightString.data(), (DWORD)eightString.size(), nullptr, nullptr);
|
||||
PtyWrite(pmas, eightString.data(), (int)eightString.size());
|
||||
}
|
||||
|
||||
void _RetireIoOperation(CD_IO_COMPLETE* const complete) const
|
||||
{
|
||||
const auto id{ FromLuid(complete->Identifier) };
|
||||
if (id == InitialConnectMessage)
|
||||
{
|
||||
memcpy((void*)&Connection, reinterpret_cast<uint8_t*>(complete->Write.Data) + complete->Write.Offset, std::min(sizeof(Connection), (unsigned long long)complete->Write.Size));
|
||||
}
|
||||
else if (id == 5)
|
||||
{
|
||||
debug_log(L"OP-{:X} Retire With Data (dest = 0x{:016x} + 0x{:x}, len = {})\n", id, (uintptr_t)(complete->Write.Data), complete->Write.Offset, complete->Write.Size);
|
||||
const auto w = *(CONSOLE_SCREENBUFFERINFO_MSG*)(((uint8_t*)complete->Write.Data) + complete->Write.Offset);
|
||||
debug_log(L"Checking - Console window is {}x{}\n", w.CurrentWindowSize.X, w.CurrentWindowSize.Y);
|
||||
auto val = OpenPty(&pmas, &pslv, w.CurrentWindowSize.X, w.CurrentWindowSize.Y);
|
||||
debug_log(L"BRIDGE - OpenPty = {} (mas {} slv {})\n", val, pmas, pslv);
|
||||
if (val == 0)
|
||||
{
|
||||
val = SpawnChild(pmas, pslv, "/bin/bash");
|
||||
debug_log(L"BRIDGE - SpawnChild {}\n", val);
|
||||
StartPtyServiceThread();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
auto head = _outgoingWriteConsole.q.begin();
|
||||
if (head != _outgoingWriteConsole.q.end() && head->seq == id)
|
||||
{
|
||||
_outgoingWriteConsole.q.pop_front();
|
||||
signal = signal || _outgoingWriteConsole.q.size() > 0;
|
||||
}
|
||||
}
|
||||
debug_log(L"OP-{:X} Retired (Status = 0x{:08X})\n", id, complete->IoStatus.Status);
|
||||
}
|
||||
|
||||
HRESULT SetServerInformation(CD_IO_SERVER_INFORMATION* const) const override
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
HRESULT ReadIo(PCONSOLE_API_MSG const, CONSOLE_API_MSG* const) const override
|
||||
HRESULT ReadIo(PCONSOLE_API_MSG pReplyMessage, CONSOLE_API_MSG* const pMessage) const override
|
||||
{
|
||||
// The easiest way to get the IO thread to stop reading from us us to simply
|
||||
// suspend it. The fuzzer doesn't need a device IO thread.
|
||||
SuspendThread(GetCurrentThread());
|
||||
if (pReplyMessage)
|
||||
{
|
||||
const auto replyId = FromLuid(pReplyMessage->Complete.Identifier);
|
||||
debug_log(L"OP-{:X} Reply Received During Read\n", replyId);
|
||||
if (replyId == 2)
|
||||
{
|
||||
auto& msg = ReadConsoleMessage<ConsolepGetMode>(*pReplyMessage);
|
||||
debug_log(L"---- Console mode = {:X}\n", msg.Mode);
|
||||
}
|
||||
else if (replyId == 5)
|
||||
{
|
||||
auto& msg = ReadConsoleMessage<ConsolepGetScreenBufferInfo>(*pReplyMessage);
|
||||
debug_log(L"Console window is {}x{}\n", msg.CurrentWindowSize.X, msg.CurrentWindowSize.Y);
|
||||
}
|
||||
_RetireIoOperation(&pReplyMessage->Complete);
|
||||
}
|
||||
|
||||
CONSOLE_API_MSG& local = *pMessage;
|
||||
memset(&local.Descriptor, 0, sizeof(CONSOLE_API_MSG) - FIELD_OFFSET(CONSOLE_API_MSG, Descriptor));
|
||||
|
||||
auto seq = _seq++;
|
||||
local.Descriptor.Process = Connection.Process;
|
||||
local.Descriptor.Identifier = ToLuid(seq);
|
||||
|
||||
// We spend the first five messages on setting up the client, console modes and codepages.
|
||||
// All following messages are generated on-the-fly as WriteConsole or ReadConsoleInput
|
||||
switch (seq)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
if (Connection.Process)
|
||||
{
|
||||
debug_log(L"UNEXPECTED -- Message 0, but we already have a connected process?\n");
|
||||
}
|
||||
local.Descriptor.Identifier = ToLuid(InitialConnectMessage); // Sentinel value for WriteOutput
|
||||
local.Descriptor.Function = CONSOLE_IO_CONNECT;
|
||||
local.Descriptor.Process = GetCurrentProcessId(); // CAC Special - Process=PID
|
||||
local.Descriptor.Object = GetCurrentThreadId(); // CAC Special - Object=TID
|
||||
local.Descriptor.InputSize = sizeof(CONSOLE_SERVER_MSG);
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
auto& msg = PrepareConsoleMessage<ConsolepSetMode>(Connection.Output, local);
|
||||
msg.Mode = ENABLE_PROCESSED_OUTPUT | ENABLE_WRAP_AT_EOL_OUTPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
auto& msg = PrepareConsoleMessage<ConsolepSetMode>(Connection.Input, local);
|
||||
msg.Mode = ENABLE_VIRTUAL_TERMINAL_INPUT;
|
||||
msg.Mode |= ENABLE_WINDOW_INPUT;
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
case 4:
|
||||
{
|
||||
auto& msg = PrepareConsoleMessage<ConsolepSetCP>(Connection.Output, local);
|
||||
msg.CodePage = CP_UTF8;
|
||||
msg.Output = seq == 3 ? TRUE : FALSE;
|
||||
break;
|
||||
}
|
||||
case 5:
|
||||
{
|
||||
auto& msg = PrepareConsoleMessage<ConsolepGetScreenBufferInfo>(Connection.Output, local);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
BOOL old{ FALSE };
|
||||
while (!signal.load())
|
||||
til::atomic_wait(signal, old); // wait for a signal
|
||||
|
||||
if (enqueueInput)
|
||||
{
|
||||
local.Descriptor.Identifier = ToLuid(EnqueuedReadInputMessage);
|
||||
auto& msg = PrepareConsoleMessage<ConsolepGetConsoleInput>(Connection.Input, local);
|
||||
msg.Unicode = TRUE;
|
||||
local.Descriptor.OutputSize = 128 * 1024;
|
||||
enqueueInput = FALSE;
|
||||
signal = _outgoingWriteConsole.q.size() > 0;
|
||||
}
|
||||
else if (_outgoingWriteConsole.q.size())
|
||||
{
|
||||
auto head = _outgoingWriteConsole.q.begin();
|
||||
head->seq = seq;
|
||||
local.Descriptor.Function = CONSOLE_IO_RAW_WRITE;
|
||||
local.Descriptor.Object = Connection.Output;
|
||||
local.Descriptor.InputSize = static_cast<ULONG>(head->len);
|
||||
signal = enqueueInput; // if we should also enqueue an input on the next trip around
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CompleteIo(CD_IO_COMPLETE* const completion) const override
|
||||
{
|
||||
const auto id = FromLuid(completion->Identifier);
|
||||
debug_log(L"OP-{:X} Completed\n", id);
|
||||
_RetireIoOperation(completion);
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT ReadInput(CD_IO_OPERATION* const operation) const override
|
||||
{
|
||||
const auto id = FromLuid(operation->Identifier);
|
||||
debug_log(L"OP-{:X} ReadInput (dest = 0x{:016x} + 0x{:x}, len = {})\n", id, (uintptr_t)(operation->Buffer.Data), operation->Buffer.Offset, operation->Buffer.Size);
|
||||
|
||||
if (id == InitialConnectMessage)
|
||||
{
|
||||
CONSOLE_SERVER_MSG msg{
|
||||
.StartupFlags = STARTF_USECOUNTCHARS,
|
||||
.ShowWindow = SW_NORMAL,
|
||||
.ScreenBufferSize = { 80, 25 },
|
||||
.WindowSize = { 80, 25 },
|
||||
.ProcessGroupId = 0xFFFFFFFF,
|
||||
.ConsoleApp = TRUE,
|
||||
.WindowVisible = TRUE,
|
||||
.TitleLength = 15 * 2,
|
||||
.Title = L"Fuzzing Harness",
|
||||
.ApplicationNameLength = 8 * 2,
|
||||
.ApplicationName = L"fuzz.exe",
|
||||
.CurrentDirectoryLength = 3 * 2,
|
||||
.CurrentDirectory = L"C:\\",
|
||||
};
|
||||
memcpy((uint8_t*)(operation->Buffer.Data) + operation->Buffer.Offset, &msg, std::min((unsigned long long)operation->Buffer.Size, sizeof(msg)));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
auto head = _outgoingWriteConsole.q.begin();
|
||||
if (head->seq == id)
|
||||
{
|
||||
memcpy((uint8_t*)(operation->Buffer.Data) + operation->Buffer.Offset, head->buf.get(), std::min(static_cast<size_t>(operation->Buffer.Size), head->len));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
debug_log(L"OP-{:X} OUT OF ORDER READ?", id);
|
||||
if (head != _outgoingWriteConsole.q.end())
|
||||
{
|
||||
debug_log(L" Expected {:X}", head->seq);
|
||||
}
|
||||
debug_log(L"\n");
|
||||
return S_FALSE;
|
||||
}
|
||||
HRESULT CompleteIo(CD_IO_COMPLETE* const) const override
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
HRESULT ReadInput(CD_IO_OPERATION* const) const override
|
||||
{
|
||||
SuspendThread(GetCurrentThread());
|
||||
return S_FALSE;
|
||||
}
|
||||
HRESULT WriteOutput(CD_IO_OPERATION* const) const override
|
||||
HRESULT WriteOutput(CD_IO_OPERATION* const operation) const override
|
||||
{
|
||||
const auto id = FromLuid(operation->Identifier);
|
||||
debug_log(L"OP-{:X} WriteOutput (dest = 0x{:016x} + 0x{:x}, len = {})\n", id, (uintptr_t)(operation->Buffer.Data), operation->Buffer.Offset, operation->Buffer.Size);
|
||||
if (id == EnqueuedReadInputMessage)
|
||||
{
|
||||
// TODO(DH) - figure out why Offset should be ignored here. It looks like that's how CompleteIo gets the _message_ back, but it's unused here?
|
||||
auto records = reinterpret_cast<INPUT_RECORD*>(reinterpret_cast<uint8_t*>(operation->Buffer.Data) + 0 /*operation->Buffer.Offset*/);
|
||||
std::span<INPUT_RECORD> spr{ records, operation->Buffer.Size / sizeof(INPUT_RECORD) };
|
||||
handleInputRecords(spr);
|
||||
|
||||
// Since we just read the input handle (maybe asynchronously), enqueue another ReadInput
|
||||
enqueueInput = TRUE;
|
||||
signal.store(TRUE);
|
||||
til::atomic_notify_one(signal);
|
||||
return S_OK;
|
||||
}
|
||||
debug_log(L"OP-{:X} Unexpected WriteOutput Request\n", id);
|
||||
return S_FALSE;
|
||||
}
|
||||
HRESULT AllowUIAccess() const override
|
||||
{
|
||||
return S_FALSE;
|
||||
}
|
||||
ULONG_PTR PutHandle(const void*) override
|
||||
ULONG_PTR PutHandle(const void* handle) override
|
||||
{
|
||||
return 0;
|
||||
// Whenever a handle is "registered" with us, we just pass it through as a literal int
|
||||
return reinterpret_cast<ULONG_PTR>(handle);
|
||||
}
|
||||
void* GetHandle(ULONG_PTR) const override
|
||||
void* GetHandle(ULONG_PTR handle) const override
|
||||
{
|
||||
return nullptr;
|
||||
return reinterpret_cast<void*>(handle);
|
||||
}
|
||||
HRESULT GetServerHandle(HANDLE*) const override
|
||||
{
|
||||
// This is only called during handoff.
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
void WriteData(std::unique_ptr<uint8_t[]> buffer, size_t len)
|
||||
{
|
||||
_outgoingWriteConsole.q.emplace_back(Rd{ std::move(buffer), len, 0 });
|
||||
signal.store(TRUE);
|
||||
til::atomic_notify_one(signal);
|
||||
}
|
||||
|
||||
void StartPtyServiceThread() const
|
||||
{
|
||||
std::thread([&]() {
|
||||
auto& globals = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals();
|
||||
auto n = static_cast<NullDeviceComm*>(globals.pDeviceComm);
|
||||
while (true)
|
||||
{
|
||||
static constexpr int bsz = 4096;
|
||||
std::unique_ptr<uint8_t[]> buf = std::make_unique_for_overwrite<uint8_t[]>(bsz);
|
||||
int read;
|
||||
read = PtyRead(pmas, buf.get(), bsz);
|
||||
if (read > 0)
|
||||
n->WriteData(std::move(buf), read);
|
||||
if (read < 0)
|
||||
{
|
||||
debug_log(L"BRIDGE - Read returned {}\n", read);
|
||||
}
|
||||
}
|
||||
}).detach();
|
||||
}
|
||||
|
||||
CD_CONNECTION_INFORMATION Connection{};
|
||||
};
|
||||
|
||||
[[nodiscard]] HRESULT StartNullConsole(const ConsoleArguments* const args)
|
||||
@@ -64,36 +411,6 @@ struct NullDeviceComm : public IDeviceComm
|
||||
// in ConDrvDeviceComm (which has been avoided by setting a global device comm beforehand)
|
||||
RETURN_IF_NTSTATUS_FAILED(ConsoleCreateIoThreadLegacy(INVALID_HANDLE_VALUE, args));
|
||||
|
||||
auto& gci = Microsoft::Console::Interactivity::ServiceLocator::LocateGlobals().getConsoleInformation();
|
||||
|
||||
// Process handle list manipulation must be done under lock
|
||||
gci.LockConsole();
|
||||
ConsoleProcessHandle* pProcessHandle{ nullptr };
|
||||
RETURN_IF_FAILED(gci.ProcessHandleList.AllocProcessData(GetCurrentProcessId(),
|
||||
GetCurrentThreadId(),
|
||||
0,
|
||||
&pProcessHandle));
|
||||
pProcessHandle->fRootProcess = true;
|
||||
|
||||
constexpr static std::wstring_view fakeTitle{ L"Fuzzing Harness" };
|
||||
|
||||
CONSOLE_API_CONNECTINFO fakeConnectInfo{};
|
||||
fakeConnectInfo.ConsoleInfo.SetShowWindow(SW_NORMAL);
|
||||
fakeConnectInfo.ConsoleInfo.SetScreenBufferSize({ 80, 25 });
|
||||
fakeConnectInfo.ConsoleInfo.SetWindowSize({ 80, 25 });
|
||||
fakeConnectInfo.ConsoleInfo.SetStartupFlags(STARTF_USECOUNTCHARS);
|
||||
wcscpy_s(fakeConnectInfo.Title, fakeTitle.data());
|
||||
fakeConnectInfo.TitleLength = gsl::narrow_cast<DWORD>(fakeTitle.size() * sizeof(wchar_t)); // bytes, not wchars
|
||||
wcscpy_s(fakeConnectInfo.AppName, fakeTitle.data());
|
||||
fakeConnectInfo.AppNameLength = gsl::narrow_cast<DWORD>(fakeTitle.size() * sizeof(wchar_t)); // bytes, not wchars
|
||||
fakeConnectInfo.ConsoleApp = TRUE;
|
||||
fakeConnectInfo.WindowVisible = TRUE;
|
||||
RETURN_IF_NTSTATUS_FAILED(ConsoleAllocateConsole(&fakeConnectInfo));
|
||||
|
||||
CommandHistory::s_Allocate(fakeTitle, (HANDLE)pProcessHandle);
|
||||
|
||||
gci.UnlockConsole();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -121,6 +438,7 @@ int main(int /*argc*/, char** /*argv*/)
|
||||
#endif
|
||||
{
|
||||
RETURN_IF_FAILED(RunConhost());
|
||||
ExitThread(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,5 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
void InitSideBySide(_Out_writes_(ScratchBufferSize) PWSTR ScratchBuffer, __range(MAX_PATH, MAX_PATH) DWORD ScratchBufferSize);
|
||||
void InitEnvironmentVariables();
|
||||
|
||||
39
src/host/proxy/CMakeLists.txt
Normal file
39
src/host/proxy/CMakeLists.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
set(IDL_FILES IConsoleHandoff.idl ITerminalHandoff.idl)
|
||||
|
||||
foreach(FILE ${IDL_FILES})
|
||||
get_filename_component(FILE_WE ${FILE} NAME_WE)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${FILE_WE}_p.c
|
||||
BYPRODUCTS
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${FILE_WE}_i.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${FILE_WE}.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/dlldata.c
|
||||
MAIN_DEPENDENCY ${FILE}
|
||||
COMMAND midl.exe /nologo /target NT100 /x64 /out "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>" /h "${FILE_WE}.h" ${FILE}
|
||||
COMMENT "MIDL ${FILE}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
VERBATIM)
|
||||
endforeach(FILE)
|
||||
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Debug/dlldata.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Release/dlldata.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/dlldata.c
|
||||
PROPERTIES GENERATED TRUE
|
||||
)
|
||||
|
||||
add_library(ConCOMProxy STATIC)
|
||||
set_target_properties(ConCOMProxy PROPERTIES LINKER_LANGUAGE CXX)
|
||||
target_sources(ConCOMProxy
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/ITerminalHandoff_p.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/ITerminalHandoff_i.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/IConsoleHandoff_p.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/IConsoleHandoff_i.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/dlldata.c
|
||||
)
|
||||
|
||||
target_include_directories(ConCOMProxy
|
||||
INTERFACE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>
|
||||
)
|
||||
@@ -18,8 +18,6 @@ Revision History:
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
class Registry
|
||||
{
|
||||
public:
|
||||
|
||||
2
src/interactivity/CMakeLists.txt
Normal file
2
src/interactivity/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(base)
|
||||
add_subdirectory(win32)
|
||||
@@ -1,10 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
namespace Microsoft::Console::Interactivity
|
||||
{
|
||||
enum class ApiLevel
|
||||
|
||||
17
src/interactivity/base/CMakeLists.txt
Normal file
17
src/interactivity/base/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
add_library(ConInteractivityBase)
|
||||
target_sources(ConInteractivityBase
|
||||
PRIVATE
|
||||
ApiDetector.cpp
|
||||
EventSynthesis.cpp
|
||||
HostSignalInputThread.cpp
|
||||
InteractivityFactory.cpp
|
||||
RemoteConsoleControl.cpp
|
||||
ServiceLocator.cpp
|
||||
VtApiRedirection.cpp
|
||||
PseudoConsoleWindowAccessibilityProvider.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConInteractivityBase
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#include "ApiDetector.hpp"
|
||||
|
||||
#include "../inc/IInteractivityFactory.hpp"
|
||||
@@ -12,8 +10,6 @@
|
||||
|
||||
#include <map>
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
namespace Microsoft::Console::Interactivity
|
||||
{
|
||||
class InteractivityFactory final : public IInteractivityFactory
|
||||
|
||||
25
src/interactivity/win32/CMakeLists.txt
Normal file
25
src/interactivity/win32/CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
add_library(ConInteractivityWin32)
|
||||
target_sources(ConInteractivityWin32
|
||||
PRIVATE
|
||||
Clipboard.cpp
|
||||
ConsoleControl.cpp
|
||||
ConsoleInputThread.cpp
|
||||
consoleKeyInfo.cpp
|
||||
find.cpp
|
||||
icon.cpp
|
||||
menu.cpp
|
||||
screenInfoUiaProvider.cpp
|
||||
SystemConfigurationProvider.cpp
|
||||
uiaTextRange.cpp
|
||||
window.cpp
|
||||
windowdpiapi.cpp
|
||||
windowio.cpp
|
||||
WindowMetrics.cpp
|
||||
windowproc.cpp
|
||||
windowUiaProvider.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConInteractivityWin32
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
@@ -12,8 +12,6 @@ Author(s):
|
||||
- Hernan Gatta (HeGatta) 29-Mar-2017
|
||||
--*/
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#include "../inc/IConsoleInputThread.hpp"
|
||||
|
||||
namespace Microsoft::Console::Interactivity::Win32
|
||||
|
||||
@@ -14,8 +14,6 @@ Author(s):
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#include "../inc/ISystemConfigurationProvider.hpp"
|
||||
|
||||
namespace Microsoft::Console::Interactivity::Win32
|
||||
|
||||
@@ -18,8 +18,6 @@ Revision History:
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#include "../../host/screenInfo.hpp"
|
||||
|
||||
namespace Microsoft::Console::Interactivity::Win32
|
||||
|
||||
@@ -16,8 +16,6 @@ Revision History:
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#include "resource.h"
|
||||
|
||||
namespace Microsoft::Console::Interactivity::Win32
|
||||
|
||||
@@ -16,7 +16,6 @@ Author(s):
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
#include "../types/UiaTextRangeBase.hpp"
|
||||
|
||||
namespace Microsoft::Console::Interactivity::Win32
|
||||
|
||||
@@ -19,8 +19,6 @@ Author(s):
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#include <UIAutomationCore.h>
|
||||
#include <wrl/implements.h>
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#include "../../server/ProcessHandle.h"
|
||||
|
||||
#pragma hdrstop
|
||||
|
||||
10
src/internal/CMakeLists.txt
Normal file
10
src/internal/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
add_library(ConInternalStubs)
|
||||
target_sources(ConInternalStubs
|
||||
PRIVATE
|
||||
stubs.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConInternalStubs
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
62
src/propsheet/CMakeLists.txt
Normal file
62
src/propsheet/CMakeLists.txt
Normal file
@@ -0,0 +1,62 @@
|
||||
add_library(console MODULE)
|
||||
target_sources(console
|
||||
PRIVATE
|
||||
ColorControl.cpp
|
||||
ColorsPage.cpp
|
||||
console.cpp
|
||||
dbcs.cpp
|
||||
dll.cpp
|
||||
fontdlg.cpp
|
||||
globals.cpp
|
||||
init.cpp
|
||||
LayoutPage.cpp
|
||||
misc.cpp
|
||||
OptionsPage.cpp
|
||||
preview.cpp
|
||||
PropSheetHandler.cpp
|
||||
registry.cpp
|
||||
TerminalPropsheetPage.cpp
|
||||
util.cpp
|
||||
|
||||
${CMAKE_CURRENT_BINARY_DIR}/strid.h
|
||||
|
||||
console.rc
|
||||
console.def
|
||||
)
|
||||
|
||||
set_property(SOURCE console.rc APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/strid.rc)
|
||||
|
||||
target_include_directories(console
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
../host
|
||||
)
|
||||
|
||||
target_link_libraries(console
|
||||
PRIVATE
|
||||
ConInternalStubs
|
||||
ConPropsLib
|
||||
ConTypes
|
||||
|
||||
onecoreuap_apiset.lib
|
||||
shlwapi.lib
|
||||
)
|
||||
|
||||
target_precompile_headers(console
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
DEPENDS strid.mc
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/strid.rc
|
||||
BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/strid.h
|
||||
COMMAND mc.exe -r "${CMAKE_CURRENT_BINARY_DIR}" -h "${CMAKE_CURRENT_BINARY_DIR}" strid.mc
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS
|
||||
console
|
||||
DESTINATION bin
|
||||
)
|
||||
13
src/propslib/CMakeLists.txt
Normal file
13
src/propslib/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
add_library(ConPropsLib)
|
||||
target_sources(ConPropsLib
|
||||
PRIVATE
|
||||
DelegationConfig.cpp
|
||||
RegistrySerialization.cpp
|
||||
ShortcutSerialization.cpp
|
||||
TrueTypeFontList.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConPropsLib
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#pragma once
|
||||
|
||||
#define DEFINE_CONSOLEV2_PROPERTIES
|
||||
#define INC_OLE2
|
||||
|
||||
|
||||
3
src/renderer/CMakeLists.txt
Normal file
3
src/renderer/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(base)
|
||||
add_subdirectory(gdi)
|
||||
add_subdirectory(atlas)
|
||||
52
src/renderer/atlas/CMakeLists.txt
Normal file
52
src/renderer/atlas/CMakeLists.txt
Normal file
@@ -0,0 +1,52 @@
|
||||
add_library(ConRenderAtlas)
|
||||
|
||||
target_include_directories(ConRenderAtlas
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>
|
||||
)
|
||||
|
||||
target_sources(ConRenderAtlas
|
||||
PRIVATE
|
||||
AtlasEngine.api.cpp
|
||||
AtlasEngine.cpp
|
||||
AtlasEngine.r.cpp
|
||||
Backend.cpp
|
||||
BackendD2D.cpp
|
||||
BackendD3D.cpp
|
||||
BuiltinGlyphs.cpp
|
||||
dwrite_helpers.cpp
|
||||
DWriteTextAnalysis.cpp
|
||||
stb_rect_pack.cpp
|
||||
wic.cpp
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/shader_vs.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/shader_ps.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/custom_shader_vs.h
|
||||
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/custom_shader_ps.h
|
||||
)
|
||||
|
||||
target_precompile_headers(ConRenderAtlas
|
||||
PRIVATE
|
||||
pch.h
|
||||
)
|
||||
|
||||
set(HLSL_SHADER_FILES shader_vs.hlsl shader_ps.hlsl custom_shader_ps.hlsl custom_shader_vs.hlsl)
|
||||
|
||||
set_source_files_properties(shader_vs.hlsl PROPERTIES ShaderType "vs")
|
||||
set_source_files_properties(shader_ps.hlsl PROPERTIES ShaderType "ps")
|
||||
set_source_files_properties(custom_shader_vs.hlsl PROPERTIES ShaderType "vs")
|
||||
set_source_files_properties(custom_shader_ps.hlsl PROPERTIES ShaderType "ps")
|
||||
set_source_files_properties(${HLSL_SHADER_FILES} PROPERTIES ShaderModel "4_0")
|
||||
|
||||
foreach(FILE ${HLSL_SHADER_FILES})
|
||||
get_filename_component(FILE_WE ${FILE} NAME_WE)
|
||||
get_source_file_property(shadertype ${FILE} ShaderType)
|
||||
get_source_file_property(shadermodel ${FILE} ShaderModel)
|
||||
add_custom_command(
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${FILE_WE}.h
|
||||
COMMAND fxc.exe /nologo /Emain /Vn${FILE_WE} /Zi /T${shadertype}_${shadermodel} $<IF:$<CONFIG:DEBUG>,/Od,/O3> /Zsb /Fh ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${FILE_WE}.h /Fd ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${FILE_WE}.pdb ${FILE}
|
||||
MAIN_DEPENDENCY ${FILE}
|
||||
COMMENT "HLSL ${FILE}"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
VERBATIM
|
||||
)
|
||||
endforeach(FILE)
|
||||
17
src/renderer/base/CMakeLists.txt
Normal file
17
src/renderer/base/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
add_library(ConRenderBase)
|
||||
target_sources(ConRenderBase
|
||||
PRIVATE
|
||||
CSSLengthPercentage.cpp
|
||||
fontinfo.cpp
|
||||
FontInfoBase.cpp
|
||||
FontInfoDesired.cpp
|
||||
FontResource.cpp
|
||||
RenderEngineBase.cpp
|
||||
renderer.cpp
|
||||
RenderSettings.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConRenderBase
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
13
src/renderer/gdi/CMakeLists.txt
Normal file
13
src/renderer/gdi/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
add_library(ConRenderGdi)
|
||||
target_sources(ConRenderGdi
|
||||
PRIVATE
|
||||
invalidate.cpp
|
||||
math.cpp
|
||||
paint.cpp
|
||||
state.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConRenderGdi
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
@@ -10,6 +10,7 @@ Abstract:
|
||||
- Avoid including internal project headers. Instead include them only in the classes that need them (helps with test project building).
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
#include <cwchar>
|
||||
#include <sal.h>
|
||||
|
||||
|
||||
34
src/server/CMakeLists.txt
Normal file
34
src/server/CMakeLists.txt
Normal file
@@ -0,0 +1,34 @@
|
||||
add_library(ConServer)
|
||||
target_sources(ConServer
|
||||
PRIVATE
|
||||
ApiDispatchers.cpp
|
||||
ApiDispatchersInternal.cpp
|
||||
ApiMessage.cpp
|
||||
ApiMessageState.cpp
|
||||
ApiSorter.cpp
|
||||
ConDrvDeviceComm.cpp
|
||||
ConsoleShimPolicy.cpp
|
||||
DeviceHandle.cpp
|
||||
Entrypoints.cpp
|
||||
IoDispatchers.cpp
|
||||
IoSorter.cpp
|
||||
ObjectHandle.cpp
|
||||
ObjectHeader.cpp
|
||||
ProcessHandle.cpp
|
||||
ProcessList.cpp
|
||||
ProcessPolicy.cpp
|
||||
WaitBlock.cpp
|
||||
WaitQueue.cpp
|
||||
WinNTControl.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConServer
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
|
||||
# We need the interface import for ConCOMProxy to get the MIDL header path
|
||||
target_link_libraries(ConServer
|
||||
PRIVATE
|
||||
ConCOMProxy
|
||||
)
|
||||
3
src/terminal/CMakeLists.txt
Normal file
3
src/terminal/CMakeLists.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(adapter)
|
||||
add_subdirectory(input)
|
||||
add_subdirectory(parser)
|
||||
17
src/terminal/adapter/CMakeLists.txt
Normal file
17
src/terminal/adapter/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
add_library(ConTermAdapt)
|
||||
target_sources(ConTermAdapt
|
||||
PRIVATE
|
||||
adaptDispatch.cpp
|
||||
adaptDispatchGraphics.cpp
|
||||
FontBuffer.cpp
|
||||
MacroBuffer.cpp
|
||||
InteractDispatch.cpp
|
||||
PageManager.cpp
|
||||
SixelParser.cpp
|
||||
terminalOutput.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConTermAdapt
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
11
src/terminal/input/CMakeLists.txt
Normal file
11
src/terminal/input/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
add_library(ConTermInput)
|
||||
target_sources(ConTermInput
|
||||
PRIVATE
|
||||
mouseInput.cpp
|
||||
terminalInput.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConTermInput
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
14
src/terminal/parser/CMakeLists.txt
Normal file
14
src/terminal/parser/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
add_library(ConTermParser)
|
||||
target_sources(ConTermParser
|
||||
PRIVATE
|
||||
base64.cpp
|
||||
InputStateMachineEngine.cpp
|
||||
OutputStateMachineEngine.cpp
|
||||
stateMachine.cpp
|
||||
tracing.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConTermParser
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
11
src/tsf/CMakeLists.txt
Normal file
11
src/tsf/CMakeLists.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
add_library(ConTSF)
|
||||
target_sources(ConTSF
|
||||
PRIVATE
|
||||
Handle.cpp
|
||||
Implementation.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConTSF
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
23
src/types/CMakeLists.txt
Normal file
23
src/types/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
add_library(ConTypes)
|
||||
target_sources(ConTypes
|
||||
PRIVATE
|
||||
CodepointWidthDetector.cpp
|
||||
ColorFix.cpp
|
||||
colorTable.cpp
|
||||
convert.cpp
|
||||
GlyphWidth.cpp
|
||||
ScreenInfoUiaProviderBase.cpp
|
||||
sgrStack.cpp
|
||||
TermControlUiaProvider.cpp
|
||||
TermControlUiaTextRange.cpp
|
||||
ThemeUtils.cpp
|
||||
UiaTextRangeBase.cpp
|
||||
UiaTracing.cpp
|
||||
utils.cpp
|
||||
viewport.cpp
|
||||
)
|
||||
|
||||
target_precompile_headers(ConTypes
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
23
src/winconpty/CMakeLists.txt
Normal file
23
src/winconpty/CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
add_library(conpty SHARED)
|
||||
target_sources(conpty
|
||||
PRIVATE
|
||||
winconpty.cpp
|
||||
../server/DeviceHandle.cpp
|
||||
../server/WinNTControl.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(conpty
|
||||
PRIVATE
|
||||
onecoreuap_apiset.lib
|
||||
)
|
||||
|
||||
target_precompile_headers(conpty
|
||||
PRIVATE
|
||||
precomp.h
|
||||
)
|
||||
|
||||
install(
|
||||
TARGETS
|
||||
conpty
|
||||
DESTINATION lib
|
||||
)
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// Licensed under the MIT license.
|
||||
|
||||
#include "precomp.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
|
||||
"dependencies": [
|
||||
"fmt",
|
||||
"ms-gsl"
|
||||
"ms-gsl",
|
||||
"wil"
|
||||
],
|
||||
"features": {
|
||||
"terminal": {
|
||||
|
||||
Reference in New Issue
Block a user