/* This file is part of Lcrzo.
*/

int lcrzo_process_close(lcrzo_process *pprocess)
{
#if defined LCRZODEF_SYSTEM_Unix
#elif defined LCRZODEF_SYSTEM_Windows
  if ( ! CloseHandle(pprocess->threadhandle) )
  { return(LCRZO_ERR_FUCLOSEHANDLE);
  }

  if ( pprocess->pfuncinfos!=NULL )
  { lcrzo_priv_process_funcinfos *plppfi;
    plppfi=(lcrzo_priv_process_funcinfos *)(pprocess->pfuncinfos);
    lcrzo_er(lcrzo_data_free(plppfi->infos));
    lcrzo_er(lcrzo_data_free(pprocess->pfuncinfos));
    pprocess->pfuncinfos=NULL;
  }
#else
 #error "Unknown value for LCRZODEF_SYSTEM"
#endif
  
  pprocess->hasended=LCRZO_FALSE;
  pprocess->returnedvalue=LCRZO_ERR_IEINTERNALERROR; /*default value*/

  return(LCRZO_ERR_OK);
}

