SetConsoleCursorPosition function Null safety kernel32

int SetConsoleCursorPosition(
  1. int hConsoleOutput,
  2. COORD dwCursorPosition
)

Sets the cursor position in the specified console screen buffer.

BOOL WINAPI SetConsoleCursorPosition(
  _In_ HANDLE hConsoleOutput,
  _In_ COORD  dwCursorPosition
);

Implementation

int SetConsoleCursorPosition(int hConsoleOutput, COORD dwCursorPosition) {
  final _SetConsoleCursorPosition = _kernel32.lookupFunction<
      Int32 Function(IntPtr hConsoleOutput, COORD dwCursorPosition),
      int Function(int hConsoleOutput,
          COORD dwCursorPosition)>('SetConsoleCursorPosition');
  return _SetConsoleCursorPosition(hConsoleOutput, dwCursorPosition);
}