ULONG CheckUserInput (PTHREADSTATE Thread_local_state, PCHAR User_input, ULONG Length)
{
  UICSTATE WR UIC_state = {0}; ULONG WR Rc = NO_ERROR;

  EXCEPTIONRECORD Record = {
                            .Exception_handler = CheckUserInputExceptionHandler,
                            .Thread_context = Thread_local_state,
                            .Local_pointer_limit = Length,
                            .Local_pointer = User_input,
                            .Local_state = &UIC_state,
                            .Complete_label = &&complete,
                            .Error_code = &Rc
                           };

  DosSetExceptionHandler (&Record);

  ú
  ú
  ú

complete:

  DosUnsetExceptionHandler (&Record);

  Free (&UIC_state);

  return Rc;
}

ULONG APIENTRY CheckUserInputExceptionHandler (PEXCEPTIONREPORT Exception_report,
                                               PTHREADSTATE     Thread_context,
                                               PCHAR            User_input,
                                               ULONG            Length,
                                               PUICSTATE        State)
{
  ...

  return XCPT_CONTINUE_EXECUTION;
}
