Changeset 1865
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/filldir.c
r1863 r1865 96 96 31 May 11 SHL Disable antique debug code in RemoveCnrItems - really speeds up container close 97 97 12 Jun 11 GKY Added IdleIfNeeded to the container "free" loops to improve system 98 responsiveness when closing containers with large numbers of items98 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 100 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 garbage that was appearing in the string.102 garbage that was appearing in the string. 103 103 02 Mar 14 GKY Speed up intial drive scans Ticket 528 104 104 19 Mar 14 SHL RemoveCnrItems: clean up odd code 105 105 22 Mar 14 GKY Reverted some code from the RemoveCnrItems changes adding a previously 106 missing break and comments explaining the code structure.106 missing break and comments explaining the code structure. 107 107 28 Jun 14 GKY Fix errors identified with CPPCheck 108 108 30 Aug 14 GKY Use saymsg2 for Suggest dialog … … 110 110 19 Jun 15 JBS Ticket 514: Double free fix (which also fixes a memory leak) 111 111 02 Aug 15 GKY Serialize local hard drive scanning to reduce drive thrashing continue to scan 112 all other drive types in separate threads.112 all other drive types in separate threads. 113 113 02 Aug 15 GKY Remove unneeded SubbyScan code and improve suppression of blank lines and 114 duplicate subdirectory name caused by running Stubby in worker threads.114 duplicate subdirectory name caused by running Stubby in worker threads. 115 115 04 Aug 15 SHL Comments 116 116 04 Aug 15 SHL Move StubbyThread to flesh.c … … 118 118 22 Aug 15 GKY Remove recurse scan code. 119 119 22 Aug 15 GKY Minimize the occurence of an A:\ Drive not ready error by moving the cursor 120 to the default drive.120 to the default drive. 121 121 122 122 ***********************************************************************/ … … 366 366 BOOL fLoadSubjectForDrive = fLoadSubject && ~flags & DRIVE_NOLOADSUBJS; 367 367 BOOL fLoadLongNameForDrive = fLoadLongnames && //~flags & DRIVE_NOLONGNAMES && 368 ~flags & DRIVE_NOLOADLONGS;368 ~flags & DRIVE_NOLOADLONGS; 369 369 if (fLoadSubjectForDrive || fLoadLongNameForDrive) { 370 370 // Allocate space to hold GEA2s and .SUBJECT and .LONGNAME strings 371 371 PGEA2LIST pgealist = xmallocz(sizeof(GEA2LIST) + (sizeof(GEA2) * 2) + 32, 372 pszSrcFile, __LINE__);372 pszSrcFile, __LINE__); 373 373 if (pgealist) { 374 374 APIRET rc; … … 379 379 EAOP2 eaop; 380 380 UINT state; 381 //DbgMsg(pszSrcFile, __LINE__, "pszFileName %s", pci->pszFileName);382 381 for (state = 0; state < 2; state++) { 383 382 PCSZ pcsz; … … 457 456 pfea = (PFEA2)((PSZ)pfea + pfea->oNextEntryOffset); 458 457 } // while 459 }458 } 460 459 free(pfealist); 461 460 } … … 589 588 pci->pszDisplayName = p; 590 589 591 // comma format the file size for large file support590 // Comma format the file size for large file support 592 591 { 593 592 CHAR szBuf[30]; … … 640 639 if (*dcd->mask.szMask || dcd->mask.antiattr) { 641 640 if (!Filter((PMINIRECORDCORE) pci, (PVOID) & dcd->mask)) 642 pci->rc.flRecordAttr |= CRA_FILTERED;641 pci->rc.flRecordAttr |= CRA_FILTERED; 643 642 } 644 643 else if ((!(dcd->mask.attrFile & FILE_HIDDEN) && … … 803 802 if (*dcd->mask.szMask || dcd->mask.antiattr) { 804 803 if (!Filter((PMINIRECORDCORE) pci, (PVOID) & dcd->mask)) 805 pci->rc.flRecordAttr |= CRA_FILTERED;804 pci->rc.flRecordAttr |= CRA_FILTERED; 806 805 } 807 806 else if ((!(dcd->mask.attrFile & FILE_HIDDEN) && … … 914 913 pffbFile = paffbFound; 915 914 ulSelCnt = 0; 916 for (;;) {915 for (;;) { 917 916 if (!*pffbFile->achName || 918 917 (!filestoo && ~pffbFile->attrFile & FILE_DIRECTORY) || … … 935 934 if (stopflag && *stopflag) 936 935 goto Abort; 937 if (fSyncUpdates) {938 if (!WinIsWindow(WinQueryAnchorBlock(hwndCnr), hwndCnr)) {939 ok = FALSE;936 if (fSyncUpdates) { 937 if (!WinIsWindow(WinQueryAnchorBlock(hwndCnr), hwndCnr)) { 938 ok = FALSE; 940 939 ullTotalBytes = 0; 941 940 break; … … 956 955 // Finish filling pci items 957 956 for (x = 0; x < ulSelCnt; x++) { 958 pffbFile = papffbSelected[x];957 pffbFile = papffbSelected[x]; 959 958 ullBytes = FillInRecordFromFFB(hwndCnr, pci, pszFileSpec, 960 pffbFile, partial, dcd);959 pffbFile, partial, dcd); 961 960 pci = (PCNRITEM) pci->rc.preccNextRecord; 962 961 ullTotalBytes += ullBytes; … … 990 989 if (ok) { 991 990 ullReturnBytes += ullTotalBytes; 992 ulReturnFiles += ulSelCnt;993 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);991 ulReturnFiles += ulSelCnt; 992 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 994 993 if (dcd) { 995 994 dcd->totalfiles += ulSelCnt; 996 995 dcd->ullTotalBytes += ullTotalBytes; 997 }998 DosReleaseMutexSem(hmtxFiltering);996 } 997 DosReleaseMutexSem(hmtxFiltering); 999 998 } 1000 999 } // if sync updates … … 1010 1009 for (x = 0; x < ulSelCnt; x++) { 1011 1010 paffbTotal[x + cAffbTotal] = *papffbSelected[x]; 1012 ullTotalBytes += papffbSelected[x]->cbFile; // 15 Sep 09 SHL1011 ullTotalBytes += papffbSelected[x]->cbFile; 1013 1012 } 1014 1013 cAffbTotal += ulSelCnt; … … 1051 1050 ULONG ulRecsToInsert; 1052 1051 1053 if (pci ==NULL) {1054 if (!WinIsWindow(WinQueryAnchorBlock(hwndCnr), hwndCnr)) {1055 ok = FALSE;1052 if (pci ==NULL) { 1053 if (!WinIsWindow(WinQueryAnchorBlock(hwndCnr), hwndCnr)) { 1054 ok = FALSE; 1056 1055 ullTotalBytes = 0; 1057 1056 break; … … 1061 1060 MPFROMLONG(EXTRA_RECORD_BYTES), MPFROMLONG(ulRecsToInsert)); 1062 1061 1063 if (!pciFirst) {1064 //ERRORID erridErrorCode = WinGetLastError(WinQueryAnchorBlock(hwndCnr));1065 //PmpfF(("Allocation failed %i", erridErrorCode));1062 if (!pciFirst) { 1063 //ERRORID erridErrorCode = WinGetLastError(WinQueryAnchorBlock(hwndCnr)); 1064 //PmpfF(("Allocation failed %i", erridErrorCode)); 1066 1065 Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, 1067 1066 GetPString(IDS_CMALLOCRECERRTEXT)); … … 1078 1077 pci = pciFirst; 1079 1078 } 1080 }1079 } 1081 1080 ullBytes = FillInRecordFromFFB(hwndCnr, pci, pszFileSpec, 1082 pffbFile, partial, dcd);1081 pffbFile, partial, dcd); 1083 1082 pci = (PCNRITEM) pci->rc.preccNextRecord; 1084 1083 ullTotalBytes += ullBytes; 1085 // 15 Sep 09 SHL allow timed updates to see1086 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);1084 // 15 Sep 09 SHL allow timed updates to see 1085 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 1087 1086 if (dcd) { 1088 1087 dcd->totalfiles = x; 1089 1088 dcd->ullTotalBytes = ullTotalBytes; 1090 }1091 DosReleaseMutexSem(hmtxFiltering);1089 } 1090 DosReleaseMutexSem(hmtxFiltering); 1092 1091 // Can not use offset since we have merged lists - this should be equivalent 1093 1092 pffbFile = (PFILEFINDBUF4L)((PBYTE)pffbFile + sizeof(FILEFINDBUF4L)); 1094 1093 1095 if (!IdleIfNeeded(&itdSleep, 30)) {1096 for (x = x+1; x < cAffbTotal; x++) {1094 if (!IdleIfNeeded(&itdSleep, 30)) { 1095 for (x = x+1; x < cAffbTotal; x++) { 1097 1096 ullBytes = FillInRecordFromFFB(hwndCnr, pci, pszFileSpec, 1098 pffbFile, partial, dcd);1097 pffbFile, partial, dcd); 1099 1098 pci = (PCNRITEM) pci->rc.preccNextRecord; 1100 ullTotalBytes += ullBytes;1101 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT);1099 ullTotalBytes += ullBytes; 1100 DosRequestMutexSem(hmtxFiltering, SEM_INDEFINITE_WAIT); 1102 1101 if (dcd) { 1103 dcd->totalfiles = x;1104 dcd->ullTotalBytes = ullTotalBytes;1105 }1106 DosReleaseMutexSem(hmtxFiltering);1107 pffbFile = (PFILEFINDBUF4L)((PBYTE)pffbFile + sizeof(FILEFINDBUF4L));1102 dcd->totalfiles = x; 1103 dcd->ullTotalBytes = ullTotalBytes; 1104 } 1105 DosReleaseMutexSem(hmtxFiltering); 1106 pffbFile = (PFILEFINDBUF4L)((PBYTE)pffbFile + sizeof(FILEFINDBUF4L)); 1108 1107 if (pci == NULL) { 1109 priority_normal();1110 InitITimer(&itdSleep, 500);1111 break;1108 priority_normal(); 1109 InitITimer(&itdSleep, 500); 1110 break; 1112 1111 } 1113 1112 } … … 1189 1188 while (pci && (INT)pci != -1) { 1190 1189 if (!pci->pszFileName || !strcmp(pci->pszFileName, NullStr)) { 1191 Runtime_Error(pszSrcFile, __LINE__, "pci->pszFileName NULL for %p", pci); 1192 return; 1190 // 2015-08-23 SHL FIXME debug 1191 DbgMsg(pszSrcFile, __LINE__, "ProcessDirectory pci %p pci->pszFileName %p %s", 1192 pci, pci->pszFileName, 1193 pci->pszFileName == NullStr ? "NullStr" : "NULL"); 1194 Runtime_Error(pszSrcFile, __LINE__, "pci->pszFileName NULL for %p", pci); 1195 return; 1193 1196 } 1194 1197 if ((pci->attrFile & FILE_DIRECTORY)) 1195 AddFleshWorkRequest(hwndCnr, pci, eStubby);1198 AddFleshWorkRequest(hwndCnr, pci, eStubby); 1196 1199 pci = WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci), 1197 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));1200 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 1198 1201 } 1199 1202 } … … 1254 1257 ULONG ulDriveMapMask; 1255 1258 CHAR szSuggest[32] = {0}; // Suggested startup command line parameters 1256 CHAR szDrive[CCHMAXPATH] = " :\\"; // 13 Oct 09 SHL1259 CHAR szDrive[CCHMAXPATH] = " :\\"; 1257 1260 CHAR szFSType[CCHMAXPATH]; 1258 1261 FILESTATUS4L fsa4; … … 1462 1465 driveflags[iDrvNum] |= DRIVE_INVALID; 1463 1466 1464 // 13 Oct 09 SHL1465 1467 // Update drives list dropdown 1466 1468 if ((ulDriveMap ^ ulLastDriveMap) & ulDriveMapMask) { … … 1483 1485 } // for drives 1484 1486 1485 ulLastDriveMap = ulDriveMap; // 13 Oct 09 SHL1487 ulLastDriveMap = ulDriveMap; 1486 1488 1487 1489 // insert the drives in container … … 1506 1508 // move cursor onto the default drive rather than the first drive 1507 1509 pci = (PCNRITEM) WinSendMsg(hwndCnr, 1508 CM_QUERYRECORD,1509 MPVOID,1510 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER));1510 CM_QUERYRECORD, 1511 MPVOID, 1512 MPFROM2SHORT(CMA_FIRST, CMA_ITEMORDER)); 1511 1513 while (pci && (INT)pci != -1) { 1512 1514 if ((ULONG) (toupper(*pci->pszFileName) - '@') == ulCurDriveNum) { 1513 1515 WinSendMsg(hwndCnr, 1514 CM_SETRECORDEMPHASIS,1515 MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_CURSORED));1516 CM_SETRECORDEMPHASIS, 1517 MPFROMP(pci), MPFROM2SHORT(TRUE, CRA_CURSORED)); 1516 1518 break; 1517 1519 } 1518 1520 pci = (PCNRITEM) WinSendMsg(hwndCnr, 1519 CM_QUERYRECORD,1520 MPFROMP(pci),1521 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER));1521 CM_QUERYRECORD, 1522 MPFROMP(pci), 1523 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); 1522 1524 } 1523 1525 … … 1531 1533 pciParent->flags |= RECFLAGS_ENV; 1532 1534 pciParent->pszFileName = xstrdup(GetPString(IDS_ENVVARSTEXT), pszSrcFile, __LINE__); 1533 pciParent->pszDisplayName = pciParent->pszFileName; // 03 Aug 07 SHL1535 pciParent->pszDisplayName = pciParent->pszFileName; 1534 1536 pciParent->rc.hptrIcon = hptrEnv; 1535 1537 pciParent->rc.pszIcon = pciParent->pszFileName; … … 1704 1706 strcat(szSuggest, " %*"); 1705 1707 rc = saymsg2(NULL, 3, HWND_DESKTOP, 1706 GetPString(IDS_SUGGESTTITLETEXT),1707 GetPString(IDS_SUGGEST1TEXT),1708 (includesyours) ? GetPString(IDS_SUGGEST2TEXT) : NullStr,1708 GetPString(IDS_SUGGESTTITLETEXT), 1709 GetPString(IDS_SUGGEST1TEXT), 1710 (includesyours) ? GetPString(IDS_SUGGEST2TEXT) : NullStr, 1709 1711 szSuggest); 1710 1712 if (rc == SM2_YES || rc == SM2_DONTASK) { … … 1747 1749 if (rc == SM2_NO || rc == SM2_DONTASK) { 1748 1750 fDontSuggestAgain = TRUE; 1749 PrfWriteProfileData(fmprof, FM3Str, "DontSuggestAgain",1750 &fDontSuggestAgain, sizeof(BOOL));1751 PrfWriteProfileData(fmprof, FM3Str, "DontSuggestAgain", 1752 &fDontSuggestAgain, sizeof(BOOL)); 1751 1753 } 1752 1754 } // if suggest … … 1795 1797 VOID FreeCnrItemData(PCNRITEM pci) 1796 1798 { 1797 1799 1800 // 2015-08-23 SHL FIXME debug 1801 if ((pci->pszSubject && (ULONG)pci->pszSubject < 0x10000) || 1802 (pci->pszLongName && (ULONG)pci->pszLongName < 0x10000) || 1803 (pci->pszDisplayName && (ULONG)pci->pszDisplayName < 0x10000) || 1804 (pci->pszFileName && (ULONG)pci->pszFileName < 0x10000) || 1805 (pci->pszLongName && (ULONG)pci->pszLongName < 0x10000) || 1806 (pci->pszFmtFileSize && (ULONG)pci->pszFmtFileSize < 0x10000)) 1807 { 1808 Runtime_Error(pszSrcFile, __LINE__, "FreeCnrItemData attempting to free bogus %p", pci); 1809 } 1810 1798 1811 if (pci->pszSubject) { 1799 1812 if (pci->pszSubject != NullStr) … … 1801 1814 pci->pszSubject = NULL; // Catch illegal references 1802 1815 } 1803 1804 // 08 Sep 08 SHL Remove excess logic 1816 1805 1817 if (pci->pszLongName) { 1806 1818 if (pci->pszLongName != NullStr) … … 1808 1820 pci->pszLongName = NULL; // Catch illegal references 1809 1821 } 1810 1822 1811 1823 // Bypass free if pszDisplayName points into pszFileName buffer 1812 // 05 Sep 08 SHL Correct pointer overlap compare logic1813 1824 if (pci->pszDisplayName) { 1814 1825 if (pci->pszDisplayName != NullStr) { … … 1817 1828 pci->pszDisplayName >= pci->pszFileName + _msize(pci->pszFileName)) 1818 1829 { 1819 free(pci->pszDisplayName);1830 free(pci->pszDisplayName); 1820 1831 } 1821 1832 } … … 1823 1834 } 1824 1835 1825 #if 0 // 26 Sep 09 SHLdebug dup free complaints1836 #if 1 // 2009-09-26 SHL FIXME debug dup free complaints 1826 1837 if (!pci->pszFileName) 1827 1838 Runtime_Error(pszSrcFile, __LINE__, "FreeCnrItemData attempting to free %p data twice", pci); … … 1833 1844 #else 1834 1845 { 1846 // 2015-08-23 SHL FIXME to work again now that Flesh/Stubby on thread 1835 1847 #define HIST_COUNT 50 1836 1848 static struct { … … 1880 1892 } 1881 1893 1882 1883 #endif 1884 1885 // 08 Sep 08 SHL Remove excess logic 1894 #endif // FIXME debug dup free 1895 1886 1896 if (pci->pszLongName) { 1887 1897 if (pci->pszLongName != NullStr) … … 1960 1970 INT remaining = usCnt; 1961 1971 BOOL bIdlePrioritySet = FALSE; 1962 // #define RCI_ITEMS_PER_TIMER_CHECK (10)1963 // 10 seems a very conservative number1964 //USHORT usTimerCheckCountdown = RCI_ITEMS_PER_TIMER_CHECK;1972 // #define RCI_ITEMS_PER_TIMER_CHECK (10) 1973 // 10 seems a very conservative number 1974 // USHORT usTimerCheckCountdown = RCI_ITEMS_PER_TIMER_CHECK; 1965 1975 PCNRITEM pci; 1966 1976 ITIMER_DESC itdSleep = { 0 }; // 30 May 11 GKY … … 1986 1996 InitITimer(&itdSleep, 500); 1987 1997 while (pci) { 1988 FreeCnrItemData(pci);1998 FreeCnrItemData(pci); 1989 1999 pci = (PCNRITEM)pci->rc.preccNextRecord; 1990 2000 if (!pci) 1991 2001 break; 1992 if (remaining && --remaining == 0)1993 break;1994 if (!bIdlePrioritySet /* && --usTimerCheckCountdown == 0 */) {1995 bIdlePrioritySet = !IdleIfNeeded(&itdSleep, 30);1996 //usTimerCheckCountdown = RCI_ITEMS_PER_TIMER_CHECK;1997 }2002 if (remaining && --remaining == 0) 2003 break; 2004 if (!bIdlePrioritySet /* && --usTimerCheckCountdown == 0 */) { 2005 bIdlePrioritySet = !IdleIfNeeded(&itdSleep, 30); 2006 // usTimerCheckCountdown = RCI_ITEMS_PER_TIMER_CHECK; 2007 } 1998 2008 } // while 1999 2009 if (bIdlePrioritySet) 2000 priority_normal();2010 priority_normal(); 2001 2011 2002 2012 DosPostEventSem(CompactSem); -
trunk/dll/findrec.c
r1854 r1865 11 11 20 Aug 07 GKY Move #pragma alloc_text to end for OpenWatcom compat 12 12 28 Dec 08 GKY Containers will only scroll to the right if needed to show end of selected 13 item and will scroll left to eliminate space after a selected item. Ticket 20413 item and will scroll left to eliminate space after a selected item. Ticket 204 14 14 06 Aug 15 SHL Clean up and comment 15 23 Aug 15 SHL Protect FindCnrRecord filename arg 15 16 16 17 ***********************************************************************/ … … 27 28 //static PSZ pszSrcFile = __FILE__; 28 29 29 PCNRITEM FindCnrRecord(HWND hwndCnr, CHAR *filename, PCNRITEM pciParent,30 PCNRITEM FindCnrRecord(HWND hwndCnr, PCSZ filename, PCNRITEM pciParent, 30 31 BOOL partial, BOOL partmatch, BOOL noenv) 31 32 { 32 33 SEARCHSTRING srch; 33 34 PCNRITEM pci; 34 register CHAR *file, *p; 35 PCSZ file; 36 PCSZ p; 35 37 36 38 if (partial) { … … 127 129 qrecrct.fsExtent = (CMA_ICON | CMA_TEXT | CMA_TREEICON); 128 130 if (!WinSendMsg(hwndCnr, 129 CM_QUERYRECORDRECT, MPFROMP(&rcl), MPFROMP(&qrecrct))) {131 CM_QUERYRECORDRECT, MPFROMP(&rcl), MPFROMP(&qrecrct))) { 130 132 qrecrct.fsExtent = CMA_TEXT | CMA_TREEICON; 131 133 WinSendMsg(hwndCnr, CM_QUERYRECORDRECT, MPFROMP(&rcl), MPFROMP(&qrecrct)); -
trunk/dll/findrec.h
r1223 r1865 4 4 $Id$ 5 5 6 <<<description here>>>6 Find records 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 23 Aug 15 SHL Protect FindCnrRecord filename arg 12 12 13 13 ***********************************************************************/ … … 18 18 #include "dircnrs.h" // typedef for CNRITEM, PCNRITEM 19 19 20 PCNRITEM FindCnrRecord(HWND hwndCnr, CHAR *filename, PCNRITEM pciParent,20 PCNRITEM FindCnrRecord(HWND hwndCnr, PCSZ filename, PCNRITEM pciParent, 21 21 BOOL partial, BOOL partmatch, BOOL noenv); 22 22 PCNRITEM FindParentRecord(HWND hwndCnr, PCNRITEM pciC); -
trunk/dll/flesh.c
r1864 r1865 250 250 CM_QUERYRECORD, 251 251 MPFROMP(pciParent), 252 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));252 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 253 253 254 254 // 2015-08-06 SHL allow pciL -1 … … 296 296 /** 297 297 * Remove children from container 298 * @param epciParent is parent of children to be removed298 * @param pciParent is parent of children to be removed 299 299 */ 300 300 … … 308 308 309 309 if (!fNoFleshDbgMsg) 310 DbgMsg(pszSrcFile, __LINE__, "UnFlesh pciParent %p pszFileName %s", pciParent, pciParent->pszFileName ? pciParent->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug310 DbgMsg(pszSrcFile, __LINE__, "UnFlesh pciParent %p pszFileName \"%s\"", pciParent, pciParent->pszFileName ? pciParent->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug 311 311 312 312 for (;;) { … … 319 319 320 320 if (!fNoFleshDbgMsg) 321 DbgMsg(pszSrcFile, __LINE__, "UnFlesh RemoveCnrItems() pciL %p %s", pciL, pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug321 DbgMsg(pszSrcFile, __LINE__, "UnFlesh RemoveCnrItems() pciL %p \"%s\"", pciL, pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-03 SHL FIXME debug 322 322 RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE); 323 323 removed = TRUE; … … 606 606 } // if !rc 607 607 else if (toupper(*wildcard) > 'B' && wildcard[1] == ':' && wildcard[2] == '\\' && 608 wildcard[3] == '*' && !wildcard[4]) {608 wildcard[3] == '*' && !wildcard[4]) { 609 609 // Is root and no subdirectories 610 610 CHAR s[162]; 611 611 612 612 sprintf(s, 613 GetPString(IDS_NOSUBDIRS2TEXT),614 nm,615 toupper(*pciParent->pszFileName),616 isremote ? GetPString(IDS_NOSUBDIRS3TEXT) : NullStr);613 GetPString(IDS_NOSUBDIRS2TEXT), 614 nm, 615 toupper(*pciParent->pszFileName), 616 isremote ? GetPString(IDS_NOSUBDIRS3TEXT) : NullStr); 617 617 Notify(s); 618 618 } … … 684 684 */ 685 685 686 #if 0// 2015-08-03 SHL FIXME debug686 #ifndef AddFleshWorkRequest // 2015-08-03 SHL FIXME debug 687 687 BOOL AddFleshWorkRequest(HWND hwndCnr, PCNRITEM pci, FLESHWORKACTION action) 688 688 #else … … 784 784 } 785 785 c = strlen(((PFLESHWORKITEM)item)->pci->pszFileName); 786 return FALSE; //strncmp(((PFLESHWORKITEM)item)->pci->pszFileName, (PCSZ)data, c) == 0; 786 // 2015-08-23 SHL FIXME to not trap for Gregg 787 return strncmp(((PFLESHWORKITEM)item)->pci->pszFileName, (PCSZ)data, c) == 0; 787 788 } 788 789 … … 793 794 */ 794 795 795 #if 0// 2015-08-03 SHL FIXME debug796 #ifndef WaitFleshWorkListEmpty // 2015-08-03 SHL FIXME debug 796 797 VOID WaitFleshWorkListEmpty(PCSZ pszDirName) 797 798 #else … … 862 863 } // while 863 864 864 if ( !pathSaved) {865 if (pathSaved) { 865 866 xDosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT); 866 867 pszFleshFocusPath = pszSavedFleshFocusPath; … … 982 983 case eStubby: 983 984 // DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread pci %p pszFileName %s", stubbyArgs->pci, stubbyArgs->pci->pszFileName); // 2015-08-03 SHL FIXME debug 984 Stubby(item->hwndCnr, item->pci);985 break;985 Stubby(item->hwndCnr, item->pci); 986 break; 986 987 case eFlesh: 987 988 if (Flesh(item->hwndCnr, item->pci)) { -
trunk/dll/treecnr.c
r1862 r1865 285 285 286 286 VOID ShowTreeRec(HWND hwndCnr, 287 CHAR *pszDir_,287 PCSZ pszDir_, 288 288 BOOL collapsefirst, 289 289 BOOL maketop) … … 299 299 CHAR szDir[CCHMAXPATH]; 300 300 301 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec pszDir_ %s", pszDir_); // 2015-08-04 SHL FIXME debug301 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec pszDir_ \"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug 302 302 303 303 // already positioned to requested record? … … 315 315 if (fSwitchTreeOnDirChg) 316 316 DosSleep(200); 317 //WaitFleshWorkListEmpty(0);318 317 319 318 // 2015-08-13 SHL add retry logic 2015-08-22 GKY increase retries from 10 to 100 to … … 353 352 TRUE); // noenv 354 353 if (!pciP || (INT)pciP == -1) { 355 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord( %s) returned %p", szDir, pciP); // 2015-08-04 SHL FIXME debug354 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(\"%s\") returned %p", szDir, pciP); // 2015-08-04 SHL FIXME debug 356 355 WaitFleshWorkListEmpty(szDir); // 2015-08-19 SHL 357 356 break; // No match 358 357 } 359 358 360 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord returned %p %s", pciP, pciP->pszFileName); // 2015-08-04 SHL FIXME debug359 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord returned %p \"%s\"", pciP, pciP->pszFileName); // 2015-08-04 SHL FIXME debug 361 360 362 361 if (!stricmp(pszDir_, pciP->pszFileName)) { … … 367 366 368 367 if (~pciP->rc.flRecordAttr & CRA_EXPANDED) { 369 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec expanding %s", pciP->pszFileName); // 2015-08-04 SHL FIXME debug368 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec expanding \"%s\"", pciP->pszFileName); // 2015-08-04 SHL FIXME debug 370 369 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID); 371 370 DosSleep(100); // 2015-08-13 SHL Let PM catch up … … 388 387 } // for 389 388 390 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 debug389 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 391 390 392 391 if (found) { … … 431 430 pciToSelect = pci; 432 431 if (pciToSelect && (INT) pciToSelect != -1) { 433 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec %p fTopDir %i maketop %i", pciToSelect, fTopDir, maketop); // 2015-08-04 SHL FIXME debug 434 if (fSwitchTreeExpand && ~pciToSelect->rc.flRecordAttr & CRA_EXPANDED) 432 if (fSwitchTreeExpand && ~pciToSelect->rc.flRecordAttr & CRA_EXPANDED) { 433 // 2015-08-23 SHL FIXME debug 434 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec WinSendMsg(CM_EXPANDTREE, %p)", pciToSelect); // 2015-08-04 SHL FIXME debug 435 435 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID); 436 if (fTopDir || maketop) 436 } 437 if (fTopDir || maketop) { 438 // 2015-08-23 SHL FIXME debug 439 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec ShowCnrRecord(%p) fTopDir %i maketop %i", pciToSelect, fTopDir, maketop); // 2015-08-04 SHL FIXME debug 437 440 ShowCnrRecord(hwndCnr, (PMINIRECORDCORE)pciToSelect); 441 } 438 442 439 443 if (!quickbail) { 440 444 WaitFleshWorkListEmpty(pszDir_); // 2015-08-19 SHL try to ensure contents stable 441 DbgMsg(pszSrcFile, __LINE__, " WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED)\"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug445 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED) pszDir_ \"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug 442 446 WinSendMsg(hwndCnr, 443 447 CM_SETRECORDEMPHASIS, … … 724 728 */ 725 729 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME cDirectoriesRestored %u", cDirectoriesRestored); // 2015-08-04 SHL FIXME debug 726 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME %s)", mp1); // 2015-08-04 SHL FIXME debug730 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME \"%s\")", mp1); // 2015-08-04 SHL FIXME debug 727 731 728 732 if (cDirectoriesRestored > 0) -
trunk/dll/treecnr.h
r1360 r1865 13 13 28 Dec 08 GKY Rework partition submenu to gray out unavailable items (check for existence of files) 14 14 and have no default choice. 15 23 Aug 15 SHL Protect ShowTreeRec dirname arg 15 16 16 17 ***********************************************************************/ … … 20 21 21 22 MRESULT EXPENTRY OpenButtonProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2); 22 VOID ShowTreeRec(HWND hwndCnr, CHAR * dirname, BOOL collapsefirst, 23 BOOL maketop); 23 VOID ShowTreeRec(HWND hwndCnr, PCSZ dirname, BOOL collapsefirst, BOOL maketop); 24 24 HWND StartTreeCnr(HWND hwndParent, ULONG flags); 25 25 MRESULT EXPENTRY TreeClientWndProc(HWND hwnd, ULONG msg, MPARAM mp1,
Note:
See TracChangeset
for help on using the changeset viewer.
