** This function is designed to convert a Win32 FILETIME structure into the ** number of seconds since the Unix Epoch (1970-01-01 00:00:00 UTC). */
| 4838 | ** number of seconds since the Unix Epoch (1970-01-01 00:00:00 UTC). |
| 4839 | */ |
| 4840 | static sqlite3_uint64 fileTimeToUnixTime( |
| 4841 | LPFILETIME pFileTime |
| 4842 | ){ |
| 4843 | SYSTEMTIME epochSystemTime; |
| 4844 | ULARGE_INTEGER epochIntervals; |
| 4845 | FILETIME epochFileTime; |
| 4846 | ULARGE_INTEGER fileIntervals; |
| 4847 | |
| 4848 | memset(&epochSystemTime, 0, sizeof(SYSTEMTIME)); |
| 4849 | epochSystemTime.wYear = 1970; |
| 4850 | epochSystemTime.wMonth = 1; |
| 4851 | epochSystemTime.wDay = 1; |
| 4852 | SystemTimeToFileTime(&epochSystemTime, &epochFileTime); |
| 4853 | epochIntervals.LowPart = epochFileTime.dwLowDateTime; |
| 4854 | epochIntervals.HighPart = epochFileTime.dwHighDateTime; |
| 4855 | |
| 4856 | fileIntervals.LowPart = pFileTime->dwLowDateTime; |
| 4857 | fileIntervals.HighPart = pFileTime->dwHighDateTime; |
| 4858 | |
| 4859 | return (fileIntervals.QuadPart - epochIntervals.QuadPart) / 10000000; |
| 4860 | } |
| 4861 | |
| 4862 | |
| 4863 | #if defined(FILEIO_WIN32_DLL) && (defined(_WIN32) || defined(WIN32)) |