From 171c2d6c66d9e8bce81a17ca925a7a8c979cb33e Mon Sep 17 00:00:00 2001 From: midipix Date: Sun, 30 Jul 2017 21:21:21 +0000 Subject: subsystem interfaces: set port type from guid when creating a server instance. --- src/tty/ntapi_tty_create_session.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/tty') 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; -- cgit v1.2.3