VirtualBox

Ignore:
Timestamp:
Apr 5, 2019 8:25:19 AM (6 years ago)
Author:
vboxsync
Message:

DnD/DnDURIList: Fixed having an invalid (file) handles when opening URI objects without DNDURILIST_FLAGS_KEEP_OPEN being set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp

    r76553 r78021  
    6565            if (pObjFile)
    6666            {
    67                 if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */
    68                 {
    69                     /** @todo Add a standard fOpen mode for this list. */
    70                     rc = pObjFile->Open(DnDURIObject::View_Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE);
    71                 }
    72                 else /* Just query the information without opening the file. */
    73                     rc = pObjFile->QueryInfo(DnDURIObject::View_Source);
    74 
     67                /** @todo Add a standard fOpen mode for this list. */
     68                rc = pObjFile->Open(DnDURIObject::View_Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE);
    7569                if (RT_SUCCESS(rc))
    7670                {
     
    7973                    m_cTotal++;
    8074                    m_cbTotal += pObjFile->GetSize();
     75
     76                    if (!(fFlags & DNDURILIST_FLAGS_KEEP_OPEN)) /* Shall we keep the file open while being added to this list? */
     77                        pObjFile->Close();
    8178                }
    8279                else
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