Changeset 552 for trunk/dll/valid.c


Ignore:
Timestamp:
Mar 1, 2007, 7:24:47 AM (18 years ago)
Author:
Gregg Young
Message:

font cleanup; new image and archiver masks; messages moved to string file; new drive flags including David's icons mostly working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/valid.c

    r551 r552  
    2020  22 Oct 06 GKY Add NDFS32 support
    2121  22 Oct 06 GKY Increased BUFFER_BYTES in CheckDrive to 8192 to fix NDFS32 scan failure
     22  07 Jan 07 GKY Move error strings etc. to string file
     23  18 Feb 07 GKY Add more drive types and icons
    2224
    2325***********************************************************************/
     
    210212
    211213# define BUFFER_BYTES 8192
    212   rc =
    213     DosAllocMem(&pvBuffer, BUFFER_BYTES,
     214  rc = DosAllocMem(&pvBuffer, BUFFER_BYTES,
    214215                PAG_COMMIT | OBJ_TILE | PAG_READ | PAG_WRITE);
    215216  if (rc) {
     
    242243  }
    243244
    244   if (pulType && !strcmp(pfsn, CDFS))
     245  if (pulType && (!strcmp(pfsn, CDFS) || !strcmp(pfsn, ISOFS)))
    245246    *pulType |= DRIVE_NOTWRITEABLE | DRIVE_CDROM | DRIVE_REMOVABLE;
    246 
    247   if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV) {
     247  if (pulType && !strcmp(pfsn, NDFS32)){
     248        *pulType |= DRIVE_VIRTUAL;
     249    }
     250  if (pulType && !strcmp(pfsn, RAMFS)){
     251        *pulType |= DRIVE_RAMDISK;
     252    }
     253  if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV &&
     254      (strcmp(pfsn, CDFS) && strcmp(pfsn, ISOFS))) {
    248255    if (pulType)
    249256      *pulType |= DRIVE_REMOTE;
     257
    250258    if (pulType && !strcmp(pfsn, CBSIFS)) {
    251259      *pulType |= DRIVE_ZIPSTREAM;
     
    261269            *pulType &= ~DRIVE_NOLONGNAMES;
    262270        }
     271
    263272      }
    264273    }
     
    267276         !strcmp(pfsn, JFS) ||
    268277         !strcmp(pfsn, FAT32) ||
    269          !strcmp(pfsn, NDFS32) || !strcmp(pfsn, HPFS386))) {
     278         !strcmp(pfsn, RAMFS) ||
     279         !strcmp(pfsn, NDFS32) ||
     280         !strcmp(pfsn, HPFS386))) {
    270281      *pulType &= ~DRIVE_NOLONGNAMES;
    271282    }
     283
    272284    DosFreeMem(pvBuffer);
    273285    return 0;                           // Remotes are non-removable
     
    278290      strcmp(pfsn, JFS) &&
    279291      strcmp(pfsn, CDFS) &&
    280       strcmp(pfsn, FAT32) && strcmp(pfsn, NDFS32) && strcmp(pfsn, HPFS386)) {
     292      strcmp(pfsn, ISOFS) &&
     293      strcmp(pfsn, RAMFS) &&
     294      strcmp(pfsn, FAT32) &&
     295      strcmp(pfsn, NDFS32) &&
     296      strcmp(pfsn, HPFS386)) {
    281297    if (pulType)
    282298      (*pulType) |= DRIVE_NOLONGNAMES;  // Others can not have long names
    283299  }
     300
    284301
    285302  DosError(FERR_DISABLEHARDERR);
     
    543560      }
    544561    }
     562     else if (*argv[x] == '`' && isalpha(argv[x][1])) {
     563
     564      CHAR *p = &argv[x][1];
     565
     566      while (isalpha(*p)) {
     567        driveflags[toupper(*p) - 'A'] |= DRIVE_NOSTATS;
     568        p++;
     569      }
     570    }
    545571    else if (*argv[x] == ',' && isalpha(argv[x][1])) {
    546572
     
    552578      }
    553579    }
    554     else if (*argv[x] == '`' && isalpha(argv[x][1])) {
     580    else if (*argv[x] == '-' && isalpha(argv[x][1])) {
    555581
    556582      CHAR *p = &argv[x][1];
     
    586612  driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
    587613                    DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS |
    588                     DRIVE_INCLUDEFILES | DRIVE_SLOW);
     614                    DRIVE_INCLUDEFILES | DRIVE_SLOW | DRIVE_NOSTATS);
    589615  if (removable != -1) {
    590616    struct
     
    608634  if (drvtype & DRIVE_REMOTE)
    609635    driveflags[x] |= DRIVE_REMOTE;
     636  if(!stricmp(FileSystem,NDFS32)){
     637    driveflags[x] |= DRIVE_VIRTUAL;
     638    driveflags[x] &= (~DRIVE_REMOTE);
     639  }
     640  if(!stricmp(FileSystem,RAMFS)){
     641    driveflags[x] |= DRIVE_RAMDISK;
     642    driveflags[x] &= (~DRIVE_REMOTE);
     643  }
    610644  if (strcmp(FileSystem, HPFS) &&
    611645      strcmp(FileSystem, JFS) &&
    612646      strcmp(FileSystem, CDFS) &&
    613       strcmp(FileSystem, FAT32) && strcmp(FileSystem, HPFS386)) {
     647      strcmp(FileSystem, ISOFS) &&
     648      strcmp(FileSystem, RAMFS) &&
     649      strcmp(FileSystem, FAT32) &&
     650      strcmp(FileSystem, HPFS386)) {
    614651    driveflags[x] |= DRIVE_NOLONGNAMES;
    615652  }
    616   if (!strcmp(FileSystem, CDFS)) {
     653
     654  if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS)) {
    617655    removable = 1;
    618656    driveflags[x] |= (DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | DRIVE_CDROM);
     
    636674    driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
    637675                      DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS |
    638                       DRIVE_INCLUDEFILES | DRIVE_SLOW);
     676                      DRIVE_INCLUDEFILES | DRIVE_SLOW | DRIVE_NOSTATS);
    639677  memset(driveserial, -1, sizeof(driveserial));
    640678  DosError(FERR_DISABLEHARDERR);
     
    737775  *pp = ' ';
    738776  pp++;
     777  *pp = '-';
     778  pp[1] = 0;
     779  p = pp + 1;
     780  if (pp) {
     781    for (x = 0; x < 26; x++) {
     782      if ((driveflags[x] & DRIVE_NOLOADSUBJS) != 0) {
     783        *p = (CHAR) x + 'A';
     784        p++;
     785        *p = 0;
     786      }
     787    }
     788  }
     789  if (!pp[1])
     790    *pp = 0;
     791  pp = &s[strlen(s)];
     792  *pp = ' ';
     793  pp++;
    739794  *pp = '`';
    740795  pp[1] = 0;
     
    742797  if (pp) {
    743798    for (x = 0; x < 26; x++) {
    744       if ((driveflags[x] & DRIVE_NOLOADSUBJS) != 0) {
     799      if ((driveflags[x] & DRIVE_NOSTATS) != 0) {
    745800        *p = (CHAR) x + 'A';
    746801        p++;
     
    871926    }
    872927    if (!*objectpath) {
    873       // Fall back - fixme to work for NLS
     928      // Fall back
    874929      DosError(FERR_DISABLEHARDERR);
    875930      DosQuerySysInfo(QSV_BOOT_DRIVE, QSV_BOOT_DRIVE,
    876931                      (PVOID) & startdrive, (ULONG) sizeof(ULONG));
    877       sprintf(objectpath, "%c:\\DESKTOP", ((CHAR) startdrive) + '@');
    878     }
    879   }
    880 }
     932      sprintf(objectpath, GetPString(IDS_PATHTODESKTOP), ((CHAR) startdrive) + '@');
     933    }
     934  }
     935}
Note: See TracChangeset for help on using the changeset viewer.