We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92c65aa commit 8facb7cCopy full SHA for 8facb7c
2 files changed
src/common/windows/nt.h
@@ -634,7 +634,9 @@ static inline uint64_t ffKSystemTimeToUInt64(const volatile KSYSTEM_TIME* pTime)
634
{
635
#if _WIN64
636
637
- return *(uint64_t*) pTime;
+ // This is safe even if pTime is not 8-byte aligned
638
+ // See https://learn.microsoft.com/en-us/windows/win32/winprog64/fault-alignments
639
+ return *(const volatile uint64_t*) pTime;
640
641
#else
642
src/detection/uptime/uptime_windows.c
@@ -4,7 +4,7 @@
4
5
const char* ffDetectUptime(FFUptimeResult* result)
6
7
- // GetInterruptTime with Win7 support
+ // QueryInterruptTime with Win7 support
8
uint64_t interruptTime = ffKSystemTimeToUInt64(&SharedUserData->InterruptTime);
9
10
result->uptime = interruptTime / 10000; // Convert from 100-nanosecond intervals to milliseconds
0 commit comments