[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
168 BOOLEAN ConsoleNeeded; // Used for GUI apps only.
169 LPTHREAD_START_ROUTINE CtrlDispatcher;
170 LPTHREAD_START_ROUTINE ImeDispatcher;
171 LPTHREAD_START_ROUTINE PropDispatcher;
172 ULONG TitleLength;
173 WCHAR ConsoleTitle[MAX_PATH + 1]; // Console title or full path to the startup shortcut
174 ULONG DesktopLength;
175 PWCHAR DesktopPath;
176 ULONG AppNameLength;
177 WCHAR AppPath[128]; // Full path of the launched app
178 ULONG IconPathLength;
179 WCHAR IconPath[MAX_PATH + 1]; // Path to the file containing the icon
180 } CONSOLE_START_INFO, *PCONSOLE_START_INFO;
181
182 typedef struct _CONSRV_API_CONNECTINFO
183 {
184 HANDLE ConsoleHandle;
185 HANDLE InputWaitHandle;
186 HANDLE InputHandle;
187 HANDLE OutputHandle;
188 HANDLE ErrorHandle;
189 HANDLE Event1;
190 HANDLE Event2;
191 /* Adapted from CONSOLE_ALLOCCONSOLE */
192 CONSOLE_START_INFO ConsoleStartInfo;
193 } CONSRV_API_CONNECTINFO, *PCONSRV_API_CONNECTINFO;
194
195 #if defined(_M_IX86)
196 C_ASSERT(sizeof(CONSRV_API_CONNECTINFO) == 0x638);
197 #endif
198
199 typedef struct
200 {
201 HANDLE ConsoleHandle;
202 ULONG ProcessCount;
203 PDWORD ProcessIdsList;
204 } CONSOLE_GETPROCESSLIST, *PCONSOLE_GETPROCESSLIST;
205
206 typedef struct
207 {
208 HANDLE ConsoleHandle;
209 DWORD CtrlEvent;
210 DWORD ProcessGroupId;
211 } CONSOLE_GENERATECTRLEVENT, *PCONSOLE_GENERATECTRLEVENT;
212
213 typedef struct
214 {
215 HANDLE ConsoleHandle;
216 } CONSOLE_NOTIFYLASTCLOSE, *PCONSOLE_NOTIFYLASTCLOSE;
217
218
219
220 typedef struct
221 {
222 HANDLE ConsoleHandle;
223 HANDLE OutputHandle;
224
225 CHAR StaticBuffer[80];
226 PVOID Buffer; // BufPtr
227 ULONG NumBytes;
228
229 // On Windows, the client never uses this member
230 ULONG Reserved1;
231
232 BOOLEAN UsingStaticBuffer;
233 BOOLEAN Unicode;
234
235 // On Windows, the client never uses this member
236 CHAR Reserved2[6];
237 } CONSOLE_WRITECONSOLE, *PCONSOLE_WRITECONSOLE;
238
239 typedef struct
240 {
241 HANDLE ConsoleHandle;
242 HANDLE InputHandle;
243
244 USHORT ExeLength;
245
246 CHAR StaticBuffer[80];
247 PVOID Buffer; // BufPtr
248 ULONG NumBytes;
249
250 ULONG CaptureBufferSize;
251
252 ULONG InitialNumBytes;
253 ULONG CtrlWakeupMask;
254 ULONG ControlKeyState;
255 BOOLEAN Unicode;
256 } CONSOLE_READCONSOLE, *PCONSOLE_READCONSOLE;
257
258 typedef struct
259 {
260 PCONSOLE_START_INFO ConsoleStartInfo;
261
262 HANDLE ConsoleHandle;
263 HANDLE InputHandle;
264 HANDLE OutputHandle;
265 HANDLE ErrorHandle;
266 HANDLE InputWaitHandle;
267 LPTHREAD_START_ROUTINE CtrlDispatcher;
268 LPTHREAD_START_ROUTINE PropDispatcher;
269 } CONSOLE_ALLOCCONSOLE, *PCONSOLE_ALLOCCONSOLE;
270
271 typedef struct
272 {
273 DWORD ProcessId; // If ProcessId == ATTACH_PARENT_PROCESS == -1, then attach the current process to its parent process console.
274 HANDLE ConsoleHandle;
275 HANDLE InputHandle;
276 HANDLE OutputHandle;
277 HANDLE ErrorHandle;
278 HANDLE InputWaitHandle;
279 LPTHREAD_START_ROUTINE CtrlDispatcher;
280 LPTHREAD_START_ROUTINE PropDispatcher;
281 } CONSOLE_ATTACHCONSOLE, *PCONSOLE_ATTACHCONSOLE;
282
283 typedef struct
284 {
285 HANDLE ConsoleHandle;
286 } CONSOLE_FREECONSOLE, *PCONSOLE_FREECONSOLE;
287
288 typedef struct
289 {
290 HANDLE ConsoleHandle;
291 HANDLE OutputHandle;
292 COORD ScreenBufferSize;
293 COORD CursorPosition;
294 COORD ViewOrigin;
295 WORD Attributes;
296 COORD ViewSize;
297 COORD MaximumViewSize;
298 } CONSOLE_GETSCREENBUFFERINFO, *PCONSOLE_GETSCREENBUFFERINFO;
299
300 typedef struct
301 {
302 HANDLE ConsoleHandle;
303 HANDLE OutputHandle;
304 COORD Position;
305 } CONSOLE_SETCURSORPOSITION, *PCONSOLE_SETCURSORPOSITION;
306
307 typedef struct
308 {
309 HANDLE ConsoleHandle;
310 HANDLE OutputHandle;
311 BOOL Show;
312 INT RefCount;
313 } CONSOLE_SHOWCURSOR, *PCONSOLE_SHOWCURSOR;
314
315 typedef struct
316 {
317 HANDLE ConsoleHandle;
318 HANDLE OutputHandle;
319 HCURSOR CursorHandle;
320 } CONSOLE_SETCURSOR, *PCONSOLE_SETCURSOR;
321
322 typedef struct
323 {
324 HANDLE ConsoleHandle;
325 HANDLE OutputHandle;
326 CONSOLE_CURSOR_INFO Info;
327 /*
328 DWORD Size;
329 BOOLEAN Visible;
330 */
331 } CONSOLE_GETSETCURSORINFO, *PCONSOLE_GETSETCURSORINFO;
332
333 typedef struct
334 {
335 HANDLE ConsoleHandle;
336 ULONG NumButtons;
337 } CONSOLE_GETMOUSEINFO, *PCONSOLE_GETMOUSEINFO;
338
339 typedef struct
340 {
341 HANDLE ConsoleHandle;
342 HANDLE OutputHandle;
343 WORD Attributes;
344 } CONSOLE_SETTEXTATTRIB, *PCONSOLE_SETTEXTATTRIB;
345
346 typedef struct
347 {
348 HANDLE ConsoleHandle;
349 HANDLE Handle;
350 DWORD Mode;
351 } CONSOLE_GETSETCONSOLEMODE, *PCONSOLE_GETSETCONSOLEMODE;
352
353 typedef struct
354 {
355 HANDLE ConsoleHandle;
356 DWORD DisplayMode; // ModeFlags
357 } CONSOLE_GETDISPLAYMODE, *PCONSOLE_GETDISPLAYMODE;
358
359 typedef struct
360 {
361 HANDLE ConsoleHandle;
362 HANDLE OutputHandle;
363 DWORD DisplayMode; // ModeFlags
364 COORD NewSBDim;
365 HANDLE EventHandle;
366 } CONSOLE_SETDISPLAYMODE, *PCONSOLE_SETDISPLAYMODE;
367
368 /*
369 * Console hardware states.
370 */
371 #define CONSOLE_HARDWARE_STATE_GDI_MANAGED 0
372 #define CONSOLE_HARDWARE_STATE_DIRECT 1
373
374 typedef struct
375 {
376 HANDLE ConsoleHandle;
377 HANDLE OutputHandle;
378 DWORD Flags;
379 DWORD State;
380 } CONSOLE_GETSETHWSTATE, *PCONSOLE_GETSETHWSTATE;
381
382
383
384 typedef struct
385 {
386 HANDLE ConsoleHandle;
387 DWORD DesiredAccess;
388 BOOL InheritHandle;
389 DWORD ShareMode;
390 /* Type of the screen buffer: CONSOLE_TEXTMODE_BUFFER or CONSOLE_GRAPHICS_BUFFER */
391 DWORD ScreenBufferType;
392 /*
393 * This structure holds the initialization information
394 * for graphics screen buffers.
395 */
396 CONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo;
397 HANDLE hMutex;
398 PVOID lpBitMap;
399 HANDLE OutputHandle; /* Handle to newly created screen buffer */
400 } CONSOLE_CREATESCREENBUFFER, *PCONSOLE_CREATESCREENBUFFER;
401
402 typedef struct
403 {
404 HANDLE ConsoleHandle;
405 HANDLE OutputHandle; /* Handle to screen buffer to switch to */
406 } CONSOLE_SETACTIVESCREENBUFFER, *PCONSOLE_SETACTIVESCREENBUFFER;
407
408 typedef struct
409 {
410 HANDLE ConsoleHandle;
411 HANDLE OutputHandle;
412 SMALL_RECT Region;
413 } CONSOLE_INVALIDATEDIBITS, *PCONSOLE_INVALIDATEDIBITS;
414
415 typedef struct
416 {
417 HANDLE ConsoleHandle;
418 HANDLE OutputHandle;
419 HPALETTE PaletteHandle;
420 UINT Usage;
421 } CONSOLE_SETPALETTE, *PCONSOLE_SETPALETTE;
422
423 typedef struct
424 {
425 HANDLE ConsoleHandle;
426 ULONG Length;
427 PVOID Title;
428 BOOLEAN Unicode;
429 } CONSOLE_GETSETCONSOLETITLE, *PCONSOLE_GETSETCONSOLETITLE;
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;
468
469 typedef struct
470 {
471 HANDLE ConsoleHandle;
472 HANDLE OutputHandle;
473 COORD Coord;
474
475 CODE_TYPE CodeType;
476 CHAR CodeStaticBuffer[80]; // == 40 * sizeof(CODE_ELEMENT)
477 PVOID pCode; // Either a pointer to a character or to an attribute.
478 // union
479 // {
480 // PVOID pCode;
481 // PCHAR AsciiChar;
482 // PWCHAR UnicodeChar;
483 // PWORD Attribute;
484 // } pCode; // Either a pointer to a character or to an attribute.
485
486 ULONG NumCodes;
487 } CONSOLE_READOUTPUTCODE , *PCONSOLE_READOUTPUTCODE,
488 CONSOLE_WRITEOUTPUTCODE, *PCONSOLE_WRITEOUTPUTCODE;
489
490 typedef struct
491 {
492 HANDLE ConsoleHandle;
493 HANDLE OutputHandle;
494 COORD WriteCoord;
495
496 CODE_TYPE CodeType;
497 CODE_ELEMENT Code; // Either a character or an attribute.
498
499 ULONG NumCodes;
500 } CONSOLE_FILLOUTPUTCODE, *PCONSOLE_FILLOUTPUTCODE;
501
502 typedef struct
503 {
504 HANDLE ConsoleHandle;
505 HANDLE InputHandle;
506 INPUT_RECORD RecordStaticBuffer[5];
507 PINPUT_RECORD RecordBufPtr;
508 ULONG NumRecords;
509 WORD Flags;
510 BOOLEAN Unicode;
511 } CONSOLE_GETINPUT, *PCONSOLE_GETINPUT;
512
513 typedef struct
514 {
515 HANDLE ConsoleHandle;
516 HANDLE InputHandle;
517 INPUT_RECORD RecordStaticBuffer[5];
518 PINPUT_RECORD RecordBufPtr;
519 ULONG NumRecords;
520 BOOLEAN Unicode;
521 BOOLEAN AppendToEnd;
522 } CONSOLE_WRITEINPUT, *PCONSOLE_WRITEINPUT;
523
524 typedef struct
525 {
526 HANDLE ConsoleHandle;
527 HANDLE OutputHandle;
528
529 CHAR_INFO StaticBuffer;
530 PCHAR_INFO CharInfo;
531
532 SMALL_RECT ReadRegion;
533 BOOLEAN Unicode;
534 } CONSOLE_READOUTPUT, *PCONSOLE_READOUTPUT;
535
536 typedef struct
537 {
538 HANDLE ConsoleHandle;
539 HANDLE OutputHandle;
540
541 CHAR_INFO StaticBuffer;
542 PCHAR_INFO CharInfo;
543
544 SMALL_RECT WriteRegion;
545 BOOLEAN Unicode;
546
547 /*
548 * If we are going to write too large (>= 64 kB, size of the CSR heap)
549 * data buffers, we allocate a heap buffer in the process' memory, and
550 * CSR will read it via NtReadVirtualMemory.
551 */
552 BOOLEAN UseVirtualMemory;
553 } CONSOLE_WRITEOUTPUT, *PCONSOLE_WRITEOUTPUT;
554
555 typedef struct
556 {
557 HANDLE ConsoleHandle;
558 HANDLE InputHandle;
559 ULONG NumberOfEvents;
560 } CONSOLE_GETNUMINPUTEVENTS, *PCONSOLE_GETNUMINPUTEVENTS;
561
562
563
564 typedef struct
565 {
566 HANDLE ConsoleHandle;
567 HANDLE Handle;
568 } CONSOLE_CLOSEHANDLE, *PCONSOLE_CLOSEHANDLE;
569
570 typedef struct
571 {
572 BOOL IsValid;
573 HANDLE ConsoleHandle;
574 HANDLE Handle;
575 } CONSOLE_VERIFYHANDLE, *PCONSOLE_VERIFYHANDLE;
576
577 typedef struct
578 {
579 HANDLE ConsoleHandle;
580 HANDLE SourceHandle;
581 DWORD DesiredAccess;
582 BOOLEAN InheritHandle;
583 DWORD Options;
584 HANDLE TargetHandle;
585 } CONSOLE_DUPLICATEHANDLE, *PCONSOLE_DUPLICATEHANDLE;
586
587 typedef struct
588 {
589 HANDLE ConsoleHandle;
590 HANDLE Handle;
591 DWORD Flags;
592 } CONSOLE_GETHANDLEINFO, *PCONSOLE_GETHANDLEINFO;
593
594 typedef struct
595 {
596 HANDLE ConsoleHandle;
597 HANDLE Handle;
598 DWORD Mask;
599 DWORD Flags;
600 } CONSOLE_SETHANDLEINFO, *PCONSOLE_SETHANDLEINFO;
601
602 /*
603 * Type of handles.
604 */
605 typedef enum _CONSOLE_HANDLE_TYPE
606 {
607 HANDLE_INPUT = 0x01,
608 HANDLE_OUTPUT = 0x02
609 } CONSOLE_HANDLE_TYPE;
610
611 typedef struct
612 {
613 HANDLE ConsoleHandle;
614 CONSOLE_HANDLE_TYPE HandleType;
615 DWORD DesiredAccess;
616 BOOL InheritHandle;
617 DWORD ShareMode;
618 HANDLE Handle;
619 } CONSOLE_OPENCONSOLE, *PCONSOLE_OPENCONSOLE;
620
621
622
623 typedef struct
624 {
625 HANDLE ConsoleHandle;
626 HANDLE OutputHandle;
627 COORD Size;
628 } CONSOLE_GETLARGESTWINDOWSIZE, *PCONSOLE_GETLARGESTWINDOWSIZE;
629
630 typedef struct
631 {
632 HANDLE ConsoleHandle;
633 HANDLE OutputHandle;
634 DWORD CmdIdLow;
635 DWORD CmdIdHigh;
636 HMENU MenuHandle;
637 } CONSOLE_MENUCONTROL, *PCONSOLE_MENUCONTROL;
638
639 typedef struct
640 {
641 HANDLE ConsoleHandle;
642 BOOL Enable;
643 } CONSOLE_SETMENUCLOSE, *PCONSOLE_SETMENUCLOSE;
644
645 typedef struct
646 {
647 HANDLE ConsoleHandle;
648 HANDLE OutputHandle;
649 BOOL Absolute;
650 SMALL_RECT WindowRect; // New console window position in the screen-buffer frame (Absolute == TRUE)
651 // or in the old window position frame (Absolute == FALSE).
652 } CONSOLE_SETWINDOWINFO, *PCONSOLE_SETWINDOWINFO;
653
654 typedef struct
655 {
656 HANDLE ConsoleHandle;
657 HWND WindowHandle;
658 } CONSOLE_GETWINDOW, *PCONSOLE_GETWINDOW;
659
660 typedef struct
661 {
662 HANDLE ConsoleHandle;
663 HICON IconHandle;
664 } CONSOLE_SETICON, *PCONSOLE_SETICON;
665
666
667
668 typedef struct
669 {
670 HANDLE ConsoleHandle;
671 USHORT SourceLength;
672 USHORT TargetLength; // Also used for storing the number of bytes written.
673 USHORT ExeLength;
674 PVOID Source;
675 PVOID Target;
676 PVOID ExeName;
677 BOOLEAN Unicode;
678 BOOLEAN Unicode2;
679 } CONSOLE_ADDGETALIAS, *PCONSOLE_ADDGETALIAS;
680
681 typedef struct
682 {
683 HANDLE ConsoleHandle;
684 USHORT ExeLength;
685 PVOID ExeName;
686 BOOLEAN Unicode;
687 BOOLEAN Unicode2;
688 ULONG AliasesBufferLength;
689 PVOID AliasesBuffer;
690 } CONSOLE_GETALLALIASES, *PCONSOLE_GETALLALIASES;
691
692 typedef struct
693 {
694 HANDLE ConsoleHandle;
695 USHORT ExeLength;
696 PVOID ExeName;
697 ULONG Length;
698 BOOLEAN Unicode;
699 BOOLEAN Unicode2;
700 } CONSOLE_GETALLALIASESLENGTH, *PCONSOLE_GETALLALIASESLENGTH;
701
702 typedef struct
703 {
704 HANDLE ConsoleHandle;
705 ULONG Length ; // ExeLength; // ExesLength
706 PVOID ExeNames;
707 BOOLEAN Unicode;
708 } CONSOLE_GETALIASESEXES, *PCONSOLE_GETALIASESEXES;
709
710 typedef struct
711 {
712 HANDLE ConsoleHandle;
713 ULONG Length;
714 BOOLEAN Unicode;
715 } CONSOLE_GETALIASESEXESLENGTH, *PCONSOLE_GETALIASESEXESLENGTH;
716
717
718
719 typedef struct
720 {
721 HANDLE ConsoleHandle;
722 ULONG HistoryLength;
723 PVOID History;
724 USHORT ExeLength;
725 PVOID ExeName;
726 BOOLEAN Unicode;
727 BOOLEAN Unicode2;
728 } CONSOLE_GETCOMMANDHISTORY, *PCONSOLE_GETCOMMANDHISTORY;
729
730 typedef struct
731 {
732 HANDLE ConsoleHandle;
733 ULONG HistoryLength;
734 USHORT ExeLength;
735 PVOID ExeName;
736 BOOLEAN Unicode;
737 BOOLEAN Unicode2;
738 } CONSOLE_GETCOMMANDHISTORYLENGTH, *PCONSOLE_GETCOMMANDHISTORYLENGTH;
739
740 typedef struct
741 {
742 HANDLE ConsoleHandle;
743 USHORT ExeLength;
744 PVOID ExeName;
745 BOOLEAN Unicode;
746 BOOLEAN Unicode2;
747 } CONSOLE_EXPUNGECOMMANDHISTORY, *PCONSOLE_EXPUNGECOMMANDHISTORY;
748
749 typedef struct
750 {
751 UINT HistoryBufferSize;
752 UINT NumberOfHistoryBuffers;
753 DWORD dwFlags;
754 } CONSOLE_GETSETHISTORYINFO, *PCONSOLE_GETSETHISTORYINFO;
755
756 typedef struct
757 {
758 HANDLE ConsoleHandle;
759 ULONG NumCommands;
760 USHORT ExeLength;
761 PVOID ExeName;
762 BOOLEAN Unicode;
763 BOOLEAN Unicode2;
764 } CONSOLE_SETHISTORYNUMBERCOMMANDS, *PCONSOLE_SETHISTORYNUMBERCOMMANDS;
765
766 typedef struct
767 {
768 HANDLE ConsoleHandle;
769 ULONG Mode;
770 } CONSOLE_SETHISTORYMODE, *PCONSOLE_SETHISTORYMODE;
771
772
773
774 typedef struct
775 {
776 HANDLE ConsoleHandle;
777 HANDLE OutputHandle;
778 COORD Size;
779 } CONSOLE_SETSCREENBUFFERSIZE, *PCONSOLE_SETSCREENBUFFERSIZE;
780
781 typedef struct
782 {
783 HANDLE ConsoleHandle;
784 CONSOLE_SELECTION_INFO Info;
785 } CONSOLE_GETSELECTIONINFO, *PCONSOLE_GETSELECTIONINFO;
786
787 typedef struct
788 {
789 HANDLE ConsoleHandle;
790 UINT CodePage;
791 BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page
792 } CONSOLE_GETINPUTOUTPUTCP, *PCONSOLE_GETINPUTOUTPUTCP;
793
794 typedef struct
795 {
796 HANDLE ConsoleHandle;
797 UINT CodePage;
798 BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page
799 HANDLE EventHandle;
800 } CONSOLE_SETINPUTOUTPUTCP, *PCONSOLE_SETINPUTOUTPUTCP;
801
802 typedef struct
803 {
804 HANDLE ConsoleHandle;
805 CHAR LayoutBuffer[KL_NAMELENGTH * sizeof(WCHAR)]; // Can hold up to 9 wchars
806 BOOL Ansi;
807 } CONSOLE_GETKBDLAYOUTNAME, *PCONSOLE_GETKBDLAYOUTNAME;
808
809 typedef struct _CONSOLE_API_MESSAGE
810 {
811 PORT_MESSAGE Header;
812
813 PCSR_CAPTURE_BUFFER CsrCaptureData;
814 CSR_API_NUMBER ApiNumber;
815 NTSTATUS Status;
816 ULONG Reserved;
817 union
818 {
819 /* Console initialization and uninitialization */
820 CONSOLE_ALLOCCONSOLE AllocConsoleRequest;
821 CONSOLE_ATTACHCONSOLE AttachConsoleRequest;
822 CONSOLE_FREECONSOLE FreeConsoleRequest;
823
824 /* Processes */
825 CONSOLE_GETPROCESSLIST GetProcessListRequest;
826 CONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest;
827 CONSOLE_NOTIFYLASTCLOSE NotifyLastCloseRequest;
828
829 /* Handles */
830 CONSOLE_OPENCONSOLE OpenConsoleRequest;
831 CONSOLE_CLOSEHANDLE CloseHandleRequest;
832 CONSOLE_VERIFYHANDLE VerifyHandleRequest;
833 CONSOLE_DUPLICATEHANDLE DuplicateHandleRequest;
834 CONSOLE_GETHANDLEINFO GetHandleInfoRequest;
835 CONSOLE_SETHANDLEINFO SetHandleInfoRequest;
836
837 /* Cursor & Mouse */
838 CONSOLE_SHOWCURSOR ShowCursorRequest;
839 CONSOLE_SETCURSOR SetCursorRequest;
840 CONSOLE_GETSETCURSORINFO CursorInfoRequest;
841 CONSOLE_SETCURSORPOSITION SetCursorPositionRequest;
842 CONSOLE_GETMOUSEINFO GetMouseInfoRequest;
843
844 /* Screen-buffer */
845 CONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest;
846 CONSOLE_SETACTIVESCREENBUFFER SetScreenBufferRequest;
847 CONSOLE_GETSCREENBUFFERINFO ScreenBufferInfoRequest;
848 CONSOLE_SETSCREENBUFFERSIZE SetScreenBufferSizeRequest;
849 CONSOLE_SCROLLSCREENBUFFER ScrollScreenBufferRequest;
850
851 CONSOLE_GETSELECTIONINFO GetSelectionInfoRequest;
852 CONSOLE_FLUSHINPUTBUFFER FlushInputBufferRequest;
853
854 /* Console mode */
855 CONSOLE_GETSETCONSOLEMODE ConsoleModeRequest;
856 CONSOLE_GETDISPLAYMODE GetDisplayModeRequest;
857 CONSOLE_SETDISPLAYMODE SetDisplayModeRequest;
858 CONSOLE_GETSETHWSTATE HardwareStateRequest;
859
860 /* Console window */
861 CONSOLE_INVALIDATEDIBITS InvalidateDIBitsRequest;
862 CONSOLE_SETPALETTE SetPaletteRequest;
863 CONSOLE_GETSETCONSOLETITLE TitleRequest;
864 CONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest;
865 CONSOLE_MENUCONTROL MenuControlRequest;
866 CONSOLE_SETMENUCLOSE SetMenuCloseRequest;
867 CONSOLE_SETWINDOWINFO SetWindowInfoRequest;
868 CONSOLE_GETWINDOW GetWindowRequest;
869 CONSOLE_SETICON SetIconRequest;
870
871 /* Read */
872 CONSOLE_READCONSOLE ReadConsoleRequest; // SrvReadConsole / ReadConsole
873 CONSOLE_GETINPUT GetInputRequest; // SrvGetConsoleInput / PeekConsoleInput & ReadConsoleInput
874 CONSOLE_READOUTPUT ReadOutputRequest; // SrvReadConsoleOutput / ReadConsoleOutput
875 CONSOLE_READOUTPUTCODE ReadOutputCodeRequest; // SrvReadConsoleOutputString / ReadConsoleOutputAttribute & ReadConsoleOutputCharacter
876 CONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest;
877
878 /* Write */
879 CONSOLE_WRITECONSOLE WriteConsoleRequest; // SrvWriteConsole / WriteConsole
880 CONSOLE_WRITEINPUT WriteInputRequest;
881 CONSOLE_WRITEOUTPUT WriteOutputRequest;
882 CONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest;
883
884 CONSOLE_FILLOUTPUTCODE FillOutputRequest;
885 CONSOLE_SETTEXTATTRIB SetTextAttribRequest;
886
887 /* Aliases */
888 CONSOLE_ADDGETALIAS ConsoleAliasRequest;
889 CONSOLE_GETALLALIASES GetAllAliasesRequest;
890 CONSOLE_GETALLALIASESLENGTH GetAllAliasesLengthRequest;
891 CONSOLE_GETALIASESEXES GetAliasesExesRequest;
892 CONSOLE_GETALIASESEXESLENGTH GetAliasesExesLengthRequest;
893
894 /* History */
895 CONSOLE_GETCOMMANDHISTORY GetCommandHistoryRequest;
896 CONSOLE_GETCOMMANDHISTORYLENGTH GetCommandHistoryLengthRequest;
897 CONSOLE_EXPUNGECOMMANDHISTORY ExpungeCommandHistoryRequest;
898 CONSOLE_GETSETHISTORYINFO HistoryInfoRequest;
899 CONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest;
900 CONSOLE_SETHISTORYMODE SetHistoryModeRequest;
901
902 /* Input and Output Code Pages; keyboard */
903 CONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest;
904 CONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest;
905 CONSOLE_GETKBDLAYOUTNAME GetKbdLayoutNameRequest;
906 } Data;
907 } CONSOLE_API_MESSAGE, *PCONSOLE_API_MESSAGE;
908
909 // Check that a CONSOLE_API_MESSAGE can hold in a CSR_API_MESSAGE.
910 CHECK_API_MSG_SIZE(CONSOLE_API_MESSAGE);
911
912 #endif // _CONMSG_H
913
914 /* EOF */