SetConsoleMode function Null safety kernel32

int SetConsoleMode(
  1. int hConsoleHandle,
  2. int dwMode

Sets the input mode of a console's input buffer or the output mode of a console screen buffer.

BOOL WINAPI SetConsoleMode(
  _In_ HANDLE hConsoleHandle,
  _In_ DWORD  dwMode


int SetConsoleMode(int hConsoleHandle, int dwMode) {
  final _SetConsoleMode = _kernel32.lookupFunction<
      Int32 Function(IntPtr hConsoleHandle, Uint32 dwMode),
      int Function(int hConsoleHandle, int dwMode)>('SetConsoleMode');
  return _SetConsoleMode(hConsoleHandle, dwMode);