Changeset 1856
- Timestamp:
- Aug 18, 2015, 7:12:52 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 13 edited
-
HISTORY (modified) (1 diff)
-
dll/dircnrs.c (modified) (24 diffs)
-
dll/filldir.c (modified) (29 diffs)
-
dll/flesh.c (modified) (24 diffs)
-
dll/flesh.h (modified) (3 diffs)
-
dll/init.c (modified) (10 diffs)
-
dll/init.h (modified) (3 diffs)
-
dll/listutil.c (added)
-
dll/listutil.h (added)
-
dll/mainwnd.c (modified) (13 diffs)
-
dll/mainwnd.h (modified) (3 diffs)
-
dll/mainwnd2.c (modified) (4 diffs)
-
dll/makefile (modified) (3 diffs)
-
dll/treecnr.c (modified) (62 diffs)
-
dll/update.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/HISTORY
r1807 r1856 1 1 New stuff at the top. This list is not necessarily complete. 2 3 3.24 4 o Rework Flesh/Stubby logic to avoid doing work on thread 1 5 o Add generic linked list support routines 2 6 3 7 3.23 -
trunk/dll/dircnrs.c
r1838 r1856 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 201 0Steven H. Levine9 Copyright (c) 2001, 2015 Steven H. Levine 10 10 11 11 16 Oct 02 SHL Handle large partitions … … 85 85 22 Feb 14 GKY Fix warn readonly yes don't ask to work when recursing directories. 86 86 02 Mar 14 GKY Speed up intial drive scans Ticket 528 87 26 Jun 14 SHL Rework DirObjWndProc UM_RESCAN to avoid hanging FM/2 Lite when tree hidden87 26 Jun 14 SHL Rework DirObjWndProc UM_RESCAN to avoid hanging FM/2 Lite when tree hidden 88 88 30 Aug 14 GKY Add semaphore hmtxFiltering to prevent freeing dcd while filtering. Prevents 89 89 a trap when FM2 is shutdown while directory containers are still populating … … 92 92 02 Aug 15 GKY Remove unneed SubbyScan code and improve suppression of blank lines and 93 93 duplicate subdirectory name caused by running Stubby in worker threads. 94 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 94 95 95 96 ***********************************************************************/ … … 139 140 // SpecialSelect2 140 141 #include "dirsize.h" // DirSizeProc 141 #include "flesh.h" // Flesh, Stubby, UnFlesh142 #include "flesh.h" // AddFleshWorkRequest 142 143 #include "valid.h" // IsValidDir 143 144 #include "objwin.h" // MakeObjWin … … 766 767 # ifdef FORTIFY 767 768 Fortify_BecomeOwner(dcd); // We free dcd 768 if (GetTidForThread() != 1)769 Fortify_ChangeScope(dcd, -1);769 if (GetTidForThread()) 770 Fortify_ChangeScope(dcd, -1); 770 771 # endif 771 772 // set unique id … … 779 780 # ifdef FORTIFY 780 781 // TID 1 will free data 781 if (GetTidForThread() != 1)782 if (GetTidForThread()) 782 783 Fortify_LeaveScope(); 783 784 # endif … … 844 845 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 845 846 if (!pciC) { 846 Stubby(dcd->hwndCnr, pci);847 AddFleshWorkRequest(dcd->hwndCnr, pci, eStubby); 847 848 } 848 849 } … … 899 900 // 2014-06-26 SHL FM/2 Lite may not have drive tree yet 900 901 if (hwndTree) { 902 // 2015-08-12 SHL Optimze to update drive tree for only last saved state 903 904 // 2015-08-13 SHL 905 if (fSwitchTreeOnDirChg) 906 DbgMsg(pszSrcFile, __LINE__, "DirObjWndProc UM_RESCAN cDirectoriesRestored %u", cDirectoriesRestored); // 2015-08-04 SHL FIXME debug 907 901 908 if (fSwitchTreeOnDirChg) { 902 909 // Keep drive tree in sync with directory container 903 910 PSZ pszTempDir; 911 #if 0 // 2015-08-12 SHL FIXME to be gone fInitialDriveScan 904 912 while (fInitialDriveScan) 905 DosSleep(10); // Allow to complete 906 DosSleep(50); 913 DosSleep(500); // Allow to complete 914 DosSleep(200); // Allow to complete 915 #endif 907 916 pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 908 917 if (pszTempDir) { 909 918 if (hwndMain) { 910 if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame) 919 if (TopWindow(hwndMain, (HWND)0) == dcd->hwndFrame) { 920 DbgMsg(pszSrcFile, __LINE__, "DirObjWndProc UM_RESCAN PostMsg(UM_SHOWME)"); // 2015-08-04 SHL FIXME debug 911 921 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 912 922 free(pszTempDir); 923 } 913 924 } 914 925 else { 926 DbgMsg(pszSrcFile, __LINE__, "DirObjWndProc UM_RESCAN PostMsg(UM_SHOWME)"); // 2015-08-04 SHL FIXME debug 915 927 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 916 928 free(pszTempDir); … … 1229 1241 0, 1230 1242 0, 1231 SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER);1243 SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER); 1232 1244 FreeList(dcd->lastselection); 1233 1245 WinSetWindowPtr(dcd->hwndCnr, QWL_USER, NULL); // 13 Apr 10 SHL Set NULL before freeing dcd … … 1421 1433 LastDir = hwnd; 1422 1434 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1435 // 2015-08-13 SHL 1423 1436 if (fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) { 1424 1437 PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 1438 DbgMsg(pszSrcFile, __LINE__, "DirCnrWndProc WM_SETFOCUS cDirectoriesRestored %u", cDirectoriesRestored); // 2015-08-04 SHL FIXME debug 1425 1439 if (pszTempDir) { 1440 DbgMsg(pszSrcFile, __LINE__, "DirCnrWndProc WM_SETFOCUS PostMsg(UM_SHOWME, %s)", pszTempDir); // 2015-08-04 SHL FIXME debug 1426 1441 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID)) 1427 1442 free(pszTempDir); // Failed … … 1490 1505 cnri.pszCnrTitle = dcd->directory; 1491 1506 WinSendMsg(hwnd, 1492 CM_SETCNRINFO, MPFROMP(&cnri), MPFROMLONG(CMA_CNRTITLE));1507 CM_SETCNRINFO, MPFROMP(&cnri), MPFROMLONG(CMA_CNRTITLE)); 1493 1508 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 1494 1509 dcd->totalfiles = cnri.cRecords; … … 1569 1584 WinSendMsg(hwnd, 1570 1585 CM_QUERYCNRINFO, 1571 MPFROMP(&cnri), MPFROMLONG(sizeof(CNRINFO)));1586 MPFROMP(&cnri), MPFROMLONG(sizeof(CNRINFO))); 1572 1587 cnri.pSortRecord = (PVOID) SortDirCnr; 1573 1588 WinSendMsg(hwnd, … … 1596 1611 cnri.flWindowAttr &= (~(CV_TREE | CV_ICON | CV_DETAIL | CV_TEXT)); 1597 1612 cnri.flWindowAttr |= (CV_NAME | CA_DETAILSVIEWTITLES | CV_MINI | 1598 CV_FLOW);1613 CV_FLOW); 1599 1614 cnri.pSortRecord = (PVOID) SortDirCnr; 1600 1615 … … 1653 1668 WinEnableMenuItem(DirCnrMenu, IDM_FINDINTREE, (hwndTree != (HWND) 0)); 1654 1669 } 1655 // 2014-06-11 SHL fm/2 lite can get here before drive scan completes 1656 //if (!fInitialDriveScan) // 2014-08-30 GKY This doesn't seem to be needed 1657 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 1670 // 2014-06-11 SHL fm/2 lite can get here before drive scan completes - may not be true anymore 1671 PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID); 1658 1672 } 1659 1673 else { … … 1963 1977 1964 1978 if (pszTempDir) { 1979 DbgMsg(pszSrcFile, __LINE__, "DirCnrWndProc IDM_FINDINTREE PostMsg(UM_SHOWME)"); // 2015-08-04 SHL FIXME debug 1965 1980 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), 1966 1981 MPFROMLONG(1L))) … … 2128 2143 dcd->sortFlags |= SORT_REVERSE; 2129 2144 break; 2130 }2145 } 2131 2146 WinSendMsg(hwnd, CM_SORTRECORD, MPFROMP(SortDirCnr), 2132 2147 MPFROMLONG(dcd->sortFlags)); … … 2728 2743 case IDM_PRINT: 2729 2744 case IDM_SHADOW: 2730 case IDM_SHADOW2:2731 case IDM_JAVAEXE:2745 case IDM_SHADOW2: 2746 case IDM_JAVAEXE: 2732 2747 case IDM_OBJECT: 2733 2748 case IDM_VIEW: … … 2847 2862 DosBeep(250,100); 2848 2863 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 2849 UnFlesh(hwnd, pci);2864 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2850 2865 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2851 2866 } … … 2855 2870 driveserial[toupper(*pci->pszFileName) - 'A'] != 2856 2871 volser.serial) 2857 UnFlesh(hwnd, pci);2872 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2858 2873 if (SHORT2FROMMP(mp1) != CN_COLLAPSETREE || 2859 2874 (!volser.serial || 2860 2875 driveserial[toupper(*pci->pszFileName) - 'A'] != 2861 2876 volser.serial)) { 2862 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && Flesh(hwnd, pci) && 2877 // 2015-08-07 SHL FIXME to wait for Flesh to finish before PostMsg 2878 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && AddFleshWorkRequest(hwnd, pci, eFlesh) && 2863 2879 !dcd->suspendview && fTopDir ) { 2864 2880 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); … … 2870 2886 } 2871 2887 else if (SHORT2FROMMP(mp1) == CN_EXPANDTREE) { 2872 if (Flesh(hwnd, pci) && !dcd->suspendview && fTopDir) { 2888 if (AddFleshWorkRequest(hwnd, pci, eFlesh) && !dcd->suspendview && fTopDir) { 2889 // 2015-08-07 SHL FIXME to wait for Flesh to finish before PostMsg 2873 2890 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); 2874 2891 //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); … … 3275 3292 else { 3276 3293 3277 MRESULT mre;3278 3279 mre = CnrDirectEdit(hwnd, msg, mp1, mp2);3294 MRESULT mre; 3295 3296 mre = CnrDirectEdit(hwnd, msg, mp1, mp2); 3280 3297 if (mre != (MRESULT) - 1) 3281 3298 return mre; … … 3530 3547 WinSendMsg(hwnd, WM_SAVEAPPLICATION, MPVOID, MPVOID); 3531 3548 if (LastDir == hwnd) 3532 LastDir = (HWND) 0;3549 LastDir = (HWND) 0; 3533 3550 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 3534 3551 if (dcd) { … … 3549 3566 0, 3550 3567 0, 3551 SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER);3568 SWP_RESTORE | SWP_SHOW | SWP_ACTIVATE | SWP_ZORDER); 3552 3569 FreeList(dcd->lastselection); 3553 3570 WinSetWindowPtr(hwnd, QWL_USER, NULL); … … 3821 3838 Win_Error(hwndClient, hwndClient, pszSrcFile, __LINE__, 3822 3839 PCSZ_WINCREATEWINDOW); 3823 PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID);3824 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);3825 free(dcd);3826 DosReleaseMutexSem(hmtxFiltering);3840 PostMsg(hwndClient, WM_CLOSE, MPVOID, MPVOID); 3841 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 3842 free(dcd); 3843 DosReleaseMutexSem(hmtxFiltering); 3827 3844 hwndFrame = (HWND) 0; 3828 3845 } -
trunk/dll/filldir.c
r1838 r1856 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 201 1Steven H. Levine9 Copyright (c) 2001, 2015 Steven H. Levine 10 10 11 11 10 Jan 04 SHL ProcessDirectory: avoid most large drive failures … … 56 56 24 Nov 08 GKY Replace 4 pass drive scan code with StubyScanThread multithread scan 57 57 28 Nov 08 SHL FreeCnrItemData: optimize and always NULL pointers 58 28 Nov 08 SHL Stubby ScanThread: add else lost in translation59 30 Nov 08 SHL Stubby ScanThread: restore else - we want all drives listed58 28 Nov 08 SHL StubbyThread: add else lost in translation 59 30 Nov 08 SHL StubbyThread: restore else - we want all drives listed 60 60 30 Nov 08 SHL FreeCnrItemData: report double free with Runtime_Error 61 61 04 Dec 08 GKY Use event semaphore to prevent scan of "last" directory container prior to … … 98 98 responsiveness when closing containers with large numbers of items 99 99 12 Jun 11 GKY Replaced SleepIfNeeded with IdleIfNeeded in the container loade loop 100 22 Oct 11 GKY Removing unneeded UnFlesh call from Stubby ScanThread appears to significantly speed opening of FM/2100 22 Oct 11 GKY Removing unneeded UnFlesh call from StubbyThread appears to significantly speed opening of FM/2 101 101 02 Mar 14 GKY !didone for fFirstTime so the suggest code works again. Also clear out the 102 102 garbage that was appearing in the string. … … 111 111 02 Aug 15 GKY Serialize local hard drive scanning to reduce drive thrashing continue to scan 112 112 all other drive types in separate threads. 113 02 Aug 15 GKY Remove unneed SubbyScan code and improve suppression of blank lines and113 02 Aug 15 GKY Remove unneeded SubbyScan code and improve suppression of blank lines and 114 114 duplicate subdirectory name caused by running Stubby in worker threads. 115 04 Aug 15 SHL Comments 116 04 Aug 15 SHL Move StubbyThread to flesh.c 117 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 115 118 116 119 ***********************************************************************/ … … 142 145 #include "fortify.h" // 06 May 08 SHL 143 146 #include "notebook.h" // INI file fields 144 #include "flesh.h" // FleshEnv, Stubby147 #include "flesh.h" // AddFleshWorkRequest 145 148 #include "update.h" // SelectDriveIcon 146 149 #include "valid.h" // CheckDrive … … 152 155 #include "i18nutil.h" // CommaFmtULL 153 156 #include "wrappers.h" // xDosFindNext 154 #include "init.h" // GetTidForWindow155 #include "common.h" // IncrThreadUsage157 #include "init.h" 158 #include "common.h" 156 159 #include "excputil.h" // xbeginthread 157 160 #include "fm3dlg.h" // INFO_LABEL … … 163 166 #endif 164 167 165 VOID StubbyScanThread(VOID * arg);166 167 168 // Data definitions 168 169 static PSZ pszSrcFile = __FILE__; … … 178 179 PCSZ FM3Tools = "<FM3_Tools>"; 179 180 PCSZ WPProgram = "WPProgram"; 180 181 typedef struct {182 PCNRITEM pci;183 HWND hwndCnr; // hwnd you want the message posted to184 }185 STUBBYSCAN;186 181 187 182 /** … … 240 235 241 236 return apszAttrString[fileAttr]; 242 243 }244 245 VOID StubbyScanThread(VOID * arg)246 {247 STUBBYSCAN *StubbyScan;248 HAB thab;249 HMQ hmq = (HMQ) 0;250 static INT ProcessDirCount = 0;251 252 DosError(FERR_DISABLEHARDERR);253 254 # ifdef FORTIFY255 Fortify_EnterScope();256 # endif257 258 StubbyScan = (STUBBYSCAN *)arg;259 if (StubbyScan && StubbyScan->pci && StubbyScan->pci->pszFileName && StubbyScan->hwndCnr) {260 thab = WinInitialize(0);261 if (thab) {262 hmq = WinCreateMsgQueue(thab, 0);263 if (hmq) {264 IncrThreadUsage();265 priority_normal();266 if (WinIsWindow((HAB)0, StubbyScan->hwndCnr)) {267 ULONG flags = driveflags[toupper(*StubbyScan->pci->pszFileName) - 'A'];268 269 if ((fRScanLocal && flags & DRIVE_LOCALHD ) ||270 (fRScanRemote && flags & DRIVE_REMOTE) ||271 (fRScanVirtual && flags & DRIVE_VIRTUAL)) {272 if (!(flags & ((fRScanNoWrite ? 0 : DRIVE_NOTWRITEABLE) ||273 (fRScanSlow ? 0 : DRIVE_SLOW)))) {274 Flesh(StubbyScan->hwndCnr, StubbyScan->pci);275 }276 else {277 Stubby(StubbyScan->hwndCnr, StubbyScan->pci);278 }279 }280 else {281 Stubby(StubbyScan->hwndCnr, StubbyScan->pci);282 }283 if (flags & DRIVE_LOCALHD)284 DosReleaseMutexSem(hmtxScanningLocalHD);285 }286 WinDestroyMsgQueue(hmq);287 }288 DecrThreadUsage();289 WinTerminate(thab);290 }291 free(StubbyScan);292 } // if StubbyScan293 ProcessDirCount++;294 // DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", ProcessDirCount, FixedVolume);295 if (ProcessDirCount >= FixedVolume) {296 DosReleaseMutexSem(hmtxScanning);297 DosPostEventSem(hevTreeCnrScanComplete);298 ProcessDirCount = 0;299 FixedVolume = 0;300 }301 # ifdef FORTIFY302 Fortify_LeaveScope();303 # endif304 237 305 238 } … … 660 593 # ifdef FORTIFY 661 594 { 662 unsignedtid = GetTidForWindow(hwndCnr);595 UINT tid = GetTidForWindow(hwndCnr); 663 596 if (tid == 1) 664 597 Fortify_ChangeScope(pci->pszFmtFileSize, -1); … … 741 674 pci->pszFileName = xstrdup(pszFileName, pszSrcFile, __LINE__); 742 675 743 // 13 Jul 09 SHL fixmeto know if fetch can be bypassed if pszFSType already filled676 // 13 Jul 09 SHL FIXME to know if fetch can be bypassed if pszFSType already filled 744 677 // If FSType not supplied, assume don't need EAs either 745 678 if (pfsa4->cbList > 4L && dcd && … … 814 747 pci->pszDisplayName = p; 815 748 816 // 13 Jul 09 SHL fixmeto know why pszFSType check needed749 // 13 Jul 09 SHL FIXME to know why pszFSType check needed 817 750 // comma format the file size for large file support 818 751 if (!pszFSType || *pszFSType == 0) { … … 1015 948 } 1016 949 else { 1017 // 04 Jan 08 SHL fixmelike comp.c to handle less than ulSelCnt records950 // 04 Jan 08 SHL FIXME like comp.c to handle less than ulSelCnt records 1018 951 pci = pciFirst; 1019 952 ullTotalBytes = 0; … … 1069 1002 pszSrcFile, __LINE__); 1070 1003 if (paffbTemp) { 1071 // 13 Aug 07 SHL fixmeto optimize copy1004 // 13 Aug 07 SHL FIXME to optimize copy 1072 1005 paffbTotal = paffbTemp; 1073 1006 ullTotalBytes = 0; // 15 Sep 09 SHL … … 1135 1068 } 1136 1069 else { 1137 // 04 Jan 08 SHL fixmelike comp.c to handle less than ulSelCnt records1070 // 04 Jan 08 SHL FIXME like comp.c to handle less than ulSelCnt records 1138 1071 if (hwndStatus && dcd && 1139 1072 dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) { … … 1232 1165 } 1233 1166 1234 // 13 Oct 09 SHL fixmeto be saymsg if ERROR_NOT_READY and first try on volume1167 // 13 Oct 09 SHL FIXME to be saymsg if ERROR_NOT_READY and first try on volume 1235 1168 if (rc && rc != ERROR_NO_MORE_FILES && (fDontSuggestAgain || !fInitialDriveScan)) { 1236 1169 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, … … 1257 1190 } 1258 1191 if ((pci->attrFile & FILE_DIRECTORY)) 1259 Stubby(hwndCnr, pci);1192 AddFleshWorkRequest(hwndCnr, pci, eStubby); 1260 1193 pci = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci), 1261 1194 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); … … 1289 1222 DosPostEventSem(CompactSem); 1290 1223 1291 #if 0 // 2011-05-31 SHL fixmeto be gone or to be configurable1224 #if 0 // 2011-05-31 SHL FIXME to be gone or to be configurable 1292 1225 { 1293 1226 int state = _heapchk(); … … 1328 1261 static ULONG ulLastDriveMap; 1329 1262 1263 DbgMsg(pszSrcFile, __LINE__, "FillTreeCnr hwndCnr %x hwndParent %x", hwndCnr, hwndParent); // 2015-08-03 SHL FIXME debug 1264 1330 1265 fDummy = TRUE; 1331 1266 *szSuggest = 0; … … 1381 1316 if (!pciFirst) { 1382 1317 Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, GetPString(IDS_CMALLOCRECERRTEXT)); 1383 // 04 Jan 08 SHL fixmenot just up and die1318 // 04 Jan 08 SHL FIXME not just up and die 1384 1319 exit(0); 1385 1320 } 1386 1321 1387 // 04 Jan 08 SHL fixmelike comp.c to handle less than ulSelCnt records1322 // 04 Jan 08 SHL FIXME like comp.c to handle less than ulSelCnt records 1388 1323 pci = pciFirst; 1389 1324 for (iDrvNum = 0; iDrvNum < 26; iDrvNum++) { … … 1407 1342 1408 1343 if (iDrvNum > 1) { 1409 // Hard drive (2..N)1344 // Hard drive, 2..N, C:..Z: 1410 1345 if (~driveflags[iDrvNum] & DRIVE_NOPRESCAN) { 1411 1346 *szFSType = 0; … … 1503 1438 driveserial[iDrvNum] = -1; 1504 1439 } 1505 } 1440 } // if not diskette 1506 1441 else { 1507 1442 // diskette drive (A or B) … … 1547 1482 ulLastDriveMap = ulDriveMap; // 13 Oct 09 SHL 1548 1483 1549 // insert the drives 1484 // insert the drives in container 1550 1485 if (numtoinsert && pciFirst) { 1551 1486 RECORDINSERT ri; … … 1662 1597 } 1663 1598 } // if show env 1664 { 1665 STUBBYSCAN *stubbyScan; 1666 1667 pci = (PCNRITEM) WinSendMsg(hwndCnr, 1668 CM_QUERYRECORD, 1669 MPVOID, 1670 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 1671 while (pci && (INT)pci != -1) { 1672 stubbyScan = xmallocz(sizeof(STUBBYSCAN), pszSrcFile, __LINE__); 1673 if (!stubbyScan) 1674 break; 1675 stubbyScan->pci = pci; 1676 stubbyScan->hwndCnr = hwndCnr; 1677 pciNext = (PCNRITEM) WinSendMsg(hwndCnr, 1678 CM_QUERYRECORD, 1679 MPFROMP(pci), 1680 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 1681 if (~pci->flags & RECFLAGS_ENV) { 1682 iDrvNum = toupper(*pci->pszFileName) - 'A'; // 0..25 1683 if (iDrvNum == ulCurDriveNum || iDrvNum >= 2) { 1684 // Hard drive or current drive 1685 ULONG flags = driveflags[iDrvNum]; // Speed up 1686 if (~flags & DRIVE_INVALID && 1687 ~flags & DRIVE_NOPRESCAN && (!fNoRemovableScan || ~flags & DRIVE_REMOVABLE)) { 1688 // DbgMsg(pszSrcFile, __LINE__, "Begin Thread %s", pci->pszFileName); 1689 if (flags & DRIVE_LOCALHD) { 1690 DosRequestMutexSem(hmtxScanningLocalHD, SEM_INDEFINITE_WAIT ); 1691 if (xbeginthread(StubbyScanThread, 1692 65536, 1693 stubbyScan, 1694 pszSrcFile, __LINE__) == -1) { 1695 DosReleaseMutexSem(hmtxScanningLocalHD); 1696 xfree(stubbyScan, pszSrcFile, __LINE__); 1697 } 1698 } 1699 else { 1700 if (xbeginthread(StubbyScanThread, 1701 65536, 1702 stubbyScan, 1703 pszSrcFile, __LINE__) == -1) 1704 xfree(stubbyScan, pszSrcFile, __LINE__); 1705 } 1706 1707 } // if drive needs to be scanned 1708 } 1709 else { 1710 // Diskette and not current drive 1711 WinSendMsg(hwndCnr, 1712 CM_INVALIDATERECORD, 1713 MPFROMP(&pci), 1714 MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION)); 1715 } 1716 } 1717 pci = pciNext; 1718 } // while 1719 } 1720 1721 // 13 Oct 09 SHL 1599 1600 // Run Stubby on each hard drive to ensure expand/collapse buttons correct 1601 pci = (PCNRITEM) WinSendMsg(hwndCnr, 1602 CM_QUERYRECORD, 1603 MPVOID, 1604 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 1605 while (pci && (INT)pci != -1) { 1606 pciNext = (PCNRITEM) WinSendMsg(hwndCnr, 1607 CM_QUERYRECORD, 1608 MPFROMP(pci), 1609 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 1610 if (~pci->flags & RECFLAGS_ENV) { 1611 iDrvNum = toupper(*pci->pszFileName) - 'A'; // 0..25 1612 if (iDrvNum == ulCurDriveNum || iDrvNum >= 2) { 1613 // Hard drive or current drive 1614 ULONG flags = driveflags[iDrvNum]; // Speed up 1615 if (~flags & DRIVE_INVALID && 1616 ~flags & DRIVE_NOPRESCAN && 1617 (!fNoRemovableScan || ~flags & DRIVE_REMOVABLE)) { 1618 AddFleshWorkRequest(hwndCnr, pci, eFillDir); 1619 } // if drive needs to be scanned 1620 } 1621 else { 1622 // Diskette or not current drive 1623 WinSendMsg(hwndCnr, 1624 CM_INVALIDATERECORD, 1625 MPFROMP(&pci), 1626 MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION)); 1627 } 1628 } 1629 pci = pciNext; 1630 } // while pci 1631 1632 // Deselect all 1722 1633 if (hwndDrivelist) 1723 1634 WinSendMsg(hwndDrivelist, LM_SELECTITEM, MPFROM2SHORT(0, 0), MPFROMLONG(TRUE)); 1724 1635 1636 // Fill in environment CNRITEMs, if any 1725 1637 pci = (PCNRITEM) WinSendMsg(hwndCnr, 1726 1638 CM_QUERYRECORD, … … 1740 1652 while (pci && (INT)pci != -1) { 1741 1653 if (pci->flags & RECFLAGS_ENV) 1742 FleshEnv(hwndCnr, pci);1654 AddFleshWorkRequest(hwndCnr, pci, eFleshEnv); 1743 1655 pci = (PCNRITEM) WinSendMsg(hwndCnr, 1744 1656 CM_QUERYRECORD, … … 1756 1668 if (hwndMain) 1757 1669 PostMsg(hwndMain, UM_BUILDDRIVEBAR, MPVOID, MPVOID); 1758 DosSleep(16); // 05 Aug 07 GKY 33 1670 1671 DosSleep(16); 1759 1672 fDummy = FALSE; 1673 1760 1674 fInitialDriveScan = FALSE; 1675 DbgMsg(pszSrcFile, __LINE__, "fInitialDriveScan now FALSE"); // 2015-08-03 SHL FIXME debug 1761 1676 DosPostEventSem(CompactSem); 1762 1677 … … 1777 1692 } 1778 1693 } 1779 // DbgMsg(pszSrcFile, __LINE__, "szSuggest %x info %x", *szSuggest, info);1694 // DbgMsg(pszSrcFile, __LINE__, "szSuggest %x info %x", *szSuggest, info); 1780 1695 if (*szSuggest) { 1781 1696 APIRET rc; … … 1837 1752 } // if !fDontSuggestAgain 1838 1753 didonce = TRUE; 1754 1755 DbgMsg(pszSrcFile, __LINE__, "FillTreeCnr finished"); // 2015-08-03 SHL FIXME debug 1756 1839 1757 } // FillTreeCnr 1840 1758 … … 2098 2016 2099 2017 #pragma alloc_text(FILLDIR,FillInRecordFromFFB,FillInRecordFromFSA,IDFile) 2100 #pragma alloc_text(FILLDIR1,ProcessDirectory,FillDirCnr,FillTreeCnr,FileAttrToString ,StubbyScanThread)2018 #pragma alloc_text(FILLDIR1,ProcessDirectory,FillDirCnr,FillTreeCnr,FileAttrToString) 2101 2019 #pragma alloc_text(EMPTYCNR,EmptyCnr,FreeCnrItemData,FreeCnrItem,FreeCnrItemList,RemoveCnrItems) 2102 2020 -
trunk/dll/flesh.c
r1837 r1856 4 4 $Id$ 5 5 6 Flesh6 Drive tree container management 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2005-201 2Steven H. Levine9 Copyright (c) 2005-2015 Steven H. Levine 10 10 11 11 24 May 05 SHL Rework Win_Error usage … … 26 26 08 Mar 09 GKY Additional strings move to PCSZs in init.c 27 27 13 Dec 09 GKY Fixed separate paramenters. Please note that appname should be used in 28 profile calls for user settings that work and are setable in more than one29 miniapp; FM3Str should be used for setting only relavent to FM/2 or that30 aren't user settable; realappname should be used for setting applicable to31 one or more miniapp but not to FM/228 profile calls for user settings that work and are setable in more than one 29 miniapp; FM3Str should be used for setting only relavent to FM/2 or that 30 aren't user settable; realappname should be used for setting applicable to 31 one or more miniapp but not to FM/2 32 32 17 Jan 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *. 33 33 04 Aug 12 GKY Fix trap on close during drive scan 34 34 02 Aug 15 GKY Fix trap in Stubby 35 03 Aug 15 SHL Document Stubby a bit better 36 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 35 37 36 38 ***********************************************************************/ … … 58 60 #include "flesh.h" 59 61 #include "valid.h" // IsValidDir 60 #include "misc.h" // LoadLibPath 62 #include "misc.h" // LoadLibPath GetTidForThread 61 63 #include "findrec.h" // FindCnrRecord 62 64 #include "notify.h" // Notify 63 65 #include "wrappers.h" // xfree 64 66 #include "excputil.h" // xbeginthread 67 #include "listutil.h" // List... 68 #include "common.h" // IncrThreadUsage DecrThreadUsage 69 65 70 #if 0 66 71 #define __PMPRINTF__ … … 73 78 static PSZ pszSrcFile = __FILE__; 74 79 80 81 static INT tidFleshWorkListThread = -1; // 2015-08-08 SHL 82 83 static CHAR chFleshFocusDrive; // 2015-08-16 SHL A..Z or 0 84 85 86 BOOL fNoFleshDbgMsg; // 2015-08-09 SHL FIXME to be gone 87 75 88 #pragma data_seg(GLOBAL1) 76 89 ULONG NoBrokenNotify; 77 90 BOOL fFilesInTree; 91 92 BOOL Flesh(HWND hwndCnr, PCNRITEM pciParent); 93 94 BOOL Stubby(HWND hwndCnr, PCNRITEM pciParent); 95 BOOL FleshEnv(HWND hwndCnr, PCNRITEM pciParent); 96 BOOL UnFlesh(HWND hwndCnr, PCNRITEM pciParent); 97 98 /** 99 * Insert CNRITEMs for members of PATH-like environment variable 100 * @param hwndCnr is the container to be populated 101 * @param pciParent is CNRITEM defining PATH-like environment variable 102 * @return TRUE if OK, FALSE is error detected 103 */ 78 104 79 105 BOOL FleshEnv(HWND hwndCnr, PCNRITEM pciParent) … … 86 112 if (!pciParent || (INT) pciParent == -1 || !hwndCnr) 87 113 return FALSE; 114 88 115 dcd = (DIRCNRDATA *) WinQueryWindowPtr(hwndCnr, QWL_USER); 89 116 if (!dcd) … … 187 214 } 188 215 216 /** 217 * Insert CNRITEMs for all children of pciParent 218 * @param hwnCnr is container to receive CNRITEMs 219 * @param pciParent is CNRITEM to have children inserted 220 * @return TRUE if OK, FALSE is error detected 221 */ 222 189 223 BOOL Flesh(HWND hwndCnr, PCNRITEM pciParent) 190 224 { 191 225 PCNRITEM pciL; 192 226 DIRCNRDATA *dcd; 193 BOOL includefiles = fFilesInTree;194 195 if (!pciParent || (INT) pciParent == -1 || !hwndCnr)227 BOOL includefiles; 228 229 if (!pciParent || (INT)pciParent == -1 || !hwndCnr) 196 230 return FALSE; 197 pciL = (PCNRITEM) WinSendMsg(hwndCnr, 198 CM_QUERYRECORD, 199 MPFROMP(pciParent), 200 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 201 if (!pciL || !*pciL->pszFileName) { 202 if (pciL && (INT) pciL != -1) 231 232 // 2015-08-13 SHL FIXME to optimize 233 if (fAmClosing) { 234 // Can jiggle - see MainWndProc WM_CLOSE 235 DosSleep(100); 236 if (fAmClosing) 237 return FALSE; // time to die 238 } 239 240 // 2015-08-03 SHL FIXME debug 241 if (!fNoFleshDbgMsg) { 242 DbgMsg(pszSrcFile, __LINE__, "Flesh %s pciParent %p pszFileName %p", 243 pciParent && (INT)pciParent != -1 && pciParent->pszFileName ? 244 pciParent->pszFileName : "(null)", 245 pciParent, 246 pciParent && (INT)pciParent != -1 ? pciParent->pszFileName : (PVOID)-1); // 2015-08-03 SHL FIXME debug 247 } 248 249 pciL = (PCNRITEM)WinSendMsg(hwndCnr, 250 CM_QUERYRECORD, 251 MPFROMP(pciParent), 252 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 253 254 // 2015-08-06 SHL allow pciL -1 255 if (!pciL || (INT)pciL == -1 || !*pciL->pszFileName) { 256 257 // No children or filename null 258 // 2015-08-06 SHL FIXME to know how this can happen 259 if (pciL && (INT)pciL != -1) { 260 // 2015-08-06 SHL FIXME to loop and timeout if Stubby threads working 261 if (!fNoFleshDbgMsg) 262 DbgMsg(pszSrcFile, __LINE__, "Flesh RemoveCnrItems() pciL %p", pciL); // 2015-08-04 SHL FIXME debug 203 263 RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE); 264 } 265 204 266 dcd = INSTDATA(hwndCnr); 205 267 if (dcd && dcd->size != sizeof(DIRCNRDATA)) 206 268 dcd = NULL; 207 if (driveflags[toupper(*pciParent->pszFileName) - 'A'] & DRIVE_INCLUDEFILES) 208 includefiles = TRUE; 269 270 // DbgMsg(pszSrcFile, __LINE__, "Flesh %s dcd %p called by %s#%u", pciParent->pszFileName, dcd, pszSrcFile_, uSrcLineNo_); // 2015-08-03 SHL FIXME debug 271 272 // 2015-08-06 SHL FIXME to not trap here 273 includefiles = 274 driveflags[toupper(*pciParent->pszFileName) - 'A'] & DRIVE_INCLUDEFILES ? 275 TRUE : fFilesInTree; 276 209 277 ProcessDirectory(hwndCnr, 210 pciParent,211 pciParent->pszFileName,212 includefiles, // filestoo213 TRUE, // recurse214 TRUE, // partial215 NULL, // stop flag216 dcd,217 NULL, // total files218 NULL); // total bytes278 pciParent, 279 pciParent->pszFileName, 280 includefiles, // filestoo 281 TRUE, // recurse 282 TRUE, // partial 283 NULL, // stop flag 284 dcd, 285 NULL, // total files 286 NULL); // total bytes 219 287 if (pciParent && pciParent->pszFileName && !(driveflags[toupper(*pciParent->pszFileName) - 'A'] & DRIVE_RSCANNED)) 220 288 driveflags[toupper(*pciParent->pszFileName) - 'A'] |= DRIVE_RSCANNED; 221 289 return TRUE; 222 290 } 291 223 292 return FALSE; 224 293 } 225 294 295 // 2015-08-06 SHL FIXME to be VOID 296 226 297 BOOL UnFlesh(HWND hwndCnr, PCNRITEM pciParent) 227 298 { 228 BOOL re t= FALSE;299 BOOL removed = FALSE; 229 300 PCNRITEM pciL; 230 301 231 302 if (!pciParent || !hwndCnr) 232 303 return FALSE; 304 305 if (!fNoFleshDbgMsg) 306 DbgMsg(pszSrcFile, __LINE__, "UnFlesh pciParent %p pszFileName %s", pciParent, pciParent->pszFileName ? pciParent->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug 307 233 308 for (;;) { 234 309 pciL = (PCNRITEM) WinSendMsg(hwndCnr, … … 236 311 MPFROMP(pciParent), 237 312 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 238 if (pciL && (INT) pciL != -1) { 239 ret = TRUE; 240 RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE); 241 } 242 else 243 break; 244 } 245 if (ret) { 313 if (!pciL || (INT)pciL == -1) 314 break; // Done 315 316 if (!fNoFleshDbgMsg) 317 DbgMsg(pszSrcFile, __LINE__, "UnFlesh RemoveCnrItems() pciL %p %s", pciL, pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug 318 RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE); 319 removed = TRUE; 320 } // for 321 322 if (removed) { 246 323 WinSendMsg(hwndCnr, 247 324 CM_INVALIDATERECORD, … … 249 326 MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION)); 250 327 } 251 return re t;328 return removed; 252 329 } 253 330 … … 255 332 256 333 /** 257 * Fill in drive tree subtree 258 * @return TRUE if OK, else FALSE 259 * This only scans the root directory and adds the first level directories 260 * Flesh does a recursive scan and should be used on fast hardware. 334 * Insert CNRITEM for 1st subdirectory [or file] of pciParent 335 * @param hwdCnr is container to be filled 336 * @param pciParent is CNRITEM to receive child record 337 * @return TRUE if record inserted, else FALSE 338 * Ensures that expand/collapse button displays if directory has children 339 * Secondary purpose is to detect broken LANs and inaccesible mapped drives 261 340 */ 262 341 … … 273 352 PFILEFINDBUF3 pffb; 274 353 HDIR hDir = HDIR_CREATE; 275 ULONG nm, ulM = 1, total = 0, fl = MUST_HAVE_DIRECTORY;354 ULONG nm, ulM = 1, total = 0, fl; 276 355 CHAR str[CCHMAXPATH]; 277 356 register INT len; 278 357 APIRET rc, prc; 279 BOOL isadir = FALSE, isremote = FALSE, includefiles = fFilesInTree;358 BOOL isadir = FALSE, isremote, includefiles; 280 359 ULONG ddepth = DDEPTH; 281 360 ULONG drvNum; … … 286 365 || pciParent->pszFileName == NullStr || !hwndCnr) 287 366 return FALSE; 288 367 368 if (!fNoFleshDbgMsg) 369 DbgMsg(pszSrcFile, __LINE__, "Stubby pciParent %p pszFileName %s", pciParent, pciParent->pszFileName); // 2015-08-03 SHL FIXME debug 370 371 // Build wildcard 289 372 len = strlen(pciParent->pszFileName); 290 373 memcpy(str, pciParent->pszFileName, len + 1); … … 302 385 str[1] != ':' || 303 386 str[2] != '\\' || ((flags & DRIVE_IGNORE))) 304 return FALSE; // Not a directory 305 306 if (flags & DRIVE_INCLUDEFILES) 307 includefiles = TRUE; 308 309 if (flags & DRIVE_REMOTE) 310 isremote = TRUE; 387 return FALSE; // Not a directory or ignore requested 388 389 includefiles = flags & DRIVE_INCLUDEFILES ? TRUE : fFilesInTree; 390 391 isremote = flags & DRIVE_REMOTE ? TRUE : FALSE; 311 392 312 393 if (isremote) { … … 323 404 324 405 if (!fRemoteBug) 325 ulM = (ddepth <= DDEPTH)? ddepth : 1;406 ulM = ddepth <= DDEPTH ? ddepth : 1; 326 407 327 408 nm = ulM; 328 409 329 410 DosError(FERR_DISABLEHARDERR); 330 if (includefiles) 331 fl = FILE_DIRECTORY; 411 412 fl = includefiles ? FILE_DIRECTORY : MUST_HAVE_DIRECTORY; 413 332 414 rc = DosFindFirst(str, 333 415 &hDir, … … 337 419 &ffb, ulM * sizeof(FILEFINDBUF3), &nm, FIL_STANDARD); 338 420 if (ulM == 1 && !rc) { 421 // Loop looking for 1st directory (or file) 339 422 do { 340 423 pffb = &ffb[0]; 341 424 if (!includefiles && !(pffb->attrFile & FILE_DIRECTORY) && !brokenlan) { 425 // Find returned file when only directories requested 342 426 brokenlan = TRUE; 343 427 ddepth = (ULONG) - 1; … … 364 448 } 365 449 } 450 366 451 if (*pffb->achName && 367 452 (includefiles || (pffb->attrFile & FILE_DIRECTORY)) && 368 // Skip . and ..369 453 (pffb->achName[0] != '.' || 370 454 (pffb->achName[1] && 371 455 (pffb->achName[1] != '.' || pffb->achName[2])))) { 456 // Got directory other than . or .. (or a file) 372 457 DosFindClose(hDir); 373 458 isadir = TRUE; … … 376 461 nm = 1; 377 462 DosError(FERR_DISABLEHARDERR); 378 } 379 while (++total < ddepth && !(rc = (DosFindNext(hDir, 380 &ffb, 381 sizeof(FILEFINDBUF3), 382 &nm)))); 383 DosFindClose(hDir); 384 // If drive B: 463 } while (++total < ddepth && !(rc = (DosFindNext(hDir, 464 &ffb, 465 sizeof(FILEFINDBUF3), 466 &nm)))); 467 DosFindClose(hDir); 468 385 469 if (toupper(*pciParent->pszFileName) > 'B' && 386 470 (*(pciParent->pszFileName + 1)) == ':' && 387 471 (*(pciParent->pszFileName + 2)) == '\\' && !(*(pciParent->pszFileName + 3))) { 388 472 473 // Searching root of hard or remote drive and find reported error 389 474 CHAR s[132]; 390 475 sprintf(s, … … 397 482 Notify(s); 398 483 } 399 goto None; 400 } 401 484 goto None; // Done 485 } 486 402 487 if (!rc) { 403 488 DosFindClose(hDir); … … 407 492 pffb = (PFILEFINDBUF3) fb; 408 493 if (!includefiles && !(pffb->attrFile & FILE_DIRECTORY)) { 494 // Got file(s), but did not ask for files 409 495 if (!isbroken) { 410 496 isbroken = TRUE; … … 432 518 &NoBrokenNotify, sizeof(ULONG)); 433 519 } 434 } 435 } 520 } // if !broken 521 } // if !directory 522 436 523 if (*pffb->achName && 437 524 (includefiles || (pffb->attrFile & FILE_DIRECTORY)) && 438 // Skip . and .. 439 ((pffb->achName[0] && pffb->achName[0] != '.') || (pffb->achName[1] 440 && (pffb->achName[1] != '.' 441 || pffb->achName[2])))) { 525 ((pffb->achName[0] && pffb->achName[0] != '.') || 526 (pffb->achName[1] && 527 (pffb->achName[1] != '.' || pffb->achName[2])))) 528 { 529 // Got directory other than . or .. (or a file) 442 530 isadir = TRUE; 443 531 break; … … 450 538 if (isadir) { 451 539 540 // Insert CNRITEM for selected directory (or file) 452 541 PCNRITEM pci; 453 542 … … 471 560 ri.zOrder = (ULONG) CMA_TOP; 472 561 ri.cRecordsInsert = 1; 473 ri.fInvalidateRecord = TRUE;474 // DbgMsg(pszSrcFile, __LINE__, "Stubby %p CM_INSERTRECORD \"%s\" %.255s", hwndCnr, pci->pszFileName, pffb->achName); // 18 Dec 08 SHL fixmedebug562 ri.fInvalidateRecord = TRUE; 563 // DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD %p \"%s\" %.255s", pci, pci->pszFileName, pffb->achName); // 2015-08-03 SHL FIXME debug 475 564 if (!WinSendMsg(hwndCnr, 476 565 CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) { 566 // Assume busy and try again 477 567 DosSleep(50); //05 Aug 07 GKY 100 478 WinSetFocus(HWND_DESKTOP, hwndCnr); 479 if (WinIsWindow((HAB)0, hwndCnr)) { 480 //DbgMsg(pszSrcFile, __LINE__, "Stubby %p CM_INSERTRECORD %s", hwndCnr, pci->pszFileName); // 18 Dec 08 SHL fixme debug 568 WinSetFocus(HWND_DESKTOP, hwndCnr); 569 if (WinIsWindow((HAB)0, hwndCnr)) { 570 if (!fNoFleshDbgMsg) 571 DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName %s", pci, pci->pszFileName); // 2015-08-03 SHL FIXME debug 481 572 if (!WinSendMsg(hwndCnr, 482 573 CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) { … … 490 581 } 491 582 else 492 ok = TRUE; 493 } 583 ok = TRUE; 494 584 } 495 585 } 586 } // if isadir 496 587 else if (toupper(*str) > 'B' && str[1] == ':' && str[2] == '\\' && 497 588 !str[3]) { 498 589 590 // Is root and no subdirectories 499 591 CHAR s[162]; 500 501 592 sprintf(s, 502 593 GetPString(IDS_NOSUBDIRS2TEXT), 503 594 nm, 504 595 toupper(*pciParent->pszFileName), 505 (isremote)? GetPString(IDS_NOSUBDIRS3TEXT) : NullStr);596 isremote ? GetPString(IDS_NOSUBDIRS3TEXT) : NullStr); 506 597 Notify(s); 507 598 } … … 509 600 } 510 601 else if (toupper(*str) > 'B' && rc != ERROR_NO_MORE_FILES) { 602 // Find for remote or hard drive failed with error 511 603 CHAR s[CCHMAXPATH + 80]; 512 604 sprintf(s, GetPString(IDS_SEARCHERRORTEXT), rc, str); … … 518 610 DosError(FERR_DISABLEHARDERR); 519 611 return ok; 520 } 521 522 #pragma alloc_text(FLESH,Flesh,FleshEnv,UnFlesh,Stubby) 612 } // Stubby 613 614 // Stubby/Flesh/Unflesh work list item 615 616 typedef struct { 617 LIST2 list; 618 HWND hwndCnr; 619 PCNRITEM pci; 620 FLESHWORKACTION action; 621 } FLESHWORKITEM; 622 typedef FLESHWORKITEM *PFLESHWORKITEM; 623 624 // Stubby/Flesh/Unflesh work list 625 LIST2 FleshWorkList; 626 627 HMTX hmtxFleshWork; 628 HEV hevFleshWorkListChanged; 629 630 /** 631 * Check pci matches 632 */ 633 634 BOOL WorkListItemMatches(PLIST2 item, PVOID data) 635 { 636 return ((PFLESHWORKITEM)data)->pci == ((PFLESHWORKITEM)item)->pci; 637 } 638 639 /** 640 * Delete stale items from flesh queue 641 */ 642 643 VOID DeleteStaleFleshWorkListItems(PCNRITEM pci) 644 { 645 FLESHWORKITEM match; 646 PLIST2 item; 647 648 match.pci = pci; 649 650 for (;;) { 651 item = List2Search(&FleshWorkList, WorkListItemMatches, &match); 652 if (!item) 653 break; 654 DbgMsg(pszSrcFile, __LINE__, "DeleteStaleFleshWorkListItems deleting %p %s", pci, pci->pszFileName ? pci->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug 655 List2Delete(&FleshWorkList, item); 656 xfree(item, pszSrcFile, __LINE__); 657 } 658 } 659 660 /** 661 * Add item to flesh work list 662 * eUnFlesh requests get special handling 663 * eFlesh etc. items for the same CNRITEM are considered stale and are 664 * deleted because eUnFlesh will free the CNRITEM associated with the item 665 * before the work list item is processed 666 */ 667 668 #if 0 // 2015-08-03 SHL FIXME debug 669 BOOL AddFleshWorkRequest(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action) 670 #else 671 BOOL AddFleshWorkRequestDbg(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action, PCSZ pszSrcFile_, UINT uSrcLineNo) 672 #endif 673 { 674 APIRET rc; 675 676 PFLESHWORKITEM item = xmallocz(sizeof(FLESHWORKITEM), pszSrcFile, __LINE__); 677 item->hwndCnr = hwndCnr; 678 item->pci = pci; 679 item->action= action; 680 681 if (fAmClosing) { 682 // Can jiggle - see MainWndProc WM_CLOSE 683 DosSleep(100); 684 if (fAmClosing) 685 return FALSE; 686 } 687 688 // 2015-08-03 SHL FIXME debug 689 { 690 #if 0 // 2015-08-13 SHL FIXME to be gone 691 static PSZ itemNames[] = { 692 "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh" 693 }; 694 695 # ifdef AddFleshWorkRequest 696 if (!pci || (INT)pci == -1) { 697 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p by %s:%u", 698 itemNames[item->action], 699 pci, 700 pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug 701 } 702 else if (!pci->pszFileName) { 703 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p pszFileName (null) by %s:%u", 704 itemNames[item->action], 705 pci, 706 pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug 707 } 708 else if (!fNoFleshDbgMsg) { 709 DbgMsg(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName %s by %s:%u", 710 itemNames[item->action], 711 pci, 712 pci->pszFileName, 713 pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug 714 } 715 #else 716 if (!pci || (INT)pci == -1) { 717 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p", 718 itemNames[item->action], 719 pci); // 2015-08-03 SHL FIXME debug 720 } 721 else if (!pci->pszFileName) { 722 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName (null)", 723 itemNames[item->action], 724 pci); // 2015-08-03 SHL FIXME debug 725 } 726 else if (!fNoFleshDbgMsg) { 727 DbgMsg(pszSrcFile, __LINE__, "AddFleshWorkRequest action %s pci %p pszFileName %s", 728 itemNames[item->action], 729 pci, 730 pci->pszFileName); // 2015-08-03 SHL FIXME debug 731 } 732 #endif 733 #endif 734 } 735 736 rc = DosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT); 737 if (rc) 738 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem"); 739 740 // 2015-08-13 SHL FIXME to be done 741 // Delete stale requests 742 if (item->action == eUnFlesh) { 743 DeleteStaleFleshWorkListItems(pci); 744 } 745 746 List2Append(&FleshWorkList, (PLIST2)item); 747 748 rc = DosReleaseMutexSem(hmtxFleshWork); 749 if (rc) 750 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosReleaseMutexSem"); 751 752 rc = DosPostEventSem(hevFleshWorkListChanged); 753 if (rc && rc != ERROR_ALREADY_POSTED) 754 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 755 756 return TRUE; 757 } 758 759 /** 760 * Return TRUE if work list empty 761 * Advisory only 762 */ 763 764 BOOL IsFleshWorkListEmpty() 765 { 766 return FleshWorkList.next == NULL; 767 } 768 769 /** 770 * Wait until work list empty 771 * Advisory only 772 */ 773 774 #if 0 // 2015-08-03 SHL FIXME debug 775 VOID WaitFleshWorkListEmpty() 776 #else 777 VOID WaitFleshWorkListEmptyDbg(PCSZ pszSrcFile_, UINT uSrcLineNo_) 778 #endif 779 { 780 INT tid = GetTidForThread(); 781 782 if (tid == 1 || tid == tidFleshWorkListThread) { 783 # ifdef WaitFleshWorkListEmpty 784 Runtime_Error(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist %sempty by tid %u at %s:%u", IsFleshWorkListEmpty() ? "" : "not ", tid, pszSrcFile_, uSrcLineNo_); 785 # else 786 Runtime_Error(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called by tid %u", tid); 787 # endif 788 return; // Avoid hang 789 } 790 else if (IsFleshWorkListEmpty()) { 791 # ifdef WaitFleshWorkListEmpty 792 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist empty by tid %u at %s:%u", tid, pszSrcFile_, uSrcLineNo_); 793 # else 794 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list empty by tid %u", tid); 795 # endif 796 } 797 798 // Can not wait if call from thread 1 or FleshWorkListThread 799 while (!IsFleshWorkListEmpty()) { 800 # ifdef WaitFleshWorkListEmpty 801 if (!fNoFleshDbgMsg) 802 // DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty by %s:%u", pszSrcFile_, uSrcLineNo_); // 2015-08-07 SHL FIXME debug 803 # else 804 if (!fNoFleshDbgMsg) 805 // DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty"); // 2015-08-07 SHL FIXME debug 806 # endif 807 // 2015-08-13 SHL FIXME to optimize 808 if (fAmClosing) { 809 // Can jiggle - see MainWndProc WM_CLOSE 810 DosSleep(100); 811 if (fAmClosing) 812 return; 813 } 814 DosSleep(250); 815 } 816 } 817 818 /** 819 * Set focus drive to optimize work list processing 820 * @param chDriveLetter is upper case drive letter (A-Z) 821 */ 822 823 VOID SetFleshFocusDrive(CHAR chDriveLetter) { 824 chFleshFocusDrive = chDriveLetter; 825 DbgMsg(pszSrcFile, __LINE__, "SetFleshFocusDrive focus drive set to %c", chFleshFocusDrive); // 2015-08-03 SHL FIXME debug 826 827 } 828 829 /** 830 * Check pci pathname matches focus drive 831 * @param data is uppercase drive letter mapped to PVOID 832 * @return TRUE if drive letter matches 833 */ 834 835 BOOL MatchesFocusDrive(PLIST2 item, PVOID data) 836 { 837 if (!((PFLESHWORKITEM)item)->pci->pszFileName) { 838 Runtime_Error(pszSrcFile, __LINE__, "MatchesFocusDrive called with pci %p pszFileName (null) by %s:%u", ((PFLESHWORKITEM)item)->pci); 839 return FALSE; 840 } 841 return ((PFLESHWORKITEM)item)->pci->pszFileName[0] == (CHAR)data; 842 } 843 844 /** 845 * Run Flesh, UnFlesh, FleshEnv, Stubby for directory for items in work list 846 */ 847 848 VOID FleshWorkThread(PVOID arg) 849 { 850 HAB thab; 851 HMQ hmq = (HMQ)0; 852 APIRET rc; 853 854 // 2015-08-07 SHL FIXME to be gone 855 static INT ProcessDirCount = 0; 856 857 DosError(FERR_DISABLEHARDERR); 858 859 # ifdef FORTIFY 860 Fortify_EnterScope(); 861 # endif 862 863 thab = WinInitialize(0); 864 if (thab) { 865 hmq = WinCreateMsgQueue(thab, 0); 866 if (hmq) { 867 IncrThreadUsage(); 868 priority_normal(); 869 870 // 2015-08-07 SHL FIXME to know when to terminate 871 // process list entries forever 872 for (;;) { 873 874 PFLESHWORKITEM item; 875 876 // 2015-08-13 SHL FIXME to optimize 877 if (fAmClosing) { 878 // Can jiggle - see MainWndProc WM_CLOSE 879 DosSleep(100); 880 if (fAmClosing) 881 break; // time to die 882 } 883 884 // 2015-08-07 SHL FIXME to use SMPSafe... 885 rc = DosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT); 886 if (rc) 887 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem"); 888 889 // 2015-08-14 SHL 890 // Get next work list item and remove from list 891 // If focus drive known, process items for focus drive first 892 if (chFleshFocusDrive) { 893 item = (PFLESHWORKITEM)List2Search(&FleshWorkList, MatchesFocusDrive, (PVOID)chFleshFocusDrive); 894 if (!item) 895 chFleshFocusDrive = 0; // Revert to normal 896 else 897 List2Delete(&FleshWorkList, (PLIST2)item); 898 } 899 else 900 item = NULL; 901 902 if (!item) 903 item = (PFLESHWORKITEM)List2DeleteFirst(&FleshWorkList); 904 905 rc = DosReleaseMutexSem(hmtxFleshWork); 906 if (rc) 907 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosReleaseMutexSem"); 908 909 // 2015-08-07 SHL FIXME to have event sem 910 if (!item) { 911 ULONG ul; 912 if (!fNoFleshDbgMsg) 913 DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread work list empty - waiting"); // 2015-08-03 SHL FIXME debug 914 rc = DosWaitEventSem(hevFleshWorkListChanged, SEM_INDEFINITE_WAIT); 915 if (rc) 916 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosWaitEventSem"); 917 rc = DosResetEventSem(hevFleshWorkListChanged, &ul); 918 if (rc) 919 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem"); 920 if (!fNoFleshDbgMsg) 921 DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread work hev posted"); // 2015-08-03 SHL FIXME debug 922 continue; 923 } 924 925 if (WinIsWindow((HAB)0, item->hwndCnr)) { 926 927 ULONG flags; 928 929 #if 0 // 2015-08-07 SHL FIXME debug 930 // 2015-08-03 SHL FIXME debug 931 { 932 static PSZ itemNames[] = { 933 "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh" 934 }; 935 936 PCNRITEM pci = item->pci; 937 if (!fNoFleshDbgMsg) { 938 DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread action %s pci %p pszFileName %s", 939 itemNames[item->action], 940 pci, 941 pci && (INT)pci != -1 ? 942 (pci->pszFileName ? pci->pszFileName : "(nullname)") : 943 "(nullpci)"); // 2015-08-03 SHL FIXME debug 944 } 945 } 946 #endif 947 948 switch (item->action) { 949 case eUnFlesh: 950 UnFlesh(item->hwndCnr, item->pci); 951 break; 952 case eFleshEnv: 953 FleshEnv(item->hwndCnr, item->pci); 954 break; 955 case eFillDir: 956 case eStubby: 957 // DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread pci %p pszFileName %s", stubbyArgs->pci, stubbyArgs->pci->pszFileName); // 2015-08-03 SHL FIXME debug 958 flags = driveflags[toupper(*item->pci->pszFileName) - 'A']; 959 960 #if 0 // 2015-08-07 SHL FIXME to be gone 961 if (flags & DRIVE_LOCALHD) { 962 // Serialize to prevent head thrashing 963 rc = DosRequestMutexSem(hmtxScanningLocalHD, SEM_INDEFINITE_WAIT); 964 if (rc) 965 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem"); 966 } 967 #endif 968 969 #if 1 970 if (item->action == eFillDir) { 971 // eFillDir maps to eFlesh or eStubby depending on fRScan.. settings 972 if (((fRScanLocal && flags & DRIVE_LOCALHD) || 973 (fRScanRemote && flags & DRIVE_REMOTE) || 974 (fRScanVirtual && flags & DRIVE_VIRTUAL)) && 975 (!(flags & ((fRScanNoWrite ? 0 : DRIVE_NOTWRITEABLE) | 976 (fRScanSlow ? 0 : DRIVE_SLOW))))) 977 { 978 item->action = eFlesh; 979 } 980 else 981 item->action = eStubby; 982 } 983 #else 984 wantFlesh = ((fRScanLocal && flags & DRIVE_LOCALHD ) || 985 (fRScanRemote && flags & DRIVE_REMOTE) || 986 (fRScanVirtual && flags & DRIVE_VIRTUAL)) && 987 // 2015-08-11 SHL typo - should not be local or 988 (!(flags & ((fRScanNoWrite ? 0 : DRIVE_NOTWRITEABLE) || 989 (fRScanSlow ? 0 : DRIVE_SLOW)))); 990 #endif 991 if (item->action == eStubby) { 992 Stubby(item->hwndCnr, item->pci); 993 break; 994 } 995 // Drop through to eFlesh 996 997 998 #if 0 // 2015-08-07 SHL FIXME to be gone 999 if (flags & DRIVE_LOCALHD) { 1000 rc = DosReleaseMutexSem(hmtxScanningLocalHD); 1001 if (rc) { 1002 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1003 "DosReleaseMutexSem(hmtxScanningLocalHD)"); 1004 } 1005 } 1006 #endif // 2015-08-07 SHL FIXME to be gone 1007 1008 // Drop through 1009 case eFlesh: 1010 if (Flesh(item->hwndCnr, item->pci)) { 1011 // 2015-08-06 SHL FIXME to report? 1012 } 1013 break; 1014 default: 1015 Runtime_Error(pszSrcFile, __LINE__, "item %u unexpected", item->action); 1016 } // switch 1017 1018 1019 } // if window 1020 1021 xfree(item, pszSrcFile, __LINE__); 1022 1023 } // for 1024 1025 WinDestroyMsgQueue(hmq); 1026 } 1027 DecrThreadUsage(); 1028 WinTerminate(thab); 1029 } 1030 1031 ProcessDirCount++; 1032 // DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", ProcessDirCount, FixedVolume); 1033 if (ProcessDirCount >= FixedVolume) { 1034 1035 #if 0 // 2015-08-04 SHL FIXME to be gone 1036 rc = DosReleaseMutexSem(hmtxScanning); 1037 if (rc) 1038 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosReleaseMutexSem"); 1039 #endif // 2015-08-04 SHL FIXME to be gone 1040 1041 #if 0 // 2015-08-04 SHL FIXME to be gone 1042 rc = DosPostEventSem(hevTreeCnrScanComplete); 1043 if (rc && rc != ERROR_ALREADY_POSTED) 1044 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 1045 #endif // 2015-08-04 SHL FIXME to be gone 1046 1047 ProcessDirCount = 0; 1048 FixedVolume = 0; 1049 } 1050 1051 # ifdef FORTIFY 1052 Fortify_LeaveScope(); 1053 # endif 1054 1055 } 1056 1057 /** 1058 * Allocate resources and start FleshWorkThread 1059 * @return TRUE if OK 1060 */ 1061 1062 BOOL StartFleshWorkThread() 1063 { 1064 APIRET rc = DosCreateMutexSem(NULL, &hmtxFleshWork, 0L /* Not shared */, FALSE /* Not owned */); 1065 if (rc) { 1066 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1067 PCSZ_DOSCREATEMUTEXSEM); 1068 return FALSE; 1069 } 1070 1071 rc = DosCreateEventSem(NULL, &hevFleshWorkListChanged, 0 /* Not shared */, FALSE /* Reset */); 1072 if (rc) { 1073 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1074 PCSZ_DOSCREATEEVENTSEM); 1075 return FALSE; 1076 } 1077 1078 /* DbgMsg is time consuming 1079 define FM2_NO_FLESH_DBGMSG to suppress 1080 2015-08-09 SHL FIXME to be gone 1081 */ 1082 1083 fNoFleshDbgMsg = getenv("FM2_NO_FLESH_DBGMSG") != NULL; 1084 1085 tidFleshWorkListThread = xbeginthread(FleshWorkThread, 1086 65536, 1087 NULL, 1088 pszSrcFile, __LINE__); 1089 return tidFleshWorkListThread != -1; 1090 1091 } 1092 1093 #pragma alloc_text(FLESH,Flesh,FleshEnv,UnFlesh,Stubby,FleshWorkThread,StartFleshWorkThread,AddFleshWorkRequest) -
trunk/dll/flesh.h
r1207 r1856 4 4 $Id$ 5 5 6 <<<description here>>>6 Drive tree container management 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2008 Steven H. Levine9 Copyright (c) 2008, 2015 Steven H. Levine 10 10 11 Change log11 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 12 12 13 13 ***********************************************************************/ … … 16 16 #define FLESH_H 17 17 18 BOOL Flesh(HWND hwndCnr, PCNRITEM pciParent); 19 BOOL FleshEnv(HWND hwndCnr, PCNRITEM pciParent); 20 BOOL Stubby(HWND hwndCnr, PCNRITEM pciParent); 21 BOOL UnFlesh(HWND hwndCnr, PCNRITEM pciParent); 18 BOOL StartFleshWorkThread(VOID); 19 20 typedef enum {eStubby, eFlesh, eFleshEnv, eUnFlesh, eFillDir} FLESHWORKACTION; 21 22 BOOL IsFleshWorkListEmpty(); 23 24 VOID SetFleshFocusDrive(CHAR chDriveLetter); 25 26 #if 0 // 2015-08-03 SHL FIXME debug 27 VOID WaitFleshWorkListEmpty(); 28 #else 29 #define WaitFleshWorkListEmpty() WaitFleshWorkListEmptyDbg(__FILE__, __LINE__) 30 VOID WaitFleshWorkListEmptyDbg(PCSZ pszSrcFile, UINT uSrcLineNo); 31 #endif 32 33 #if 0 // 2015-08-03 SHL FIXME debug 34 BOOL AddFleshWorkRequest(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action); 35 #else 36 #define AddFleshWorkRequest(hwnCnr, pciParent, action) AddFleshWorkRequestDbg(hwnCnr, pciParent, action, __FILE__, __LINE__) 37 BOOL AddFleshWorkRequestDbg(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action, PCSZ pszSrcFile, UINT uSrcLineNo); 38 #endif 22 39 23 40 // Data declarations … … 25 42 extern BOOL fFilesInTree; 26 43 44 27 45 #endif // FLESH_H -
trunk/dll/init.c
r1846 r1856 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 201 0Steven H. Levine9 Copyright (c) 2001, 2015 Steven H. Levine 10 10 11 11 11 Jun 02 SHL Add CheckVersion … … 211 211 #include "excputil.h" // xbeginthread 212 212 #include "systemf.h" // runemf2 213 213 214 #if 0 214 215 #define __PMPRINTF__ 215 216 #include "PMPRINTF.H" 216 217 #endif 218 217 219 extern int _CRT_init(void); 218 220 extern void _CRT_term(void); … … 236 238 HMTX hmtxFM2Delete; 237 239 HMTX hmtxFM2Globals; 240 241 #if 0 // 2015-08-04 SHL FIXME to be gone 238 242 HMTX hmtxScanning; 243 #endif // 2015-08-04 SHL FIXME to be gone 244 245 #if 0 // 2015-08-07 SHL FIXME to be gone 239 246 HMTX hmtxScanningLocalHD; 240 HMTX hmtxScanningLocal; 247 #endif // 2015-08-07 SHL FIXME to be gone 248 241 249 HMTX hmtxFiltering; 250 251 #if 0 // 2015-08-04 SHL FIXME to be gone 242 252 HEV hevTreeCnrScanComplete; 253 #endif // 2015-08-04 SHL FIXME to be gone 254 243 255 ULONG OS2ver[2]; 244 256 PFNWP PFNWPCnr; … … 249 261 ULONG ulTimeFmt; 250 262 ULONG ulDateFmt; 251 ULONG ulScanPostCnt;252 263 BOOL fDontSuggestAgain; 253 264 BOOL fInitialDriveScan; … … 712 723 } 713 724 714 rc = DosExitList(EXLST_ADD, DeInitFM3DLL);715 if (rc) {716 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,717 "DosExitList");718 }719 720 rcq = DosQueryProcAddr(FM3ModHandle, 1, "ResVersion", &pfnResVersion);721 if (!rcq)722 ret = pfnResVersion(&RVMajor, &RVMinor);725 rc = DosExitList(EXLST_ADD, DeInitFM3DLL); 726 if (rc) { 727 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 728 "DosExitList"); 729 } 730 731 rcq = DosQueryProcAddr(FM3ModHandle, 1, "ResVersion", &pfnResVersion); 732 if (!rcq) 733 ret = pfnResVersion(&RVMajor, &RVMinor); 723 734 else { 724 735 ret = 0; … … 739 750 return FALSE; 740 751 } 752 741 753 #if 0 742 754 PmPrintfDisplayInterfaceVersionInfo(); 743 755 PmPrintfQueueNameThisProcess(NULL); 744 756 #endif 757 745 758 if (!*profile) 746 759 strcpy(profile, PCSZ_FM3DOTINI); … … 769 782 } 770 783 771 // Save the FM2 save directory name. This is the location of the ini, dat files etc.784 // Save the FM2 save directory name. This is the location of the ini, dat files etc. 772 785 rc = save_dir2(temp); 773 786 if (rc) { … … 885 898 } 886 899 900 if (!StartFleshWorkThread()) 901 return FALSE; 902 887 903 // timer messages are sent from a separate thread -- start it 888 904 if (!StartTimer()) { … … 1166 1182 sizeof(PVOID)); 1167 1183 1168 if (DosCreateMutexSem(NULL, &hmtxFM2Globals, 0L, FALSE)) 1184 rc = DosCreateMutexSem(NULL, &hmtxFM2Globals, 0L, FALSE); 1185 if (rc) { 1169 1186 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1170 1187 PCSZ_DOSCREATEMUTEXSEM); 1188 } 1189 #if 0 // 2015-08-04 SHL FIXME to be gone 1171 1190 if (DosCreateMutexSem(NULL, &hmtxScanning, 0L, TRUE)) 1172 1191 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1173 1192 PCSZ_DOSCREATEMUTEXSEM); 1174 if (DosCreateMutexSem(NULL, &hmtxScanningLocalHD, 0L, FALSE)) 1193 #endif // 2015-08-04 SHL FIXME to be gone 1194 #if 0 // 2015-08-07 SHL FIXME to be gone 1195 rc = DosCreateMutexSem(NULL, &hmtxScanningLocalHD, 0L, FALSE); 1196 if (rc) { 1175 1197 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1176 1198 PCSZ_DOSCREATEMUTEXSEM); 1177 if (DosCreateMutexSem(NULL, &hmtxScanningLocal, 0L, FALSE))1178 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1179 PCSZ_DOSCREATEMUTEXSEM);1180 if ( DosCreateMutexSem(NULL, &hmtxFM2Delete, 0L, FALSE))1199 } 1200 #endif // 2015-08-07 SHL FIXME to be gone 1201 rc = DosCreateMutexSem(NULL, &hmtxFM2Delete, 0L, FALSE); 1202 if (rc) { 1181 1203 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1182 1204 PCSZ_DOSCREATEMUTEXSEM); 1183 if (DosCreateMutexSem(NULL, &hmtxFiltering, 0L, FALSE)) 1205 } 1206 rc = DosCreateMutexSem(NULL, &hmtxFiltering, 0L, FALSE); 1207 if (rc) { 1184 1208 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1185 1209 PCSZ_DOSCREATEMUTEXSEM); 1186 if (DosCreateEventSem(NULL, &hevTreeCnrScanComplete, 0L, TRUE)) 1210 } 1211 #if 0 // 2015-08-04 SHL FIXME to be gone 1212 rc = DosCreateEventSem(NULL, &hevTreeCnrScanComplete, 0L, TRUE); 1213 if (rc) { 1187 1214 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__, 1188 1215 PCSZ_DOSCREATEEVENTSEM); 1216 } 1217 #endif // 2015-08-04 SHL FIXME to be gone 1189 1218 1190 1219 /** … … 1653 1682 PrfQueryProfileData(fmprof, FM3Str, "DontAskGzip", &fDontAskGzip, &size); 1654 1683 1684 // 2015-08-11 SHL FIXME debug 1685 DbgMsg(pszSrcFile, __LINE__, "ShowEnv %u SwitchTree %u SwitchTreeExpand %u SwitchTreeOnFocus %u CollapseFirst %u", fShowEnv, fSwitchTreeOnDirChg, fSwitchTreeExpand, fSwitchTreeOnFocus, fCollapseFirst); 1686 DbgMsg(pszSrcFile, __LINE__, "RScanLocal %u RScanRemote %u RScanVirtual %u RScanSlow RScanNoWrite %u", fRScanLocal, fRScanRemote, fRScanVirtual, fRScanSlow, fRScanNoWrite); 1687 1655 1688 LoadDetailsSwitches(PCSZ_DIRCNR, &dsDirCnrDefault, FALSE); 1656 1689 -
trunk/dll/init.h
r1838 r1856 4 4 $Id$ 5 5 6 <<<description here>>>6 Initialization 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2008 -10Steven H. Levine9 Copyright (c) 2008, 2015 Steven H. Levine 10 10 11 11 Change log … … 107 107 extern ULONG ulTimeFmt; 108 108 extern ULONG ulDateFmt; 109 extern ULONG ulScanPostCnt;110 109 extern PCSZ FNT_HELVETICA; 111 110 extern PCSZ FNT_6HELVETICA; … … 239 238 extern HMTX hmtxFM2Globals; 240 239 extern HMTX hmtxFM2Delete; 240 241 #if 0 // 2015-08-07 SHL FIXME to be gone 241 242 extern HMTX hmtxScanning; 243 #endif // 2015-08-07 SHL FIXME to be gone 244 245 #if 0 // 2015-08-07 SHL FIXME to be gone 242 246 extern HMTX hmtxScanningLocalHD; 243 extern HMTX hmtxScanningLocal; 247 #endif // 2015-08-07 SHL FIXME to be gone 248 244 249 extern HMTX hmtxFiltering; 250 251 #if 0 // 2015-08-04 SHL FIXME to be gone 245 252 extern HEV hevTreeCnrScanComplete; 253 #endif // 2015-08-04 SHL FIXME to be gone 254 246 255 #endif 247 256 -
trunk/dll/mainwnd.c
r1844 r1856 117 117 02 Aug 15 GKY Remove unneed SubbyScan code and improve suppression of blank lines and 118 118 duplicate subdirectory name caused by running Stubby in worker threads. 119 duplicate subdirectory name caused by running Stubby in worker threads. 119 120 09 Aug 15 SHL Use RESTORE_STATE_... 121 13 Aug 15 SHL Sync with Flesh/Stubby mods 120 122 121 123 ***********************************************************************/ … … 239 241 USHORT shiftstate; 240 242 243 UINT cDirectoriesRestored; // 2015-08-12 SHL Incremented by RestoreDirCnrState 244 241 245 #pragma data_seg(GLOBAL2) 242 246 HMODULE FM3ModHandle; … … 1820 1824 MRESULT EXPENTRY DriveBackProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 1821 1825 { 1826 #if 0 // 2015-08-04 SHL FIXME to be gone 1822 1827 APIRET rc; 1828 #endif // 2015-08-04 SHL FIXME to be gone 1823 1829 1824 1830 static BOOL emphasized; … … 2095 2101 2096 2102 case WM_COMMAND: 2103 #if 0 // 2015-08-04 SHL FIXME to be gone 2097 2104 rc = DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT); 2098 2105 if (rc) 2099 2106 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosWaitEventSem"); 2107 #endif // 2015-08-04 SHL FIXME to be gone 2100 2108 2101 2109 switch(SHORT1FROMMP(mp1)) { … … 2136 2144 HWND hwndActive = TopWindow(hwnd, (HWND) 0); 2137 2145 if (hwndActive) 2146 DbgMsg(pszSrcFile, __LINE__, "WinSendMsg UM_DRIVECMD %c", *dv); // 2015-08-04 SHL FIXME debug 2138 2147 WinSendMsg(WinWindowFromID(hwndActive, FID_CLIENT), 2139 2148 UM_DRIVECMD, MPFROMP(dv), MPVOID); … … 3446 3455 HWND hwndDir, hwndC, hwndPPSave = NULLHANDLE; 3447 3456 SWP swp, swpO, swpN; 3448 ULONG size, numsaves = 0; 3457 ULONG size; 3458 ULONG numsaves = 0; 3449 3459 LONG x; 3450 3460 double xtrans, ytrans; … … 3464 3474 3465 3475 sprintf(szPrefix, "%s.", pszStateName); 3476 3477 DbgMsg(pszSrcFile, __LINE__, "RestoreDirCnrState %s", pszStateName); // 2015-08-13 SHL FIXME debug 3466 3478 3467 3479 // If restoring shutdown state bypass no-prescan drives … … 3533 3545 size = sizeof(ULONG); 3534 3546 if (PrfQueryProfileData(fmprof, FM3Str, szKey, (PVOID) &numsaves, &size)) { 3547 // 2015-08-13 SHL TreeCnrWndProc UM_RESCAN has already requested a UM_RESCAN2 which 3548 // will result in an extra UM_SHOWME 3549 // RestoreDirCnrState can be called before pending UM_SHOWMEs complete - oh well 3550 if (fSwitchTreeOnFocus && numsaves) 3551 cDirectoriesRestored = 1; 3552 else 3553 cDirectoriesRestored = 0; 3535 3554 if (fDeleteState) 3536 3555 PrfWriteProfileData(fmprof, FM3Str, szKey, NULL, 0L); … … 3631 3650 } 3632 3651 } 3652 // 2015-08-12 SHL Suppress drive tree updates if not last container to restore 3653 if (fSwitchTreeOnFocus) 3654 cDirectoriesRestored++; // 2015-08-12 SHL 3655 3633 3656 if (!PostMsg(hwndCnr, UM_SETUP2, NULL, NULL)) 3634 3657 WinSendMsg(hwndCnr, UM_SETUP2, NULL, NULL); … … 3660 3683 } 3661 3684 } 3662 } // for 3685 } // for numsaves 3663 3686 if (hwndPPSave) { 3664 3687 SavePresParams(hwndPPSave, PCSZ_DIRCNR); 3665 3688 WinDestroyWindow(hwndPPSave); 3666 3689 } 3690 DbgMsg(pszSrcFile, __LINE__, "RestoreDirCnrState returning fRestored %u", fRestored); // 2015-08-13 SHL FIXME debug 3667 3691 } 3692 3668 3693 return fRestored; 3669 3694 } … … 6533 6558 } 6534 6559 else if (SHORT1FROMMP(mp1) == MAIN_DRIVELIST) { 6560 DbgMsg(pszSrcFile, __LINE__, "MainWndProc CBN_ENTER ShowTreeRec(\"%s\")", path); // 2015-08-04 SHL FIXME debug 6535 6561 ShowTreeRec(WinWindowFromID(WinWindowFromID(hwndTree, 6536 6562 FID_CLIENT), … … 6663 6689 } 6664 6690 DosSleep(1); 6665 DbgMsg(pszSrcFile, __LINE__, "MainWndProc WM_CLOSE returning ");6691 DbgMsg(pszSrcFile, __LINE__, "MainWndProc WM_CLOSE returning with fAmClosing %u", fAmClosing); // 2015-08-16 SHL 6666 6692 6667 6693 return 0; // Suppress WinDefWindowProc WM_QUIT message generation … … 6693 6719 6694 6720 case WM_DESTROY: 6721 DbgMsg(pszSrcFile, __LINE__, "MainWndProc WM_DESTROY hwnd %p TID %u", hwnd, GetTidForThread()); // 2015-08-09 SHL FIXME debug 6695 6722 hwndMain = (HWND)0; 6696 6723 if (!PostMsg((HWND)0, WM_QUIT, MPVOID, MPVOID)) 6697 6724 WinSendMsg((HWND)0, WM_QUIT, MPVOID, MPVOID); 6698 6725 # ifdef FORTIFY 6726 DbgMsg(pszSrcFile, __LINE__, "MainWndProc WM_DESTROY hwnd %p TID %u", hwnd, GetTidForThread()); // 2015-08-09 SHL FIXME debug 6699 6727 free_commands(); 6700 6728 free_associations(); -
trunk/dll/mainwnd.h
r1550 r1856 4 4 $Id$ 5 5 6 <<description here>>6 fm/2 main window 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 20 09Steven H. Levine9 Copyright (c) 2001, 2015 Steven H. Levine 10 10 11 11 05 Sep 08 JBS Ticket 187: Refactor FM3DLL.H … … 14 14 21 Jun 09 GKY Added drive letter to bitmap buttons in drive bar; Eliminate static drive 15 15 letter windows; Use button ID to identify drive letter for processing. 16 13 Aug 15 SHL Sync with Flesh/Stubby updates 16 17 17 18 ***********************************************************************/ … … 91 92 extern PSZ pszFocusDir; 92 93 94 extern UINT cDirectoriesRestored; // 2015-08-12 SHL Incremented by RestoreDirCnrState 95 93 96 #define STATE_NAME_MAX_BYTES 256 94 97 -
trunk/dll/mainwnd2.c
r1782 r1856 1265 1265 break; 1266 1266 case IDM_CONFIGMENU: 1267 // 2014-05-17 SHL FIXME to use SetToggleChecks maybe1267 // 2014-05-17 SHL FIXME to use SetToggleChecks maybe 1268 1268 WinCheckMenuItem((HWND) mp2, IDM_TOOLSUBMENU, fToolbar); 1269 1269 WinCheckMenuItem((HWND) mp2, IDM_AUTOVIEW, fAutoView); … … 1272 1272 break; 1273 1273 case IDM_TOOLSUBMENU: 1274 // 2014-05-17 SHL FIXME to use SetToggleChecks maybe1274 // 2014-05-17 SHL FIXME to use SetToggleChecks maybe 1275 1275 WinCheckMenuItem((HWND) mp2, IDM_TOOLBAR, fToolbar); 1276 1276 WinCheckMenuItem((HWND) mp2, IDM_TEXTTOOLS, fTextTools); … … 1278 1278 break; 1279 1279 case IDM_WINDOWSMENU: 1280 // 2014-05-17 SHL FIXME to use SetToggleChecks maybe1280 // 2014-05-17 SHL FIXME to use SetToggleChecks maybe 1281 1281 WinCheckMenuItem((HWND) mp2, IDM_VTREE, (hwndTree != (HWND) 0)); 1282 1282 WinCheckMenuItem((HWND) mp2, IDM_TILEBACKWARDS, fTileBackwards); … … 1404 1404 CloseChildren(hwnd); 1405 1405 PostMsg(hwnd, UM_CLOSE, MPVOID, MPVOID); 1406 DbgMsg(pszSrcFile, __LINE__, "MainWndProc2 WM_CLOSE returning with fAmClosing %u", fAmClosing); // 2015-08-16 SHL 1406 1407 DosSleep(1); 1407 1408 return 0; // Suppress WinDefWindowProc WM_QUIT message generation -
trunk/dll/makefile
r1852 r1856 3 3 4 4 # Copyright (c) 1993-98 M. Kimes 5 # Copyright (c) 2002, 201 4Steven H. Levine5 # Copyright (c) 2002, 2015 Steven H. Levine 6 6 7 7 # 22 May 03 SHL Correct icon dependencies … … 47 47 # 21 Feb 14 JBS Ticket #500: Set only non-resource objects in FM3RES.DLL to high memory 48 48 # 24 Feb 14 JBS Ticket #500: Suspended use of high memory by commenting out the calls to exehdr 49 # 13 Aug 15 SHL Add listutil 49 50 50 51 # Environment: see makefile_pre.mk and makefile_post.mk … … 196 197 fonts.obj fortify.obj & 197 198 getnames.obj grep.obj grep2.obj i18nutil.obj info.obj inis.obj & 198 init.obj input.obj instant.obj key.obj killproc.obj literal.obj & 199 init.obj input.obj instant.obj key.obj killproc.obj & 200 listutil.obj literal.obj & 199 201 loadbmp.obj mainwnd.obj mainwnd2.obj makelist.obj menu.obj misc.obj & 200 202 mkdir.obj mle.obj newview.obj notebook.obj notify.obj objcnr.obj & -
trunk/dll/treecnr.c
r1828 r1856 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001 -2012Steven H. Levine9 Copyright (c) 2001, 2015 Steven H. Levine 10 10 11 11 16 Oct 02 SHL Handle large partitions … … 78 78 15 Sep 09 SHL Use UM_GREP when passing pathname 79 79 15 Nov 09 GKY Add semaphore to fix double names in tree container caused by UM_SHOWME 80 before scan completes80 before scan completes 81 81 22 Nov 09 GKY Add LVM.EXE to partition submenu 82 82 17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast 83 CHAR CONSTANT * as CHAR *.83 CHAR CONSTANT * as CHAR *. 84 84 11 Apr 10 GKY Fix drive tree rescan failure and program hang caused by event sem 85 never being posted85 never being posted 86 86 20 Nov 10 GKY Rework scanning code to remove redundant scans, prevent double directory 87 entries in the tree container, fix related semaphore performance using88 combination of event and mutex semaphores87 entries in the tree container, fix related semaphore performance using 88 combination of event and mutex semaphores 89 89 04 Aug 12 GKY Fix trap reported by Ben 90 90 30 Dec 12 GKY Changed refresh removable media to query LVM directly to call Rediscover_PRMs (Ticket 472); 91 Also added a tree rescan following volume detach.91 Also added a tree rescan following volume detach. 92 92 22 Feb 14 GKY Fix warn readonly yes don't ask to work when recursing directories. 93 93 07 Sep 14 GKY Fix tree container mis-draws (stacked icons with RWS) The problem was magnified 94 by RWS but I think the occasional extra blank directory or duplicating95 directories is related.94 by RWS but I think the occasional extra blank directory or duplicating 95 directories is related. 96 96 16 Mar 15 GKY Add semaphore hmtxFiltering to prevent freeing dcd while filtering. Prevents 97 a trap when FM2 is shutdown or the container is closed while tree98 container is still populating97 a trap when FM2 is shutdown or the container is closed while tree 98 container is still populating 99 99 02 May 15 GKY Changes to allow a JAVA executable object to be created using "Real object" 100 menu item on a jar file.100 menu item on a jar file. 101 101 12 Jul 15 GKY Fixed trap caused by pci->pszFileName being NullStr 102 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 102 103 103 104 ***********************************************************************/ … … 141 142 #include "select.h" // ExpandAll 142 143 #include "findrec.h" // FindCnrRecord, FindParentRecord, ShowCnrRecord 143 #include "flesh.h" // Flesh, UnFlesh144 #include "flesh.h" // AddFleshWorkRequest 144 145 #include "notify.h" // HideNote 145 146 #include "objwin.h" // MakeObjWin … … 165 166 #include "dirs.h" // save_dir2 166 167 #include "fortify.h" 167 #include "init.h" // GetTidForWindow168 #include "init.h" // NullStr etc. 168 169 #include "excputil.h" // xbeginthread 169 170 #include "copyf.h" // ignorereadonly … … 273 274 } 274 275 276 /** 277 * Find a record in tree view, move it so it shows in container and 278 * make it the current record 279 * @param hwndCnr is container which must be in tree view 280 * @param pszDir_ is full path name to find 281 */ 282 275 283 VOID ShowTreeRec(HWND hwndCnr, 276 CHAR * dirname,284 CHAR *pszDir_, 277 285 BOOL collapsefirst, 278 286 BOOL maketop) 279 287 { 280 /** 281 * Find a record in tree view, move it so it shows in container and 282 * make it the current record 283 */ 284 285 PCNRITEM pci, pciToSelect, pciP; 288 PCNRITEM pci; 289 PCNRITEM pciToSelect; 290 PCNRITEM pciP; 291 UINT retries; 286 292 BOOL quickbail = FALSE; 287 CHAR szDir[CCHMAXPATH], *p; 293 PSZ p; 294 UINT cDirLen; 295 BOOL found; 296 CHAR szDir[CCHMAXPATH]; 297 298 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec pszDir_ %s", pszDir_); // 2015-08-04 SHL FIXME debug 288 299 289 300 // already positioned to requested record? … … 291 302 CM_QUERYRECORDEMPHASIS, 292 303 MPFROMLONG(CMA_FIRST), MPFROMSHORT(CRA_CURSORED)); 293 if (pci && (INT) pci != -1 && !stricmp(pci->pszFileName, dirname)) { 294 quickbail = TRUE; // Bypass repositioning 304 if (pci && (INT)pci != -1 && !stricmp(pci->pszFileName, pszDir_)) { 305 found = TRUE; 306 quickbail = TRUE; // Already at requested record - bypass repositioning 295 307 goto MakeTop; 296 308 } 309 297 310 WinEnableWindowUpdate(hwndCnr, FALSE); 298 pci = FindCnrRecord(hwndCnr, dirname, NULL, TRUE, FALSE, TRUE); 299 if (!pci || (INT) pci == -1) { 300 *szDir = *dirname; 311 312 // 2015-08-13 SHL add retry logic 313 for (found = FALSE, retries = 0; !found && retries < 10; retries++) { 314 315 pci = FindCnrRecord(hwndCnr, 316 pszDir_, 317 NULL, // pciParent 318 TRUE, // partial 319 FALSE, // partmatch 320 TRUE); // noenv 321 322 if (pci && (INT)pci != -1) { 323 found = TRUE; 324 break; // Found it 325 } 326 327 // Try again expanding as needed 328 329 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec need expand"); // 2015-08-04 SHL FIXME debug 330 331 cDirLen = strlen(pszDir_); 332 333 *szDir = *pszDir_; // Drive letter 301 334 szDir[1] = ':'; 302 335 szDir[2] = '\\'; 303 336 szDir[3] = 0; 304 337 p = szDir + 3; // Point after root backslash 338 305 339 for (;;) { 306 pciP = FindCnrRecord(hwndCnr, szDir, NULL, TRUE, FALSE, TRUE); 307 if (pciP && (INT) pciP != -1) { 308 if (!stricmp(dirname, pciP->pszFileName)) 309 break; // Found it 310 if (~pciP->rc.flRecordAttr & CRA_EXPANDED) 311 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID); 312 strcpy(szDir, dirname); 313 if (p - szDir >= strlen(szDir)) 314 break; // Not root dir 315 p = strchr(p, '\\'); 316 if (p) { 317 *p = 0; // fixme? 318 p++; 319 } 320 else 321 break; 322 } 323 else 324 break; 325 DosSleep(0); 326 } // for 327 pci = FindCnrRecord(hwndCnr, dirname, NULL, TRUE, FALSE, TRUE); 328 } 329 if (pci && (INT) pci != -1) { 340 // Try to match path prefix 341 pciP = FindCnrRecord(hwndCnr, 342 szDir, 343 NULL, // pciParent 344 TRUE, // partial 345 FALSE, // partmatch 346 TRUE); // noenv 347 if (!pciP || (INT)pciP == -1) { 348 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(%s) returned %p", szDir, pciP); // 2015-08-04 SHL FIXME debug 349 WaitFleshWorkListEmpty(); // 2015-08-13 SHL 350 DosSleep(1000); 351 break; // No match 352 } 353 354 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord returned %p %s", pciP, pciP->pszFileName); // 2015-08-04 SHL FIXME debug 355 356 if (!stricmp(pszDir_, pciP->pszFileName)) { 357 pci = pciP; 358 found = TRUE; 359 break; // Got full match 360 } 361 362 if (~pciP->rc.flRecordAttr & CRA_EXPANDED) { 363 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec expanding %s", pciP->pszFileName); // 2015-08-04 SHL FIXME debug 364 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID); 365 DosSleep(100); // 2015-08-13 SHL Let PM catch up 366 // WaitFleshWorkListEmpty(); // 2015-08-13 SHL 367 } 368 369 WaitFleshWorkListEmpty(); // 2015-08-13 SHL 370 371 // Add next component to path 372 if (p - szDir >= cDirLen) 373 break; // Done 374 strcpy(szDir, pszDir_); // Reset 375 p = strchr(p, '\\'); // Find next backslash 376 if (!p) 377 break; // Give up 378 379 *p++ = 0; // Truncate at backslash 380 381 } // while expanding 382 383 } // for 384 385 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec retries %u pci %p pci->pszFileName %s",retries, pci, pci && (INT)pci != -1 ? pci->pszFileName : "(null)"); // 2015-08-04 SHL FIXME debug 386 387 if (found) { 388 // Found it 330 389 if (~pci->rc.flRecordAttr & CRA_CURSORED) { 331 390 if (collapsefirst) { … … 334 393 MPVOID, MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 335 394 while (pciP && (INT) pciP != -1) { 336 #if 1 // 05 Jan 08 SHL fixme to be sure this is correct code337 395 if (pciP->rc.flRecordAttr & CRA_EXPANDED) { 338 396 // collapse top level of all branches 339 397 WinSendMsg(hwndCnr, CM_COLLAPSETREE, MPFROMP(pciP), MPVOID); 340 398 } 341 #else // fixme to be gone342 if (toupper(*pciP->pszFileName) == toupper(*dirname)) {343 // collapse all levels if branch is our drive344 if (pciP->rc.flRecordAttr & CRA_EXPANDED)345 ExpandAll(hwndCnr, FALSE, pciP);346 }347 else if (pciP->rc.flRecordAttr & CRA_EXPANDED) {348 // collapse top level of all branches349 WinSendMsg(hwndCnr, CM_COLLAPSETREE, MPFROMP(pciP), MPVOID);350 }351 #endif352 399 pciP = WinSendMsg(hwndCnr, 353 400 CM_QUERYRECORD, … … 355 402 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 356 403 } // while 357 } 358 // expand all parent branches 404 } // if collapse 405 406 // Expand parent branches 407 // 2015-08-06 SHL FIXME to bypass if we did not collapse since search already expanded - maybe? 359 408 pciToSelect = pci; 360 409 for (;;) { … … 363 412 MPFROMP(pciToSelect), 364 413 MPFROM2SHORT(CMA_PARENT, CMA_ITEMORDER)); 365 if (pciP && (INT) pciP != -1) { 366 if (!(pciP->rc.flRecordAttr & CRA_EXPANDED)) 367 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID); 368 pciToSelect = pciP; 369 } 370 else 371 break; 414 if (!pciP || (INT)pciP == -1) 415 break; // Done 416 // Got parent 417 if (~pciP->rc.flRecordAttr & CRA_EXPANDED) 418 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID); 419 pciToSelect = pciP; 372 420 DosSleep(0); // Let GUI update 373 421 } // for 374 } 422 } // if not cursored 423 424 MakeTop: 375 425 // make record visible 376 MakeTop:377 426 pciToSelect = pci; 378 427 if (pciToSelect && (INT) pciToSelect != -1) { 379 //DbgMsg(pszSrcFile, __LINE__, "TOP %i %i", fTopDir, maketop);428 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec %p fTopDir %i maketop %i", pciToSelect, fTopDir, maketop); // 2015-08-04 SHL FIXME debug 380 429 if (fSwitchTreeExpand && ~pciToSelect->rc.flRecordAttr & CRA_EXPANDED) 381 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID);382 if (fTopDir || maketop) {383 ShowCnrRecord(hwndCnr, (PMINIRECORDCORE)pciToSelect);384 } 430 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID); 431 if (fTopDir || maketop) 432 ShowCnrRecord(hwndCnr, (PMINIRECORDCORE)pciToSelect); 433 385 434 if (!quickbail) { 435 WaitFleshWorkListEmpty(); // 2015-08-07 SHL FIXME try to ensure contents stable 436 DbgMsg(pszSrcFile, __LINE__, "WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED) \"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug 386 437 WinSendMsg(hwndCnr, 387 438 CM_SETRECORDEMPHASIS, … … 391 442 } 392 443 } 444 393 445 WinEnableWindowUpdate(hwndCnr, TRUE); 394 446 } … … 649 701 } 650 702 703 ULONG ulScanPostCnt; 704 651 705 MRESULT EXPENTRY TreeObjWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 652 706 { 653 707 DIRCNRDATA *dcd; 708 709 #if 0 // 2015-08-04 SHL FIXME to be gone 710 APIRET rc; 711 #endif // 2015-08-04 SHL FIXME to be gone 654 712 655 713 switch (msg) { … … 661 719 dcd = INSTDATA(hwnd); 662 720 if (dcd) { 663 BOOL tempsusp, tempfollow, temptop; 664 665 DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT); 666 tempsusp = dcd->suspendview; 667 dcd->suspendview = TRUE; 668 tempfollow = fFollowTree; 669 fFollowTree = FALSE; 670 if (mp2) { 671 temptop = fTopDir; 672 fTopDir = TRUE; 673 } 674 ShowTreeRec(dcd->hwndCnr, (CHAR *)mp1, fCollapseFirst, TRUE); 675 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID); 676 dcd->suspendview = (USHORT) tempsusp; 677 fFollowTree = tempfollow; 678 if (mp2) 679 fTopDir = temptop; 721 722 #if 0 // 2015-08-04 SHL FIXME to be gone 723 rc = DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT); 724 if (rc) 725 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 726 #endif // 2015-08-04 SHL FIXME to be gone 727 728 /* Hold off if switching on focus change and 729 RestoreDirCnrState has restored one or directory directory containers 730 See RestoreDirCnrState() 731 */ 732 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME cDirectoriesRestored %u", cDirectoriesRestored, fInitialDriveScan); // 2015-08-04 SHL FIXME debug 733 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME %s)", mp1); // 2015-08-04 SHL FIXME debug 734 735 if (cDirectoriesRestored > 0) 736 cDirectoriesRestored--; 737 738 if (!cDirectoriesRestored) { 739 BOOL tempsusp = dcd->suspendview; 740 BOOL tempfollow = fFollowTree; 741 BOOL temptop; 742 dcd->suspendview = TRUE; 743 fFollowTree = FALSE; 744 if (mp2) { 745 temptop = fTopDir; 746 fTopDir = TRUE; 747 } 748 749 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME calling ShowTreeRec(\"%s\")", mp1); // 2015-08-04 SHL FIXME debug 750 ShowTreeRec(dcd->hwndCnr, (CHAR *)mp1, fCollapseFirst, TRUE); 751 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME calling PostMsg(IDM_UPDATE)"); // 2015-08-04 SHL FIXME debug 752 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID); 753 754 dcd->suspendview = (USHORT)tempsusp; // Restore 755 fFollowTree = tempfollow; // Restore 756 if (mp2) 757 fTopDir = temptop; // Restore 758 } 680 759 } 681 760 free((CHAR *)mp1); … … 717 796 dcd->suspendview = TRUE; 718 797 ExpandAll(dcd->hwndCnr, 719 (SHORT1FROMMP(mp1) == IDM_EXPAND), (PCNRITEM) mp2);798 (SHORT1FROMMP(mp1) == IDM_EXPAND), (PCNRITEM) mp2); 720 799 DosSleep(1); // Fixes tree epansion (dir text and icons all placed on 721 // the same line as the drive) failure on startup using RWS800 // the same line as the drive) failure on startup using RWS 722 801 dcd->suspendview = (USHORT) tempsusp; 723 802 PostMsg(dcd->hwndCnr, UM_FILTER, MPVOID, MPVOID); … … 789 868 if (cnri.cRecords) { 790 869 sprintf(s, GetPString(IDS_NUMDRIVESTEXT), cnri.cRecords); 791 if (pci && (INT) pci != -1 && pci->pszFileName != NullStr) { //fixme? will try checking pci->pszFileName instead of the pointer870 if (pci && (INT) pci != -1 && pci->pszFileName != NullStr) { //fixme? will try checking pci->pszFileName instead of the pointer 792 871 if (!(driveflags[toupper(*pci->pszFileName) - 'A'] & 793 872 DRIVE_REMOVABLE) || … … 809 888 } 810 889 else 811 *szFree = 0;812 //Show information on status line not shown in the tree container890 *szFree = 0; 891 //Show information on status line not shown in the tree container 813 892 driveserial[toupper(*pci->pszFileName) - 'A'] = volser.serial; 814 if (CheckDrive(toupper(*pci->pszFileName), FileSystem, &type) == -1 ||815 fShowFSTypeInTree)893 if (CheckDrive(toupper(*pci->pszFileName), FileSystem, &type) == -1 || 894 fShowFSTypeInTree) 816 895 strcpy(FileSystem, NullStr); 817 896 if (fShowDriveLabelInTree) … … 826 905 sprintf(s, 827 906 GetPString(fShowFSTypeInTree ? IDS_TREESTATUSSTART1TEXT : 828 fShowDriveLabelInTree ? IDS_TREESTATUSSTART2TEXT :829 IDS_TREESTATUSSTARTTEXT), toupper(*pci->pszFileName),830 FileSystem, szTmpLabel, volser.serial, szFree);907 fShowDriveLabelInTree ? IDS_TREESTATUSSTART2TEXT : 908 IDS_TREESTATUSSTARTTEXT), toupper(*pci->pszFileName), 909 FileSystem, szTmpLabel, volser.serial, szFree); 831 910 strcat(s, temp); 832 911 } … … 835 914 sprintf(&s[strlen(s)], 836 915 GetPString(fShowFSTypeInTree ? IDS_TREESTATUSSTART1TEXT : 837 fShowDriveLabelInTree ? IDS_TREESTATUSSTART2TEXT :838 IDS_TREESTATUSSTARTTEXT), toupper(*pci->pszFileName),839 FileSystem, szTmpLabel, volser.serial, szFree);916 fShowDriveLabelInTree ? IDS_TREESTATUSSTART2TEXT : 917 IDS_TREESTATUSSTARTTEXT), toupper(*pci->pszFileName), 918 FileSystem, szTmpLabel, volser.serial, szFree); 840 919 strcat(s, "]"); 841 920 } … … 861 940 pci = FindParentRecord(dcd->hwndCnr, pci); 862 941 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 863 UnFlesh(dcd->hwndCnr, pci); 864 } 865 } 866 } 867 // 21 Sep 09 SHL fixme to know why checking again - focus change? 942 WaitFleshWorkListEmpty(); // 2015-08-13 SHL in case pci still in work list 943 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 944 } 945 } 946 } 947 // 21 Sep 09 SHL FIXME to know why checking again - focus change? 868 948 if (dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) 869 949 WinSetWindowText(hwndStatus, s); … … 873 953 case UM_RESCAN: 874 954 // populate container 875 DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT); 876 DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 955 #if 0 // 2015-08-04 SHL FIXME to be gone 956 rc = DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT); 957 if (rc) 958 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosWaitEventSem"); 959 rc = DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 960 if (rc) 961 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem"); 962 #endif // 2015-08-04 SHL FIXME to be gone 963 877 964 dcd = WinQueryWindowPtr(hwnd, QWL_USER); 878 965 if (!dcd) … … 885 972 CM_SCROLLWINDOW, 886 973 MPFROMSHORT(CMA_HORIZONTAL), MPFROMLONG(-1)); 974 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc FillTreeCnr()"); // 2015-08-04 SHL FIXME debug 887 975 FillTreeCnr(dcd->hwndCnr, dcd->hwndParent); 888 976 if (fOkayMinimize) { … … 892 980 WinSendMsg(dcd->hwndCnr, 893 981 CM_INVALIDATERECORD, 894 MPVOID, MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION)); 982 MPVOID, MPFROM2SHORT(0, CMA_ERASE | CMA_REPOSITION)); 983 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc PostMsg(UM_RESCAN)"); // 2015-08-04 SHL FIXME debug 895 984 PostMsg(dcd->hwndCnr, UM_RESCAN, MPVOID, MPVOID); 896 985 } … … 917 1006 case IDM_DELETE: 918 1007 case IDM_PERMDELETE: 919 if (li->type == IDM_DELETE)920 ignorereadonly = FALSE;1008 if (li->type == IDM_DELETE) 1009 ignorereadonly = FALSE; 921 1010 if (PostMsg(hwnd, UM_MASSACTION, mp1, mp2)) 922 1011 return (MRESULT) TRUE; … … 1037 1126 DIRCNRDATA *dcd = INSTDATA(hwnd); 1038 1127 PCNRITEM pci; 1128 APIRET rc; 1039 1129 1040 1130 switch (msg) { … … 1124 1214 WinSetWindowText(hwndStatus2, NullStr); 1125 1215 } 1126 // 13 Jul 09 SHL fixmeto make sense1216 // 13 Jul 09 SHL FIXME to make sense 1127 1217 if (msg == UM_TIMER) 1128 1218 return 0; … … 1138 1228 FSALLOCATE fsa; 1139 1229 1140 pci = (PCNRITEM) CurrentRecord(hwnd);1141 if (pci && (INT) pci != -1) {1230 pci = (PCNRITEM)CurrentRecord(hwnd); 1231 if (pci && (INT)pci != -1) { 1142 1232 if (IsRoot(pci->pszFileName) || !DosQueryFSInfo(toupper(*pci->pszFileName) - '@', 1143 1233 FSIL_ALLOC, &fsa, … … 1235 1325 else 1236 1326 WinSetWindowText(WinWindowFromID(dcd->hwndFrame, 1237 MAIN_STATUS), pci->pszFileName);1327 MAIN_STATUS), pci->pszFileName); 1238 1328 if (fMoreButtons && hwndName) { 1239 1329 CHAR szDate[DATE_BUF_BYTES]; … … 1248 1338 } 1249 1339 } 1340 DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_RESCAN PostMsg(UM_RESCAN2, %s)", pci->pszFileName); // 2015-08-04 SHL FIXME debug 1250 1341 PostMsg(dcd->hwndObject, UM_RESCAN2, MPFROMP(pci), MPVOID); 1251 1342 if (hwndStatus2) … … 1515 1606 } 1516 1607 } 1517 pDItem = DrgQueryDragitemPtr(pDInfo, // Access DRAGITEM1518 0); // Index to DRAGITEM1519 if (DrgVerifyRMF(pDItem, // Check valid rendering1608 pDItem = DrgQueryDragitemPtr(pDInfo, // Access DRAGITEM 1609 0); // Index to DRAGITEM 1610 if (DrgVerifyRMF(pDItem, // Check valid rendering 1520 1611 (CHAR *) DRM_OS2FILE, // mechanisms and data 1521 NULL) || DrgVerifyRMF(pDItem,1522 (CHAR *) DRM_FM2ARCMEMBER,1523 (CHAR *) DRF_FM2ARCHIVE)) { // formats1524 DrgFreeDraginfo(pDInfo); // Free DRAGINFO1612 NULL) || DrgVerifyRMF(pDItem, 1613 (CHAR *) DRM_FM2ARCMEMBER, 1614 (CHAR *) DRF_FM2ARCHIVE)) { // formats 1615 DrgFreeDraginfo(pDInfo); // Free DRAGINFO 1525 1616 if (!pci || (INT) pci == -1) 1526 1617 return MRFROM2SHORT(DOR_DROP, DO_MOVE); … … 1530 1621 if (toupper(*pci->pszFileName) < 'C') 1531 1622 return MRFROM2SHORT(DOR_DROP, DO_COPY); 1532 return MRFROM2SHORT(DOR_DROP, // Return okay to drop1623 return MRFROM2SHORT(DOR_DROP, // Return okay to drop 1533 1624 ((fCopyDefault) ? DO_COPY : DO_MOVE)); 1534 1625 } 1535 DrgFreeDraginfo(pDInfo); // Free DRAGINFO1536 } 1537 return MRFROM2SHORT(DOR_NODROP, 0); // Drop not valid1626 DrgFreeDraginfo(pDInfo); // Free DRAGINFO 1627 } 1628 return MRFROM2SHORT(DOR_NODROP, 0); // Drop not valid 1538 1629 1539 1630 case CN_INITDRAG: … … 1754 1845 case CN_CONTEXTMENU: 1755 1846 { 1756 PCNRITEM pci = (PCNRITEM) mp2;1847 PCNRITEM pci = (PCNRITEM)mp2; 1757 1848 BOOL wasFollowing; 1758 1849 1759 //DosEnterCritSec(); //GKY 11-28-081760 1850 wasFollowing = fFollowTree; 1761 1851 fFollowTree = FALSE; 1762 //DosExitCritSec(); 1763 if (pci && (INT) pci != -1 && !(pci->flags & RECFLAGS_ENV)) { 1764 WinSendMsg(hwnd, 1765 CM_SETRECORDEMPHASIS, 1766 MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_CURSORED)); 1767 MarkAll(hwnd, FALSE, FALSE, TRUE); 1768 if (!(pci->attrFile & FILE_DIRECTORY)) 1769 dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &FileMenu, FILE_POPUP); 1770 else if (!IsRoot(pci->pszFileName)) 1771 dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP); 1772 else 1773 dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &TreeMenu, TREE_POPUP); 1852 if (pci && (INT)pci != -1 && !(pci->flags & RECFLAGS_ENV)) { 1853 // 2015-08-09 SHL try to ensure contents stable 1854 if (!IsFleshWorkListEmpty()) 1855 WinPostMsg(hwnd, msg, mp1, mp2); // Try again later 1856 else { 1857 WinSendMsg(hwnd, 1858 CM_SETRECORDEMPHASIS, 1859 MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_CURSORED)); 1860 MarkAll(hwnd, FALSE, FALSE, TRUE); 1861 if (!(pci->attrFile & FILE_DIRECTORY)) 1862 dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &FileMenu, FILE_POPUP); 1863 else if (!IsRoot(pci->pszFileName)) 1864 dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP); 1865 else 1866 dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &TreeMenu, TREE_POPUP); 1867 } 1774 1868 } 1775 1869 else { … … 1798 1892 } 1799 1893 } 1800 //DosEnterCritSec(); //GKY 11-28-081801 1894 fFollowTree = wasFollowing; 1802 //DosExitCritSec();1803 1895 } 1804 1896 break; … … 1837 1929 driveserial[toupper(*pci->pszFileName) - 'A'] != 1838 1930 volser.serial) 1839 UnFlesh(hwnd, pci); 1931 { 1932 WaitFleshWorkListEmpty(); // 2015-08-13 SHL in case pci still in work list 1933 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 1934 } 1840 1935 if (SHORT2FROMMP(mp1) != CN_COLLAPSETREE || 1841 1936 (!volser.serial || 1842 1937 driveserial[toupper(*pci->pszFileName) - 'A'] != 1843 1938 volser.serial)) { 1844 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && Flesh(hwnd, pci)1845 &&!dcd->suspendview && fTopDir) {1939 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && AddFleshWorkRequest(hwnd, pci, eFlesh) 1940 &&!dcd->suspendview && fTopDir) { 1846 1941 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); 1847 1942 //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); … … 1852 1947 else { 1853 1948 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 1854 UnFlesh(hwnd, pci); 1949 WaitFleshWorkListEmpty(); // 2015-08-13 SHL in case pci still in work list 1950 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 1855 1951 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 1856 1952 if (!fAlertBeepOff) … … 1859 1955 } 1860 1956 else if (SHORT2FROMMP(mp1) == CN_EXPANDTREE) { 1861 if (Flesh(hwnd, pci) && !dcd->suspendview && fTopDir){ 1957 // 2015-08-04 SHL 1958 #if 1 1959 AddFleshWorkRequest(hwnd, pci, eFlesh); // forceFlesh 1960 if (!dcd->suspendview && fTopDir) { 1961 DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_TOPDIR %p pci %p", hwnd, pci); // 2015-08-04 SHL FIXME debug 1862 1962 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); 1863 //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci);1864 1963 } 1964 #else 1965 if (Flesh(hwnd, pci) && !dcd->suspendview && fTopDir) { 1966 DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_TOPDIR %p pci %p", hwnd, pci); // 2015-08-04 SHL FIXME debug 1967 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); 1968 } 1969 #endif 1865 1970 } 1866 1971 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && !dcd->suspendview){ 1972 DbgMsg(pszSrcFile, __LINE__, "UM_FILTER %p pci %p", hwnd, pci); 1867 1973 WinSendMsg(hwnd, UM_FILTER, MPVOID, MPVOID); 1868 //DbgMsg(pszSrcFile, __LINE__, "UM_FILTER %p pci %p", hwnd, pci);1869 1974 } 1870 1975 } … … 1892 1997 1893 1998 if (dir) { 1999 DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_SHOWME PostMsg(UM_SHOWME, %s)", dir); // 2015-08-13 SHL FIXME debug 1894 2000 if (!PostMsg(dcd->hwndObject, UM_SHOWME, MPFROMP(dir), MPVOID)) 1895 2001 free(dir); 2002 else 2003 SetFleshFocusDrive(*dir); 1896 2004 } 1897 2005 } … … 1900 2008 case UM_TOPDIR: 1901 2009 if (mp1) { 1902 1903 2010 PCNRITEM pci = (PCNRITEM) mp1; 1904 1905 2011 ShowCnrRecord(hwnd, (PMINIRECORDCORE) pci); 1906 2012 } … … 1912 2018 HDIR hDir = HDIR_CREATE; 1913 2019 ULONG nm = 1; 1914 APIRET status;2020 // APIRET status; 1915 2021 BOOL IsOk = FALSE; 1916 2022 ULONG ulDriveNum, ulDriveMap; … … 1919 2025 INT x; 1920 2026 1921 DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT); 1922 DosQueryEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 2027 #if 0 // 2015-08-04 SHL FIXME to be gone 2028 rc = DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT); 2029 if (rc) 2030 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem"); 2031 #endif // 2015-08-04 SHL FIXME to be gone 2032 2033 #if 0 // 2015-08-04 SHL FIXME to be gone 2034 rc = DosQueryEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 2035 if (rc) 2036 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosQueryEventSem"); 1923 2037 if (ulScanPostCnt < 1) 1924 return 0; 1925 DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 2038 return 0; 2039 rc = DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 2040 if (rc) 2041 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem"); 2042 #endif // 2015-08-04 SHL FIXME to be gone 2043 1926 2044 if (fFollowTree) 1927 2045 fl = 0; … … 1938 2056 if (hwndStatus) 1939 2057 WinSetWindowText(hwndStatus, (CHAR *) GetPString(IDS_RESCANSUGTEXT)); 1940 DosPostEventSem(hevTreeCnrScanComplete); 2058 2059 #if 0 // 2015-08-04 SHL FIXME to be gone 2060 rc = DosPostEventSem(hevTreeCnrScanComplete); 2061 if (rc && rc != ERROR_ALREADY_POSTED) 2062 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 2063 #endif // 2015-08-04 SHL FIXME to be gone 2064 1941 2065 return 0; 1942 2066 } … … 1958 2082 } // for 1959 2083 RemoveCnrItems(hwnd, pciP, 1, CMA_FREE | CMA_INVALIDATE); 1960 DosPostEventSem(hevTreeCnrScanComplete); 2084 2085 #if 0 // 2015-08-04 SHL FIXME to be gone 2086 rc = DosPostEventSem(hevTreeCnrScanComplete); 2087 if (rc && rc != ERROR_ALREADY_POSTED) 2088 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 2089 #endif // 2015-08-04 SHL FIXME to be gone 1961 2090 return 0; 1962 2091 } … … 1996 2125 memset(&volser, 0, sizeof(volser)); 1997 2126 DosError(FERR_DISABLEHARDERR); 1998 status= DosQueryFSInfo(toupper(*pci->pszFileName) - '@',1999 FSIL_VOLSER, &volser,2000 (ULONG) sizeof(volser));2001 if (! status) {2127 rc = DosQueryFSInfo(toupper(*pci->pszFileName) - '@', 2128 FSIL_VOLSER, &volser, 2129 (ULONG) sizeof(volser)); 2130 if (!rc) { 2002 2131 if (!volser.serial || driveserial[x] != volser.serial) { 2132 #if 1 // 2015-08-04 SHL FIXME to be gone 2133 AddFleshWorkRequest(hwnd, pciP, eFlesh); // forceFlesh 2134 #else 2003 2135 Flesh(hwnd, pciP); 2136 #endif // 2015-08-04 SHL FIXME to be gone 2004 2137 driveserial[x] = volser.serial; 2005 2138 } … … 2008 2141 MPFROMP(pciP), 2009 2142 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 2010 if (!pciL) { 2011 Flesh(hwnd, pciP); 2012 } 2143 if (!pciL) { 2144 #if 1 // 2015-08-04 SHL FIXME to be gone 2145 AddFleshWorkRequest(hwnd, pciP, eFlesh); // forceFlesh 2146 #else 2147 Flesh(hwnd, pciP); 2148 #endif // 2015-08-04 SHL FIXME to be gone 2149 } 2013 2150 if ((fShowFSTypeInTree || fShowDriveLabelInTree) && 2014 2151 strlen(pciP->pszFileName) < 4) { … … 2027 2164 else { 2028 2165 driveserial[x] = -1; 2029 UnFlesh(hwnd, pci); 2166 WaitFleshWorkListEmpty(); // 2015-08-13 SHL in case pci still in work list 2167 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2030 2168 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2031 PostMsg(hwnd, UM_SETUP2, MPFROMP(pci), MPFROMLONG(status)); 2032 DosPostEventSem(hevTreeCnrScanComplete); 2169 PostMsg(hwnd, UM_SETUP2, MPFROMP(pci), MPFROMLONG(rc)); 2170 2171 #if 0 // 2015-08-04 SHL FIXME to be gone 2172 rc = DosPostEventSem(hevTreeCnrScanComplete); 2173 if (rc && rc != ERROR_ALREADY_POSTED) 2174 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 2175 #endif // 2015-08-04 SHL FIXME to be gone 2033 2176 return 0; 2034 2177 } 2035 2178 } 2036 status= 0;2179 rc = 0; 2037 2180 IsOk = (IsRoot(pci->pszFileName) && 2038 2181 IsValidDrive(toupper(*pci->pszFileName))); 2039 2182 if (!IsOk) { 2040 2183 DosError(FERR_DISABLEHARDERR); 2041 status= DosFindFirst(pci->pszFileName, &hDir,2042 FILE_NORMAL | FILE_DIRECTORY |2043 FILE_ARCHIVED | FILE_READONLY |2044 FILE_HIDDEN | FILE_SYSTEM,2045 &ffb, sizeof(ffb), &nm, FIL_STANDARD);2184 rc = DosFindFirst(pci->pszFileName, &hDir, 2185 FILE_NORMAL | FILE_DIRECTORY | 2186 FILE_ARCHIVED | FILE_READONLY | 2187 FILE_HIDDEN | FILE_SYSTEM, 2188 &ffb, sizeof(ffb), &nm, FIL_STANDARD); 2046 2189 priority_bumped(); 2047 2190 } 2048 if (! status) {2191 if (!rc) { 2049 2192 if (!IsOk) 2050 2193 DosFindClose(hDir); … … 2053 2196 PostMsg(hwnd, 2054 2197 WM_COMMAND, MPFROM2SHORT(IDM_SHOWALLFILES, 0), MPVOID); 2055 DosPostEventSem(hevTreeCnrScanComplete); 2198 2199 #if 0 // 2015-08-04 SHL FIXME to be gone 2200 rc = DosPostEventSem(hevTreeCnrScanComplete); 2201 if (rc && rc != ERROR_ALREADY_POSTED) 2202 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 2203 #endif // 2015-08-04 SHL FIXME to be gone 2056 2204 return 0; 2057 2205 } 2058 2206 if ((shiftstate & (KC_CTRL | KC_SHIFT)) == (KC_CTRL | KC_SHIFT)) { 2059 2207 OpenObject(pci->pszFileName, Settings, dcd->hwndFrame); 2060 DosPostEventSem(hevTreeCnrScanComplete); 2208 2209 #if 0 // 2015-08-04 SHL FIXME to be gone 2210 rc = DosPostEventSem(hevTreeCnrScanComplete); 2211 if (rc && rc != ERROR_ALREADY_POSTED) 2212 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 2213 #endif // 2015-08-04 SHL FIXME to be gone 2061 2214 return 0; 2062 2215 } … … 2064 2217 if (!ParentIsDesktop(hwnd, dcd->hwndParent)) { 2065 2218 if (FindDirCnrByName(pci->pszFileName, TRUE)) { 2066 DosPostEventSem(hevTreeCnrScanComplete); 2219 2220 #if 0 // 2015-08-04 SHL FIXME to be gone 2221 rc = DosPostEventSem(hevTreeCnrScanComplete); 2222 if (rc && rc != ERROR_ALREADY_POSTED) 2223 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 2224 #endif // 2015-08-04 SHL FIXME to be gone 2067 2225 return 0; 2068 2226 } … … 2088 2246 } 2089 2247 OpenObject(pci->pszFileName, s, dcd->hwndFrame); 2090 DosPostEventSem(hevTreeCnrScanComplete); 2248 2249 #if 0 // 2015-08-04 SHL FIXME to be gone 2250 rc = DosPostEventSem(hevTreeCnrScanComplete); 2251 if (rc && rc != ERROR_ALREADY_POSTED) 2252 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 2253 #endif // 2015-08-04 SHL FIXME to be gone 2091 2254 return 0; 2092 2255 } … … 2123 2286 else { 2124 2287 if (!IsRoot(pci->pszFileName)) { 2125 NotifyError(pci->pszFileName, status);2288 NotifyError(pci->pszFileName, rc); 2126 2289 RemoveCnrItems(hwnd, pci, 1, CMA_FREE | CMA_INVALIDATE); 2127 2290 } … … 2132 2295 if (fFollowTree) 2133 2296 WinSetFocus(HWND_DESKTOP, hwnd); 2134 DosPostEventSem(hevTreeCnrScanComplete); 2297 2298 #if 0 // 2015-08-04 SHL FIXME to be gone 2299 rc = DosPostEventSem(hevTreeCnrScanComplete); 2300 if (rc && rc != ERROR_ALREADY_POSTED) 2301 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 2302 #endif // 2015-08-04 SHL FIXME to be gone 2135 2303 } 2136 2304 return 0; … … 2235 2403 WinEnableMenuItem((HWND) mp2, IDM_PARTITION, fMiniLVM); 2236 2404 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONDF, fDFSee); 2237 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui);2238 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVM, fLVM);2405 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui); 2406 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVM, fLVM); 2239 2407 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONFD, fFDisk); 2240 2408 … … 2266 2434 WinEnableMenuItem((HWND) mp2, IDM_PARTITION, fMiniLVM); 2267 2435 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONDF, fDFSee); 2268 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui);2269 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVM, fLVM);2436 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVMG, fLVMGui); 2437 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONLVM, fLVM); 2270 2438 WinEnableMenuItem((HWND) mp2, IDM_PARTITIONFD, fFDisk); 2271 2439 break; … … 2350 2518 dcd->suspendview = (USHORT) tempsusp; 2351 2519 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2352 //DbgMsg(pszSrcFile, __LINE__, "UM_RESCAN %p pci %s", hwnd, (CHAR *) mp1);2353 2520 } 2354 2521 return 0; … … 2356 2523 case UM_DRIVECMD: 2357 2524 if (mp1) { 2525 DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_DRIVECMD ShowTreeRec(\"%s\")", mp1); 2358 2526 ShowTreeRec(hwnd, (CHAR *)mp1, FALSE, TRUE); 2527 DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc PostMsg(IDM_UPDATE)"); 2359 2528 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_UPDATE, 0), MPVOID); 2360 2529 } … … 2386 2555 RemoveCnrItems(hwnd, pci, 1, CMA_FREE); 2387 2556 else 2388 Flesh(hwnd, pci);2557 AddFleshWorkRequest(hwnd, pci, eFlesh); 2389 2558 } 2390 2559 if (info->prev) … … 2461 2630 } 2462 2631 apptail = info; 2463 }2464 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);2632 } 2633 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID); 2465 2634 } 2466 2635 } … … 2612 2781 NULL, NULL, 2613 2782 "%s", PCSZ_LVMGUICMD); 2614 break;2783 break; 2615 2784 2616 2785 case IDM_PARTITIONLVM: … … 2627 2796 2628 2797 case IDM_REFRESHREMOVABLES: 2629 { 2630 PFN Rediscover_PRMs; 2631 HMODULE hmod = 0; 2632 APIRET rc; 2633 CHAR objerr[CCHMAXPATH]; 2634 2635 rc = DosLoadModule(objerr, sizeof(objerr), "LVM", &hmod); 2636 if (!rc) { 2637 rc = DosQueryProcAddr(hmod, 70, NULL, &Rediscover_PRMs); 2638 if (!rc) 2798 { 2799 PFN Rediscover_PRMs; 2800 HMODULE hmod = 0; 2801 CHAR objerr[CCHMAXPATH]; 2802 2803 rc = DosLoadModule(objerr, sizeof(objerr), "LVM", &hmod); 2804 if (!rc) { 2805 rc = DosQueryProcAddr(hmod, 70, NULL, &Rediscover_PRMs); 2806 if (!rc) 2639 2807 Rediscover_PRMs(&rc); 2640 DosFreeModule(hmod);2641 }2642 if (!rc)2808 DosFreeModule(hmod); 2809 } 2810 if (!rc) 2643 2811 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID); 2644 break;2645 }2812 break; 2813 } 2646 2814 2647 2815 case IDM_SORTNAME: … … 2802 2970 case IDM_UPDATE: 2803 2971 { 2804 PCNRITEM pci = (PCNRITEM)CurrentRecord(hwnd); 2972 // 2015-08-07 SHL FIXME select 2973 PCNRITEM pci; 2974 if (!IsFleshWorkListEmpty()) 2975 break; // 2015-08-07 SHL hold off until stable 2976 pci = (PCNRITEM)CurrentRecord(hwnd); 2805 2977 if (pci && (INT)pci != -1) { 2806 2978 struct … … 2817 2989 if (pci->attrFile & FILE_DIRECTORY) { 2818 2990 if (pci->flags & RECFLAGS_UNDERENV) 2819 break; 2820 DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT); 2821 DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 2822 UnFlesh(hwnd, pci); 2991 break; 2992 2993 #if 0 // 2015-08-04 SHL FIXME to be gone 2994 rc = DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT); 2995 if (rc) 2996 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem"); 2997 #endif // 2015-08-04 SHL FIXME to be gone 2998 2999 #if 0 // 2015-08-04 SHL FIXME to be gone 3000 rc = DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt); 3001 if (rc) 3002 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem"); 3003 #endif // 2015-08-04 SHL FIXME to be gone 3004 3005 // Can't wait here 3006 // WaitFleshWorkListEmpty(); // 2015-08-13 SHL in case pci still in work list 3007 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2823 3008 // Check if drive type might need update 2824 3009 if ((driveflag & (DRIVE_INVALID | DRIVE_NOPRESCAN)) || … … 2828 3013 if (driveflag & DRIVE_INVALID) 2829 3014 pci->rc.hptrIcon = hptrDunno; 2830 else if (strlen(pci->pszFileName) < 4) {3015 else if (strlen(pci->pszFileName) < 4) { 2831 3016 SelectDriveIcon(pci); 2832 if (fShowFSTypeInTree || fShowDriveLabelInTree) {2833 strcpy(szBuf, pci->pszFileName);2834 strcat(szBuf, " [");2835 strcat(szBuf, fShowFSTypeInTree ? FileSystem : volser.volumelabel);2836 strcat(szBuf, "]");2837 pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__);2838 pci->rc.pszIcon = pci->pszDisplayName;2839 }2840 }3017 if (fShowFSTypeInTree || fShowDriveLabelInTree) { 3018 strcpy(szBuf, pci->pszFileName); 3019 strcat(szBuf, " ["); 3020 strcat(szBuf, fShowFSTypeInTree ? FileSystem : volser.volumelabel); 3021 strcat(szBuf, "]"); 3022 pci->pszDisplayName = xstrdup(szBuf, pszSrcFile, __LINE__); 3023 pci->rc.pszIcon = pci->pszDisplayName; 3024 } 3025 } 2841 3026 WinSendMsg(hwnd, 2842 3027 CM_INVALIDATERECORD, … … 2846 3031 PostMsg(hwndMain, UM_BUILDDRIVEBAR, MPVOID, MPVOID); 2847 3032 } 3033 DbgMsg(pszSrcFile, __LINE__, " TreeCnrWndProc IDM_UPDATE %s", pci->pszFileName); // 2015-08-03 SHL FIXME debug 2848 3034 if (~driveflag & DRIVE_INVALID) 2849 Flesh(hwnd, pci); 2850 DosPostEventSem(hevTreeCnrScanComplete); 3035 AddFleshWorkRequest(hwnd, pci, eFlesh); 3036 #if 0 // 2015-08-04 SHL FIXME to be gone 3037 rc = DosPostEventSem(hevTreeCnrScanComplete); 3038 if (rc && rc != ERROR_ALREADY_POSTED) 3039 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem"); 3040 #endif // 2015-08-04 SHL FIXME to be gone 2851 3041 } 2852 3042 } … … 3021 3211 case IDM_MCIPLAY: 3022 3212 action = UM_MASSACTION; 3023 }3024 if (li->type == IDM_DELETE)3025 ignorereadonly = FALSE;3213 } 3214 if (li->type == IDM_DELETE) 3215 ignorereadonly = FALSE; 3026 3216 if (SHORT1FROMMP(mp1) == IDM_SHADOW || 3027 3217 SHORT1FROMMP(mp1) == IDM_SHADOW2) … … 3143 3333 case WM_DESTROY: 3144 3334 # ifdef FORTIFY 3145 DbgMsg(pszSrcFile, __LINE__, "WM_DESTROY hwnd % p TID %u", hwnd, GetTidForThread()); // 18 Jul 08 SHL fixme3335 DbgMsg(pszSrcFile, __LINE__, "WM_DESTROY hwnd %x TID %u", hwnd, GetTidForThread()); // 18 Jul 08 SHL FIXME 3146 3336 # endif 3147 3337 if (TreeCnrMenu) -
trunk/dll/update.c
r1830 r1856 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2003, 20 08Steven H. Levine9 Copyright (c) 2003, 2015 Steven H. Levine 10 10 11 11 12 Feb 03 SHL Standardize EA math … … 21 21 14 Mar 09 GKY Prevent execution of UM_SHOWME while drive scan is occuring 22 22 22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning 23 07 Aug 15 SHL Sync with Flesh/Stubby mods 24 23 25 24 26 ***********************************************************************/ … … 200 202 PostMsg(hwndCnr, UM_RESCAN, MPVOID, MPVOID); 201 203 if (pci->attrFile & FILE_DIRECTORY) { 202 Stubby(hwndCnr, pci);204 AddFleshWorkRequest(hwndCnr, pci, eStubby); 203 205 } 204 206 } … … 243 245 if (WinSendMsg(hwndCnr, 244 246 CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) { 245 Flesh(hwndCnr, pci);247 AddFleshWorkRequest(hwndCnr, pci, eFlesh); 246 248 *p = temp; 247 249 pci = FindCnrRecord(hwndCnr, … … 255 257 pciParent = pciT; 256 258 if (!(pciT->rc.flRecordAttr & CRA_EXPANDED)) { 257 Flesh(hwndCnr, pciT);259 AddFleshWorkRequest(hwndCnr, pciT, eFlesh); 258 260 *p = temp; 259 261 pci = FindCnrRecord(hwndCnr, … … 294 296 dcd->ullTotalBytes += ullTotalBytes; 295 297 } 296 Stubby(hwndCnr, pci);298 AddFleshWorkRequest(hwndCnr, pci, eStubby); 297 299 } 298 300 } … … 460 462 repos = TRUE; 461 463 if (pci->attrFile & FILE_DIRECTORY) { 462 Stubby(hwndCnr, pci);464 AddFleshWorkRequest(hwndCnr, pci, eStubby); 463 465 } 464 466 } … … 559 561 } 560 562 repos = TRUE; 561 Stubby(hwndCnr, pci);563 AddFleshWorkRequest(hwndCnr, pci, eStubby); 562 564 } 563 565 else
Note:
See TracChangeset
for help on using the changeset viewer.
