mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:02:59 +00:00
-Use correct conversion factors in FileTimeToUnixTime (increased by factor 1000)
-Prefer time_t to arch specific __time64_t -Assumption from r42506 was wrong: GetSystemTimeAsFileTime supplies good values svn path=/trunk/; revision=42517
This commit is contained in:
parent
e8aa4b4280
commit
7b6de8b1d4
1 changed files with 4 additions and 4 deletions
|
@ -10,19 +10,19 @@
|
||||||
#define LEAPDAY 59
|
#define LEAPDAY 59
|
||||||
|
|
||||||
static __inline
|
static __inline
|
||||||
__time64_t
|
time_t
|
||||||
FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
|
FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
|
||||||
{
|
{
|
||||||
ULARGE_INTEGER ULargeInt;
|
ULARGE_INTEGER ULargeInt;
|
||||||
__time64_t time;
|
time_t time;
|
||||||
|
|
||||||
ULargeInt.LowPart = FileTime->dwLowDateTime;
|
ULargeInt.LowPart = FileTime->dwLowDateTime;
|
||||||
ULargeInt.HighPart = FileTime->dwHighDateTime;
|
ULargeInt.HighPart = FileTime->dwHighDateTime;
|
||||||
ULargeInt.QuadPart -= DIFFTIME;
|
ULargeInt.QuadPart -= DIFFTIME;
|
||||||
|
|
||||||
time = ULargeInt.QuadPart / 10000;
|
time = ULargeInt.QuadPart / 10000000;
|
||||||
if (millitm)
|
if (millitm)
|
||||||
*millitm = (ULargeInt.QuadPart % 10000) / 10;
|
*millitm = (ULargeInt.QuadPart % 10000000) / 10000;
|
||||||
|
|
||||||
return time;
|
return time;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue