ReadConsole function Null safety kernel32
- int hConsoleInput,
- Pointer<
NativeType> lpBuffer, - int nNumberOfCharsToRead,
- Pointer<
Uint32> lpNumberOfCharsRead, - Pointer<
NativeType> pInputControl
Reads character input from the console input buffer and removes it from the buffer.
BOOL WINAPI ReadConsoleW(
_In_ HANDLE hConsoleInput,
_Out_ LPVOID lpBuffer,
_In_ DWORD nNumberOfCharsToRead,
_Out_ LPDWORD lpNumberOfCharsRead,
_In_opt_ LPVOID pInputControl
);
Implementation
int ReadConsole(int hConsoleInput, Pointer lpBuffer, int nNumberOfCharsToRead,
Pointer<Uint32> lpNumberOfCharsRead, Pointer pInputControl) {
final _ReadConsole = _kernel32.lookupFunction<
Int32 Function(
IntPtr hConsoleInput,
Pointer lpBuffer,
Uint32 nNumberOfCharsToRead,
Pointer<Uint32> lpNumberOfCharsRead,
Pointer pInputControl),
int Function(
int hConsoleInput,
Pointer lpBuffer,
int nNumberOfCharsToRead,
Pointer<Uint32> lpNumberOfCharsRead,
Pointer pInputControl)>('ReadConsoleW');
return _ReadConsole(hConsoleInput, lpBuffer, nNumberOfCharsToRead,
lpNumberOfCharsRead, pInputControl);
}