Changeset 1444 for trunk/dll/valid.c
- Timestamp:
- Jul 23, 2009, 1:24:23 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/valid.c
r1439 r1444 36 36 08 Mar 09 GKY Additional strings move to PCSZs 37 37 12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory 38 22 Jul 09 GKY Consolidated driveflag setting code in DriveFlagsOne 39 22 Jul 09 GKY Check if drives support EAs add driveflag for this 40 22 Jul 09 GKY Add LocalHD driveflag 41 22 Jul 09 GKY Streamline scanning code for faster Tree rescans 38 42 39 43 ***********************************************************************/ … … 79 83 PCSZ RAMFS = "RAMFS"; 80 84 PCSZ NTFS = "NTFS"; 85 PCSZ LAN = "LAN"; 81 86 BOOL fVerifyOffChecked[26]; 82 87 … … 256 261 INT CheckDrive(CHAR chDrive, CHAR * pszFileSystem, ULONG * pulType) 257 262 { 258 CHAR szPath[ 3];263 CHAR szPath[4]; 259 264 VOID *pvBuffer = NULL; 260 265 CHAR *pfsn; … … 266 271 ULONG clDataBytes; 267 272 HFILE hDev; 273 EASIZEBUF easize = {0}; 274 ULONG ulDataLen = sizeof(EASIZEBUF); 275 ULONG ulParmLen = 0; 268 276 269 277 # pragma pack(1) … … 322 330 pfsn = (PCHAR)(pfsq->szName) + pfsq->cbName + 1; 323 331 pfsd = pfsn + pfsq->cbFSDName + 1; 332 strupr(pfsn); 324 333 325 334 if (pszFileSystem) { … … 327 336 pszFileSystem[CCHMAXPATH - 1] = 0; 328 337 } 329 338 szPath[2] = '\\'; 339 szPath[3] = 0; 340 DosFSCtl(&easize, sizeof(EASIZEBUF), &ulDataLen, NULL, ulParmLen, 341 &ulParmLen, FSCTL_MAX_EASIZE, szPath, -1, FSCTL_PATHNAME); 342 //DbgMsg(pszSrcFile, __LINE__, "%i %i %s %s", easize.cbMaxEASize, easize.cbMaxEAListSize, szPath, pfsn); 343 szPath[2] = 0; 344 if (pulType && easize.cbMaxEASize == 0) 345 *pulType |= DRIVE_NOEASUPPORT; 330 346 if (pulType && (!strcmp(pfsn, CDFS) || !strcmp(pfsn, ISOFS))) 331 347 *pulType |= DRIVE_NOTWRITEABLE | DRIVE_CDROM | DRIVE_REMOVABLE; 332 348 if (pulType && !strcmp(pfsn, NTFS)) 333 349 *pulType |= DRIVE_NOTWRITEABLE; … … 338 354 *pulType |= DRIVE_RAMDISK; 339 355 } 340 if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV && 341 (strcmp(pfsn, CDFS) || strcmp(pfsn, ISOFS))) { 356 if (((PFSQBUFFER2) pvBuffer)->iType == FSAT_REMOTEDRV) { 342 357 if (pulType) 343 358 *pulType |= DRIVE_REMOTE; … … 360 375 } 361 376 if (pulType && 362 (!strcmp(pfsn, HPFS) || 363 !strcmp(pfsn, JFS) || 364 !strcmp(pfsn, FAT32) || 377 (!strcmp(pfsn, LAN) || 365 378 !strcmp(pfsn, RAMFS) || 366 !strcmp(pfsn, NDFS32) || 367 !strcmp(pfsn, NTFS) || 368 !strcmp(pfsn, HPFS386))) { 379 !strcmp(pfsn, NDFS32))) { 369 380 *pulType &= ~DRIVE_NOLONGNAMES; 370 381 } … … 376 387 // Local drive 377 388 if (strcmp(pfsn, HPFS) && 378 strcmp(pfsn, JFS) &&379 389 strcmp(pfsn, CDFS) && 380 390 strcmp(pfsn, ISOFS) && 381 strcmp(pfsn, RAMFS) &&391 strcmp(pfsn, JFS) && 382 392 strcmp(pfsn, FAT32) && 383 strcmp(pfsn, NDFS32) &&384 393 strcmp(pfsn, NTFS) && 385 394 strcmp(pfsn, HPFS386)) { … … 387 396 (*pulType) |= DRIVE_NOLONGNAMES; // Others can not have long names 388 397 } 389 390 398 391 399 DosError(FERR_DISABLEHARDERR); … … 725 733 } 726 734 727 VOID DriveFlagsOne(INT x )735 VOID DriveFlagsOne(INT x, CHAR *FileSystem, VOID *volser) 728 736 { 729 737 INT removable; 730 CHAR szDrive[] = " :\\" , FileSystem[CCHMAXPATH];738 CHAR szDrive[] = " :\\"; 731 739 ULONG drvtype; 732 740 … … 735 743 drvtype = 0; 736 744 removable = CheckDrive(*szDrive, FileSystem, &drvtype); 745 strupr(FileSystem); 737 746 driveserial[x] = -1; 738 747 driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS | … … 741 750 DRIVE_WRITEVERIFYOFF); 742 751 if (removable != -1) { 743 struct 744 { 745 ULONG serial; 746 CHAR volumelength; 747 CHAR volumelabel[CCHMAXPATH]; 748 } 749 volser; 750 751 DosError(FERR_DISABLEHARDERR); 752 if (!DosQueryFSInfo((ULONG) x + 1, FSIL_VOLSER, &volser, sizeof(volser))) 753 driveserial[x] = volser.serial; 754 else 752 if (!volser) { 753 struct 754 { 755 ULONG serial; 756 CHAR volumelength; 757 CHAR volumelabel[CCHMAXPATH]; 758 } 759 volserl; 760 755 761 DosError(FERR_DISABLEHARDERR); 762 if (!DosQueryFSInfo((ULONG) x + 1, FSIL_VOLSER, &volserl, sizeof(volserl))) 763 driveserial[x] = volserl.serial; 764 else 765 DosError(FERR_DISABLEHARDERR); 766 } 767 else { 768 DosError(FERR_DISABLEHARDERR); 769 if (DosQueryFSInfo((ULONG) x + 1, FSIL_VOLSER, volser, 770 sizeof(ULONG) + sizeof(CHAR) + CCHMAXPATH)) 771 DosError(FERR_DISABLEHARDERR); 772 } 756 773 } 757 774 else 758 775 driveflags[x] |= DRIVE_INVALID; 759 driveflags[x] |= ((removable == -1 || removable == 1) ? 760 DRIVE_REMOVABLE : 0); 776 driveflags[x] |= ((removable == -1 || removable == 1) ? DRIVE_REMOVABLE : 0); 761 777 if (drvtype & DRIVE_REMOTE) 762 778 driveflags[x] |= DRIVE_REMOTE; 763 if(!stricmp(FileSystem,NDFS32)){ 779 if (drvtype & DRIVE_NOEASUPPORT) 780 driveflags[x] |= DRIVE_NOEASUPPORT; 781 if(!strcmp(FileSystem,NDFS32)){ 764 782 driveflags[x] |= DRIVE_VIRTUAL; 765 783 driveflags[x] &= (~DRIVE_REMOTE); 766 784 } 767 if(!str icmp(FileSystem,RAMFS)){785 if(!strcmp(FileSystem,RAMFS)){ 768 786 driveflags[x] |= DRIVE_RAMDISK; 769 787 driveflags[x] &= (~DRIVE_REMOTE); 770 788 } 771 if(!str icmp(FileSystem,NTFS))789 if(!strcmp(FileSystem,NTFS)) 772 790 driveflags[x] |= DRIVE_NOTWRITEABLE; 773 791 if (strcmp(FileSystem, HPFS) && 774 strcmp(FileSystem, JFS) &&775 792 strcmp(FileSystem, CDFS) && 776 793 strcmp(FileSystem, ISOFS) && 794 strcmp(FileSystem, JFS) && 795 strcmp(FileSystem, LAN) && 777 796 strcmp(FileSystem, RAMFS) && 778 797 strcmp(FileSystem, FAT32) && … … 782 801 driveflags[x] |= DRIVE_NOLONGNAMES; 783 802 } 784 803 if ((!strcmp(FileSystem, HPFS) || 804 !strcmp(FileSystem, JFS) || 805 !strcmp(FileSystem, FAT32) || 806 !strcmp(FileSystem, NTFS) || 807 !strcmp(FileSystem, HPFS386)) && ~driveflags[x] & DRIVE_REMOVABLE) { 808 driveflags[x] |= DRIVE_LOCALHD; 809 } 785 810 if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS)) { 786 removable = 1;787 811 driveflags[x] |= (DRIVE_REMOVABLE | DRIVE_NOTWRITEABLE | DRIVE_CDROM); 788 812 } 789 if (!str icmp(FileSystem, CBSIFS)) {813 if (!strcmp(FileSystem, CBSIFS)) { 790 814 driveflags[x] |= DRIVE_ZIPSTREAM; 791 815 driveflags[x] &= (~DRIVE_REMOTE); … … 823 847 824 848 if (x > 1) { 825 if (!(driveflags[x] & DRIVE_NOPRESCAN)) 826 DriveFlagsOne(x); 849 if (!(driveflags[x] & DRIVE_NOPRESCAN)) { 850 CHAR FileSystem[CCHMAXPATH]; 851 DriveFlagsOne(x, FileSystem, NULL); 852 } 827 853 else 828 854 driveserial[x] = -1;
Note:
See TracChangeset
for help on using the changeset viewer.