Changeset 907 for trunk/dll/filldir.c


Ignore:
Timestamp:
Jan 6, 2008, 8:26:17 AM (18 years ago)
Author:
Steven Levine
Message:

Avoid out of memory traps in Compare Directories
Rework Compare Directories progress display for 2 second update rate
Start refactoring to reduce dependence on fm3dll.h
Add timer services (IsITimerExpired etc.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/filldir.c

    r859 r907  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2007 Steven H. Levine
     9  Copyright (c) 2001, 2008 Steven H. Levine
    1010
    1111  10 Jan 04 SHL ProcessDirectory: avoid most large drive failures
     
    4343***********************************************************************/
    4444
     45#include <stdlib.h>
     46#include <string.h>
     47#include <ctype.h>
     48
     49#if 0 // fixme to disable or to be configurable
     50#include <malloc.h>                     // _heapchk
     51#endif
     52
    4553#define INCL_DOS
    4654#define INCL_WIN
    4755#define INCL_DOSERRORS
    4856#define INCL_LONGLONG
    49 #include <os2.h>
    50 
    51 #include <stdarg.h>
    52 #include <stdio.h>
    53 #include <stdlib.h>
    54 #include <string.h>
    55 #include <ctype.h>
    56 #include <time.h>
    57 #include <time.h>
    58 
    59 #if 0 // fixme to disable or to be configurable
    60 #include <malloc.h>                     // _heapchk
    61 #endif
    62 
     57
     58#include "fm3str.h"
     59#include "filldir.h"
     60#include "errutil.h"                    // Dos_Error...
     61#include "strutil.h"                    // GetPString
    6362#include "fm3dll.h"
    64 #include "fm3str.h"
    6563
    6664static PSZ pszSrcFile = __FILE__;
     
    486484
    487485ULONGLONG FillInRecordFromFSA(HWND hwndCnr, PCNRITEM pci,
    488                               const PSZ pszFileName,
    489                               const PFILESTATUS4L pfsa4,
    490                               const BOOL partial, DIRCNRDATA * dcd)     // Optional
     486                              const PSZ pszFileName,
     487                              const PFILESTATUS4L pfsa4,
     488                              const BOOL partial, DIRCNRDATA * dcd)     // Optional
    491489{
    492490  HPOINTER hptr;
     
    792790         * network file systems exhibit such a problem).
    793791         */
    794 #if 0 // 13 Aug 07 SHL fixme to be gone
    795         {
    796           static ULONG ulMaxCnt = 1;
    797           if (ulFindCnt > ulMaxCnt) {
    798             ulMaxCnt = ulFindCnt;
    799             DbgMsg(pszSrcFile, __LINE__, "ulMaxCnt %u/%u", ulMaxCnt, ulFindMax);
    800           }
    801         }
    802 #endif // fixme to be gone
    803792
    804793        if (stopflag && *stopflag)
     
    838827            }
    839828            else {
     829              // 04 Jan 08 SHL fixme like comp.c to handle less than ulSelCnt records
    840830              pci = pciFirst;
    841831              ullTotalBytes = 0;
     
    937927        }
    938928        else {
     929          // 04 Jan 08 SHL fixme like comp.c to handle less than ulSelCnt records
    939930          pci = pciFirst;
    940931          ullTotalBytes = 0;
     
    11051096  if (!pciFirst) {
    11061097    Win_Error2(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, IDS_CMALLOCRECERRTEXT);
     1098    // 04 Jan 08 SHL fixme not just up and die
    11071099    exit(0);
    11081100  }
    11091101
     1102  // 04 Jan 08 SHL fixme like comp.c to handle less than ulSelCnt records
    11101103  pci = pciFirst;
    11111104  for (x = 0; x < 26; x++) {
     
    16801673      while (pci) {
    16811674        // 12 Sep 07 SHL dwg drivebar crash testing - ticket# ???
    1682         static PCNRITEM pciLast;                // 12 Sep 07 SHL
    1683         ULONG ulSize = sizeof(*pci);
    1684         ULONG ulAttr;
     1675        static PCNRITEM pciLast;                // 12 Sep 07 SHL
     1676        ULONG ulSize = sizeof(*pci);
     1677        ULONG ulAttr;
    16851678        APIRET apiret = DosQueryMem((PVOID)pci, &ulSize, &ulAttr);
    16861679        if (apiret)
    1687           Dos_Error(MB_ENTER, apiret, HWND_DESKTOP, pszSrcFile, __LINE__,
     1680          Dos_Error(MB_ENTER, apiret, HWND_DESKTOP, pszSrcFile, __LINE__,
    16881681                    "DosQueryMem failed pci %p pciLast %p", pci, pciLast);
    16891682        FreeCnrItemData(pci);
Note: See TracChangeset for help on using the changeset viewer.