Changeset 1029 for trunk/dll/worker.c


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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.