Blob Blame History Raw
/*********************************************************/
/*  toksvc: a framework-native token broker service      */
/*  Copyright (C) 2020  SysDeer Technologies, LLC        */
/*  Released under GPLv2 and GPLv3; see COPYING.TOKSVC.  */
/*********************************************************/

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

#include "toksvc_daemon_impl.h"
#include "toksvc_driver_impl.h"

int32_t __stdcall toks_daemon_signal(struct toks_daemon_ctx * dctx)
{
	nt_tty_port_msg * msg = &dctx->reply;

	/* [not a] ctty signal? */
	if (msg->ctlinfo.ctxarg[0])
		return NT_STATUS_SUCCESS;

	/* ctty sigint */
	if (msg->ctlinfo.ctlcode == TTY_TCSBRK)
		ntapi->zw_terminate_process(
			NT_CURRENT_PROCESS_HANDLE,
			NT_STATUS_WAIT_1);

	return NT_STATUS_NOT_SUPPORTED;
}