1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-13 21:15:08 -05:00

schannel: Replace deprecated GetVersion with VerifyVersionInfo

This commit is contained in:
Marcel Raad 2015-07-21 17:23:07 -04:00 committed by Jay Satiro
parent ad32457623
commit 7a8e861a56

View File

@ -1120,12 +1120,21 @@ cleanup:
*/ */
if(len && !connssl->decdata_offset && connssl->recv_connection_closed && if(len && !connssl->decdata_offset && connssl->recv_connection_closed &&
!connssl->recv_sspi_close_notify) { !connssl->recv_sspi_close_notify) {
DWORD winver_full, winver_major, winver_minor; BOOL isWin2k;
winver_full = GetVersion(); ULONGLONG cm;
winver_major = (DWORD)(LOBYTE(LOWORD(winver_full))); OSVERSIONINFOEX osver = { sizeof osver, 5, };
winver_minor = (DWORD)(HIBYTE(LOWORD(winver_full)));
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; connssl->recv_sspi_close_notify = true;
else { else {
*err = CURLE_RECV_ERROR; *err = CURLE_RECV_ERROR;