GetConsoleMode function Null safety kernel32

int GetConsoleMode(
  1. int hConsoleHandle,
  2. Pointer<Uint32> lpMode
)

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

BOOL WINAPI GetConsoleMode(
  _In_  HANDLE  hConsoleHandle,
  _Out_ LPDWORD lpMode
);

Implementation

int GetConsoleMode(int hConsoleHandle, Pointer<Uint32> lpMode) {
  final _GetConsoleMode = _kernel32.lookupFunction<
      Int32 Function(IntPtr hConsoleHandle, Pointer<Uint32> lpMode),
      int Function(
          int hConsoleHandle, Pointer<Uint32> lpMode)>('GetConsoleMode');
  return _GetConsoleMode(hConsoleHandle, lpMode);
}