Changeset 1424 for trunk/dll/filldir.c
- Timestamp:
- Jun 6, 2009, 9:16:12 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/filldir.c
r1402 r1424 108 108 #include "common.h" // IncrThreadUsage 109 109 #include "excputil.h" // xbeginthread 110 #include "fm3dlg.h" // INFO_LABEL 110 111 111 112 VOID StubbyScanThread(VOID * arg); … … 719 720 const PSZ pszFileName, 720 721 const PFILESTATUS4L pfsa4, 721 const BOOL partial, 722 const BOOL partial, 723 CHAR *szFSType, 722 724 DIRCNRDATA *dcd) // Optional 723 725 { … … 725 727 CHAR *p; 726 728 ULONG flags; 729 CHAR szBuf[80]; 727 730 728 731 // fill in a container record from a FILESTATUS4L structure … … 730 733 pci->hwndCnr = hwndCnr; 731 734 pci->pszFileName = xstrdup(pszFileName, pszSrcFile, __LINE__); 732 //strcpy(pci->pszFileName, pszFileName);733 735 flags = driveflags[toupper(*pci->pszFileName) - 'A']; 734 // load the object's Subject, if required 735 //pci->pszSubject = NullStr; 736 if (pfsa4->cbList > 4 && 736 if ((pfsa4->cbList > 4) && 737 737 dcd && 738 738 fLoadSubject && … … 876 876 else 877 877 p = pci->pszFileName; 878 pci->pszDisplayName = p; 878 if (szFSType && (fShowSysType || fShowLabel)) { 879 strcpy(szBuf, p); 880 strcat(szBuf, " ["); 881 strcat(szBuf, szFSType); 882 strcat(szBuf, "]"); 883 pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__); 884 } 885 else 886 pci->pszDisplayName = p; 879 887 880 888 //comma format the file size for large file support … … 1244 1252 while (pci && (INT)pci != -1) { 1245 1253 if ((pci->attrFile & FILE_DIRECTORY)) 1246 //if (fInitialDriveScan)1254 if (!fInitialDriveScan) 1247 1255 Stubby(hwndCnr, pci); 1248 /*else {1256 else { 1249 1257 while (StubbyScanCount != 0) 1250 1258 DosSleep(50); 1251 1259 Stubby(hwndCnr, pci); 1252 } */1260 } 1253 1261 //Stubby(hwndCnr, pci); 1254 1262 pci = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci), … … 1302 1310 CHAR suggest[32]; 1303 1311 CHAR szDrive[] = " :\\"; 1304 CHAR szFSType[CCHMAXPATH]; 1312 CHAR szFSType[CCHMAXPATH]; 1305 1313 FILESTATUS4L fsa4; 1306 1314 APIRET rc; … … 1366 1374 ULONG flags = 0; 1367 1375 ULONG size = sizeof(ULONG); 1376 BOOL FSInfo = FALSE; 1377 struct { 1378 ULONG serial; 1379 CHAR volumelength; 1380 CHAR volumelabel[CCHMAXPATH]; 1381 } volser; 1368 1382 1369 1383 *szDrive = (CHAR)x + 'A'; // Build path spec … … 1381 1395 removable = CheckDrive(*szDrive, szFSType, &ulDriveType); 1382 1396 driveserial[x] = -1; 1383 if (removable != -1) { 1384 struct { 1385 ULONG serial; 1386 CHAR volumelength; 1387 CHAR volumelabel[CCHMAXPATH]; 1388 } volser; 1389 1390 DosError(FERR_DISABLEHARDERR); 1391 if (!DosQueryFSInfo((ULONG) x, 1392 FSIL_VOLSER, &volser, sizeof(volser))) { 1393 driveserial[x] = volser.serial; 1394 } 1397 if (removable != -1) { 1398 DosError(FERR_DISABLEHARDERR); 1399 if (!DosQueryFSInfo((ULONG) x + 1, 1400 FSIL_VOLSER, &volser, sizeof(volser))) { 1401 driveserial[x] = volser.serial; 1402 FSInfo = TRUE; 1403 } 1404 1395 1405 } 1396 1406 else … … 1398 1408 1399 1409 memset(&fsa4, 0, sizeof(FILESTATUS4L)); 1400 driveflags[x] |= removable == -1 || removable == 1 ? 1401 DRIVE_REMOVABLE : 0; 1410 driveflags[x] |= removable == -1 || removable == 1 ? DRIVE_REMOVABLE : 0; 1402 1411 if (ulDriveType & DRIVE_REMOTE) 1403 1412 driveflags[x] |= DRIVE_REMOTE; … … 1447 1456 } 1448 1457 } 1458 if (strcmp(volser.volumelabel, "") != 0 && FSInfo && fShowLabel) 1459 strcpy(szFSType, volser.volumelabel); 1449 1460 pci->rc.flRecordAttr |= CRA_RECORDREADONLY; 1450 1461 if ((ULONG)(toupper(*szDrive) - '@') == ulCurDriveNum) … … 1471 1482 *suggest = '/'; 1472 1483 suggest[1] = 0; 1473 } 1474 sprintf(suggest + strlen(suggest), "%c" , toupper(*szDrive)); 1475 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1476 pci->pszDisplayName = pci->pszFileName; 1484 } 1485 1486 sprintf(suggest + strlen(suggest), "%c" , toupper(*szDrive)); 1487 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1488 if (fShowSysType || fShowLabel) { 1489 strcat(szDrive, " ["); 1490 strcat(szDrive, szFSType); 1491 strcat(szDrive, "]"); 1492 } 1493 pci->pszDisplayName = xstrdup(szDrive, pszSrcFile, __LINE__); 1494 szDrive[3] = 0; 1477 1495 pci->rc.pszIcon = pci->pszDisplayName; 1478 1496 pci->attrFile = FILE_DIRECTORY; … … 1480 1498 driveserial[x] = -1; 1481 1499 } 1482 1483 FillInRecordFromFSA(hwndCnr, pci, szDrive, &fsa4, TRUE, NULL);1500 else 1501 FillInRecordFromFSA(hwndCnr, pci, szDrive, &fsa4, TRUE, szFSType, NULL); 1484 1502 } 1485 1503 else { 1486 // Removable volume 1487 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1488 pci->pszDisplayName = pci->pszFileName; 1504 // Removable volume 1505 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1506 if (fShowSysType || fShowLabel) { 1507 strcat(szDrive, " ["); 1508 strcat(szDrive, szFSType); 1509 strcat(szDrive, "]"); 1510 } 1511 pci->pszDisplayName = xstrdup(szDrive, pszSrcFile, __LINE__); 1512 szDrive[3] = 0; 1489 1513 pci->rc.pszIcon = pci->pszDisplayName; 1490 1514 pci->attrFile = FILE_DIRECTORY; … … 1498 1522 } 1499 1523 else { 1500 pci->rc.hptrIcon = hptrDunno; 1501 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1524 pci->rc.hptrIcon = hptrDunno; 1525 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1526 if (fShowSysType || fShowLabel) { 1527 strcat(szDrive, " ["); 1528 strcat(szDrive, szFSType); 1529 strcat(szDrive, "]"); 1530 } 1531 pci->pszDisplayName = xstrdup(szDrive, pszSrcFile, __LINE__); 1532 szDrive[3] = 0; 1502 1533 # ifdef FORTIFY 1503 1534 // Will be freed by TreeCnrWndProc WM_DESTROY 1504 1535 Fortify_SetScope(pci->pszFileName, 2); 1505 1536 # endif 1506 pci->pszDisplayName = pci->pszFileName; 1507 pci->rc.pszIcon = pci->pszFileName; 1537 pci->rc.pszIcon = pci->pszDisplayName; 1508 1538 pci->attrFile = FILE_DIRECTORY; 1509 1539 pci->pszDispAttr = FileAttrToString(pci->attrFile); … … 1513 1543 else { 1514 1544 // diskette drive (A or B) 1515 pci->rc.hptrIcon = hptrFloppy; 1516 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1517 pci->pszDisplayName = pci->pszFileName; 1545 pci->rc.hptrIcon = hptrFloppy; 1546 pci->pszFileName = xstrdup(szDrive, pszSrcFile, __LINE__); 1547 if (fShowSysType || fShowLabel) 1548 strcat(szDrive, " [Floppy]"); 1549 pci->pszDisplayName = xstrdup(szDrive, pszSrcFile, __LINE__); 1550 szDrive[3] = 0; 1518 1551 pci->rc.pszIcon = pci->pszDisplayName; 1519 1552 pci->attrFile = FILE_DIRECTORY;
Note:
See TracChangeset
for help on using the changeset viewer.