Changeset 1354 for trunk/dll/valid.c


Ignore:
Timestamp:
Dec 25, 2008, 11:43:34 PM (17 years ago)
Author:
Gregg Young
Message:

Added driveflags to over ride write verify for USB removable drives that fail when it is on (Ticket 323); A flag to prevent directory name from being broadcast to drives in the tree cnr prior to a recursive scan of the drive (causes dbl directory names Ticket 321) Add option for multithreaded recursive scan of user selected drives at startup (Ticket 322).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/valid.c

    r1351 r1354  
    6868CHAR *NTFS;
    6969CHAR *RAMFS;
     70BOOL fVerifyOffChecked[26];
    7071
    7172APIRET MakeFullName(char *pszFileName)
     
    598599      strcat(fname, ".");
    599600      ret = DosQueryAppType(fname, &apptype);
    600     }
     601    } //fixme protectonly BMT GKY 23 Dec 08
    601602    if ((!ret && (!apptype ||
    602603                  (apptype &
     
    691692  driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
    692693                    DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS |
    693                     DRIVE_INCLUDEFILES | DRIVE_SLOW | DRIVE_NOSTATS);
     694                    DRIVE_INCLUDEFILES | DRIVE_SLOW | DRIVE_NOSTATS |
     695                    DRIVE_WRITEVERIFYOFF);
    694696  if (removable != -1) {
    695697    struct
     
    751753VOID FillInDriveFlags(VOID * dummy)
    752754{
    753   ULONG ulDriveNum, ulDriveMap;
     755  ULONG ulDriveNum, ulDriveMap, size;
    754756  register INT x;
    755757
     
    757759    driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS |
    758760                      DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS |
    759                       DRIVE_INCLUDEFILES | DRIVE_SLOW | DRIVE_NOSTATS);
     761                      DRIVE_INCLUDEFILES | DRIVE_SLOW | DRIVE_NOSTATS |
     762                      DRIVE_WRITEVERIFYOFF);
    760763  memset(driveserial, -1, sizeof(driveserial));
    761764  DosError(FERR_DISABLEHARDERR);
     
    764767    if (ulDriveMap & (1 << x) && !(driveflags[x] & DRIVE_IGNORE)) {
    765768      {
    766         CHAR s[80];
    767         ULONG flags = 0, size = sizeof(ULONG);
    768 
    769         sprintf(s, "%c.DriveFlags", (CHAR) (x + 'A'));
    770         if (PrfQueryProfileData(fmprof, appname, s, &flags, &size) &&
    771             size == sizeof(ULONG))
    772           driveflags[x] |= flags;
     769        ULONG flags = 0, size = sizeof(ULONG);
     770        CHAR FlagKey[80];
     771
     772          sprintf(FlagKey, "%c.DriveFlags", (CHAR) (x + 'A'));
     773          if (PrfQueryProfileData(fmprof, appname, FlagKey, &flags, &size) &&
     774              size == sizeof(ULONG))
     775            driveflags[x] |= flags;
    773776      }
    774777
     
    795798    if (startdrive)
    796799      driveflags[startdrive - 1] |= DRIVE_BOOT;
     800  }
     801  {
     802    INT x;
     803    CHAR Key[80];
     804
     805    for (x = 2; x < 26; x++) {
     806      sprintf(Key, "%c.VerifyOffChecked", (CHAR) (x + 'A'));
     807      size = sizeof(BOOL);
     808      PrfQueryProfileData(fmprof, appname, Key, &fVerifyOffChecked[x], &size);
     809      if (!fVerifyOffChecked[x]) {
     810        if (driveflags[x] & DRIVE_REMOVABLE)
     811          driveflags[x] |= DRIVE_WRITEVERIFYOFF;
     812        if (!(driveflags[x] & DRIVE_IGNORE | DRIVE_INVALID)) {
     813          fVerifyOffChecked[x] = TRUE;
     814          PrfWriteProfileData(fmprof, appname, Key, &fVerifyOffChecked[x], sizeof(BOOL));
     815        }
     816      }
     817    }
    797818  }
    798819}
Note: See TracChangeset for help on using the changeset viewer.