Changeset 1721
- Timestamp:
- Feb 16, 2014, 9:16:25 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/worker.c
r1712 r1721 57 57 09 Feb 14 GKY Modified wipeallf to allow suppression of the readonly warning on delete 58 58 of temporary files 59 16 Feb 14 GKY Fixed move to trashcan to work when the trashcan::drives key hadn't been 60 written to OS2.INI. INI check is now only if fTrashCan is TRUE. 61 16 Feb 14 GKY Rework readonly check on delete code so it actually works in a logical way 62 and so it works with move to trashcan inabled. 59 63 60 64 ***********************************************************************/ … … 230 234 CHAR message[(CCHMAXPATH * 2) + 80], wildname[CCHMAXPATH]; 231 235 UINT x; 232 BOOL dontask = FALSE, wildcarding = FALSE, overold = 233 FALSE, overnew = FALSE, noreadonlywarn = FALSE, usedtarget; 236 BOOL dontask = FALSE, wildcarding = FALSE, overold = FALSE; 237 BOOL overnew = FALSE, usedtarget; 238 BOOL noreadonlywarn = FALSE; 234 239 235 240 WinCancelShutdown(hmq2, TRUE); … … 879 884 if (rc == ERROR_ACCESS_DENIED || rc == ERROR_SHARING_VIOLATION) { 880 885 ret = make_deleteable(newname, rc, noreadonlywarn); 886 if (ret == SM2_CANCEL) 887 break; 888 if (ret == SM2_DONTASK) 889 noreadonlywarn = TRUE; 890 if (ret == SM2_NO) 891 continue; 881 892 rc = docopyf(type, wk->li->list[x], newname); 882 893 } … … 1587 1598 FILESTATUS3 fsa; 1588 1599 CHAR prompt[CCHMAXPATH * 3]; 1589 APIRET error = 0 ;1600 APIRET error = 0, rc; 1590 1601 HOBJECT hObjectdest, hObjectofObject; 1591 1602 BYTE G_abSupportedDrives[24] = {0}; 1592 1603 ULONG cbSupportedDrives = sizeof(G_abSupportedDrives); 1593 1604 BOOL ignorereadonly = FALSE; 1605 INT retrn = 0; 1594 1606 1595 1607 for (x = 0; wk->li->list[x]; x++) { … … 1713 1725 DosError(FERR_DISABLEHARDERR); 1714 1726 if (wk->li->type == IDM_DELETE) { 1715 hObjectdest = WinQueryObject("<XWP_TRASHCAN>"); 1716 PrfQueryProfileData(HINI_USER, 1717 "XWorkplace", 1718 "TrashCan::Drives", 1719 G_abSupportedDrives, 1720 &cbSupportedDrives); 1721 if (hObjectdest != NULLHANDLE && fTrashCan && 1722 (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] & 1723 1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] & 1724 (DRIVE_REMOVABLE | DRIVE_IGNORE | 1725 DRIVE_REMOTE | DRIVE_VIRTUAL | 1726 DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) { 1727 hObjectofObject = WinQueryObject(wk->li->list[x]); 1728 error = WinMoveObject(hObjectofObject, hObjectdest, 0); 1729 } 1730 else { 1731 error = DosDelete(wk->li->list[x]); 1732 } 1733 } 1734 else { 1735 error = DosForceDelete(wk->li->list[x]); ; 1736 } 1727 if (fTrashCan) { 1728 hObjectdest = WinQueryObject("<XWP_TRASHCAN>"); 1729 rc = PrfQueryProfileData(HINI_USER, 1730 "XWorkplace", 1731 "TrashCan::Drives", 1732 G_abSupportedDrives, 1733 &cbSupportedDrives); 1734 if (hObjectdest != NULLHANDLE && 1735 (rc ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] & 1) 1736 :((driveflags[toupper(*wk->li->list[x]) - 'A'] & 1737 DRIVE_LOCALHD )))) { 1738 hObjectofObject = WinQueryObject(wk->li->list[x]); 1739 retrn = make_deleteable(wk->li->list[x], error, ignorereadonly); 1740 if (retrn == SM2_CANCEL) 1741 break; 1742 if (retrn == SM2_DONTASK) 1743 ignorereadonly = TRUE; 1744 if (retrn == SM2_NO) 1745 continue; 1746 error = WinMoveObject(hObjectofObject, hObjectdest, 0); 1747 } 1748 else 1749 error = DosDelete(wk->li->list[x]); 1750 } 1751 else 1752 error = DosDelete(wk->li->list[x]); 1753 } 1754 else 1755 error = DosForceDelete(wk->li->list[x]); 1737 1756 if (error) { 1738 INT retrn = 0;1739 1757 1740 1758 DosError(FERR_DISABLEHARDERR); 1741 1759 retrn = make_deleteable(wk->li->list[x], error, ignorereadonly); 1742 if (retrn == 2)1760 if (retrn == SM2_CANCEL) 1743 1761 break; 1744 if (retrn == 1)1762 if (retrn == SM2_DONTASK) 1745 1763 ignorereadonly = TRUE; 1746 if (retrn == 3)1764 if (retrn == SM2_NO) 1747 1765 continue; 1748 if (wk->li->type == IDM_DELETE){ 1749 hObjectdest = WinQueryObject("<XWP_TRASHCAN>"); 1750 PrfQueryProfileData(HINI_USER, 1751 "XWorkplace", 1752 "TrashCan::Drives", 1753 G_abSupportedDrives, 1754 &cbSupportedDrives); 1755 if (hObjectdest != NULLHANDLE && fTrashCan && 1756 (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] & 1757 1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] & 1758 (DRIVE_REMOVABLE | DRIVE_IGNORE | 1759 DRIVE_REMOTE | DRIVE_VIRTUAL | 1760 DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) { 1761 hObjectofObject = WinQueryObject(wk->li->list[x]); 1762 error = WinMoveObject(hObjectofObject, hObjectdest, 0); 1763 } 1764 else { 1765 error = DosDelete(wk->li->list[x]); 1766 } 1766 if (wk->li->type == IDM_DELETE) { 1767 if (fTrashCan) { 1768 hObjectdest = WinQueryObject("<XWP_TRASHCAN>"); 1769 rc = PrfQueryProfileData(HINI_USER, 1770 "XWorkplace", 1771 "TrashCan::Drives", 1772 G_abSupportedDrives, 1773 &cbSupportedDrives); 1774 if (hObjectdest != NULLHANDLE && 1775 (rc ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] & 1) 1776 :((driveflags[toupper(*wk->li->list[x]) - 'A'] & 1777 DRIVE_LOCALHD )))) { 1778 hObjectofObject = WinQueryObject(wk->li->list[x]); 1779 error = WinMoveObject(hObjectofObject, hObjectdest, 0); 1780 } 1781 else 1782 error = DosDelete(wk->li->list[x]); 1783 } 1784 else 1785 error = DosDelete(wk->li->list[x]); 1767 1786 } 1768 else {1787 else 1769 1788 error = DosForceDelete(wk->li->list[x]); 1770 }1771 1789 } 1772 1790 DosReleaseMutexSem(hmtxFM2Delete); 1773 1791 } 1774 if (error) { 1792 if (error && (error != 5 || 1793 (error == 5 && 1794 (retrn == SM2_YES || retrn == SM2_DONTASK || retrn == 0)))) { 1775 1795 if (LogFileHandle) 1776 1796 fprintf(LogFileHandle,
Note:
See TracChangeset
for help on using the changeset viewer.