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.
QueryUnbiasedInterruptTime
1 parent 6da8181 commit b812f3cCopy full SHA for b812f3c
src/detection/uptime/uptime_windows.c
@@ -1,11 +1,13 @@
1
#include "uptime.h"
2
#include "common/time.h"
3
4
-#include <sysinfoapi.h>
+#include <realtimeapiset.h>
5
6
const char* ffDetectUptime(FFUptimeResult* result)
7
{
8
- result->uptime = GetTickCount64();
+ // According to MSDN, this function only fails if it's called with NULL
9
+ QueryUnbiasedInterruptTime(&result->uptime);
10
+ result->uptime /= 10000; // Convert from 100-nanosecond intervals to milliseconds
11
result->bootTime = ffTimeGetNow() - result->uptime;
12
return NULL;
13
}
0 commit comments