curl-library
Win32 use of GetVersionEx()
Date: Wed, 15 Jan 2014 20:32:57 +0000
Dear Friends,
I have just pushed commit c7a76bb056f31e to fix the build warnings
associated with GetVersionEx() on Windows when compiling with Visual Studio
2013 [1].
In summary, and as of Windows 8.1, this function has been marked deprecated
and it's return value altered depending on an application's manifest file
and what operating system it is targeted at [2]. Applications that are not
manifested will only return v6.2 regardless of whether they are running on
Windows 8 (NT Kernel v6.2) or Windows 8.1 (NT Kernel v6.3) and as such it is
recommended to use the Version Helper API instead.
Given this, I have implemented the appropriate Version Helper functions in
both connect.c and curl_sspi.c where we currently use GetVersionEx(). The
functions I have used have been available since Windows 2000 (NT Kernel
v5.0) [3] rather than the newer aliases which Microsoft are also providing
[4].
I would appreciate it if some of my Win32 colleagues here, could take a look
at the patch [5] and provide any additional feedback if required.
You will note that I have kept the existing GetVersionEx() code and
protected it by "#if !defined(VerifyVersionInfo)", in case it is compiled
for an older version of the Windows NT kernel or even the old non NT
variants (Windows 3.1, 95, 98 and ME). Note that the #if !defined could be
modified to a specific version of Visual Studio or Platform SDK if need be -
your thoughts are appreciated.
Many thanks in advance.
Steve
[1] = http://curl.haxx.se/dev/log.cgi?id=20140115000200-10369#prob1
[2] =
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).as
px
[3] =
http://msdn.microsoft.com/en-us/library/windows/desktop/ms725492(v=vs.85).as
px
[4] =
http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972(v=vs.85).as
px
[5] =
https://github.com/bagder/curl/commit/c7a76bb056f31e1cf4766dd219d9ef5cb4e346
3d
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-01-15