mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +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
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue