ReactOS  0.4.15-dev-1207-g698a8e6
ftime.c File Reference
#include <precomp.h>
#include <sys/timeb.h>
#include "bitsfixup.h"
Include dependency graph for ftime.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

errno_t CDECL _ftime_s (struct _timeb *ptimeb)
 
void CDECL _ftime (struct _timeb *ptimeb)
 

Function Documentation

◆ _ftime()

void CDECL _ftime ( struct _timeb ptimeb)

Definition at line 55 of file ftime.c.

56 {
57  _ftime_s(ptimeb);
58 }
errno_t CDECL _ftime_s(struct _timeb *ptimeb)
Definition: ftime.c:21

◆ _ftime_s()

errno_t CDECL _ftime_s ( struct _timeb ptimeb)

Definition at line 21 of file ftime.c.

22 {
23  DWORD ret;
24  TIME_ZONE_INFORMATION TimeZoneInformation;
25  FILETIME SystemTime;
26 
27  /* Validate parameters */
28  if (!MSVCRT_CHECK_PMT( ptimeb != NULL ))
29  {
30  *_errno() = EINVAL;
31  return EINVAL;
32  }
33 
34  ret = GetTimeZoneInformation(&TimeZoneInformation);
35  ptimeb->dstflag = (ret == TIME_ZONE_ID_DAYLIGHT) ? 1 : 0;
36  ptimeb->timezone = (short)TimeZoneInformation.Bias;
37 
38  GetSystemTimeAsFileTime(&SystemTime);
39  ptimeb->time = (time_t)FileTimeToUnixTime(&SystemTime, &ptimeb->millitm);
40 
41  return 0;
42 }
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
Definition: timezone.c:262
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
Definition: arc.h:39
short dstflag
Definition: timeb.h:28
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
static __inline __time64_t FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
Definition: time.h:14
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
_CRTIMP int *__cdecl _errno(void)
Definition: errno.c:19
int ret
#define MSVCRT_CHECK_PMT(x)
Definition: mbstowcs_s.c:26
unsigned short millitm
Definition: timeb.h:26
short timezone
Definition: timeb.h:27
__kernel_time_t time_t
Definition: linux.h:252
#define TIME_ZONE_ID_DAYLIGHT
Definition: rtltypes.h:252
time_t time
Definition: timeb.h:25

Referenced by _ftime().