Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2019-09-06 16:01:27 +0300
committerKen Brown <kbrown@cornell.edu>2019-09-06 19:31:17 +0300
commitf39a694c463c1a1ea14e60f5d03652d94e6f76ee (patch)
tree2bf67d68b99ddd7f4509a11d93f27efe8a6edfac
parent46d3953d644bd7381c9cc3231b4826c018c51b90 (diff)
Cygwin: pty: Make SetConsoleCursorPosition() to be hooked.
- Win32 API SetConsoleCursorPosition() injects ANSI escape sequence to pseudo console. Therefore, it should be added to the API list to be hooked.
-rw-r--r--winsup/cygwin/fhandler_tty.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
index 2533e5618..3ffd64e21 100644
--- a/winsup/cygwin/fhandler_tty.cc
+++ b/winsup/cygwin/fhandler_tty.cc
@@ -156,6 +156,7 @@ DEF_HOOK (WriteConsoleOutputW);
DEF_HOOK (WriteConsoleOutputCharacterA);
DEF_HOOK (WriteConsoleOutputCharacterW);
DEF_HOOK (WriteConsoleOutputAttribute);
+DEF_HOOK (SetConsoleCursorPosition);
DEF_HOOK (SetConsoleTextAttribute);
DEF_HOOK (WriteConsoleInputA);
DEF_HOOK (WriteConsoleInputW);
@@ -242,6 +243,13 @@ WriteConsoleOutputAttribute_Hooked
return WriteConsoleOutputAttribute_Orig (h, a, l, c, n);
}
static BOOL WINAPI
+SetConsoleCursorPosition_Hooked
+ (HANDLE h, COORD c)
+{
+ set_ishybrid_and_switch_to_pcon (h);
+ return SetConsoleCursorPosition_Orig (h, c);
+}
+static BOOL WINAPI
SetConsoleTextAttribute_Hooked
(HANDLE h, WORD a)
{
@@ -2952,6 +2960,7 @@ fhandler_pty_slave::fixup_after_exec ()
DO_HOOK (NULL, WriteConsoleOutputCharacterA);
DO_HOOK (NULL, WriteConsoleOutputCharacterW);
DO_HOOK (NULL, WriteConsoleOutputAttribute);
+ DO_HOOK (NULL, SetConsoleCursorPosition);
DO_HOOK (NULL, SetConsoleTextAttribute);
DO_HOOK (NULL, WriteConsoleInputA);
DO_HOOK (NULL, WriteConsoleInputW);