00335b7bb86dccc6f8613c494cab10d48ed1dc47
[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 HANDLE OutputHandle;
326 WORD Attributes;
327 } CONSOLE_SETTEXTATTRIB, *PCONSOLE_SETTEXTATTRIB;
328
329 typedef struct
330 {
331 HANDLE ConsoleHandle;
332 HANDLE Handle;
333 DWORD Mode;
334 } CONSOLE_GETSETCONSOLEMODE, *PCONSOLE_GETSETCONSOLEMODE;
335
336 typedef struct
337 {
338 HANDLE ConsoleHandle;
339 DWORD DisplayMode; // ModeFlags
340 } CONSOLE_GETDISPLAYMODE, *PCONSOLE_GETDISPLAYMODE;
341
342 typedef struct
343 {
344 HANDLE ConsoleHandle;
345 HANDLE OutputHandle;
346 DWORD DisplayMode; // ModeFlags
347 COORD NewSBDim;
348 HANDLE EventHandle;
349 } CONSOLE_SETDISPLAYMODE, *PCONSOLE_SETDISPLAYMODE;
350
351 /*
352 * Console hardware states.
353 */
354 #define CONSOLE_HARDWARE_STATE_GDI_MANAGED 0
355 #define CONSOLE_HARDWARE_STATE_DIRECT 1
356
357 typedef struct
358 {
359 HANDLE ConsoleHandle;
360 HANDLE OutputHandle;
361 DWORD Flags;
362 DWORD State;
363 } CONSOLE_GETSETHWSTATE, *PCONSOLE_GETSETHWSTATE;
364
365
366
367 typedef struct
368 {
369 HANDLE ConsoleHandle;
370 DWORD DesiredAccess;
371 BOOL InheritHandle;
372 DWORD ShareMode;
373 DWORD ScreenBufferType; /* Type of the screen buffer: CONSOLE_TEXTMODE_BUFFER or CONSOLE_GRAPHICS_BUFFER */
374 /*
375 * This structure holds the initialization information
376 * for graphics screen buffers.
377 */
378 CONSOLE_GRAPHICS_BUFFER_INFO GraphicsBufferInfo;
379 HANDLE hMutex;
380 PVOID lpBitMap;
381 HANDLE OutputHandle; /* Handle to newly created screen buffer */
382 } CONSOLE_CREATESCREENBUFFER, *PCONSOLE_CREATESCREENBUFFER;
383
384 typedef struct
385 {
386 HANDLE ConsoleHandle;
387 HANDLE OutputHandle; /* Handle to screen buffer to switch to */
388 } CONSOLE_SETACTIVESCREENBUFFER, *PCONSOLE_SETACTIVESCREENBUFFER;
389
390 typedef struct
391 {
392 HANDLE ConsoleHandle;
393 HANDLE OutputHandle;
394 SMALL_RECT Region;
395 } CONSOLE_INVALIDATEDIBITS, *PCONSOLE_INVALIDATEDIBITS;
396
397 typedef struct
398 {
399 HANDLE ConsoleHandle;
400 HANDLE OutputHandle;
401 HPALETTE PaletteHandle;
402 UINT Usage;
403 } CONSOLE_SETPALETTE, *PCONSOLE_SETPALETTE;
404
405 typedef struct
406 {
407 HANDLE ConsoleHandle;
408 DWORD Length;
409 PVOID Title;
410 BOOLEAN Unicode;
411 } CONSOLE_GETSETCONSOLETITLE, *PCONSOLE_GETSETCONSOLETITLE;
412
413 typedef struct
414 {
415 HANDLE OutputHandle;
416
417 BOOL Unicode;
418 COORD BufferSize;
419 COORD BufferCoord;
420 SMALL_RECT WriteRegion;
421 PCHAR_INFO CharInfo;
422 } CONSOLE_WRITEOUTPUT, *PCONSOLE_WRITEOUTPUT;
423
424 typedef struct
425 {
426 HANDLE ConsoleHandle;
427 HANDLE InputHandle;
428 } CONSOLE_FLUSHINPUTBUFFER, *PCONSOLE_FLUSHINPUTBUFFER;
429
430 typedef struct
431 {
432 HANDLE ConsoleHandle;
433 HANDLE OutputHandle;
434 SMALL_RECT ScrollRectangle;
435 SMALL_RECT ClipRectangle;
436 BOOL UseClipRectangle;
437 COORD DestinationOrigin;
438 CHAR_INFO Fill;
439 BOOLEAN Unicode;
440 } CONSOLE_SCROLLSCREENBUFFER, *PCONSOLE_SCROLLSCREENBUFFER;
441
442
443 /*
444 * An attribute or a character are instances of the same entity, namely
445 * a "code" (what would be called an (ANSI) escape sequence). Therefore
446 * encode them inside the same structure.
447 */
448 typedef enum _CODE_TYPE
449 {
450 CODE_ASCII = 0x01,
451 CODE_UNICODE = 0x02,
452 CODE_ATTRIBUTE = 0x03
453 } CODE_TYPE;
454
455 typedef struct
456 {
457 HANDLE OutputHandle;
458
459 DWORD NumCodesToRead;
460 COORD ReadCoord;
461 COORD EndCoord;
462
463 DWORD CodesRead;
464
465 CODE_TYPE CodeType;
466 union
467 {
468 PVOID pCode;
469 PCHAR AsciiChar;
470 PWCHAR UnicodeChar;
471 PWORD Attribute;
472 } pCode; // Either a pointer to a character or to an attribute.
473 } CONSOLE_READOUTPUTCODE, *PCONSOLE_READOUTPUTCODE;
474
475 typedef struct
476 {
477 HANDLE OutputHandle;
478
479 ULONG BufferSize; // Seems unusued
480 WORD Length;
481 COORD Coord;
482 COORD EndCoord;
483
484 ULONG NrCharactersWritten; // Seems unusued
485
486 CODE_TYPE CodeType;
487 union
488 {
489 PVOID pCode;
490 PCHAR AsciiChar;
491 PWCHAR UnicodeChar;
492 PWORD Attribute;
493 } pCode; // Either a pointer to a character or to an attribute.
494 } CONSOLE_WRITEOUTPUTCODE, *PCONSOLE_WRITEOUTPUTCODE;
495
496 typedef struct
497 {
498 HANDLE OutputHandle;
499
500 CODE_TYPE CodeType;
501 union
502 {
503 CHAR AsciiChar;
504 WCHAR UnicodeChar;
505 WORD Attribute;
506 } Code; // Either a character or an attribute.
507
508 COORD Coord;
509 ULONG Length;
510
511 ULONG NrCharactersWritten; // FIXME: Only for chars, is it removable ?
512 } CONSOLE_FILLOUTPUTCODE, *PCONSOLE_FILLOUTPUTCODE;
513
514 typedef struct
515 {
516 HANDLE InputHandle;
517 ULONG InputsRead;
518 PINPUT_RECORD InputRecord;
519 ULONG Length;
520 WORD wFlags;
521 BOOLEAN Unicode;
522 } CONSOLE_GETINPUT, *PCONSOLE_GETINPUT;
523
524 typedef struct
525 {
526 HANDLE OutputHandle;
527
528 BOOL Unicode;
529 COORD BufferSize;
530 COORD BufferCoord;
531 SMALL_RECT ReadRegion;
532 PCHAR_INFO CharInfo;
533 } CONSOLE_READOUTPUT, *PCONSOLE_READOUTPUT;
534
535 typedef struct
536 {
537 HANDLE InputHandle;
538 DWORD Length;
539 INPUT_RECORD* InputRecord;
540 BOOL Unicode;
541 BOOL AppendToEnd;
542 } CONSOLE_WRITEINPUT, *PCONSOLE_WRITEINPUT;
543
544 typedef struct
545 {
546 HANDLE ConsoleHandle;
547 HANDLE InputHandle;
548 DWORD NumberOfEvents;
549 } CONSOLE_GETNUMINPUTEVENTS, *PCONSOLE_GETNUMINPUTEVENTS;
550
551
552
553 typedef struct
554 {
555 HANDLE ConsoleHandle;
556 HANDLE Handle;
557 } CONSOLE_CLOSEHANDLE, *PCONSOLE_CLOSEHANDLE;
558
559 typedef struct
560 {
561 BOOL IsValid;
562 HANDLE ConsoleHandle;
563 HANDLE Handle;
564 } CONSOLE_VERIFYHANDLE, *PCONSOLE_VERIFYHANDLE;
565
566 typedef struct
567 {
568 HANDLE ConsoleHandle;
569 HANDLE SourceHandle;
570 DWORD DesiredAccess;
571 BOOLEAN InheritHandle;
572 DWORD Options;
573 HANDLE TargetHandle;
574 } CONSOLE_DUPLICATEHANDLE, *PCONSOLE_DUPLICATEHANDLE;
575
576 typedef struct
577 {
578 HANDLE ConsoleHandle;
579 HANDLE Handle;
580 DWORD Flags;
581 } CONSOLE_GETHANDLEINFO, *PCONSOLE_GETHANDLEINFO;
582
583 typedef struct
584 {
585 HANDLE ConsoleHandle;
586 HANDLE Handle;
587 DWORD Mask;
588 DWORD Flags;
589 } CONSOLE_SETHANDLEINFO, *PCONSOLE_SETHANDLEINFO;
590
591 /*
592 * Type of handles.
593 */
594 typedef enum _CONSOLE_HANDLE_TYPE
595 {
596 HANDLE_INPUT = 0x01,
597 HANDLE_OUTPUT = 0x02
598 } CONSOLE_HANDLE_TYPE;
599
600 typedef struct
601 {
602 HANDLE ConsoleHandle;
603 CONSOLE_HANDLE_TYPE HandleType;
604 DWORD DesiredAccess;
605 BOOL InheritHandle;
606 DWORD ShareMode;
607 HANDLE Handle;
608 } CONSOLE_OPENCONSOLE, *PCONSOLE_OPENCONSOLE;
609
610
611
612 typedef struct
613 {
614 HANDLE ConsoleHandle;
615 HANDLE OutputHandle;
616 COORD Size;
617 } CONSOLE_GETLARGESTWINDOWSIZE, *PCONSOLE_GETLARGESTWINDOWSIZE;
618
619 typedef struct
620 {
621 HANDLE ConsoleHandle;
622 HANDLE OutputHandle;
623 DWORD CmdIdLow;
624 DWORD CmdIdHigh;
625 HMENU MenuHandle;
626 } CONSOLE_MENUCONTROL, *PCONSOLE_MENUCONTROL;
627
628 typedef struct
629 {
630 HANDLE ConsoleHandle;
631 BOOL Enable;
632 } CONSOLE_SETMENUCLOSE, *PCONSOLE_SETMENUCLOSE;
633
634 typedef struct
635 {
636 HANDLE ConsoleHandle;
637 HANDLE OutputHandle;
638 BOOL Absolute;
639 SMALL_RECT WindowRect; // New console window position in the screen-buffer frame (Absolute == TRUE)
640 // or in the old window position frame (Absolute == FALSE).
641 } CONSOLE_SETWINDOWINFO, *PCONSOLE_SETWINDOWINFO;
642
643 typedef struct
644 {
645 HANDLE ConsoleHandle;
646 HWND WindowHandle;
647 } CONSOLE_GETWINDOW, *PCONSOLE_GETWINDOW;
648
649 typedef struct
650 {
651 HANDLE ConsoleHandle;
652 HICON IconHandle;
653 } CONSOLE_SETICON, *PCONSOLE_SETICON;
654
655
656
657 typedef struct
658 {
659 ULONG SourceLength;
660 ULONG TargetLength; // Also used for storing the number of bytes written.
661 ULONG ExeLength;
662 LPWSTR Source;
663 LPWSTR Target;
664 LPWSTR Exe;
665 } CONSOLE_ADDGETALIAS, *PCONSOLE_ADDGETALIAS;
666
667 typedef struct
668 {
669 DWORD ExeLength;
670 DWORD AliasesBufferLength;
671 LPWSTR ExeName;
672 LPWSTR AliasesBuffer;
673 } CONSOLE_GETALLALIASES, *PCONSOLE_GETALLALIASES;
674
675 typedef struct
676 {
677 HANDLE ConsoleHandle;
678 USHORT ExeLength;
679 PVOID ExeName;
680 ULONG Length;
681 BOOLEAN Unicode;
682 BOOLEAN Unicode2;
683 } CONSOLE_GETALLALIASESLENGTH, *PCONSOLE_GETALLALIASESLENGTH;
684
685 typedef struct
686 {
687 HANDLE ConsoleHandle;
688 ULONG Length ; // ExeLength; // ExesLength
689 PVOID ExeNames;
690 BOOLEAN Unicode;
691 } CONSOLE_GETALIASESEXES, *PCONSOLE_GETALIASESEXES;
692
693 typedef struct
694 {
695 HANDLE ConsoleHandle;
696 ULONG Length;
697 BOOLEAN Unicode;
698 } CONSOLE_GETALIASESEXESLENGTH, *PCONSOLE_GETALIASESEXESLENGTH;
699
700
701
702 typedef struct
703 {
704 HANDLE ConsoleHandle;
705 ULONG HistoryLength;
706 PVOID History;
707 // UNICODE_STRING ExeName;
708 USHORT ExeLength;
709 PVOID ExeName;
710 BOOLEAN Unicode;
711 BOOLEAN Unicode2;
712 } CONSOLE_GETCOMMANDHISTORY, *PCONSOLE_GETCOMMANDHISTORY;
713
714 typedef struct
715 {
716 HANDLE ConsoleHandle;
717 ULONG HistoryLength;
718 // UNICODE_STRING ExeName;
719 USHORT ExeLength;
720 PVOID ExeName;
721 BOOLEAN Unicode;
722 BOOLEAN Unicode2;
723 } CONSOLE_GETCOMMANDHISTORYLENGTH, *PCONSOLE_GETCOMMANDHISTORYLENGTH;
724
725 typedef struct
726 {
727 HANDLE ConsoleHandle;
728 // UNICODE_STRING ExeName;
729 USHORT ExeLength;
730 PVOID ExeName;
731 BOOLEAN Unicode;
732 BOOLEAN Unicode2;
733 } CONSOLE_EXPUNGECOMMANDHISTORY, *PCONSOLE_EXPUNGECOMMANDHISTORY;
734
735 typedef struct
736 {
737 UINT HistoryBufferSize;
738 UINT NumberOfHistoryBuffers;
739 DWORD dwFlags;
740 } CONSOLE_GETSETHISTORYINFO, *PCONSOLE_GETSETHISTORYINFO;
741
742 typedef struct
743 {
744 HANDLE ConsoleHandle;
745 ULONG NumCommands;
746 // UNICODE_STRING ExeName;
747 USHORT ExeLength;
748 PVOID ExeName;
749 BOOLEAN Unicode;
750 BOOLEAN Unicode2;
751 } CONSOLE_SETHISTORYNUMBERCOMMANDS, *PCONSOLE_SETHISTORYNUMBERCOMMANDS;
752
753 typedef struct
754 {
755 HANDLE ConsoleHandle;
756 ULONG Mode;
757 } CONSOLE_SETHISTORYMODE, *PCONSOLE_SETHISTORYMODE;
758
759
760
761 typedef struct
762 {
763 HANDLE ConsoleHandle;
764 HANDLE OutputHandle;
765 COORD Size;
766 } CONSOLE_SETSCREENBUFFERSIZE, *PCONSOLE_SETSCREENBUFFERSIZE;
767
768 typedef struct
769 {
770 HANDLE ConsoleHandle;
771 CONSOLE_SELECTION_INFO Info;
772 } CONSOLE_GETSELECTIONINFO, *PCONSOLE_GETSELECTIONINFO;
773
774 typedef struct
775 {
776 HANDLE ConsoleHandle;
777 UINT CodePage;
778 BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page
779 } CONSOLE_GETINPUTOUTPUTCP, *PCONSOLE_GETINPUTOUTPUTCP;
780
781 typedef struct
782 {
783 HANDLE ConsoleHandle;
784 UINT CodePage;
785 BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page
786 HANDLE EventHandle;
787 } CONSOLE_SETINPUTOUTPUTCP, *PCONSOLE_SETINPUTOUTPUTCP;
788
789 typedef struct _CONSOLE_API_MESSAGE
790 {
791 PORT_MESSAGE Header;
792
793 PCSR_CAPTURE_BUFFER CsrCaptureData;
794 CSR_API_NUMBER ApiNumber;
795 NTSTATUS Status;
796 ULONG Reserved;
797 union
798 {
799 /* Console initialization and uninitialization */
800 CONSOLE_ALLOCCONSOLE AllocConsoleRequest;
801 CONSOLE_ATTACHCONSOLE AttachConsoleRequest;
802 CONSOLE_FREECONSOLE FreeConsoleRequest;
803
804 /* Processes */
805 CONSOLE_GETPROCESSLIST GetProcessListRequest;
806 CONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest;
807 CONSOLE_NOTIFYLASTCLOSE NotifyLastCloseRequest;
808
809 /* Handles */
810 CONSOLE_OPENCONSOLE OpenConsoleRequest;
811 CONSOLE_CLOSEHANDLE CloseHandleRequest;
812 CONSOLE_VERIFYHANDLE VerifyHandleRequest;
813 CONSOLE_DUPLICATEHANDLE DuplicateHandleRequest;
814 CONSOLE_GETHANDLEINFO GetHandleInfoRequest;
815 CONSOLE_SETHANDLEINFO SetHandleInfoRequest;
816
817 /* Cursor */
818 CONSOLE_SHOWCURSOR ShowCursorRequest;
819 CONSOLE_SETCURSOR SetCursorRequest;
820 CONSOLE_GETSETCURSORINFO CursorInfoRequest;
821 CONSOLE_SETCURSORPOSITION SetCursorPositionRequest;
822
823 /* Screen-buffer */
824 CONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest;
825 CONSOLE_SETACTIVESCREENBUFFER SetScreenBufferRequest;
826 CONSOLE_GETSCREENBUFFERINFO ScreenBufferInfoRequest;
827 CONSOLE_SETSCREENBUFFERSIZE SetScreenBufferSizeRequest;
828 CONSOLE_SCROLLSCREENBUFFER ScrollScreenBufferRequest;
829
830 CONSOLE_GETSELECTIONINFO GetSelectionInfoRequest;
831 CONSOLE_FLUSHINPUTBUFFER FlushInputBufferRequest;
832
833 /* Console mode */
834 CONSOLE_GETSETCONSOLEMODE ConsoleModeRequest;
835 CONSOLE_GETDISPLAYMODE GetDisplayModeRequest;
836 CONSOLE_SETDISPLAYMODE SetDisplayModeRequest;
837 CONSOLE_GETSETHWSTATE HardwareStateRequest;
838
839 /* Console window */
840 CONSOLE_INVALIDATEDIBITS InvalidateDIBitsRequest;
841 CONSOLE_SETPALETTE SetPaletteRequest;
842 CONSOLE_GETSETCONSOLETITLE TitleRequest;
843 CONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest;
844 CONSOLE_MENUCONTROL MenuControlRequest;
845 CONSOLE_SETMENUCLOSE SetMenuCloseRequest;
846 CONSOLE_SETWINDOWINFO SetWindowInfoRequest;
847 CONSOLE_GETWINDOW GetWindowRequest;
848 CONSOLE_SETICON SetIconRequest;
849
850 /* Read */
851 CONSOLE_READCONSOLE ReadConsoleRequest; // SrvReadConsole / ReadConsole
852 CONSOLE_GETINPUT GetInputRequest; // SrvGetConsoleInput / PeekConsoleInput & ReadConsoleInput
853 CONSOLE_READOUTPUT ReadOutputRequest; // SrvReadConsoleOutput / ReadConsoleOutput
854 CONSOLE_READOUTPUTCODE ReadOutputCodeRequest; // SrvReadConsoleOutputString / ReadConsoleOutputAttribute & ReadConsoleOutputCharacter
855 CONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest;
856
857 /* Write */
858 CONSOLE_WRITECONSOLE WriteConsoleRequest; // SrvWriteConsole / WriteConsole
859 CONSOLE_WRITEINPUT WriteInputRequest;
860 CONSOLE_WRITEOUTPUT WriteOutputRequest;
861 CONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest;
862
863 CONSOLE_FILLOUTPUTCODE FillOutputRequest;
864 CONSOLE_SETTEXTATTRIB SetTextAttribRequest;
865
866 /* Aliases */
867 CONSOLE_ADDGETALIAS ConsoleAliasRequest;
868 CONSOLE_GETALLALIASES GetAllAliasesRequest;
869 CONSOLE_GETALLALIASESLENGTH GetAllAliasesLengthRequest;
870 CONSOLE_GETALIASESEXES GetAliasesExesRequest;
871 CONSOLE_GETALIASESEXESLENGTH GetAliasesExesLengthRequest;
872
873 /* History */
874 CONSOLE_GETCOMMANDHISTORY GetCommandHistoryRequest;
875 CONSOLE_GETCOMMANDHISTORYLENGTH GetCommandHistoryLengthRequest;
876 CONSOLE_EXPUNGECOMMANDHISTORY ExpungeCommandHistoryRequest;
877 CONSOLE_GETSETHISTORYINFO HistoryInfoRequest;
878 CONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest;
879 CONSOLE_SETHISTORYMODE SetHistoryModeRequest;
880
881 /* Input and Output Code Pages */
882 CONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest;
883 CONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest;
884 } Data;
885 } CONSOLE_API_MESSAGE, *PCONSOLE_API_MESSAGE;
886
887 // Check that a CONSOLE_API_MESSAGE can hold in a CSR_API_MESSAGE.
888 CHECK_API_MSG_SIZE(CONSOLE_API_MESSAGE);
889
890 #endif // _CONMSG_H
891
892 /* EOF */