Changeset 1858
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dircnrs.c
r1856 r1858 909 909 // Keep drive tree in sync with directory container 910 910 PSZ pszTempDir; 911 #if 0 // 2015-08-12 SHL FIXME to be gone fInitialDriveScan912 while (fInitialDriveScan)913 DosSleep(500); // Allow to complete914 DosSleep(200); // Allow to complete915 #endif916 911 pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__); 917 912 if (pszTempDir) { -
trunk/dll/flesh.c
r1856 r1858 7 7 8 8 Copyright (c) 1993-98 M. Kimes 9 Copyright (c) 2005 -2015 Steven H. Levine9 Copyright (c) 2005, 2015 Steven H. Levine 10 10 11 11 24 May 05 SHL Rework Win_Error usage … … 35 35 03 Aug 15 SHL Document Stubby a bit better 36 36 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 37 19 Aug 15 SHL Allow WaitFleshWorkListEmpty to wait for dependent items 37 38 38 39 ***********************************************************************/ … … 94 95 BOOL Stubby(HWND hwndCnr, PCNRITEM pciParent); 95 96 BOOL FleshEnv(HWND hwndCnr, PCNRITEM pciParent); 96 BOOLUnFlesh(HWND hwndCnr, PCNRITEM pciParent);97 VOID UnFlesh(HWND hwndCnr, PCNRITEM pciParent); 97 98 98 99 /** … … 110 111 fullpath[CCHMAXPATH + 12], *env, *p, *pp, *var = NULL; 111 112 112 if (!pciParent || (INT) 113 if (!pciParent || (INT)pciParent == -1 || !hwndCnr) 113 114 return FALSE; 114 115 … … 155 156 fullpath, pciParent, FALSE, FALSE, FALSE); 156 157 if (pciL) { 157 while (pciL && pciL != (PCNRITEM) -1 && pciL != pciParent)158 while (pciL && pciL != (PCNRITEM)-1 && pciL != pciParent) 158 159 pciL = WinSendMsg(hwndCnr, 159 160 CM_QUERYRECORD, … … 183 184 memset(&ri, 0, sizeof(ri)); 184 185 ri.cb = sizeof(ri); 185 ri.pRecordOrder = (PRECORDCORE) 186 ri.pRecordParent = (PRECORDCORE) 187 ri.zOrder = (ULONG) 186 ri.pRecordOrder = (PRECORDCORE)CMA_END; 187 ri.pRecordParent = (PRECORDCORE)pciParent; 188 ri.zOrder = (ULONG)CMA_TOP; 188 189 ri.cRecordsInsert = 1; 189 190 ri.fInvalidateRecord = FALSE; 191 // 2015-08-03 SHL FIXME debug 192 if (pciL->pszFileName == NullStr) 193 DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pciL, pciL->pszFileName); // 2015-08-03 SHL FIXME debug 190 194 if (!WinSendMsg(hwndCnr, 191 195 CM_INSERTRECORD, MPFROMP(pciL), MPFROMP(&ri))) … … 198 202 } 199 203 xfree(var, pszSrcFile, __LINE__); 200 pciL = (PCNRITEM) 201 202 203 204 while (pciL && (INT) 204 pciL = (PCNRITEM)WinSendMsg(hwndCnr, 205 CM_QUERYRECORD, 206 MPFROMP(pciParent), 207 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 208 while (pciL && (INT)pciL != -1) { 205 209 pciL->flags |= (RECFLAGS_NODRAG | RECFLAGS_UNDERENV); 206 210 WinSendMsg(hwndCnr, … … 230 234 return FALSE; 231 235 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 } 236 // 2015-08-13 SHL 237 if (fAmQuitting) 238 return FALSE; 239 239 240 240 // 2015-08-03 SHL FIXME debug … … 253 253 254 254 // 2015-08-06 SHL allow pciL -1 255 // 2015-08-06 SHL FIXME to not need pszFileName check 255 256 if (!pciL || (INT)pciL == -1 || !*pciL->pszFileName) { 256 257 257 258 // No children or filename null 258 // 2015-08-06 SHL FIXME to know how this can happen259 259 if (pciL && (INT)pciL != -1) { 260 // 2015-08-06 SHL FIXME to loop and timeout if Stubby threads working 260 // 2015-08-06 SHL FIXME to ensure this an not happen 261 // if (!*pciL->pszFileName) 262 // Runtime_Error(pszSrcFile, __LINE__, "Flesh called with pci %p pszFileName (null)", pciL); 263 261 264 if (!fNoFleshDbgMsg) 262 DbgMsg(pszSrcFile, __LINE__, "Flesh RemoveCnrItems() pciL %p", pciL); // 2015-08-04 SHL FIXME debug 265 DbgMsg(pszSrcFile, __LINE__, "Flesh RemoveCnrItems() pciL %p \"%s\"", 266 pciL, 267 pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-04 SHL FIXME debug 268 // Assume refernces to pciL already removed from work list 263 269 RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE); 264 270 } … … 268 274 dcd = NULL; 269 275 270 // DbgMsg(pszSrcFile, __LINE__, "Flesh %s dcd %p called by %s#%u", pciParent->pszFileName, dcd, pszSrcFile_, uSrcLineNo_); // 2015-08-03 SHL FIXME debug271 272 // 2015-08-06 SHL FIXME to not trap here273 276 includefiles = 274 277 driveflags[toupper(*pciParent->pszFileName) - 'A'] & DRIVE_INCLUDEFILES ? … … 293 296 } 294 297 295 // 2015-08-06 SHL FIXME to be VOID 296 297 BOOL UnFlesh(HWND hwndCnr, PCNRITEM pciParent) 298 /** 299 * Remove children from container 300 * @parame pciParent is parent of children to be removed 301 */ 302 303 VOID UnFlesh(HWND hwndCnr, PCNRITEM pciParent) 298 304 { 299 305 BOOL removed = FALSE; … … 301 307 302 308 if (!pciParent || !hwndCnr) 303 return FALSE;309 return; 304 310 305 311 if (!fNoFleshDbgMsg) … … 307 313 308 314 for (;;) { 309 pciL = (PCNRITEM) 310 311 312 315 pciL = (PCNRITEM)WinSendMsg(hwndCnr, 316 CM_QUERYRECORD, 317 MPFROMP(pciParent), 318 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 313 319 if (!pciL || (INT)pciL == -1) 314 320 break; // Done … … 326 332 MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION)); 327 333 } 328 return removed;334 return; 329 335 } 330 336 … … 353 359 HDIR hDir = HDIR_CREATE; 354 360 ULONG nm, ulM = 1, total = 0, fl; 355 CHAR str[CCHMAXPATH];361 CHAR wildcard[CCHMAXPATH]; 356 362 register INT len; 357 363 APIRET rc, prc; 358 BOOL isadir = FALSE, isremote, includefiles; 364 BOOL isadir = FALSE; 365 BOOL isremote; 366 BOOL includefiles; 359 367 ULONG ddepth = DDEPTH; 360 368 ULONG drvNum; … … 362 370 static BOOL brokenlan = FALSE, isbroken = FALSE; 363 371 364 if (!pciParent || (INT) 372 if (!pciParent || (INT)pciParent == -1 || !*pciParent->pszFileName 365 373 || pciParent->pszFileName == NullStr || !hwndCnr) 366 374 return FALSE; … … 371 379 // Build wildcard 372 380 len = strlen(pciParent->pszFileName); 373 memcpy(str, pciParent->pszFileName, len + 1); 374 if (str[len - 1] != '\\') 375 str[len++] = '\\'; 376 str[len++] = '*'; 377 str[len] = 0; 378 379 if (!isalpha(*str) || str[1] != ':' || str[2] != '\\') 380 MakeFullName(str); 381 memcpy(wildcard, pciParent->pszFileName, len + 1); 382 if (wildcard[len - 1] != '\\') 383 wildcard[len++] = '\\'; 384 wildcard[len++] = '*'; 385 wildcard[len] = 0; 386 387 // 2015-08-19 SHL FIXME to know how this can happen 388 if (!isalpha(*wildcard) || wildcard[1] != ':' || wildcard[2] != '\\') { 389 MakeFullName(wildcard); 390 DbgMsg(pszSrcFile, __LINE__, "Stubby MakeFullName returned %s", wildcard); // 2015-08-19 SHL FIXME debug 391 } 381 392 382 393 drvNum = toupper(*pciParent->pszFileName) - 'A'; 383 394 flags = driveflags[drvNum]; 384 if (!isalpha(* str) ||385 str[1] != ':' ||386 str[2] != '\\' || ((flags & DRIVE_IGNORE)))395 if (!isalpha(*wildcard) || 396 wildcard[1] != ':' || 397 wildcard[2] != '\\' || ((flags & DRIVE_IGNORE))) 387 398 return FALSE; // Not a directory or ignore requested 388 399 … … 394 405 if (fRemoteBug) { 395 406 if (brokenlan) { 396 ddepth = (ULONG) -1;407 ddepth = (ULONG)-1; 397 408 ddepth--; 398 409 } … … 412 423 fl = includefiles ? FILE_DIRECTORY : MUST_HAVE_DIRECTORY; 413 424 414 rc = DosFindFirst(str, 425 DbgMsg(pszSrcFile, __LINE__, "Stubby DosFindFirst(%s)", wildcard); // 2015-08-19 SHL FIXME debug 426 427 rc = DosFindFirst(wildcard, 415 428 &hDir, 416 429 FILE_NORMAL | fl | … … 425 438 // Find returned file when only directories requested 426 439 brokenlan = TRUE; 427 ddepth = (ULONG) -1;440 ddepth = (ULONG)-1; 428 441 ddepth--; 429 442 if (!NoBrokenNotify) { … … 477 490 total, toupper(*pciParent->pszFileName)); 478 491 if (rc && rc != ERROR_NO_MORE_FILES) 479 sprintf(&s[strlen(s)], GetPString(IDS_SEARCHERRORTEXT), rc, str);492 sprintf(&s[strlen(s)], GetPString(IDS_SEARCHERRORTEXT), rc, wildcard); 480 493 else if (ddepth < 16) 481 494 brokenlan = TRUE; … … 502 515 isremote ? GetPString(IDS_REMOTETEXT) : 503 516 GetPString(IDS_LOCALTEXT), 504 * str);517 *wildcard); 505 518 if (prc == MBID_NO) { 506 519 saymsg(MB_ENTER, … … 551 564 else { 552 565 RECORDINSERT ri; 553 pci->pszFileName = NullStr; 554 pci->pszDisplayName = pci->pszFileName; 566 // 2015-08-19 SHL FIXME to use BldFullPathName(wildcard, ...) 567 pci->pszFileName = NullStr; // 2015-08-19 SHL FIXME to doc why 568 pci->pszDisplayName = NullStr; 555 569 pci->rc.pszIcon = pci->pszDisplayName; 556 570 memset(&ri, 0, sizeof(RECORDINSERT)); 557 571 ri.cb = sizeof(RECORDINSERT); 558 ri.pRecordOrder = (PRECORDCORE) 559 ri.pRecordParent = (PRECORDCORE) 560 ri.zOrder = (ULONG) 572 ri.pRecordOrder = (PRECORDCORE)CMA_END; 573 ri.pRecordParent = (PRECORDCORE)pciParent; 574 ri.zOrder = (ULONG)CMA_TOP; 561 575 ri.cRecordsInsert = 1; 562 576 ri.fInvalidateRecord = TRUE; 563 // DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD %p \"%s\" %.255s", pci, pci->pszFileName, pffb->achName); // 2015-08-03 SHL FIXME debug 577 // 2015-08-03 SHL FIXME debug 578 if (pci->pszFileName == NullStr) 579 DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD %p \"%s\" %.255s", pci, pci->pszFileName, pffb->achName); 564 580 if (!WinSendMsg(hwndCnr, 565 581 CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) { … … 568 584 WinSetFocus(HWND_DESKTOP, hwndCnr); 569 585 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 586 if (!fNoFleshDbgMsg) { 587 // 2015-08-03 SHL FIXME debug 588 if (pci->pszFileName == NullStr) 589 DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pci, pci->pszFileName); // 2015-08-03 SHL FIXME debug 590 } 572 591 if (!WinSendMsg(hwndCnr, 573 592 CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) { … … 585 604 } 586 605 } // if isadir 587 else if (toupper(*str) > 'B' && str[1] == ':' && str[2] == '\\' && 588 !str[3]) { 589 606 else if (toupper(*wildcard) > 'B' && wildcard[1] == ':' && wildcard[2] == '\\' && 607 !wildcard[3]) { 608 609 // 2015-08-19 SHL FIXME to know how this can happen since wildcard ends with * 590 610 // Is root and no subdirectories 591 611 CHAR s[162]; 612 DbgMsg(pszSrcFile, __LINE__, "Stubby !isadir for %s", wildcard); // 2015-08-19 SHL FIXME debug 592 613 sprintf(s, 593 614 GetPString(IDS_NOSUBDIRS2TEXT), … … 599 620 } 600 621 } 601 else if (toupper(* str) > 'B' && rc != ERROR_NO_MORE_FILES) {622 else if (toupper(*wildcard) > 'B' && rc != ERROR_NO_MORE_FILES) { 602 623 // Find for remote or hard drive failed with error 603 624 CHAR s[CCHMAXPATH + 80]; 604 sprintf(s, GetPString(IDS_SEARCHERRORTEXT), rc, str);625 sprintf(s, GetPString(IDS_SEARCHERRORTEXT), rc, wildcard); 605 626 Notify(s); 606 627 } … … 629 650 630 651 /** 631 * Check pci matches652 * Check work list item pci matches passed pci 632 653 */ 633 654 … … 679 700 item->action= action; 680 701 681 if (fAmClosing) { 682 // Can jiggle - see MainWndProc WM_CLOSE 683 DosSleep(100); 684 if (fAmClosing) 685 return FALSE; 686 } 702 if (fAmQuitting) 703 return FALSE; 687 704 688 705 // 2015-08-03 SHL FIXME debug 706 #if 0 // 2015-08-13 SHL FIXME to be gone 689 707 { 690 #if 0 // 2015-08-13 SHL FIXME to be gone691 708 static PSZ itemNames[] = { 692 709 "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh" … … 698 715 itemNames[item->action], 699 716 pci, 700 pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug717 pszSrcFile_, uSrcLineNo); 701 718 } 702 719 else if (!pci->pszFileName) { … … 704 721 itemNames[item->action], 705 722 pci, 706 pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug723 pszSrcFile_, uSrcLineNo); 707 724 } 708 725 else if (!fNoFleshDbgMsg) { … … 717 734 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p", 718 735 itemNames[item->action], 719 pci); // 2015-08-03 SHL FIXME debug736 pci); 720 737 } 721 738 else if (!pci->pszFileName) { 722 739 Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName (null)", 723 740 itemNames[item->action], 724 pci); // 2015-08-03 SHL FIXME debug741 pci); 725 742 } 726 743 else if (!fNoFleshDbgMsg) { … … 731 748 } 732 749 #endif 750 } 733 751 #endif 734 }735 752 736 753 rc = DosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT); … … 738 755 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem"); 739 756 740 // 2015-08-13 SHL FIXME to be done741 757 // Delete stale requests 742 if (item->action == eUnFlesh) {758 if (item->action == eUnFlesh) 743 759 DeleteStaleFleshWorkListItems(pci); 744 }745 760 746 761 List2Append(&FleshWorkList, (PLIST2)item); … … 768 783 769 784 /** 770 * Wait until work list empty 785 * Check if pci pathname is parent of child path name 786 * @param data is child path name 787 * @return TRUE if is parent 788 */ 789 790 BOOL IsParentOfChildPath(PLIST2 item, PVOID data) 791 { 792 UINT c; 793 if (!((PFLESHWORKITEM)item)->pci->pszFileName) { 794 Runtime_Error(pszSrcFile, __LINE__, "MatchesFocusDrive called with pci %p pszFileName (null) by %s:%u", ((PFLESHWORKITEM)item)->pci); 795 return FALSE; 796 } 797 c = strlen(((PFLESHWORKITEM)item)->pci->pszFileName); 798 return strncmp(((PFLESHWORKITEM)item)->pci->pszFileName, (PCSZ)data, c) == 0; 799 } 800 801 /** 802 * Wait until work list empty or until dependent items removed from list 771 803 * Advisory only 804 * @parse pszFileName is dependent pathName 772 805 */ 773 806 774 807 #if 0 // 2015-08-03 SHL FIXME debug 775 VOID WaitFleshWorkListEmpty( )808 VOID WaitFleshWorkListEmpty(PCSZ pszFileName) 776 809 #else 777 VOID WaitFleshWorkListEmptyDbg(PCSZ psz SrcFile_, UINT uSrcLineNo_)810 VOID WaitFleshWorkListEmptyDbg(PCSZ pszFileName, PCSZ pszSrcFile_, UINT uSrcLineNo_) 778 811 #endif 779 812 { 813 APIRET rc; 814 PFLESHWORKITEM item; 780 815 INT tid = GetTidForThread(); 816 CHAR chSavedFleshFocusDrive = chFleshFocusDrive; 781 817 782 818 if (tid == 1 || tid == tidFleshWorkListThread) { … … 790 826 else if (IsFleshWorkListEmpty()) { 791 827 # ifdef WaitFleshWorkListEmpty 792 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist empty by tid %u at %s:%u", tid, pszSrcFile_, uSrcLineNo_);828 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist empty at %s:%u", pszSrcFile_, uSrcLineNo_); 793 829 # else 794 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list empty by tid %u", tid);830 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list empty"); 795 831 # endif 796 832 } … … 798 834 // Can not wait if call from thread 1 or FleshWorkListThread 799 835 while (!IsFleshWorkListEmpty()) { 836 837 #if 0 // 2015-08-19 SHL FIXME debug 800 838 # ifdef WaitFleshWorkListEmpty 801 839 if (!fNoFleshDbgMsg) 802 //DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty by %s:%u", pszSrcFile_, uSrcLineNo_); // 2015-08-07 SHL FIXME debug840 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty by %s:%u", pszSrcFile_, uSrcLineNo_); // 2015-08-07 SHL FIXME debug 803 841 # else 804 842 if (!fNoFleshDbgMsg) 805 //DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty"); // 2015-08-07 SHL FIXME debug843 DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty"); // 2015-08-07 SHL FIXME debug 806 844 # 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; 845 #endif // 2015-08-19 SHL FIXME debug 846 847 // 2015-08-13 SHL 848 if (fAmQuitting) 849 return; 850 851 // Just wait for dependents if path name given 852 if (pszFileName) { 853 rc = DosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT); 854 if (rc) { 855 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem"); 856 continue; 857 } 858 859 chFleshFocusDrive = *pszFileName; // Give priority to work on this drive 860 861 item = (PFLESHWORKITEM)List2Search(&FleshWorkList, IsParentOfChildPath, (PVOID)pszFileName); 862 863 rc = DosReleaseMutexSem(hmtxFleshWork); 864 if (rc) 865 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosReleaseMutexSem"); 866 867 if (!item) 868 break; // Dependents gone from work list 813 869 } 814 870 DosSleep(250); 815 } 871 } // while 872 873 chFleshFocusDrive = chSavedFleshFocusDrive; // In case overridden 874 816 875 } 817 876 … … 868 927 priority_normal(); 869 928 870 // 2015-08-07 SHL FIXME to know when to terminate 871 // process list entries forever 872 for (;;) { 929 // process list entries until time to die 930 for (;!fAmQuitting;) { 873 931 874 932 PFLESHWORKITEM item; 875 876 // 2015-08-13 SHL FIXME to optimize877 if (fAmClosing) {878 // Can jiggle - see MainWndProc WM_CLOSE879 DosSleep(100);880 if (fAmClosing)881 break; // time to die882 }883 933 884 934 // 2015-08-07 SHL FIXME to use SMPSafe... … … 907 957 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosReleaseMutexSem"); 908 958 909 // 2015-08-07 SHL FIXME to have event sem959 // Wait for new items to be added to list 910 960 if (!item) { 911 961 ULONG ul; … … 957 1007 // DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread pci %p pszFileName %s", stubbyArgs->pci, stubbyArgs->pci->pszFileName); // 2015-08-03 SHL FIXME debug 958 1008 flags = driveflags[toupper(*item->pci->pszFileName) - 'A']; 959 960 #if 0 // 2015-08-07 SHL FIXME to be gone961 if (flags & DRIVE_LOCALHD) {962 // Serialize to prevent head thrashing963 rc = DosRequestMutexSem(hmtxScanningLocalHD, SEM_INDEFINITE_WAIT);964 if (rc)965 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem");966 }967 #endif968 1009 969 1010 #if 1 … … 995 1036 // Drop through to eFlesh 996 1037 997 998 #if 0 // 2015-08-07 SHL FIXME to be gone999 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 gone1007 1008 // Drop through1009 1038 case eFlesh: 1010 1039 if (Flesh(item->hwndCnr, item->pci)) { … … 1032 1061 // DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", ProcessDirCount, FixedVolume); 1033 1062 if (ProcessDirCount >= FixedVolume) { 1034 1035 #if 0 // 2015-08-04 SHL FIXME to be gone1036 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 gone1040 1041 #if 0 // 2015-08-04 SHL FIXME to be gone1042 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 gone1046 1047 1063 ProcessDirCount = 0; 1048 1064 FixedVolume = 0; -
trunk/dll/flesh.h
r1856 r1858 10 10 11 11 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 12 19 Aug 15 SHL Allow WaitFleshWorkListEmpty to wait for dependent items 12 13 13 14 ***********************************************************************/ … … 27 28 VOID WaitFleshWorkListEmpty(); 28 29 #else 29 #define WaitFleshWorkListEmpty( ) WaitFleshWorkListEmptyDbg(__FILE__, __LINE__)30 VOID WaitFleshWorkListEmptyDbg(PCSZ psz SrcFile, UINT uSrcLineNo);30 #define WaitFleshWorkListEmpty(pszFileName) WaitFleshWorkListEmptyDbg(pszFileName, __FILE__, __LINE__) 31 VOID WaitFleshWorkListEmptyDbg(PCSZ pszFileName, PCSZ pszSrcFile, UINT uSrcLineNo); 31 32 #endif 32 33 -
trunk/dll/init.c
r1856 r1858 135 135 12 Aug 15 JBS Ticket #524: Ensure no "highmem-unsafe" functions are called directly 136 136 Calls to unsafe Dos... functions have been changed to call the wrapped xDos... functions 137 19 Aug 15 SHL Delete obsoletes 137 138 138 139 ***********************************************************************/ … … 239 240 HMTX hmtxFM2Globals; 240 241 241 #if 0 // 2015-08-04 SHL FIXME to be gone242 HMTX hmtxScanning;243 #endif // 2015-08-04 SHL FIXME to be gone244 245 #if 0 // 2015-08-07 SHL FIXME to be gone246 HMTX hmtxScanningLocalHD;247 #endif // 2015-08-07 SHL FIXME to be gone248 249 242 HMTX hmtxFiltering; 250 251 #if 0 // 2015-08-04 SHL FIXME to be gone252 HEV hevTreeCnrScanComplete;253 #endif // 2015-08-04 SHL FIXME to be gone254 243 255 244 ULONG OS2ver[2]; … … 1187 1176 PCSZ_DOSCREATEMUTEXSEM); 1188 1177 } 1189 #if 0 // 2015-08-04 SHL FIXME to be gone1190 if (DosCreateMutexSem(NULL, &hmtxScanning, 0L, TRUE))1191 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,1192 PCSZ_DOSCREATEMUTEXSEM);1193 #endif // 2015-08-04 SHL FIXME to be gone1194 #if 0 // 2015-08-07 SHL FIXME to be gone1195 rc = DosCreateMutexSem(NULL, &hmtxScanningLocalHD, 0L, FALSE);1196 if (rc) {1197 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,1198 PCSZ_DOSCREATEMUTEXSEM);1199 }1200 #endif // 2015-08-07 SHL FIXME to be gone1201 1178 rc = DosCreateMutexSem(NULL, &hmtxFM2Delete, 0L, FALSE); 1202 1179 if (rc) { … … 1209 1186 PCSZ_DOSCREATEMUTEXSEM); 1210 1187 } 1211 #if 0 // 2015-08-04 SHL FIXME to be gone1212 rc = DosCreateEventSem(NULL, &hevTreeCnrScanComplete, 0L, TRUE);1213 if (rc) {1214 Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,1215 PCSZ_DOSCREATEEVENTSEM);1216 }1217 #endif // 2015-08-04 SHL FIXME to be gone1218 1188 1219 1189 /** -
trunk/dll/init.h
r1856 r1858 43 43 02 Aug 15 GKY Serialize local hard drive scanning to reduce drive thrashing continue to scan 44 44 all other drive types in separate threads. 45 19 Aug 15 SHL Delete obsoletes 45 46 46 47 ***********************************************************************/ … … 238 239 extern HMTX hmtxFM2Globals; 239 240 extern HMTX hmtxFM2Delete; 240 241 #if 0 // 2015-08-07 SHL FIXME to be gone242 extern HMTX hmtxScanning;243 #endif // 2015-08-07 SHL FIXME to be gone244 245 #if 0 // 2015-08-07 SHL FIXME to be gone246 extern HMTX hmtxScanningLocalHD;247 #endif // 2015-08-07 SHL FIXME to be gone248 249 241 extern HMTX hmtxFiltering; 250 242 251 #if 0 // 2015-08-04 SHL FIXME to be gone252 extern HEV hevTreeCnrScanComplete;253 #endif // 2015-08-04 SHL FIXME to be gone254 255 243 #endif 256 244 -
trunk/dll/mainwnd.c
r1856 r1858 120 120 09 Aug 15 SHL Use RESTORE_STATE_... 121 121 13 Aug 15 SHL Sync with Flesh/Stubby mods 122 19 Aug 15 SHL Add/use fAmQuitting 123 19 Aug 15 SHL Delete obsoletes 122 124 123 125 ***********************************************************************/ … … 214 216 PFNWP PFNWPButton; 215 217 PFNWP PFNWPStatic; 216 BOOL fAmClosing; 218 BOOL fAmClosing; // Attempting to close main window 219 BOOL fAmQuitting; // Main window close/destroy in progress 217 220 BOOL fAutoTile; 218 221 BOOL fAutoView; … … 1824 1827 MRESULT EXPENTRY DriveBackProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) 1825 1828 { 1826 #if 0 // 2015-08-04 SHL FIXME to be gone1827 APIRET rc;1828 #endif // 2015-08-04 SHL FIXME to be gone1829 1830 1829 static BOOL emphasized; 1831 1830 … … 2101 2100 2102 2101 case WM_COMMAND: 2103 #if 0 // 2015-08-04 SHL FIXME to be gone2104 rc = DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT);2105 if (rc)2106 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosWaitEventSem");2107 #endif // 2015-08-04 SHL FIXME to be gone2108 2109 2102 switch(SHORT1FROMMP(mp1)) { 2110 2103 case IDM_RESCAN: … … 6679 6672 WM_SYSCOMMAND, MPFROM2SHORT(SC_MINIMIZE, 0), MPVOID); 6680 6673 if (CloseChildren(hwnd)) { 6674 // Close request refused - recover 6681 6675 fAmClosing = FALSE; 6682 6676 if (fAutoTile) … … 6688 6682 WinSendMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID); 6689 6683 } 6684 fAmQuitting = TRUE; // Let world know quit in progress 6690 6685 DosSleep(1); 6691 6686 DbgMsg(pszSrcFile, __LINE__, "MainWndProc WM_CLOSE returning with fAmClosing %u", fAmClosing); // 2015-08-16 SHL -
trunk/dll/mainwnd.h
r1856 r1858 15 15 letter windows; Use button ID to identify drive letter for processing. 16 16 13 Aug 15 SHL Sync with Flesh/Stubby updates 17 19 Aug 15 SHL Add fAmQuitting 17 18 18 19 ***********************************************************************/ … … 65 66 extern RGB2 RGBGREY; 66 67 extern BOOL fAmClosing; 68 extern BOOL fAmQuitting; // Main window close/destroy in progress 67 69 extern BOOL fAutoTile; 68 70 extern BOOL fAutoView; -
trunk/dll/mainwnd2.c
r1856 r1858 1404 1404 CloseChildren(hwnd); 1405 1405 PostMsg(hwnd, UM_CLOSE, MPVOID, MPVOID); 1406 fAmQuitting = TRUE; // Let world know quit in progress 1406 1407 DbgMsg(pszSrcFile, __LINE__, "MainWndProc2 WM_CLOSE returning with fAmClosing %u", fAmClosing); // 2015-08-16 SHL 1407 1408 DosSleep(1); -
trunk/dll/treecnr.c
r1857 r1858 326 326 327 327 // Try again expanding as needed 328 329 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec need expand"); // 2015-08-04 SHL FIXME debug 328 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec need expand, IsFleshWorkListEmpty %u", IsFleshWorkListEmpty()); // 2015-08-04 SHL FIXME debug 330 329 331 330 cDirLen = strlen(pszDir_); … … 347 346 if (!pciP || (INT)pciP == -1) { 348 347 DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(%s) returned %p", szDir, pciP); // 2015-08-04 SHL FIXME debug 349 WaitFleshWorkListEmpty( ); // 2015-08-13SHL348 WaitFleshWorkListEmpty(szDir); // 2015-08-19 SHL 350 349 DosSleep(1000); 351 350 break; // No match … … 364 363 WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID); 365 364 DosSleep(100); // 2015-08-13 SHL Let PM catch up 366 // WaitFleshWorkListEmpty(); // 2015-08-13 SHL 367 } 368 369 WaitFleshWorkListEmpty(); // 2015-08-13 SHL 365 } 366 367 WaitFleshWorkListEmpty(szDir); // 2015-08-19 SHL 370 368 371 369 // Add next component to path … … 433 431 434 432 if (!quickbail) { 435 WaitFleshWorkListEmpty( ); // 2015-08-07 SHL FIXMEtry to ensure contents stable433 WaitFleshWorkListEmpty(pszDir_); // 2015-08-19 SHL try to ensure contents stable 436 434 DbgMsg(pszSrcFile, __LINE__, "WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED) \"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug 437 435 WinSendMsg(hwndCnr, … … 707 705 DIRCNRDATA *dcd; 708 706 709 #if 0 // 2015-08-04 SHL FIXME to be gone710 APIRET rc;711 #endif // 2015-08-04 SHL FIXME to be gone712 713 707 switch (msg) { 714 708 case UM_SHOWME: … … 720 714 if (dcd) { 721 715 722 #if 0 // 2015-08-04 SHL FIXME to be gone723 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 gone727 728 716 /* Hold off if switching on focus change and 729 717 RestoreDirCnrState has restored one or directory directory containers 730 718 See RestoreDirCnrState() 731 719 */ 732 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME cDirectoriesRestored %u", cDirectoriesRestored , fInitialDriveScan); // 2015-08-04 SHL FIXME debug720 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME cDirectoriesRestored %u", cDirectoriesRestored); // 2015-08-04 SHL FIXME debug 733 721 DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME %s)", mp1); // 2015-08-04 SHL FIXME debug 734 722 … … 940 928 pci = FindParentRecord(dcd->hwndCnr, pci); 941 929 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 942 WaitFleshWorkListEmpty( ); // 2015-08-13SHL in case pci still in work list930 WaitFleshWorkListEmpty(pci->pszFileName); // 2015-08-19 SHL in case pci still in work list 943 931 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 944 932 } … … 952 940 953 941 case UM_RESCAN: 954 // populate container 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 942 // Populate container 964 943 dcd = WinQueryWindowPtr(hwnd, QWL_USER); 965 944 if (!dcd) … … 1931 1910 volser.serial) 1932 1911 { 1933 WaitFleshWorkListEmpty( ); // 2015-08-13SHL in case pci still in work list1912 WaitFleshWorkListEmpty(pci->pszFileName); // 2015-08-19 SHL in case pci still in work list 1934 1913 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 1935 1914 } … … 1948 1927 else { 1949 1928 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 1950 WaitFleshWorkListEmpty( ); // 2015-08-13SHL in case pci still in work list1929 WaitFleshWorkListEmpty(pci->pszFileName); // 2015-08-19 SHL in case pci still in work list 1951 1930 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 1952 1931 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); … … 2026 2005 INT x; 2027 2006 2028 #if 0 // 2015-08-04 SHL FIXME to be gone2029 rc = DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT);2030 if (rc)2031 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem");2032 #endif // 2015-08-04 SHL FIXME to be gone2033 2034 #if 0 // 2015-08-04 SHL FIXME to be gone2035 rc = DosQueryEventSem(hevTreeCnrScanComplete, &ulScanPostCnt);2036 if (rc)2037 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosQueryEventSem");2038 if (ulScanPostCnt < 1)2039 return 0;2040 rc = DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt);2041 if (rc)2042 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem");2043 #endif // 2015-08-04 SHL FIXME to be gone2044 2045 2007 if (fFollowTree) 2046 2008 fl = 0; … … 2057 2019 if (hwndStatus) 2058 2020 WinSetWindowText(hwndStatus, (CHAR *) GetPString(IDS_RESCANSUGTEXT)); 2059 2060 #if 0 // 2015-08-04 SHL FIXME to be gone2061 rc = DosPostEventSem(hevTreeCnrScanComplete);2062 if (rc && rc != ERROR_ALREADY_POSTED)2063 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");2064 #endif // 2015-08-04 SHL FIXME to be gone2065 2066 2021 return 0; 2067 2022 } … … 2083 2038 } // for 2084 2039 RemoveCnrItems(hwnd, pciP, 1, CMA_FREE | CMA_INVALIDATE); 2085 2086 #if 0 // 2015-08-04 SHL FIXME to be gone2087 rc = DosPostEventSem(hevTreeCnrScanComplete);2088 if (rc && rc != ERROR_ALREADY_POSTED)2089 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");2090 #endif // 2015-08-04 SHL FIXME to be gone2091 2040 return 0; 2092 2041 } … … 2131 2080 if (!rc) { 2132 2081 if (!volser.serial || driveserial[x] != volser.serial) { 2133 #if 1 // 2015-08-04 SHL FIXME to be gone2134 2082 AddFleshWorkRequest(hwnd, pciP, eFlesh); // forceFlesh 2135 #else2136 Flesh(hwnd, pciP);2137 #endif // 2015-08-04 SHL FIXME to be gone2138 2083 driveserial[x] = volser.serial; 2139 2084 } … … 2143 2088 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 2144 2089 if (!pciL) { 2145 #if 1 // 2015-08-04 SHL FIXME to be gone2146 2090 AddFleshWorkRequest(hwnd, pciP, eFlesh); // forceFlesh 2147 #else2148 Flesh(hwnd, pciP);2149 #endif // 2015-08-04 SHL FIXME to be gone2150 2091 } 2151 2092 if ((fShowFSTypeInTree || fShowDriveLabelInTree) && … … 2165 2106 else { 2166 2107 driveserial[x] = -1; 2167 WaitFleshWorkListEmpty( ); // 2015-08-13 SHL in case pci still in work list2108 WaitFleshWorkListEmpty(NULL); // 2015-08-13 SHL in case pci still in work list 2168 2109 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2169 2110 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); 2170 2111 PostMsg(hwnd, UM_SETUP2, MPFROMP(pci), MPFROMLONG(rc)); 2171 2172 #if 0 // 2015-08-04 SHL FIXME to be gone2173 rc = DosPostEventSem(hevTreeCnrScanComplete);2174 if (rc && rc != ERROR_ALREADY_POSTED)2175 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");2176 #endif // 2015-08-04 SHL FIXME to be gone2177 2112 return 0; 2178 2113 } … … 2197 2132 PostMsg(hwnd, 2198 2133 WM_COMMAND, MPFROM2SHORT(IDM_SHOWALLFILES, 0), MPVOID); 2199 2200 #if 0 // 2015-08-04 SHL FIXME to be gone2201 rc = DosPostEventSem(hevTreeCnrScanComplete);2202 if (rc && rc != ERROR_ALREADY_POSTED)2203 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");2204 #endif // 2015-08-04 SHL FIXME to be gone2205 2134 return 0; 2206 2135 } 2207 2136 if ((shiftstate & (KC_CTRL | KC_SHIFT)) == (KC_CTRL | KC_SHIFT)) { 2208 2137 OpenObject(pci->pszFileName, Settings, dcd->hwndFrame); 2209 2210 #if 0 // 2015-08-04 SHL FIXME to be gone2211 rc = DosPostEventSem(hevTreeCnrScanComplete);2212 if (rc && rc != ERROR_ALREADY_POSTED)2213 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");2214 #endif // 2015-08-04 SHL FIXME to be gone2215 2138 return 0; 2216 2139 } … … 2218 2141 if (!ParentIsDesktop(hwnd, dcd->hwndParent)) { 2219 2142 if (FindDirCnrByName(pci->pszFileName, TRUE)) { 2220 2221 #if 0 // 2015-08-04 SHL FIXME to be gone2222 rc = DosPostEventSem(hevTreeCnrScanComplete);2223 if (rc && rc != ERROR_ALREADY_POSTED)2224 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");2225 #endif // 2015-08-04 SHL FIXME to be gone2226 2143 return 0; 2227 2144 } … … 2247 2164 } 2248 2165 OpenObject(pci->pszFileName, s, dcd->hwndFrame); 2249 2250 #if 0 // 2015-08-04 SHL FIXME to be gone2251 rc = DosPostEventSem(hevTreeCnrScanComplete);2252 if (rc && rc != ERROR_ALREADY_POSTED)2253 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");2254 #endif // 2015-08-04 SHL FIXME to be gone2255 2166 return 0; 2256 2167 } … … 2296 2207 if (fFollowTree) 2297 2208 WinSetFocus(HWND_DESKTOP, hwnd); 2298 2299 #if 0 // 2015-08-04 SHL FIXME to be gone2300 rc = DosPostEventSem(hevTreeCnrScanComplete);2301 if (rc && rc != ERROR_ALREADY_POSTED)2302 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");2303 #endif // 2015-08-04 SHL FIXME to be gone2304 2209 } 2305 2210 return 0; … … 2992 2897 break; 2993 2898 2994 #if 0 // 2015-08-04 SHL FIXME to be gone2995 rc = DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT);2996 if (rc)2997 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem");2998 #endif // 2015-08-04 SHL FIXME to be gone2999 3000 #if 0 // 2015-08-04 SHL FIXME to be gone3001 rc = DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt);3002 if (rc)3003 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem");3004 #endif // 2015-08-04 SHL FIXME to be gone3005 3006 // Can't wait here3007 // WaitFleshWorkListEmpty(); // 2015-08-13 SHL in case pci still in work list3008 2899 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2900 3009 2901 // Check if drive type might need update 3010 2902 if ((driveflag & (DRIVE_INVALID | DRIVE_NOPRESCAN)) || … … 3035 2927 if (~driveflag & DRIVE_INVALID) 3036 2928 AddFleshWorkRequest(hwnd, pci, eFlesh); 3037 #if 0 // 2015-08-04 SHL FIXME to be gone3038 rc = DosPostEventSem(hevTreeCnrScanComplete);3039 if (rc && rc != ERROR_ALREADY_POSTED)3040 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");3041 #endif // 2015-08-04 SHL FIXME to be gone3042 2929 } 3043 2930 }
Note:
See TracChangeset
for help on using the changeset viewer.