SetConsoleCtrlHandler function Null safety kernel32

int SetConsoleCtrlHandler(
  1. Pointer<NativeFunction<HandlerRoutine>> HandlerRoutine,
  2. int Add
)

Adds or removes an application-defined HandlerRoutine function from the list of handler functions for the calling process.

BOOL WINAPI SetConsoleCtrlHandler(
  _In_opt_ PHANDLER_ROUTINE HandlerRoutine,
  _In_     BOOL             Add
);

Implementation

int SetConsoleCtrlHandler(
        Pointer<NativeFunction<HandlerRoutine>> HandlerRoutine, int Add) =>
    _SetConsoleCtrlHandler(HandlerRoutine, Add);