gwin32: Add g_win32_check_windows_version() API
authorChun-wei Fan <fanchunwei@src.gnome.org>
Mon, 26 Jan 2015 03:11:48 +0000 (11:11 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 27 Jan 2015 04:17:14 +0000 (12:17 +0800)
commitbcbf80c35580142216f4b1ed2f71717efb2de99d
treea848baa0f26518466901f9db09a06b8ad067edb5
parentbe2d9b4f5801380ac02e8d158686538d10e3dee5
gwin32: Add g_win32_check_windows_version() API

This adds a public API where one can use to see whether the running version
of Windows where the code is run is at least the specified version, service
pack level, and the type (non-server, server, any) of the running Windows
OS.

This API is done as:
-GetVersion()/GetVersionEx() changed in the way they work since Windows 8.1
 [1][2], so a newer mechanism to check the version of the running Windows
 operating system is needed.  MSDN also states that GetVersion() might be
 further changed or removed after Windows 8.1.  This provides a wrapper for
 VerfyVersionInfo() as well in GLib for most cases, which was recommended
 in place of g_win32_get_windows_version() for more detailed Windows
 version checking.
-Provides an OS-level functionality check, for those that we don't need to
 venture into GetProcAddress(), and also to determine system API behavior
 changes due to differences in OS versions.

Also added a note for the g_win32_get_windows_version() API that since the
behavior of GetVersion() which it uses, is changed since Windows 8.1, users
of the API should be aware.

[1]:
http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms724451%28v=vs.85%29.aspx
[2]:
http://msdn.microsoft.com/zh-tw/library/windows/desktop/ms724451%28v=vs.85%29.aspx

https://bugzilla.gnome.org/show_bug.cgi?id=741895
glib/gwin32.c
glib/gwin32.h