diff options
Diffstat (limited to 'src/pty/ntapi_pty_fd.c')
-rw-r--r-- | src/pty/ntapi_pty_fd.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/pty/ntapi_pty_fd.c b/src/pty/ntapi_pty_fd.c index ee0b426..bb7e77e 100644 --- a/src/pty/ntapi_pty_fd.c +++ b/src/pty/ntapi_pty_fd.c @@ -213,6 +213,51 @@ int32_t __stdcall __ntapi_pty_open( return NT_STATUS_SUCCESS; } +int32_t __stdcall __ntapi_pty_inherit( + __in void * hport, + __out nt_pty ** pty, + __in nt_pty_client_info * client_info) +{ + int32_t status; + nt_iosb iosb; + nt_pty_inherit_info inherit; + nt_pty * ctx; + + inherit.any[0] = client_info->any[0]; + inherit.any[1] = client_info->any[1]; + inherit.any[2] = client_info->any[2]; + inherit.any[3] = client_info->any[3]; + + if ((status = __ntapi_pty_query( + hport,&iosb, + &inherit,sizeof(inherit), + NT_PTY_INHERIT_INFORMATION))) + return status; + + /* control block */ + if ((status = __ntapi_pty_alloc(&ctx))) + return status; + + __ntapi_tt_guid_copy( + &ctx->guid, + &inherit.guid); + + ctx->access = inherit.access; + ctx->flags = inherit.flags; + ctx->share = inherit.share; + ctx->options = inherit.options; + + ctx->luid.low = inherit.luid.low; + ctx->luid.high = inherit.luid.high; + + if ((status = __ntapi_pty_connect(hport,ctx,&iosb))) + return status; + + *pty = ctx; + + return NT_STATUS_SUCCESS; +} + int32_t __stdcall __ntapi_pty_reopen( __in void * hport, __in nt_pty * pty) |