Changeset 1664 for trunk/dll/worker.c


Ignore:
Timestamp:
Aug 5, 2012, 2:11:07 AM (13 years ago)
Author:
Gregg Young
Message:

Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of copy, move and delete operations. Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog for delete of readonly files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/worker.c

    r1646 r1664  
    4949                by temp file creation failures.
    5050  12 Nov 11 GKY Fixed extract failure caused by spaces in the arc file name.
     51  04 Aug 12 GKY Changes to use Unlock to unlock files if Unlock.exe is in path both from menu/toolbar and as part of
     52                copy, move and delete operations
     53  04 Aug 12 GKY Changes to allow copy and move over readonly files with a warning dialog; also added a warning dialog
     54                for delete of readonly files
    5155
    5256***********************************************************************/
     
    118122#pragma data_seg(GLOBAL2)
    119123FILE *LogFileHandle;
     124BOOL fUnlock;
    120125
    121126#pragma data_seg(DATA2)
     
    222227          UINT x;
    223228          BOOL dontask = FALSE, wildcarding = FALSE, overold =
    224             FALSE, overnew = FALSE, usedtarget;
     229            FALSE, overnew = FALSE, noreadonlywarn = FALSE, usedtarget;
    225230
    226231          WinCancelShutdown(hmq2, TRUE);
     
    455460                  }
    456461                }
    457                 break;
     462                break;
     463
     464              case IDM_UNLOCKFILE:
     465                runemf2(SEPARATE | KEEP | WINDOWED//| INVISIBLE | BACKGROUND
     466                        | WAIT,
     467                        HWND_DESKTOP, pszSrcFile, __LINE__,
     468                        NULL, NULL, "%s %s", PCSZ_UNLOCKEXE, wk->li->list[x]);
     469                break;
    458470
    459471              case IDM_VIEWARCHIVE:
     
    707719                    // Target OK so far
    708720                    CHAR newname[CCHMAXPATH];
    709                     APIRET rc;
     721                    APIRET rc;
     722                    INT ret;
    710723                    FILESTATUS4L fs4;
    711724                    BOOL isnewer;
     
    793806                        overold = TRUE;
    794807                      if (mv.overnew)
    795                         overnew = TRUE;
     808                        overnew = TRUE;
     809                      if (mv.noreadonlywarn)
     810                        noreadonlywarn = TRUE;
    796811                      if (wildcarding || wk->li->type == IDM_RENAME) {
    797812                        p = strrchr(mv.target, '\\');
     
    856871                      priority_idle();
    857872
    858                     rc = docopyf(type, wk->li->list[x], newname);
     873                    rc = docopyf(type, wk->li->list[x], newname);
     874                    if (rc == ERROR_ACCESS_DENIED || rc == ERROR_SHARING_VIOLATION) {
     875                      if (rc == ERROR_ACCESS_DENIED && noreadonlywarn)
     876                        rc = -1;
     877                      ret = make_deleteable(newname, rc);
     878                      rc = docopyf(type, wk->li->list[x], newname);
     879                    }
     880                    if (!ret && (rc == ERROR_ACCESS_DENIED || (rc == ERROR_SHARING_VIOLATION && fUnlock)))
     881                      rc = NO_ERROR;
     882                    //if (fTurnOffReadOnly)
     883                    //  make_deleteable(newname, rc);
    859884                    if (fResetVerify) {
    860885                      DosSetVerify(fVerify);
    861886                      fResetVerify = FALSE;
    862887                    }
    863                     priority_normal();
     888                    priority_normal();
    864889                    if (rc) {
    865890                      if ((rc == ERROR_DISK_FULL ||
     
    17151740                  if (error) {
    17161741                    DosError(FERR_DISABLEHARDERR);
    1717                     make_deleteable(wk->li->list[x]);
     1742                    make_deleteable(wk->li->list[x], error);
    17181743                    if (wk->li->type == IDM_DELETE){
    17191744                      hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
Note: See TracChangeset for help on using the changeset viewer.