-
Notifications
You must be signed in to change notification settings - Fork 320
/
consoleapi.h
executable file
·215 lines (172 loc) · 4.58 KB
/
consoleapi.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
/********************************************************************************
* *
* consoleapi.h -- ApiSet Contract for api-ms-win-core-console-l1 *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
********************************************************************************/
#ifdef _MSC_VER
#pragma once
#endif // _MSC_VER
#ifndef _APISETCONSOLE_
#define _APISETCONSOLE_
#include <apiset.h>
#include <apisetcconv.h>
#include <windows.h>
/* APISET_NAME: api-ms-win-core-console-l1 */
/* APISET_TAG: public */
#if !defined(RC_INVOKED)
#ifndef _APISET_CONSOLE_VER
#ifdef _APISET_TARGET_VERSION
#if _APISET_TARGET_VERSION >= _APISET_TARGET_VERSION_WIN7
#define _APISET_CONSOLE_VER 0x0100
#endif
#endif
#endif
#endif // !defined(RC_INVOKED)
#ifdef __cplusplus
extern "C" {
#endif
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
WINBASEAPI
BOOL
WINAPI
AllocConsole(
VOID
);
WINBASEAPI
UINT
WINAPI
GetConsoleCP(
VOID
);
WINBASEAPI
BOOL
WINAPI
GetConsoleMode(
_In_ HANDLE hConsoleHandle,
_Out_ LPDWORD lpMode
);
WINBASEAPI
UINT
WINAPI
GetConsoleOutputCP(
VOID
);
WINBASEAPI
BOOL
WINAPI
GetNumberOfConsoleInputEvents(
_In_ HANDLE hConsoleInput,
_Out_ LPDWORD lpNumberOfEvents
);
WINBASEAPI
BOOL
WINAPI
PeekConsoleInputA(
_In_ HANDLE hConsoleInput,
_Out_writes_(nLength) PINPUT_RECORD lpBuffer,
_In_ DWORD nLength,
_Out_ LPDWORD lpNumberOfEventsRead
);
#ifndef UNICODE
#define PeekConsoleInput PeekConsoleInputA
#endif
WINBASEAPI
_Success_(return != FALSE)
BOOL
WINAPI
ReadConsoleA(
_In_ HANDLE hConsoleInput,
_Out_writes_bytes_to_(nNumberOfCharsToRead * sizeof(CHAR), *lpNumberOfCharsRead * sizeof(CHAR)) LPVOID lpBuffer,
_In_ DWORD nNumberOfCharsToRead,
_Out_ _Deref_out_range_(<=, nNumberOfCharsToRead) LPDWORD lpNumberOfCharsRead,
_In_opt_ PCONSOLE_READCONSOLE_CONTROL pInputControl
);
WINBASEAPI
_Success_(return != FALSE)
BOOL
WINAPI
ReadConsoleW(
_In_ HANDLE hConsoleInput,
_Out_writes_bytes_to_(nNumberOfCharsToRead * sizeof(WCHAR), *lpNumberOfCharsRead * sizeof(WCHAR)) LPVOID lpBuffer,
_In_ DWORD nNumberOfCharsToRead,
_Out_ _Deref_out_range_(<=, nNumberOfCharsToRead) LPDWORD lpNumberOfCharsRead,
_In_opt_ PCONSOLE_READCONSOLE_CONTROL pInputControl
);
#ifdef UNICODE
#define ReadConsole ReadConsoleW
#else
#define ReadConsole ReadConsoleA
#endif // !UNICODE
WINBASEAPI
_Success_(return != FALSE)
BOOL
WINAPI
ReadConsoleInputA(
_In_ HANDLE hConsoleInput,
_Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer,
_In_ DWORD nLength,
_Out_ _Deref_out_range_(<=, nLength) LPDWORD lpNumberOfEventsRead
);
WINBASEAPI
_Success_(return != FALSE)
BOOL
WINAPI
ReadConsoleInputW(
_In_ HANDLE hConsoleInput,
_Out_writes_to_(nLength, *lpNumberOfEventsRead) PINPUT_RECORD lpBuffer,
_In_ DWORD nLength,
_Out_ _Deref_out_range_(<=, nLength) LPDWORD lpNumberOfEventsRead
);
#ifdef UNICODE
#define ReadConsoleInput ReadConsoleInputW
#else
#define ReadConsoleInput ReadConsoleInputA
#endif // !UNICODE
WINBASEAPI
BOOL
WINAPI
SetConsoleCtrlHandler(
_In_opt_ PHANDLER_ROUTINE HandlerRoutine,
_In_ BOOL Add
);
WINBASEAPI
BOOL
WINAPI
SetConsoleMode(
_In_ HANDLE hConsoleHandle,
_In_ DWORD dwMode
);
WINBASEAPI
BOOL
WINAPI
WriteConsoleA(
_In_ HANDLE hConsoleOutput,
_In_reads_(nNumberOfCharsToWrite) CONST VOID * lpBuffer,
_In_ DWORD nNumberOfCharsToWrite,
_Out_opt_ LPDWORD lpNumberOfCharsWritten,
_Reserved_ LPVOID lpReserved
);
WINBASEAPI
BOOL
WINAPI
WriteConsoleW(
_In_ HANDLE hConsoleOutput,
_In_reads_(nNumberOfCharsToWrite) CONST VOID * lpBuffer,
_In_ DWORD nNumberOfCharsToWrite,
_Out_opt_ LPDWORD lpNumberOfCharsWritten,
_Reserved_ LPVOID lpReserved
);
#ifdef UNICODE
#define WriteConsole WriteConsoleW
#else
#define WriteConsole WriteConsoleA
#endif // !UNICODE
#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#pragma endregion
#ifdef __cplusplus
}
#endif
#endif // _APISETCONSOLE_