Blame src/daemon/ptyc_daemon_connect.c

72c4b0
/*********************************************************/
72c4b0
/*  ptycon: a pty-console bridge                         */
1f983d
/*  Copyright (C) 2016--2017  Z. Gilboa                  */
72c4b0
/*  Released under GPLv2 and GPLv3; see COPYING.PTYCON.  */
72c4b0
/*********************************************************/
72c4b0
72c4b0
#include <psxtypes/psxtypes.h>
72c4b0
#include <ntapi/ntapi.h>
72c4b0
72c4b0
#include <ptycon/ptycon.h>
72c4b0
#include "ptycon_daemon_impl.h"
72c4b0
#include "ptycon_driver_impl.h"
72c4b0
72c4b0
int32_t __stdcall ptyc_daemon_connect(nt_tty_port_msg * msg)
72c4b0
{
72c4b0
	void * hport = 0;
72c4b0
ab99f6
	msg->ttyinfo.exarg = 0;
72c4b0
72c4b0
	ntapi->zw_accept_connect_port(
72c4b0
		&hport,
72c4b0
		msg->header.client_id.process_id,
72c4b0
		&msg->header,
72c4b0
		NT_LPC_ACCEPT_CONNECTION,0,0);
72c4b0
72c4b0
	return ntapi->zw_complete_connect_port(hport);
72c4b0
}