Changeset 1627 for trunk/dll/systemf.c


Ignore:
Timestamp:
Aug 26, 2011, 11:48:06 PM (14 years ago)
Author:
Gregg Young
Message:

Add a low mem version of xDosAlloc* wrappers; move error checking into all the xDosAlloc* wrappers. Ticket 471

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r1554 r1627  
    3737  20 Nov 10 GKY Check that pTmpDir IsValid and recreate if not found; Fixes hangs caused
    3838                by temp file creation failures.
     39  26 Aug 11 GKY Add a low mem version of xDosAlloc* wrappers; move error checking into all the
     40                xDosAlloc* wrappers.
    3941
    4042***********************************************************************/
     
    768770    hwnd = HWND_DESKTOP;
    769771
    770   rc = DosAllocMem((PVOID)&pszPgm,
    771                    MaxComLineStrg,
    772                    PAG_COMMIT | PAG_READ | PAG_WRITE);
    773   if (rc) {
    774     Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY));
    775     return -1;
    776   }
    777 
     772  if (xDosAllocMemLow((PVOID)&pszPgm,
     773                       MaxComLineStrg,
     774                       PAG_COMMIT | PAG_READ | PAG_WRITE,
     775                       pszSrcFile,__LINE__))
     776    return -1; //already complained
    778777  *szSavedir = 0;
    779778
     
    816815      temp = *p;
    817816      if (temp) {
    818         rc = DosAllocMem((PVOID)&pszArgs,
    819                          MaxComLineStrg * 2,
    820                          PAG_COMMIT | PAG_READ | PAG_WRITE);
    821         if (rc)
    822           Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY));
     817        if (xDosAllocMemLow((PVOID)&pszArgs, MaxComLineStrg * 2,
     818                             PAG_COMMIT | PAG_READ | PAG_WRITE,
     819                            pszSrcFile, __LINE__)) {
     820          DosFreeMem(pszPgm);
     821          return -1;   //already complained
     822        }
    823823      }
    824824      else
     
    958958      if (~type & FULLSCREEN)
    959959        type |= WINDOWED;
    960       rc = DosAllocMem((PVOID) & pszArgs, MaxComLineStrg * 2,
    961                        PAG_COMMIT | PAG_READ | PAG_WRITE);
    962       if (rc) {
    963         Dos_Error(MB_CANCEL,rc,hwnd,pszSrcFile,__LINE__,GetPString(IDS_OUTOFMEMORY));
     960      if (xDosAllocMemLow((PVOID) &pszArgs, MaxComLineStrg * 2,
     961                           PAG_COMMIT | PAG_READ | PAG_WRITE,
     962                           pszSrcFile, __LINE__)) {
    964963        DosFreeMem(pszPgm);
    965         return -1;
     964        return -1;   //already complained
    966965      }
    967966      *pszArgs = 0;
Note: See TracChangeset for help on using the changeset viewer.