AttachConsole function Null safety kernel32

int AttachConsole(
  1. int dwProcessId
)

Attaches the calling process to the console of the specified process.

BOOL WINAPI AttachConsole(
  _In_ DWORD dwProcessId
);

Implementation

int AttachConsole(int dwProcessId) {
  final _AttachConsole = _kernel32.lookupFunction<
      Int32 Function(Uint32 dwProcessId),
      int Function(int dwProcessId)>('AttachConsole');
  return _AttachConsole(dwProcessId);
}