X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/476607a777ec5328804da0564364b70128725647..8a28f119c8864aa53bc1c33bf57aa9976f358f3b:/src/os2/utils.cpp diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index abea758038..2bae71d97b 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -160,7 +160,7 @@ bool wxShell( SData.PgmName = zShell; sInputs = "/C " + rCommand; - SData.PgmInputs = NULL; //(BYTE*)sInputs.c_str(); + SData.PgmInputs = (BYTE*)sInputs.c_str(); SData.TermQ = 0; SData.Environment = 0; SData.InheritOpt = SSF_INHERTOPT_SHELL; @@ -177,7 +177,7 @@ bool wxShell( SData.ObjectBuffLen = (ULONG)sizeof(achObjBuf); rc = ::DosStartSession(&SData, &ulSessID, &vPid); - if (rc == 0) + if (rc == 0 || rc == 457) // NO_ERROR or SMG_START_IN_BACKGROUND { PTIB ptib; PPIB ppib; @@ -195,10 +195,9 @@ bool wxShell( } // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) -long wxGetFreeMemory( - void* pMemptr -) +long wxGetFreeMemory() { + void* pMemptr; ULONG lSize; ULONG lMemFlags; APIRET rc; @@ -309,14 +308,17 @@ int wxGetOsVersion( ) { ULONG ulSysInfo[QSV_MAX] = {0}; - - if (::DosQuerySysInfo( 1L - ,QSV_MAX - ,(PVOID)ulSysInfo - ,sizeof(ULONG) * QSV_MAX - )) + APIRET ulrc; + + ulrc = ::DosQuerySysInfo( 1L + ,QSV_MAX + ,(PVOID)ulSysInfo + ,sizeof(ULONG) * QSV_MAX + ); + if (ulrc == 0L) { *pMajorVsn = ulSysInfo[QSV_VERSION_MAJOR]; + *pMajorVsn = *pMajorVsn/10; *pMinorVsn = ulSysInfo[QSV_VERSION_MINOR]; return wxWINDOWS_OS2; } @@ -427,10 +429,10 @@ bool wxGetResource( ,(PSZ)WXSTRINGCAST rSection ,(PSZ)WXSTRINGCAST rEntry ,(PSZ)zDefunkt - ,(void*)wxBuffer + ,(void*)*ppValue ,1000 ); - if (n == 0L || wxStrcmp(wxBuffer, zDefunkt) == 0) + if (n != 0L || wxStrcmp(*ppValue, zDefunkt) == 0) return FALSE; } else @@ -442,15 +444,12 @@ bool wxGetResource( ,(PSZ)WXSTRINGCAST rSection ,(PSZ)WXSTRINGCAST rEntry ,(PSZ)zDefunkt - ,(void*)wxBuffer + ,(void*)*ppValue ,1000 ); - if (n == 0L || wxStrcmp(wxBuffer, zDefunkt) == 0) + if (n != 0L || wxStrcmp(*ppValue, zDefunkt) == 0) return FALSE; } - if (*ppValue) - delete[] (*ppValue); - *ppValue = copystring(wxBuffer); return TRUE; }