Index: /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp	(revision 69757)
+++ /trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestCtrl.cpp	(revision 69758)
@@ -2232,8 +2232,9 @@
              * Enumerate the directory tree.
              */
+            size_t        cbDirEntry = 0;
+            PRTDIRENTRYEX pDirEntry  = NULL;
             while (RT_SUCCESS(vrc))
             {
-                RTDIRENTRY DirEntry;
-                vrc = RTDirRead(hDir, &DirEntry, NULL);
+                vrc = RTDirReadExA(hDir, &pDirEntry, &cbDirEntry, RTFSOBJATTRADD_NOTHING, 0);
                 if (RT_FAILURE(vrc))
                 {
@@ -2242,18 +2243,15 @@
                     break;
                 }
-                /** @todo r=bird: This ain't gonna work on most UNIX file systems because
-                 *        enmType is RTDIRENTRYTYPE_UNKNOWN.  This is clearly documented in
-                 *        RTDIRENTRY::enmType. For trunk, RTDirQueryUnknownType can be used. */
-                switch (DirEntry.enmType)
+
+                switch (pDirEntry->Info.Attr.fMode & RTFS_TYPE_MASK)
                 {
-                    case RTDIRENTRYTYPE_DIRECTORY:
+                    case RTFS_TYPE_DIRECTORY:
                     {
                         /* Skip "." and ".." entries. */
-                        if (   !strcmp(DirEntry.szName, ".")
-                            || !strcmp(DirEntry.szName, ".."))
+                        if (RTDirEntryExIsStdDotLink(pDirEntry))
                             break;
 
                         if (pContext->pCmdCtx->cVerbose)
-                            RTPrintf("Directory: %s\n", DirEntry.szName);
+                            RTPrintf("Directory: %s\n", pDirEntry->szName);
 
                         if (enmFlags & kGctlCopyFlags_Recursive)
@@ -2261,8 +2259,8 @@
                             char *pszNewSub = NULL;
                             if (pszSubDir)
-                                pszNewSub = RTPathJoinA(pszSubDir, DirEntry.szName);
+                                pszNewSub = RTPathJoinA(pszSubDir, pDirEntry->szName);
                             else
                             {
-                                pszNewSub = RTStrDup(DirEntry.szName);
+                                pszNewSub = RTStrDup(pDirEntry->szName);
                                 RTPathStripTrailingSlash(pszNewSub);
                             }
@@ -2281,17 +2279,16 @@
                     }
 
-                    case RTDIRENTRYTYPE_SYMLINK:
+                    case RTFS_TYPE_SYMLINK:
                         if (   (enmFlags & kGctlCopyFlags_Recursive)
                             && (enmFlags & kGctlCopyFlags_FollowLinks))
-                        {
-                            /* Fall through to next case is intentional. */
-                        }
+                        { /* Fall through to next case is intentional. */ }
                         else
                             break;
-
-                    case RTDIRENTRYTYPE_FILE:
+                        RT_FALL_THRU();
+
+                    case RTFS_TYPE_FILE:
                     {
                         if (   pszFilter
-                            && !RTStrSimplePatternMatch(pszFilter, DirEntry.szName))
+                            && !RTStrSimplePatternMatch(pszFilter, pDirEntry->szName))
                         {
                             break; /* Filter does not match. */
@@ -2299,11 +2296,10 @@
 
                         if (pContext->pCmdCtx->cVerbose)
-                            RTPrintf("File: %s\n", DirEntry.szName);
+                            RTPrintf("File: %s\n", pDirEntry->szName);
 
                         if (!fDirCreated)
                         {
                             char *pszDestDir;
-                            vrc = gctlCopyTranslatePath(pszSource, szCurDir,
-                                                        pszDest, &pszDestDir);
+                            vrc = gctlCopyTranslatePath(pszSource, szCurDir, pszDest, &pszDestDir);
                             if (RT_SUCCESS(vrc))
                             {
@@ -2317,10 +2313,9 @@
                         if (RT_SUCCESS(vrc))
                         {
-                            char *pszFileSource = RTPathJoinA(szCurDir, DirEntry.szName);
+                            char *pszFileSource = RTPathJoinA(szCurDir, pDirEntry->szName);
                             if (pszFileSource)
                             {
                                 char *pszFileDest;
-                                vrc = gctlCopyTranslatePath(pszSource, pszFileSource,
-                                                           pszDest, &pszFileDest);
+                                vrc = gctlCopyTranslatePath(pszSource, pszFileSource, pszDest, &pszFileDest);
                                 if (RT_SUCCESS(vrc))
                                 {
@@ -2342,4 +2337,5 @@
             }
 
+            RTDirReadExAFree(&pDirEntry, &cbDirEntry);
             RTDirClose(hDir);
         }
Index: /trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp
===================================================================
--- /trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp	(revision 69757)
+++ /trunk/src/VBox/GuestHost/DragAndDrop/DnDURIList.cpp	(revision 69758)
@@ -128,5 +128,4 @@
         {
             rc = addEntry(pcszSrcPath, &pcszDstPath[cchDstBase], fFlags);
-
             if (RT_SUCCESS(rc))
             {
@@ -135,8 +134,10 @@
                 if (RT_SUCCESS(rc))
                 {
+                    size_t        cbDirEntry = 0;
+                    PRTDIRENTRYEX pDirEntry  = NULL;
                     do
                     {
-                        RTDIRENTRY DirEntry;
-                        rc = RTDirRead(hDir, &DirEntry, NULL);
+                        /* Retrieve the next directory entry. */
+                        rc = RTDirReadExA(hDir, &pDirEntry, &cbDirEntry, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
                         if (RT_FAILURE(rc))
                         {
@@ -145,20 +146,17 @@
                             break;
                         }
-                        /** @todo r=bird: you really need to read the documentation! I already
-                         *        pointed out that this isn't goint to work in the guest control
-                         *        code. sigh. */
-
-                        switch (DirEntry.enmType)
+
+                        switch (pDirEntry->Info.Attr.fMode & RTFS_TYPE_MASK)
                         {
-                            case RTDIRENTRYTYPE_DIRECTORY:
+                            case RTFS_TYPE_DIRECTORY:
                             {
                                 /* Skip "." and ".." entries. */
-                                if (RTDirEntryIsStdDotLink(&DirEntry))
+                                if (RTDirEntryExIsStdDotLink(pDirEntry))
                                     break;
 
-                                char *pszSrc = RTPathJoinA(pcszSrcPath, DirEntry.szName);
+                                char *pszSrc = RTPathJoinA(pcszSrcPath, pDirEntry->szName);
                                 if (pszSrc)
                                 {
-                                    char *pszDst = RTPathJoinA(pcszDstPath, DirEntry.szName);
+                                    char *pszDst = RTPathJoinA(pcszDstPath, pDirEntry->szName);
                                     if (pszDst)
                                     {
@@ -176,10 +174,10 @@
                             }
 
-                            case RTDIRENTRYTYPE_FILE:
+                            case RTFS_TYPE_FILE:
                             {
-                                char *pszSrc = RTPathJoinA(pcszSrcPath, DirEntry.szName);
+                                char *pszSrc = RTPathJoinA(pcszSrcPath, pDirEntry->szName);
                                 if (pszSrc)
                                 {
-                                    char *pszDst = RTPathJoinA(pcszDstPath, DirEntry.szName);
+                                    char *pszDst = RTPathJoinA(pcszDstPath, pDirEntry->szName);
                                     if (pszDst)
                                     {
@@ -195,5 +193,5 @@
                                 break;
                             }
-                            case RTDIRENTRYTYPE_SYMLINK:
+                            case RTFS_TYPE_SYMLINK:
                             {
                                 if (fFlags & DNDURILIST_FLAGS_RESOLVE_SYMLINKS)
@@ -233,4 +231,5 @@
                     } while (RT_SUCCESS(rc));
 
+                    RTDirReadExAFree(&pDirEntry, &cbDirEntry);
                     RTDirClose(hDir);
                 }
