Rev 21 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
21 | f9daq | 1 | //------------------------------------------------------------------------------------------- |
2 | // os_info.c - request the OS type and version |
||
3 | // |
||
4 | // this source code is published under GPL (Open Source). You can use, redistrubute and |
||
5 | // modify it unless this header is not modified or deleted. No warranty is given that |
||
6 | // this software will work like expected. |
||
7 | // This product is not authorized for use as critical component in life support systems |
||
8 | // wihout the express written approval of ARW Elektronik Germany. |
||
9 | // |
||
10 | // Please announce changes and hints to ARW Elektronik |
||
11 | // |
||
12 | // |
||
13 | // what who when |
||
14 | // first steps AR 07.11.1999 |
||
15 | // |
||
16 | |||
17 | //------------------------------------------------------------------------------------------- |
||
18 | // INCLUDES |
||
19 | // |
||
20 | #include <windows.h> |
||
21 | |||
22 | //------------------------------------------------------------------------------------------- |
||
23 | // DEFINES |
||
24 | // |
||
25 | |||
26 | //------------------------------------------------------------------------------------------- |
||
27 | // TYPEDEFS |
||
28 | // |
||
29 | |||
30 | //------------------------------------------------------------------------------------------- |
||
31 | // LOCALS |
||
32 | // |
||
33 | |||
34 | //------------------------------------------------------------------------------------------- |
||
35 | // EXTERNALS |
||
36 | // |
||
37 | |||
38 | //------------------------------------------------------------------------------------------- |
||
39 | // GLOBALS |
||
40 | // |
||
41 | |||
42 | //------------------------------------------------------------------------------------------- |
||
43 | // FUNCTIONS |
||
44 | // |
||
45 | BOOLEAN IsWindowsNT(void) |
||
46 | { |
||
47 | OSVERSIONINFO osvi; |
||
48 | |||
49 | osvi.dwOSVersionInfoSize = sizeof(osvi); |
||
50 | if (!GetVersionEx(&osvi)) return FALSE; // can't get info |
||
51 | |||
52 | if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) |
||
53 | { |
||
54 | return TRUE; |
||
55 | } |
||
56 | else |
||
57 | return FALSE; |
||
58 | } |
||
59 | |||
60 | BOOLEAN IsWindows95(void) |
||
61 | { |
||
62 | OSVERSIONINFO osvi; |
||
63 | |||
64 | osvi.dwOSVersionInfoSize = sizeof(osvi); |
||
65 | if (!GetVersionEx(&osvi)) return FALSE; // can't get info |
||
66 | |||
67 | if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) |
||
68 | { |
||
69 | if ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion == 0)) |
||
70 | return TRUE; |
||
71 | } |
||
72 | |||
73 | return FALSE; |
||
74 | } |
||
75 | |||
76 | BOOLEAN IsWindows98(void) |
||
77 | { |
||
78 | OSVERSIONINFO osvi; |
||
79 | |||
80 | osvi.dwOSVersionInfoSize = sizeof(osvi); |
||
81 | if (!GetVersionEx(&osvi)) return FALSE; // can't get info |
||
82 | |||
83 | if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) |
||
84 | { |
||
85 | if ((osvi.dwMajorVersion > 4) || |
||
86 | ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0))) |
||
87 | return TRUE; |
||
88 | } |
||
89 | |||
90 | return FALSE; |
||
91 | } |
||
92 | |||
93 | /* |
||
94 | BOOLEAN IsWindowsBlaBla(void) |
||
95 | { |
||
96 | |||
97 | } |
||
98 | */ |
||
99 |