mirror of
https://github.com/reactos/reactos.git
synced 2025-06-26 19:39:48 +00:00
Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
This commit is contained in:
parent
a28e798006
commit
c424146e2c
20602 changed files with 0 additions and 1140137 deletions
63
lib/sdk/crt/time/ftime.c
Normal file
63
lib/sdk/crt/time/ftime.c
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
* COPYRIGHT: LGPL, See LGPL.txt in the top level directory
|
||||
* PROJECT: ReactOS CRT library
|
||||
* FILE: lib/sdk/crt/time/ftime.c
|
||||
* PURPOSE: Deprecated BSD library call
|
||||
* PROGRAMERS: Timo Kreuzer
|
||||
*/
|
||||
#include <precomp.h>
|
||||
#include <sec_api/time_s.h>
|
||||
#include <sys/timeb.h>
|
||||
#include "bitsfixup.h"
|
||||
|
||||
/******************************************************************************
|
||||
* \name _ftime_s
|
||||
* \brief Get the current time.
|
||||
* \param [out] ptimeb Pointer to a structure of type struct _timeb that
|
||||
* recieves the current time.
|
||||
* \sa http://msdn.microsoft.com/en-us/library/95e68951.aspx
|
||||
*/
|
||||
errno_t
|
||||
_ftime_s(struct _timeb *ptimeb)
|
||||
{
|
||||
DWORD ret;
|
||||
TIME_ZONE_INFORMATION TimeZoneInformation;
|
||||
FILETIME SystemTime;
|
||||
|
||||
/* Validate parameters */
|
||||
if (!ptimeb)
|
||||
{
|
||||
#if 0
|
||||
_invalid_parameter(0,
|
||||
0,//__FUNCTION__,
|
||||
_CRT_WIDE(__FILE__),
|
||||
__LINE__,
|
||||
0);
|
||||
#endif
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
ret = GetTimeZoneInformation(&TimeZoneInformation);
|
||||
ptimeb->dstflag = (ret == TIME_ZONE_ID_DAYLIGHT) ? 1 : 0;
|
||||
ptimeb->timezone = TimeZoneInformation.Bias;
|
||||
|
||||
GetSystemTimeAsFileTime(&SystemTime);
|
||||
ptimeb->time = FileTimeToUnixTime(&SystemTime, &ptimeb->millitm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* \name _ftime
|
||||
* \brief Get the current time.
|
||||
* \param [out] ptimeb Pointer to a structure of type struct _timeb that
|
||||
* recieves the current time.
|
||||
* \note This function is for compatability and simply calls the secure
|
||||
* version _ftime_s().
|
||||
* \sa http://msdn.microsoft.com/en-us/library/z54t9z5f.aspx
|
||||
*/
|
||||
void
|
||||
_ftime(struct _timeb *ptimeb)
|
||||
{
|
||||
_ftime_s(ptimeb);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue