Changeset 36 for trunk/dll/seeall.c


Ignore:
Timestamp:
Oct 17, 2002, 3:53:23 AM (23 years ago)
Author:
root
Message:

Handle large partitions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/seeall.c

    r2 r36  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  See all matching files
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2001, 2002 Steven H.Levine
     10
     11  Revisions     16 Oct 02 SHL - Handle large partitions
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_DOSERRORS
     
    733747
    734748                    FSALLOCATE  fsa;
    735                     ULONG       totalsize;
     749                    ULONG       clFreeBytes;
    736750                    CHAR       *ptr;
    737751                    INT         cntr;
     
    742756                    if(!DosQueryFSInfo(toupper(*newname) - '@',
    743757                       FSIL_ALLOC,&fsa,sizeof(FSALLOCATE))) {
    744                       totalsize = fsa.cUnitAvail * fsa.cSectorUnit *
    745                                   fsa.cbSector;
    746                       if(totalsize) {
     758                      // Assume <2GB since file did not fit
     759                      clFreeBytes = fsa.cUnitAvail * fsa.cSectorUnit *
     760                                    fsa.cbSector;
     761                      if(clFreeBytes) {
     762                        // Find item that will fit in available space
    747763                        for(cntr = x + 1;list[cntr];cntr++) {
    748764                          DosError(FERR_DISABLEHARDERR);
     
    751767                                               &fs4,sizeof(fs4)) &&
    752768                             !(fs4.attrFile & FILE_DIRECTORY) &&
    753                              fs4.cbFile + fs4.cbList <= totalsize) {
     769                             fs4.cbFile + fs4.cbList <= clFreeBytes) {
     770                            // Swap with failing item
    754771                            ptr = list[x];
    755772                            list[x] = list[cntr];
Note: See TracChangeset for help on using the changeset viewer.