Changeset 1335 for trunk/dll/worker.c
- Timestamp:
- Dec 13, 2008, 12:49:02 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/worker.c
r1324 r1335 1 1 2 /*********************************************************************** 2 3 … … 28 29 20 Jul 08 GKY Add save/append filename to clipboard. 29 30 02 Aug 08 GKY Limit use of "trash can" to local writable fixed drives or to trash can supported 30 31 drives list if it exists. Fix ability to deselect use of trash can. 31 32 01 Sep 08 GKY Add code to retry on Netdrives "pipe error" 32 33 04 Dec 08 GKY Add a DosSleep to allow file extract to complete before rescan 33 34 04 Dec 08 GKY Add mutex semaphore and disable fSyncUpdates for file deletes to prevent the creation 34 on dead CNRITEMS. 35 on dead CNRITEMS. 36 10 Dec 08 SHL Integrate exception handler support 35 37 36 38 ***********************************************************************/ … … 40 42 #include <ctype.h> 41 43 #include <share.h> 42 #include <process.h> // _beginthread 44 #include <process.h> // _beginthread // 10 Dec 08 SHL 43 45 #include <time.h> 44 46 … … 67 69 #include "strutil.h" // GetPString 68 70 #include "notebook.h" // External viewers 69 #include "worker.h" 70 #include "notify.h" 71 #include "copyf.h" 71 #include "worker.h" // Action 72 #include "notify.h" // AddNote 73 #include "copyf.h" // AdjustWildcardName, make_deleteable 72 74 #include "attribs.h" // AttrListDlgProc 73 75 #include "chklist.h" // CheckListProc … … 97 99 #include "wrappers.h" // xfopen 98 100 #include "fortify.h" 101 #include "excputil.h" // 06 May 08 SHL added 99 102 100 103 // Data definitions … … 124 127 if (undo->type && undo->list && undo->list[0]) { 125 128 switch (undo->type) { 126 case IDM_MOVE case IDM_COPY: 129 case IDM_MOVE: 130 case IDM_COPY: 127 131 case IDM_EXTRACT: 128 132 { … … 147 151 break; 148 152 } 149 if (_beginthread(MassAction, NULL, 122880, (PVOID) wk) == -1) { 150 Runtime_Error(pszSrcFile, __LINE__, 151 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 153 if (xbeginthread(MassAction, 154 122880, 155 wk, 156 pszSrcFile, 157 __LINE__) == -1) 158 { 152 159 FreeListInfo(wk->li); 153 160 free(wk); … … 162 169 } 163 170 break; 164 } 171 } // switch 165 172 } 166 173 FreeUndo(); … … 477 484 if (needs_quoting(ex.masks) && !strchr(ex.masks, '\"')) 478 485 maskspaces = TRUE; 479 486 if (!runemf2(SEPARATE | WINDOWED | WAIT | 480 487 fArcStuffVisible ? 0 : (BACKGROUND | MINIMIZED), 481 488 HWND_DESKTOP, pszSrcFile, __LINE__, ex.extractdir, NULL, … … 486 493 *ex.masks ? ex.masks : "\"*\"", 487 494 maskspaces ? "\"" : NullStr) && 488 489 490 495 !stricmp(ex.extractdir, wk->directory)) { 496 DosSleep(100); // wait for runemf2 to complete so rescan will actually show something 497 if (WinIsWindow((HAB) 0, wk->hwndCnr)) 491 498 WinSendMsg(wk->hwndCnr, 492 499 WM_COMMAND, … … 596 603 case IDM_MOVE: 597 604 case IDM_COPY: 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 605 case IDM_RENAME: 606 { 607 608 if (!*wk->li->targetpath && (wk->li->type == IDM_MOVE || 609 wk->li->type == IDM_COPY || 610 wk->li->type == IDM_WPSMOVE || 611 wk->li->type == IDM_WPSCOPY)) { 612 613 APIRET rc = 1; 614 615 usedtarget = FALSE; 616 if (hwndMain) { 617 if (!*targetdir) 618 TopWindowName(hwndMain, 619 wk->hwndFrame, wk->li->targetpath); 620 else { 621 strcpy(wk->li->targetpath, targetdir); 622 usedtarget = TRUE; 623 } 624 } 625 if (!*wk->li->targetpath) 626 strcpy(wk->li->targetpath, wk->directory); 627 if (!*wk->li->targetpath) { 628 strcpy(wk->li->targetpath, wk->li->list[0]); 629 p = strrchr(wk->li->targetpath, '\\'); 630 if (p) { 631 if (*(p - 1) == ':') 632 p++; 633 *p = 0; 634 } 635 } 636 MakeValidDir(wk->li->targetpath); 637 if (fConfirmTarget || 638 (!*targetdir && strcmp(realappname, "FM/4"))) { 639 RetryPath: 640 usedtarget = FALSE; 641 if (wk->li->type == IDM_MOVE || 642 wk->li->type == IDM_WPSMOVE) { 643 rc = WinDlgBox(HWND_DESKTOP, 644 wk->hwndFrame, 645 WalkMoveDlgProc, 646 FM3ModHandle, 647 WALK_FRAME, MPFROMP(wk->li->targetpath)); 648 } 649 else if (wk->li->type == IDM_COPY || 650 wk->li->type == IDM_WPSCOPY) { 651 rc = WinDlgBox(HWND_DESKTOP, 652 wk->hwndFrame, 653 WalkCopyDlgProc, 654 FM3ModHandle, 655 WALK_FRAME, MPFROMP(wk->li->targetpath)); 656 } 657 else 658 rc = WinDlgBox(HWND_DESKTOP, 659 wk->hwndFrame, 660 WalkDlgProc, 661 FM3ModHandle, 662 WALK_FRAME, MPFROMP(wk->li->targetpath)); 663 } 664 if (!rc || !*wk->li->targetpath) 665 goto Abort; 666 if (driveflags[toupper(*wk->li->targetpath) - 'A'] & 667 DRIVE_NOTWRITEABLE) { 668 saymsg(MB_CANCEL, 669 wk->hwndFrame, 670 GetPString(IDS_ERRORTEXT), 671 "%s", GetPString(IDS_NOTWRITENOTARGETTEXT)); 672 goto RetryPath; 673 } 674 } 675 Retry: 676 { 677 CHAR newname[CCHMAXPATH], *moving, *move, *moved; 678 APIRET rc; 679 INT type; 680 FILESTATUS4L fs4; 681 BOOL isnewer, existed; 682 683 type = (wk->li->type == IDM_RENAME) ? MOVE : 684 (wk->li->type == IDM_MOVE) ? MOVE : 685 (wk->li->type == IDM_WPSMOVE) ? WPSMOVE : 686 (wk->li->type == IDM_WPSCOPY) ? WPSCOPY : COPY; 687 moving = (wk->li->type == IDM_RENAME) ? 688 GetPString(IDS_RENAMINGTEXT) : 689 (wk->li->type == IDM_MOVE || 690 wk->li->type == IDM_WPSMOVE) ? 691 GetPString(IDS_MOVINGTEXT) : GetPString(IDS_COPYINGTEXT); 692 move = (wk->li->type == IDM_RENAME) ? 693 GetPString(IDS_RENAMETEXT) : 694 (wk->li->type == IDM_MOVE || 695 wk->li->type == IDM_WPSMOVE) ? 696 GetPString(IDS_MOVETEXT) : GetPString(IDS_COPYTEXT); 697 moved = (wk->li->type == IDM_RENAME) ? 698 GetPString(IDS_RENAMEDTEXT) : 699 (wk->li->type == IDM_MOVE || 700 wk->li->type == IDM_WPSMOVE) ? 701 GetPString(IDS_MOVEDTEXT) : GetPString(IDS_COPIEDTEXT); 702 if (*wk->li->targetpath) { 703 strcpy(newname, wk->li->targetpath); 704 if (newname[strlen(newname) - 1] != '\\') 705 strcat(newname, "\\"); 706 if (plen) 707 p = wk->li->list[x] + plen; 708 else { 709 p = strrchr(wk->li->list[x], '\\'); 710 if (p) 711 p++; 712 else 713 p = wk->li->list[x]; 714 } 715 strcat(newname, p); 716 } 717 else 718 strcpy(newname, wk->li->list[x]); 719 if ((wildcarding || wk->li->type == IDM_RENAME) && 720 *wildname) { 721 722 CHAR testname[CCHMAXPATH]; 723 724 strcpy(testname, wildname); 725 if (AdjustWildcardName(newname, testname)) 726 strcpy(newname, testname); 727 } 728 existed = (IsFile(newname) != -1); 729 isnewer = IsNewer(wk->li->list[x], newname); 730 /* 731 { 732 char temp[CCHMAXPATH * 3]; 733 sprintf(temp,"Target: %s\rSource: %s\rOverold: %lu\rOvernew: %lu\rIsNewer: %lu\rExisted: %lu",newname,wk->li->list[x],overold,overnew,isnewer,existed); 734 saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,temp); 735 } 736 */ 737 if (existed && wk->li->type != IDM_RENAME && dontask) { 738 if (!overold && !overnew) 739 break; 740 if (!overold && !isnewer) 741 break; 742 if (!overnew && isnewer) 743 break; 744 } 745 if ((wk->li->type == IDM_RENAME && 746 (!dontask || !*wildname)) || 747 (!dontask && existed) || 748 (!dontask && wildcarding) || 749 (IsFile(newname) == 0 && IsFile(wk->li->list[x]) > 0)) { 750 751 MOVEIT mv; 752 753 memset(&mv, 0, sizeof(MOVEIT)); 754 mv.rename = (wk->li->type == IDM_RENAME); 755 mv.source = wk->li->list[x]; 756 strcpy(mv.target, newname); 757 rc = WinDlgBox(HWND_DESKTOP, 758 wk->hwndFrame, 759 RenameProc, 760 FM3ModHandle, REN_FRAME, (PVOID) & mv); 761 if (!rc) 762 goto Abort; 763 DosSleep(1); 764 if (mv.skip || !*mv.target) 765 break; 766 if (mv.dontask) 767 dontask = TRUE; 768 if (mv.overold) 769 overold = TRUE; 770 if (mv.overnew) 771 overnew = TRUE; 772 if (wildcarding || wk->li->type == IDM_RENAME) { 773 p = strrchr(mv.target, '\\'); 774 if (p && (strchr(p, '*') || strchr(p, '?'))) { 775 strcpy(wildname, mv.target); 776 AdjustWildcardName(wk->li->list[x], mv.target); 777 } 778 else 779 *wildname = 0; 780 } 781 strcpy(newname, mv.target); 782 existed = (IsFile(newname) != -1); 783 isnewer = IsNewer(wk->li->list[x], newname); 784 if (!mv.overwrite) { 785 if (existed && wk->li->type != IDM_RENAME && dontask) { 786 if (!overold && !overnew) 787 break; 788 if (!overold && !isnewer) 789 break; 790 if (!overnew && isnewer) 791 break; 792 } 793 } 794 } 795 if (!strcmp(wk->li->list[x], newname) || 796 (wk->li->type == IDM_COPY && 797 !stricmp(wk->li->list[x], newname))) 798 break; 799 sprintf(message, 800 " %s \"%s\" %s\"%s\"%s", 801 moving, 802 wk->li->list[x], 803 GetPString(IDS_TOTEXT), 804 newname, 805 (usedtarget) ? GetPString(IDS_TOTARGETTEXT) : 806 NullStr); 807 AddNote(message); 808 if (plen) { 809 /* make directory/ies, if required */ 810 811 CHAR dirpart[CCHMAXPATH]; 812 813 strcpy(dirpart, newname); 814 p = strrchr(dirpart, '\\'); 815 if (p) { 816 *p = 0; 817 if (p > dirpart + 3) 818 MassMkdir((hwndMain) ? hwndMain : wk->hwndCnr, 819 dirpart); 820 } 821 } 822 if (fRealIdle) 823 priority_idle(); 824 rc = docopyf(type, wk->li->list[x], "%s", newname); 825 priority_normal(); 826 if (rc) { 827 if ((rc == ERROR_DISK_FULL || 828 rc == ERROR_HANDLE_DISK_FULL) && 829 isalpha(*newname) && 830 (driveflags[toupper(*newname) - 'A'] & 831 DRIVE_REMOVABLE) 832 && !(driveflags[toupper(*newname) - 'A'] & 833 DRIVE_NOTWRITEABLE) 834 && toupper(*newname) != toupper(*wk->li->list[x]) 835 && !DosQueryPathInfo(wk->li->list[x], FIL_QUERYEASIZEL, 836 &fs4, sizeof(fs4)) 837 && !(fs4.attrFile & FILE_DIRECTORY)) { 838 839 FSALLOCATE fsa; 840 ULONGLONG ullFreeBytes; 841 CHAR *ptr; 842 INT cntr; 843 844 Notify(GetPString(IDS_FITTINGTEXT)); 845 DosError(FERR_DISABLEHARDERR); 846 if (!DosQueryFSInfo(toupper(*newname) - '@', 847 FSIL_ALLOC, 848 &fsa, sizeof(FSALLOCATE))) { 849 // Assume large file support 850 ullFreeBytes = (ULONGLONG) fsa.cUnitAvail * fsa.cSectorUnit * 851 fsa.cbSector; 852 if (ullFreeBytes) { 853 // Find item that will fit in available space 854 for (cntr = x + 1; wk->li->list[cntr]; cntr++) { 855 DosError(FERR_DISABLEHARDERR); 856 if (!DosQueryPathInfo(wk->li->list[cntr], 857 FIL_QUERYEASIZEL, 858 &fs4, 859 sizeof(fs4)) && 860 !(fs4.attrFile & FILE_DIRECTORY) && 861 // fixme to use CBLIST_TO_EASIZE? 862 fs4.cbFile + fs4.cbList <= ullFreeBytes) { 863 // Swap with failing item 864 ptr = wk->li->list[x]; 865 wk->li->list[x] = wk->li->list[cntr]; 866 wk->li->list[cntr] = ptr; 867 goto Retry; 868 } 869 } 870 Notify(GetPString(IDS_COULDNTFITTEXT)); 871 } 872 } 873 rc = saymsg(MB_ABORTRETRYIGNORE | MB_ICONEXCLAMATION, 874 wk->hwndFrame, 875 GetPString(IDS_DISKFULLTEXT), 876 "%s", GetPString(IDS_ANOTHERDISKTEXT)); 877 if (rc == MBID_RETRY) 878 goto Retry; 879 if (rc == MBID_ABORT) 880 goto Abort; 881 } 882 else { 883 if (LogFileHandle) 884 fprintf(LogFileHandle, 885 GetPString(IDS_LOGTOFAILEDTEXT), 886 move, wk->li->list[x], newname, rc); 887 rc = Dos_Error(MB_ENTERCANCEL, 888 rc, 889 wk->hwndFrame, 890 pszSrcFile, 891 __LINE__, 892 "%s %s \"%s\" %s\"%s\" %s.", 893 move, 894 GetPString(IDS_OFTEXT), 895 wk->li->list[x], 896 GetPString(IDS_TOTEXT), 897 newname, GetPString(IDS_FAILEDTEXT)); 898 if (rc == MBID_CANCEL) 899 goto Abort; 900 } 901 } 902 else { 903 if (LogFileHandle) 904 fprintf(LogFileHandle, 905 "%s \"%s\" %s\"%s\"\n", 906 moved, 907 wk->li->list[x], 908 GetPString(IDS_TOTEXT), newname); 909 if (//fSyncUpdates || 910 AddToList(wk->li->list[x], 911 &files, &numfiles, &numalloc)) 912 Broadcast(hab2, 913 wk->hwndCnr, 914 UM_UPDATERECORD, 915 MPFROMP(wk->li->list[x]), MPVOID); 916 if (//fSyncUpdates || 917 AddToList(newname, &files, &numfiles, &numalloc)) 918 Broadcast(hab2, 919 wk->hwndCnr, 920 UM_UPDATERECORD, MPFROMP(newname), MPVOID); 921 } 922 } 923 break; 924 } 918 925 919 926 case IDM_COMPARE: … … 1110 1117 if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | 1111 1118 SEARCH_CUR_DIRECTORY, 1112 "PATH", "FM2PLAY.EXE", fbuf, CCHMAXPATH - 1))1119 "PATH", "FM2PLAY.EXE", (PBYTE)fbuf, CCHMAXPATH - 1)) 1113 1120 total += strlen("..\\FM2UTILS\\FM2PLAY.EXE "); 1114 1121 else … … 1159 1166 if (DosSearchPath(SEARCH_IGNORENETERRS | SEARCH_ENVIRONMENT | 1160 1167 SEARCH_CUR_DIRECTORY, 1161 "PATH", "FM2PLAY.EXE", fbuf, CCHMAXPATH - 1))1168 "PATH", "FM2PLAY.EXE", (PBYTE)fbuf, CCHMAXPATH - 1)) 1162 1169 strcpy(szBuffer, "UTILS\\FM2PLAY.EXE"); 1163 1170 else … … 1229 1236 1230 1237 case IDM_APPENDTOCLIP: 1231 1232 1233 1238 case IDM_SAVETOCLIP: 1239 case IDM_SAVETOCLIPFILENAME: 1240 case IDM_APPENDTOCLIPFILENAME: 1234 1241 ListToClipboardHab(hab2, 1235 1242 wk->li->list, … … 1285 1292 strcat(ad.arcname, "\\"); 1286 1293 } 1287 1288 1294 if (!WinDlgBox(HWND_DESKTOP, wk->hwndFrame, ArchiveDlgProc, FM3ModHandle, 1295 ARCH_FRAME, (PVOID) & ad) || !*ad.arcname || !*ad.command) /* we blew it */ 1289 1296 break; 1290 1297 // Provide extension so containers work … … 1473 1480 if (wk->li && wk->li->list && wk->li->list[0]) { 1474 1481 strcpy(wk->li->targetpath, printer); 1475 if (_beginthread(PrintListThread, NULL, 65536, (PVOID) wk->li) 1476 == -1) 1477 Runtime_Error(pszSrcFile, __LINE__, 1478 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 1479 else 1480 wk->li = NULL; /* prevent LISTINFO li from being freed */ 1482 if (xbeginthread(PrintListThread, 1483 65536, 1484 wk->li, 1485 pszSrcFile, 1486 __LINE__) != -1) 1487 { 1488 wk->li = NULL; // prevent LISTINFO li from being freed here 1489 } 1481 1490 } 1482 1491 } … … 1504 1513 CHAR prompt[CCHMAXPATH * 3]; 1505 1514 APIRET error = 0; 1506 1507 1508 1515 HOBJECT hObjectdest, hObjectofObject; 1516 BYTE G_abSupportedDrives[24] = {0}; 1517 ULONG cbSupportedDrives = sizeof(G_abSupportedDrives); 1509 1518 1510 1519 for (x = 0; wk->li->list[x]; x++) { … … 1601 1610 if (!wk->li->list || !wk->li->list[0]) 1602 1611 break; 1603 1604 1612 } 1613 DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 GKY 1605 1614 for (x = 0; wk->li->list[x]; x++) { 1606 1615 fsa.attrFile = 0; … … 1609 1618 FIL_STANDARD, 1610 1619 &fsa, (ULONG) sizeof(FILESTATUS3)); 1611 1620 if (fsa.attrFile & FILE_DIRECTORY) { 1612 1621 /*sprintf(prompt, 1613 1622 GetPString(IDS_DELETINGTEXT), wk->li->list[x]); 1614 1623 AddNote(prompt);*/ //Duplicate call 12-03-08 GKY 1615 1624 DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 GKY 1616 1625 error = (APIRET) wipeallf("%s%s*", 1617 1626 wk->li->list[x], 1618 1627 (*wk->li->list[x] && 1619 1628 wk->li-> 1620 1621 1629 list[x][strlen(wk->li->list[x]) - 1] 1630 != '\\') ? "\\" : NullStr); 1622 1631 DosError(FERR_DISABLEHARDERR); 1623 1632 if (!error) 1624 1633 error = DosDeleteDir(wk->li->list[x]); 1625 1634 else 1626 1627 1628 } 1629 1630 1635 DosDeleteDir(wk->li->list[x]); 1636 DosReleaseMutexSem(hmtxFM2Delete); 1637 } 1638 else { 1639 DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 1631 1640 /*sprintf(prompt, 1632 1641 GetPString(IDS_DELETINGTEXT), wk->li->list[x]); … … 1635 1644 if (wk->li->type == IDM_DELETE){ 1636 1645 hObjectdest = WinQueryObject("<XWP_TRASHCAN>"); 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1646 PrfQueryProfileData(HINI_USER, 1647 "XWorkplace", 1648 "TrashCan::Drives", 1649 G_abSupportedDrives, 1650 &cbSupportedDrives); 1651 if (hObjectdest != NULLHANDLE && fTrashCan && 1652 (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] & 1653 1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] & 1654 (DRIVE_REMOVABLE | DRIVE_IGNORE | 1655 DRIVE_REMOTE | DRIVE_VIRTUAL | 1656 DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) { 1657 hObjectofObject = WinQueryObject(wk->li->list[x]); 1658 error = WinMoveObject(hObjectofObject, hObjectdest, 0); 1659 } 1660 else { 1661 //DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 GKY 1662 error = DosDelete(wk->li->list[x]); 1663 //DosReleaseMutexSem(hmtxFM2Delete); 1664 } 1656 1665 } 1657 1666 else { 1658 1659 1660 1661 1667 //DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 GKY 1668 error = DosForceDelete(wk->li->list[x]); 1669 //DosReleaseMutexSem(hmtxFM2Delete); 1670 } 1662 1671 if (error) { 1663 1672 DosError(FERR_DISABLEHARDERR); 1664 1673 make_deleteable(wk->li->list[x]); 1665 1674 if (wk->li->type == IDM_DELETE){ 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1675 hObjectdest = WinQueryObject("<XWP_TRASHCAN>"); 1676 PrfQueryProfileData(HINI_USER, 1677 "XWorkplace", 1678 "TrashCan::Drives", 1679 G_abSupportedDrives, 1680 &cbSupportedDrives); 1681 if (hObjectdest != NULLHANDLE && fTrashCan && 1682 (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] & 1683 1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] & 1684 (DRIVE_REMOVABLE | DRIVE_IGNORE | 1685 DRIVE_REMOTE | DRIVE_VIRTUAL | 1686 DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) { 1687 hObjectofObject = WinQueryObject(wk->li->list[x]); 1688 error = WinMoveObject(hObjectofObject, hObjectdest, 0); 1689 } 1681 1690 else { 1682 1683 1684 1685 1691 // DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 GKY 1692 error = DosDelete(wk->li->list[x]); 1693 // DosReleaseMutexSem(hmtxFM2Delete); 1694 } 1686 1695 } 1687 1696 else { 1688 1689 1690 1691 1692 } 1693 1694 1697 //DosRequestMutexSem(hmtxFM2Delete, SEM_INDEFINITE_WAIT); // Prevent race 12-3-08 GKY 1698 error = DosForceDelete(wk->li->list[x]); 1699 //DosReleaseMutexSem(hmtxFM2Delete); 1700 } 1701 } 1702 DosReleaseMutexSem(hmtxFM2Delete); 1703 } 1695 1704 if (error) { 1696 1705 if (LogFileHandle) … … 1716 1725 } 1717 1726 if (//fSyncUpdates || 1718 1727 AddToList(wk->li->list[x], &files, &numfiles, &numalloc)) { 1719 1728 Broadcast(hab2, 1720 1729 wk->hwndCnr, 1721 1730 UM_UPDATERECORD, 1722 1723 1724 } 1731 MPFROMP(wk->li->list[x]), MPVOID); 1732 } 1733 } // for 1725 1734 } 1726 1735 break; … … 1741 1750 } 1742 1751 } 1743 if (wk->li) 1744 FreeListInfo(wk->li); 1752 FreeListInfo(wk->li); 1745 1753 free(wk); 1746 1754 # ifdef FORTIFY
Note:
See TracChangeset
for help on using the changeset viewer.