1f77ba35afea1d578b3fe2491def66f6a970b720
[reactos.git] / include / reactos / subsys / csrss / msg.h
1 /*
2 * PROJECT: ReactOS Native Headers
3 * FILE: include/subsys/csrss/msg.h
4 * PURPOSE: Public Definitions for communication
5 * between CSR Clients and Servers.
6 * PROGRAMMERS: Alex Ionescu (alex@relsoft.net)
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #ifndef _CSRMSG_H
11 #define _CSRMSG_H
12
13 typedef struct _CSR_CONNECTION_INFO
14 {
15 ULONG Version;
16 ULONG Unknown;
17 HANDLE ObjectDirectory;
18 PVOID SharedSectionBase;
19 PVOID SharedSectionHeap;
20 PVOID SharedSectionData;
21 ULONG DebugFlags;
22 ULONG Unknown2[3];
23 HANDLE ProcessId;
24 } CSR_CONNECTION_INFO, *PCSR_CONNECTION_INFO;
25
26 typedef struct _CSR_IDENTIFY_ALTERTABLE_THREAD
27 {
28 CLIENT_ID Cid;
29 } CSR_IDENTIFY_ALTERTABLE_THREAD, *PCSR_IDENTIFY_ALTERTABLE_THREAD;
30
31 typedef struct _CSR_SET_PRIORITY_CLASS
32 {
33 HANDLE hProcess;
34 ULONG PriorityClass;
35 } CSR_SET_PRIORITY_CLASS, *PCSR_SET_PRIORITY_CLASS;
36
37 typedef struct _CSR_CLIENT_CONNECT
38 {
39 ULONG ServerId;
40 PVOID ConnectionInfo;
41 ULONG ConnectionInfoSize;
42 } CSR_CLIENT_CONNECT, *PCSR_CLIENT_CONNECT;
43
44 typedef struct _CSR_CAPTURE_BUFFER
45 {
46 ULONG Size;
47 struct _CSR_CAPTURE_BUFFER *PreviousCaptureBuffer;
48 ULONG PointerCount;
49 ULONG_PTR BufferEnd;
50 ULONG_PTR PointerArray[1];
51 } CSR_CAPTURE_BUFFER, *PCSR_CAPTURE_BUFFER;
52
53 /*
54 typedef union _CSR_API_NUMBER
55 {
56 WORD Index;
57 WORD Subsystem;
58 } CSR_API_NUMBER, *PCSR_API_NUMBER;
59 */
60 typedef ULONG CSR_API_NUMBER;
61
62 #include "csrss.h" // remove it when the data structures are not used anymore.
63
64 /* Keep in sync with definition below. */
65 // #define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS))
66
67 typedef struct _CSR_API_MESSAGE
68 {
69 PORT_MESSAGE Header;
70 union
71 {
72 CSR_CONNECTION_INFO ConnectionInfo;
73 struct
74 {
75 PCSR_CAPTURE_BUFFER CsrCaptureData;
76 CSR_API_NUMBER ApiNumber;
77 ULONG Status;
78 ULONG Reserved;
79 union
80 {
81 CSR_CLIENT_CONNECT CsrClientConnect;
82
83 CSR_SET_PRIORITY_CLASS SetPriorityClass;
84 CSR_IDENTIFY_ALTERTABLE_THREAD IdentifyAlertableThread;
85
86 /*** Temporary ***/
87 #if 1
88 CSRSS_CREATE_PROCESS CreateProcessRequest;
89 CSRSS_CREATE_THREAD CreateThreadRequest;
90 CSRSS_TERMINATE_PROCESS TerminateProcessRequest;
91 CSRSS_CONNECT_PROCESS ConnectRequest;
92 CSRSS_WRITE_CONSOLE WriteConsoleRequest;
93 CSRSS_READ_CONSOLE ReadConsoleRequest;
94 CSRSS_ALLOC_CONSOLE AllocConsoleRequest;
95 CSRSS_SCREEN_BUFFER_INFO ScreenBufferInfoRequest;
96 CSRSS_SET_CURSOR SetCursorRequest;
97 CSRSS_FILL_OUTPUT FillOutputRequest;
98 CSRSS_READ_INPUT ReadInputRequest;
99 CSRSS_WRITE_CONSOLE_OUTPUT_CHAR WriteConsoleOutputCharRequest;
100 CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB WriteConsoleOutputAttribRequest;
101 CSRSS_FILL_OUTPUT_ATTRIB FillOutputAttribRequest;
102 CSRSS_SET_CURSOR_INFO SetCursorInfoRequest;
103 CSRSS_GET_CURSOR_INFO GetCursorInfoRequest;
104 CSRSS_SET_ATTRIB SetAttribRequest;
105 CSRSS_SET_CONSOLE_MODE SetConsoleModeRequest;
106 CSRSS_GET_CONSOLE_MODE GetConsoleModeRequest;
107 CSRSS_CREATE_SCREEN_BUFFER CreateScreenBufferRequest;
108 CSRSS_SET_SCREEN_BUFFER SetScreenBufferRequest;
109 CSRSS_SET_TITLE SetTitleRequest;
110 CSRSS_GET_TITLE GetTitleRequest;
111 CSRSS_WRITE_CONSOLE_OUTPUT WriteConsoleOutputRequest;
112 CSRSS_FLUSH_INPUT_BUFFER FlushInputBufferRequest;
113 CSRSS_SCROLL_CONSOLE_SCREEN_BUFFER ScrollConsoleScreenBufferRequest;
114 CSRSS_READ_CONSOLE_OUTPUT_CHAR ReadConsoleOutputCharRequest;
115 CSRSS_READ_CONSOLE_OUTPUT_ATTRIB ReadConsoleOutputAttribRequest;
116 CSRSS_GET_NUM_INPUT_EVENTS GetNumInputEventsRequest;
117 CSRSS_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
118 CSRSS_EXIT_REACTOS ExitReactosRequest;
119 CSRSS_SET_SHUTDOWN_PARAMETERS SetShutdownParametersRequest;
120 CSRSS_GET_SHUTDOWN_PARAMETERS GetShutdownParametersRequest;
121 CSRSS_PEEK_CONSOLE_INPUT PeekConsoleInputRequest;
122 CSRSS_READ_CONSOLE_OUTPUT ReadConsoleOutputRequest;
123 CSRSS_WRITE_CONSOLE_INPUT WriteConsoleInputRequest;
124 CSRSS_GET_INPUT_HANDLE GetInputHandleRequest;
125 CSRSS_GET_OUTPUT_HANDLE GetOutputHandleRequest;
126 CSRSS_CLOSE_HANDLE CloseHandleRequest;
127 CSRSS_VERIFY_HANDLE VerifyHandleRequest;
128 CSRSS_DUPLICATE_HANDLE DuplicateHandleRequest;
129 CSRSS_SETGET_CONSOLE_HW_STATE ConsoleHardwareStateRequest;
130 CSRSS_GET_CONSOLE_WINDOW GetConsoleWindowRequest;
131 CSRSS_CREATE_DESKTOP CreateDesktopRequest;
132 CSRSS_SHOW_DESKTOP ShowDesktopRequest;
133 CSRSS_HIDE_DESKTOP HideDesktopRequest;
134 CSRSS_SET_CONSOLE_ICON SetConsoleIconRequest;
135 CSRSS_SET_LOGON_NOTIFY_WINDOW SetLogonNotifyWindowRequest;
136 CSRSS_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
137 CSRSS_GET_CONSOLE_CP GetConsoleCodePage;
138 CSRSS_SET_CONSOLE_CP SetConsoleCodePage;
139 CSRSS_GET_CONSOLE_OUTPUT_CP GetConsoleOutputCodePage;
140 CSRSS_SET_CONSOLE_OUTPUT_CP SetConsoleOutputCodePage;
141 CSRSS_GET_INPUT_WAIT_HANDLE GetConsoleInputWaitHandle;
142 CSRSS_GET_PROCESS_LIST GetProcessListRequest;
143 CSRSS_ADD_CONSOLE_ALIAS AddConsoleAlias;
144 CSRSS_GET_CONSOLE_ALIAS GetConsoleAlias;
145 CSRSS_GET_ALL_CONSOLE_ALIASES GetAllConsoleAlias;
146 CSRSS_GET_ALL_CONSOLE_ALIASES_LENGTH GetAllConsoleAliasesLength;
147 CSRSS_GET_CONSOLE_ALIASES_EXES GetConsoleAliasesExes;
148 CSRSS_GET_CONSOLE_ALIASES_EXES_LENGTH GetConsoleAliasesExesLength;
149 CSRSS_GENERATE_CTRL_EVENT GenerateCtrlEvent;
150 CSRSS_SET_SCREEN_BUFFER_SIZE SetScreenBufferSize;
151 CSRSS_GET_CONSOLE_SELECTION_INFO GetConsoleSelectionInfo;
152 CSRSS_GET_COMMAND_HISTORY_LENGTH GetCommandHistoryLength;
153 CSRSS_GET_COMMAND_HISTORY GetCommandHistory;
154 CSRSS_EXPUNGE_COMMAND_HISTORY ExpungeCommandHistory;
155 CSRSS_SET_HISTORY_NUMBER_COMMANDS SetHistoryNumberCommands;
156 CSRSS_GET_HISTORY_INFO GetHistoryInfo;
157 CSRSS_SET_HISTORY_INFO SetHistoryInfo;
158 CSRSS_GET_TEMP_FILE GetTempFile;
159 CSRSS_DEFINE_DOS_DEVICE DefineDosDeviceRequest;
160 CSRSS_SOUND_SENTRY SoundSentryRequest;
161 CSRSS_UPDATE_VDM_ENTRY UpdateVdmEntry;
162 CSRSS_GET_VDM_EXIT_CODE GetVdmExitCode;
163 CSRSS_CHECK_VDM CheckVdm;
164 #endif
165 /*****************/
166 } Data;
167 };
168 };
169 } CSR_API_MESSAGE, *PCSR_API_MESSAGE;
170
171 /*** old ***
172 typedef struct _CSR_API_MESSAGE
173 {
174 PORT_MESSAGE Header;
175 PVOID CsrCaptureData;
176 ULONG Type;
177 NTSTATUS Status;
178 union
179 {
180 CSRSS_CREATE_PROCESS CreateProcessRequest;
181 CSRSS_CREATE_THREAD CreateThreadRequest;
182 CSRSS_TERMINATE_PROCESS TerminateProcessRequest;
183 CSRSS_CONNECT_PROCESS ConnectRequest;
184
185 . . . . . . . . . . . . . . .
186
187 CSRSS_GET_VDM_EXIT_CODE GetVdmExitCode;
188 CSRSS_CHECK_VDM CheckVdm;
189 } Data;
190 } CSR_API_MESSAGE, *PCSR_API_MESSAGE;
191
192 ***/
193
194
195
196
197 #define CSR_PORT_NAME L"ApiPort"
198
199 /**** move these defines elsewhere ****/
200
201 #define CSR_SRV_SERVER 0
202 #define CSR_SERVER_DLL_MAX 4
203
204 /**************************************/
205
206
207
208 #define CSR_CREATE_API_NUMBER(ServerId, ApiId) \
209 (CSR_API_NUMBER)(((ServerId) << 16) | (ApiId))
210
211 #define CSR_API_NUMBER_TO_SERVER_ID(ApiNumber) \
212 (ULONG)((ULONG)(ApiNumber) >> 16)
213
214 #define CSR_API_NUMBER_TO_API_ID(ApiNumber) \
215 (ULONG)((ULONG)(ApiNumber) & 0xFFFF)
216
217 #endif // _CSRMSG_H
218
219 /* EOF */