]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed getting OS version information.
authorStefan Neis <Stefan.Neis@t-online.de>
Wed, 30 Aug 2006 17:14:57 +0000 (17:14 +0000)
committerStefan Neis <Stefan.Neis@t-online.de>
Wed, 30 Aug 2006 17:14:57 +0000 (17:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/os2/utils.cpp
src/os2/utilsgui.cpp

index 66db9ff3f3966d53cf19b472169a024384f717df..33d262725b7d3c74273123a1480d3ffd73482c93 100644 (file)
@@ -297,19 +297,18 @@ void wxBell()
 wxString wxGetOsDescription()
 {
     wxString strVer(_T("OS/2"));
-    ULONG ulSysInfo[QSV_MAX] = {0};
+    ULONG ulSysInfo = 0;
 
-    if (::DosQuerySysInfo( 1L,
-                           QSV_MAX,
-                           (PVOID)ulSysInfo,
-                           sizeof(ULONG) * QSV_MAX
+    if (::DosQuerySysInfo( QSV_VERSION_MINOR,
+                           QSV_VERSION_MINOR,
+                           (PVOID)&ulSysInfo,
+                           sizeof(ULONG)
                          ) == 0L )
     {
         wxString ver;
-        ver.Printf( _T(" ver. %d.%d rev. %c"),
-                    int(ulSysInfo[QSV_VERSION_MAJOR] / 10),
-                    int(ulSysInfo[QSV_VERSION_MINOR]),
-                    char(ulSysInfo[QSV_VERSION_REVISION])
+        ver.Printf( _T(" ver. %d.%d"),
+                    int(ulSysInfo / 10),
+                    int(ulSysInfo % 10)
                   );
         strVer += ver;
     }
@@ -334,21 +333,21 @@ void wxAppTraits::TerminateGui(unsigned long WXUNUSED(ulHab))
 
 wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
 {
-    ULONG                 ulSysInfo[QSV_MAX] = {0};
+    ULONG                 ulSysInfo = 0;
     APIRET                ulrc;
 
-    ulrc = ::DosQuerySysInfo( 1L
-                             ,QSV_MAX
-                             ,(PVOID)ulSysInfo
-                             ,sizeof(ULONG) * QSV_MAX
+    ulrc = ::DosQuerySysInfo( QSV_VERSION_MINOR,
+                              QSV_VERSION_MINOR,
+                              (PVOID)&ulSysInfo,
+                              sizeof(ULONG)
                             );
 
     if (ulrc == 0L)
     {
         if ( verMaj )
-            *verMaj = ulSysInfo[QSV_VERSION_MAJOR] / 10;
+            *verMaj = ulSysInfo / 10;
         if ( verMin )
-            *verMin = ulSysInfo[QSV_VERSION_MINOR];
+            *verMin = ulSysInfo % 10;
     }
 
     return wxOS_OS2;
index 8fd49de6305261953936d4e7bf046ff10fc8c3aa..4bcf41183d3a27de0d45a01a7e3609934fe73502 100644 (file)
@@ -437,9 +437,10 @@ void wxGUIAppTraits::TerminateGui(unsigned long ulHab)
     ::WinTerminate(ulHab);
 }
 
-wxPortId wxGUIAppTraits::GetToolkitVersion(int *WXUNUSED(verMaj), int *WXUNUSED(verMin)) const
+wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
 {
-    // TODO: how to get version of PM ?
+    // How to get version of PM ? I guess, just reusing the OS version is OK.
+    (void) wxGetOsVersion(verMaj, verMin);
     return wxPORT_OS2;
 }