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