Blob Blame History Raw
#ifndef TOKSVC_DAEMON_IMPL_H
#define TOKSVC_DAEMON_IMPL_H

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

enum toks_daemon_opcodes {
	TOKS_DAEMON_OPCODE_BASE	= 0x20000,
	TOKS_DAEMON_CONNECT	= TOKS_DAEMON_OPCODE_BASE,
	TOKS_DAEMON_DISCONNECT,
	TOKS_DAEMON_TTYSIGNAL,
	TOKS_DAEMON_IPCSIGNAL,
	TOKS_DAEMON_SIGCHLD,
	TOKS_DAEMON_THREADEXIT,
	TOKS_DAEMON_OPCODE_CAP
};

typedef int32_t __stdcall toks_daemon_routine(nt_tty_port_msg *);

struct toks_driver_ctx;

struct toks_daemon_ctx {
	struct toks_driver_ctx *driver_ctx;

	nt_port_keys		daemon_keys;
	nt_port_attr		daemon_attr;
	nt_port_name		daemon_name;

	void *			hport_daemon;
	void *			hevent_daemon_ready;

	void *			hport_internal_client;
	void *			hevent_internal_client_ready;
};

int32_t __stdcall toks_daemon_init(struct toks_daemon_ctx *, const nt_guid *);
int32_t __stdcall toks_daemon_loop(void *);
int32_t __stdcall toks_daemon_connect(nt_tty_port_msg *);
int32_t __stdcall toks_daemon_signal(nt_tty_port_msg *);

#endif