summaryrefslogtreecommitdiffstats
path: root/src/libgdl/gdl-win32.c
blob: f23036ed6544516be0faa16f056088efa6b7c08b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * Windows stuff
 *
 * Author:
 *   Albin Sunnanbo
 *   Based on code by Lauris Kaplinski <lauris@kaplinski.com> (/src/extension/internal/win32.cpp)
 *
 * This code is in public domain
 */
#ifdef WIN32

#include "gdl-win32.h"
#include <windows.h>

/* Platform detection */
gboolean
is_os_vista()
{
	static gboolean initialized = FALSE;
	static gboolean is_vista = FALSE;
	static OSVERSIONINFOA osver;

	if ( !initialized )
	{
		BOOL result;

		initialized = TRUE;

		memset (&osver, 0, sizeof(OSVERSIONINFOA));
		osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
		result = GetVersionExA (&osver);
		if (result)
		{
			if (osver.dwMajorVersion == WIN32_MAJORVERSION_VISTA)
				is_vista = TRUE;
		}
	}

	return is_vista;
}

#endif