VirtualBox

Changeset 56900 in vbox


Ignore:
Timestamp:
Jul 9, 2015 2:24:26 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101578
Message:

DnD: DNDDIRDROPPEDFILES: Track directory open status internally.

Location:
trunk
Files:
2 edited

Legend:

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

    r55805 r56900  
    4141 * Structure for maintaining a "dropped files" directory
    4242 * on the host or guest. This will contain all received files & directories
    43  * for a single transfer.
     43 * for a single drag and drop operation.
    4444 */
    4545typedef struct DNDDIRDROPPEDFILES
     
    4747    /** Directory handle for drop directory. */
    4848    PRTDIR                       hDir;
     49    /** Flag indicating whether the drop directory
     50     *  has been opened for processing or not. */
     51    bool                         fOpen;
    4952    /** Absolute path to drop directory. */
    5053    RTCString                    strPathAbs;
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDDir.cpp

    r55640 r56900  
    9797            pDir->hDir       = phDir;
    9898            pDir->strPathAbs = pszDropDir;
     99            pDir->fOpen      = true;
    99100        }
    100101    }
     
    125126    AssertPtrReturn(pDir, VERR_INVALID_POINTER);
    126127
    127     int rc = RTDirClose(pDir->hDir);
     128    int rc = VINF_SUCCESS;
     129    if (pDir->fOpen)
     130    {
     131        rc = RTDirClose(pDir->hDir);
     132        if (RT_SUCCESS(rc))
     133            pDir->fOpen = false;
     134    }
    128135    if (RT_SUCCESS(rc))
    129136    {
     
    131138        pDir->lstFiles.clear();
    132139
    133         if (fRemove)
     140        if (   fRemove
     141            && pDir->strPathAbs.isNotEmpty())
    134142        {
    135143            /* Try removing the (empty) drop directory in any case. */
Note: See TracChangeset for help on using the changeset viewer.

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