mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Packages (Windows): prefers NT APIs
This commit is contained in:
@@ -47,13 +47,14 @@ bool ffPackagesReadCache(FFstrbuf* cacheDir, FFstrbuf* cacheContent, const char*
|
||||
}
|
||||
|
||||
uint64_t mtime_current;
|
||||
if (!GetFileTime(handle, NULL, NULL, (FILETIME*) &mtime_current))
|
||||
FILE_BASIC_INFORMATION fileInfo;
|
||||
IO_STATUS_BLOCK iosb;
|
||||
if (!NT_SUCCESS(NtQueryInformationFile(handle, &iosb, &fileInfo, sizeof(fileInfo), FileBasicInformation)))
|
||||
return false;
|
||||
|
||||
mtime_current = (mtime_current - 116444736000000000ull) / 10000ull;
|
||||
if (fileInfo.LastWriteTime.QuadPart <= 116444736000000000ull) return false;
|
||||
|
||||
if (__builtin_expect(mtime_current == 0, false))
|
||||
return false;
|
||||
mtime_current = (fileInfo.LastWriteTime.QuadPart - 116444736000000000ull) / 10000ull;
|
||||
#endif
|
||||
|
||||
ffStrbufSet(cacheDir, &instance.state.platform.cacheDir);
|
||||
|
||||
Reference in New Issue
Block a user