+ s_version.verMaj = info.dwMajorVersion;
+ s_version.verMin = info.dwMinorVersion;
+ }
+ else // GetVersionEx() failed
+ {
+ s_version.initialized = -1;
+ }
+ }
+
+ if ( s_version.initialized == 1 )
+ {
+ if ( verMaj )
+ *verMaj = s_version.verMaj;
+ if ( verMin )
+ *verMin = s_version.verMin;
+ }
+
+ // this works even if we were not initialized successfully as the initial
+ // values of this field is 0 which is wxOS_UNKNOWN and exactly what we need
+ return s_version.os;
+}
+
+wxWinVersion wxGetWinVersion()
+{
+ int verMaj,
+ verMin;
+ switch ( wxGetOsVersion(&verMaj, &verMin) )
+ {
+ case wxOS_WINDOWS_9X:
+ if ( verMaj == 4 )
+ {
+ switch ( verMin )
+ {
+ case 0:
+ return wxWinVersion_95;
+
+ case 10:
+ return wxWinVersion_98;
+
+ case 90:
+ return wxWinVersion_ME;
+ }
+ }
+ break;
+
+ case wxOS_WINDOWS_NT:
+ switch ( verMaj )
+ {
+ case 3:
+ return wxWinVersion_NT3;
+
+ case 4:
+ return wxWinVersion_NT4;
+
+ case 5:
+ switch ( verMin )
+ {
+ case 0:
+ return wxWinVersion_2000;
+
+ case 1:
+ return wxWinVersion_XP;
+
+ case 2:
+ return wxWinVersion_2003;
+ }