/* This file is part of Lcrzo.
*/

#if defined LCRZODEF_SYSTEM_Unix
  /* this function is not needed */
#elif defined LCRZODEF_SYSTEM_Windows

/*-------------------------------------------------------------*/

int lcrzo_priv_wait_winmsec_init_time(lcrzo_time *ptime, 
				      lcrzo_uint32 *pmsec)
{ int ret;

  /* parameters verification */
  if (ptime==NULL) return(LCRZO_ERR_PANULLPTR);
  if (pmsec==NULL) return(LCRZO_ERR_OK);

  if ( ptime->sec==LCRZO_WAIT_NODELAY_VAL &&
       ptime->usec==LCRZO_WAIT_NODELAY_VAL )
  { *pmsec=0;
  }
  else if ( ptime->sec==LCRZO_WAIT_INFINITE_VAL &&
	    ptime->usec==LCRZO_WAIT_INFINITE_VAL )
  { *pmsec=INFINITE;
  }
  else
  { ret=lcrzo_time_get_msec(ptime, pmsec);
    if (ret!=LCRZO_ERR_OK)
    { if (ret==LCRZO_ERR_SPTIMEMSECOVER)
	  *pmsec=INFINITE;
      else
        return(ret);
	}
  }

  return(LCRZO_ERR_OK);
}

/*-------------------------------------------------------------*/
#else
 #error "Unknown value for LCRZODEF_SYSTEM"
#endif



