Changeset 1846 for trunk/dll/arccnrs.c


Ignore:
Timestamp:
Aug 12, 2015, 10:31:54 PM (10 years ago)
Author:
John Small
Message:

Ticket #524: Ensure no "highmem-unsafe" functions are called directly
Calls to unsafe Dos... functions have been changed to call the wrapped xDos... functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1826 r1846  
    106106  06 Apr 14 GKY Removed all BZ/GZ checks
    107107  28 Jun 14 GKY Fix errors identified with CPPCheck; Fix retry to create workdir code
     108  12 Aug 15 JBS Ticket #524: Ensure no "highmem-unsafe" functions are called directly
     109                Calls to unsafe Dos... functions have been changed to call the wrapped xDos... functions
    108110
    109111***********************************************************************/
     
    591593  CHAR lonename[CCHMAXPATH + 2],
    592594       *nsize, *osize, *fdate, *fname, *p, *pp, *arctemp;
    593   // Change the DosQueryAppType call below to xDosQueryAppType if "s" is no longer in low memory
    594595  CHAR s[CCHMAXPATH * 2];
    595   CHAR TestStr[CCHMAXPATH * 2]; 
     596  CHAR TestStr[CCHMAXPATH * 2];
    596597  BOOL gotstart;
    597598  BOOL gotend;
     
    606607  APIRET rc;
    607608  CHAR *mode;
    608   ULONG cnter = 0; 
     609  ULONG cnter = 0;
    609610
    610611  if (!arcname || !arcinfo)
     
    659660      *p = 0;
    660661    DosError(FERR_DISABLEHARDERR);
    661     if (!DosQueryAppType(s, &apptype) &&
     662    if (!xDosQueryAppType(s, &apptype) &&
    662663        (apptype & FAPPTYP_DOS ||
    663664         apptype & FAPPTYP_WINDOWSREAL ||
     
    701702          }
    702703          else {
    703             rc = 0; 
     704            rc = 0;
    704705            //DbgMsg(pszSrcFile, __LINE__, "Number of tries %i", cnter);
    705706            rc = SearchPathForFile(PCSZ_PATH, s, NULL);
     
    711712                      info->list,
    712713                      BldQuotedFileName(s, arcname));
    713               if (cnter == 1) { 
     714              if (cnter == 1) {
    714715                if (info->test)
    715716                  strcpy(TestStr, info->test);
     
    944945          if (tinfo) {
    945946            DosError(FERR_DISABLEHARDERR);
    946             DosForceDelete(arctemp);
     947            xDosForceDelete(arctemp);
    947948            info = tinfo;
    948949            goto ReTry;
     
    952953          DosBeep(750, 50);             // wake up user
    953954
    954         if (cnter > 0) { 
     955        if (cnter > 0) {
    955956          CHAR Temp[CCHMAXPATH + 2];
    956957
     
    965966          strcpy(ad.listname, arctemp);
    966967          strcpy(ad.arcname, arcname);
    967           if (!notest) { 
     968          if (!notest) {
    968969            strcpy(Temp, info->test);
    969970            info->test = xstrdup(TestStr, pszSrcFile, __LINE__);
     
    980981            info->test = xstrdup(Temp, pszSrcFile, __LINE__);
    981982        }
    982         else 
     983        else
    983984          saymsg(MB_OK, HWND_DESKTOP, GetPString(IDS_ARCMISSINGEXE),
    984985                 GetPString(IDS_ARCMISSINGEXEVERBOSE));
     
    9991000
    10001001    DosError(FERR_DISABLEHARDERR);
    1001     DosForceDelete(arctemp);
     1002    xDosForceDelete(arctemp);
    10021003    xfree(arctemp, pszSrcFile, __LINE__);
    10031004  }
     
    10081009  return numarcfiles;
    10091010} // FillArcCnr
     1011
    10101012MRESULT EXPENTRY ArcTextProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    10111013{
Note: See TracChangeset for help on using the changeset viewer.