Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6ee09f5d
Commit
6ee09f5d
authored
Mar 11, 2004
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 11, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement _ftime with Win32 APIs.
parent
30dc4291
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
4 deletions
+20
-4
time.c
dlls/msvcrt/time.c
+20
-4
No files found.
dlls/msvcrt/time.c
View file @
6ee09f5d
...
...
@@ -32,6 +32,7 @@
#include "msvcrt/sys/timeb.h"
#include "msvcrt/time.h"
#include "winbase.h"
#include "wine/debug.h"
...
...
@@ -130,15 +131,30 @@ MSVCRT_time_t MSVCRT_time(MSVCRT_time_t* buf)
return
buf
?
*
buf
=
curtime
:
curtime
;
}
#define SECSPERDAY 86400
/* 1601 to 1970 is 369 years plus 89 leap days */
#define SECS_1601_TO_1970 ((369 * 365 + 89) * (ULONGLONG)SECSPERDAY)
#define TICKSPERSEC 10000000
#define TICKSPERMSEC 10000
/*********************************************************************
* _ftime (MSVCRT.@)
*/
void
_ftime
(
struct
_timeb
*
buf
)
{
buf
->
time
=
MSVCRT_time
(
NULL
);
buf
->
millitm
=
0
;
/* FIXME */
buf
->
timezone
=
0
;
buf
->
dstflag
=
0
;
TIME_ZONE_INFORMATION
tzinfo
;
FILETIME
ft
;
ULONGLONG
time
;
DWORD
tzid
=
GetTimeZoneInformation
(
&
tzinfo
);
GetSystemTimeAsFileTime
(
&
ft
);
time
=
((
ULONGLONG
)
ft
.
dwHighDateTime
<<
32
)
|
ft
.
dwLowDateTime
;
buf
->
time
=
time
/
TICKSPERSEC
-
SECS_1601_TO_1970
;
buf
->
millitm
=
(
time
%
TICKSPERSEC
)
/
TICKSPERMSEC
;
buf
->
timezone
=
tzinfo
.
Bias
;
buf
->
dstflag
=
(
tzid
==
TIME_ZONE_ID_DAYLIGHT
?
1
:
0
);
}
/*********************************************************************
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment