diff options
author | midipix <writeonce@midipix.org> | 2018-06-16 22:25:29 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-06-16 18:35:55 -0400 |
commit | e62c29643298bda31ab5f1111eed11862f7324bc (patch) | |
tree | f44dc14f94ae390cc6df2b0f8e0a195f754ff21e /src/pty/ntapi_pty_query.c | |
parent | c4fe1edd2cc367994ea57a0ab8f3e870db9e6bec (diff) | |
download | ntapi-e62c29643298bda31ab5f1111eed11862f7324bc.tar.bz2 ntapi-e62c29643298bda31ab5f1111eed11862f7324bc.tar.xz |
pty query: client-side interfaces: revised and extended for api consistency.
Diffstat (limited to 'src/pty/ntapi_pty_query.c')
-rw-r--r-- | src/pty/ntapi_pty_query.c | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/pty/ntapi_pty_query.c b/src/pty/ntapi_pty_query.c index 72b3b31..329516a 100644 --- a/src/pty/ntapi_pty_query.c +++ b/src/pty/ntapi_pty_query.c @@ -22,11 +22,13 @@ int32_t __stdcall __ntapi_pty_query( void * hport; nt_pty_sigctl_msg msg; uintptr_t * info; - nt_pty_inherit_info * inherit; if (pty_info_class>=NT_PTY_INFORMATION_CAP) return NT_STATUS_INVALID_INFO_CLASS; + if (pty_info_class == NT_PTY_INHERIT_INFORMATION) + return NT_STATUS_CONTEXT_MISMATCH; + if (pty_info_class == NT_PTY_BASIC_INFORMATION) return NT_STATUS_NOT_IMPLEMENTED; @@ -34,10 +36,6 @@ int32_t __stdcall __ntapi_pty_query( if (pty_info_length < sizeof(nt_pty_client_info)) return NT_STATUS_INVALID_PARAMETER; - if (pty_info_class == NT_PTY_INHERIT_INFORMATION) - if (pty_info_length != sizeof(nt_pty_inherit_info)) - return NT_STATUS_INVALID_PARAMETER; - __ntapi->tt_aligned_block_memset( &msg,0,sizeof(msg)); @@ -57,17 +55,6 @@ int32_t __stdcall __ntapi_pty_query( &msg.data.ctlinfo.guid, &pty->guid); - } else if (pty_info_class == NT_PTY_INHERIT_INFORMATION) { - msg.data.ctlinfo.hpty = NT_INVALID_HANDLE_VALUE; - msg.data.ctlinfo.ctlcode = pty_info_class; - - inherit = (nt_pty_inherit_info *)pty_info; - msg.data.ctlinfo.ctxarg[0] = inherit->any[0]; - msg.data.ctlinfo.ctxarg[1] = inherit->any[1]; - msg.data.ctlinfo.ctxarg[2] = inherit->any[2]; - msg.data.ctlinfo.ctxarg[3] = inherit->any[3]; - - hport = pty ? pty : __ntapi_internals()->hport_tty_session; } else { return NT_STATUS_INVALID_INFO_CLASS; } @@ -88,20 +75,6 @@ int32_t __stdcall __ntapi_pty_query( info[2] = msg.data.ctlinfo.ctxarg[2]; info[3] = msg.data.ctlinfo.ctxarg[3]; - } else if (pty_info_class == NT_PTY_INHERIT_INFORMATION) { - inherit = (nt_pty_inherit_info *)pty_info; - inherit->hpty = msg.data.ctlinfo.hpty; - inherit->luid.low = msg.data.ctlinfo.luid.low; - inherit->luid.high = msg.data.ctlinfo.luid.high; - - inherit->access = (uint32_t)msg.data.ctlinfo.ctxarg[0]; - inherit->flags = (uint32_t)msg.data.ctlinfo.ctxarg[1]; - inherit->share = (uint32_t)msg.data.ctlinfo.ctxarg[2]; - inherit->options = (uint32_t)msg.data.ctlinfo.ctxarg[3]; - - __ntapi->tt_guid_copy( - &inherit->guid, - &msg.data.ctlinfo.guid); } return NT_STATUS_SUCCESS; |