VirtualBox

Ignore:
Timestamp:
Nov 19, 2017 3:23:57 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
119158
Message:

VBoxManageGuestCtrl.cpp,DnDURIList.cpp: Fix RTDIRENTRYTYPE_UNKNOWN problem by using RTDirReadExA. Untested.

File:
1 edited

Legend:

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

    r69755 r69758  
    128128        {
    129129            rc = addEntry(pcszSrcPath, &pcszDstPath[cchDstBase], fFlags);
    130 
    131130            if (RT_SUCCESS(rc))
    132131            {
     
    135134                if (RT_SUCCESS(rc))
    136135                {
     136                    size_t        cbDirEntry = 0;
     137                    PRTDIRENTRYEX pDirEntry  = NULL;
    137138                    do
    138139                    {
    139                         RTDIRENTRY DirEntry;
    140                         rc = RTDirRead(hDir, &DirEntry, NULL);
     140                        /* Retrieve the next directory entry. */
     141                        rc = RTDirReadExA(hDir, &pDirEntry, &cbDirEntry, RTFSOBJATTRADD_NOTHING, RTPATH_F_ON_LINK);
    141142                        if (RT_FAILURE(rc))
    142143                        {
     
    145146                            break;
    146147                        }
    147                         /** @todo r=bird: you really need to read the documentation! I already
    148                          *        pointed out that this isn't goint to work in the guest control
    149                          *        code. sigh. */
    150 
    151                         switch (DirEntry.enmType)
     148
     149                        switch (pDirEntry->Info.Attr.fMode & RTFS_TYPE_MASK)
    152150                        {
    153                             case RTDIRENTRYTYPE_DIRECTORY:
     151                            case RTFS_TYPE_DIRECTORY:
    154152                            {
    155153                                /* Skip "." and ".." entries. */
    156                                 if (RTDirEntryIsStdDotLink(&DirEntry))
     154                                if (RTDirEntryExIsStdDotLink(pDirEntry))
    157155                                    break;
    158156
    159                                 char *pszSrc = RTPathJoinA(pcszSrcPath, DirEntry.szName);
     157                                char *pszSrc = RTPathJoinA(pcszSrcPath, pDirEntry->szName);
    160158                                if (pszSrc)
    161159                                {
    162                                     char *pszDst = RTPathJoinA(pcszDstPath, DirEntry.szName);
     160                                    char *pszDst = RTPathJoinA(pcszDstPath, pDirEntry->szName);
    163161                                    if (pszDst)
    164162                                    {
     
    176174                            }
    177175
    178                             case RTDIRENTRYTYPE_FILE:
     176                            case RTFS_TYPE_FILE:
    179177                            {
    180                                 char *pszSrc = RTPathJoinA(pcszSrcPath, DirEntry.szName);
     178                                char *pszSrc = RTPathJoinA(pcszSrcPath, pDirEntry->szName);
    181179                                if (pszSrc)
    182180                                {
    183                                     char *pszDst = RTPathJoinA(pcszDstPath, DirEntry.szName);
     181                                    char *pszDst = RTPathJoinA(pcszDstPath, pDirEntry->szName);
    184182                                    if (pszDst)
    185183                                    {
     
    195193                                break;
    196194                            }
    197                             case RTDIRENTRYTYPE_SYMLINK:
     195                            case RTFS_TYPE_SYMLINK:
    198196                            {
    199197                                if (fFlags & DNDURILIST_FLAGS_RESOLVE_SYMLINKS)
     
    233231                    } while (RT_SUCCESS(rc));
    234232
     233                    RTDirReadExAFree(&pDirEntry, &cbDirEntry);
    235234                    RTDirClose(hDir);
    236235                }
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