cURL / Mailing Lists / curl-library / Single Mail


RE: Win32 use of GetVersionEx()

From: Steve Holme <>
Date: Wed, 15 Jan 2014 23:34:06 +0000

On Wed, 15 Jan 2014, wrote:

> Change VER_EQUAL to VER_GREATER_EQUAL. The existence of code
> like this is why Windows 7 is NT 6.1 and not 7.0 =^-^=

Well spotted - thank you.... and update pushed.

Believe it or not, a previous iteration of the fix used VER_GREATER_EQUAL and somehow the copying and pasting between connect.c and curl_sspi.c reverted that :(

> Put "static const" before DWORD majorVersion, or use #define, and
> perhaps capitalize it as VISTA_MAJOR_VERSION or something.

If it was outside the function, or a modern version of a #define at the top of the source file (for example) I would have no hesitation in using static const DWORD but is there any benefit over just a const DWORD? As such I haven't made either modification yet and await feedback ;-)

> Since VerifyVersionInfo is specific to NT (I'm believing what you say),
> you might as well force Unicode use here. Use OSVERSIONINFOEXW
> and VerifyVersionInfoW.

MSDN says the function was introduced in Windows 2000 and Windows 2000 server. However...

What about ASCII builds - won't using the wide function and struct break that as a supported build platform?

Cheers again


List admin:
Received on 2014-01-16