[REQUEST] implementation of FileTimeToLocalFileTime, SystemTimeToFileTime, CompareFileTime, FileTimeToSystemTime and LocalFileTimeToFileTime
I need those winapi functions for backporting XTimeUtils from Kodi. Source code of that file can be found here.
FileTimeToSystemTime and SystemTimeToFileTime are trivially implemented with their kernel counterparts RtlTimeToTimeFields and RtlTimeFieldsToTime. CompareFileTime is also trivially implemented with something like this:
LONG CompareFileTime(const FILETIME *lpFileTime1, const FILETIME *lpFileTime2)
{
uint64_t ft1, ft2;
ft1 = ((uint64_t)lpFileTime1->dwHighDateTime << 32 | lpFileTime1->dwLowDateTime);
ft2 = ((uint64_t)lpFileTime2->dwHighDateTime << 32 | lpFileTime2->dwLowDateTime);
if (ft1 < ft2) {
return -1L;
} else if (ft1 > ft2) {
return 1L;
}
/* we are only here if ft1 == ft2 */
return 0L;
}
LocalFileTimeToFileTime and FileTimeToLocalFileTime may also be trivial to implement with the already implemented GetTimeZoneInformation and the Bias member of the TIME_ZONE_INFORMATION structure.
I implemented some of these back in february here, haven't gotten around to finishing and upstreaming yet though
Thanks guys I'm using trimbor implementation and remaining two are ChatGPT implemented. I still wasn't able to test them, hopefully this month I will start on implementing CApplication where those functions are used.