47c5addc8b8b03d5fa2beeeb1d369c2b0bc609b9
[reactos.git] / reactos / include / reactos / subsys / csrss / csrss.h
1 #ifndef __INCLUDE_CSRSS_CSRSS_H
2 #define __INCLUDE_CSRSS_CSRSS_H
3
4 #include <drivers/blue/ntddblue.h>
5
6 #define CSR_NATIVE 0x0000
7 #define CSR_CONSOLE 0x0001
8 #define CSR_GUI 0x0002
9 #define CONSOLE_INPUT_MODE_VALID (0x0f)
10 #define CONSOLE_OUTPUT_MODE_VALID (0x03)
11
12 /*
13 typedef union _CSR_API_NUMBER
14 {
15 WORD Index; // CSRSS API number
16 WORD Subsystem; // 0=NTDLL;1=KERNEL32;2=KERNEL32
17 } CSR_API_NUMBER, *PCSR_API_NUMBER;
18 */
19
20 typedef ULONG CSR_API_NUMBER;
21
22 #define MAKE_CSR_API(Number, Server) \
23 ((Server) << 16) + Number
24
25 #define CSR_CSRSS_SECTION_SIZE (65536)
26
27 typedef VOID (CALLBACK *PCONTROLDISPATCHER)(DWORD);
28
29 typedef struct
30 {
31 ULONG Dummy;
32 } CSRSS_CONNECT_PROCESS, *PCSRSS_CONNECT_PROCESS;
33
34 typedef struct
35 {
36 HANDLE NewProcessId;
37 ULONG Flags;
38 BOOL bInheritHandles;
39 } CSRSS_CREATE_PROCESS, *PCSRSS_CREATE_PROCESS;
40
41 typedef struct
42 {
43 CLIENT_ID ClientId;
44 HANDLE ThreadHandle;
45 } CSRSS_CREATE_THREAD, *PCSRSS_CREATE_THREAD;
46
47 typedef struct
48 {
49 ULONG Dummy;
50 } CSRSS_TERMINATE_PROCESS, *PCSRSS_TERMINATE_PROCESS;
51
52 typedef struct
53 {
54 USHORT nMaxIds;
55 PDWORD ProcessId;
56 ULONG nProcessIdsTotal;
57 } CSRSS_GET_PROCESS_LIST, *PCSRSS_GET_PROCESS_LIST;
58
59 typedef struct
60 {
61 HANDLE ConsoleHandle;
62 BOOL Unicode;
63 ULONG NrCharactersToWrite;
64 ULONG NrCharactersWritten;
65 HANDLE UnpauseEvent;
66 BYTE Buffer[0];
67 } CSRSS_WRITE_CONSOLE, *PCSRSS_WRITE_CONSOLE;
68
69 typedef struct
70 {
71 HANDLE ConsoleHandle;
72 BOOL Unicode;
73 WORD NrCharactersToRead;
74 WORD NrCharactersRead;
75 HANDLE EventHandle;
76 PVOID Buffer;
77 UNICODE_STRING ExeName;
78 DWORD CtrlWakeupMask;
79 DWORD ControlKeyState;
80 } CSRSS_READ_CONSOLE, *PCSRSS_READ_CONSOLE;
81
82 typedef struct
83 {
84 PCONTROLDISPATCHER CtrlDispatcher;
85 BOOLEAN ConsoleNeeded;
86 BOOLEAN Visible;
87 HANDLE Console;
88 HANDLE InputHandle;
89 HANDLE OutputHandle;
90 } CSRSS_ALLOC_CONSOLE, *PCSRSS_ALLOC_CONSOLE;
91
92 typedef struct
93 {
94 ULONG Dummy;
95 } CSRSS_FREE_CONSOLE, *PCSRSS_FREE_CONSOLE;
96
97 typedef struct
98 {
99 HANDLE ConsoleHandle;
100 CONSOLE_SCREEN_BUFFER_INFO Info;
101 } CSRSS_SCREEN_BUFFER_INFO, *PCSRSS_SCREEN_BUFFER_INFO;
102
103 typedef struct
104 {
105 HANDLE ConsoleHandle;
106 COORD Position;
107 } CSRSS_SET_CURSOR, *PCSRSS_SET_CURSOR;
108
109 typedef struct
110 {
111 HANDLE ConsoleHandle;
112 BOOL Unicode;
113 union
114 {
115 CHAR AsciiChar;
116 WCHAR UnicodeChar;
117 } Char;
118 COORD Position;
119 WORD Length;
120 ULONG NrCharactersWritten;
121 } CSRSS_FILL_OUTPUT, *PCSRSS_FILL_OUTPUT;
122
123 typedef struct
124 {
125 HANDLE ConsoleHandle;
126 CHAR Attribute;
127 COORD Coord;
128 WORD Length;
129 } CSRSS_FILL_OUTPUT_ATTRIB, *PCSRSS_FILL_OUTPUT_ATTRIB;
130
131 typedef struct
132 {
133 HANDLE ConsoleHandle;
134 BOOL Unicode;
135 INPUT_RECORD Input;
136 BOOL MoreEvents;
137 HANDLE Event;
138 } CSRSS_READ_INPUT, *PCSRSS_READ_INPUT;
139
140 typedef struct
141 {
142 HANDLE ConsoleHandle;
143 BOOL Unicode;
144 WORD Length;
145 COORD Coord;
146 COORD EndCoord;
147 ULONG NrCharactersWritten;
148 CHAR String[0];
149 } CSRSS_WRITE_CONSOLE_OUTPUT_CHAR, *PCSRSS_WRITE_CONSOLE_OUTPUT_CHAR;
150
151 typedef struct
152 {
153 HANDLE ConsoleHandle;
154 WORD Length;
155 COORD Coord;
156 COORD EndCoord;
157 WORD Attribute[0];
158 } CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB, *PCSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB;
159
160 typedef struct
161 {
162 HANDLE ConsoleHandle;
163 CONSOLE_CURSOR_INFO Info;
164 } CSRSS_GET_CURSOR_INFO, *PCSRSS_GET_CURSOR_INFO;
165
166 typedef struct
167 {
168 HANDLE ConsoleHandle;
169 CONSOLE_CURSOR_INFO Info;
170 } CSRSS_SET_CURSOR_INFO, *PCSRSS_SET_CURSOR_INFO;
171
172 typedef struct
173 {
174 HANDLE ConsoleHandle;
175 WORD Attrib;
176 } CSRSS_SET_ATTRIB, *PCSRSS_SET_ATTRIB;
177
178 typedef struct
179 {
180 HANDLE ConsoleHandle;
181 DWORD Mode;
182 } CSRSS_SET_CONSOLE_MODE, *PCSRSS_SET_CONSOLE_MODE;
183
184 typedef struct
185 {
186 HANDLE ConsoleHandle;
187 DWORD ConsoleMode;
188 } CSRSS_GET_CONSOLE_MODE, *PCSRSS_GET_CONSOLE_MODE;
189
190 typedef struct
191 {
192 DWORD Access;
193 DWORD ShareMode;
194 BOOL Inheritable;
195 HANDLE OutputHandle; /* handle to newly created screen buffer */
196 } CSRSS_CREATE_SCREEN_BUFFER, *PCSRSS_CREATE_SCREEN_BUFFER;
197
198 typedef struct
199 {
200 HANDLE OutputHandle; /* handle to screen buffer to switch to */
201 } CSRSS_SET_SCREEN_BUFFER, *PCSRSS_SET_SCREEN_BUFFER;
202
203 typedef struct
204 {
205 HANDLE UniqueThread;
206 CLIENT_ID Cid;
207 } CSRSS_IDENTIFY_ALERTABLE_THREAD, *PCSRSS_IDENTIFY_ALERTABLE_THREAD;
208
209 typedef struct
210 {
211 DWORD Length;
212 PWCHAR Title;
213 } CSRSS_SET_TITLE, *PCSRSS_SET_TITLE;
214
215 typedef struct
216 {
217 DWORD Length;
218 PWCHAR Title;
219 } CSRSS_GET_TITLE, *PCSRSS_GET_TITLE;
220
221 typedef struct
222 {
223 HANDLE ConsoleHandle;
224 BOOL Unicode;
225 COORD BufferSize;
226 COORD BufferCoord;
227 SMALL_RECT WriteRegion;
228 CHAR_INFO* CharInfo;
229 } CSRSS_WRITE_CONSOLE_OUTPUT, *PCSRSS_WRITE_CONSOLE_OUTPUT;
230
231 typedef struct
232 {
233 HANDLE ConsoleInput;
234 } CSRSS_FLUSH_INPUT_BUFFER, *PCSRSS_FLUSH_INPUT_BUFFER;
235
236 typedef struct
237 {
238 HANDLE ConsoleHandle;
239 BOOL Unicode;
240 SMALL_RECT ScrollRectangle;
241 BOOLEAN UseClipRectangle;
242 SMALL_RECT ClipRectangle;
243 COORD DestinationOrigin;
244 CHAR_INFO Fill;
245 } CSRSS_SCROLL_CONSOLE_SCREEN_BUFFER, *PCSRSS_SCROLL_CONSOLE_SCREEN_BUFFER;
246
247 typedef struct
248 {
249 HANDLE ConsoleHandle;
250 BOOL Unicode;
251 DWORD NumCharsToRead;
252 COORD ReadCoord;
253 COORD EndCoord;
254 DWORD CharsRead;
255 CHAR String[0];
256 }CSRSS_READ_CONSOLE_OUTPUT_CHAR, *PCSRSS_READ_CONSOLE_OUTPUT_CHAR;
257
258 typedef struct
259 {
260 HANDLE ConsoleHandle;
261 DWORD NumAttrsToRead;
262 COORD ReadCoord;
263 COORD EndCoord;
264 WORD Attribute[0];
265 }CSRSS_READ_CONSOLE_OUTPUT_ATTRIB, *PCSRSS_READ_CONSOLE_OUTPUT_ATTRIB;
266
267 typedef struct
268 {
269 HANDLE ConsoleHandle;
270 DWORD NumInputEvents;
271 }CSRSS_GET_NUM_INPUT_EVENTS, *PCSRSS_GET_NUM_INPUT_EVENTS;
272
273 typedef struct
274 {
275 HANDLE ProcessId;
276 } CSRSS_REGISTER_SERVICES_PROCESS, *PCSRSS_REGISTER_SERVICES_PROCESS;
277
278 typedef struct
279 {
280 UINT Flags;
281 DWORD Reserved;
282 } CSRSS_EXIT_REACTOS, *PCSRSS_EXIT_REACTOS;
283
284 typedef struct
285 {
286 DWORD Level;
287 DWORD Flags;
288 } CSRSS_SET_SHUTDOWN_PARAMETERS, *PCSRSS_SET_SHUTDOWN_PARAMETERS;
289
290 typedef struct
291 {
292 DWORD Level;
293 DWORD Flags;
294 } CSRSS_GET_SHUTDOWN_PARAMETERS, *PCSRSS_GET_SHUTDOWN_PARAMETERS;
295
296 typedef struct
297 {
298 HANDLE ConsoleHandle;
299 BOOL Unicode;
300 DWORD Length;
301 INPUT_RECORD* InputRecord;
302 } CSRSS_PEEK_CONSOLE_INPUT, *PCSRSS_PEEK_CONSOLE_INPUT;
303
304 typedef struct
305 {
306 HANDLE ConsoleHandle;
307 BOOL Unicode;
308 COORD BufferSize;
309 COORD BufferCoord;
310 SMALL_RECT ReadRegion;
311 CHAR_INFO* CharInfo;
312 } CSRSS_READ_CONSOLE_OUTPUT, *PCSRSS_READ_CONSOLE_OUTPUT;
313
314 typedef struct
315 {
316 HANDLE ConsoleHandle;
317 BOOL Unicode;
318 DWORD Length;
319 INPUT_RECORD* InputRecord;
320 } CSRSS_WRITE_CONSOLE_INPUT, *PCSRSS_WRITE_CONSOLE_INPUT;
321
322 typedef struct
323 {
324 DWORD Access;
325 BOOL Inheritable;
326 HANDLE Handle;
327 DWORD ShareMode;
328 } CSRSS_GET_INPUT_HANDLE, *PCSRSS_GET_INPUT_HANDLE,
329 CSRSS_GET_OUTPUT_HANDLE, *PCSRSS_GET_OUTPUT_HANDLE;
330
331 typedef struct
332 {
333 HANDLE Handle;
334 } CSRSS_CLOSE_HANDLE, *PCSRSS_CLOSE_HANDLE;
335
336 typedef struct
337 {
338 HANDLE Handle;
339 } CSRSS_VERIFY_HANDLE, *PCSRSS_VERIFY_HANDLE;
340
341 typedef struct
342 {
343 HANDLE Handle;
344 DWORD Access;
345 BOOL Inheritable;
346 DWORD Options;
347 } CSRSS_DUPLICATE_HANDLE, *PCSRSS_DUPLICATE_HANDLE;
348
349 #define CONSOLE_HARDWARE_STATE_GET 0
350 #define CONSOLE_HARDWARE_STATE_SET 1
351
352 #define CONSOLE_HARDWARE_STATE_GDI_MANAGED 0
353 #define CONSOLE_HARDWARE_STATE_DIRECT 1
354
355 typedef struct
356 {
357 HANDLE ConsoleHandle;
358 DWORD SetGet; /* 0=get; 1=set */
359 DWORD State;
360 } CSRSS_SETGET_CONSOLE_HW_STATE, *PCSRSS_SETGET_CONSOLE_HW_STATE;
361
362 typedef struct
363 {
364 HWND WindowHandle;
365 } CSRSS_GET_CONSOLE_WINDOW, *PCSRSS_GET_CONSOLE_WINDOW;
366
367 typedef struct
368 {
369 HICON WindowIcon;
370 } CSRSS_SET_CONSOLE_ICON, *PCSRSS_SET_CONSOLE_ICON;
371
372 typedef struct
373 {
374 HDESK DesktopHandle;
375 } CSRSS_CREATE_DESKTOP, *PCSRSS_CREATE_DESKTOP;
376
377 typedef struct
378 {
379 HWND DesktopWindow;
380 ULONG Width;
381 ULONG Height;
382 } CSRSS_SHOW_DESKTOP, *PCSRSS_SHOW_DESKTOP;
383
384 typedef struct
385 {
386 HWND DesktopWindow;
387 } CSRSS_HIDE_DESKTOP, *PCSRSS_HIDE_DESKTOP;
388
389 typedef struct
390 {
391 HWND LogonNotifyWindow;
392 } CSRSS_SET_LOGON_NOTIFY_WINDOW, *PCSRSS_SET_LOGON_NOTIFY_WINDOW;
393
394 typedef struct
395 {
396 HANDLE ProcessId;
397 BOOL Register;
398 } CSRSS_REGISTER_LOGON_PROCESS, *PCSRSS_REGISTER_LOGON_PROCESS;
399
400 typedef struct
401 {
402 UINT CodePage;
403 } CSRSS_GET_CONSOLE_CP, *PCSRSS_GET_CONSOLE_CP;
404
405 typedef struct
406 {
407 UINT CodePage;
408 } CSRSS_SET_CONSOLE_CP, *PCSRSS_SET_CONSOLE_CP;
409
410 typedef struct
411 {
412 UINT CodePage;
413 } CSRSS_GET_CONSOLE_OUTPUT_CP, *PCSRSS_GET_CONSOLE_OUTPUT_CP;
414
415 typedef struct
416 {
417 UINT CodePage;
418 } CSRSS_SET_CONSOLE_OUTPUT_CP, *PCSRSS_SET_CONSOLE_OUTPUT_CP;
419
420 typedef struct
421 {
422 HANDLE InputWaitHandle;
423 } CSRSS_GET_INPUT_WAIT_HANDLE, *PCSRSS_GET_INPUT_WAIT_HANDLE;
424
425 typedef struct
426 {
427 ULONG SourceLength;
428 ULONG ExeLength;
429 ULONG TargetLength;
430 } CSRSS_ADD_CONSOLE_ALIAS, *PCSRSS_ADD_CONSOLE_ALIAS;
431
432 typedef struct
433 {
434 ULONG SourceLength;
435 ULONG ExeLength;
436 ULONG BytesWritten;
437 ULONG TargetBufferLength;
438 PVOID TargetBuffer;
439 } CSRSS_GET_CONSOLE_ALIAS, *PCSRSS_GET_CONSOLE_ALIAS;
440
441 typedef struct
442 {
443 LPWSTR lpExeName;
444 DWORD BytesWritten;
445 DWORD AliasBufferLength;
446 LPWSTR AliasBuffer;
447 } CSRSS_GET_ALL_CONSOLE_ALIASES, *PCSRSS_GET_ALL_CONSOLE_ALIAS;
448
449 typedef struct
450 {
451 LPWSTR lpExeName;
452 DWORD Length;
453 } CSRSS_GET_ALL_CONSOLE_ALIASES_LENGTH, *PCSRSS_GET_ALL_CONSOLE_ALIASES_LENGTH;
454
455 typedef struct
456 {
457 DWORD BytesWritten;
458 DWORD Length;
459 LPWSTR ExeNames;
460 } CSRSS_GET_CONSOLE_ALIASES_EXES, *PCSRSS_GET_CONSOLE_ALIASES_EXES;
461
462 typedef struct
463 {
464 DWORD Length;
465 } CSRSS_GET_CONSOLE_ALIASES_EXES_LENGTH, *PCSRSS_GET_CONSOLE_ALIASES_EXES_LENGTH;
466
467 typedef struct
468 {
469 DWORD Event;
470 DWORD ProcessGroup;
471 } CSRSS_GENERATE_CTRL_EVENT, *PCSRSS_GENERATE_CTRL_EVENT;
472
473 typedef struct
474 {
475 HANDLE OutputHandle;
476 COORD Size;
477 } CSRSS_SET_SCREEN_BUFFER_SIZE, *PCSRSS_SET_SCREEN_BUFFER_SIZE;
478
479 typedef struct
480 {
481 CONSOLE_SELECTION_INFO Info;
482 } CSRSS_GET_CONSOLE_SELECTION_INFO, *PCSRSS_GET_CONSOLE_SELECTION_INFO;
483
484 typedef struct
485 {
486 UNICODE_STRING ExeName;
487 DWORD Length;
488 } CSRSS_GET_COMMAND_HISTORY_LENGTH, *PCSRSS_GET_COMMAND_HISTORY_LENGTH;
489
490 typedef struct
491 {
492 UNICODE_STRING ExeName;
493 PWCHAR History;
494 DWORD Length;
495 } CSRSS_GET_COMMAND_HISTORY, *PCSRSS_GET_COMMAND_HISTORY;
496
497 typedef struct
498 {
499 UNICODE_STRING ExeName;
500 } CSRSS_EXPUNGE_COMMAND_HISTORY, *PCSRSS_EXPUNGE_COMMAND_HISTORY;
501
502 typedef struct
503 {
504 UNICODE_STRING ExeName;
505 DWORD NumCommands;
506 } CSRSS_SET_HISTORY_NUMBER_COMMANDS, *PCSRSS_SET_HISTORY_NUMBER_COMMANDS;
507
508 typedef struct
509 {
510 DWORD HistoryBufferSize;
511 DWORD NumberOfHistoryBuffers;
512 DWORD dwFlags;
513 } CSRSS_GET_HISTORY_INFO, *PCSRSS_GET_HISTORY_INFO,
514 CSRSS_SET_HISTORY_INFO, *PCSRSS_SET_HISTORY_INFO;;
515
516 typedef struct
517 {
518 UINT UniqueID;
519 } CSRSS_GET_TEMP_FILE, *PCSRSS_GET_TEMP_FILE;
520
521 #define CSR_API_MESSAGE_HEADER_SIZE(Type) (FIELD_OFFSET(CSR_API_MESSAGE, Data) + sizeof(Type))
522 #define CSRSS_MAX_WRITE_CONSOLE (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE))
523 #define CSRSS_MAX_WRITE_CONSOLE_OUTPUT_CHAR (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE_OUTPUT_CHAR))
524 #define CSRSS_MAX_WRITE_CONSOLE_OUTPUT_ATTRIB (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB))
525 #define CSRSS_MAX_READ_CONSOLE_OUTPUT_CHAR (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_READ_CONSOLE_OUTPUT_CHAR))
526 #define CSRSS_MAX_READ_CONSOLE_OUTPUT_ATTRIB (LPC_MAX_DATA_LENGTH - CSR_API_MESSAGE_HEADER_SIZE(CSRSS_READ_CONSOLE_OUTPUT_ATTRIB))
527
528 #define CREATE_PROCESS (0x0)
529 #define TERMINATE_PROCESS (0x1)
530 #define WRITE_CONSOLE (0x2)
531 #define READ_CONSOLE (0x3)
532 #define ALLOC_CONSOLE (0x4)
533 #define FREE_CONSOLE (0x5)
534 #define CONNECT_PROCESS (0x6)
535 #define SCREEN_BUFFER_INFO (0x7)
536 #define SET_CURSOR (0x8)
537 #define FILL_OUTPUT (0x9)
538 #define READ_INPUT (0xA)
539 #define WRITE_CONSOLE_OUTPUT_CHAR (0xB)
540 #define WRITE_CONSOLE_OUTPUT_ATTRIB (0xC)
541 #define FILL_OUTPUT_ATTRIB (0xD)
542 #define GET_CURSOR_INFO (0xE)
543 #define SET_CURSOR_INFO (0xF)
544 #define SET_ATTRIB (0x10)
545 #define GET_CONSOLE_MODE (0x11)
546 #define SET_CONSOLE_MODE (0x12)
547 #define CREATE_SCREEN_BUFFER (0x13)
548 #define SET_SCREEN_BUFFER (0x14)
549 #define SET_TITLE (0x15)
550 #define GET_TITLE (0x16)
551 #define WRITE_CONSOLE_OUTPUT (0x17)
552 #define FLUSH_INPUT_BUFFER (0x18)
553 #define SCROLL_CONSOLE_SCREEN_BUFFER (0x19)
554 #define READ_CONSOLE_OUTPUT_CHAR (0x1A)
555 #define READ_CONSOLE_OUTPUT_ATTRIB (0x1B)
556 #define GET_NUM_INPUT_EVENTS (0x1C)
557 #define REGISTER_SERVICES_PROCESS (0x1D)
558 #define EXIT_REACTOS (0x1E)
559 #define GET_SHUTDOWN_PARAMETERS (0x1F)
560 #define SET_SHUTDOWN_PARAMETERS (0x20)
561 #define PEEK_CONSOLE_INPUT (0x21)
562 #define READ_CONSOLE_OUTPUT (0x22)
563 #define WRITE_CONSOLE_INPUT (0x23)
564 #define GET_INPUT_HANDLE (0x24)
565 #define GET_OUTPUT_HANDLE (0x25)
566 #define CLOSE_HANDLE (0x26)
567 #define VERIFY_HANDLE (0x27)
568 #define DUPLICATE_HANDLE (0x28)
569 #define SETGET_CONSOLE_HW_STATE (0x29)
570 #define GET_CONSOLE_WINDOW (0x2A)
571 #define CREATE_DESKTOP (0x2B)
572 #define SHOW_DESKTOP (0x2C)
573 #define HIDE_DESKTOP (0x2D)
574 #define SET_CONSOLE_ICON (0x2E)
575 #define SET_LOGON_NOTIFY_WINDOW (0x2F)
576 #define REGISTER_LOGON_PROCESS (0x30)
577 #define GET_CONSOLE_CP (0x31)
578 #define SET_CONSOLE_CP (0x32)
579 #define GET_CONSOLE_OUTPUT_CP (0x33)
580 #define SET_CONSOLE_OUTPUT_CP (0x34)
581 #define GET_INPUT_WAIT_HANDLE (0x35)
582 #define GET_PROCESS_LIST (0x36)
583 #define START_SCREEN_SAVER (0x37)
584 #define ADD_CONSOLE_ALIAS (0x38)
585 #define GET_CONSOLE_ALIAS (0x39)
586 #define GET_ALL_CONSOLE_ALIASES (0x3A)
587 #define GET_ALL_CONSOLE_ALIASES_LENGTH (0x3B)
588 #define GET_CONSOLE_ALIASES_EXES (0x3C)
589 #define GET_CONSOLE_ALIASES_EXES_LENGTH (0x3D)
590 #define GENERATE_CTRL_EVENT (0x3E)
591 #define CREATE_THREAD (0x3F)
592 #define SET_SCREEN_BUFFER_SIZE (0x40)
593 #define GET_CONSOLE_SELECTION_INFO (0x41)
594 #define GET_COMMAND_HISTORY_LENGTH (0x42)
595 #define GET_COMMAND_HISTORY (0x43)
596 #define EXPUNGE_COMMAND_HISTORY (0x44)
597 #define SET_HISTORY_NUMBER_COMMANDS (0x45)
598 #define GET_HISTORY_INFO (0x46)
599 #define SET_HISTORY_INFO (0x47)
600 #define GET_TEMP_FILE (0x48)
601
602 /* Keep in sync with definition below. */
603 #define CSRSS_HEADER_SIZE (sizeof(PORT_MESSAGE) + sizeof(ULONG) + sizeof(NTSTATUS))
604
605 typedef struct _CSR_API_MESSAGE
606 {
607 PORT_MESSAGE Header;
608 PVOID CsrCaptureData;
609 ULONG Type;
610 NTSTATUS Status;
611 union
612 {
613 CSRSS_CREATE_PROCESS CreateProcessRequest;
614 CSRSS_CREATE_THREAD CreateThreadRequest;
615 CSRSS_CONNECT_PROCESS ConnectRequest;
616 CSRSS_WRITE_CONSOLE WriteConsoleRequest;
617 CSRSS_READ_CONSOLE ReadConsoleRequest;
618 CSRSS_ALLOC_CONSOLE AllocConsoleRequest;
619 CSRSS_SCREEN_BUFFER_INFO ScreenBufferInfoRequest;
620 CSRSS_SET_CURSOR SetCursorRequest;
621 CSRSS_FILL_OUTPUT FillOutputRequest;
622 CSRSS_READ_INPUT ReadInputRequest;
623 CSRSS_WRITE_CONSOLE_OUTPUT_CHAR WriteConsoleOutputCharRequest;
624 CSRSS_WRITE_CONSOLE_OUTPUT_ATTRIB WriteConsoleOutputAttribRequest;
625 CSRSS_FILL_OUTPUT_ATTRIB FillOutputAttribRequest;
626 CSRSS_SET_CURSOR_INFO SetCursorInfoRequest;
627 CSRSS_GET_CURSOR_INFO GetCursorInfoRequest;
628 CSRSS_SET_ATTRIB SetAttribRequest;
629 CSRSS_SET_CONSOLE_MODE SetConsoleModeRequest;
630 CSRSS_GET_CONSOLE_MODE GetConsoleModeRequest;
631 CSRSS_CREATE_SCREEN_BUFFER CreateScreenBufferRequest;
632 CSRSS_SET_SCREEN_BUFFER SetScreenBufferRequest;
633 CSRSS_SET_TITLE SetTitleRequest;
634 CSRSS_GET_TITLE GetTitleRequest;
635 CSRSS_WRITE_CONSOLE_OUTPUT WriteConsoleOutputRequest;
636 CSRSS_FLUSH_INPUT_BUFFER FlushInputBufferRequest;
637 CSRSS_SCROLL_CONSOLE_SCREEN_BUFFER ScrollConsoleScreenBufferRequest;
638 CSRSS_READ_CONSOLE_OUTPUT_CHAR ReadConsoleOutputCharRequest;
639 CSRSS_READ_CONSOLE_OUTPUT_ATTRIB ReadConsoleOutputAttribRequest;
640 CSRSS_GET_NUM_INPUT_EVENTS GetNumInputEventsRequest;
641 CSRSS_REGISTER_SERVICES_PROCESS RegisterServicesProcessRequest;
642 CSRSS_EXIT_REACTOS ExitReactosRequest;
643 CSRSS_SET_SHUTDOWN_PARAMETERS SetShutdownParametersRequest;
644 CSRSS_GET_SHUTDOWN_PARAMETERS GetShutdownParametersRequest;
645 CSRSS_PEEK_CONSOLE_INPUT PeekConsoleInputRequest;
646 CSRSS_READ_CONSOLE_OUTPUT ReadConsoleOutputRequest;
647 CSRSS_WRITE_CONSOLE_INPUT WriteConsoleInputRequest;
648 CSRSS_GET_INPUT_HANDLE GetInputHandleRequest;
649 CSRSS_GET_OUTPUT_HANDLE GetOutputHandleRequest;
650 CSRSS_CLOSE_HANDLE CloseHandleRequest;
651 CSRSS_VERIFY_HANDLE VerifyHandleRequest;
652 CSRSS_DUPLICATE_HANDLE DuplicateHandleRequest;
653 CSRSS_SETGET_CONSOLE_HW_STATE ConsoleHardwareStateRequest;
654 CSRSS_GET_CONSOLE_WINDOW GetConsoleWindowRequest;
655 CSRSS_CREATE_DESKTOP CreateDesktopRequest;
656 CSRSS_SHOW_DESKTOP ShowDesktopRequest;
657 CSRSS_HIDE_DESKTOP HideDesktopRequest;
658 CSRSS_SET_CONSOLE_ICON SetConsoleIconRequest;
659 CSRSS_SET_LOGON_NOTIFY_WINDOW SetLogonNotifyWindowRequest;
660 CSRSS_REGISTER_LOGON_PROCESS RegisterLogonProcessRequest;
661 CSRSS_GET_CONSOLE_CP GetConsoleCodePage;
662 CSRSS_SET_CONSOLE_CP SetConsoleCodePage;
663 CSRSS_GET_CONSOLE_OUTPUT_CP GetConsoleOutputCodePage;
664 CSRSS_SET_CONSOLE_OUTPUT_CP SetConsoleOutputCodePage;
665 CSRSS_GET_INPUT_WAIT_HANDLE GetConsoleInputWaitHandle;
666 CSRSS_GET_PROCESS_LIST GetProcessListRequest;
667 CSRSS_ADD_CONSOLE_ALIAS AddConsoleAlias;
668 CSRSS_GET_CONSOLE_ALIAS GetConsoleAlias;
669 CSRSS_GET_ALL_CONSOLE_ALIASES GetAllConsoleAlias;
670 CSRSS_GET_ALL_CONSOLE_ALIASES_LENGTH GetAllConsoleAliasesLength;
671 CSRSS_GET_CONSOLE_ALIASES_EXES GetConsoleAliasesExes;
672 CSRSS_GET_CONSOLE_ALIASES_EXES_LENGTH GetConsoleAliasesExesLength;
673 CSRSS_GENERATE_CTRL_EVENT GenerateCtrlEvent;
674 CSRSS_SET_SCREEN_BUFFER_SIZE SetScreenBufferSize;
675 CSRSS_GET_CONSOLE_SELECTION_INFO GetConsoleSelectionInfo;
676 CSRSS_GET_COMMAND_HISTORY_LENGTH GetCommandHistoryLength;
677 CSRSS_GET_COMMAND_HISTORY GetCommandHistory;
678 CSRSS_EXPUNGE_COMMAND_HISTORY ExpungeCommandHistory;
679 CSRSS_SET_HISTORY_NUMBER_COMMANDS SetHistoryNumberCommands;
680 CSRSS_GET_HISTORY_INFO GetHistoryInfo;
681 CSRSS_SET_HISTORY_INFO SetHistoryInfo;
682 CSRSS_GET_TEMP_FILE GetTempFile;
683 } Data;
684 } CSR_API_MESSAGE, *PCSR_API_MESSAGE;
685
686 /* Types used in the new CSR. Temporarly here for proper compile of NTDLL */
687 #define CSR_SRV_SERVER 0
688
689 #define CsrSrvClientConnect 0
690 #define CsrSrvIdentifyAlertableThread 3
691 #define CsrSrvSetPriorityClass 4
692
693 #define CSR_MAKE_OPCODE(s,m) ((s) << 16) | (m)
694
695 typedef struct _CSR_CONNECTION_INFO
696 {
697 ULONG Version;
698 ULONG Unknown;
699 HANDLE ObjectDirectory;
700 PVOID SharedSectionBase;
701 PVOID SharedSectionHeap;
702 PVOID SharedSectionData;
703 ULONG DebugFlags;
704 ULONG Unknown2[3];
705 HANDLE ProcessId;
706 } CSR_CONNECTION_INFO, *PCSR_CONNECTION_INFO;
707
708 typedef struct _CSR_CLIENT_CONNECT
709 {
710 ULONG ServerId;
711 PVOID ConnectionInfo;
712 ULONG ConnectionInfoSize;
713 } CSR_CLIENT_CONNECT, *PCSR_CLIENT_CONNECT;
714
715 typedef struct _CSR_IDENTIFY_ALTERTABLE_THREAD
716 {
717 CLIENT_ID Cid;
718 } CSR_IDENTIFY_ALTERTABLE_THREAD, *PCSR_IDENTIFY_ALTERTABLE_THREAD;
719
720 typedef struct _CSR_SET_PRIORITY_CLASS
721 {
722 HANDLE hProcess;
723 ULONG PriorityClass;
724 } CSR_SET_PRIORITY_CLASS, *PCSR_SET_PRIORITY_CLASS;
725
726 typedef struct _CSR_API_MESSAGE2
727 {
728 PORT_MESSAGE Header;
729 union
730 {
731 CSR_CONNECTION_INFO ConnectionInfo;
732 struct
733 {
734 PVOID CsrCaptureData;
735 CSR_API_NUMBER Opcode;
736 ULONG Status;
737 ULONG Reserved;
738 union
739 {
740 CSR_CLIENT_CONNECT ClientConnect;
741 CSR_SET_PRIORITY_CLASS SetPriorityClass;
742 CSR_IDENTIFY_ALTERTABLE_THREAD IdentifyAlertableThread;
743 };
744 };
745 };
746 } CSR_API_MESSAGE2, *PCSR_API_MESSAGE2;
747
748 typedef struct _CSR_CAPTURE_BUFFER
749 {
750 ULONG Size;
751 struct _CSR_CAPTURE_BUFFER *PreviousCaptureBuffer;
752 ULONG PointerCount;
753 ULONG_PTR BufferEnd;
754 ULONG_PTR PointerArray[1];
755 } CSR_CAPTURE_BUFFER, *PCSR_CAPTURE_BUFFER;
756
757 #endif /* __INCLUDE_CSRSS_CSRSS_H */