diff options
author | midipix <writeonce@midipix.org> | 2016-07-15 06:07:42 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-07-21 03:47:29 -0400 |
commit | cc2a484a8cd35d2d9bd2d4cade73386e87726b5b (patch) | |
tree | 6e1156d5448b4295e2fcf611db969a52545fbd9e | |
parent | 08072c290b4578eed984f10122dd0894ffefed11 (diff) | |
download | ptycon-cc2a484a8cd35d2d9bd2d4cade73386e87726b5b.tar.bz2 ptycon-cc2a484a8cd35d2d9bd2d4cade73386e87726b5b.tar.xz |
daemon: added controlling terminal signal delivery initialization logic.
-rw-r--r-- | src/daemon/ptyc_daemon_init.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/daemon/ptyc_daemon_init.c b/src/daemon/ptyc_daemon_init.c index c7fa5eb..b8d1170 100644 --- a/src/daemon/ptyc_daemon_init.c +++ b/src/daemon/ptyc_daemon_init.c @@ -14,7 +14,7 @@ static const nt_guid ptyc_daemon_guid = PTYC_PORT_GUID_DAEMON; -static int32_t ptyc_daemon_init_impl(struct ptyc_daemon_ctx * dctx) +static int32_t ptyc_daemon_init_impl(struct ptyc_daemon_ctx * dctx, void * htty) { int32_t status; nt_daemon_params dparams; @@ -66,7 +66,14 @@ static int32_t ptyc_daemon_init_impl(struct ptyc_daemon_ctx * dctx) dparams.stack_size_commit = 8192; dparams.stack_size_reserve = 8192; - return ntapi->dsr_init(&dparams); + if ((status = ntapi->dsr_init(&dparams))) + return status; + + return ntapi->tty_request_peer( + htty, + PTYC_DAEMON_TTYSIGNAL, + 0,&(nt_guid)TTY_PTS_GUID, + &dctx->daemon_attr); } static int32_t ptyc_daemon_once = 0; @@ -92,7 +99,7 @@ int32_t __stdcall ptyc_daemon_init(struct ptyc_daemon_ctx * dctx, uint64_t drvfl /* once */ switch (at_locked_cas_32(&ptyc_daemon_once,0,1)) { case 0: - if ((status = ptyc_daemon_init_impl(dctx))) { + if ((status = ptyc_daemon_init_impl(dctx,rtdata->hsession))) { at_locked_add_32(&ptyc_daemon_once,2); return status; } |