-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:
Gregor Schneider 2009-08-08 14:55:25 +00:00
parent e8aa4b4280
commit 7b6de8b1d4

View file

@ -10,19 +10,19 @@
#define LEAPDAY 59
static __inline
__time64_t
time_t
FileTimeToUnixTime(const FILETIME *FileTime, USHORT *millitm)
{
ULARGE_INTEGER ULargeInt;
__time64_t time;
time_t time;
ULargeInt.LowPart = FileTime->dwLowDateTime;
ULargeInt.HighPart = FileTime->dwHighDateTime;
ULargeInt.QuadPart -= DIFFTIME;
time = ULargeInt.QuadPart / 10000;
time = ULargeInt.QuadPart / 10000000;
if (millitm)
*millitm = (ULargeInt.QuadPart % 10000) / 10;
*millitm = (ULargeInt.QuadPart % 10000000) / 10000;
return time;
}