Index: /trunk/include/VBox/GuestHost/DragAndDrop.h
===================================================================
--- /trunk/include/VBox/GuestHost/DragAndDrop.h	(revision 56908)
+++ /trunk/include/VBox/GuestHost/DragAndDrop.h	(revision 56909)
@@ -177,12 +177,12 @@
 
     void Clear(void);
-    DnDURIObject &First(void) { return m_lstTree.first(); }
-    bool IsEmpty(void) { return m_lstTree.isEmpty(); }
+    DnDURIObject *First(void) { return m_lstTree.first(); }
+    bool IsEmpty(void) const { return m_lstTree.isEmpty(); }
     void RemoveFirst(void);
     int RootFromURIData(const void *pvData, size_t cbData, uint32_t fFlags);
     RTCString RootToString(const RTCString &strPathBase = "", const RTCString &strSeparator = "\r\n");
-    size_t RootCount(void) { return m_lstRoot.size(); }
-    uint32_t TotalCount(void) { return m_cTotal; }
-    size_t TotalBytes(void) { return m_cbTotal; }
+    size_t RootCount(void) const { return m_lstRoot.size(); }
+    uint32_t TotalCount(void) const { return m_cTotal; }
+    size_t TotalBytes(void) const { return m_cbTotal; }
 
 protected:
@@ -196,12 +196,14 @@
      *  Note: All paths are kept internally as UNIX paths for
      *        easier conversion/handling!  */
-    RTCList<RTCString>     m_lstRoot;
-    /** List of all URI objects added. */
-    RTCList<DnDURIObject>  m_lstTree;
+    RTCList<RTCString>      m_lstRoot;
+    /** List of all URI objects added. The list's content
+     *  might vary depending on how the objects are being
+     *  added (lazy or not). */
+    RTCList<DnDURIObject *> m_lstTree;
     /** Total number of all URI objects. */
-    uint32_t               m_cTotal;
+    uint32_t                m_cTotal; /** @todo Really needed? m_lstTree.size()? */
     /** Total size of all URI objects, that is, the file
      *  size of all objects (in bytes). */
-    size_t                 m_cbTotal;
+    size_t                  m_cbTotal;
 };
 #endif /* ___VBox_GuestHost_DragAndDrop_h */
Index: /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp
===================================================================
--- /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp	(revision 56908)
+++ /trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibDragAndDrop.cpp	(revision 56909)
@@ -1231,8 +1231,9 @@
 }
 
-static int vbglR3DnDGHSendDir(PVBGLR3GUESTDNDCMDCTX pCtx, DnDURIObject &obj)
-{
-    AssertPtrReturn(pCtx,                                  VERR_INVALID_POINTER);
-    AssertReturn(obj.GetType() == DnDURIObject::Directory, VERR_INVALID_PARAMETER);
+static int vbglR3DnDGHSendDir(PVBGLR3GUESTDNDCMDCTX pCtx, DnDURIObject *pObj)
+{
+    AssertPtrReturn(pObj,                                    VERR_INVALID_POINTER);
+    AssertPtrReturn(pCtx,                                    VERR_INVALID_POINTER);
+    AssertReturn(pObj->GetType() == DnDURIObject::Directory, VERR_INVALID_PARAMETER);
 
     DragAndDropSvc::VBOXDNDGHSENDDIRMSG Msg;
@@ -1243,11 +1244,11 @@
     Msg.hdr.cParms      = 3;
 
-    RTCString strPath = obj.GetDestPath();
+    RTCString strPath = pObj->GetDestPath();
     LogFlowFunc(("strDir=%s (%zu), fMode=0x%x\n",
-                 strPath.c_str(), strPath.length(), obj.GetMode()));
+                 strPath.c_str(), strPath.length(), pObj->GetMode()));
 
     Msg.pvName.SetPtr((void *)strPath.c_str(), (uint32_t)(strPath.length() + 1));
     Msg.cbName.SetUInt32((uint32_t)(strPath.length() + 1));
-    Msg.fMode.SetUInt32(obj.GetMode());
+    Msg.fMode.SetUInt32(pObj->GetMode());
 
     int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(Msg)), &Msg, sizeof(Msg));
@@ -1259,9 +1260,10 @@
 }
 
-static int vbglR3DnDGHSendFile(PVBGLR3GUESTDNDCMDCTX pCtx, DnDURIObject &obj)
-{
-    AssertPtrReturn(pCtx,                             VERR_INVALID_POINTER);
-    AssertReturn(obj.GetType() == DnDURIObject::File, VERR_INVALID_PARAMETER);
-    AssertReturn(obj.IsOpen(),                        VERR_INVALID_STATE);
+static int vbglR3DnDGHSendFile(PVBGLR3GUESTDNDCMDCTX pCtx, DnDURIObject *pObj)
+{
+    AssertPtrReturn(pCtx,                               VERR_INVALID_POINTER);
+    AssertPtrReturn(pObj,                               VERR_INVALID_POINTER);
+    AssertReturn(pObj->GetType() == DnDURIObject::File, VERR_INVALID_PARAMETER);
+    AssertReturn(pObj->IsOpen(),                        VERR_INVALID_STATE);
 
     uint32_t cbBuf = _64K;           /** @todo Make this configurable? */
@@ -1272,7 +1274,8 @@
     int rc;
 
-    RTCString strPath = obj.GetDestPath();
-
-    LogFlowFunc(("strFile=%s (%zu), cbSize=%RU64, fMode=0x%x\n", strPath.c_str(), strPath.length(), obj.GetSize(), obj.GetMode()));
+    RTCString strPath = pObj->GetDestPath();
+
+    LogFlowFunc(("strFile=%s (%zu), cbSize=%RU64, fMode=0x%x\n", strPath.c_str(), strPath.length(),
+                 pObj->GetSize(), pObj->GetMode()));
     LogFlowFunc(("uProtocol=%RU32, uClientID=%RU32\n", pCtx->uProtocol, pCtx->uClientID));
 
@@ -1290,6 +1293,6 @@
         MsgHdr.cbName.SetUInt32((uint32_t)(strPath.length() + 1));
         MsgHdr.uFlags.SetUInt32(0);                                                      /* Flags; unused at the moment. */
-        MsgHdr.fMode.SetUInt32(obj.GetMode());                                           /* File mode */
-        MsgHdr.cbTotal.SetUInt64(obj.GetSize());                                         /* File size (in bytes). */
+        MsgHdr.fMode.SetUInt32(pObj->GetMode());                                         /* File mode */
+        MsgHdr.cbTotal.SetUInt64(pObj->GetSize());                                       /* File size (in bytes). */
 
         rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_HGCM_CALL(sizeof(MsgHdr)), &MsgHdr, sizeof(MsgHdr));
@@ -1319,5 +1322,5 @@
             Msg.u.v1.pvName.SetPtr((void *)strPath.c_str(), (uint32_t)(strPath.length() + 1));
             Msg.u.v1.cbName.SetUInt32((uint32_t)(strPath.length() + 1));
-            Msg.u.v1.fMode.SetUInt32(obj.GetMode());
+            Msg.u.v1.fMode.SetUInt32(pObj->GetMode());
         }
         else
@@ -1329,5 +1332,5 @@
         }
 
-        uint64_t cbToReadTotal  = obj.GetSize();
+        uint64_t cbToReadTotal  = pObj->GetSize();
         uint64_t cbWrittenTotal = 0;
         while (cbToReadTotal)
@@ -1336,5 +1339,5 @@
             uint32_t cbRead   = 0;
             if (cbToRead)
-                rc = obj.Read(pvBuf, cbToRead, &cbRead);
+                rc = pObj->Read(pvBuf, cbToRead, &cbRead);
 
             LogFlowFunc(("cbToReadTotal=%RU64, cbToRead=%RU32, cbRead=%RU32, rc=%Rrc\n",
@@ -1370,5 +1373,5 @@
             cbWrittenTotal += cbRead;
 
-            LogFlowFunc(("%RU64/%RU64 -- %RU8%%\n", cbWrittenTotal, obj.GetSize(), cbWrittenTotal * 100 / obj.GetSize()));
+            LogFlowFunc(("%RU64/%RU64 -- %RU8%%\n", cbWrittenTotal, pObj->GetSize(), cbWrittenTotal * 100 / pObj->GetSize()));
         };
     }
@@ -1380,22 +1383,23 @@
 }
 
-static int vbglR3DnDGHSendURIObject(PVBGLR3GUESTDNDCMDCTX pCtx, DnDURIObject &obj)
+static int vbglR3DnDGHSendURIObject(PVBGLR3GUESTDNDCMDCTX pCtx, DnDURIObject *pObj)
 {
     AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
+    AssertPtrReturn(pObj, VERR_INVALID_POINTER);
 
     int rc;
 
-    switch (obj.GetType())
+    switch (pObj->GetType())
     {
         case DnDURIObject::Directory:
-            rc = vbglR3DnDGHSendDir(pCtx, obj);
+            rc = vbglR3DnDGHSendDir(pCtx, pObj);
             break;
 
         case DnDURIObject::File:
-            rc = vbglR3DnDGHSendFile(pCtx, obj);
+            rc = vbglR3DnDGHSendFile(pCtx, pObj);
             break;
 
         default:
-            AssertMsgFailed(("URI type %ld not implemented\n", obj.GetType()));
+            AssertMsgFailed(("Object type %ld not implemented\n", pObj->GetType()));
             rc = VERR_NOT_IMPLEMENTED;
             break;
@@ -1441,7 +1445,7 @@
         while (!lstURI.IsEmpty())
         {
-            DnDURIObject &nextObj = lstURI.First();
-
-            rc = vbglR3DnDGHSendURIObject(pCtx, nextObj);
+            DnDURIObject *pNextObj = lstURI.First();
+
+            rc = vbglR3DnDGHSendURIObject(pCtx, pNextObj);
             if (RT_FAILURE(rc))
                 break;
Index: /trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp	(revision 56908)
+++ /trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp	(revision 56909)
@@ -43,4 +43,5 @@
 DnDURIList::~DnDURIList(void)
 {
+    Clear();
 }
 
@@ -60,18 +61,23 @@
             LogFlowFunc(("File '%s' -> '%s' (%RU64)\n", pcszSource, pcszTarget, (uint64_t)objInfo.cbObject));
 
-            DnDURIObject objFile(DnDURIObject::File, pcszSource, pcszTarget);
-            if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */
-            {
-                /** @todo Add a standard fOpen mode for this list. */
-                rc = objFile.Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode);
-            }
-
-            if (RT_SUCCESS(rc))
-            {
-                m_lstTree.append(objFile);
-
-                m_cTotal++;
-                m_cbTotal += (uint64_t)objInfo.cbObject;
-            }
+            DnDURIObject *pObjFile= new DnDURIObject(DnDURIObject::File, pcszSource, pcszTarget);
+            if (pObjFile)
+            {
+                if (fFlags & DNDURILIST_FLAGS_KEEP_OPEN) /* Shall we keep the file open while being added to this list? */
+                {
+                    /** @todo Add a standard fOpen mode for this list. */
+                    rc = pObjFile->Open(DnDURIObject::Source, RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, objInfo.Attr.fMode);
+                }
+
+                if (RT_SUCCESS(rc))
+                {
+                    m_lstTree.append(pObjFile);
+
+                    m_cTotal++;
+                    m_cbTotal += pObjFile->GetSize();
+                }
+            }
+            else
+                rc = VERR_NO_MEMORY;
         }
         else if (RTFS_IS_DIRECTORY(objInfo.Attr.fMode))
@@ -79,6 +85,12 @@
             LogFlowFunc(("Directory '%s' -> '%s' \n", pcszSource, pcszTarget));
 
-            m_lstTree.append(DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget,
-                             objInfo.Attr.fMode, 0 /* Size */));
+            DnDURIObject *pObjDir= new DnDURIObject(DnDURIObject::Directory, pcszSource, pcszTarget,
+                                                    objInfo.Attr.fMode, 0 /* Size */);
+            if (pObjDir)
+            {
+                m_lstTree.append(pObjDir);
+            }
+            else
+                rc = VERR_NO_MEMORY;
 
             /** @todo Add DNDURILIST_FLAGS_KEEP_OPEN handling. */
@@ -397,4 +409,11 @@
 {
     m_lstRoot.clear();
+
+    for (size_t i = 0; i < m_lstTree.size(); i++)
+    {
+        DnDURIObject *pCurObj = m_lstTree.at(i);
+        AssertPtr(pCurObj);
+        RTMemFree(pCurObj);
+    }
     m_lstTree.clear();
 
@@ -408,11 +427,13 @@
         return;
 
-    DnDURIObject &curObj = m_lstTree.first();
-
-    uint64_t cbSize = curObj.GetSize();
+    DnDURIObject *pCurObj = m_lstTree.first();
+    AssertPtr(pCurObj);
+
+    uint64_t cbSize = pCurObj->GetSize();
     Assert(m_cbTotal >= cbSize);
     m_cbTotal -= cbSize; /* Adjust total size. */
 
-    curObj.Close();
+    pCurObj->Close();
+    RTMemFree(pCurObj);
 
     m_lstTree.removeFirst();
Index: /trunk/src/VBox/Main/include/GuestDnDTargetImpl.h
===================================================================
--- /trunk/src/VBox/Main/include/GuestDnDTargetImpl.h	(revision 56908)
+++ /trunk/src/VBox/Main/include/GuestDnDTargetImpl.h	(revision 56909)
@@ -85,7 +85,7 @@
     int i_cancelOperation(void);
     int i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
-    int i_sendDirectory(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aDirectory);
-    int i_sendFile(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aFile);
-    int i_sendFileData(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aFile);
+    int i_sendDirectory(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject);
+    int i_sendFile(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject);
+    int i_sendFileData(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject);
     int i_sendURIData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
     int i_sendRawData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout);
Index: /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp	(revision 56908)
+++ /trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp	(revision 56909)
@@ -756,9 +756,10 @@
 }
 
-int GuestDnDTarget::i_sendDirectory(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aDirectory)
-{
-    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
-
-    RTCString strPath = aDirectory.GetDestPath();
+int GuestDnDTarget::i_sendDirectory(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject)
+{
+    AssertPtrReturn(pObject, VERR_INVALID_POINTER);
+    AssertPtrReturn(pCtx,    VERR_INVALID_POINTER);
+
+    RTCString strPath = pObject->GetDestPath();
     if (strPath.isEmpty())
         return VERR_INVALID_PARAMETER;
@@ -771,14 +772,15 @@
     pMsg->setNextString(strPath.c_str());                  /* path */
     pMsg->setNextUInt32((uint32_t)(strPath.length() + 1)); /* path length - note: Maximum is RTPATH_MAX on guest side. */
-    pMsg->setNextUInt32(aDirectory.GetMode());             /* mode */
+    pMsg->setNextUInt32(pObject->GetMode());             /* mode */
 
     return VINF_SUCCESS;
 }
 
-int GuestDnDTarget::i_sendFile(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aFile)
-{
-    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
-
-    RTCString strPathSrc = aFile.GetSourcePath();
+int GuestDnDTarget::i_sendFile(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject)
+{
+    AssertPtrReturn(pObject, VERR_INVALID_POINTER);
+    AssertPtrReturn(pCtx,    VERR_INVALID_POINTER);
+
+    RTCString strPathSrc = pObject->GetSourcePath();
     if (strPathSrc.isEmpty())
         return VERR_INVALID_PARAMETER;
@@ -789,9 +791,9 @@
                  strPathSrc.c_str(), mData.mcbBlockSize, mDataBase.mProtocolVersion));
 
-    bool fOpen = aFile.IsOpen();
+    bool fOpen = pObject->IsOpen();
     if (!fOpen)
     {
         LogFlowFunc(("Opening \"%s\" ...\n", strPathSrc.c_str()));
-        rc = aFile.OpenEx(strPathSrc, DnDURIObject::File, DnDURIObject::Source,
+        rc = pObject->OpenEx(strPathSrc, DnDURIObject::File, DnDURIObject::Source,
                           RTFILE_O_OPEN | RTFILE_O_READ | RTFILE_O_DENY_WRITE, 0 /* fFlags */);
         if (RT_FAILURE(rc))
@@ -813,14 +815,14 @@
                 pMsg->setType(DragAndDropSvc::HOST_DND_HG_SND_FILE_HDR);
                 pMsg->setNextUInt32(0);                                            /* context ID */
-                rc = pMsg->setNextString(aFile.GetDestPath().c_str());             /* pvName */
+                rc = pMsg->setNextString(pObject->GetDestPath().c_str());             /* pvName */
                 AssertRC(rc);
-                pMsg->setNextUInt32((uint32_t)(aFile.GetDestPath().length() + 1)); /* cbName */
+                pMsg->setNextUInt32((uint32_t)(pObject->GetDestPath().length() + 1)); /* cbName */
                 pMsg->setNextUInt32(0);                                            /* uFlags */
-                pMsg->setNextUInt32(aFile.GetMode());                              /* fMode */
-                pMsg->setNextUInt64(aFile.GetSize());                              /* uSize */
+                pMsg->setNextUInt32(pObject->GetMode());                              /* fMode */
+                pMsg->setNextUInt64(pObject->GetSize());                              /* uSize */
 
                 LogFlowFunc(("Sending file header ...\n"));
                 LogRel2(("DnD: Transferring host file to guest: %s (%RU64 bytes, mode 0x%x)\n",
-                         strPathSrc.c_str(), aFile.GetSize(), aFile.GetMode()));
+                         strPathSrc.c_str(), pObject->GetSize(), pObject->GetMode()));
 
                 /** @todo Set progress object title to current file being transferred? */
@@ -842,5 +844,5 @@
         && fSendFileData)
     {
-        rc = i_sendFileData(pCtx, pMsg, aFile);
+        rc = i_sendFileData(pCtx, pMsg, pObject);
     }
 
@@ -849,8 +851,9 @@
 }
 
-int GuestDnDTarget::i_sendFileData(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject &aFile)
-{
-    AssertPtrReturn(pCtx, VERR_INVALID_POINTER);
-    AssertPtrReturn(pMsg, VERR_INVALID_POINTER);
+int GuestDnDTarget::i_sendFileData(PSENDDATACTX pCtx, GuestDnDMsg *pMsg, DnDURIObject *pObject)
+{
+    AssertPtrReturn(pObject, VERR_INVALID_POINTER);
+    AssertPtrReturn(pCtx,    VERR_INVALID_POINTER);
+    AssertPtrReturn(pMsg,    VERR_INVALID_POINTER);
 
     GuestDnDResponse *pResp = pCtx->mpResp;
@@ -877,6 +880,6 @@
     if (mDataBase.mProtocolVersion <= 1)
     {
-        pMsg->setNextString(aFile.GetDestPath().c_str());                  /* pvName */
-        pMsg->setNextUInt32((uint32_t)(aFile.GetDestPath().length() + 1)); /* cbName */
+        pMsg->setNextString(pObject->GetDestPath().c_str());                  /* pvName */
+        pMsg->setNextUInt32((uint32_t)(pObject->GetDestPath().length() + 1)); /* cbName */
     }
     else
@@ -888,5 +891,5 @@
     uint32_t cbRead = 0;
 
-    int rc = aFile.Read(pCtx->mURI.pvScratchBuf, pCtx->mURI.cbScratchBuf, &cbRead);
+    int rc = pObject->Read(pCtx->mURI.pvScratchBuf, pCtx->mURI.cbScratchBuf, &cbRead);
     if (RT_SUCCESS(rc))
     {
@@ -897,5 +900,5 @@
             pMsg->setNextPointer(pCtx->mURI.pvScratchBuf, cbRead);  /* pvData */
             pMsg->setNextUInt32(cbRead);                            /* cbData */
-            pMsg->setNextUInt32(aFile.GetMode());                   /* fMode */
+            pMsg->setNextUInt32(pObject->GetMode());                   /* fMode */
         }
         else
@@ -905,8 +908,8 @@
         }
 
-        if (aFile.IsComplete()) /* Done reading? */
-        {
-            LogRel2(("DnD: File transfer to guest complete: %s\n", aFile.GetSourcePath().c_str()));
-            LogFlowFunc(("File \"%s\" complete\n", aFile.GetSourcePath().c_str()));
+        if (pObject->IsComplete()) /* Done reading? */
+        {
+            LogRel2(("DnD: File transfer to guest complete: %s\n", pObject->GetSourcePath().c_str()));
+            LogFlowFunc(("File \"%s\" complete\n", pObject->GetSourcePath().c_str()));
             rc = VINF_EOF;
         }
@@ -1261,29 +1264,29 @@
 
     Assert(!lstURI.IsEmpty());
-    DnDURIObject &curObj = lstURI.First();
-
-    uint32_t fMode = curObj.GetMode();
+    DnDURIObject *pCurObj = lstURI.First();
+
+    uint32_t fMode = pCurObj->GetMode();
     LogFlowFunc(("Processing srcPath=%s, dstPath=%s, fMode=0x%x, cbSize=%RU32, fIsDir=%RTbool, fIsFile=%RTbool\n",
-                 curObj.GetSourcePath().c_str(), curObj.GetDestPath().c_str(),
-                 fMode, curObj.GetSize(),
+                 pCurObj->GetSourcePath().c_str(), pCurObj->GetDestPath().c_str(),
+                 fMode, pCurObj->GetSize(),
                  RTFS_IS_DIRECTORY(fMode), RTFS_IS_FILE(fMode)));
 
     if (RTFS_IS_DIRECTORY(fMode))
     {
-        rc = i_sendDirectory(pCtx, pMsg, curObj);
+        rc = i_sendDirectory(pCtx, pMsg, pCurObj);
     }
     else if (RTFS_IS_FILE(fMode))
     {
-        rc = i_sendFile(pCtx, pMsg, curObj);
+        rc = i_sendFile(pCtx, pMsg, pCurObj);
     }
     else
     {
         AssertMsgFailed(("fMode=0x%x is not supported for srcPath=%s, dstPath=%s\n",
-                         fMode, curObj.GetSourcePath().c_str(), curObj.GetDestPath().c_str()));
+                         fMode, pCurObj->GetSourcePath().c_str(), pCurObj->GetDestPath().c_str()));
         rc = VERR_NOT_SUPPORTED;
     }
 
     bool fRemove = false; /* Remove current entry? */
-    if (   curObj.IsComplete()
+    if (   pCurObj->IsComplete()
         || RT_FAILURE(rc))
     {
@@ -1293,5 +1296,5 @@
     if (fRemove)
     {
-        LogFlowFunc(("Removing \"%s\" from list, rc=%Rrc\n", curObj.GetSourcePath().c_str(), rc));
+        LogFlowFunc(("Removing \"%s\" from list, rc=%Rrc\n", pCurObj->GetSourcePath().c_str(), rc));
         lstURI.RemoveFirst();
     }
