Changeset 1440
- Timestamp:
- Jul 13, 2009, 6:22:40 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/filldir.c
r1439 r1440 74 74 12 Jul 09 GKY Add szFSType to FillInRecordFromFSA use to bypass EA scan and size formatting 75 75 for tree container 76 13 Jul 09 SHL Avoid trap in FillInRecordFromFSA if pszFSType NULL 76 77 77 78 ***********************************************************************/ … … 725 726 const PFILESTATUS4L pfsa4, 726 727 const BOOL partial, 727 CHAR * szFSType,728 CHAR *pszFSType, // Optional 728 729 DIRCNRDATA *dcd) // Optional 729 730 { … … 738 739 pci->pszFileName = xstrdup(pszFileName, pszSrcFile, __LINE__); 739 740 740 if (pfsa4->cbList > 4L && dcd && *szFSType == 0) 741 // 13 Jul 09 SHL fixme to know if fetch can be bypassed if pszFSType already filled 742 // If FSType not supplied, assume don't need EAs either 743 if (pfsa4->cbList > 4L && dcd && pszFSType) 741 744 FetchCommonEAs(pci); 742 745 … … 798 801 else 799 802 p = pci->pszFileName; 800 if ( szFSType && (fShowFSTypeInTree || fShowDriveLabelInTree)) {803 if (pszFSType && (fShowFSTypeInTree || fShowDriveLabelInTree)) { 801 804 strcpy(szBuf, p); 802 805 strcat(szBuf, " ["); 803 strcat(szBuf, szFSType);806 strcat(szBuf, pszFSType); 804 807 strcat(szBuf, "]"); 805 808 pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__); … … 808 811 pci->pszDisplayName = p; 809 812 810 //comma format the file size for large file support 811 if (*szFSType == 0) { 813 // 13 Jul 09 SHL fixme to know why pszFSType check needed 814 // comma format the file size for large file support 815 if (!pszFSType || *pszFSType == 0) { 812 816 CHAR szBuf[30]; 813 817 CommaFmtULL(szBuf, sizeof(szBuf), pfsa4->cbFile, ' '); … … 958 962 priority_normal(); 959 963 pszFileSpec[strlen(pszFileSpec) - 1] = 0; // Chop off wildcard 960 //*pchEndPath = 0; 964 //*pchEndPath = 0; 961 965 if (!rc) { 962 966 do { … … 1235 1239 CHAR suggest[32]; 1236 1240 CHAR szDrive[] = " :\\"; 1237 CHAR szFSType[CCHMAXPATH]; 1241 CHAR szFSType[CCHMAXPATH]; 1238 1242 FILESTATUS4L fsa4; 1239 1243 APIRET rc; … … 1247 1251 driveflags[x] &= (DRIVE_IGNORE | DRIVE_NOPRESCAN | DRIVE_NOLOADICONS | 1248 1252 DRIVE_NOLOADSUBJS | DRIVE_NOLOADLONGS | 1249 1250 1253 DRIVE_INCLUDEFILES | DRIVE_SLOW | DRIVE_NOSTATS | 1254 DRIVE_WRITEVERIFYOFF); 1251 1255 } 1252 1256 memset(driveserial, -1, sizeof(driveserial)); … … 1268 1272 rc, 1269 1273 HWND_DESKTOP, 1270 1274 pszSrcFile, __LINE__, PCSZ_FILLDIRQCURERRTEXT); 1271 1275 exit(0); 1272 1276 } … … 1301 1305 BOOL FSInfo = FALSE; 1302 1306 struct { 1303 1304 1305 1306 1307 ULONG serial; 1308 CHAR volumelength; 1309 CHAR volumelabel[CCHMAXPATH]; 1310 } volser; 1307 1311 1308 1312 *szDrive = (CHAR)x + 'A'; // Build path spec … … 1320 1324 removable = CheckDrive(*szDrive, szFSType, &ulDriveType); 1321 1325 driveserial[x] = -1; 1322 1323 1324 1325 1326 1327 1328 1326 if (removable != -1) { 1327 DosError(FERR_DISABLEHARDERR); 1328 if (!DosQueryFSInfo((ULONG) x + 1, 1329 FSIL_VOLSER, &volser, sizeof(volser))) { 1330 driveserial[x] = volser.serial; 1331 FSInfo = TRUE; 1332 } 1329 1333 1330 1334 } … … 1353 1357 strcmp(szFSType, NDFS32) && 1354 1358 strcmp(szFSType, RAMFS) && 1355 1359 strcmp(szFSType, NTFS) && 1356 1360 strcmp(szFSType, HPFS386)) { 1357 1361 driveflags[x] |= DRIVE_NOLONGNAMES; … … 1369 1373 if (!(ulDriveType & DRIVE_NOLONGNAMES)) 1370 1374 driveflags[x] &= ~DRIVE_NOLONGNAMES; 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1375 } 1376 if (!fVerifyOffChecked[x]) { 1377 if (driveflags[x] & DRIVE_REMOVABLE) 1378 driveflags[x] |= DRIVE_WRITEVERIFYOFF; 1379 if (!(driveflags[x] & DRIVE_INVALID)) { 1380 CHAR Key[80]; 1381 1382 sprintf(Key, "%c.VerifyOffChecked", (CHAR) (x + 'A')); 1383 fVerifyOffChecked[x] = TRUE; 1384 PrfWriteProfileData(fmprof, appname, Key, &fVerifyOffChecked[x], sizeof(BOOL)); 1385 } 1386 } 1387 if (strcmp(volser.volumelabel, NullStr) != 0 && FSInfo && fShowDriveLabelInTree) 1388 strcpy(szFSType, volser.volumelabel); 1385 1389 pci->rc.flRecordAttr |= CRA_RECORDREADONLY; 1386 1390 if ((ULONG)(toupper(*szDrive) - '@') == ulCurDriveNum) … … 1406 1410 *suggest = '/'; 1407 1411 suggest[1] = 0; 1408 1409 1410 1411 1412 1413 1414 1415 1416 1412 } 1413 1414 sprintf(suggest + strlen(suggest), "%c" , toupper(*szDrive)); 1415 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1416 if (fShowFSTypeInTree || fShowDriveLabelInTree) { 1417 strcat(szDrive, " ["); 1418 strcat(szDrive, szFSType); 1419 strcat(szDrive, "]"); 1420 } 1417 1421 pci->pszDisplayName = xstrdup(szDrive, pszSrcFile, __LINE__); 1418 1422 szDrive[3] = 0; 1419 1423 pci->rc.pszIcon = pci->pszDisplayName; 1420 1424 pci->attrFile = FILE_DIRECTORY; … … 1422 1426 driveserial[x] = -1; 1423 1427 } 1424 1425 1428 else 1429 FillInRecordFromFSA(hwndCnr, pci, szDrive, &fsa4, TRUE, szFSType, NULL); 1426 1430 } 1427 1431 else { 1428 1429 1430 1431 1432 1433 1434 1432 // Removable volume 1433 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1434 if (fShowFSTypeInTree || fShowDriveLabelInTree) { 1435 strcat(szDrive, " ["); 1436 strcat(szDrive, szFSType); 1437 strcat(szDrive, "]"); 1438 } 1435 1439 pci->pszDisplayName = xstrdup(szDrive, pszSrcFile, __LINE__); 1436 1440 szDrive[3] = 0; 1437 1441 pci->rc.pszIcon = pci->pszDisplayName; 1438 1442 pci->attrFile = FILE_DIRECTORY; … … 1447 1451 else { 1448 1452 *szFSType = 0; 1449 1450 1451 1452 1453 1453 pci->rc.hptrIcon = hptrDunno; 1454 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1455 if (fShowFSTypeInTree || fShowDriveLabelInTree) { 1456 strcat(szDrive, " [?]"); 1457 } 1454 1458 pci->pszDisplayName = xstrdup(szDrive, pszSrcFile, __LINE__); 1455 1459 szDrive[3] = 0; 1456 1460 # ifdef FORTIFY 1457 1461 // Will be freed by TreeCnrWndProc WM_DESTROY … … 1466 1470 else { 1467 1471 // diskette drive (A or B) 1468 1469 1470 1471 1472 pci->rc.hptrIcon = hptrFloppy; 1473 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1474 if (fShowFSTypeInTree || fShowDriveLabelInTree) 1475 strcat(szDrive, " [Floppy]"); 1472 1476 pci->pszDisplayName = xstrdup(szDrive, pszSrcFile, __LINE__); 1473 1477 szDrive[3] = 0; 1474 1478 pci->rc.pszIcon = pci->pszDisplayName; 1475 1479 pci->attrFile = FILE_DIRECTORY; … … 1503 1507 { 1504 1508 Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, 1505 1509 GetPString(IDS_CMINSERTERRTEXT)); 1506 1510 } 1507 1511 } … … 1617 1621 CM_QUERYRECORD, 1618 1622 MPVOID, 1619 1623 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 1620 1624 StubbyScanCount ++; 1621 1625 while (pci && (INT)pci != -1) {
Note:
See TracChangeset
for help on using the changeset viewer.