SetStdHandle function Null safety kernel32

int SetStdHandle(
  1. int nStdHandle,
  2. int hHandle
)

Sets the handle for the specified standard device (standard input, standard output, or standard error).

BOOL WINAPI SetStdHandle(
  _In_ DWORD  nStdHandle,
  _In_ HANDLE hHandle
);

Implementation

int SetStdHandle(int nStdHandle, int hHandle) {
  final _SetStdHandle = _kernel32.lookupFunction<
      Int32 Function(Uint32 nStdHandle, IntPtr hHandle),
      int Function(int nStdHandle, int hHandle)>('SetStdHandle');
  return _SetStdHandle(nStdHandle, hHandle);
}