Changeset 1038


Ignore:
Timestamp:
Jul 4, 2008, 10:33:59 PM (17 years ago)
Author:
Gregg Young
Message:

More fortify cleanup

Location:
trunk/dll
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1037 r1038  
    337337    psz = pai->pszFileName;
    338338    pai->pszFileName = NullStr;
     339    free(psz);
    339340# ifdef FORTIFY
    340     xfree(psz, pszSrcFile, __LINE__);
    341 # else
    342     free(psz);
    343 # endif
    344 # ifdef FORTIFY
    345   Fortify_LeaveScope(pszSrcFile, __LINE__);
     341  Fortify_LeaveScope();
    346342# endif
    347343  }
  • trunk/dll/autoview.c

    r1036 r1038  
    638638  hab2 = WinInitialize(0);
    639639  if (hab2) {
     640# ifdef FORTIFY
     641  Fortify_EnterScope();
     642# endif
    640643    hmq2 = WinCreateMsgQueue(hab2, 128);
    641644    if (hmq2) {
     
    659662      }
    660663      else {
    661 # ifdef FORTIFY
    662   Fortify_EnterScope();
    663 # endif
    664664        WinSetWindowULong(hwndAutoObj, QWL_USER, hwndParent);
    665665        priority_normal();
     
    674674    WinTerminate(hab2);
    675675# ifdef FORTIFY
    676     Fortify_LeaveScope(pszSrcFile, __LINE__);
     676    Fortify_LeaveScope();
    677677# endif
    678678  }
  • trunk/dll/comp.c

    r1036 r1038  
    201201    hab2 = WinInitialize(0);
    202202    if (hab2) {
    203       hmq2 = WinCreateMsgQueue(hab2, 0);
    204       if (hmq2) {
    205203# ifdef FORTIFY
    206204  Fortify_EnterScope();
    207205# endif
     206      hmq2 = WinCreateMsgQueue(hab2, 0);
     207      if (hmq2) {
    208208        WinCancelShutdown(hmq2, TRUE);
    209209        IncrThreadUsage();
     
    316316      WinTerminate(hab2);
    317317# ifdef FORTIFY
    318       Fortify_LeaveScope(pszSrcFile, __LINE__);
     318      Fortify_LeaveScope();
    319319# endif
    320320    }
     
    408408  hab = WinInitialize(0);
    409409  if (hab) {
    410     hmq = WinCreateMsgQueue(hab, 0);
    411     if (hmq) {
    412410# ifdef FORTIFY
    413411  Fortify_EnterScope();
    414412# endif
     413    hmq = WinCreateMsgQueue(hab, 0);
     414    if (hmq) {
    415415      WinCancelShutdown(hmq, TRUE);
    416416      IncrThreadUsage();
     
    694694    WinTerminate(hab);
    695695# ifdef FORTIFY
    696     Fortify_LeaveScope(pszSrcFile, __LINE__);
     696    Fortify_LeaveScope();
    697697# endif
    698698  }
     
    720720  hab = WinInitialize(0);
    721721  if (hab) {
    722     hmq = WinCreateMsgQueue(hab, 0);
    723     if (hmq) {
    724722# ifdef FORTIFY
    725723  Fortify_EnterScope();
    726724# endif
     725    hmq = WinCreateMsgQueue(hab, 0);
     726    if (hmq) {
    727727      WinCancelShutdown(hmq, TRUE);
    728728      IncrThreadUsage();
     
    759759    WinTerminate(hab);
    760760# ifdef FORTIFY
    761     Fortify_LeaveScope(pszSrcFile, __LINE__);
     761    Fortify_LeaveScope();
    762762# endif
    763763  }
     
    19551955
    19561956          if (x <= 0) {
    1957 # ifdef FORTIFY
    1958             xfree(filesl[l++], pszSrcFile, __LINE__);
    1959 # else
    19601957            free(filesl[l++]);          // Done with item on left
    1961 # endif
    19621958          }
    19631959          if (x >= 0) {
    1964 # ifdef FORTIFY
    1965             xfree(filesr[r++], pszSrcFile, __LINE__);
    1966 # else
    19671960            free(filesr[r++]);          // Done with item on right
    1968 #endif
    19691961          }
    19701962          // Ensure empty buffers point somewhere
     
    20172009          if (filesl) {
    20182010            for(; filesl[l]; l++) {
    2019 # ifdef FORTIFY
    2020               xfree(filesl[l], pszSrcFile, __LINE__);
    2021 # else
    20222011              free(filesl[l]);
    2023 # endif
    20242012            }
    20252013          }
     
    20332021          if (filesr) {
    20342022            for (; filesr[r]; r++) {
    2035 # ifdef FORTIFY
    2036               xfree(filesr[r], pszSrcFile, __LINE__);
    2037 # else
    20382023              free(filesr[r]);
    2039 # endif
    20402024            }
    20412025          }
     
    21172101
    21182102# ifdef FORTIFY
    2119   Fortify_LeaveScope(pszSrcFile, __LINE__);
     2103  Fortify_LeaveScope();
    21202104# endif
    21212105
  • trunk/dll/datamin.c

    r1009 r1038  
    4242#include "strutil.h"                    // GetPString
    4343#include "fm3dll.h"
     44#include "fortify.h"
    4445
    4546#pragma data_seg(DATA2)
     
    981982  USHORT id;
    982983
     984# ifdef FORTIFY
     985  Fortify_EnterScope();
     986# endif
    983987  if (G_hevDataMin == NULLHANDLE) {
    984988    // Create just once for any thread that might use it
     
    10741078  if (hab != NULLHANDLE)
    10751079    WinTerminate(hab);
    1076 
     1080# ifdef FORTIFY
     1081    Fortify_LeaveScope();
     1082# endif
    10771083}                                       // dataminThread
    10781084
  • trunk/dll/dircnrs.c

    r1037 r1038  
    24762476          LISTINFO *li;
    24772477          ULONG action = UM_ACTION;
    2478 # ifdef FORTIFY
    2479   Fortify_EnterScope();
    2480 # endif
    24812478          li = xmallocz(sizeof(LISTINFO), pszSrcFile, __LINE__);
    24822479          if (li) {
     
    25672564            else
    25682565              xfree(li, pszSrcFile, __LINE__);
    2569 # ifdef FORTIFY
    2570   Fortify_LeaveScope();
    2571 # endif
    25722566          }
    25732567        }
     
    33633357      FreeList(dcd->lastselection);
    33643358      xfree(dcd, pszSrcFile, __LINE__);
    3365 # ifdef FORTIFY
    3366       Fortify_LeaveScope(pszSrcFile, __LINE__);
    3367 # endif
    33683359      WinSetWindowPtr(hwnd, QWL_USER, NULL);
    33693360      DosPostEventSem(CompactSem);
  • trunk/dll/dirsize.c

    r1036 r1038  
    463463
    464464  xfree(dirsize, pszSrcFile, __LINE__);
    465 # ifdef FORTIFY
    466   //Fortify_LeaveScope(pszSrcFile, __LINE__);
    467 # endif
    468465  PostMsg(WinQueryWindow(hwndCnr, QW_PARENT),
    469466          UM_CONTAINER_FILLED, MPVOID, MPVOID);
     467# ifdef FORTIFY
     468  Fortify_LeaveScope();
     469# endif
    470470}
    471471
  • trunk/dll/filldir.c

    r1032 r1038  
    15851585    psz = pci->pszSubject;
    15861586    pci->pszSubject = NullStr;
    1587 # ifdef FORTIFY
    1588     xfree(psz, pszSrcFile, __LINE__);
    1589 # else
    15901587    free(psz);
    1591 # endif
    15921588  }
    15931589
     
    16001596    psz = pci->pszLongName;
    16011597    pci->pszLongName = NullStr;
    1602 # ifdef FORTIFY
    1603     xfree(psz, pszSrcFile, __LINE__);
    1604 # else
    16051598    free(psz);
    1606 # endif
    16071599  }
    16081600
     
    16101602    psz = pci->pszFileName;
    16111603    pci->pszFileName = NullStr;
    1612 # ifdef FORTIFY
    1613     xfree(psz, pszSrcFile, __LINE__);
    1614 # else
    16151604    free(psz);
    1616 # endif
    16171605  }
    16181606
     
    16201608    psz = pci->pszFmtFileSize;
    16211609    pci->pszFmtFileSize = NullStr;
    1622 # ifdef FORTIFY
    1623     xfree(psz, pszSrcFile, __LINE__);
    1624 # else
    16251610    free(psz);
    1626 # endif
    16271611  }
    16281612}
  • trunk/dll/grep.c

    r1032 r1038  
    276276  }
    277277
     278# ifdef FORTIFY
     279  Fortify_EnterScope();
     280# endif
    278281  grep = *(GREP *)arg;
    279282  *grep.stopflag = 0;                   // reset thread-killing flag
     
    288291      WinCancelShutdown(ghmq, TRUE);
    289292      IncrThreadUsage();
    290 # ifdef FORTIFY
    291   Fortify_EnterScope();
    292 # endif
    293293      // DosSleep(100); //05 Aug 07 GKY 128     // 07 Feb 08 SHL
    294294      // hwndStatus does not exist for applet
     
    412412    FreeDupes(&grep);
    413413  if (grep.numlines && grep.matched) {
    414 # ifdef FORTIFY
    415     xfree(grep.matched, pszSrcFile, __LINE__);
    416 # else
    417414    free(grep.matched);
    418 # endif
    419415  }
    420416  // 07 Feb 08 SHL fixme to free grep here when not static
     
    663659    if (grep->insertffb) {
    664660      for (x = 0; grep->insertffb[x]; x++) {
    665 # ifdef FORTIFY
    666         xfree(grep->insertffb[x], pszSrcFile, __LINE__);
    667 # else
    668661        free(grep->insertffb[x]);
    669 #endif
    670662      }
    671663      xfree(grep->insertffb, pszSrcFile, __LINE__);
     
    673665    if (grep->dir) {
    674666      for (x = 0; grep->dir[x]; x++) {
    675 # ifdef FORTIFY
    676         xfree(grep->dir[x], pszSrcFile, __LINE__);
    677 # else
    678667        free(grep->dir[x]);
    679 # endif
    680668      }
    681669      xfree(grep->dir, pszSrcFile, __LINE__);
     
    11631151    next = i->next;
    11641152    if (i->name) {
    1165 # ifdef FORTIFY
    1166       xfree(i->name, pszSrcFile, __LINE__);
    1167 # else
    11681153      free(i->name);
    1169 # endif
    1170     }
    1171 # ifdef FORTIFY
    1172     xfree(i, pszSrcFile, __LINE__);
    1173 # else
     1154    }
    11741155    free(i);
    1175 # endif
    11761156    i = next;
    11771157  }
  • trunk/dll/inis.c

    r1014 r1038  
    4747#include "strutil.h"                    // GetPString
    4848#include "fm3dll.h"
     49#include "fortify.h"
    4950
    5051#pragma data_seg(DATA2)
     
    126127
    127128  if (inirec) {
     129# ifdef FORTIFY
     130  Fortify_EnterScope();
     131# endif
    128132    hab2 = WinInitialize(0);
    129133    if (hab2) {
     
    293297              MPVOID);
    294298    xfree(inirec, pszSrcFile, __LINE__);
     299# ifdef FORTIFY
     300    Fortify_LeaveScope();
     301# endif
    295302  }
    296303}
     
    335342
    336343  if (prfp) {
     344# ifdef FORTIFY
     345  Fortify_EnterScope();
     346# endif
    337347    hab2 = WinInitialize(0);
    338348    if (hab2) {
     
    434444    xfree(prfp->pszSysName, pszSrcFile, __LINE__);
    435445    xfree(prfp, pszSrcFile, __LINE__);
     446# ifdef FORTIFY
     447    Fortify_LeaveScope();
     448# endif
    436449  }
    437450}
  • trunk/dll/killproc.c

    r1036 r1038  
    8484  MODINFO *pmi;
    8585
     86# ifdef FORTIFY
     87  Fortify_EnterScope();
     88# endif
    8689  thab = WinInitialize(0);
    8790  thmq = WinCreateMsgQueue(thab, 0);
     
    134137  DecrThreadUsage();
    135138  WinTerminate(thab);
     139# ifdef FORTIFY
     140    Fortify_LeaveScope();
     141# endif
    136142}
    137143
     
    147153  QSLREC *pmi;
    148154
     155# ifdef FORTIFY
     156  Fortify_EnterScope();
     157# endif
    149158  thab = WinInitialize(0);
    150159  thmq = WinCreateMsgQueue(thab, 0);
     
    197206  DecrThreadUsage();
    198207  WinTerminate(thab);
     208# ifdef FORTIFY
     209    Fortify_LeaveScope();
     210# endif
    199211}
    200212
     
    215227  DosError(FERR_DISABLEHARDERR);
    216228
     229# ifdef FORTIFY
     230  Fortify_EnterScope();
     231# endif
    217232  thab = WinInitialize(0);
    218233  thmq = WinCreateMsgQueue(thab, 0);
    219234  WinCancelShutdown(thmq, TRUE);
    220235  IncrThreadUsage();
    221 # ifdef FORTIFY
    222   Fortify_EnterScope();
    223 # endif
    224236
    225237  WinSendDlgItemMsg(hwnd, KILL_LISTBOX, LM_DELETEALL, MPVOID, MPVOID);
     
    289301    }
    290302    fclose(fp);
    291 # ifdef FORTIFY
    292     Fortify_LeaveScope(pszSrcFile, __LINE__);
    293 # endif
    294303  }
    295304Abort:
     
    299308  DecrThreadUsage();
    300309  WinTerminate(thab);
     310# ifdef FORTIFY
     311    Fortify_LeaveScope();
     312# endif
    301313}
    302314
  • trunk/dll/makelist.c

    r1036 r1038  
    9191      _heap_check();
    9292#endif
    93 # ifdef FORTIFY
    94       xfree(list[x], pszSrcFile, __LINE__);
    95 # else
    9693      free(list[x]);
    97 # endif
    9894    }
    9995#ifdef __DEBUG_ALLOC__
     
    270266    for (x = 0; list[x]; x++) {
    271267      if (item == list[x]) {
    272 # ifdef FORTIFY
    273         xfree(list[x], pszSrcFile, __LINE__);
    274 # else
    275268        free(list[x]);
    276 # endif
    277269        list[x] = NULL;
    278270        for (y = x;; y++) {
  • trunk/dll/newview.c

    r1036 r1038  
    649649    ad->markedlines = NULL;
    650650    DosPostEventSem(CompactSem);
    651 # ifdef FORTIFY
    652     Fortify_LeaveScope(pszSrcFile, __LINE__);
    653 # endif
    654651  }
    655652}
     
    10721069      WinDestroyMsgQueue(hmq2);
    10731070# ifdef FORTIFY
    1074       Fortify_LeaveScope(pszSrcFile, __LINE__);
     1071      Fortify_LeaveScope();
    10751072# endif
    10761073    }
     
    13561353    WinTerminate(hab2);
    13571354# ifdef FORTIFY
    1358     Fortify_LeaveScope(pszSrcFile, __LINE__);
     1355    Fortify_LeaveScope();
    13591356# endif
    13601357  }
     
    14811478    WinTerminate(hab2);
    14821479# ifdef FORTIFY
    1483     Fortify_LeaveScope(pszSrcFile, __LINE__);
     1480    Fortify_LeaveScope();
    14841481# endif
    14851482  }
     
    24042401              case 0:
    24052402                xfree(urld, pszSrcFile, __LINE__);
    2406 # ifdef FORTIFY
    2407   Fortify_LeaveScope();
    2408 # endif
    24092403                goto NoAdd;
    24102404              case 1:
     
    24332427                }
    24342428                xfree(urld, pszSrcFile, __LINE__);
    2435 # ifdef FORTIFY
    2436   Fortify_LeaveScope();
    2437 # endif
    24382429                goto NoAdd;
    24392430              case 2:
     
    24622453                }
    24632454                xfree(urld, pszSrcFile, __LINE__);
    2464 # ifdef FORTIFY
    2465   Fortify_LeaveScope();
    2466 # endif
    24672455                goto NoAdd;
    24682456              case 3:
     
    24752463                }
    24762464                xfree(urld, pszSrcFile, __LINE__);
    2477 # ifdef FORTIFY
    2478   Fortify_LeaveScope();
    2479 # endif
    24802465                goto NoAdd;
    24812466              default:
     
    24832468              }
    24842469              xfree(urld, pszSrcFile, __LINE__);
    2485 # ifdef FORTIFY
    2486   Fortify_LeaveScope();
    2487 # endif
    24882470            }
    24892471          }
     
    25642546            }
    25652547            xfree(s, pszSrcFile, __LINE__);
    2566 # ifdef FORTIFY
    2567   Fortify_LeaveScope();
    2568 # endif
    25692548          }
    25702549        }
     
    39803959        WinSetWindowPtr(hwnd, QWL_USER, NULL);
    39813960        xfree(ad, pszSrcFile, __LINE__);
    3982 # ifdef FORTIFY
    3983       Fortify_LeaveScope(pszSrcFile, __LINE__);
    3984 # endif
    39853961      }
    39863962      if (hwndRestore && hwndRestore != HWND_DESKTOP) {
  • trunk/dll/notify.c

    r1009 r1038  
    3535#include "strutil.h"                    // GetPString
    3636#include "fm3dll.h"
     37#include "fortify.h"
    3738
    3839#pragma data_seg(DATA1)
     
    432433{
    433434  HAB hab = WinInitialize(0);
    434 
     435# ifdef FORTIFY
     436  Fortify_EnterScope();
     437# endif
    435438  if (hab) {
    436439    HMQ hmq = WinCreateMsgQueue(hab, 0);
     
    444447    WinTerminate(hab);
    445448  }
     449# ifdef FORTIFY
     450    Fortify_LeaveScope();
     451# endif
    446452}
    447453
     
    544550}
    545551
    546 #pragma alloc_text(NOTIFY,Notify,NotifyWndProc,StartNotify)
    547 #pragma alloc_text(NOTIFY,NotifyThread,NotifyError)
     552#pragma alloc_text(NOTIFY,Notify,NotifyWndProc,StartNotify,NotifyError)
    548553#pragma alloc_text(NOTIFY2,AddNote,NoteThread,NoteWndProc)
    549554#pragma alloc_text(NOTIFY3,StartNotes,EndNote,HideNote,ShowNote)
  • trunk/dll/objcnr.c

    r1017 r1038  
    215215  DIRSIZE *dirsize = (DIRSIZE *)args;
    216216
     217# ifdef FORTIFY
     218  Fortify_EnterScope();
     219# endif
    217220  if (!dirsize) {
    218221    Runtime_Error(pszSrcFile, __LINE__, "no data");
  • trunk/dll/objwin.c

    r1036 r1038  
    9191    }
    9292# ifdef FORTIFY
    93     Fortify_LeaveScope(pszSrcFile, __LINE__);
     93    Fortify_LeaveScope();
    9494# endif
    9595    WinTerminate(hab2);
  • trunk/dll/printer.c

    r1029 r1038  
    113113    }
    114114  }
     115# ifdef FORTIFY
     116  Fortify_EnterScope();
     117# endif
    115118  priority_normal();
    116119  hab2 = WinInitialize(0);
     
    121124      IncrThreadUsage();
    122125      if (li && li->list && li->list[0]) {
    123 # ifdef FORTIFY
    124   Fortify_EnterScope();
    125 # endif
    126126        AddNote(GetPString(IDS_PRINTINGLISTTEXT));
    127127        for (x = 0; li->list[x]; x++) {
     
    324324  if (li)
    325325    FreeListInfo(li);
     326# ifdef FORTIFY
     327    Fortify_LeaveScope();
     328# endif
    326329}
    327330
  • trunk/dll/seeall.c

    r1037 r1038  
    11321132    hab2 = WinInitialize(0);
    11331133    if (hab2) {
     1134# ifdef FORTIFY
     1135  Fortify_EnterScope();
     1136# endif
    11341137      hmq2 = WinCreateMsgQueue(hab2, 256);
    11351138      if (hmq2) {
     
    11631166      }
    11641167      else
    1165         WinTerminate(hab2);
     1168        WinTerminate(hab2);
     1169# ifdef FORTIFY
     1170    Fortify_LeaveScope();
     1171# endif
    11661172    }
    11671173  }
     
    16391645  ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
    16401646
     1647# ifdef FORTIFY
     1648  Fortify_EnterScope();
     1649# endif
    16411650  if (!DosRequestMutexSem(ad->hmtxScan, SEM_INDEFINITE_WAIT)) {
    16421651    priority_normal();
     
    17501759    WinTerminate(hab2);
    17511760  }
     1761# ifdef FORTIFY
     1762    Fortify_LeaveScope();
     1763# endif
    17521764}
    17531765
     
    20432055  ALLDATA *ad = WinQueryWindowPtr(hwnd, QWL_USER);
    20442056
     2057# ifdef FORTIFY
     2058  Fortify_EnterScope();
     2059# endif
    20452060  if (!DosRequestMutexSem(ad->hmtxScan, SEM_INDEFINITE_WAIT)) {
    20462061    priority_normal();
     
    21022117    WinTerminate(hab2);
    21032118  }
     2119# ifdef FORTIFY
     2120    Fortify_LeaveScope();
     2121# endif
    21042122}
    21052123
  • trunk/dll/undel.c

    r1009 r1038  
    3232#include "strutil.h"                    // GetPString
    3333#include "fm3dll.h"
     34#include "fortify.h"
    3435
    3536#pragma data_seg(DATA2)
     
    6263  DosError(FERR_DISABLEHARDERR);
    6364
     65# ifdef FORTIFY
     66  Fortify_EnterScope();
     67# endif
    6468  thab = WinInitialize(0);
    6569  thmq = WinCreateMsgQueue(thab, 0);
     
    158162    WinTerminate(thab);
    159163  }
     164# ifdef FORTIFY
     165    Fortify_LeaveScope();
     166# endif
    160167}
    161168
Note: See TracChangeset for help on using the changeset viewer.