| 75 | } |
| 76 | |
| 77 | TimePoint ToTimePoint(FILETIME ft) { |
| 78 | // Hundreds of nanoseconds between January 1, 1601 (UTC) and the Unix epoch. |
| 79 | static constexpr int64_t kFileTimeEpoch = 11644473600LL * 10000000; |
| 80 | |
| 81 | int64_t hundreds = (static_cast<int64_t>(ft.dwHighDateTime) << 32) + ft.dwLowDateTime - |
| 82 | kFileTimeEpoch; // hundreds of ns since Unix epoch |
| 83 | std::chrono::nanoseconds ns_count(100 * hundreds); |
| 84 | return TimePoint(std::chrono::duration_cast<TimePoint::duration>(ns_count)); |
| 85 | } |
| 86 | |
| 87 | FileInfo FileInformationToFileInfo(const BY_HANDLE_FILE_INFORMATION& information) { |
| 88 | FileInfo info; |
no outgoing calls
no test coverage detected