Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schannel: compile fix for Windows SDK 8+ #353

Closed
wants to merge 2 commits into from

Conversation

MarcelRaad
Copy link
Member

GetVersion was deprecated in Windows SDK 8.0, which is treated as an error by default. This has been cleaned up in connect.c and curl_sspi.c, but 3e7ec1e re-introduced a call to GetVersion.
As in the other places where GetVersion(Ex) was used, this can be changed to use VerifyVersionInfo, which is not deprecated. I don't think a fallback version for Windows < 2000 is necessary here as SChannel was introduced in Windows 2000.

GetVersion was deprecated in Windows SDK 8.0, which is treated as an error by default. This has been cleaned up in connect.c and curl_sspi.c, but curl@3e7ec1e re-introduced a call to GetVersion.
As in the other places where GetVersion(Ex) was used, this can be changed to use VerifyVersionInfo, which is not deprecated. I don't think a fallback version for Windows < 2000 is necessary here as SChannel was introduced in Windows 2000.
@gvanem
Copy link
Contributor

gvanem commented Jul 21, 2015

GetVersion was deprecated in Windows SDK 8.0, which is treated as an error by default.

You mean the warning from cl is treated as an error? That can be avoided by a -DBUILD_WINDOWS in the CFLAGS.

@MarcelRaad
Copy link
Member Author

Yes, that's what I mean. Thanks, I didn't know about that workaround!

@jay
Copy link
Member

jay commented Jul 21, 2015

VerifyVersionInfo dwTypeMask value VER_MAJORVERSION says:

If you are testing the major version, you must also test the minor version and the service pack major and minor versions.

That's an odd requirement. I don't recall having encountered this API function but I imagine as Windows 10 makes inroads I'll have to deal with it. I've modified your commit to conform to the API specification. As I said I'm unfamiliar with this spec so if I've misinterpreted it please let me know.
https://github.com/bagder/curl/compare/master...jay:pr_353_modified_draft1?expand=1

@MarcelRaad
Copy link
Member Author

Looks good, thanks a lot @jay!

Strange, I've used that function quite a few times in production code since Visual Studio 2012 came out and I was relatively sure I read the documentation, but I can't remember that requirement. The other two calls to VerifyVersionInfo in libcurl also only check for the major version, but your version is definitely correct according to the documentation.

jay added a commit that referenced this pull request Jul 22, 2015
- Fix the VerifyVersionInfo calls, which we use to test for the OS major
version, to also test for the minor version as well as the service pack
major and minor versions.

MSDN: "If you are testing the major version, you must also test the
minor version and the service pack major and minor versions."

https://msdn.microsoft.com/en-us/library/windows/desktop/ms725492.aspx

Bug: #353 (comment)
Reported-by: Marcel Raad <MarcelRaad@users.noreply.github.com>
@jay
Copy link
Member

jay commented Jul 22, 2015

Thanks, landed in 7a8e861 and 40c921f.

@jay jay closed this Jul 22, 2015
jgsogo pushed a commit to jgsogo/curl that referenced this pull request Oct 19, 2015
- Fix the VerifyVersionInfo calls, which we use to test for the OS major
version, to also test for the minor version as well as the service pack
major and minor versions.

MSDN: "If you are testing the major version, you must also test the
minor version and the service pack major and minor versions."

https://msdn.microsoft.com/en-us/library/windows/desktop/ms725492.aspx

Bug: curl#353 (comment)
Reported-by: Marcel Raad <MarcelRaad@users.noreply.github.com>
@MarcelRaad MarcelRaad deleted the patch-1 branch October 31, 2016 12:27
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants