diff options
author | Takashi Yano <takashi.yano@nifty.ne.jp> | 2022-08-02 07:42:53 +0900 |
---|---|---|
committer | Takashi Yano <takashi.yano@nifty.ne.jp> | 2022-08-02 07:42:53 +0900 |
commit | 7a469e6dd5e211a9bc7697e9330513edad8f2690 (patch) | |
tree | 5bef86c50e1bba35d91694c0c8376afe5fe17459 /winsup | |
parent | 2b4f986e499f040966be72516dae5b01ef721d24 (diff) | |
download | newlib-7a469e6dd5e211a9bc7697e9330513edad8f2690.zip newlib-7a469e6dd5e211a9bc7697e9330513edad8f2690.tar.gz newlib-7a469e6dd5e211a9bc7697e9330513edad8f2690.tar.bz2 |
Cygwin: console: Modify ConEmu cygwin connector hook.
- Previously, LoadLibraryA() is hooked for ConEmu cygwin connector.
With this patch, GetProcAddress() for "RequestTermConnector" is
hooked instead which is more essential for ConEmu cygwin connector.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/fhandler_console.cc | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 41b3fd6..b5594a6 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -3988,7 +3988,7 @@ fhandler_console::set_console_mode_to_native () DEF_HOOK (CreateProcessA); DEF_HOOK (CreateProcessW); DEF_HOOK (ContinueDebugEvent); -DEF_HOOK (LoadLibraryA); /* Hooked for ConEmu cygwin connector */ +DEF_HOOK (GetProcAddress); /* Hooked for ConEmu cygwin connector */ static BOOL WINAPI CreateProcessA_Hooked @@ -4031,21 +4031,12 @@ ContinueDebugEvent_Hooked } /* Hooked for ConEmu cygwin connector */ -static HMODULE WINAPI -LoadLibraryA_Hooked (LPCSTR m) +static FARPROC WINAPI +GetProcAddress_Hooked (HMODULE h, LPCSTR n) { - const char *p; - if ((p = strrchr(m, '\\'))) - p++; - else - p = m; -#ifdef __x86_64__ - if (strcasecmp(p, "ConEmuHk64.dll") == 0) -#else - if (strcasecmp(p, "ConEmuHk.dll") == 0) -#endif + if (strcmp(n, "RequestTermConnector") == 0) fhandler_console::set_disable_master_thread (true); - return LoadLibraryA_Orig (m); + return GetProcAddress_Orig (h, n); } void @@ -4074,7 +4065,7 @@ fhandler_console::fixup_after_fork_exec (bool execing) static void hook_conemu_cygwin_connector() { - DO_HOOK (NULL, LoadLibraryA); + DO_HOOK (NULL, GetProcAddress); } // #define WINSTA_ACCESS (WINSTA_READATTRIBUTES | STANDARD_RIGHTS_READ | STANDARD_RIGHTS_WRITE | WINSTA_CREATEDESKTOP | WINSTA_EXITWINDOWS) |