What is the proper way to convert a FILETIME
structure into __int64
? Can you please tell me?
What is the proper way to convert a FILETIME
structure into __int64
? Can you please tell me?
I don't think you're suppose to: "Do not cast a pointer to a FILETIME
structure to either a ULARGE_INTEGER*
or __int64*
value because it can cause alignment faults on 64-bit Windows."
If you really wanted it would be something like:
__int64 to_int64(FILETIME ft)
{
return static_cast<__int64>(ft.dwHighDateTime) << 32 | ft.dwLowDateTime;
}
FILETIME ft = // ...
__int64 t = to_int64(ft);
But something like:
FILETIME ft = // ...
__int64 t = *reinterpet_cast<__int64*>(&ft);
Is bad.