Int32x32To64 macro internally truncates the arguments to int32,
while time_t is 64-bit on most/all modern platforms.
Therefore, usage of this macro creates a Year 2038 bug.
Signed-off-by: Adrian Zdanowicz <zdanio95@gmail.com>
void to_filetime(time_t t, LPFILETIME pft)
{
// Note that LONGLONG is a 64-bit value
- LONGLONG ll = Int32x32To64(t, 10000000) + 116444736000000000;
+ LONGLONG ll = (t * 10000000LL) + 116444736000000000LL;
pft->dwLowDateTime = (DWORD)ll;
pft->dwHighDateTime = ll >> 32;
}