Blame src/daemon/toks_daemon_signal.c

5e5175
/*********************************************************/
5e5175
/*  toksvc: a framework-native token broker service      */
d91fa0
/*  Copyright (C) 2020  SysDeer Technologies, LLC        */
5e5175
/*  Released under GPLv2 and GPLv3; see COPYING.TOKSVC.  */
5e5175
/*********************************************************/
5e5175
5e5175
#include <psxtypes/psxtypes.h>
5e5175
#include <ntapi/ntapi.h>
5e5175
#include <ntapi/nt_termios.h>
5e5175
5e5175
#include "toksvc_daemon_impl.h"
5e5175
#include "toksvc_driver_impl.h"
5e5175
9985a1
int32_t __stdcall toks_daemon_signal(struct toks_daemon_ctx * dctx)
5e5175
{
9985a1
	nt_tty_port_msg * msg = &dctx->reply;
9985a1
5e5175
	/* [not a] ctty signal? */
5e5175
	if (msg->ctlinfo.ctxarg[0])
5e5175
		return NT_STATUS_SUCCESS;
5e5175
5e5175
	/* ctty sigint */
5e5175
	if (msg->ctlinfo.ctlcode == TTY_TCSBRK)
5e5175
		ntapi->zw_terminate_process(
5e5175
			NT_CURRENT_PROCESS_HANDLE,
5e5175
			NT_STATUS_WAIT_1);
5e5175
5e5175
	return NT_STATUS_NOT_SUPPORTED;
5e5175
}