- OSVERSIONINFO info;
- memset(&info, 0, sizeof(OSVERSIONINFO));
- info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
- if (GetVersionEx(&info))
- {
- if (majorVsn) *majorVsn = info.dwMajorVersion;
- if (minorVsn) *minorVsn = info.dwMinorVersion;
- switch (info.dwPlatformId)
- {
- case VER_PLATFORM_WIN32s:
- return wxWIN32S;
- break;
- case VER_PLATFORM_WIN32_WINDOWS:
- return wxWIN95;
- break;
- case VER_PLATFORM_WIN32_NT:
- return wxWINDOWS_NT;
- break;
- }
- }
- return wxWINDOWS; // error if we get here, return generic value
-#else
- // Win16 code...
- int retValue = 0;
-# ifdef __WINDOWS_386__
- retValue = wxWIN386;
-# else
-# if !defined(__WATCOMC__) && !defined(GNUWIN32) && wxUSE_PENWINDOWS
- extern HANDLE g_hPenWin;
- retValue = g_hPenWin ? wxPENWINDOWS : wxWINDOWS ;
-# endif
-# endif
- // @@@@ To be completed. I don't have the manual here...
- if (majorVsn) *majorVsn = 3 ;
- if (minorVsn) *minorVsn = 1 ;
- return retValue ;
+ OSVERSIONINFO info;
+ wxZeroMemory(info);
+
+ info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ if ( ::GetVersionEx(&info) )
+ {
+ if (majorVsn)
+ *majorVsn = info.dwMajorVersion;
+ if (minorVsn)
+ *minorVsn = info.dwMinorVersion;
+
+ switch ( info.dwPlatformId )
+ {
+ case VER_PLATFORM_WIN32s:
+ return wxWIN32S;
+
+ case VER_PLATFORM_WIN32_WINDOWS:
+ return wxWIN95;
+
+ case VER_PLATFORM_WIN32_NT:
+ return wxWINDOWS_NT;
+ }
+ }
+
+ return wxWINDOWS; // error if we get here, return generic value
+#else // Win16
+ int retValue = wxWINDOWS;
+ #ifdef __WINDOWS_386__
+ retValue = wxWIN386;
+ #else
+ #if !defined(__WATCOMC__) && !defined(GNUWIN32) && wxUSE_PENWINDOWS
+ extern HANDLE g_hPenWin;
+ retValue = g_hPenWin ? wxPENWINDOWS : wxWINDOWS;
+ #endif
+ #endif
+
+ if (majorVsn)
+ *majorVsn = 3;
+ if (minorVsn)
+ *minorVsn = 1;
+
+ return retValue;