1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! ApiSet Contract for api-ms-win-core-console-l1
7 use shared::minwindef::{BOOL, DWORD, LPDWORD, LPVOID, UINT};
8 use um::wincon::{PCONSOLE_READCONSOLE_CONTROL, PHANDLER_ROUTINE};
9 use um::wincontypes::{COORD, HPCON, PINPUT_RECORD};
10 use um::winnt::{HANDLE, HRESULT, VOID};
11 extern "system" {
AllocConsole() -> BOOL12     pub fn AllocConsole() -> BOOL;
GetConsoleCP() -> UINT13     pub fn GetConsoleCP() -> UINT;
GetConsoleMode( hConsoleHandle: HANDLE, lpMode: LPDWORD, ) -> BOOL14     pub fn GetConsoleMode(
15         hConsoleHandle: HANDLE,
16         lpMode: LPDWORD,
17     ) -> BOOL;
GetConsoleOutputCP() -> UINT18     pub fn GetConsoleOutputCP() -> UINT;
GetNumberOfConsoleInputEvents( hConsoleInput: HANDLE, lpNumberOfEvents: LPDWORD, ) -> BOOL19     pub fn GetNumberOfConsoleInputEvents(
20         hConsoleInput: HANDLE,
21         lpNumberOfEvents: LPDWORD,
22     ) -> BOOL;
PeekConsoleInputA( hConsoleInput: HANDLE, lpBuffer: PINPUT_RECORD, nLength: DWORD, lpNumberOfEventsRead: LPDWORD, ) -> BOOL23     pub fn PeekConsoleInputA(
24         hConsoleInput: HANDLE,
25         lpBuffer: PINPUT_RECORD,
26         nLength: DWORD,
27         lpNumberOfEventsRead: LPDWORD,
28     ) -> BOOL;
ReadConsoleA( hConsoleInput: HANDLE, lpBuffer: LPVOID, nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, pInputControl: PCONSOLE_READCONSOLE_CONTROL, ) -> BOOL29     pub fn ReadConsoleA(
30         hConsoleInput: HANDLE,
31         lpBuffer: LPVOID,
32         nNumberOfCharsToRead: DWORD,
33         lpNumberOfCharsRead: LPDWORD,
34         pInputControl: PCONSOLE_READCONSOLE_CONTROL,
35     ) -> BOOL;
ReadConsoleW( hConsoleInput: HANDLE, lpBuffer: LPVOID, nNumberOfCharsToRead: DWORD, lpNumberOfCharsRead: LPDWORD, pInputControl: PCONSOLE_READCONSOLE_CONTROL, ) -> BOOL36     pub fn ReadConsoleW(
37         hConsoleInput: HANDLE,
38         lpBuffer: LPVOID,
39         nNumberOfCharsToRead: DWORD,
40         lpNumberOfCharsRead: LPDWORD,
41         pInputControl: PCONSOLE_READCONSOLE_CONTROL,
42     ) -> BOOL;
ReadConsoleInputA( hConsoleInput: HANDLE, lpBuffer: PINPUT_RECORD, nLength: DWORD, lpNumberOfEventsRead: LPDWORD, ) -> BOOL43     pub fn ReadConsoleInputA(
44         hConsoleInput: HANDLE,
45         lpBuffer: PINPUT_RECORD,
46         nLength: DWORD,
47         lpNumberOfEventsRead: LPDWORD,
48     ) -> BOOL;
ReadConsoleInputW( hConsoleInput: HANDLE, lpBuffer: PINPUT_RECORD, nLength: DWORD, lpNumberOfEventsRead: LPDWORD, ) -> BOOL49     pub fn ReadConsoleInputW(
50         hConsoleInput: HANDLE,
51         lpBuffer: PINPUT_RECORD,
52         nLength: DWORD,
53         lpNumberOfEventsRead: LPDWORD,
54     ) -> BOOL;
SetConsoleCtrlHandler( HandlerRoutine: PHANDLER_ROUTINE, Add: BOOL, ) -> BOOL55     pub fn SetConsoleCtrlHandler(
56         HandlerRoutine: PHANDLER_ROUTINE,
57         Add: BOOL,
58     ) -> BOOL;
SetConsoleMode( hConsoleHandle: HANDLE, dwMode: DWORD, ) -> BOOL59     pub fn SetConsoleMode(
60         hConsoleHandle: HANDLE,
61         dwMode: DWORD,
62     ) -> BOOL;
WriteConsoleA( hConsoleOutput: HANDLE, lpBuffer: *const VOID, nNumberOfCharsToWrite: DWORD, lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID, ) -> BOOL63     pub fn WriteConsoleA(
64         hConsoleOutput: HANDLE,
65         lpBuffer: *const VOID,
66         nNumberOfCharsToWrite: DWORD,
67         lpNumberOfCharsWritten: LPDWORD,
68         lpReserved: LPVOID,
69     ) -> BOOL;
WriteConsoleW( hConsoleOutput: HANDLE, lpBuffer: *const VOID, nNumberOfCharsToWrite: DWORD, lpNumberOfCharsWritten: LPDWORD, lpReserved: LPVOID, ) -> BOOL70     pub fn WriteConsoleW(
71         hConsoleOutput: HANDLE,
72         lpBuffer: *const VOID,
73         nNumberOfCharsToWrite: DWORD,
74         lpNumberOfCharsWritten: LPDWORD,
75         lpReserved: LPVOID,
76     ) -> BOOL;
CreatePseudoConsole( size: COORD, hInput: HANDLE, hOutput: HANDLE, dwFlags: DWORD, phPC: *mut HPCON, ) -> HRESULT77     pub fn CreatePseudoConsole(
78         size: COORD,
79         hInput: HANDLE,
80         hOutput: HANDLE,
81         dwFlags: DWORD,
82         phPC: *mut HPCON,
83     ) -> HRESULT;
ResizePseudoConsole( hPC: HPCON, size: COORD, ) -> HRESULT84     pub fn ResizePseudoConsole(
85         hPC: HPCON,
86         size: COORD,
87     ) -> HRESULT;
ClosePseudoConsole( hPC: HPCON, )88     pub fn ClosePseudoConsole(
89         hPC: HPCON,
90     );
91 }
92