bd7c836db3ecb143148cd6590e22e3246eee7d1c
[reactos.git] / posix / include / psx / lpcproto.h
1 /* $Id: lpcproto.h,v 1.6 2002/12/26 18:14:34 robd Exp $
2 *
3 * ReactOS POSIX+ Environment Subsystem
4 * LPC protocol spoken by PSXSS.EXE, PSXDLL.DLL, CSRTERM.EXE.
5 */
6 #ifndef _PSX_LPCPROTO_H
7 #define _PSX_LPCPROTO_H
8
9 #include <napi/lpc.h>
10
11 #ifndef PRIVATE
12 #define PRIVATE static
13 #endif
14
15 /* Protocol version */
16 #define PSX_LPC_PROTOCOL_VERSION 1
17
18 /* POSIX+ system name space */
19 #define PSX_NS_SUBSYSTEM_DIRECTORY_NAME L"POSIX+"
20 #define PSX_NS_SESSION_DIRECTORY_NAME L"Sessions"
21 #define PSX_NS_SYSTEM_DIRECTORY_NAME L"System"
22 #define PSX_NS_API_PORT_NAME L"ApiPort"
23 #define PSX_NS_SBAPI_PORT_NAME L"SbApiPort"
24 #define PSX_NS_SESSIONAPI_PORT_NAME L"SessionPort"
25 #define PSX_NS_API_PORT_TEMPLATE L"\\%s\\%s"
26 #define PSX_NS_SESSION_PORT_TEMPLATE L"\\%s\\%s\\P%d"
27 #define PSX_NS_SESSION_DATA_TEMPLATE L"\\%s\\%s\\D%d"
28
29 /* ConnectData protocol */
30
31 typedef enum {
32 PSX_CONNECTION_TYPE_PROCESS,
33 PSX_CONNECTION_TYPE_TERMINAL,
34 PSX_CONNECTION_TYPE_SERVER
35 } PSX_CONNECTION_TYPE;
36
37 typedef struct _PSX_CONNECT_PORT_DATA
38 {
39 PSX_CONNECTION_TYPE ConnectionType; /* IN OUT */
40 ULONG Version; /* IN OUT */
41 ULONG PortIdentifier; /* OUT */
42 } PSX_CONNECT_PORT_DATA, * PPSX_CONNECT_PORT_DATA;
43
44 /* LPC message subsystem-specific header */
45
46 typedef struct _PSX_MESSAGE_HEADER
47 {
48 WORD Context;
49 WORD Procedure;
50 NTSTATUS Status;
51 } PSX_MESSAGE_HEADER, * PPSX_MESSAGE_HEADER;
52
53 typedef PSX_MESSAGE_HEADER PSX_MESSAGE, * PPSX_MESSAGE;
54
55 #define PSX_MAX_LPC_DATA_SIZE 128 /* compute it*/
56
57 typedef struct _PSX_MAX_MESSAGE
58 {
59 //LPC_MESSAGE_HEADER Header;
60 LPC_MESSAGE Header;
61 PSX_MESSAGE_HEADER PsxHeader;
62 BYTE Data [PSX_MAX_LPC_DATA_SIZE];
63 } PSX_MAX_MESSAGE, * PPSX_MAX_MESSAGE;
64
65 /* Terminal I/O */
66
67 /* \POSIX+\SessionPort API */
68
69 #define PSX_TERMINAL_SECTION_SIZE 65536L
70 #define PSX_TERMINAL_SECTION_OFFSET 8192L
71
72 typedef enum {
73 PSX_TERMINAL_INTERRUPT,
74 PSX_TERMINAL_SESSION_STATUS_REQUEST
75 } PSX_TERMINAL_API;
76
77 typedef struct _PSX_TERMINAL_IO
78 {
79 //LPC_MESSAGE_HEADER Header;
80 LPC_MESSAGE Header;
81 PSX_MESSAGE_HEADER PsxHeader;
82 ULONG Size;
83 ULONG Offset;
84 } PSX_TERMINAL_READ, * PPSX_TERMINAL_READ;
85
86 /* System I/O (system calls) */
87
88 #include <psx/syscall.h>
89
90 #endif /* ndef _PSX_LPCPROTO_H */