SetConsoleDisplayMode function Null safety kernel32

int SetConsoleDisplayMode (
  1. int hConsoleOutput,
  2. int dwFlags,
  3. Pointer<COORD> lpNewScreenBufferDimensions
)

Sets the display mode of the specified console screen buffer.

BOOL WINAPI SetConsoleDisplayMode(
  _In_      HANDLE hConsoleOutput,
  _In_      DWORD  dwFlags,
  _Out_opt_ PCOORD lpNewScreenBufferDimensions
);

Implementation

int SetConsoleDisplayMode(int hConsoleOutput, int dwFlags,
    Pointer<COORD> lpNewScreenBufferDimensions) {
  final _SetConsoleDisplayMode = _kernel32.lookupFunction<
      Int32 Function(IntPtr hConsoleOutput, Uint32 dwFlags,
          Pointer<COORD> lpNewScreenBufferDimensions),
      int Function(int hConsoleOutput, int dwFlags,
          Pointer<COORD> lpNewScreenBufferDimensions)>('SetConsoleDisplayMode');
  return _SetConsoleDisplayMode(
      hConsoleOutput, dwFlags, lpNewScreenBufferDimensions);
}