summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-08-21 07:56:25 -0400
committermidipix <writeonce@midipix.org>2016-08-22 09:00:53 -0400
commit2bdcda2e64180f27c8555520d69dec7ecdc1c1cc (patch)
tree1551a06f3dab7f53854a113f2eac5ca1e829a74c
parent2ded43b586991998e22151d0902b85ca9ba75373 (diff)
downloadptycon-2bdcda2e64180f27c8555520d69dec7ecdc1c1cc.tar.bz2
ptycon-2bdcda2e64180f27c8555520d69dec7ecdc1c1cc.tar.xz
pty layer: integrated __ntapi_pty_inherit_runtime_ctty().
-rw-r--r--src/pty/ptyc_spawn.c23
-rw-r--r--src/ptycon.c30
2 files changed, 26 insertions, 27 deletions
diff --git a/src/pty/ptyc_spawn.c b/src/pty/ptyc_spawn.c
index f4f026b..f94af2d 100644
--- a/src/pty/ptyc_spawn.c
+++ b/src/pty/ptyc_spawn.c
@@ -74,10 +74,25 @@ int __stdcall ptyc_spawn(struct ptyc_driver_ctx * dctx)
rtctx.stdout_type = NT_FILE_TYPE_PTY;
rtctx.stderr_type = NT_FILE_TYPE_PTY;
- rtctx.ptyany[0] = clctx->clinfo.any[0];
- rtctx.ptyany[1] = clctx->clinfo.any[1];
- rtctx.ptyany[2] = clctx->clinfo.any[2];
- rtctx.ptyany[3] = clctx->clinfo.any[3];
+ rtctx.ptyin [0] = clctx->clinfo.any[0];
+ rtctx.ptyin [1] = clctx->clinfo.any[1];
+ rtctx.ptyin [2] = clctx->clinfo.any[2];
+ rtctx.ptyin [3] = clctx->clinfo.any[3];
+
+ rtctx.ptyout[0] = clctx->clinfo.any[0];
+ rtctx.ptyout[1] = clctx->clinfo.any[1];
+ rtctx.ptyout[2] = clctx->clinfo.any[2];
+ rtctx.ptyout[3] = clctx->clinfo.any[3];
+
+ rtctx.ptyerr[0] = clctx->clinfo.any[0];
+ rtctx.ptyerr[1] = clctx->clinfo.any[1];
+ rtctx.ptyerr[2] = clctx->clinfo.any[2];
+ rtctx.ptyerr[3] = clctx->clinfo.any[3];
+
+ rtctx.ptyctl[0] = clctx->clinfo.any[0];
+ rtctx.ptyctl[1] = clctx->clinfo.any[1];
+ rtctx.ptyctl[2] = clctx->clinfo.any[2];
+ rtctx.ptyctl[3] = clctx->clinfo.any[3];
/* hoppla */
if ((status = ntapi->tt_spawn_native_process(&sparams)))
diff --git a/src/ptycon.c b/src/ptycon.c
index 5c8fe76..20a9aa8 100644
--- a/src/ptycon.c
+++ b/src/ptycon.c
@@ -46,7 +46,6 @@ static int32_t ptycon_start(int argc, char ** argv, char ** envp)
nt_runtime_data * rtdata;
nt_port_attr port_attr;
nt_pty_client_info client_info;
- nt_pty * hpty;
nt_iosb iosb;
/* rtdata */
@@ -100,35 +99,20 @@ static int32_t ptycon_start(int argc, char ** argv, char ** envp)
return status;
/* pty */
- client_info.any[0] = rtdata->ptyany[0];
- client_info.any[1] = rtdata->ptyany[1];
- client_info.any[2] = rtdata->ptyany[2];
- client_info.any[3] = rtdata->ptyany[3];
-
- status = ntapi->pty_inherit(
- rtdata->hsession,
- &hpty,
- &client_info);
-
- /* ntaio */
- if (status == NT_STATUS_SUCCESS) {
- if (rtdata->stdin_type == NT_FILE_TYPE_PTY)
- rtdata->hstdin = hpty;
-
- if (rtdata->stdout_type == NT_FILE_TYPE_PTY)
- rtdata->hstdout = hpty;
-
- if (rtdata->stderr_type == NT_FILE_TYPE_PTY)
- rtdata->hstderr = hpty;
+ if ((status = ntapi->pty_inherit_runtime_ctty(
+ rtdata->hsession,
+ rtdata)))
+ return status;
- /* ctty identification */
+ /* ctty identification */
+ if (rtdata->hctty) {
client_info.any[0] = 0;
client_info.any[1] = 0;
client_info.any[2] = 0;
client_info.any[3] = 0;
if ((status = ntapi->pty_set(
- hpty,&iosb,
+ rtdata->hctty,&iosb,
&client_info,sizeof(client_info),
NT_PTY_CLIENT_INFORMATION)))
return status;