]> wimlib.net Git - wimlib/blobdiff - src/win32_replacements.c
Improved year 2038 safety
[wimlib] / src / win32_replacements.c
index 2a16500da67964bd8e87b3e293a46023a439263b..c2fb556d15553228412a535a606960118989e2ea 100644 (file)
@@ -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__ */