aboutsummaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2016-06-04 20:58:39 +0100
committerSteve Holme <steve_holme@hotmail.com>2016-06-04 21:24:09 +0100
commit332e8d6164bfb33dfae19704ef8c3e851a71b2d3 (patch)
tree46443825db983bb389262eedceb79349678d4d57 /lib/connect.c
parentdde5e430e21605e94b24262deef4800e04fb6ba5 (diff)
win32: Used centralised verify windows version function
Closes #845
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c36
1 files changed, 4 insertions, 32 deletions
diff --git a/lib/connect.c b/lib/connect.c
index ac2f26833..dcfb4b469 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -72,6 +72,7 @@
#include "warnless.h"
#include "conncache.h"
#include "multihandle.h"
+#include "system_win32.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@@ -945,44 +946,15 @@ void Curl_sndbufset(curl_socket_t sockfd)
int val = CURL_MAX_WRITE_SIZE + 32;
int curval = 0;
int curlen = sizeof(curval);
- DWORD majorVersion = 6;
static int detectOsState = DETECT_OS_NONE;
- if(detectOsState == DETECT_OS_NONE) {
-#if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_WIN2K) || \
- (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
- OSVERSIONINFO osver;
-
- memset(&osver, 0, sizeof(osver));
- osver.dwOSVersionInfoSize = sizeof(osver);
-
- detectOsState = DETECT_OS_PREVISTA;
- if(GetVersionEx(&osver)) {
- if(osver.dwMajorVersion >= majorVersion)
- detectOsState = DETECT_OS_VISTA_OR_LATER;
- }
-#else
- ULONGLONG cm;
- OSVERSIONINFOEX osver;
-
- memset(&osver, 0, sizeof(osver));
- osver.dwOSVersionInfoSize = sizeof(osver);
- osver.dwMajorVersion = majorVersion;
-
- cm = VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_MINORVERSION, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
- cm = VerSetConditionMask(cm, VER_SERVICEPACKMINOR, VER_GREATER_EQUAL);
-
- if(VerifyVersionInfo(&osver, (VER_MAJORVERSION | VER_MINORVERSION |
- VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR),
- cm))
+ if(detectOsState == DETECT_OS_NONE)
+ if(Curl_verify_windows_version(6, 0, PLATFORM_WINNT,
+ VERSION_GREATER_THAN_EQUAL))
detectOsState = DETECT_OS_VISTA_OR_LATER;
else
detectOsState = DETECT_OS_PREVISTA;
-#endif
- }
if(detectOsState == DETECT_OS_VISTA_OR_LATER)
return;