1 /*
2 * Windows stuff
3 *
4 * Author:
5 * Albin Sunnanbo
6 * Based on code by Lauris Kaplinski <lauris@kaplinski.com> (/src/extension/internal/win32.cpp)
7 *
8 * This code is in public domain
9 */
11 #ifdef HAVE_CONFIG_H
12 # include "config.h"
13 #endif
15 #include "gdl-win32.h"
17 /* Platform detection */
18 gboolean
19 is_os_vista()
20 {
21 static gboolean initialized = FALSE;
22 static gboolean is_vista = FALSE;
23 static OSVERSIONINFOA osver;
25 if ( !initialized )
26 {
27 BOOL result;
29 initialized = TRUE;
31 memset (&osver, 0, sizeof(OSVERSIONINFOA));
32 osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
33 result = GetVersionExA (&osver);
34 if (result)
35 {
36 if (osver.dwMajorVersion == WIN32_MAJORVERSION_VISTA)
37 is_vista = TRUE;
38 }
39 }
41 return is_vista;
42 }