Blame src/tty/ntapi_tty_connect.c

dd89bb
/********************************************************/
dd89bb
/*  ntapi: Native API core library                      */
dde53a
/*  Copyright (C) 2013--2017  Z. Gilboa                 */
dd89bb
/*  Released under GPLv2 and GPLv3; see COPYING.NTAPI.  */
dd89bb
/********************************************************/
dd89bb
dd89bb
#include <psxtypes/psxtypes.h>
dd89bb
#include <ntapi/nt_object.h>
dd89bb
#include <ntapi/nt_port.h>
dd89bb
#include <ntapi/nt_string.h>
dd89bb
#include <ntapi/ntapi.h>
dd89bb
#include "ntapi_impl.h"
dd89bb
dd89bb
int32_t __stdcall __ntapi_tty_connect(
dd89bb
	__out	void **			hport,
dd89bb
	__in	wchar16_t *		tty_port_name,
dd89bb
	__in	int32_t			impersonation_level)
dd89bb
{
dd89bb
	nt_unicode_string		name;
dd89bb
	nt_security_quality_of_service	sqos;
dd89bb
dd89bb
	__ntapi->tt_init_unicode_string_from_utf16(
dd89bb
		&name,tty_port_name);
dd89bb
dd89bb
	sqos.length 			= sizeof(sqos);
dd89bb
	sqos.impersonation_level	= impersonation_level;
dd89bb
	sqos.context_tracking_mode	= NT_SECURITY_TRACKING_DYNAMIC;
dd89bb
	sqos.effective_only		= 1;
dd89bb
dd89bb
	return __ntapi->zw_connect_port(
2ea2de
		hport,&name,&sqos,
2ea2de
		0,0,0,0,0);
dd89bb
}