source: trunk/src/kernel32/time.cpp@ 8777

Last change on this file since 8777 was 8777, checked in by sandervl, 23 years ago

There are no bugs in the WGSS SystemTimeToFileTime & DosDateTimeToFileTime functions; Real problem lies in the fact that the times returned by DosFindFirst, DosFindNext, DosQueryPathInfo & DosQueryFileInfo are in local time; we must convert them to file time (UTC)

File size: 5.8 KB
Line 
1/* $Id: time.cpp,v 1.21 2002-06-26 07:42:35 sandervl Exp $ */
2
3/*
4 * Win32 time/date API functions
5 *
6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
7 * Copyright 1999 Christoph Bratschi (cbratschi@datacomm.ch)
8 *
9 * Copyright 1996 Alexandre Julliard
10 * Copyright 1995 Martin von Loewis
11 * Copyright 1998 David Lee Lambert
12
13 *
14 * Project Odin Software License can be found in LICENSE.TXT
15 */
16
17
18/*****************************************************************************
19 * Includes *
20 *****************************************************************************/
21
22#include <odin.h>
23#include <odinwrap.h>
24#include <os2sel.h>
25
26#include <os2win.h>
27
28#include <winnls.h>
29#include "winuser.h"
30#include <stdlib.h>
31#include <string.h>
32#include <stdio.h>
33#include <time.h>
34#include "unicode.h"
35
36#define DBG_LOCALLOG DBG_time
37#include "dbglocal.h"
38
39//******************************************************************************
40//******************************************************************************
41void WIN32API GetLocalTime(LPSYSTEMTIME arg1)
42{
43 O32_GetLocalTime(arg1);
44}
45//******************************************************************************
46//******************************************************************************
47BOOL WIN32API SetLocalTime(const SYSTEMTIME * arg1)
48{
49 return O32_SetLocalTime(arg1);
50}
51//******************************************************************************
52//******************************************************************************
53BOOL WIN32API FileTimeToDosDateTime(const FILETIME * arg1, LPWORD arg2,
54 LPWORD arg3)
55{
56 return O32_FileTimeToDosDateTime(arg1, arg2, arg3);
57}
58
59//******************************************************************************
60//******************************************************************************
61BOOL WIN32API FileTimeToLocalFileTime(const FILETIME * utcft, LPFILETIME localft)
62{
63 return O32_FileTimeToLocalFileTime(utcft,localft);
64}
65//******************************************************************************
66//******************************************************************************
67BOOL WIN32API LocalFileTimeToFileTime(const FILETIME * arg1, LPFILETIME arg2)
68{
69 dprintf(("KERNEL32: LocalFileTimeToFileTime\n"));
70 return O32_LocalFileTimeToFileTime(arg1, arg2);
71}
72//******************************************************************************
73//******************************************************************************
74BOOL WIN32API FileTimeToSystemTime(const FILETIME * arg1, LPSYSTEMTIME arg2)
75{
76 return O32_FileTimeToSystemTime(arg1, arg2);
77}
78//******************************************************************************
79//******************************************************************************
80BOOL WIN32API DosDateTimeToFileTime(WORD arg1, WORD arg2, LPFILETIME arg3)
81{
82 return O32_DosDateTimeToFileTime(arg1, arg2, arg3);
83}
84//******************************************************************************
85//******************************************************************************
86DWORD WIN32API GetTimeZoneInformation(LPTIME_ZONE_INFORMATION arg1)
87{
88 return O32_GetTimeZoneInformation(arg1);
89}
90//******************************************************************************
91//******************************************************************************
92DWORD WIN32API GetTickCount(void)
93{
94//// dprintf(("KERNEL32: GetTickCount\n"));
95 return O32_GetTickCount();
96}
97//******************************************************************************
98//******************************************************************************
99void WIN32API GetSystemTime(LPSYSTEMTIME arg1)
100{
101 O32_GetSystemTime(arg1);
102}
103//******************************************************************************
104//******************************************************************************
105BOOL WIN32API SystemTimeToFileTime(const SYSTEMTIME * arg1,
106 LPFILETIME arg2)
107{
108 return O32_SystemTimeToFileTime(arg1, arg2);
109}
110//******************************************************************************
111//******************************************************************************
112BOOL WIN32API SystemTimeToTzSpecificLocalTime(LPTIME_ZONE_INFORMATION arg1,
113 LPSYSTEMTIME arg2,
114 LPSYSTEMTIME arg3)
115{
116 return O32_SystemTimeToTzSpecificLocalTime(arg1, arg2, arg3);
117}
118//******************************************************************************
119//******************************************************************************
120BOOL WIN32API SetTimeZoneInformation(const LPTIME_ZONE_INFORMATION arg1)
121{
122 return O32_SetTimeZoneInformation(arg1);
123}
124//******************************************************************************
125//******************************************************************************
126BOOL WIN32API SetSystemTime(const SYSTEMTIME * arg1)
127{
128 return O32_SetSystemTime(arg1);
129}
130/*****************************************************************************
131 * Name : DWORD GetSystemTimeAsFileTime
132 * Purpose : The GetSystemTimeAsFileTime function obtains the current system
133 * date and time. The information is in Coordinated Universal Time (UTC) format.
134 * Parameters: LLPFILETIME lLPSYSTEMTIMEAsFileTime
135 * Variables :
136 * Result :
137 * Remark :
138 * Status : UNTESTED
139 *
140 * Author : Patrick Haller [Mon, 1998/06/15 08:00]
141 *****************************************************************************/
142
143VOID WIN32API GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime)
144{
145 FILETIME ft; /* code sequence from WIN32.HLP */
146 SYSTEMTIME st;
147
148 dprintf(("KERNEL32: GetSystemTimeAsFileTime(%08xh)\n", lpSystemTimeAsFileTime));
149
150 GetSystemTime(&st);
151 SystemTimeToFileTime(&st, &ft);
152}
Note: See TracBrowser for help on using the repository browser.