VirtualBox

Changeset 50830 in vbox


Ignore:
Timestamp:
Mar 20, 2014 4:13:19 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92902
Message:

DnD: Bugfixes.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/GuestHost/DragAndDrop.h

    r50561 r50830  
    3636int DnDPathSanitizeFilename(char *pszPath, size_t cbPath);
    3737int DnDPathSanitize(char *pszPath, size_t cbPath);
     38
     39/** Keep the original paths, don't convert paths to relative ones. */
     40#define DNDURILIST_FLAGS_ABSOLUTE_PATHS         RT_BIT(0)
    3841
    3942class DnDURIObject
     
    120123protected:
    121124
    122     /** List of all top-level file/directory entries. */
     125    /** List of all top-level file/directory entries.
     126     *  Note: All paths are kept internally as UNIX paths for
     127     *        easier conversion/handling!  */
    123128    RTCList<RTCString>     m_lstRoot;
    124129    /** List of all URI objects added. */
  • trunk/src/VBox/Additions/WINNT/VBoxTray/VBoxDnDDropTarget.cpp

    r50734 r50830  
    453453                        if (RT_SUCCESS(rc))
    454454                        {
     455                            cchFiles += 1; /* Add string termination. */
    455456                            uint32_t cbFiles = cchFiles * sizeof(char);
    456                             Assert(cbFiles);
     457
     458                            LogFlowFunc(("cFiles=%u, cchFiles=%RU32, cbFiles=%RU32, pszFiles=0x%p\n",
     459                                         cFiles, cchFiles, cbFiles, pszFiles));
    457460
    458461                            /* Translate the list into URI elements. */
    459462                            DnDURIList lstURI;
    460                             rc = lstURI.AppendNativePathsFromList(pszFiles, cbFiles, 
    461                                                                   0 /* Flags */);
     463                            rc = lstURI.AppendNativePathsFromList(pszFiles, cbFiles,
     464                                                                  DNDURILIST_FLAGS_ABSOLUTE_PATHS);
    462465                            if (RT_SUCCESS(rc))
    463466                            {
     
    494497
    495498                /*
    496                  * Third stage: Release access to the storage medium again.
     499                 * Third stage: Unlock + release access to the storage medium again.
    497500                 */
    498501                switch (mFormatEtc.tymed)
     
    508511            }
    509512
     513            /* Release storage medium again. */
     514            ReleaseStgMedium(&stgMed);
     515
    510516            /* Signal waiters. */
    511517            mDroppedRc = rc;
    512518            RTSemEventSignal(hEventDrop);
    513 
    514             /* Release storage medium again. */
    515             ReleaseStgMedium(&stgMed);
    516519        }
    517520    }
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp

    r50724 r50830  
    10821082
    10831083static int vbglR3DnDGHProcessURIMessages(uint32_t u32ClientId,
    1084                                          void *pvData, uint32_t cbData)
     1084                                         const void *pvData, uint32_t cbData)
    10851085{
    10861086    AssertPtrReturn(pvData, VERR_INVALID_POINTER);
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp

    r50734 r50830  
    430430            {
    431431                Assert(pszFileName >= pszFilePath);
    432                 char *pszRoot = &pszFilePath[pszFileName - pszFilePath];
     432                size_t cbBase = (fFlags & DNDURILIST_FLAGS_ABSOLUTE_PATHS)
     433                              ? 0 /* Use start of path as root. */
     434                              : pszFileName - pszFilePath;
     435                char *pszRoot = &pszFilePath[cbBase];
    433436                m_lstRoot.append(pszRoot);
    434437#ifdef DEBUG_andy
     
    436439                             pszFilePath, pszFileName, pszRoot));
    437440#endif
    438                 rc = appendPathRecursive(pszFilePath,
    439                                          pszFileName - pszFilePath,
     441                rc = appendPathRecursive(pszFilePath, cbBase,
    440442                                         fFlags);
    441443            }
     
    551553    {
    552554        const char *pszCurRoot = m_lstRoot.at(i).c_str();
     555#ifdef DEBUG_andy
     556        LogFlowFunc(("pszCurRoot=%s\n", pszCurRoot));
     557#endif
    553558        if (strBasePath.isNotEmpty())
    554559        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette