1 #ifndef _NTDDBLUE_H_INCLUDED_
2 #define _NTDDBLUE_H_INCLUDED_
3 
4 #define IOCTL_CONSOLE_RESET_SCREEN              CTL_CODE(FILE_DEVICE_SCREEN, 0x800, METHOD_BUFFERED, FILE_WRITE_ACCESS)
5 
6 #define IOCTL_CONSOLE_GET_SCREEN_BUFFER_INFO    CTL_CODE(FILE_DEVICE_SCREEN, 0x801, METHOD_BUFFERED, FILE_READ_ACCESS)
7 #define IOCTL_CONSOLE_SET_SCREEN_BUFFER_INFO    CTL_CODE(FILE_DEVICE_SCREEN, 0x802, METHOD_BUFFERED, FILE_WRITE_ACCESS)
8 #define IOCTL_CONSOLE_GET_CURSOR_INFO           CTL_CODE(FILE_DEVICE_SCREEN, 0x803, METHOD_BUFFERED, FILE_READ_ACCESS)
9 #define IOCTL_CONSOLE_SET_CURSOR_INFO           CTL_CODE(FILE_DEVICE_SCREEN, 0x804, METHOD_BUFFERED, FILE_WRITE_ACCESS)
10 #define IOCTL_CONSOLE_GET_MODE                  CTL_CODE(FILE_DEVICE_SCREEN, 0x805, METHOD_BUFFERED, FILE_READ_ACCESS)
11 #define IOCTL_CONSOLE_SET_MODE                  CTL_CODE(FILE_DEVICE_SCREEN, 0x806, METHOD_BUFFERED, FILE_WRITE_ACCESS)
12 
13 #define IOCTL_CONSOLE_FILL_OUTPUT_ATTRIBUTE     CTL_CODE(FILE_DEVICE_SCREEN, 0x810, METHOD_BUFFERED, FILE_WRITE_ACCESS)
14 #define IOCTL_CONSOLE_READ_OUTPUT_ATTRIBUTE     CTL_CODE(FILE_DEVICE_SCREEN, 0x811, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
15 #define IOCTL_CONSOLE_WRITE_OUTPUT_ATTRIBUTE    CTL_CODE(FILE_DEVICE_SCREEN, 0x812, METHOD_IN_DIRECT, FILE_WRITE_ACCESS)
16 #define IOCTL_CONSOLE_SET_TEXT_ATTRIBUTE        CTL_CODE(FILE_DEVICE_SCREEN, 0x813, METHOD_BUFFERED, FILE_WRITE_ACCESS)
17 
18 #define IOCTL_CONSOLE_FILL_OUTPUT_CHARACTER     CTL_CODE(FILE_DEVICE_SCREEN, 0x820, METHOD_BUFFERED, FILE_WRITE_ACCESS)
19 #define IOCTL_CONSOLE_READ_OUTPUT_CHARACTER     CTL_CODE(FILE_DEVICE_SCREEN, 0x821, METHOD_OUT_DIRECT, FILE_READ_ACCESS)
20 #define IOCTL_CONSOLE_WRITE_OUTPUT_CHARACTER    CTL_CODE(FILE_DEVICE_SCREEN, 0x822, METHOD_IN_DIRECT, FILE_WRITE_ACCESS)
21 
22 #define IOCTL_CONSOLE_DRAW                      CTL_CODE(FILE_DEVICE_SCREEN, 0x830, METHOD_IN_DIRECT, FILE_WRITE_ACCESS)
23 
24 #define IOCTL_CONSOLE_LOADFONT                  CTL_CODE(FILE_DEVICE_SCREEN, 0x840, METHOD_IN_DIRECT, FILE_WRITE_ACCESS)
25 
26 /* TYPEDEFS **************************************************************/
27 
28 typedef struct tagCONSOLE_MODE
29 {
30     ULONG dwMode;
31 } CONSOLE_MODE, *PCONSOLE_MODE;
32 
33 typedef struct tagOUTPUT_ATTRIBUTE
34 {
35     USHORT wAttribute;
36     ULONG  nLength;
37     COORD  dwCoord;
38     ULONG  dwTransfered;
39 } OUTPUT_ATTRIBUTE, *POUTPUT_ATTRIBUTE;
40 
41 typedef struct tagOUTPUT_CHARACTER
42 {
43     CHAR  cCharacter;
44     ULONG nLength;
45     COORD dwCoord;
46     ULONG dwTransfered;
47 } OUTPUT_CHARACTER, *POUTPUT_CHARACTER;
48 
49 typedef struct tagCONSOLE_DRAW
50 {
51     USHORT X;       /* Origin */
52     USHORT Y;
53     USHORT SizeX;   /* Size of the screen buffer (chars) */
54     USHORT SizeY;
55     USHORT CursorX; /* New cursor position (screen-relative) */
56     USHORT CursorY;
57     /* Followed by screen buffer in char/attrib format */
58 } CONSOLE_DRAW, *PCONSOLE_DRAW;
59 
60 #endif /* _NTDDBLUE_H_INCLUDED_ */
61