Changeset 1029 for trunk/dll


Ignore:
Timestamp:
Jun 23, 2008, 3:30:16 AM (17 years ago)
Author:
Gregg Young
Message:

Fixed early memory free; Added free_... functions to make fortify checking easier; Added fortify scopes; Delete now moves to trash can on systems with the xworkplace trash can installed.

Location:
trunk/dll
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/assoc.c

    r1012 r1029  
    979979}
    980980
    981 #pragma alloc_text(ASSOC2,free_commands,load_associations,save_associations,display_associations)
     981#pragma alloc_text(ASSOC2,free_associations,load_associations,save_associations,display_associations)
    982982#pragma alloc_text(ASSOC2,ExecAssociation,AssocTextProc)
    983983#pragma alloc_text(ASSOC,add_association,kill_association,AssocDlgProc,EditAssociations)
  • trunk/dll/autoview.c

    r1009 r1029  
    4444#include "strutil.h"                    // GetPString
    4545#include "fm3dll.h"
     46
     47#include "fortify.h"
    4648
    4749#pragma data_seg(DATA1)
     
    194196      break;
    195197    }
    196     pfealist->list[0].cbValue = (ULONG) (eaval -
     198    pfealist->list[0].cbValue = /*(ULONG)*/ (eaval -
    197199                                         (pfealist->list[0].szName +
    198200                                          pfealist->list[0].cbName + 1));
     
    416418                }
    417419                xfree(ibuff, pszSrcFile, __LINE__);
     420# ifdef FORTIFY
     421  Fortify_LeaveScope();
     422# endif
    418423              }
    419424              DosClose(handle);
     
    509514                  WinSetWindowText(hwndAutoview, pszBuf);
    510515                xfree(pszBuf, pszSrcFile, __LINE__);
     516# ifdef FORTIFY
     517  Fortify_LeaveScope();
     518# endif
    511519              }
    512520            }
     
    543551                                    (PVOID) & eaop, (ULONG) sizeof(EAOP2));
    544552              xfree(pgealist, pszSrcFile, __LINE__);
     553# ifdef FORTIFY
     554  Fortify_LeaveScope();
     555# endif
    545556              if (!rc) {
    546557                pfea = &eaop.fpFEA2List->list[0];
     
    612623      }
    613624      xfree((CHAR *)mp1, pszSrcFile, __LINE__);
     625# ifdef FORTIFY
     626  Fortify_LeaveScope();
     627# endif
    614628    }
    615629    return 0;
     
    788802              PostMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
    789803              xfree(ea, pszSrcFile, __LINE__);
     804# ifdef FORTIFY
     805  Fortify_LeaveScope();
     806# endif
    790807            }
    791808          }
     
    838855          if (!PostMsg(hwndAutoObj, UM_LOADFILE, MPFROMP(cf), MPVOID))
    839856            xfree(cf, pszSrcFile, __LINE__);
     857# ifdef FORTIFY
     858  Fortify_LeaveScope();
     859# endif
    840860        }
    841861      }
     
    894914    if (!PostMsg(hwndAutoObj, msg, mp1, mp2)) {
    895915      xfree((CHAR *)mp1, pszSrcFile, __LINE__);
     916# ifdef FORTIFY
     917  Fortify_LeaveScope();
     918# endif
    896919    }
    897920    return 0;
  • trunk/dll/avl.c

    r1009 r1029  
    3131  25 Aug 07 SHL load_archivers: add missing close on error path
    3232  29 Feb 08 GKY Use xfree where appropriate
     33  22 Jun 08 GKY Added free_archivers fot fortify checking
    3334
    3435***********************************************************************/
     
    5354static PSZ pszSrcFile = __FILE__;
    5455
    55 static void free_arc_type(ARC_TYPE * pat);
    5656static void fill_listbox(HWND hwnd, BOOL fShowAll, SHORT sOldSelect);
    5757
     
    217217}
    218218
     219VOID free_archivers(VOID)
     220{
     221  ARC_TYPE *pat, *next;
     222
     223  pat = arcsighead;
     224  while (pat) {
     225    next = pat->next;
     226    xfree(pat->id, pszSrcFile, __LINE__);
     227    xfree(pat->ext, pszSrcFile, __LINE__);
     228    xfree(pat->list, pszSrcFile, __LINE__);
     229    xfree(pat->extract, pszSrcFile, __LINE__);
     230    xfree(pat->create, pszSrcFile, __LINE__);
     231    xfree(pat->move, pszSrcFile, __LINE__);
     232    xfree(pat->delete, pszSrcFile, __LINE__);
     233    xfree(pat->signature, pszSrcFile, __LINE__);
     234    xfree(pat->startlist, pszSrcFile, __LINE__);
     235    xfree(pat->endlist, pszSrcFile, __LINE__);
     236    xfree(pat->exwdirs, pszSrcFile, __LINE__);
     237    xfree(pat->test, pszSrcFile, __LINE__);
     238    xfree(pat->createrecurse, pszSrcFile, __LINE__);
     239    xfree(pat->createwdirs, pszSrcFile, __LINE__);
     240    xfree(pat->movewdirs, pszSrcFile, __LINE__);
     241    xfree(pat, pszSrcFile, __LINE__);
     242    pat = next;
     243  }
     244  arcsighead = NULL;
     245}
     246
    219247//=== free_arc_type() free allocated ARC_TYPE ===
    220248
    221 static void free_arc_type(ARC_TYPE * pat)
     249VOID free_arc_type(ARC_TYPE * pat)
    222250{
    223251  if (pat) {
     
    12581286
    12591287#pragma alloc_text(MISC9,quick_find_type,find_type)
    1260 #pragma alloc_text(AVL,load_archivers, get_line_strip_comments, get_line_strip_white)
     1288#pragma alloc_text(AVL,load_archivers, get_line_strip_comments, get_line_strip_white, free_archivers)
    12611289#pragma alloc_text(FMARCHIVE,SBoxDlgProc,SDlgListboxSubclassProc)
    12621290#pragma alloc_text(ARCCNRS,ArcDateTime)
  • trunk/dll/avl.h

    r907 r1029  
    8686INT load_archivers(VOID);
    8787BOOL ArcDateTime(CHAR * dt, INT type, CDATE * cdate, CTIME * ctime);
     88VOID free_arc_type(ARC_TYPE * pat);
     89VOID free_archivers(VOID);
    8890
    8991// 05 Jan 08 SHL fixme for avl.c globals to be here
  • trunk/dll/collect.c

    r1018 r1029  
    785785    }
    786786    xfree(mp1, pszSrcFile, __LINE__);
     787# ifdef FORTIFY
     788  Fortify_LeaveScope();
     789# endif
    787790    return 0;
    788791
     
    14641467    if (mp1) {
    14651468      if (!dcd) {
    1466         xfree(mp1, pszSrcFile, __LINE__);
     1469        xfree(mp1, pszSrcFile, __LINE__);
     1470# ifdef FORTIFY
     1471  Fortify_LeaveScope();
     1472# endif
    14671473        Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
    14681474      }
     
    14711477          Runtime_Error(pszSrcFile, __LINE__, "PostMsg");
    14721478          xfree(mp1, pszSrcFile, __LINE__);
     1479# ifdef FORTIFY
     1480  Fortify_LeaveScope();
     1481# endif
    14731482        }
    14741483      }
     
    15961605            if (p) {
    15971606              if (!PostMsg(hwnd, UM_COLLECTFROMFILE, MPFROMP(p), MPVOID))
    1598                 xfree(p, pszSrcFile, __LINE__);
     1607                xfree(p, pszSrcFile, __LINE__);
     1608# ifdef FORTIFY
     1609  Fortify_LeaveScope();
     1610# endif
    15991611            }
    16001612          }
     
    26752687                           (INT) mp1, (CHAR *)mp2, dcd->hwndFrame);
    26762688      xfree((CHAR *)mp2, pszSrcFile, __LINE__);
     2689# ifdef FORTIFY
     2690  Fortify_LeaveScope();
     2691# endif
    26772692      return MRFROMLONG(ret);
    26782693    }
  • trunk/dll/command.h

    r1015 r1029  
    1010
    1111  01 Mar 08 GKY Move from fm3dll.h to here
     12  22 Jun 08 GKY Moved free_commands here for fortify checking
    1213
    1314***********************************************************************/
     
    2425CHAR *command_title(INT cx);
    2526VOID load_commands(VOID);
     27VOID free_commands(VOID);
    2628
    2729typedef struct LINKCMDS
  • trunk/dll/comp.c

    r1017 r1029  
    25742574                }
    25752575                if (fUpdateHideButton) {
    2576                   USHORT state = WinQueryButtonCheckstate(hwnd,COMP_HIDENOTSELECTED);
     2576                  ULONG state = WinQueryButtonCheckstate(hwnd,COMP_HIDENOTSELECTED);
    25772577                  if (state == 1) {
    25782578                    WinCheckButton(hwnd, COMP_HIDENOTSELECTED, 2);
     
    27232723    cmp = INSTDATA(hwnd);
    27242724    if (cmp) {
    2725       USHORT wasHidden = WinQueryButtonCheckstate(hwnd,
     2725      ULONG wasHidden = WinQueryButtonCheckstate(hwnd,
    27262726                                                  COMP_HIDENOTSELECTED);
    27272727
  • trunk/dll/dircnrs.c

    r1028 r1029  
    3939  11 May 08 SHL Add stale dcd sanity checks
    4040  21 Jun 08 GKY Fix columns to honor preferences on new container open.
     41  22 Jun 08 GKY Included free_... functions for fortify checking
    4142
    4243***********************************************************************/
     
    6465#include "command.h"                    // RunCommand
    6566#include "fm3dll.h"
     67#include "avl.h"                        // free_archivers
    6668#include "fortify.h"
    6769
     
    33153317                                (INT)mp1, (CHAR *)mp2, dcd->hwndFrame);
    33163318      xfree((CHAR *)mp2, pszSrcFile, __LINE__);
     3319# ifdef FORTIFY
     3320  Fortify_LeaveScope();
     3321# endif
    33173322      return MRFROMLONG(ret);
    33183323    }
     
    33563361      xfree(dcd, pszSrcFile, __LINE__);
    33573362# ifdef FORTIFY
     3363  free_commands();
     3364  free_associations();
     3365  free_udir();
     3366  free_ldir();
     3367  free_archivers();
    33583368  Fortify_LeaveScope();
    33593369# endif
  • trunk/dll/eas.c

    r1009 r1029  
    11471147      break;
    11481148    }
    1149     pfealist->list[0].cbValue = (ULONG) (eaval -
     1149    pfealist->list[0].cbValue = /*(ULONG)*/ (eaval -
    11501150                                         (pfealist->list[0].szName +
    11511151                                          pfealist->list[0].cbName + 1));
  • trunk/dll/fm3dll.h

    r1009 r1029  
    7979  14 Feb 08 SHL Refactor CfgDlgProc to notebook.h
    8080  29 Feb 08 GKY Refactor global command line variables to notebook.h
     81  22 Jun 08 GKY Changed some variable types to fix compiler warnings
    8182
    8283***********************************************************************/
     
    384385{
    385386  USHORT size;
    386   USHORT flags;
    387   USHORT cmd;
     387  ULONG flags;
     388  ULONG cmd;
    388389  USHORT dummy;
    389390  CHAR *prompt;
     
    801802BOOL remove_udir(PSZ path);
    802803BOOL remove_ldir(PSZ path);
     804VOID free_udir(VOID);
     805VOID free_ldir(VOID);
    803806VOID fill_setups_list(VOID);
    804807VOID load_setups(VOID);
     
    829832VOID load_associations(VOID);
    830833VOID save_associations(VOID);
     834VOID free_associations(VOID);
    831835
    832836/*draglist.c */
  • trunk/dll/grep.c

    r1017 r1029  
    288288      WinCancelShutdown(ghmq, TRUE);
    289289      IncrThreadUsage();
     290# ifdef FORTIFY
     291  Fortify_EnterScope();
     292# endif
    290293      // DosSleep(100); //05 Aug 07 GKY 128     // 07 Feb 08 SHL
    291294      // hwndStatus does not exist for applet
     
    411414    free(grep.matched);
    412415  // 07 Feb 08 SHL fixme to free grep here when not static
     416# ifdef FORTIFY
     417  Fortify_LeaveScope();
     418# endif
    413419  DosPostEventSem(CompactSem);
    414420}
     
    610616              DosFindClose(findHandle);
    611617              xfree(pffbArray, pszSrcFile, __LINE__);
     618# ifdef FORTIFY
     619  Fortify_LeaveScope();
     620# endif
    612621              return 1;
    613622            }
     
    636645
    637646  xfree(pffbArray, pszSrcFile, __LINE__);
     647# ifdef FORTIFY
     648  Fortify_LeaveScope();
     649# endif
    638650  return 0;
    639651}
     
    658670    grep->toinsert = 0L;
    659671    grep->insertedbytes = 0L;
     672# ifdef FORTIFY
     673  Fortify_LeaveScope();
     674# endif
    660675  }
    661676}
     
    765780        if (!grep->dir) {
    766781          xfree(grep->insertffb, pszSrcFile, __LINE__);
     782# ifdef FORTIFY
     783  Fortify_LeaveScope();
     784# endif
    767785          return FALSE;
    768786        }
     
    777795      grep->dir[grep->toinsert] = xstrdup(szDirectory, pszSrcFile, __LINE__);
    778796      if (!grep->dir) {
    779         xfree(grep->insertffb[grep->toinsert], pszSrcFile, __LINE__);
     797        xfree(grep->insertffb[grep->toinsert], pszSrcFile, __LINE__);
     798# ifdef FORTIFY
     799  Fortify_LeaveScope();
     800# endif
    780801        return FALSE;
    781802      }
     
    9951016      }
    9961017      xfree(input, pszSrcFile, __LINE__);
     1018# ifdef FORTIFY
     1019  Fortify_LeaveScope();
     1020# endif
    9971021      // DosSleep(1);                   // 07 Feb 08 SHL
    9981022    }
     
    11091133    }
    11101134    xfree(buffer, pszSrcFile, __LINE__);
     1135# ifdef FORTIFY
     1136  Fortify_LeaveScope();
     1137# endif
    11111138  }
    11121139  return CRC;
     
    11291156  xfree(grep->dupesizes, pszSrcFile, __LINE__);
    11301157  grep->dupesizes = grep->dupenames = NULL;
     1158# ifdef FORTIFY
     1159  Fortify_LeaveScope();
     1160# endif
    11311161}
    11321162
     
    14781508      xfree(grep->dupesizes, pszSrcFile, __LINE__);
    14791509      grep->dupesizes = NULL;
     1510# ifdef FORTIFY
     1511  Fortify_LeaveScope();
     1512# endif
    14801513
    14811514      InitITimer(pitdSleep, 0);         // Reset rate estimator
     
    15921625    if (!info->name) {
    15931626      xfree(info, pszSrcFile, __LINE__);
     1627# ifdef FORTIFY
     1628  Fortify_LeaveScope();
     1629# endif
    15941630      return FALSE;
    15951631    }
  • trunk/dll/grep2.c

    r1009 r1029  
    4444#include "strutil.h"                    // GetPString
    4545#include "fm3dll.h"
     46#include "fortify.h"
    4647
    4748#pragma data_seg(DATA1)
     
    825826          WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, GREP_MASK));
    826827          xfree(p, pszSrcFile, __LINE__);
     828# ifdef FORTIFY
     829  Fortify_LeaveScope();
     830# endif
    827831          break;
    828832        }
     
    924928                        GetPString(IDS_COULDNTSTARTTHREADTEXT));
    925929          xfree(p, pszSrcFile, __LINE__);
     930# ifdef FORTIFY
     931  Fortify_LeaveScope();
     932# endif
    926933          WinDismissDlg(hwnd, 0);
    927934          break;
     
    929936        DosSleep(100); //05 Aug 07 GKY 128
    930937        xfree(p, pszSrcFile, __LINE__);
     938# ifdef FORTIFY
     939  Fortify_LeaveScope();
     940# endif
    931941      }
    932942      if (changed) {
  • trunk/dll/mainwnd.c

    r1027 r1029  
    5656  29 Feb 08 GKY Use xfree where appropriate
    5757  19 Jun 08 JBS Ticket 227: Allow temporary saving/deleting of the shutdown state of directory containers
     58  22 Jun 08 GKY Use free_... functions for fortify checking
    5859
    5960***********************************************************************/
     
    7677#include "comp.h"
    7778#include "datamin.h"
    78 #include "pathutil.h"                    // BldQuotedFileName
     79#include "pathutil.h"                   // BldQuotedFileName
    7980#include "errutil.h"                    // Dos_Error...
    8081#include "strutil.h"                    // GetPString
    81 #include "notebook.h"                        // CfgDlgProc CfgMenuInit
     82#include "notebook.h"                   // CfgDlgProc CfgMenuInit
    8283#include "command.h"                    // LINKCMDS
    8384#include "fm3dll.h"
     85#include "avl.h"                        // free_archivers
    8486
    8587#include "fortify.h"
     
    63556357      WinSendMsg((HWND) 0, WM_QUIT, MPVOID, MPVOID);
    63566358# ifdef FORTIFY
     6359  free_commands();
     6360  free_associations();
     6361  free_udir();
     6362  free_ldir();
     6363  free_archivers();
    63576364  Fortify_LeaveScope();
    63586365# endif
  • trunk/dll/makelist.c

    r1018 r1029  
    116116      // Use plain realloc for speed
    117117      // 06 Aug 07 SHL fixme to know why + 6
     118# ifdef FORTIFY
     119  Fortify_EnterScope();
     120# endif
    118121      pflArray = realloc(*list, (*pnumalloced + 6) * sizeof(FILELIST *));
    119122      if (!pflArray) {
     
    167170    if (((*pnumfiles) + 3) > *pnumalloced) {
    168171      // Use plain realloc for speed
     172# ifdef FORTIFY
     173  Fortify_EnterScope();
     174# endif
    169175      ppsz = realloc(*list, (*pnumalloced + 6) * sizeof(CHAR *));
    170176      if (!ppsz) {
     
    216222  if (numalloc > numfiles + 1) {
    217223    // Use plain realloc for speed
     224
     225# ifdef FORTIFY
     226  Fortify_EnterScope();
     227# endif
    218228    test = realloc(list, sizeof(CHAR *) * (numfiles + 1));
    219229    if (!test)
     
    267277          list = NULL;
    268278        }
     279# ifdef FORTIFY
     280  Fortify_LeaveScope();
     281# endif
    269282        break;
    270283      }
  • trunk/dll/makelist.h

    r907 r1029  
    1010
    1111  05 Jan 08 SHL Move makelist.c definitions here
     12  22 Jun 08 GKY Change variable type to fix compiler warning
    1213
    1314***********************************************************************/
     
    5960  HWND hwnd;
    6061  HWND hwndS;
    61   USHORT type;
     62  ULONG type;
    6263  USHORT id;
    6364  INT flags;
  • trunk/dll/mle.c

    r1009 r1029  
    2020  29 Feb 08 GKY Refactor global command line variables to notebook.h
    2121  29 Feb 08 GKY Use xfree where appropriate
     22  22 Jun 08 GKY Fixed memory buffer access after it had been freed
    2223
    2324***********************************************************************/
     
    4041#include "notebook.h"                   // httprun etc
    4142#include "fm3dll.h"
     43#include "fortify.h"
    4244
    4345static PSZ pszSrcFile = __FILE__;
     
    251253              GetPString(IDS_OUTOFMEMORY));
    252254    xfree(sel, pszSrcFile, __LINE__);
     255# ifdef FORTIFY
     256  Fortify_LeaveScope();
     257# endif
    253258    DosPostEventSem(CompactSem);
    254259    return FALSE;
     
    268273      Runtime_Error(pszSrcFile, __LINE__, "len < 1");
    269274      xfree(sel, pszSrcFile, __LINE__);
     275# ifdef FORTIFY
     276  Fortify_LeaveScope();
     277# endif
    270278      DosPostEventSem(CompactSem);
    271279      return FALSE;
     
    282290    DosFreeMem(temp);
    283291    xfree(sel, pszSrcFile, __LINE__);
     292# ifdef FORTIFY
     293  Fortify_LeaveScope();
     294# endif
    284295    MLEenable(h);
    285296    DosPostEventSem(CompactSem);
     
    303314      DosFreeMem(temp);
    304315      xfree(sel, pszSrcFile, __LINE__);
     316# ifdef FORTIFY
     317  Fortify_LeaveScope();
     318# endif
    305319      MLEenable(h);
    306320      DosPostEventSem(CompactSem);
     
    376390    DosFreeMem(temp);
    377391    xfree(sel, pszSrcFile, __LINE__);
     392# ifdef FORTIFY
     393  Fortify_LeaveScope();
     394# endif
    378395    DosPostEventSem(CompactSem);
    379396    MLEenable(h);
     
    409426  DosFreeMem(temp);
    410427  xfree(sel, pszSrcFile, __LINE__);
     428# ifdef FORTIFY
     429  Fortify_LeaveScope();
     430# endif
    411431  DosPostEventSem(CompactSem);
    412432  return TRUE;
     
    575595            ret = FALSE;
    576596          xfree(buffer, pszSrcFile, __LINE__);
     597# ifdef FORTIFY
     598  Fortify_LeaveScope();
     599# endif
    577600        }
    578601        DosFreeMem(hexbuff);
     
    756779        WinCancelShutdown(thmq, TRUE);
    757780        IncrThreadUsage();
     781# ifdef FORTIFY
     782  Fortify_EnterScope();
     783# endif
    758784        priority_normal();
    759785        if (bkg->hex == 1)
     
    770796        _heap_check();
    771797#endif
    772         xfree(bkg, pszSrcFile, __LINE__);
     798        //xfree(bkg, pszSrcFile, __LINE__);
    773799        WinDestroyMsgQueue(thmq);
    774800      }
    775801      DecrThreadUsage();
    776802      WinTerminate(thab);
     803      xfree(bkg, pszSrcFile, __LINE__);
     804      bkg = NULL;
     805# ifdef FORTIFY
     806  Fortify_LeaveScope();
     807# endif
    777808      _endthread();
    778809    }
    779810    // fixme to be gone?
    780     PostMsg(bkg->hwndReport, bkg->msg, MPVOID, MPVOID);
     811    if (bkg) {
     812      PostMsg(bkg->hwndReport, bkg->msg, MPVOID, MPVOID);
     813      xfree(bkg, pszSrcFile, __LINE__);
     814# ifdef FORTIFY
     815  Fortify_LeaveScope();
     816# endif
     817    }
    781818  }
    782819}
  • trunk/dll/newview.c

    r1009 r1029  
    5353#include "notebook.h"                   // httprun etc
    5454#include "fm3dll.h"
     55#include "fortify.h"
    5556
    5657#pragma data_seg(DATA2)
     
    648649    ad->markedlines = NULL;
    649650    DosPostEventSem(CompactSem);
     651# ifdef FORTIFY
     652  Fortify_LeaveScope();
     653# endif
    650654  }
    651655}
     
    10891093      WinCancelShutdown(hmq2, TRUE);
    10901094      IncrThreadUsage();
     1095# ifdef FORTIFY
     1096  Fortify_EnterScope();
     1097# endif
    10911098      ad = WinQueryWindowPtr(hwnd, QWL_USER);
    10921099      if (ad) {
     
    12041211            xfree(ad->lines, pszSrcFile, __LINE__);
    12051212            xfree(ad->markedlines, pszSrcFile, __LINE__);
     1213# ifdef FORTIFY
     1214  Fortify_LeaveScope();
     1215# endif
    12061216            ad->lines = NULL;
    12071217            ad->markedlines = NULL;
     
    13721382            xfree(ad->lines, pszSrcFile, __LINE__);
    13731383            xfree(ad->markedlines, pszSrcFile, __LINE__);
     1384# ifdef FORTIFY
     1385  Fortify_LeaveScope();
     1386# endif
    13741387            ad->text = NULL;
    13751388            ad->lines = NULL;
     
    14211434                              GetPString(IDS_ERRORREADINGTEXT), ad->filename);
    14221435                    xfree(ad->text, pszSrcFile, __LINE__);
     1436# ifdef FORTIFY
     1437  Fortify_LeaveScope();
     1438# endif
    14231439                    ad->text = NULL;
    14241440                    ad->textsize = 0;
     
    23762392              case 0:
    23772393                xfree(urld, pszSrcFile, __LINE__);
     2394# ifdef FORTIFY
     2395  Fortify_LeaveScope();
     2396# endif
    23782397                goto NoAdd;
    23792398              case 1:
     
    24022421                }
    24032422                xfree(urld, pszSrcFile, __LINE__);
     2423# ifdef FORTIFY
     2424  Fortify_LeaveScope();
     2425# endif
    24042426                goto NoAdd;
    24052427              case 2:
     
    24282450                }
    24292451                xfree(urld, pszSrcFile, __LINE__);
     2452# ifdef FORTIFY
     2453  Fortify_LeaveScope();
     2454# endif
    24302455                goto NoAdd;
    24312456              case 3:
     
    24382463                }
    24392464                xfree(urld, pszSrcFile, __LINE__);
     2465# ifdef FORTIFY
     2466  Fortify_LeaveScope();
     2467# endif
    24402468                goto NoAdd;
    24412469              default:
     
    24432471              }
    24442472              xfree(urld, pszSrcFile, __LINE__);
     2473# ifdef FORTIFY
     2474  Fortify_LeaveScope();
     2475# endif
    24452476            }
    24462477          }
     
    25212552            }
    25222553            xfree(s, pszSrcFile, __LINE__);
     2554# ifdef FORTIFY
     2555  Fortify_LeaveScope();
     2556# endif
    25232557          }
    25242558        }
     
    39343968        WinSetWindowPtr(hwnd, QWL_USER, NULL);
    39353969        xfree(ad, pszSrcFile, __LINE__);
     3970# ifdef FORTIFY
     3971  Fortify_LeaveScope();
     3972# endif
    39363973      }
    39373974      if (hwndRestore && hwndRestore != HWND_DESKTOP) {
  • trunk/dll/printer.c

    r907 r1029  
    3333#include "strutil.h"                    // GetPString
    3434#include "fm3dll.h"
     35#include "fortify.h"
    3536
    3637#pragma data_seg(DATA1)
     
    120121      IncrThreadUsage();
    121122      if (li && li->list && li->list[0]) {
     123# ifdef FORTIFY
     124  Fortify_EnterScope();
     125# endif
    122126        AddNote(GetPString(IDS_PRINTINGLISTTEXT));
    123127        for (x = 0; li->list[x]; x++) {
  • trunk/dll/viewer.c

    r1009 r1029  
    3636#include "notebook.h"                   // External viewers
    3737#include "fm3dll.h"
     38#include "fortify.h"
    3839
    3940#pragma data_seg(DATA1)
     
    99100    }
    100101  }
    101 
     102# ifdef FORTIFY
     103  Fortify_EnterScope();
     104# endif
    102105  vw = xmallocz(sizeof(XMLEWNDPTR), pszSrcFile, __LINE__);
    103106  if (!vw)
     
    891894          }
    892895        }
     896        //printf("%s %s %d\n ",vw->exportfilename, __FILE__, __LINE__); fflush(stdout);
    893897        if (!MLEexportfile(hwndMLE,
    894898                           vw->exportfilename,
     
    12541258        }
    12551259        xfree(vw, pszSrcFile, __LINE__);
     1260# ifdef FORTIFY
     1261  Fortify_LeaveScope();
     1262# endif
    12561263      }
    12571264      if (!dontclose &&
  • trunk/dll/viewinf.c

    r1009 r1029  
    3434#include "strutil.h"                    // GetPString
    3535#include "fm3dll.h"
     36#include "fortify.h"
    3637
    3738#pragma data_seg(DATA1)
     
    5758  if (!dummy)
    5859    return;
     60# ifdef FORTIFY
     61  Fortify_EnterScope();
     62# endif
    5963  hwnd = dummy->hwnd;
    6064  hab2 = WinInitialize(0);
     
    190194  }
    191195  xfree(dummy, pszSrcFile, __LINE__);
     196# ifdef FORTIFY
     197  Fortify_LeaveScope();
     198# endif
    192199}
    193200
  • trunk/dll/walkem.c

    r1027 r1029  
    2828  29 Feb 08 GKY Refactor global command line variables to notebook.h
    2929  19 Jun 08 JBS Ticket 227: Allow temporary saving/deleting of the shutdown state of directory containers
     30  22 Jun 08 GKY Add free_?dir for fortify testing
    3031
    3132***********************************************************************/
     
    534535}
    535536
     537VOID free_ldir(VOID)
     538{
     539  LINKDIRS *info, *next;
     540
     541  info = ldirhead;
     542  while (info) {
     543    next = info->next;
     544    xfree(info->path, pszSrcFile, __LINE__);
     545    xfree(info, pszSrcFile, __LINE__);
     546    info = next;
     547  }
     548  ldirhead = NULL;
     549}
     550
     551VOID free_udir(VOID)
     552{
     553  LINKDIRS *info, *next;
     554
     555  info = udirhead;
     556  while (info) {
     557    next = info->next;
     558    xfree(info->path, pszSrcFile, __LINE__);
     559    xfree(info, pszSrcFile, __LINE__);
     560    info = next;
     561  }
     562  udirhead = NULL;
     563}
     564
    536565VOID FillPathListBox(HWND hwnd, HWND hwnddrive, HWND hwnddir, CHAR * pszPath,
    537566                     BOOL nounwriteable)
  • trunk/dll/worker.c

    r1018 r1029  
    2626  29 Feb 08 GKY Use xfree where appropriate
    2727  29 Feb 08 GKY Refactor global command line variables to notebook.h
     28  22 Jun 08 GKY Made Felete move to xworkplace trash can  on systems that have it
    2829
    2930***********************************************************************/
     
    4142#define INCL_LONGLONG
    4243#define INCL_WINPOINTERS
     44#define INCL_WINWORKPLACE
    4345
    4446#include "fm3dlg.h"
     
    134136
    135137  if (wk) {
     138# ifdef FORTIFY
     139  Fortify_EnterScope();
     140# endif
    136141    if (wk->li && wk->li->list && wk->li->list[0]) {
    137142      hab2 = WinInitialize(0);
     
    265270                                 UM_COLLECTFROMFILE, MPFROMP(temp), MPVOID))
    266271                      xfree(temp, pszSrcFile, __LINE__);
     272# ifdef FORTIFY
     273  Fortify_LeaveScope();
     274# endif
    267275                  }
    268276                }
     
    990998
    991999  if (wk) {
     1000# ifdef FORTIFY
     1001  Fortify_EnterScope();
     1002# endif
    9921003    if (wk->li && wk->li->list && wk->li->list[0]) {
    9931004      hab2 = WinInitialize(0);
     
    11311142                strcpy(p, wk->li->list[x]);
    11321143                xfree(wk->li->list[x], pszSrcFile, __LINE__);
     1144# ifdef FORTIFY
     1145  Fortify_LeaveScope();
     1146# endif
    11331147                wk->li->list[x] = xstrdup(szBuffer, pszSrcFile, __LINE__);
    11341148              }
     
    13111325                               MPFROMLONG(5 + viewtype), MPFROMP(temp)))
    13121326                    xfree(temp, pszSrcFile, __LINE__);
     1327# ifdef FORTIFY
     1328  Fortify_LeaveScope();
     1329# endif
    13131330                }
    13141331                DosSleep(1);
     
    13561373                               MPFROMLONG(4 + viewtype), MPFROMP(temp)))
    13571374                    xfree(temp, pszSrcFile, __LINE__);
     1375# ifdef FORTIFY
     1376  Fortify_LeaveScope();
     1377# endif
    13581378                }
    13591379                DosSleep(1);
     
    14331453              CHAR prompt[CCHMAXPATH * 3];
    14341454              APIRET error;
     1455              HOBJECT hObjectdest, hObjectofObject;
    14351456
    14361457              for (x = 0; wk->li->list[x]; x++) {
     
    15561577                  AddNote(prompt);
    15571578                  DosError(FERR_DISABLEHARDERR);
    1558                   if (wk->li->type == IDM_DELETE)
    1559                     error = DosDelete(wk->li->list[x]);
     1579                  if (wk->li->type == IDM_DELETE){
     1580                    hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
     1581                    if (hObjectdest != NULLHANDLE){
     1582                      hObjectofObject = WinQueryObject(wk->li->list[x]);
     1583                      error = WinMoveObject(hObjectofObject, hObjectdest, 0);
     1584                    }
     1585                    else
     1586                      error = DosDelete(wk->li->list[x]);
     1587                  }
    15601588                  else
    15611589                    error = DosForceDelete(wk->li->list[x]);
     
    15631591                    DosError(FERR_DISABLEHARDERR);
    15641592                    make_deleteable(wk->li->list[x]);
    1565                     if (wk->li->type == IDM_DELETE)
    1566                       error = DosDelete(wk->li->list[x]);
     1593                    if (wk->li->type == IDM_DELETE){
     1594                      hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
     1595                      if (hObjectdest != NULLHANDLE){
     1596                        hObjectofObject = WinQueryObject(wk->li->list[x]);
     1597                        error = WinMoveObject(hObjectofObject, hObjectdest, 0);
     1598                      }
     1599                      else
     1600                        error = DosDelete(wk->li->list[x]);
     1601                    }
    15671602                    else
    15681603                      error = DosForceDelete(wk->li->list[x]);
Note: See TracChangeset for help on using the changeset viewer.