summaryrefslogtreecommitdiffhomepage
path: root/src/daemon/ptyc_daemon_connect.c
blob: 8e61d4289030517f1933a96376376149eccff3cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*********************************************************/
/*  ptycon: a pty-console bridge                         */
/*  Copyright (C) 2016--2017  Z. Gilboa                  */
/*  Released under GPLv2 and GPLv3; see COPYING.PTYCON.  */
/*********************************************************/

#include <psxtypes/psxtypes.h>
#include <ntapi/ntapi.h>

#include <ptycon/ptycon.h>
#include "ptycon_daemon_impl.h"
#include "ptycon_driver_impl.h"

int32_t __stdcall ptyc_daemon_connect(nt_tty_port_msg * msg)
{
	void * hport = 0;

	msg->ttyinfo.exarg = 0;

	ntapi->zw_accept_connect_port(
		&hport,
		msg->header.client_id.process_id,
		&msg->header,
		NT_LPC_ACCEPT_CONNECTION,0,0);

	return ntapi->zw_complete_connect_port(hport);
}