[KERNEL32]
[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 ConsoleHandle;
433 HANDLE InputHandle;
434 } CONSOLE_FLUSHINPUTBUFFER, *PCONSOLE_FLUSHINPUTBUFFER;
435
436 typedef struct
437 {
438 HANDLE ConsoleHandle;
439 HANDLE OutputHandle;
440 SMALL_RECT ScrollRectangle;
441 SMALL_RECT ClipRectangle;
442 BOOL UseClipRectangle;
443 COORD DestinationOrigin;
444 CHAR_INFO Fill;
445 BOOLEAN Unicode;
446 } CONSOLE_SCROLLSCREENBUFFER, *PCONSOLE_SCROLLSCREENBUFFER;
447
448
449 /*
450 * An attribute or a character are instances of the same entity, namely
451 * a "code" (what would be called an (ANSI) escape sequence). Therefore
452 * encode them inside the same structure.
453 */
454 typedef enum _CODE_TYPE
455 {
456 CODE_ASCII = 0x01,
457 CODE_UNICODE = 0x02,
458 CODE_ATTRIBUTE = 0x03
459 } CODE_TYPE;
460
461 typedef union _CODE_ELEMENT
462 {
463 CHAR AsciiChar;
464 WCHAR UnicodeChar;
465 WORD Attribute;
466 } CODE_ELEMENT;
467
468 typedef struct
469 {
470 HANDLE ConsoleHandle;
471 HANDLE OutputHandle;
472 COORD Coord;
473
474 CODE_TYPE CodeType;
475 CHAR CodeStaticBuffer[80]; // == 40 * sizeof(CODE_ELEMENT)
476 PVOID pCode; // Either a pointer to a character or to an attribute.
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 ConsoleHandle;
526 HANDLE OutputHandle;
527
528 CHAR_INFO StaticBuffer;
529 PCHAR_INFO CharInfo;
530
531 SMALL_RECT ReadRegion;
532 BOOLEAN Unicode;
533 } CONSOLE_READOUTPUT, *PCONSOLE_READOUTPUT;
534
535 typedef struct
536 {
537 HANDLE ConsoleHandle;
538 HANDLE OutputHandle;
539
540 CHAR_INFO StaticBuffer;
541 PCHAR_INFO CharInfo;
542
543 SMALL_RECT WriteRegion;
544 BOOLEAN Unicode;
545
546 ULONG Unknown;
547 } CONSOLE_WRITEOUTPUT, *PCONSOLE_WRITEOUTPUT;
548
549 typedef struct
550 {
551 HANDLE ConsoleHandle;
552 HANDLE InputHandle;
553 ULONG NumberOfEvents;
554 } CONSOLE_GETNUMINPUTEVENTS, *PCONSOLE_GETNUMINPUTEVENTS;
555
556
557
558 typedef struct
559 {
560 HANDLE ConsoleHandle;
561 HANDLE Handle;
562 } CONSOLE_CLOSEHANDLE, *PCONSOLE_CLOSEHANDLE;
563
564 typedef struct
565 {
566 BOOL IsValid;
567 HANDLE ConsoleHandle;
568 HANDLE Handle;
569 } CONSOLE_VERIFYHANDLE, *PCONSOLE_VERIFYHANDLE;
570
571 typedef struct
572 {
573 HANDLE ConsoleHandle;
574 HANDLE SourceHandle;
575 DWORD DesiredAccess;
576 BOOLEAN InheritHandle;
577 DWORD Options;
578 HANDLE TargetHandle;
579 } CONSOLE_DUPLICATEHANDLE, *PCONSOLE_DUPLICATEHANDLE;
580
581 typedef struct
582 {
583 HANDLE ConsoleHandle;
584 HANDLE Handle;
585 DWORD Flags;
586 } CONSOLE_GETHANDLEINFO, *PCONSOLE_GETHANDLEINFO;
587
588 typedef struct
589 {
590 HANDLE ConsoleHandle;
591 HANDLE Handle;
592 DWORD Mask;
593 DWORD Flags;
594 } CONSOLE_SETHANDLEINFO, *PCONSOLE_SETHANDLEINFO;
595
596 /*
597 * Type of handles.
598 */
599 typedef enum _CONSOLE_HANDLE_TYPE
600 {
601 HANDLE_INPUT = 0x01,
602 HANDLE_OUTPUT = 0x02
603 } CONSOLE_HANDLE_TYPE;
604
605 typedef struct
606 {
607 HANDLE ConsoleHandle;
608 CONSOLE_HANDLE_TYPE HandleType;
609 DWORD DesiredAccess;
610 BOOL InheritHandle;
611 DWORD ShareMode;
612 HANDLE Handle;
613 } CONSOLE_OPENCONSOLE, *PCONSOLE_OPENCONSOLE;
614
615
616
617 typedef struct
618 {
619 HANDLE ConsoleHandle;
620 HANDLE OutputHandle;
621 COORD Size;
622 } CONSOLE_GETLARGESTWINDOWSIZE, *PCONSOLE_GETLARGESTWINDOWSIZE;
623
624 typedef struct
625 {
626 HANDLE ConsoleHandle;
627 HANDLE OutputHandle;
628 DWORD CmdIdLow;
629 DWORD CmdIdHigh;
630 HMENU MenuHandle;
631 } CONSOLE_MENUCONTROL, *PCONSOLE_MENUCONTROL;
632
633 typedef struct
634 {
635 HANDLE ConsoleHandle;
636 BOOL Enable;
637 } CONSOLE_SETMENUCLOSE, *PCONSOLE_SETMENUCLOSE;
638
639 typedef struct
640 {
641 HANDLE ConsoleHandle;
642 HANDLE OutputHandle;
643 BOOL Absolute;
644 SMALL_RECT WindowRect; // New console window position in the screen-buffer frame (Absolute == TRUE)
645 // or in the old window position frame (Absolute == FALSE).
646 } CONSOLE_SETWINDOWINFO, *PCONSOLE_SETWINDOWINFO;
647
648 typedef struct
649 {
650 HANDLE ConsoleHandle;
651 HWND WindowHandle;
652 } CONSOLE_GETWINDOW, *PCONSOLE_GETWINDOW;
653
654 typedef struct
655 {
656 HANDLE ConsoleHandle;
657 HICON IconHandle;
658 } CONSOLE_SETICON, *PCONSOLE_SETICON;
659
660
661
662 typedef struct
663 {
664 HANDLE ConsoleHandle;
665 USHORT SourceLength;
666 USHORT TargetLength; // Also used for storing the number of bytes written.
667 USHORT ExeLength;
668 PVOID Source;
669 PVOID Target;
670 PVOID ExeName;
671 BOOLEAN Unicode;
672 BOOLEAN Unicode2;
673 } CONSOLE_ADDGETALIAS, *PCONSOLE_ADDGETALIAS;
674
675 typedef struct
676 {
677 HANDLE ConsoleHandle;
678 USHORT ExeLength;
679 PVOID ExeName;
680 BOOLEAN Unicode;
681 BOOLEAN Unicode2;
682 ULONG AliasesBufferLength;
683 PVOID AliasesBuffer;
684 } CONSOLE_GETALLALIASES, *PCONSOLE_GETALLALIASES;
685
686 typedef struct
687 {
688 HANDLE ConsoleHandle;
689 USHORT ExeLength;
690 PVOID ExeName;
691 ULONG Length;
692 BOOLEAN Unicode;
693 BOOLEAN Unicode2;
694 } CONSOLE_GETALLALIASESLENGTH, *PCONSOLE_GETALLALIASESLENGTH;
695
696 typedef struct
697 {
698 HANDLE ConsoleHandle;
699 ULONG Length ; // ExeLength; // ExesLength
700 PVOID ExeNames;
701 BOOLEAN Unicode;
702 } CONSOLE_GETALIASESEXES, *PCONSOLE_GETALIASESEXES;
703
704 typedef struct
705 {
706 HANDLE ConsoleHandle;
707 ULONG Length;
708 BOOLEAN Unicode;
709 } CONSOLE_GETALIASESEXESLENGTH, *PCONSOLE_GETALIASESEXESLENGTH;
710
711
712
713 typedef struct
714 {
715 HANDLE ConsoleHandle;
716 ULONG HistoryLength;
717 PVOID History;
718 USHORT ExeLength;
719 PVOID ExeName;
720 BOOLEAN Unicode;
721 BOOLEAN Unicode2;
722 } CONSOLE_GETCOMMANDHISTORY, *PCONSOLE_GETCOMMANDHISTORY;
723
724 typedef struct
725 {
726 HANDLE ConsoleHandle;
727 ULONG HistoryLength;
728 USHORT ExeLength;
729 PVOID ExeName;
730 BOOLEAN Unicode;
731 BOOLEAN Unicode2;
732 } CONSOLE_GETCOMMANDHISTORYLENGTH, *PCONSOLE_GETCOMMANDHISTORYLENGTH;
733
734 typedef struct
735 {
736 HANDLE ConsoleHandle;
737 USHORT ExeLength;
738 PVOID ExeName;
739 BOOLEAN Unicode;
740 BOOLEAN Unicode2;
741 } CONSOLE_EXPUNGECOMMANDHISTORY, *PCONSOLE_EXPUNGECOMMANDHISTORY;
742
743 typedef struct
744 {
745 UINT HistoryBufferSize;
746 UINT NumberOfHistoryBuffers;
747 DWORD dwFlags;
748 } CONSOLE_GETSETHISTORYINFO, *PCONSOLE_GETSETHISTORYINFO;
749
750 typedef struct
751 {
752 HANDLE ConsoleHandle;
753 ULONG NumCommands;
754 USHORT ExeLength;
755 PVOID ExeName;
756 BOOLEAN Unicode;
757 BOOLEAN Unicode2;
758 } CONSOLE_SETHISTORYNUMBERCOMMANDS, *PCONSOLE_SETHISTORYNUMBERCOMMANDS;
759
760 typedef struct
761 {
762 HANDLE ConsoleHandle;
763 ULONG Mode;
764 } CONSOLE_SETHISTORYMODE, *PCONSOLE_SETHISTORYMODE;
765
766
767
768 typedef struct
769 {
770 HANDLE ConsoleHandle;
771 HANDLE OutputHandle;
772 COORD Size;
773 } CONSOLE_SETSCREENBUFFERSIZE, *PCONSOLE_SETSCREENBUFFERSIZE;
774
775 typedef struct
776 {
777 HANDLE ConsoleHandle;
778 CONSOLE_SELECTION_INFO Info;
779 } CONSOLE_GETSELECTIONINFO, *PCONSOLE_GETSELECTIONINFO;
780
781 typedef struct
782 {
783 HANDLE ConsoleHandle;
784 UINT CodePage;
785 BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page
786 } CONSOLE_GETINPUTOUTPUTCP, *PCONSOLE_GETINPUTOUTPUTCP;
787
788 typedef struct
789 {
790 HANDLE ConsoleHandle;
791 UINT CodePage;
792 BOOL OutputCP; // TRUE : Output Code Page ; FALSE : Input Code Page
793 HANDLE EventHandle;
794 } CONSOLE_SETINPUTOUTPUTCP, *PCONSOLE_SETINPUTOUTPUTCP;
795
796 typedef struct _CONSOLE_API_MESSAGE
797 {
798 PORT_MESSAGE Header;
799
800 PCSR_CAPTURE_BUFFER CsrCaptureData;
801 CSR_API_NUMBER ApiNumber;
802 NTSTATUS Status;
803 ULONG Reserved;
804 union
805 {
806 /* Console initialization and uninitialization */
807 CONSOLE_ALLOCCONSOLE AllocConsoleRequest;
808 CONSOLE_ATTACHCONSOLE AttachConsoleRequest;
809 CONSOLE_FREECONSOLE FreeConsoleRequest;
810
811 /* Processes */
812 CONSOLE_GETPROCESSLIST GetProcessListRequest;
813 CONSOLE_GENERATECTRLEVENT GenerateCtrlEventRequest;
814 CONSOLE_NOTIFYLASTCLOSE NotifyLastCloseRequest;
815
816 /* Handles */
817 CONSOLE_OPENCONSOLE OpenConsoleRequest;
818 CONSOLE_CLOSEHANDLE CloseHandleRequest;
819 CONSOLE_VERIFYHANDLE VerifyHandleRequest;
820 CONSOLE_DUPLICATEHANDLE DuplicateHandleRequest;
821 CONSOLE_GETHANDLEINFO GetHandleInfoRequest;
822 CONSOLE_SETHANDLEINFO SetHandleInfoRequest;
823
824 /* Cursor & Mouse */
825 CONSOLE_SHOWCURSOR ShowCursorRequest;
826 CONSOLE_SETCURSOR SetCursorRequest;
827 CONSOLE_GETSETCURSORINFO CursorInfoRequest;
828 CONSOLE_SETCURSORPOSITION SetCursorPositionRequest;
829 CONSOLE_GETMOUSEINFO GetMouseInfoRequest;
830
831 /* Screen-buffer */
832 CONSOLE_CREATESCREENBUFFER CreateScreenBufferRequest;
833 CONSOLE_SETACTIVESCREENBUFFER SetScreenBufferRequest;
834 CONSOLE_GETSCREENBUFFERINFO ScreenBufferInfoRequest;
835 CONSOLE_SETSCREENBUFFERSIZE SetScreenBufferSizeRequest;
836 CONSOLE_SCROLLSCREENBUFFER ScrollScreenBufferRequest;
837
838 CONSOLE_GETSELECTIONINFO GetSelectionInfoRequest;
839 CONSOLE_FLUSHINPUTBUFFER FlushInputBufferRequest;
840
841 /* Console mode */
842 CONSOLE_GETSETCONSOLEMODE ConsoleModeRequest;
843 CONSOLE_GETDISPLAYMODE GetDisplayModeRequest;
844 CONSOLE_SETDISPLAYMODE SetDisplayModeRequest;
845 CONSOLE_GETSETHWSTATE HardwareStateRequest;
846
847 /* Console window */
848 CONSOLE_INVALIDATEDIBITS InvalidateDIBitsRequest;
849 CONSOLE_SETPALETTE SetPaletteRequest;
850 CONSOLE_GETSETCONSOLETITLE TitleRequest;
851 CONSOLE_GETLARGESTWINDOWSIZE GetLargestWindowSizeRequest;
852 CONSOLE_MENUCONTROL MenuControlRequest;
853 CONSOLE_SETMENUCLOSE SetMenuCloseRequest;
854 CONSOLE_SETWINDOWINFO SetWindowInfoRequest;
855 CONSOLE_GETWINDOW GetWindowRequest;
856 CONSOLE_SETICON SetIconRequest;
857
858 /* Read */
859 CONSOLE_READCONSOLE ReadConsoleRequest; // SrvReadConsole / ReadConsole
860 CONSOLE_GETINPUT GetInputRequest; // SrvGetConsoleInput / PeekConsoleInput & ReadConsoleInput
861 CONSOLE_READOUTPUT ReadOutputRequest; // SrvReadConsoleOutput / ReadConsoleOutput
862 CONSOLE_READOUTPUTCODE ReadOutputCodeRequest; // SrvReadConsoleOutputString / ReadConsoleOutputAttribute & ReadConsoleOutputCharacter
863 CONSOLE_GETNUMINPUTEVENTS GetNumInputEventsRequest;
864
865 /* Write */
866 CONSOLE_WRITECONSOLE WriteConsoleRequest; // SrvWriteConsole / WriteConsole
867 CONSOLE_WRITEINPUT WriteInputRequest;
868 CONSOLE_WRITEOUTPUT WriteOutputRequest;
869 CONSOLE_WRITEOUTPUTCODE WriteOutputCodeRequest;
870
871 CONSOLE_FILLOUTPUTCODE FillOutputRequest;
872 CONSOLE_SETTEXTATTRIB SetTextAttribRequest;
873
874 /* Aliases */
875 CONSOLE_ADDGETALIAS ConsoleAliasRequest;
876 CONSOLE_GETALLALIASES GetAllAliasesRequest;
877 CONSOLE_GETALLALIASESLENGTH GetAllAliasesLengthRequest;
878 CONSOLE_GETALIASESEXES GetAliasesExesRequest;
879 CONSOLE_GETALIASESEXESLENGTH GetAliasesExesLengthRequest;
880
881 /* History */
882 CONSOLE_GETCOMMANDHISTORY GetCommandHistoryRequest;
883 CONSOLE_GETCOMMANDHISTORYLENGTH GetCommandHistoryLengthRequest;
884 CONSOLE_EXPUNGECOMMANDHISTORY ExpungeCommandHistoryRequest;
885 CONSOLE_GETSETHISTORYINFO HistoryInfoRequest;
886 CONSOLE_SETHISTORYNUMBERCOMMANDS SetHistoryNumberCommandsRequest;
887 CONSOLE_SETHISTORYMODE SetHistoryModeRequest;
888
889 /* Input and Output Code Pages */
890 CONSOLE_GETINPUTOUTPUTCP GetConsoleCPRequest;
891 CONSOLE_SETINPUTOUTPUTCP SetConsoleCPRequest;
892 } Data;
893 } CONSOLE_API_MESSAGE, *PCONSOLE_API_MESSAGE;
894
895 // Check that a CONSOLE_API_MESSAGE can hold in a CSR_API_MESSAGE.
896 CHECK_API_MSG_SIZE(CONSOLE_API_MESSAGE);
897
898 #endif // _CONMSG_H
899
900 /* EOF */