Changeset 1856 for trunk/dll/treecnr.c
- Timestamp:
- Aug 18, 2015, 7:12:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 80 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 83 CHAR CONSTANT * as CHAR *. 84 84 11 Apr 10 GKY Fix drive tree rescan failure and program hang caused by event sem 85 85 never being posted 86 86 20 Nov 10 GKY Rework scanning code to remove redundant scans, prevent double directory 87 88 87 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 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 95 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 98 97 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 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 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 798 (SHORT1FROMMP(mp1) == IDM_EXPAND), (PCNRITEM) mp2); 720 799 DosSleep(1); // Fixes tree epansion (dir text and icons all placed on 721 800 // 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 870 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 812 890 *szFree = 0; 891 //Show information on status line not shown in the tree container 813 892 driveserial[toupper(*pci->pszFileName) - 'A'] = volser.serial; 814 815 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 829 830 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 838 839 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 920 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) 1141 if (pci && (INT) 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 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, 1518 0); 1519 if (DrgVerifyRMF(pDItem, 1608 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 1522 1523 1524 DrgFreeDraginfo(pDInfo); 1612 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, 1623 return MRFROM2SHORT(DOR_DROP, // Return okay to drop 1533 1624 ((fCopyDefault) ? DO_COPY : DO_MOVE)); 1534 1625 } 1535 DrgFreeDraginfo(pDInfo); 1536 } 1537 return MRFROM2SHORT(DOR_NODROP, 0); 1626 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) 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 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 2000 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 2043 2044 2045 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 2238 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 2269 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 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 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 2641 2642 2808 DosFreeModule(hmod); 2809 } 2810 if (!rc) 2643 2811 PostMsg(hwndTree, WM_COMMAND, MPFROM2SHORT(IDM_RESCAN, 0), MPVOID); 2644 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 3015 else if (strlen(pci->pszFileName) < 4) { 2831 3016 SelectDriveIcon(pci); 2832 2833 2834 2835 2836 2837 2838 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 3025 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)
Note:
See TracChangeset
for help on using the changeset viewer.