Files forgotten in r19815
[reactos.git] / reactos / subsys / csrss / include / api.h
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS system libraries
5 * FILE: subsys/csrss/include/api.h
6 * PURPOSE: CSRSS API interface
7 */
8
9 #ifndef API_H_INCLUDED
10 #define API_H_INCLUDED
11
12 #define NTOS_MODE_USER
13 #include <ndk/ntndk.h>
14
15 #include <csrss/csrss.h>
16
17 typedef struct Object_tt
18 {
19 LONG Type;
20 LONG ReferenceCount;
21 CRITICAL_SECTION Lock;
22 } Object_t;
23
24 typedef struct ConsoleInput_t
25 {
26 LIST_ENTRY ListEntry;
27 INPUT_RECORD InputEvent;
28 BOOLEAN Echoed; // already been echoed or not
29 BOOLEAN Fake; // synthesized, not a real event
30 BOOLEAN NotChar; // message should not be used to return a character
31 } ConsoleInput;
32
33 typedef struct tagCSRSS_CONSOLE *PCSRSS_CONSOLE;
34
35 typedef struct _CSRSS_PROCESS_DATA
36 {
37 PCSRSS_CONSOLE Console;
38 PCSRSS_CONSOLE ParentConsole;
39 BOOL bInheritHandles;
40 RTL_CRITICAL_SECTION HandleTableLock;
41 ULONG HandleTableSize;
42 Object_t ** HandleTable;
43 HANDLE ProcessId;
44 HANDLE Process;
45 ULONG ShutdownLevel;
46 ULONG ShutdownFlags;
47 HANDLE ConsoleEvent;
48 PVOID CsrSectionViewBase;
49 ULONG CsrSectionViewSize;
50 struct _CSRSS_PROCESS_DATA * next;
51 LIST_ENTRY ProcessEntry;
52 PCONTROLDISPATCHER CtrlDispatcher;
53 BOOL Terminated;
54 } CSRSS_PROCESS_DATA, *PCSRSS_PROCESS_DATA;
55
56 typedef VOID (STDCALL *CSR_CLEANUP_OBJECT_PROC)(Object_t *Object);
57
58 typedef struct tagCSRSS_OBJECT_DEFINITION
59 {
60 LONG Type;
61 CSR_CLEANUP_OBJECT_PROC CsrCleanupObjectProc;
62 } CSRSS_OBJECT_DEFINITION, *PCSRSS_OBJECT_DEFINITION;
63
64 typedef NTSTATUS (STDCALL *CSRSS_API_PROC)(PCSRSS_PROCESS_DATA ProcessData,
65 PCSR_API_MESSAGE Request);
66
67 typedef struct _CSRSS_API_DEFINITION
68 {
69 ULONG Type;
70 ULONG MinRequestSize;
71 CSRSS_API_PROC Handler;
72 } CSRSS_API_DEFINITION, *PCSRSS_API_DEFINITION;
73
74 #define CSRSS_DEFINE_API(Func, Handler) \
75 { Func, sizeof(CSRSS_##Func), Handler }
76
77 typedef struct _CSRSS_LISTEN_DATA
78 {
79 HANDLE ApiPortHandle;
80 ULONG ApiDefinitionsCount;
81 PCSRSS_API_DEFINITION *ApiDefinitions;
82 } CSRSS_LISTEN_DATA, *PCSRSS_LISTEN_DATA;
83
84 #define CSR_API(n) NTSTATUS STDCALL n (\
85 PCSRSS_PROCESS_DATA ProcessData,\
86 PCSR_API_MESSAGE Request)
87
88 /* init.c */
89 extern HANDLE hBootstrapOk;
90
91 /* api/process.c */
92 CSR_API(CsrConnectProcess);
93 CSR_API(CsrCreateProcess);
94 CSR_API(CsrTerminateProcess);
95
96 /* print.c */
97 VOID STDCALL DisplayString(LPCWSTR lpwString);
98 VOID STDCALL PrintString (char* fmt, ...);
99
100 /* api/wapi.c */
101 NTSTATUS FASTCALL CsrApiRegisterDefinitions(PCSRSS_API_DEFINITION NewDefinitions);
102 VOID FASTCALL CsrApiCallHandler(PCSRSS_PROCESS_DATA ProcessData,
103 PCSR_API_MESSAGE Request);
104 DWORD STDCALL ServerApiPortThread (PVOID PortHandle);
105 DWORD STDCALL ServerSbApiPortThread (PVOID PortHandle);
106 DWORD STDCALL Console_Api( PVOID unused );
107
108 extern HANDLE CsrssApiHeap;
109
110 /* api/conio.c */
111 VOID STDCALL CsrInitConsoleSupport(VOID);
112
113 /* api/process.c */
114 typedef NTSTATUS (STDCALL *CSRSS_ENUM_PROCESS_PROC)(PCSRSS_PROCESS_DATA ProcessData,
115 PVOID Context);
116 VOID STDCALL CsrInitProcessData(VOID);
117 PCSRSS_PROCESS_DATA STDCALL CsrGetProcessData(HANDLE ProcessId);
118 PCSRSS_PROCESS_DATA STDCALL CsrCreateProcessData(HANDLE ProcessId);
119 NTSTATUS STDCALL CsrFreeProcessData( HANDLE Pid );
120 NTSTATUS STDCALL CsrEnumProcesses(CSRSS_ENUM_PROCESS_PROC EnumProc, PVOID Context);
121
122 /* api/handle.c */
123 NTSTATUS FASTCALL CsrRegisterObjectDefinitions(PCSRSS_OBJECT_DEFINITION NewDefinitions);
124 NTSTATUS STDCALL CsrInsertObject( PCSRSS_PROCESS_DATA ProcessData, PHANDLE Handle, Object_t *Object );
125 NTSTATUS STDCALL CsrDuplicateHandleTable(PCSRSS_PROCESS_DATA SourceProcessData, PCSRSS_PROCESS_DATA TargetProcessData);
126 NTSTATUS STDCALL CsrGetObject( PCSRSS_PROCESS_DATA ProcessData, HANDLE Handle, Object_t **Object );
127 BOOL STDCALL CsrServerInitialization (int,char**,char**);
128 NTSTATUS STDCALL CsrReleaseObjectByPointer(Object_t *Object);
129 NTSTATUS STDCALL CsrReleaseObject( PCSRSS_PROCESS_DATA ProcessData, HANDLE Object );
130 NTSTATUS STDCALL CsrVerifyObject( PCSRSS_PROCESS_DATA ProcessData, HANDLE Object );
131
132 CSR_API(CsrGetInputHandle);
133 CSR_API(CsrGetOutputHandle);
134 CSR_API(CsrCloseHandle);
135 CSR_API(CsrVerifyHandle);
136 CSR_API(CsrDuplicateHandle);
137 CSR_API(CsrGetInputWaitHandle);
138
139 /* api/user.c */
140 CSR_API(CsrRegisterServicesProcess);
141 CSR_API(CsrExitReactos);
142 CSR_API(CsrGetShutdownParameters);
143 CSR_API(CsrSetShutdownParameters);
144
145 CSR_API(CsrSetLogonNotifyWindow);
146 CSR_API(CsrRegisterLogonProcess);
147
148 #endif /* ndef API_H_INCLUDED */
149
150 /* EOF */
151