X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwin32_replacements.c;h=c2fb556d15553228412a535a606960118989e2ea;hp=2a16500da67964bd8e87b3e293a46023a439263b;hb=db1b9ac63e5c0a1dffb51a1a162cf69a01a5cf24;hpb=088dff37aa334c218e1cac96cc847f5dd14f7124 diff --git a/src/win32_replacements.c b/src/win32_replacements.c index 2a16500d..c2fb556d 100644 --- a/src/win32_replacements.c +++ b/src/win32_replacements.c @@ -36,6 +36,7 @@ #include "wimlib/assert.h" #include "wimlib/glob.h" #include "wimlib/error.h" +#include "wimlib/timestamp.h" #include "wimlib/util.h" static int @@ -774,4 +775,15 @@ get_random_bytes(void *p, size_t n) } } +/* Retrieve the current time as a WIM timestamp. */ +u64 +now_as_wim_timestamp(void) +{ + FILETIME ft; + + GetSystemTimeAsFileTime(&ft); + + return ((u64)ft.dwHighDateTime << 32) | ft.dwLowDateTime; +} + #endif /* __WIN32__ */