Fixed getting OS version information.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2006-08-30 17:14:57 +00:00
parent 5c351979c3
commit 930a9efaf1
2 changed files with 18 additions and 18 deletions

View File

@@ -297,19 +297,18 @@ void wxBell()
wxString wxGetOsDescription() wxString wxGetOsDescription()
{ {
wxString strVer(_T("OS/2")); wxString strVer(_T("OS/2"));
ULONG ulSysInfo[QSV_MAX] = {0}; ULONG ulSysInfo = 0;
if (::DosQuerySysInfo( 1L, if (::DosQuerySysInfo( QSV_VERSION_MINOR,
QSV_MAX, QSV_VERSION_MINOR,
(PVOID)ulSysInfo, (PVOID)&ulSysInfo,
sizeof(ULONG) * QSV_MAX sizeof(ULONG)
) == 0L ) ) == 0L )
{ {
wxString ver; wxString ver;
ver.Printf( _T(" ver. %d.%d rev. %c"), ver.Printf( _T(" ver. %d.%d"),
int(ulSysInfo[QSV_VERSION_MAJOR] / 10), int(ulSysInfo / 10),
int(ulSysInfo[QSV_VERSION_MINOR]), int(ulSysInfo % 10)
char(ulSysInfo[QSV_VERSION_REVISION])
); );
strVer += ver; strVer += ver;
} }
@@ -334,21 +333,21 @@ void wxAppTraits::TerminateGui(unsigned long WXUNUSED(ulHab))
wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
{ {
ULONG ulSysInfo[QSV_MAX] = {0}; ULONG ulSysInfo = 0;
APIRET ulrc; APIRET ulrc;
ulrc = ::DosQuerySysInfo( 1L ulrc = ::DosQuerySysInfo( QSV_VERSION_MINOR,
,QSV_MAX QSV_VERSION_MINOR,
,(PVOID)ulSysInfo (PVOID)&ulSysInfo,
,sizeof(ULONG) * QSV_MAX sizeof(ULONG)
); );
if (ulrc == 0L) if (ulrc == 0L)
{ {
if ( verMaj ) if ( verMaj )
*verMaj = ulSysInfo[QSV_VERSION_MAJOR] / 10; *verMaj = ulSysInfo / 10;
if ( verMin ) if ( verMin )
*verMin = ulSysInfo[QSV_VERSION_MINOR]; *verMin = ulSysInfo % 10;
} }
return wxOS_OS2; return wxOS_OS2;

View File

@@ -437,9 +437,10 @@ void wxGUIAppTraits::TerminateGui(unsigned long ulHab)
::WinTerminate(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; return wxPORT_OS2;
} }