From 19b0b14b2e5e578297af63d305bb802a45006cca Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Thu, 21 May 2026 15:29:00 +0200 Subject: [PATCH] Assume GetTickCount64() always available --- cmdline/mingw.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/cmdline/mingw.c b/cmdline/mingw.c index ff4b6e18..944f4005 100644 --- a/cmdline/mingw.c +++ b/cmdline/mingw.c @@ -44,12 +44,6 @@ int exit_sync_needed = 2; */ static BOOLEAN(WINAPI * ptr_RtlGenRandom)(PVOID, ULONG); -/** - * Direct access to GetTickCount64(). - * This function is available only from Windows Vista. - */ -static ULONGLONG(WINAPI * ptr_GetTickCount64)(void); - /** * Description of the last error. * It's stored in the thread local storage. @@ -167,9 +161,6 @@ void os_init(int opt) /* get pointer to RtlGenRandom, note that it was reported missing in some cases */ ptr_RtlGenRandom = (void*)GetProcAddress(dll_advapi32, "SystemFunction036"); - /* get pointer to ptr_GetTickCount64 */ - ptr_GetTickCount64 = (void*)GetProcAddress(kernel32, "GetTickCount64"); - /* set the thread execution level to avoid sleep */ /* first try for Windows 7 */ if (SetThreadExecutionState(WIN32_ES_CONTINUOUS | WIN32_ES_SYSTEM_REQUIRED | WIN32_ES_AWAYMODE_REQUIRED) == 0) { @@ -2278,11 +2269,7 @@ uint64_t os_tick(void) uint64_t os_tick_ms(void) { - /* GetTickCount64() isn't supported in Windows XP */ - if (ptr_GetTickCount64 != 0) - return ptr_GetTickCount64(); - - return GetTickCount(); + return GetTickCount64(); } int randomize(void* void_ptr, size_t size)