cURL / Mailing Lists / curl-library / Single Mail


Win32 use of GetVersionEx()

From: Steve Holme <>
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

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.


[1] =
[2] =
[3] =
[4] =
[5] =
List admin:
Received on 2014-01-15