aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Raad <MarcelRaad@users.noreply.github.com>2015-07-21 17:23:07 -0400
committerJay Satiro <raysatiro@yahoo.com>2015-07-22 01:55:42 -0400
commit7a8e861a56ab0ef0a3a621f53b5f5ba999b27576 (patch)
tree5a2725255e4927b8cb053f4128d821c99b512e61
parentad324576230159dcf03fb9f5ac0b4d9c2b7b457a (diff)
schannel: Replace deprecated GetVersion with VerifyVersionInfo
-rw-r--r--lib/vtls/schannel.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c
index fe35a278b..2e03b7807 100644
--- a/lib/vtls/schannel.c
+++ b/lib/vtls/schannel.c
@@ -1120,12 +1120,21 @@ cleanup:
*/
if(len && !connssl->decdata_offset && connssl->recv_connection_closed &&
!connssl->recv_sspi_close_notify) {
- DWORD winver_full, winver_major, winver_minor;
- winver_full = GetVersion();
- winver_major = (DWORD)(LOBYTE(LOWORD(winver_full)));
- winver_minor = (DWORD)(HIBYTE(LOWORD(winver_full)));
+ BOOL isWin2k;
+ ULONGLONG cm;
+ OSVERSIONINFOEX osver = { sizeof osver, 5, };
- if(winver_major == 5 && winver_minor == 0 && sspi_status == SEC_E_OK)
+ cm = VerSetConditionMask(0, VER_MAJORVERSION, VER_EQUAL);
+ cm = VerSetConditionMask(cm, VER_MINORVERSION, VER_EQUAL);
+ cm = VerSetConditionMask(cm, VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL);
+ cm = VerSetConditionMask(cm, VER_SERVICEPACKMINOR, VER_GREATER_EQUAL);
+
+ isWin2k = VerifyVersionInfo(&osver,
+ (VER_MAJORVERSION | VER_MINORVERSION |
+ VER_SERVICEPACKMAJOR | VER_SERVICEPACKMINOR),
+ cm);
+
+ if(isWin2k && sspi_status == SEC_E_OK)
connssl->recv_sspi_close_notify = true;
else {
*err = CURLE_RECV_ERROR;