CreatePseudoConsole function Null safety kernel32

int CreatePseudoConsole(
  1. COORD size,
  2. int hInput,
  3. int hOutput,
  4. int dwFlags,
  5. Pointer<IntPtr> phPC
)

Creates a new pseudoconsole object for the calling process.

HRESULT WINAPI CreatePseudoConsole(
  _In_ COORD size,
  _In_ HANDLE hInput,
  _In_ HANDLE hOutput,
  _In_ DWORD dwFlags,
  _Out_ HPCON* phPC
);

Implementation

int CreatePseudoConsole(
    COORD size, int hInput, int hOutput, int dwFlags, Pointer<IntPtr> phPC) {
  final _CreatePseudoConsole = _kernel32.lookupFunction<
      Int32 Function(COORD size, IntPtr hInput, IntPtr hOutput, Uint32 dwFlags,
          Pointer<IntPtr> phPC),
      int Function(COORD size, int hInput, int hOutput, int dwFlags,
          Pointer<IntPtr> phPC)>('CreatePseudoConsole');
  return _CreatePseudoConsole(size, hInput, hOutput, dwFlags, phPC);
}