[KERNEL32][CONSRV]
[reactos.git] / include / reactos / subsys / win / conmsg.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Console Server DLL
4 * FILE: include/reactos/subsys/win/conmsg.h
5 * PURPOSE: Public definitions for communication
6 * between Console API Clients and Servers
7 * PROGRAMMERS: Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #ifndef _CONMSG_H
11 #define _CONMSG_H
12
13 #pragma once
14
15 #define CONSRV_SERVERDLL_INDEX 2
16 #define CONSRV_FIRST_API_NUMBER 512
17
18 // Windows Server 2003 table from http://j00ru.vexillium.org/csrss_list/api_list.html#Windows_2k3
19 typedef enum _CONSRV_API_NUMBER
20 {
21 ConsolepOpenConsole = CONSRV_FIRST_API_NUMBER,
22 ConsolepGetConsoleInput,
23 ConsolepWriteConsoleInput,
24 ConsolepReadConsoleOutput,
25 ConsolepWriteConsoleOutput,
26 ConsolepReadConsoleOutputString,
27 ConsolepWriteConsoleOutputString,
28 ConsolepFillConsoleOutput,
29 ConsolepGetMode,
30 ConsolepGetNumberOfFonts,
31 ConsolepGetNumberOfInputEvents,
32 ConsolepGetScreenBufferInfo,
33 ConsolepGetCursorInfo,
34 ConsolepGetMouseInfo,
35 ConsolepGetFontInfo,
36 ConsolepGetFontSize,
37 ConsolepGetCurrentFont,
38 ConsolepSetMode,
39 ConsolepSetActiveScreenBuffer,
40 ConsolepFlushInputBuffer,
41 ConsolepGetLargestWindowSize,
42 ConsolepSetScreenBufferSize,
43 ConsolepSetCursorPosition,
44 ConsolepSetCursorInfo,
45 ConsolepSetWindowInfo,
46 ConsolepScrollScreenBuffer,
47 ConsolepSetTextAttribute,
48 ConsolepSetFont,
49 ConsolepSetIcon,
50 ConsolepReadConsole,
51 ConsolepWriteConsole,
52 ConsolepDuplicateHandle,
53 ConsolepGetHandleInformation,
54 ConsolepSetHandleInformation,
55 ConsolepCloseHandle,
56 ConsolepVerifyIoHandle,
57 ConsolepAlloc, // Not present in Win7
58 ConsolepFree, // Not present in Win7
59 ConsolepGetTitle,
60 ConsolepSetTitle,
61 ConsolepCreateScreenBuffer,
62 ConsolepInvalidateBitMapRect,
63 ConsolepVDMOperation,
64 ConsolepSetCursor,
65 ConsolepShowCursor,
66 ConsolepMenuControl,
67 ConsolepSetPalette,
68 ConsolepSetDisplayMode,
69 ConsolepRegisterVDM,
70 ConsolepGetHardwareState,
71 ConsolepSetHardwareState,
72 ConsolepGetDisplayMode,
73 ConsolepAddAlias,
74 ConsolepGetAlias,
75 ConsolepGetAliasesLength,
76 ConsolepGetAliasExesLength,
77 ConsolepGetAliases,
78 ConsolepGetAliasExes,
79 ConsolepExpungeCommandHistory,
80 ConsolepSetNumberOfCommands,
81 ConsolepGetCommandHistoryLength,
82 ConsolepGetCommandHistory,
83 ConsolepSetCommandHistoryMode, // Not present in Vista+
84 ConsolepGetCP,
85 ConsolepSetCP,
86 ConsolepSetKeyShortcuts,
87 ConsolepSetMenuClose,
88 ConsolepNotifyLastClose,
89 ConsolepGenerateCtrlEvent,
90 ConsolepGetKeyboardLayoutName,
91 ConsolepGetConsoleWindow,
92 ConsolepCharType,
93 ConsolepSetLocalEUDC,
94 ConsolepSetCursorMode,
95 ConsolepGetCursorMode,
96 ConsolepRegisterOS2,
97 ConsolepSetOS2OemFormat,
98 ConsolepGetNlsMode,
99 ConsolepSetNlsMode,
100 ConsolepRegisterConsoleIME, // Not present in Win7
101 ConsolepUnregisterConsoleIME, // Not present in Win7
102 // ConsolepQueryConsoleIME, // Added only in Vista and Win2k8, not present in Win7
103 ConsolepGetLangId,
104 ConsolepAttach, // Not present in Win7
105 ConsolepGetSelectionInfo,
106 ConsolepGetProcessList,
107
108 ConsolepGetHistory, // Added in Vista+
109 ConsolepSetHistory, // Added in Vista+
110 // ConsolepSetCurrentFont, // Added in Vista+
111 // ConsolepSetScreenBufferInfo, // Added in Vista+
112 // ConsolepClientConnect, // Added in Win7
113
114 ConsolepMaxApiNumber
115 } CONSRV_API_NUMBER, *PCONSRV_API_NUMBER;
116
117 //
118 // See http://msdn.microsoft.com/en-us/library/windows/desktop/bb773359(v=vs.85).aspx
119 //
120 typedef struct _CONSOLE_PROPERTIES
121 {
122 WORD wFillAttribute;
123 WORD wPopupFillAttribute;
124
125 //
126 // Not on MSDN, but show up in binary
127 //
128 WORD wShowWindow;
129 WORD wUnknown;
130
131 COORD dwScreenBufferSize;
132 COORD dwWindowSize;
133 COORD dwWindowOrigin;
134 DWORD nFont;
135 DWORD nInputBufferSize;
136 COORD dwFontSize;
137 UINT uFontFamily;
138 UINT uFontWeight;
139 WCHAR FaceName[LF_FACESIZE];
140 UINT uCursorSize;
141 BOOL bFullScreen;
142 BOOL bQuickEdit;
143 BOOL bInsertMode;
144 BOOL bAutoPosition;
145 UINT uHistoryBufferSize;
146 UINT uNumberOfHistoryBuffers;
147 BOOL bHistoryNoDup;
148 COLORREF ColorTable[16];
149
150 //NT_FE_CONSOLE_PROPS
151 UINT uCodePage;
152 } CONSOLE_PROPERTIES;
153
154 //
155 // To minimize code changes, some fields were put here even though they really only belong in
156 // CONSRV_API_CONNECTINFO. Do not change the ordering however, as it's required for Windows
157 // compatibility.
158 //
159 typedef struct _CONSOLE_START_INFO
160 {
161 INT IconIndex;
162 HICON IconHandle1;
163 HICON IconHandle2;
164 DWORD dwHotKey;
165 DWORD dwStartupFlags;
166 CONSOLE_PROPERTIES;
167 BOOLEAN ConsoleNeeded; // Used for GUI apps only.
168 LPTHREAD_START_ROUTINE CtrlDispatcher;
169 LPTHREAD_START_ROUTINE ImeDispatcher;
170 LPTHREAD_START_ROUTINE PropDispatcher;
171 ULONG TitleLength;
172 WCHAR ConsoleTitle[MAX_PATH + 1]; // Console title or full path to the startup shortcut
173 ULONG DesktopLength;
174 PWCHAR DesktopPath;
175 ULONG AppNameLength;
176 WCHAR AppPath[128]; // Full path of the launched app
177 ULONG IconPathLength;
178 WCHAR IconPath[MAX_PATH + 1]; // Path to the file containing the icon
179 } CONSOLE_START_INFO, *PCONSOLE_START_INFO;
180
181 typedef struct _CONSRV_API_CONNECTINFO
182 {
183 HANDLE ConsoleHandle;
184 HANDLE InputWaitHandle;
185 HANDLE InputHandle;
186 HANDLE OutputHandle;
187 HANDLE ErrorHandle;
188 HANDLE Event1;
189 HANDLE Event2;
190 /* Adapted from CONSOLE_ALLOCCONSOLE */
191 CONSOLE_START_INFO ConsoleStartInfo;
192 } CONSRV_API_CONNECTINFO, *PCONSRV_API_CONNECTINFO;
193
194 #if defined(_M_IX86)
195 C_ASSERT(sizeof(CONSRV_API_CONNECTINFO) == 0x638);
196 #endif
197
198 typedef struct
199 {
200 HANDLE ConsoleHandle;
201 ULONG ProcessCount;
202 PDWORD ProcessIdsList;
203 } CONSOLE_GETPROCESSLIST, *PCONSOLE_GETPROCESSLIST;
204
205 typedef struct
206 {
207 HANDLE ConsoleHandle;
208 DWORD CtrlEvent;
209 DWORD ProcessGroupId;
210 } CONSOLE_GENERATECTRLEVENT, *PCONSOLE_GENERATECTRLEVENT;
211
212 typedef struct
213 {
214 HANDLE ConsoleHandle;
215 } CONSOLE_NOTIFYLASTCLOSE, *PCONSOLE_NOTIFYLASTCLOSE;
216
217
218
219 typedef struct
220 {
221 HANDLE OutputHandle;
222
223 BOOL Unicode;
224 ULONG NrCharactersToWrite;
225 ULONG NrCharactersWritten;
226
227 ULONG BufferSize;
228 PVOID Buffer;
229 } CONSOLE_WRITECONSOLE, *PCONSOLE_WRITECONSOLE;
230
231 typedef struct
232 {
233 HANDLE InputHandle;
234
235 BOOL Unicode;
236 ULONG NrCharactersToRead;
237 ULONG NrCharactersRead;
238
239 UNICODE_STRING ExeName;
240 DWORD CtrlWakeupMask;
241 DWORD ControlKeyState;
242
243 ULONG BufferSize;
244 PVOID Buffer;
245 } CONSOLE_READCONSOLE, *PCONSOLE_READCONSOLE;
246
247 typedef struct
248 {
249 PCONSOLE_START_INFO ConsoleStartInfo;
250
251 HANDLE ConsoleHandle;
252 HANDLE InputHandle;
253 HANDLE OutputHandle;
254 HANDLE ErrorHandle;
255 HANDLE InputWaitHandle;
256 LPTHREAD_START_ROUTINE CtrlDispatcher;
257 LPTHREAD_START_ROUTINE PropDispatcher;
258 } CONSOLE_ALLOCCONSOLE, *PCONSOLE_ALLOCCONSOLE;
259
260 typedef struct
261 {
262 DWORD ProcessId; // If ProcessId == ATTACH_PARENT_PROCESS == -1, then attach the current process to its parent process console.
263 HANDLE ConsoleHandle;
264 HANDLE InputHandle;
265 HANDLE OutputHandle;
266 HANDLE ErrorHandle;
267 HANDLE InputWaitHandle;
268 LPTHREAD_START_ROUTINE CtrlDispatcher;
269 LPTHREAD_START_ROUTINE PropDispatcher;
270 } CONSOLE_ATTACHCONSOLE, *PCONSOLE_ATTACHCONSOLE;
271
272 typedef struct
273 {
274 ULONG Dummy;
275 } CONSOLE_FREECONSOLE, *PCONSOLE_FREECONSOLE;
276
277 typedef struct
278 {
279 HANDLE ConsoleHandle;
280 HANDLE OutputHandle;
281 COORD ScreenBufferSize;
282 COORD CursorPosition;
283 COORD ViewOrigin;
284 WORD Attributes;
285 COORD ViewSize;
286 COORD MaximumViewSize;
287 } CONSOLE_GETSCREENBUFFERINFO, *PCONSOLE_GETSCREENBUFFERINFO;
288
289 typedef struct
290 {
291 HANDLE ConsoleHandle;
292 HANDLE OutputHandle;
293 COORD Position;
294 } CONSOLE_SETCURSORPOSITION, *PCONSOLE_SETCURSORPOSITION;
295
296 typedef struct
297 {
298 HANDLE ConsoleHandle;
299 HANDLE OutputHandle;
300 BOOL Show;
301 INT RefCount;
302 } CONSOLE_SHOWCURSOR, *PCONSOLE_SHOWCURSOR;
303
304 typedef struct
305 {
306 HANDLE ConsoleHandle;
307 HANDLE OutputHandle;
308 HCURSOR CursorHandle;
309 } CONSOLE_SETCURSOR, *PCONSOLE_SETCURSOR;
310
311 typedef struct
312 {
313 HANDLE ConsoleHandle;
314 HANDLE OutputHandle;
315 CONSOLE_CURSOR_INFO Info;
316 /*
317 DWORD Size;
318 BOOLEAN Visible;
319 */
320 } CONSOLE_GETSETCURSORINFO, *PCONSOLE_GETSETCURSORINFO;
321
322 typedef struct
323 {
324 HANDLE ConsoleHandle;
325 ULONG NumButtons;
326 } CONSOLE_GETMOUSEINFO, *PCONSOLE_GETMOUSEINFO;
327
328 typedef struct
329 {
330 HANDLE ConsoleHandle;
331 HANDLE OutputHandle;
332 WORD Attributes;
333 } CONSOLE_SETTEXTATTRIB, *PCONSOLE_SETTEXTATTRIB;
334
335 typedef struct
336 {
337 HANDLE ConsoleHandle;
338 HANDLE Handle;
339 DWORD Mode;
340 } CONSOLE_GETSETCONSOLEMODE, *PCONSOLE_GETSETCONSOLEMODE;
341
342 typedef struct
343 {
344 HANDLE ConsoleHandle;
345 DWORD DisplayMode; // ModeFlags
346 } CONSOLE_GETDISPLAYMODE, *PCONSOLE_GETDISPLAYMODE;
347
348 typedef struct
349 {
350 HANDLE ConsoleHandle;
351 HANDLE OutputHandle;
352 DWORD DisplayMode; // ModeFlags
353 COORD NewSBDim;
354 HANDLE EventHandle;
355 } CONSOLE_SETDISPLAYMODE, *PCONSOLE_SETDISPLAYMODE;
356
357 /*
358 * Console hardware states.
359 */
360 #define CONSOLE_HARDWARE_STATE_GDI_MANAGED 0
361 #define CONSOLE_HARDWARE_STATE_DIRECT 1
362
363 typedef struct
364 {
365 HANDLE ConsoleHandle;
366 HANDLE OutputHandle;
367 DWORD Flags;
368 DWORD State;
369 } CONSOLE_GETSETHWSTATE, *PCONSOLE_GETSETHWSTATE;
370
371
372
373 typedef struct
374 {
375 HANDLE ConsoleHandle;
376 DWORD DesiredAccess;
377 BOOL InheritHandle;
378 DWORD ShareMode;
379 /* Type of the screen buffer: CONSOLE_TEXTMODE_BUFFER or CONSOLE_GRAPHICS_BUFFER */
380 DWORD ScreenBufferType;
381 /*
382 * This structure holds the initialization information
383 * for graphics screen buffers.
384 */
385 CONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo;
386 HANDLE hMutex;
387 PVOID lpBitMap;
388 HANDLE OutputHandle; /* Handle to newly created screen buffer */
389 } CONSOLE_CREATESCREENBUFFER, *PCONSOLE_CREATESCREENBUFFER;
390
391 typedef struct
392 {
393 HANDLE ConsoleHandle;
394 HANDLE OutputHandle; /* Handle to screen buffer to switch to */
395 } CONSOLE_SETACTIVESCREENBUFFER, *PCONSOLE_SETACTIVESCREENBUFFER;
396
397 typedef struct
398 {
399 HANDLE ConsoleHandle;
400 HANDLE OutputHandle;
401 SMALL_RECT Region;
402 } CONSOLE_INVALIDATEDIBITS, *PCONSOLE_INVALIDATEDIBITS;
403
404 typedef struct
405 {
406 HANDLE ConsoleHandle;
407 HANDLE OutputHandle;
408 HPALETTE PaletteHandle;
409 UINT Usage;
410 } CONSOLE_SETPALETTE, *PCONSOLE_SETPALETTE;
411
412 typedef struct
413 {
414 HANDLE ConsoleHandle;
415 DWORD Length;
416 PVOID Title;
417 BOOLEAN Unicode;
418 } CONSOLE_GETSETCONSOLETITLE, *PCONSOLE_GETSETCONSOLETITLE;
419
420 typedef struct
421 {
422 HANDLE OutputHandle;
423
424 BOOL Unicode;
425 COORD BufferSize;
426 COORD BufferCoord; // WriteCoord
427 SMALL_RECT WriteRegion;
428 PCHAR_INFO CharInfo;
429 } CONSOLE_WRITEOUTPUT, *PCONSOLE_WRITEOUTPUT;
430
431 typedef struct
432 {
433 HANDLE ConsoleHandle;
434 HANDLE InputHandle;
435 } CONSOLE_FLUSHINPUTBUFFER, *PCONSOLE_FLUSHINPUTBUFFER;
436
437 typedef struct
438 {
439 HANDLE ConsoleHandle;
440 HANDLE OutputHandle;
441 SMALL_RECT ScrollRectangle;
442 SMALL_RECT ClipRectangle;
443 BOOL UseClipRectangle;
444 COORD DestinationOrigin;
445 CHAR_INFO Fill;
446 BOOLEAN Unicode;
447 } CONSOLE_SCROLLSCREENBUFFER, *PCONSOLE_SCROLLSCREENBUFFER;
448
449
450 /*
451 * An attribute or a character are instances of the same entity, namely
452 * a "code" (what would be called an (ANSI) escape sequence). Therefore
453 * encode them inside the same structure.
454 */
455 typedef enum _CODE_TYPE
456 {
457 CODE_ASCII = 0x01,
458 CODE_UNICODE = 0x02,
459 CODE_ATTRIBUTE = 0x03
460 } CODE_TYPE;
461
462 typedef union _CODE_ELEMENT
463 {
464 CHAR AsciiChar;
465 WCHAR UnicodeChar;
466 WORD Attribute;
467 } CODE_ELEMENT, *PCODE_ELEMENT;
468
469 typedef struct
470 {
471 HANDLE ConsoleHandle;
472 HANDLE OutputHandle;
473 COORD Coord;
474
475 CODE_TYPE CodeType;
476 CHAR CodeStaticBuffer[80];
477 union
478 {
479 PVOID pCode;
480 PCHAR AsciiChar;
481 PWCHAR UnicodeChar;
482 PWORD Attribute;
483 } pCode; // Either a pointer to a character or to an attribute.
484
485 ULONG NumCodes;
486 } CONSOLE_READOUTPUTCODE , *PCONSOLE_READOUTPUTCODE,
487 CONSOLE_WRITEOUTPUTCODE, *PCONSOLE_WRITEOUTPUTCODE;
488
489 typedef struct
490 {
491 HANDLE ConsoleHandle;
492 HANDLE OutputHandle;
493 COORD WriteCoord;
494
495 CODE_TYPE CodeType;
496 CODE_ELEMENT Code; // Either a character or an attribute.
497
498 ULONG NumCodes;
499 } CONSOLE_FILLOUTPUTCODE, *PCONSOLE_FILLOUTPUTCODE;
500
501 typedef struct
502 {
503 HANDLE ConsoleHandle;
504 HANDLE InputHandle;
505 INPUT_RECORD RecordStaticBuffer[5];
506 PINPUT_RECORD RecordBufPtr;
507 ULONG NumRecords;
508 WORD Flags;
509 BOOLEAN Unicode;
510 } CONSOLE_GETINPUT, *PCONSOLE_GETINPUT;
511
512 typedef struct
513 {
514 HANDLE ConsoleHandle;
515 HANDLE InputHandle;
516 INPUT_RECORD RecordStaticBuffer[5];
517 PINPUT_RECORD RecordBufPtr;
518 ULONG NumRecords;
519 BOOLEAN Unicode;
520 BOOLEAN AppendToEnd;
521 } CONSOLE_WRITEINPUT, *PCONSOLE_WRITEINPUT;
522
523 typedef struct
524 {
525 HANDLE OutputHandle;
526
527 BOOL Unicode;
528 COORD BufferSize;
529 COORD BufferCoord;
530 SMALL_RECT ReadRegion;
531 PCHAR_INFO CharInfo;
532 } CONSOLE_READOUTPUT, *PCONSOLE_READOUTPUT;
533
534 typedef struct
535 {
536 HANDLE ConsoleHandle;
537 HANDLE InputHandle;
538 ULONG NumberOfEvents;
539 } CONSOLE_GETNUMINPUTEVENTS, *PCONSOLE_GETNUMINPUTEVENTS;
540
541
542
543 typedef struct
544 {
545 HANDLE ConsoleHandle;
546 HANDLE Handle;
547 } CONSOLE_CLOSEHANDLE, *PCONSOLE_CLOSEHANDLE;
548
549 typedef struct
550 {
551 BOOL IsValid;
552 HANDLE ConsoleHandle;
553 HANDLE Handle;
554 } CONSOLE_VERIFYHANDLE, *PCONSOLE_VERIFYHANDLE;
555
556 typedef struct
557 {
558 HANDLE ConsoleHandle;
559 HANDLE SourceHandle;
560 DWORD DesiredAccess;
561 BOOLEAN InheritHandle;
562 DWORD Options;
563 HANDLE TargetHandle;
564 } CONSOLE_DUPLICATEHANDLE, *PCONSOLE_DUPLICATEHANDLE;
565
566 typedef struct
567 {
568 HANDLE ConsoleHandle;
569 HANDLE Handle;
570 DWORD Flags;
571 } CONSOLE_GETHANDLEINFO, *PCONSOLE_GETHANDLEINFO;
572
573 typedef struct
574 {
575 HANDLE ConsoleHandle;
576 HANDLE Handle;
577 DWORD Mask;
578 DWORD Flags;
579 } CONSOLE_SETHANDLEINFO, *PCONSOLE_SETHANDLEINFO;
580
581 /*
582 * Type of handles.
583 */
584 typedef enum _CONSOLE_HANDLE_TYPE
585 {
586 HANDLE_INPUT = 0x01,
587 HANDLE_OUTPUT = 0x02
588 } CONSOLE_HANDLE_TYPE;
589
590 typedef struct
591 {
592 HANDLE ConsoleHandle;
593 CONSOLE_HANDLE_TYPE HandleType;
594 DWORD DesiredAccess;
595 BOOL InheritHandle;
596 DWORD ShareMode;
597 HANDLE Handle;
598 } CONSOLE_OPENCONSOLE, *PCONSOLE_OPENCONSOLE;
599
600
601
602 typedef struct
603 {
604 HANDLE ConsoleHandle;
605 HANDLE OutputHandle;
606 COORD Size;
607 } CONSOLE_GETLARGESTWINDOWSIZE, *PCONSOLE_GETLARGESTWINDOWSIZE;
608
609 typedef struct
610 {
611 HANDLE ConsoleHandle;
612 HANDLE OutputHandle;
613 DWORD CmdIdLow;
614 DWORD CmdIdHigh;
615 HMENU MenuHandle;
616 } CONSOLE_MENUCONTROL, *PCONSOLE_MENUCONTROL;
617
618 typedef struct
619 {
620 HANDLE ConsoleHandle;
621 BOOL Enable;
622 } CONSOLE_SETMENUCLOSE, *PCONSOLE_SETMENUCLOSE;
623
624 typedef struct
625 {
626 HANDLE ConsoleHandle;
627 HANDLE OutputHandle;
628 BOOL Absolute;
629 SMALL_RECT WindowRect; // New console window position in the screen-buffer frame (Absolute == TRUE)
630 // or in the old window position frame (Absolute == FALSE).
631 } CONSOLE_SETWINDOWINFO, *PCONSOLE_SETWINDOWINFO;
632
633 typedef struct
634 {
635 HANDLE ConsoleHandle;
636 HWND WindowHandle;
637 } CONSOLE_GETWINDOW, *PCONSOLE_GETWINDOW;
638
639 typedef struct
640 {
641 HANDLE ConsoleHandle;
642 HICON IconHandle;
643 } CONSOLE_SETICON, *PCONSOLE_SETICON;
644
645
646
647 typedef struct
648 {
649 HANDLE ConsoleHandle;
650 USHORT SourceLength;
651 USHORT TargetLength; // Also used for storing the number of bytes written.
652 USHORT ExeLength;
653 PVOID Source;
654 PVOID Target;
655 PVOID ExeName;
656 BOOLEAN Unicode;
657 BOOLEAN Unicode2;
658 } CONSOLE_ADDGETALIAS, *PCONSOLE_ADDGETALIAS;
659
660 typedef struct
661 {
662 HANDLE ConsoleHandle;
663 USHORT ExeLength;
664 PVOID ExeName;
665 BOOLEAN Unicode;
666 BOOLEAN Unicode2;
667 ULONG AliasesBufferLength;
668 PVOID AliasesBuffer;
669 } CONSOLE_GETALLALIASES, *PCONSOLE_GETALLALIASES;
670
671 typedef struct
672 {
673 HANDLE ConsoleHandle;
674 USHORT ExeLength;
675 PVOID ExeName;
676 ULONG Length;
677 BOOLEAN Unicode;
678 BOOLEAN Unicode2;
679 } CONSOLE_GETALLALIASESLENGTH, *PCONSOLE_GETALLALIASESLENGTH;
680
681 typedef struct
682 {
683 HANDLE ConsoleHandle;
684 ULONG Length ; // ExeLength; // ExesLength
685 PVOID ExeNames;
686 BOOLEAN Unicode;
687 } CONSOLE_GETALIASESEXES, *PCONSOLE_GETALIASESEXES;
688
689 typedef struct
690 {
691 HANDLE ConsoleHandle;
692 ULONG Length;
693 BOOLEAN Unicode;
694 } CONSOLE_GETALIASESEXESLENGTH, *PCONSOLE_GETALIASESEXESLENGTH;
695
696
697
698 typedef struct
699 {
700 HANDLE ConsoleHandle;
701 ULONG HistoryLength;
702 PVOID History;
703 USHORT ExeLength;
704 PVOID ExeName;
705 BOOLEAN Unicode;
706 BOOLEAN Unicode2;
707 } CONSOLE_GETCOMMANDHISTORY, *PCONSOLE_GETCOMMANDHISTORY;
708
709 typedef struct
710 {
711 HANDLE ConsoleHandle;
712 ULONG HistoryLength;
713 USHORT ExeLength;
714 PVOID ExeName;
715 BOOLEAN Unicode;
716 BOOLEAN Unicode2;
717 } CONSOLE_GETCOMMANDHISTORYLENGTH, *PCONSOLE_GETCOMMANDHISTORYLENGTH;
718
719 typedef struct
720 {
721 HANDLE ConsoleHandle;
722 USHORT ExeLength;
723 PVOID ExeName;
724 BOOLEAN Unicode;
725 BOOLEAN Unicode2;
726 } CONSOLE_EXPUNGECOMMANDHISTORY, *PCONSOLE_EXPUNGECOMMANDHISTORY;
727
728 typedef struct
729 {
730 UINT HistoryBufferSize;
731 UINT NumberOfHistoryBuffers;
732 DWORD dwFlags;
733 } CONSOLE_GETSETHISTORYINFO, *PCONSOLE_GETSETHISTORYINFO;
734
735 typedef struct
736 {
737 HANDLE ConsoleHandle;
738 ULONG NumCommands;
739 USHORT ExeLength;
740 PVOID ExeName;
741 BOOLEAN Unicode;
742 BOOLEAN Unicode2;
743 } CONSOLE_SETHISTORYNUMBERCOMMANDS, *PCONSOLE_SETHISTORYNUMBERCOMMANDS;
744
745 typedef struct
746 {
747 HANDLE ConsoleHandle;
748 ULONG Mode;
749 } CONSOLE_SETHISTORYMODE, *PCONSOLE_SETHISTORYMODE;
750
751
752
753 typedef struct
754 {
755 HANDLE ConsoleHandle;
756 HANDLE OutputHandle;
757 COORD Size;
758 } CONSOLE_SETSCREENBUFFERSIZE, *PCONSOLE_SETSCREENBUFFERSIZE;
759
760 typedef struct
761 {
762 HANDLE ConsoleHandle;
763 CONSOLE_SELECTION_INFO Info;
764 } CONSOLE_GETSELECTIONINFO, *PCONSOLE_GETSELECTIONINFO;
765
766 typedef struct
767 {
768 HANDLE ConsoleHandle;
769 UINT CodePage;
770 BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page
771 } CONSOLE_GETINPUTOUTPUTCP, *PCONSOLE_GETINPUTOUTPUTCP;
772
773 typedef struct
774 {
775 HANDLE ConsoleHandle;
776 UINT CodePage;
777 BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page
778 HANDLE EventHandle;
779 } CONSOLE_SETINPUTOUTPUTCP, *PCONSOLE_SETINPUTOUTPUTCP;
780
781 typedef struct _CONSOLE_API_MESSAGE
782 {
783 PORT_MESSAGE Header;
784
785 PCSR_CAPTURE_BUFFER CsrCaptureData;
786 CSR_API_NUMBER ApiNumber;
787 NTSTATUS Status;
788 ULONG Reserved;
789 union
790 {
791 /* Console initialization and uninitialization */
792 CONSOLE_ALLOCCONSOLE AllocConsoleRequest;
793 CONSOLE_ATTACHCONSOLE AttachConsoleRequest;
794 CONSOLE_FREECONSOLE FreeConsoleRequest;
795
796 /* Processes */
797 CONSOLE_GETPROCESSLIST GetProcessListRequest;
798 CONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest;
799 CONSOLE_NOTIFYLASTCLOSE NotifyLastCloseRequest;
800
801 /* Handles */
802 CONSOLE_OPENCONSOLE OpenConsoleRequest;
803 CONSOLE_CLOSEHANDLE CloseHandleRequest;
804 CONSOLE_VERIFYHANDLE VerifyHandleRequest;
805 CONSOLE_DUPLICATEHANDLE DuplicateHandleRequest;
806 CONSOLE_GETHANDLEINFO GetHandleInfoRequest;
807 CONSOLE_SETHANDLEINFO SetHandleInfoRequest;
808
809 /* Cursor & Mouse */
810 CONSOLE_SHOWCURSOR ShowCursorRequest;
811 CONSOLE_SETCURSOR SetCursorRequest;
812 CONSOLE_GETSETCURSORINFO CursorInfoRequest;
813 CONSOLE_SETCURSORPOSITION SetCursorPositionRequest;
814 CONSOLE_GETMOUSEINFO GetMouseInfoRequest;
815
816 /* Screen-buffer */
817 CONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest;
818 CONSOLE_SETACTIVESCREENBUFFER SetScreenBufferRequest;
819 CONSOLE_GETSCREENBUFFERINFO ScreenBufferInfoRequest;
820 CONSOLE_SETSCREENBUFFERSIZE SetScreenBufferSizeRequest;
821 CONSOLE_SCROLLSCREENBUFFER ScrollScreenBufferRequest;
822
823 CONSOLE_GETSELECTIONINFO GetSelectionInfoRequest;
824 CONSOLE_FLUSHINPUTBUFFER FlushInputBufferRequest;
825
826 /* Console mode */
827 CONSOLE_GETSETCONSOLEMODE ConsoleModeRequest;
828 CONSOLE_GETDISPLAYMODE GetDisplayModeRequest;
829 CONSOLE_SETDISPLAYMODE SetDisplayModeRequest;
830 CONSOLE_GETSETHWSTATE HardwareStateRequest;
831
832 /* Console window */
833 CONSOLE_INVALIDATEDIBITS InvalidateDIBitsRequest;
834 CONSOLE_SETPALETTE SetPaletteRequest;
835 CONSOLE_GETSETCONSOLETITLE TitleRequest;
836 CONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest;
837 CONSOLE_MENUCONTROL MenuControlRequest;
838 CONSOLE_SETMENUCLOSE SetMenuCloseRequest;
839 CONSOLE_SETWINDOWINFO SetWindowInfoRequest;
840 CONSOLE_GETWINDOW GetWindowRequest;
841 CONSOLE_SETICON SetIconRequest;
842
843 /* Read */
844 CONSOLE_READCONSOLE ReadConsoleRequest; // SrvReadConsole / ReadConsole
845 CONSOLE_GETINPUT GetInputRequest; // SrvGetConsoleInput / PeekConsoleInput & ReadConsoleInput
846 CONSOLE_READOUTPUT ReadOutputRequest; // SrvReadConsoleOutput / ReadConsoleOutput
847 CONSOLE_READOUTPUTCODE ReadOutputCodeRequest; // SrvReadConsoleOutputString / ReadConsoleOutputAttribute & ReadConsoleOutputCharacter
848 CONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest;
849
850 /* Write */
851 CONSOLE_WRITECONSOLE WriteConsoleRequest; // SrvWriteConsole / WriteConsole
852 CONSOLE_WRITEINPUT WriteInputRequest;
853 CONSOLE_WRITEOUTPUT WriteOutputRequest;
854 CONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest;
855
856 CONSOLE_FILLOUTPUTCODE FillOutputRequest;
857 CONSOLE_SETTEXTATTRIB SetTextAttribRequest;
858
859 /* Aliases */
860 CONSOLE_ADDGETALIAS ConsoleAliasRequest;
861 CONSOLE_GETALLALIASES GetAllAliasesRequest;
862 CONSOLE_GETALLALIASESLENGTH GetAllAliasesLengthRequest;
863 CONSOLE_GETALIASESEXES GetAliasesExesRequest;
864 CONSOLE_GETALIASESEXESLENGTH GetAliasesExesLengthRequest;
865
866 /* History */
867 CONSOLE_GETCOMMANDHISTORY GetCommandHistoryRequest;
868 CONSOLE_GETCOMMANDHISTORYLENGTH GetCommandHistoryLengthRequest;
869 CONSOLE_EXPUNGECOMMANDHISTORY ExpungeCommandHistoryRequest;
870 CONSOLE_GETSETHISTORYINFO HistoryInfoRequest;
871 CONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest;
872 CONSOLE_SETHISTORYMODE SetHistoryModeRequest;
873
874 /* Input and Output Code Pages */
875 CONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest;
876 CONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest;
877 } Data;
878 } CONSOLE_API_MESSAGE, *PCONSOLE_API_MESSAGE;
879
880 // Check that a CONSOLE_API_MESSAGE can hold in a CSR_API_MESSAGE.
881 CHECK_API_MSG_SIZE(CONSOLE_API_MESSAGE);
882
883 #endif // _CONMSG_H
884
885 /* EOF */