You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VerifyVersionInfo is used when available. I don't see the problem.
Well, let me reverse the question.
This usage causes a compiler warning in projects that use cURL.
Why would you keep using a deprecated function? Why would you use it when a replacement (or alternative) is available, when using the deprecated function is also unnecesary, since all old Windows versions support the replacement. Without a reason not to upgrade it. Pro's versus cons.
Deprecated functions, like the MS article for this one also says, also may not be reliable (or unavailable) in future and thus there is a risk they'll behave in unexpected ways. This future risk is unnecesary, since you can replace the usage.
It is deprecated. The following description matters to understand the pro's and cons (as I said before, you don't want to risk unexpected behavior in the future for no good reason right? Any arguing against upgrading is just a case of principle/project practise, so I will leave this issue now and you can do whatever you want):
[GetVersionEx may be altered or unavailable for releases after Windows 8.1. Instead, use the Version Helper functions]
With the release of Windows 8.1, the behavior of the GetVersionEx API has changed in the value it will return for the operating system version
I think it is you who misses the point: the code tries to use the right function already and we'd appreciate if you helped us figure out why it doesn't!
I've only just seen this - so my apologies for jumping in late.
The idea with #if block at line 218 is that GetVersionEx() should only be used on Non-Windows NT based versions of Windows (i.e. Windows 9x / ME and versions of NT earlier than Windows 2000, ie Windows NT 3.5x and 4.0) where a) it isn't deprecated and b) VerifyVersionInfo() isn't available. Anything newer should be using VerifyVersionInfo() as seen at line 345.
It would seem that for some reason this #if block isn't working as intended and I, like my colleagues, would like to try and understand why.
Where was the source code/libcurl API obtained from (Official tarball/zip, Github, NuGet, etc...)?
Are you using libcurl with the default config-win32.h?
Are you compiling libcurl yourself? If so how is it built (Visual Studio Projects, nmake, cmake, msys)?
Activity
jay commentedon Feb 28, 2020
VerifyVersionInfo is used when available. I don't see the problem.
/cc @captain-caveman2k
FuccDucc commentedon Feb 28, 2020
Well, let me reverse the question.
This usage causes a compiler warning in projects that use cURL.
Why would you keep using a deprecated function? Why would you use it when a replacement (or alternative) is available, when using the deprecated function is also unnecesary, since all old Windows versions support the replacement. Without a reason not to upgrade it. Pro's versus cons.
Deprecated functions, like the MS article for this one also says, also may not be reliable (or unavailable) in future and thus there is a risk they'll behave in unexpected ways. This future risk is unnecesary, since you can replace the usage.
jay commentedon Feb 28, 2020
What is the warning, how are you building curl and what are you using to build it?
Because not all build systems or targets may support the replacement function.
FuccDucc commentedon Feb 28, 2020
All modern versions of Visual Studio, for example, give a deprecation warning.
Yes they do, GetVersionEx is a Windows API (talking about targets) and the replacement, like I said, supports all old versions of Windows.
Since it appears no one understands anything, maybe it's better to go and read this article: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getversionexa
It is deprecated. The following description matters to understand the pro's and cons (as I said before, you don't want to risk unexpected behavior in the future for no good reason right? Any arguing against upgrading is just a case of principle/project practise, so I will leave this issue now and you can do whatever you want):
jay commentedon Feb 28, 2020
VerifyVersionInfo should be used when available. Please tell us:
What is the warning, how are you building curl and what are you using to build it?
bagder commentedon Feb 28, 2020
I think it is you who misses the point: the code tries to use the right function already and we'd appreciate if you helped us figure out why it doesn't!
captain-caveman2k commentedon Feb 29, 2020
I've only just seen this - so my apologies for jumping in late.
The idea with #if block at line 218 is that
GetVersionEx()should only be used on Non-Windows NT based versions of Windows (i.e. Windows 9x / ME and versions of NT earlier than Windows 2000, ie Windows NT 3.5x and 4.0) where a) it isn't deprecated and b)VerifyVersionInfo()isn't available. Anything newer should be usingVerifyVersionInfo()as seen at line 345.It would seem that for some reason this #if block isn't working as intended and I, like my colleagues, would like to try and understand why.
bagder commentedon Mar 5, 2020
No feedback, closing.
curl_setup: define _WIN32_WINNT_[OS] symbols