Changeset 1101 for trunk/dll/worker.c


Ignore:
Timestamp:
Aug 2, 2008, 10:25:22 PM (17 years ago)
Author:
Gregg Young
Message:

Fix delete use trash can to only use local fixed drives or the trash can supported list and allow deselection of trash can.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/worker.c

    r1084 r1101  
    2828  16 JUL 08 GKY Use TMP directory for temp files
    2929  20 Jul 08 GKY Add save/append filename to clipboard.
     30  02 Aug 08 GKY Limit use of "trash can" to local writable fixed drives or to trash can supported
     31                drives list if it exists. Fix ability to deselect use of trash can.
    3032
    3133***********************************************************************/
     
    4446#define INCL_WINPOINTERS
    4547#define INCL_WINWORKPLACE
     48#define INCL_WINSHELLDATA
    4649
    4750#include "fm3dlg.h"
     
    14531456              FILESTATUS3 fsa;
    14541457              CHAR prompt[CCHMAXPATH * 3];
    1455               APIRET error;
    1456               HOBJECT hObjectdest, hObjectofObject;
     1458              APIRET error = 0;
     1459              HOBJECT hObjectdest, hObjectofObject;
     1460              BYTE G_abSupportedDrives[24] = {0};
     1461              ULONG cbSupportedDrives = sizeof(G_abSupportedDrives);
    14571462
    14581463              for (x = 0; wk->li->list[x]; x++) {
     
    15801585                  if (wk->li->type == IDM_DELETE){
    15811586                    hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
    1582                     if (hObjectdest != NULLHANDLE){
    1583                       hObjectofObject = WinQueryObject(wk->li->list[x]);
    1584                       error = WinMoveObject(hObjectofObject, hObjectdest, 0);
    1585                     }
     1587                    PrfQueryProfileData(HINI_USER,
     1588                                        "XWorkplace",
     1589                                        "TrashCan::Drives",
     1590                                        G_abSupportedDrives,
     1591                                        &cbSupportedDrives);
     1592                    if (hObjectdest != NULLHANDLE && fTrashCan &&
     1593                        (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] &
     1594                                                1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] &
     1595                                                      (DRIVE_REMOVABLE | DRIVE_IGNORE |
     1596                                                      DRIVE_REMOTE | DRIVE_VIRTUAL |
     1597                                                      DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) {
     1598                        hObjectofObject = WinQueryObject(wk->li->list[x]);
     1599                        error = WinMoveObject(hObjectofObject, hObjectdest, 0);
     1600                    }
    15861601                    else
    15871602                      error = DosDelete(wk->li->list[x]);
     
    15931608                    make_deleteable(wk->li->list[x]);
    15941609                    if (wk->li->type == IDM_DELETE){
    1595                       hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
    1596                       if (hObjectdest != NULLHANDLE){
    1597                         hObjectofObject = WinQueryObject(wk->li->list[x]);
    1598                         error = WinMoveObject(hObjectofObject, hObjectdest, 0);
    1599                       }
     1610                      hObjectdest = WinQueryObject("<XWP_TRASHCAN>");
     1611                      PrfQueryProfileData(HINI_USER,
     1612                                          "XWorkplace",
     1613                                          "TrashCan::Drives",
     1614                                          G_abSupportedDrives,
     1615                                          &cbSupportedDrives);
     1616                      if (hObjectdest != NULLHANDLE && fTrashCan &&
     1617                          (G_abSupportedDrives ? (G_abSupportedDrives[toupper(*wk->li->list[x]) - 'C'] &
     1618                                                  1):(!(driveflags[toupper(*wk->li->list[x]) - 'A'] &
     1619                                                        (DRIVE_REMOVABLE | DRIVE_IGNORE |
     1620                                                        DRIVE_REMOTE | DRIVE_VIRTUAL |
     1621                                                        DRIVE_NOTWRITEABLE | DRIVE_RAMDISK))))) {
     1622                          hObjectofObject = WinQueryObject(wk->li->list[x]);
     1623                          error = WinMoveObject(hObjectofObject, hObjectdest, 0);
     1624                      }
    16001625                      else
    16011626                        error = DosDelete(wk->li->list[x]);
Note: See TracChangeset for help on using the changeset viewer.