diff options
Diffstat (limited to 'src/tty')
-rw-r--r-- | src/tty/ntapi_tty_create_session.c | 15 |
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; |