summaryrefslogtreecommitdiffhomepage
path: root/src/pty
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-01-01 18:39:21 +0000
committermidipix <writeonce@midipix.org>2017-01-07 09:02:19 -0500
commit47aaf28e9060c837e3c0d3a7ac009c434f95eda7 (patch)
treea1858207244d2da4c576d185836f096fd22e75d3 /src/pty
parente47608b7ec59407d5bca7def446137b41e54ee64 (diff)
downloadntapi-47aaf28e9060c837e3c0d3a7ac009c434f95eda7.tar.bz2
ntapi-47aaf28e9060c837e3c0d3a7ac009c434f95eda7.tar.xz
pty interfaces: added __ntapi_pty_open_pair().
Diffstat (limited to 'src/pty')
-rw-r--r--src/pty/ntapi_pty_fd.c51
1 files changed, 45 insertions, 6 deletions
diff --git a/src/pty/ntapi_pty_fd.c b/src/pty/ntapi_pty_fd.c
index 3071482..b35804e 100644
--- a/src/pty/ntapi_pty_fd.c
+++ b/src/pty/ntapi_pty_fd.c
@@ -167,14 +167,15 @@ static int32_t __ntapi_pty_connect(
}
-int32_t __stdcall __ntapi_pty_open(
+static int32_t __ntapi_pty_open_impl(
void * hport,
nt_pty ** pty,
uint32_t desired_access,
nt_object_attributes* obj_attr,
nt_iosb * iosb,
uint32_t share_access,
- uint32_t open_options)
+ uint32_t open_options,
+ nt_pty * rpty)
{
int32_t status;
nt_guid guid;
@@ -221,10 +222,12 @@ int32_t __stdcall __ntapi_pty_open(
ctx->options = open_options;
/* pts */
- if (obj_attr->root_dir) {
- ctx->hpty = ((nt_pty *)obj_attr->root_dir)->hpty;
- ctx->luid.high = ((nt_pty *)obj_attr->root_dir)->luid.high;
- ctx->luid.low = ((nt_pty *)obj_attr->root_dir)->luid.low;
+ if (rpty) {
+ ctx->hpty = rpty->hpty;
+ ctx->luid.high = rpty->luid.high;
+ ctx->luid.low = rpty->luid.low;
+ } else {
+ ctx->hpty = obj_attr->root_dir;
}
if ((status = __ntapi_pty_connect(hport,ctx,iosb)))
@@ -235,6 +238,42 @@ int32_t __stdcall __ntapi_pty_open(
return NT_STATUS_SUCCESS;
}
+int32_t __stdcall __ntapi_pty_open(
+ void * hport,
+ nt_pty ** pty,
+ uint32_t desired_access,
+ nt_object_attributes* obj_attr,
+ nt_iosb * iosb,
+ uint32_t share_access,
+ uint32_t open_options)
+{
+ return __ntapi_pty_open_impl(
+ hport,pty,
+ desired_access,
+ obj_attr,iosb,
+ share_access,
+ open_options,
+ (nt_pty *)obj_attr->root_dir);
+}
+
+int32_t __stdcall __ntapi_pty_open_pair(
+ void * hport,
+ nt_pty ** pty,
+ uint32_t desired_access,
+ nt_object_attributes* obj_attr,
+ nt_iosb * iosb,
+ uint32_t share_access,
+ uint32_t open_options)
+{
+ return __ntapi_pty_open_impl(
+ hport,pty,
+ desired_access,
+ obj_attr,iosb,
+ share_access,
+ open_options,
+ 0);
+}
+
int32_t __stdcall __ntapi_pty_inherit(
__in void * hport,
__out nt_pty ** pty,