Changeset 1567 for trunk/dll/filldir.c
- Timestamp:
- May 31, 2011, 9:49:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/filldir.c
r1564 r1567 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2001, 201 0Steven H. Levine9 Copyright (c) 2001, 2011 Steven H. Levine 10 10 11 11 10 Jan 04 SHL ProcessDirectory: avoid most large drive failures … … 85 85 15 Nov 09 GKY Optimize some check code 86 86 17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). 87 87 Mostly cast CHAR CONSTANT * as CHAR *. 88 88 09 MAY 10 JBS Ticket 434 bug fixes, message box text improvements and parameter update 89 89 improvements. 90 90 20 Nov 10 GKY Rework scanning code to remove redundant scans, prevent double directory 91 92 91 entries in the tree container, fix related semaphore performance using 92 combination of event and mutex semaphores 93 93 30 May 11 GKY Fixed trap caused by passing a nonexistant pci to FillInRecordFromFFB in FillDir 94 94 because pci is limited to 65535 files. (nRecord is a USHORT) SHL's single loop 95 95 30 May 11 GKY Added SleepIfNeeded to DosFind and container load loops to improve WPS responsiveness 96 31 May 11 SHL Disable antique debug code in RemoveCnrItems - really speeds up container close 96 97 97 98 ***********************************************************************/ … … 243 244 IncrThreadUsage(); 244 245 priority_normal(); 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 } 262 246 if (WinIsWindow((HAB)0, StubbyScan->hwndCnr)) { 247 ULONG flags = driveflags[toupper(*StubbyScan->pci->pszFileName) - 'A']; 248 249 if ((fRScanLocal && ~flags & DRIVE_REMOTE && ~flags & DRIVE_VIRTUAL) || 250 (fRScanRemote && flags & DRIVE_REMOTE) || 251 (fRScanVirtual && flags & DRIVE_VIRTUAL)) { 252 if (!(flags & ((fRScanNoWrite ? 0 : DRIVE_NOTWRITEABLE) || 253 (fRScanSlow ? 0 : DRIVE_SLOW)))) { 254 UnFlesh(StubbyScan->hwndCnr, StubbyScan->pci); 255 Flesh(StubbyScan->hwndCnr, StubbyScan->pci); 256 } 257 } 258 else { 259 Stubby(StubbyScan->hwndCnr, StubbyScan->pci); 260 //if (!ok) 261 // FixedVolume--; 262 } 263 } 263 264 WinDestroyMsgQueue(hmq); 264 265 } … … 269 270 } // if StubbyScan 270 271 ProcessDirCount++; 271 //DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", 272 // ProcessDirCount, FixedVolume); 272 // DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", ProcessDirCount, FixedVolume); 273 273 if (ProcessDirCount >= FixedVolume) { 274 274 DosReleaseMutexSem(hmtxScanning); … … 277 277 // Keep drive tree in sync with directory container 278 278 if (hwndMain) { 279 280 281 279 //if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame) 280 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszFocusDir), MPVOID)) 281 free(pszFocusDir); 282 282 } 283 283 else { 284 285 284 if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszFocusDir), MPVOID)) 285 free(pszFocusDir); 286 286 } 287 287 } … … 302 302 HAB thab; 303 303 HMQ hmq = (HMQ) 0; 304 304 305 305 306 306 DosError(FERR_DISABLEHARDERR); … … 1115 1115 //priority_normal(); 1116 1116 if (rc) 1117 1118 1117 DosError(FERR_DISABLEHARDERR); 1118 SleepIfNeeded(&itdSleep, 1); 1119 1119 } while (!rc); 1120 1120 … … 1130 1130 goto Abort; 1131 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1132 pci = NULL; 1133 ullTotalBytes = 0; 1134 pffbFile = paffbTotal; 1135 for (x = 0; x < cAffbTotal; x++) { 1136 ULONG ulRecsToInsert; 1137 1138 if (pci ==NULL) { 1139 ulRecsToInsert = cAffbTotal - x < USHRT_MAX ? cAffbTotal - x : USHRT_MAX; 1140 pciFirst = WinSendMsg(hwndCnr, CM_ALLOCRECORD, 1141 MPFROMLONG(EXTRA_RECORD_BYTES), MPFROMLONG(ulRecsToInsert)); 1142 1143 if (!pciFirst) { 1144 Win_Error(hwndCnr, HWND_DESKTOP, pszSrcFile, __LINE__, 1145 GetPString(IDS_CMALLOCRECERRTEXT)); 1146 ok = FALSE; 1147 ullTotalBytes = 0; 1148 break; 1149 } 1150 else { 1151 // 04 Jan 08 SHL fixme like comp.c to handle less than ulSelCnt records 1152 if (hwndStatus && dcd && 1153 dcd->hwndFrame == WinQueryActiveWindow(dcd->hwndParent)) { 1154 WinSetWindowText(hwndStatus, (CHAR *) GetPString(IDS_PLEASEWAITCOUNTINGTEXT)); 1155 } 1156 pci = pciFirst; 1157 } 1158 } 1159 ullBytes = FillInRecordFromFFB(hwndCnr, pci, pszFileSpec, 1160 pffbFile, partial, dcd); 1161 pci = (PCNRITEM) pci->rc.preccNextRecord; 1162 ullTotalBytes += ullBytes; 1163 // 15 Sep 09 SHL allow timed updates to see 1164 if (dcd) { 1165 dcd->totalfiles = x; 1166 dcd->ullTotalBytes = ullTotalBytes; 1167 } 1168 // Can not use offset since we have merged lists - this should be equivalent 1169 pffbFile = (PFILEFINDBUF4L)((PBYTE)pffbFile + sizeof(FILEFINDBUF4L)); 1170 1171 if (pci == NULL && ulRecsToInsert) { 1172 1172 memset(&ri, 0, sizeof(RECORDINSERT)); 1173 1173 ri.cb = sizeof(RECORDINSERT); … … 1189 1189 ullTotalBytes = 0; 1190 1190 if (WinIsWindow((HAB) 0, hwndCnr)) 1191 1192 1193 1191 FreeCnrItemList(hwndCnr, pciFirst); 1192 pciFirst = NULL; 1193 break; 1194 1194 } 1195 1195 } 1196 1197 1198 1196 } 1197 SleepIfNeeded(&itdSleep, 1); 1198 } 1199 1199 if (ok) { 1200 1200 ullReturnBytes += ullTotalBytes; … … 1274 1274 DosPostEventSem(CompactSem); 1275 1275 1276 #if 0 // fixme to be gone or to be configurable1276 #if 0 // 2011-05-31 SHL fixme to be gone or to be configurable 1277 1277 { 1278 1278 int state = _heapchk(); … … 1418 1418 1419 1419 if (~driveflags[iDrvNum] & DRIVE_REMOVABLE) { 1420 1421 1422 1420 // Fixed volume 1421 if (~flags & DRIVE_INVALID && ~flags & DRIVE_NOPRESCAN) 1422 FixedVolume++; 1423 1423 pci->attrFile |= FILE_DIRECTORY; 1424 1424 DosError(FERR_DISABLEHARDERR); … … 1768 1768 szSuggest); 1769 1769 if (rc == MBID_YES) { 1770 1770 HOBJECT hFM2Object; 1771 1771 char s[64]; 1772 1772 sprintf(s, "PARAMETERS=%s", szSuggest); 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1773 hFM2Object = WinQueryObject("<FM/2>"); 1774 if (hFM2Object) { 1775 rc = WinSetObjectData(hFM2Object, (PSZ)s); 1776 } 1777 hFM2Object = WinQueryObject("<FM/2 LITE>"); 1778 if (hFM2Object) { 1779 rc = WinSetObjectData(hFM2Object, (PSZ)s); 1780 } 1781 hFM2Object = WinQueryObject("<FM/2_AV/2>"); 1782 if (hFM2Object) { 1783 rc = WinSetObjectData(hFM2Object, (PSZ)s); 1784 } 1785 hFM2Object = WinQueryObject("<FM/2_DIRSIZE>"); 1786 if (hFM2Object) { 1787 rc = WinSetObjectData(hFM2Object, (PSZ)s); 1788 } 1789 hFM2Object = WinQueryObject("<FM/2_VTREE>"); 1790 if (hFM2Object) { 1791 rc = WinSetObjectData(hFM2Object, (PSZ)s); 1792 } 1793 hFM2Object = WinQueryObject("<FM/2_VDIR>"); 1794 if (hFM2Object) { 1795 rc = WinSetObjectData(hFM2Object, (PSZ)s); 1796 } 1797 hFM2Object = WinQueryObject("<FM/2_SEEALL>"); 1798 if (hFM2Object) { 1799 rc = WinSetObjectData(hFM2Object, (PSZ)s); 1800 } 1801 hFM2Object = WinQueryObject("<FM/2_DATABAR>"); 1802 if (hFM2Object) { 1803 rc = WinSetObjectData(hFM2Object, (PSZ)s); 1804 } 1805 1805 } 1806 1806 else if (rc == MBID_CANCEL) { … … 2007 2007 PCNRITEM pci; 2008 2008 ITIMER_DESC itdSleep = { 0 }; // 30 May 11 GKY 2009 2009 2010 2010 2011 2011 if ((usCnt && !pciFirst) || (!usCnt && pciFirst)) { … … 2029 2029 InitITimer(&itdSleep, 500); 2030 2030 while (pci) { 2031 // 12 Sep 07 SHL dwg drivebar crash testing - ticket# ??? 2031 #if 0 // 12 Sep 07 SHL dwg drivebar crash testing - ticket# ??? - fixme to be gone 2032 2032 static PCNRITEM pciLast; // 12 Sep 07 SHL 2033 2033 ULONG ulSize = sizeof(*pci); … … 2037 2037 Dos_Error(MB_ENTER, apiret, HWND_DESKTOP, pszSrcFile, __LINE__, 2038 2038 "DosQueryMem failed pci %p pciLast %p", pci, pciLast); 2039 FreeCnrItemData(pci); 2039 #endif 2040 FreeCnrItemData(pci); 2041 #if 0 // 12 Sep 07 SHL dwg drivebar crash testing - ticket# ??? - fixme to be gone 2040 2042 pciLast = pci; 2043 #endif 2041 2044 pci = (PCNRITEM)pci->rc.preccNextRecord; 2042 2045 if (remaining && --remaining == 0) 2043 2044 2046 break; 2047 SleepIfNeeded(&itdSleep, 1); 2045 2048 } 2046 2049 }
Note:
See TracChangeset
for help on using the changeset viewer.