Changeset 70


Ignore:
Timestamp:
Nov 5, 2003, 2:18:25 AM (22 years ago)
Author:
root
Message:

Add JFS and FAT32 support

Location:
trunk/dll
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/filldir.c

    r51 r70  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2002 Steven H.Levine
     9  Copyright (c) 2001, 2003 Steven H.Levine
    1010
    1111  Revisions     12 Sep 02 SHL - Rework symbols to understand code
    1212                08 Feb 03 SHL - DropHelp: calc EA size consistently
     13                11 Jun 03 SHL - Add JFS and FAT32 support
    1314
    1415***********************************************************************/
     
    971972            if(drvtype & DRIVE_REMOTE)
    972973              driveflags[x] |= DRIVE_REMOTE;
    973             if(strcmp(FileSystem,HPFS) &&
    974                strcmp(FileSystem,HPFS386) &&
    975                strcmp(FileSystem,CDFS))
     974            if (strcmp(FileSystem,HPFS) &&
     975                strcmp(FileSystem,JFS) &&
     976                strcmp(FileSystem,CDFS) &&
     977                strcmp(FileSystem,FAT32) &&
     978                strcmp(FileSystem,HPFS386))
     979            {
    976980              driveflags[x] |= DRIVE_NOLONGNAMES;
     981            }
    977982            if(!strcmp(FileSystem,CDFS)) {
    978983              removable = 1;
    979               driveflags[x] |= (DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE |
    980                                 DRIVE_CDROM);
     984              driveflags[x] |= DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE |
     985                                DRIVE_CDROM;
    981986            }
    982             else if(!stricmp(FileSystem,CBSIFS)) {
     987            else if(!stricmp(FileSystem,CBSIFS))
     988            {
    983989              driveflags[x] |= DRIVE_ZIPSTREAM;
    984               driveflags[x] &= (~DRIVE_REMOTE);
     990              driveflags[x] &= ~DRIVE_REMOTE;
    985991              if(drvtype & DRIVE_REMOVABLE)
    986992                driveflags[x] |= DRIVE_REMOVABLE;
    987993              if(!(drvtype & DRIVE_NOLONGNAMES))
    988                 driveflags[x] &= (~DRIVE_NOLONGNAMES);
     994                driveflags[x] &= ~DRIVE_NOLONGNAMES;
    989995            }
    990996
  • trunk/dll/fm3dll.h

    r49 r70  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2002 Steven H.Levine
     9  Copyright (c) 2001, 2003 Steven H.Levine
    1010
    1111  Revisions     12 Feb 03 SHL - Add CBLIST_TO_EASIZE
     12                11 Jun 03 SHL - Add JFS and FAT32 support
    1213
    1314***********************************************************************/
     
    12371238                 *DRMDRFLIST,*DRMDRFOS2FILE,*DRMDRFFM2ARC,
    12381239                 *DRM_FM2INIRECORD,*DRF_FM2INI,*SUBJECT,*LONGNAME,
    1239                  *HPFS,*HPFS386,*CDFS,*CBSIFS,*WPProgram,*FM3Folder,*FM3Tools;
     1240                 *HPFS,*JFS,*CDFS,*FAT32,*HPFS386,*CBSIFS,*WPProgram,*FM3Folder,*FM3Tools;
    12401241DATADEF RGB2      RGBGREY,RGBBLACK;
    12411242DATADEF CHAR      archiverbb2[CCHMAXPATH],StopPrinting,profile[CCHMAXPATH];
  • trunk/dll/init.c

    r32 r70  
    1010
    1111  Revisions     11 Jun 02 SHL - Add CheckVersion
     12                11 Jun 03 SHL - Add JFS and FAT32 support
    1213
    1314***********************************************************************/
     
    218219      LONGNAME = ".LONGNAME";
    219220      HPFS = "HPFS";
     221      JFS = "JFS";
    220222      CDFS = "CDFS";
     223      FAT32 = "FAT32";
    221224      HPFS386 = "HPFS386";
    222225      CBSIFS = "CBSIFS";
  • trunk/dll/misc.c

    r2 r70  
     1
     2/***********************************************************************
     3
     4  $Id$
     5
     6  Misc support functions
     7
     8  Copyright (c) 1993-98 M. Kimes
     9  Copyright (c) 2003 Steven H.Levine
     10
     11  Revisions     11 Jun 03 SHL - Add JFS and FAT32 support
     12
     13***********************************************************************/
     14
    115#define INCL_DOS
    216#define INCL_WIN
     
    298312
    299313
    300 BOOL AdjustCnrColRO (HWND hwndCnr,CHAR *title,BOOL readonly,BOOL toggle) {
    301 
     314BOOL AdjustCnrColRO (HWND hwndCnr,CHAR *title,BOOL readonly,BOOL toggle)
     315{
    302316  PFIELDINFO pfi;
    303317
     
    340354  x = CheckDrive(toupper(*directory),FileSystem,NULL);
    341355  if(x != -1) {
    342     if(!stricmp(FileSystem,HPFS) || !stricmp(FileSystem,HPFS386)) {
     356    if (!stricmp(FileSystem,HPFS) ||
     357        !stricmp(FileSystem,JFS) ||
     358        !stricmp(FileSystem,CDFS) ||
     359        !stricmp(FileSystem,FAT32) ||
     360        !stricmp(FileSystem,HPFS386))
     361    {
    343362      showem = TRUE;
    344363      showemA = TRUE;
    345364    }
    346     else if(!strcmp(FileSystem,CDFS)) {
     365    else if (!strcmp(FileSystem,CDFS))
     366    {
    347367      showem = TRUE;
    348368      showemA = FALSE;
     
    351371      showem = showemA = FALSE;
    352372  }
    353   else  /* assume FAT */
     373  else
     374  {
     375    /* assume FAT */
    354376    showem = showemA = FALSE;
     377  }
    355378  bool = (dcd) ? &dcd->detailsladate : &detailsladate;
    356379  AdjustCnrColVis(hwndCnr,GetPString(IDS_LADATE),
  • trunk/dll/treecnr.c

    r36 r70  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2001, 2002 Steven H.Levine
     9  Copyright (c) 2001, 2003 Steven H.Levine
    1010
    1111  Revisions     16 Oct 02 SHL - Handle large partitions
     12                11 Jun 03 SHL - Add JFS and FAT32 support
    1213
    1314***********************************************************************/
     
    18351836
    18361837          case CN_ENTER:
    1837             if(mp2) {
    1838            
     1838            if(mp2)
     1839            {
    18391840              PCNRITEM pci = (PCNRITEM)((PNOTIFYRECORDENTER)mp2)->pRecord;
    18401841
     
    20412042                                    DRIVE_NOTWRITEABLE |
    20422043                                    DRIVE_CDROM);
    2043                 if(strcmp(FileSystem,HPFS) && strcmp(FileSystem,CDFS) &&
    2044                    strcmp(FileSystem,HPFS386))
     2044                if (strcmp(FileSystem,HPFS) &&
     2045                    strcmp(FileSystem,JFS) &&
     2046                    strcmp(FileSystem,CDFS) &&
     2047                    strcmp(FileSystem,FAT32) &&
     2048                    strcmp(FileSystem,HPFS386))
     2049                {
    20452050                  driveflags[x] |= DRIVE_NOLONGNAMES;
     2051                }
    20462052                if(!strcmp(FileSystem,CBSIFS)) {
    20472053                  driveflags[x] |= DRIVE_ZIPSTREAM;
  • trunk/dll/valid.c

    r48 r70  
    1010
    1111  Revisions     23 Nov 02 SHL - RootName: rework for sanity
    12                 27 Nov 02 SHL - MakeFullName: correct typo
    13 
     12                27 Nov 02 SHL - MakeFullName: correct typo
     13                11 Jun 03 SHL - Add JFS and FAT32 support
    1414
    1515***********************************************************************/
     
    168168
    169169
    170 INT CheckDrive (CHAR Drive, CHAR *FileSystem, ULONG *type) {
    171 
     170INT CheckDrive (CHAR chDrive, CHAR *pszFileSystem, ULONG *pulType)
     171{
    172172  CHAR        Path[3],*Buffer = NULL,*pfsn = NULL,*pfsd = NULL;
    173173  ULONG       Size,Status,action,LengthIn,LengthOut;
     
    176176  PFSQBUFFER2 pfsq;
    177177
    178   if(FileSystem)
    179     *FileSystem = 0;
    180   if(type)
    181     *type = 0;
     178  if (pszFileSystem)
     179    *pszFileSystem = 0;
     180  if (pulType)
     181    *pulType = 0;
    182182
    183183  if(DosAllocMem((PVOID)&Buffer,4096,
    184184                 PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE)) {
    185185    DosBeep(50,50);
    186     return -1;
    187   }
    188 
    189   Path[0] = Drive;
     186    return -1;                          // Say failed
     187  }
     188
     189  Path[0] = chDrive;
    190190  Path[1] = ':';
    191191  Path[2] = 0;
     
    194194  Status = DosQueryFSAttach(Path, 0, FSAIL_QUERYNAME,
    195195                            (PFSQBUFFER2)Buffer, &Size);
    196   if(Status) {   /* can't get any info at all */
     196  if (Status)
     197  {
     198    /* can't get any info at all */
    197199    DosFreeMem(Buffer);
    198200    DosError(FERR_DISABLEHARDERR);
    199     return -1;
     201    return -1;                          // Say failed
    200202  }
    201203
     
    204206  pfsd = pfsn + pfsq->cbFSDName + 1;
    205207
    206   if(FileSystem) {
    207     strncpy(FileSystem, pfsn, CCHMAXPATH);
    208     FileSystem[CCHMAXPATH - 1] = 0;
    209   }
    210 
    211   if(type && !strcmp(pfsn,CDFS))
    212     (*type) |= (DRIVE_NOTWRITEABLE | DRIVE_CDROM | DRIVE_REMOVABLE);
    213 
    214   if(((PFSQBUFFER2)Buffer)->iType == FSAT_REMOTEDRV) {
    215     if(type)
    216       (*type) |= DRIVE_REMOTE;
    217     if(type && !strcmp(pfsn,CBSIFS)) {
    218       (*type) |= DRIVE_ZIPSTREAM;
    219       (*type) &= (~DRIVE_REMOTE);
    220       (*type) |= DRIVE_NOLONGNAMES;
    221       if(pfsq->cbFSAData) {
    222 
     208  if (pszFileSystem)
     209  {
     210    strncpy(pszFileSystem, pfsn, CCHMAXPATH);
     211    pszFileSystem[CCHMAXPATH - 1] = 0;
     212  }
     213
     214  if (pulType && !strcmp(pfsn,CDFS))
     215    *pulType |= DRIVE_NOTWRITEABLE | DRIVE_CDROM | DRIVE_REMOVABLE;
     216
     217  if (((PFSQBUFFER2)Buffer)->iType == FSAT_REMOTEDRV)
     218  {
     219    if (pulType)
     220      *pulType |= DRIVE_REMOTE;
     221    if (pulType && !strcmp(pfsn,CBSIFS))
     222    {
     223      *pulType |= DRIVE_ZIPSTREAM;
     224      *pulType &= ~DRIVE_REMOTE;
     225      *pulType |= DRIVE_NOLONGNAMES;
     226      if (pfsq->cbFSAData)
     227      {
    223228        ULONG FType;
    224229
    225         if(CheckDrive(*pfsd,NULL,&FType) != -1) {
    226           if(FType & DRIVE_REMOVABLE)
    227             (*type) |= DRIVE_REMOVABLE;
    228           if(!(FType & DRIVE_NOLONGNAMES))
    229             (*type) &= (~DRIVE_NOLONGNAMES);
     230        if (CheckDrive(*pfsd,NULL,&FType) != -1)
     231        {
     232          if (FType & DRIVE_REMOVABLE)
     233            *pulType |= DRIVE_REMOVABLE;
     234          if (~FType & DRIVE_NOLONGNAMES)
     235            *pulType &= ~DRIVE_NOLONGNAMES;
    230236        }
    231237      }
    232238    }
    233     if(type && (!strcmp(pfsn,HPFS) || !strcmp(pfsn,HPFS386)))
    234       (*type) &= (~DRIVE_NOLONGNAMES);
     239    if (pulType &&
     240        (!strcmp(pfsn,HPFS) ||
     241         !strcmp(pfsn,JFS) ||
     242         !strcmp(pfsn,FAT32) ||
     243         !strcmp(pfsn,HPFS386)))
     244    {
     245      *pulType &= ~DRIVE_NOLONGNAMES;
     246    }
    235247    DosFreeMem(Buffer);
    236     return 0;  /* assume remotes are non-removable */
    237   }
    238 
    239   if(strcmp(pfsn,HPFS) && strcmp(pfsn,CDFS) && strcmp(pfsn,HPFS386)) {
    240     if(type)
    241       (*type) |= DRIVE_NOLONGNAMES;
     248    return 0;                           // Say non-removable
     249  }
     250
     251  // Local drive
     252  if (strcmp(pfsn,HPFS) &&
     253      strcmp(pfsn,JFS) &&
     254      strcmp(pfsn,CDFS) &&
     255      strcmp(pfsn,FAT32) &&
     256      strcmp(pfsn,HPFS386))
     257  {
     258    if(pulType)
     259      (*pulType) |= DRIVE_NOLONGNAMES;
    242260  }
    243261
     
    246264                   OPEN_ACCESS_READONLY | OPEN_SHARE_DENYNONE |
    247265                   OPEN_FLAGS_DASD | OPEN_FLAGS_FAIL_ON_ERROR, 0);
    248   if(Status) {
    249     DosError(FERR_DISABLEHARDERR);
    250     if(type)
    251       (*type) |= DRIVE_REMOVABLE;
     266  if(Status)
     267  {
     268    DosError(FERR_DISABLEHARDERR);
     269    if (pulType)
     270      *pulType |= DRIVE_REMOVABLE;      // Assume removable if can not access
    252271    DosFreeMem(Buffer);
    253     return(1);  /* assume inaccessible local drives are removable */
     272    return 1;                           // Say removable
    254273  }
    255274  LengthIn = sizeof(Command);
     
    260279              &NonRemovable, sizeof(NonRemovable), &LengthOut);
    261280  DosClose(Handle);
    262   if(!NonRemovable && type)
    263     (*type) |= DRIVE_REMOVABLE;
     281  if (!NonRemovable && pulType)
     282    *pulType |= DRIVE_REMOVABLE;
    264283  DosFreeMem(Buffer);
    265   return (NonRemovable) ? 0 : 1;
     284  return NonRemovable ? 0 : 1;
    266285}
    267286
     
    532551
    533552
    534 VOID DriveFlagsOne (INT x) {
    535 
     553VOID DriveFlagsOne (INT x)
     554{
    536555  INT         removable;
    537556  CHAR        szDrive[] = " :\\",FileSystem[CCHMAXPATH];
     
    546565                    DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS |
    547566                    DRIVE_INCLUDEFILES | DRIVE_SLOW);
    548   if(removable != -1) {
    549 
    550     struct {
     567  if(removable != -1)
     568  {
     569    struct
     570    {
    551571      ULONG serial;
    552572      CHAR  volumelength;
     
    566586  if(drvtype & DRIVE_REMOTE)
    567587    driveflags[x] |= DRIVE_REMOTE;
    568   if(strcmp(FileSystem,HPFS) &&
    569      strcmp(FileSystem,HPFS386) &&
    570      strcmp(FileSystem,CDFS))
     588  if (strcmp(FileSystem,HPFS) &&
     589      strcmp(FileSystem,JFS) &&
     590      strcmp(FileSystem,CDFS) &&
     591      strcmp(FileSystem,FAT32) &&
     592      strcmp(FileSystem,HPFS386))
     593  {
    571594    driveflags[x] |= DRIVE_NOLONGNAMES;
     595  }
    572596  if(!strcmp(FileSystem,CDFS)) {
    573597    removable = 1;
Note: See TracChangeset for help on using the changeset viewer.