--- Win9xConHook.c.old	Wed Feb 14 14:22:08 2001
+++ Win9xConHook.c	Thu Sep 13 20:06:48 2001
@@ -261,6 +261,48 @@
     return FALSE;
 }
 
+/*  Exported function that creates a Win9x 'service' via a hidden window,
+ *  that notifies the process via the HandlerRoutine messages.
+ */
+BOOL __declspec(dllexport) WINAPI Windows9xServiceCtrl2Handler(
+        PHANDLER_ROUTINE phandler,
+        LPCSTR name,
+        LPHANDLE pthread,
+        LPDWORD  ptid)
+{
+    /* If we have not yet done so */
+    FreeConsole();
+
+    if (name)
+    {
+        HANDLE hThread;
+        /* NOTE: this is static so the module can continue to
+         * access these args while we go on to other things
+         */
+        static tty_info tty;
+        tty.instance = GetModuleHandle(NULL);
+        tty.phandler = phandler;
+        tty.parent = NULL;
+        tty.name = name;
+        tty.type = 2;
+        RegisterWindows9xService(TRUE);
+        hThread = CreateThread(NULL, 0, ttyConsoleCtrlThread,
+                               (LPVOID)&tty, 0, ptid);
+        if (hThread)
+        {
+            *pthread = hThread;
+            return TRUE;
+        }
+    }
+    else /* remove */
+    {
+        if (monitor_hwnd)
+            SendMessage(monitor_hwnd, WM_DESTROY, 0, 0);
+        RegisterWindows9xService(FALSE);
+        return TRUE;
+    }
+    return FALSE;
+}
 
 /*  Exported function that registers a HandlerRoutine to accept missing
  *  Win9x CTRL_EVENTs from the tty window, as NT does without a hassle.
