Changeset 749


Ignore:
Timestamp:
Aug 2, 2007, 4:47:07 PM (13 years ago)
Author:
Steven Levine
Message:

Lock in DoFileDrop? sanity checks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/droplist.c

    r730 r749  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2003, 2006 Steven H.Levine
     9  Copyright (c) 2003, 2007 Steven H.Levine
    1010
    1111  22 Nov 02 SHL Baseline
     
    1919  21 Apr 07 SHL Add debug code to track down reason for PMERR_SOURCE_SAME_AS_TARGET
    2020  10 Jun 07 GKY Add CheckPmDrgLimit including IsFm2Window as part of work around PM drag limit
     21  02 Aug 07 SHL Lock in DoFileDrop sanity checks
    2122
    2223***********************************************************************/
     
    5051          if (!DrgAccessDraginfo(pDInfo)) {
    5152            Win_Error(HWND_DESKTOP, HWND_DESKTOP, pszSrcFile, __LINE__,
    52                       "DrgAccessDraginfo");
    53             return FALSE;
     53                      "DrgAccessDraginfo");
     54            return FALSE;
    5455          }
    5556          else if (IsFm2Window(pDInfo->hwndSource, FALSE)) {
    5657            DIRCNRDATA *dcdsrc = INSTDATA(pDInfo->hwndSource);
    5758            if (dcdsrc->ulItemsToUnHilite) {
    58             saymsg(MB_OK | MB_INFORMATION,
    59                    HWND_DESKTOP,
    60                    GetPString(IDS_ERRORTEXT),
    61                    GetPString(IDS_EXCEEDPMDRGLMT));
     59            saymsg(MB_OK | MB_INFORMATION,
     60                   HWND_DESKTOP,
     61                   GetPString(IDS_ERRORTEXT),
     62                   GetPString(IDS_EXCEEDPMDRGLMT));
    6263            }
    6364            DrgFreeDraginfo(pDInfo);
    64           }
    65           return TRUE;
     65          }
     66          return TRUE;
    6667}
    6768
     
    278279                     MPARAM mp1, MPARAM mp2)
    279280{
    280 
    281281  /* builds a list from the dropped files */
    282282
     
    287287  CHAR szFrom[CCHMAXPATH + 1], szArc[CCHMAXPATH + 1];
    288288  CHAR **files = NULL;
    289   INT numfiles = 0, numalloc = 0;
     289  UINT numfiles = 0, numalloc = 0;
    290290  ULONG curitem, numitems, *cbFile = NULL, *ulitemID = NULL;
    291291  LISTINFO *li = NULL;
    292292  ARC_TYPE *arcinfo = NULL;
    293293  USHORT Operation;
     294
     295  UINT numok = 0;                       // 02 Aug 07 SHL fixme to be gone someday
     296  UINT numfail = 0;
    294297
    295298  *szArc = 0;
     
    361364                           MPFROMLONG(pDItem->ulItemID),
    362365                           MPFROMLONG(DMFL_TARGETFAIL));
     366        numfail++;
    363367        continue;
    364368      }
     
    377381                           MPFROMLONG(pDItem->ulItemID),
    378382                           MPFROMLONG(DMFL_TARGETFAIL));
     383        numfail++;
    379384        continue;
    380385      }
     
    405410                           MPFROMLONG(pDItem->ulItemID),
    406411                           MPFROMLONG(DMFL_TARGETFAIL));
     412        numfail++;
    407413        continue;
    408414      }
     
    448454                         MPFROMLONG(pDItem->ulItemID),
    449455                         MPFROMLONG(DMFL_TARGETSUCCESSFUL));
    450     }
    451     else
     456      numok++;
     457    }
     458    else {
    452459      DrgSendTransferMsg(pDItem->hwndItem,
    453460                         DM_ENDCONVERSATION,
    454461                         MPFROMLONG(pDItem->ulItemID),
    455462                         MPFROMLONG(DMFL_TARGETFAIL));
     463      numfail++;
     464    }
    456465  } // for curitem
    457466
     
    493502  }
    494503
    495   // fixme to know why PM thinks drop not done
    496   // this will avoid DrgFreeDraginfo complaints from FreeDragInfoData
    497   DbgMsg(pszSrcFile, __LINE__, "calling FreeDragInfoData");
    498504  FreeDragInfoData(hwndCnr, pDInfo);
    499505
     506  // 02 Aug 07 SHL fixme to be gone someday or use Runtime_Error is really an error
     507  if (numfail || numok == 0)
     508    DbgMsg(pszSrcFile, __LINE__, "calling FreeDragInfoData with %u ok, %u failed", numok, numfail);
     509
    500510  return li;
    501511}
Note: See TracChangeset for help on using the changeset viewer.