VirtualBox

Changeset 59854 in vbox for trunk/src/VBox/GuestHost


Ignore:
Timestamp:
Feb 26, 2016 3:41:01 PM (9 years ago)
Author:
vboxsync
Message:

Backed out r105750, as exception handling is disabled.

File:
1 edited

Legend:

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

    r59852 r59854  
    55
    66/*
    7  * Copyright (C) 2014-2016 Oracle Corporation
     7 * Copyright (C) 2014-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5959    if (RT_SUCCESS(rc))
    6060    {
    61         try
    62         {
    63             DnDURIObject *pObj = NULL;
    64 
    65             if (RTFS_IS_FILE(objInfo.Attr.fMode))
    66             {
    67                 LogFlowFunc(("File '%s' -> '%s' (%RU64 bytes, file mode 0x%x)\n",
    68                              pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode));
    69 
    70                 pObj = new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget);
    71 
     61        if (RTFS_IS_FILE(objInfo.Attr.fMode))
     62        {
     63            LogFlowFunc(("File '%s' -> '%s' (%RU64 bytes, file mode 0x%x)\n",
     64                         pcszSource, pcszTarget, (uint64_t)objInfo.cbObject, objInfo.Attr.fMode));
     65
     66            DnDURIObject *pObjFile = new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget);
     67            if (pObjFile)
     68            {
    7269                if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */
    7370                {
    7471                    /** @todo Add a standard fOpen mode for this list. */
    75                     rc = pObj->Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE,
    76                                     objInfo.Attr.fMode);
     72                    rc = pObjFile->Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode);
    7773                }
    7874
    7975                if (RT_SUCCESS(rc))
    8076                {
    81                     m_lstTree.append(pObj);
     77                    m_lstTree.append(pObjFile);
    8278
    8379                    m_cTotal++;
    84                     m_cbTotal += pObj->GetSize();
     80                    m_cbTotal += pObjFile->GetSize();
    8581                }
    86             }
    87             else if (RTFS_IS_DIRECTORY(objInfo.Attr.fMode))
    88             {
    89                 LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode));
    90 
    91                 pObj = new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget, objInfo.Attr.fMode, 0 /* Size */);
    92                 m_lstTree.append(pObj);
     82                else
     83                    delete pObjFile;
     84            }
     85            else
     86                rc = VERR_NO_MEMORY;
     87        }
     88        else if (RTFS_IS_DIRECTORY(objInfo.Attr.fMode))
     89        {
     90            LogFlowFunc(("Directory '%s' -> '%s' (file mode 0x%x)\n", pcszSource, pcszTarget, objInfo.Attr.fMode));
     91
     92            DnDURIObject *pObjDir = new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget,
     93                                                     objInfo.Attr.fMode, 0 /* Size */);
     94            if (pObjDir)
     95            {
     96                m_lstTree.append(pObjDir);
    9397
    9498                /** @todo Add DNDURILIST_FLAGS_KEEP_OPEN handling? */
    9599                m_cTotal++;
    96100            }
    97             /* Note: Symlinks already should have been resolved at this point. */
    98101            else
    99                 rc = VERR_NOT_SUPPORTED;
    100 
    101             if (RT_FAILURE(rc))
    102             {
    103                 if (pObj)
    104                     delete pObj;
    105             }
    106         }
    107         catch (std::bad_alloc &)
    108         {
    109             rc = VERR_NO_MEMORY;
    110         }
     102                rc = VERR_NO_MEMORY;
     103        }
     104        /* Note: Symlinks already should have been resolved at this point. */
     105        else
     106            rc = VERR_NOT_SUPPORTED;
    111107    }
    112108
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