summaryrefslogtreecommitdiff
path: root/lib/easy.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-02-14 17:08:29 +0100
committerDaniel Stenberg <daniel@haxx.se>2019-02-15 23:23:14 +0100
commitca597ad34a4bf2f4f1c2352186d3e589040a0b54 (patch)
treee74c2093ac05a48ce63fe069c4633225e141bc4f /lib/easy.c
parent208c77713aaab87d77a3b11f83308b7db61aaabc (diff)
downloadcurl-ca597ad34a4bf2f4f1c2352186d3e589040a0b54.tar.gz
Curl_now: figure out windows version in win32_init
... and avoid use of static variables that aren't thread safe. Fixes regression from e9ababd4f5a (present in the 7.64.0 release) Reported-by: Paul Groke Fixes #3572 Closes #3573
Diffstat (limited to 'lib/easy.c')
-rw-r--r--lib/easy.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/easy.c b/lib/easy.c
index 6fcad3dec..d2d4166d5 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -75,6 +75,7 @@
#include "ssh.h"
#include "setopt.h"
#include "http_digest.h"
+#include "system_win32.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@@ -95,6 +96,11 @@ static void win32_cleanup(void)
#endif
}
+#ifdef WIN32
+LARGE_INTEGER Curl_freq;
+bool Curl_isVistaOrGreater;
+#endif
+
/* win32_init() performs win32 socket initialization to properly setup the
stack to allow networking */
static CURLcode win32_init(void)
@@ -144,6 +150,16 @@ static CURLcode win32_init(void)
}
#endif
+#ifdef WIN32
+ if(Curl_verify_windows_version(6, 0, PLATFORM_WINNT,
+ VERSION_GREATER_THAN_EQUAL)) {
+ Curl_isVistaOrGreater = TRUE;
+ QueryPerformanceFrequency(&Curl_freq);
+ }
+ else
+ Curl_isVistaOrGreater = FALSE;
+#endif
+
return CURLE_OK;
}