summaryrefslogtreecommitdiffhomepage
path: root/src/tty
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-07-30 21:21:21 +0000
committermidipix <writeonce@midipix.org>2017-07-31 08:43:35 -0400
commit171c2d6c66d9e8bce81a17ca925a7a8c979cb33e (patch)
tree4c655c17eb2078d4066f9ef521fff0a20cf0000e /src/tty
parent6d572660b22e7ef9b07b2b380aca88fa949127b3 (diff)
downloadntapi-171c2d6c66d9e8bce81a17ca925a7a8c979cb33e.tar.bz2
ntapi-171c2d6c66d9e8bce81a17ca925a7a8c979cb33e.tar.xz
subsystem interfaces: set port type from guid when creating a server instance.
Diffstat (limited to 'src/tty')
-rw-r--r--src/tty/ntapi_tty_create_session.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/tty/ntapi_tty_create_session.c b/src/tty/ntapi_tty_create_session.c
index 9e39ee1..0c0a4fb 100644
--- a/src/tty/ntapi_tty_create_session.c
+++ b/src/tty/ntapi_tty_create_session.c
@@ -60,9 +60,20 @@ int32_t __stdcall __ntapi_tty_create_session(
__ntapi->tt_aligned_block_memset(
&ssattr,0,sizeof(ssattr));
+ /* port type */
+ if (guid) {
+ if ((status = __ntapi->tt_port_type_from_guid(
+ &port_attr.type,
+ &port_attr.subtype,
+ guid)))
+ return status;
+ } else {
+ port_attr.type = NT_PORT_TYPE_SUBSYSTEM;
+ }
+
+ /* port subtype */
switch (type) {
case NT_TTY_SESSION_PRIMARY:
- port_attr.type = NT_PORT_TYPE_SUBSYSTEM;
port_attr.subtype = NT_PORT_SUBTYPE_DEFAULT;
if (!hport)
@@ -74,7 +85,6 @@ int32_t __stdcall __ntapi_tty_create_session(
break;
case NT_TTY_SESSION_SECONDARY:
- port_attr.type = NT_PORT_TYPE_SUBSYSTEM;
port_attr.subtype = NT_PORT_SUBTYPE_DEFAULT;
if (!hport)
@@ -86,7 +96,6 @@ int32_t __stdcall __ntapi_tty_create_session(
break;
case NT_TTY_SESSION_PRIVATE:
- port_attr.type = NT_PORT_TYPE_SUBSYSTEM;
port_attr.subtype = NT_PORT_SUBTYPE_PRIVATE;
break;