return 0;
}
+static void hook_conemu_cygwin_connector();
+
int
fhandler_console::open (int flags, mode_t)
{
if (myself->pid == con.owner)
{
+ if (GetModuleHandle ("ConEmuHk64.dll"))
+ hook_conemu_cygwin_connector ();
char name[MAX_PATH];
shared_name (name, CONS_THREAD_SYNC, get_minor ());
thread_sync_event = CreateEvent(NULL, FALSE, FALSE, name);
DEF_HOOK (CreateProcessA);
DEF_HOOK (CreateProcessW);
DEF_HOOK (ContinueDebugEvent);
+DEF_HOOK (LoadLibraryA); /* Hooked for ConEmu cygwin connector */
static BOOL WINAPI
CreateProcessA_Hooked
return ContinueDebugEvent_Orig (p, t, s);
}
+/* Hooked for ConEmu cygwin connector */
+static HMODULE WINAPI
+LoadLibraryA_Hooked (LPCSTR m)
+{
+ const char *p;
+ if ((p = strrchr(m, '\\')))
+ p++;
+ else
+ p = m;
+ if (strcasecmp(p, "ConEmuHk64.dll") == 0)
+ fhandler_console::set_disable_master_thread (true);
+ return LoadLibraryA_Orig (m);
+}
+
void
fhandler_console::fixup_after_fork_exec (bool execing)
{
DO_HOOK (NULL, ContinueDebugEvent);
}
+static void
+hook_conemu_cygwin_connector()
+{
+ DO_HOOK (NULL, LoadLibraryA);
+}
+
/* Ugly workaround to create invisible console required since Windows 7.
First try to just attach to any console which may have started this