mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-11 02:36:33 +08:00
Merge pull request #145 from CookiePLMonster/y2038-fix
Fix a Y2038 bug in timeToFILETIME
This commit is contained in:
commit
3e5b930d96
@ -2241,10 +2241,10 @@ GHC_INLINE time_t timeFromFILETIME(const FILETIME& ft)
|
|||||||
|
|
||||||
GHC_INLINE void timeToFILETIME(time_t t, FILETIME& ft)
|
GHC_INLINE void timeToFILETIME(time_t t, FILETIME& ft)
|
||||||
{
|
{
|
||||||
LONGLONG ll;
|
ULARGE_INTEGER ull;
|
||||||
ll = Int32x32To64(t, 10000000) + 116444736000000000;
|
ull.QuadPart = static_cast<ULONGLONG>((t * 10000000LL) + 116444736000000000LL);
|
||||||
ft.dwLowDateTime = static_cast<DWORD>(ll);
|
ft.dwLowDateTime = ull.LowPart;
|
||||||
ft.dwHighDateTime = static_cast<DWORD>(ll >> 32);
|
ft.dwHighDateTime = ull.HighPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename INFO>
|
template <typename INFO>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user