Blame src/tty/ntapi_tty_client_process_register.c

dd89bb
/********************************************************/
dd89bb
/*  ntapi: Native API core library                      */
59d585
/*  Copyright (C) 2013--2021  Z. Gilboa                 */
dd89bb
/*  Released under GPLv2 and GPLv3; see COPYING.NTAPI.  */
dd89bb
/********************************************************/
dd89bb
dd89bb
#include <psxtypes/psxtypes.h>
dd89bb
#include <ntapi/ntapi.h>
dd89bb
#include "ntapi_impl.h"
dd89bb
dd89bb
int32_t __stdcall __ntapi_tty_client_process_register(
dd89bb
	__in	void *			hport,
dd89bb
	__in	uintptr_t		process_id,
dd89bb
	__in	uintptr_t		thread_id,
dd89bb
	__in	uintptr_t		flags,
dd89bb
	__in	nt_large_integer *	reserved)
dd89bb
{
dd89bb
	nt_status		status;
dd89bb
	nt_tty_register_msg	msg;
dd89bb
c713d8
	(void)reserved;
c713d8
dd89bb
	__ntapi->tt_aligned_block_memset(
dd89bb
		&msg,0,sizeof(msg));
dd89bb
dd89bb
	msg.header.msg_type	= NT_LPC_NEW_MESSAGE;
dd89bb
	msg.header.data_size	= sizeof(msg.data);
dd89bb
	msg.header.msg_size	= sizeof(msg);
dd89bb
	msg.data.ttyinfo.opcode	= NT_TTY_CLIENT_PROCESS_REGISTER;
dd89bb
dd89bb
	msg.data.reginfo.process_id 	= process_id;
dd89bb
	msg.data.reginfo.thread_id	= thread_id;
dd89bb
	msg.data.reginfo.flags		= flags;
dd89bb
dd89bb
	if ((status = __ntapi->zw_request_wait_reply_port(hport,&msg,&msg)))
dd89bb
		return status;
dd89bb
dd89bb
	return msg.data.ttyinfo.status;
dd89bb
}