diff options
author | midipix <writeonce@midipix.org> | 2016-07-15 05:07:59 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-07-21 03:47:28 -0400 |
commit | 72c4b0c8c5aa2ce3e47d4f335d2de055a33ecfe0 (patch) | |
tree | 3d535bf75479472c7b2409910265c43d195fbe00 | |
parent | f23497da9ffe02a44b9896aa5f6a5fd029939fd8 (diff) | |
download | ptycon-72c4b0c8c5aa2ce3e47d4f335d2de055a33ecfe0.tar.bz2 ptycon-72c4b0c8c5aa2ce3e47d4f335d2de055a33ecfe0.tar.xz |
daemon: added ptyc_daemon_connect().
-rw-r--r-- | project/common.mk | 1 | ||||
-rw-r--r-- | src/daemon/ptyc_daemon_connect.c | 27 |
2 files changed, 28 insertions, 0 deletions
diff --git a/project/common.mk b/project/common.mk index 838a6bb..a5c1120 100644 --- a/project/common.mk +++ b/project/common.mk @@ -7,6 +7,7 @@ COMMON_SRCS = \ src/console/ptyc_console_poller.c \ src/console/ptyc_console_reader.c \ src/console/ptyc_console_writer.c \ + src/daemon/ptyc_daemon_connect.c \ src/daemon/ptyc_daemon_init.c \ src/daemon/ptyc_daemon_loop.c \ src/debug/ptyc_dbg_cat.c \ diff --git a/src/daemon/ptyc_daemon_connect.c b/src/daemon/ptyc_daemon_connect.c new file mode 100644 index 0000000..82626b8 --- /dev/null +++ b/src/daemon/ptyc_daemon_connect.c @@ -0,0 +1,27 @@ +/*********************************************************/ +/* ptycon: a pty-console bridge */ +/* Copyright (C) 2016 Z. Gilboa */ +/* Released under GPLv2 and GPLv3; see COPYING.PTYCON. */ +/*********************************************************/ + +#include <psxtypes/psxtypes.h> +#include <ntapi/ntapi.h> + +#include <ptycon/ptycon.h> +#include "ptycon_daemon_impl.h" +#include "ptycon_driver_impl.h" + +int32_t __stdcall ptyc_daemon_connect(nt_tty_port_msg * msg) +{ + void * hport = 0; + + msg->ttyinfo.reserved = 0; + + ntapi->zw_accept_connect_port( + &hport, + msg->header.client_id.process_id, + &msg->header, + NT_LPC_ACCEPT_CONNECTION,0,0); + + return ntapi->zw_complete_connect_port(hport); +} |