Changeset 1916


Ignore:
Timestamp:
Nov 1, 2025, 7:30:47 PM (5 days ago)
Author:
Gregg Young
Message:

Fix easize so that EAs larger than 32767 show their actual size instead of 32767

Location:
trunk/dll
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/autoview.c

    r1878 r1916  
    510510                    CommaFmtULL(szCmmaFmtFileSize,
    511511                                sizeof(szCmmaFmtFileSize),
    512                                 pffbFile->cbFile + CBLIST_TO_EASIZE(pffbFile->cbList),
     512                                pffbFile->cbFile + pffbFile->cbList == 65535 ? GetLargeEASize(pffbFile->achName) : CBLIST_TO_EASIZE(pffbFile->cbList),
    513513                                ' ');
    514514                    FDateFormat(szDate, pffbFile->fdateLastWrite);
  • trunk/dll/dirsize.c

    r1878 r1916  
    100100#include "pathutil.h"                   // AddBackslashToPath
    101101#include "tmrsvcs.h"
     102#include "eas.h"                        // GetLargeEASize
    102103
    103104typedef struct
     
    208209    if (!rc) {
    209210      ullCurDirBytes = pffbArray->cbFile;
    210       ullCurDirBytes += CBLIST_TO_EASIZE(pffbArray->cbList);
     211      ullCurDirBytes += pffbArray->cbList == 65535 ? GetLargeEASize(pffbArray->achName) : CBLIST_TO_EASIZE(pffbArray->cbList);
    211212    }
    212213    else
     
    289290              (pffbFile->achName[1] != '.' || pffbFile->achName[2])))) {
    290291          ullCurDirBytes += pffbFile->cbFile;
    291           ullCurDirBytes += CBLIST_TO_EASIZE(pffbFile->cbList) & 0x3ff;
     292          ullCurDirBytes += (pffbFile->cbList == 65535 ? GetLargeEASize(pffbFile->achName) : CBLIST_TO_EASIZE(pffbFile->cbList)) & 0x3ff;
    292293
    293294          if (*pchStopFlag)
  • trunk/dll/droplist.c

    r1780 r1916  
    4444
    4545#include "fortify.h"
     46#include "eas.h"                        // GetLargeEASize
    4647
    4748static PSZ pszSrcFile = __FILE__;
     
    446447
    447448        if (!DosQueryPathInfo(szFrom, FIL_QUERYEASIZEL, &fsa4, sizeof(fsa4)))
    448           pcbFile[numfiles] = fsa4.cbFile + CBLIST_TO_EASIZE(fsa4.cbList);
     449          pcbFile[numfiles] = fsa4.cbFile + fsa4.cbList == 65535 ? GetLargeEASize(szFrom) : CBLIST_TO_EASIZE(fsa4.cbList);
    449450      }
    450451      pulitemID[numfiles] = pDItem->ulItemID;
  • trunk/dll/eas.c

    r1915 r1916  
    14881488  DosPostEventSem(CompactSem);
    14891489}
     1490#if 1
     1491ULONG  GetLargeEASize(PSZ filename)
     1492{
     1493  ULONG EASize = 0;
     1494  PDENA2 pdena;
     1495  ULONG ulEntry = 1, ulCount = 1;
     1496  int rc = 0;
     1497
     1498    pdena = xmalloc(65536 + 1024, pszSrcFile, __LINE__);
     1499    if (pdena) {
     1500      while ((rc = DosEnumAttribute(ENUMEA_REFTYPE_PATH,
     1501                                    filename,
     1502                                    ulEntry,
     1503                                    (PVOID)pdena,
     1504                                    (ULONG)65536,
     1505                                    &ulCount,
     1506                                    ENUMEA_LEVEL_NO_VALUE) == 0) && ulCount)
     1507      {
     1508        //GKY 10/10/25  name size term null EA data size  sizeofcbName & EAf(lag) sizeofcbValue sizeof next offset
     1509        EASize += (pdena->cbName) + pdena->cbValue + (sizeof(BYTE) * 2) + sizeof(USHORT) + sizeof(USHORT);
     1510        ulEntry += ulCount; //next entry
     1511      }
     1512      free(pdena);
     1513      DosPostEventSem(CompactSem);
     1514    }
     1515  return EASize;
     1516}
     1517
     1518#endif
    14901519#pragma alloc_text(EAS,DisplayEAsProc,SaveEA,HexDumpEA,CheckEA,AddEAProc)
    14911520#pragma alloc_text(EAS1,HexDump,GetFileEAs,Free_FEAList,GetLargeEASize)
  • trunk/dll/eas.h

    r1222 r1916  
    3232HOLDFEA *GetFileEAs(CHAR * filename, BOOL ishandle, BOOL silentfail);
    3333VOID HexDump(HWND hwnd, CHAR * value, ULONG cbValue);
     34ULONG GetLargeEASize(PSZ filename);
    3435
    3536#endif // EAS_H
  • trunk/dll/filldir.c

    r1907 r1916  
    172172#include "pathutil.h"                   // AddBackslashToPath
    173173#include "tmrsvcs.h"                    // ITIMER_DESC
     174#include "eas.h"                        // GetLargeEASize
    174175
    175176// Data definitions
     
    620621  pci->crtime.minutes = pffb->ftimeCreation.minutes;
    621622  pci->crtime.hours = pffb->ftimeCreation.hours;
    622   pci->easize = CBLIST_TO_EASIZE(pffb->cbList);
     623  if (pffb->cbList < 65535)
     624    pci->easize = CBLIST_TO_EASIZE(pffb->cbList);
     625  else
     626    pci->easize = GetLargeEASize(pci->pszFileName);
    623627  pci->cbFile = pffb->cbFile;
    624628  pci->attrFile = pffb->attrFile;
     
    782786  pci->crtime.minutes = pfsa4->ftimeCreation.minutes;
    783787  pci->crtime.hours = pfsa4->ftimeCreation.hours;
    784   pci->easize = CBLIST_TO_EASIZE(pfsa4->cbList);
     788  if (pfsa4->cbList < 65535)
     789    pci->easize = CBLIST_TO_EASIZE(pfsa4->cbList);
     790  else
     791    pci->easize = GetLargeEASize(pszFileName);
    785792  pci->cbFile = pfsa4->cbFile;
    786793  pci->attrFile = pfsa4->attrFile;
  • trunk/dll/grep.c

    r1880 r1916  
    8181#include "sortcnr.h"                    // SortCollectorCnr
    8282#include "collect.h"
     83#include "eas.h"                        // GetLargeEASize
    8384
    8485static VOID DoAllSubdirs(GREP *grep,
     
    871872      }
    872873
    873       grep->insertedbytes += pffb->cbFile + CBLIST_TO_EASIZE(pffb->cbList);
     874      grep->insertedbytes += pffb->cbFile + pffb->cbList == 65535 ? GetLargeEASize(pffb->achName) : CBLIST_TO_EASIZE(pffb->cbList);
    874875      grep->toinsert++;
    875876      // 07 Oct 09 SHL honor sync updates
     
    913914    ULONG adjsize;
    914915
    915     adjsize = pffb->cbFile + (grep->searchEAs ? CBLIST_TO_EASIZE(pffb->cbList) : 0);
     916    adjsize = pffb->cbFile + (grep->searchEAs ? (pffb->cbList == 65535 ? GetLargeEASize(pffb->achName) : CBLIST_TO_EASIZE(pffb->cbList)) : 0);
    916917    if (grep->greaterthan) {
    917918      if (adjsize < grep->greaterthan)
  • trunk/dll/info.c

    r1863 r1916  
    8181#include "wrappers.h"                   // xDosFindFirst
    8282#include "fortify.h"
     83#include "eas.h"                        // GetLargeEASize
    8384
    8485// Data definitions
     
    737738                    sizeof(szCmmaFmtFileSize), fs.cbFile, ' ');
    738739        CommaFmtULL(szCmmaFmtEASize,
    739                     sizeof(szCmmaFmtEASize), CBLIST_TO_EASIZE(fs.cbList), ' ');
     740                    sizeof(szCmmaFmtEASize), fs.cbList == 65535 ? GetLargeEASize(pfs->szFileName) : CBLIST_TO_EASIZE(fs.cbList), ' ');
    740741        CommaFmtULL(szCmmaFmtFileEASize,
    741742                    sizeof(szCmmaFmtFileEASize),
    742                     fs.cbFile + CBLIST_TO_EASIZE(fs.cbList),
     743                    fs.cbFile + fs.cbList == 65535 ? GetLargeEASize(pfs->szFileName) : CBLIST_TO_EASIZE(fs.cbList),
    743744                    ' ');
    744745        CommaFmtULL(szCmmaFmtFileEASizeK,
    745746                    sizeof(szCmmaFmtFileEASizeK),
    746                     fs.cbFile + CBLIST_TO_EASIZE(fs.cbList),
     747                    fs.cbFile + fs.cbList == 65535 ? GetLargeEASize(pfs->szFileName) : CBLIST_TO_EASIZE(fs.cbList),
    747748                    'K');
    748749        sprintf(s,
  • trunk/dll/makelist.c

    r1673 r1916  
    3939#include "fortify.h"                    // 06 May 08 SHL
    4040#include "tmrsvcs.h"                    // ITIMER_DESC
     41#include "eas.h"                        // GetLargeEASize
    4142
    4243static PSZ pszSrcFile = __FILE__;
     
    150151    pfl->crtime = ffb4->ftimeCreation;
    151152    pfl->cbFile = ffb4->cbFile;
    152     pfl->easize = CBLIST_TO_EASIZE(ffb4->cbList);
     153    //Need to account for snapshot file but since cbList is a ulong and will always be even the fact they can exceed
     154    //65535 doesn't matter. 31 Oct 25 GKY
     155    pfl->easize = ffb4->cbList == 65535 ? GetLargeEASize(ffb4->achName) : CBLIST_TO_EASIZE(ffb4->cbList);
    153156    strcpy(pfl->fname, string);
    154157    (*list)[*pnumfiles] = pfl;
  • trunk/dll/saveclip.c

    r1673 r1916  
    6767#include "dirs.h"                       // save_dir2
    6868#include "fortify.h"
     69#include "eas.h"                        // GetLargeEASize
    6970
    7071static PSZ pszSrcFile = __FILE__;
     
    961962                      break;
    962963                    case 'E':
    963                       fprintf(fp, "%-5u", CBLIST_TO_EASIZE(ffb4.cbList));
     964                      fprintf(fp, "%-5u", 65535 ? GetLargeEASize(ffb4.achName) : CBLIST_TO_EASIZE(ffb4.cbList));
    964965                      break;
    965966                    case 'e':
    966                       fprintf(fp, "%u", CBLIST_TO_EASIZE(ffb4.cbList));
     967                      fprintf(fp, "%u", 65535 ? GetLargeEASize(ffb4.achName) : CBLIST_TO_EASIZE(ffb4.cbList));
    967968                      break;
    968969                    case 'd':
  • trunk/dll/seeall.c

    r1880 r1916  
    815815                                            &fs4, sizeof(fs4)) &&
    816816                          !(fs4.attrFile & FILE_DIRECTORY) &&
    817                           // fixme to use CBLIST_TO_EASIZE?
     817                          // fixme to use CBLIST_TO_EASIZE? No as it understates the size of EA > 32K
    818818                          fs4.cbFile + fs4.cbList <= ullFreeBytes) {
    819819                        // Swap with failing item
  • trunk/dll/update.c

    r1890 r1916  
    5151#include "misc.h"                       // PostMsg
    5252#include "fortify.h"
     53#include "eas.h"                        // GetLargeEASize
    5354
    5455#ifdef PMPRINTF
     
    142143      if ((!fForceUpper && !fForceLower && strcmp(pci->pszFileName, filename)) ||
    143144          pci->cbFile != ffb.cbFile || pci->attrFile != ffb.attrFile ||
    144           pci->easize != CBLIST_TO_EASIZE(ffb.cbList) || pci->date.day !=
     145          pci->easize != 65535 ? GetLargeEASize(filename) : CBLIST_TO_EASIZE(ffb.cbList) || pci->date.day !=
    145146          ffb.fdateLastWrite.day || pci->date.month != ffb.fdateLastWrite.month ||
    146147          pci->date.year != ffb.fdateLastWrite.year + 1980 || pci->time.seconds !=
     
    405406               strcmp(pci->pszFileName, filename[x])) ||
    406407              pci->cbFile != ffb.cbFile || pci->attrFile != ffb.attrFile ||
    407               pci->easize != CBLIST_TO_EASIZE(ffb.cbList) ||
     408              pci->easize != 65535 ? GetLargeEASize(filename[x]) : CBLIST_TO_EASIZE(ffb.cbList) ||
    408409              pci->date.day != ffb.fdateLastWrite.day ||
    409410              pci->date.month != ffb.fdateLastWrite.month ||
Note: See TracChangeset for help on using the changeset viewer.