VirtualBox

Changeset 35755 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Jan 28, 2011 11:36:42 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69715
Message:

Main: convert SharedFolder to utf-8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r35676 r35755  
    70327032 *      must be called from under the object's lock!
    70337033 */
    7034 HRESULT Machine::findSharedFolder(CBSTR aName,
     7034HRESULT Machine::findSharedFolder(const Utf8Str &aName,
    70357035                                  ComObjPtr<SharedFolder> &aSharedFolder,
    70367036                                  bool aSetError /* = false */)
    70377037{
    7038     bool found = false;
     7038    HRESULT rc = VBOX_E_OBJECT_NOT_FOUND;
    70397039    for (HWData::SharedFolderList::const_iterator it = mHWData->mSharedFolders.begin();
    7040         !found && it != mHWData->mSharedFolders.end();
     7040        it != mHWData->mSharedFolders.end();
    70417041        ++it)
    70427042    {
    7043         AutoWriteLock alock(*it COMMA_LOCKVAL_SRC_POS);
    7044         found = (*it)->getName() == aName;
    7045         if (found)
    7046             aSharedFolder = *it;
    7047     }
    7048 
    7049     HRESULT rc = found ? S_OK : VBOX_E_OBJECT_NOT_FOUND;
    7050 
    7051     if (aSetError && !found)
    7052         setError(rc, tr("Could not find a shared folder named '%ls'"), aName);
     7043        SharedFolder *pSF = *it;
     7044        AutoCaller autoCaller(pSF);
     7045        if (pSF->getName() == aName)
     7046        {
     7047            aSharedFolder = pSF;
     7048            rc = S_OK;
     7049            break;
     7050        }
     7051    }
     7052
     7053    if (aSetError && FAILED(rc))
     7054        setError(rc, tr("Could not find a shared folder named '%s'"), aName.c_str());
    70537055
    70547056    return rc;
     
    85028504            ++it)
    85038505        {
    8504             ComObjPtr<SharedFolder> pFolder = *it;
     8506            SharedFolder *pSF = *it;
     8507            AutoCaller sfCaller(pSF);
     8508            AutoReadLock sfLock(pSF COMMA_LOCKVAL_SRC_POS);
    85058509            settings::SharedFolder sf;
    8506             sf.strName = pFolder->getName();
    8507             sf.strHostPath = pFolder->getHostPath();
    8508             sf.fWritable = !!pFolder->isWritable();
    8509             sf.fAutoMount = !!pFolder->isAutoMounted();
     8510            sf.strName = pSF->getName();
     8511            sf.strHostPath = pSF->getHostPath();
     8512            sf.fWritable = !!pSF->isWritable();
     8513            sf.fAutoMount = !!pSF->isAutoMounted();
    85108514
    85118515            data.llSharedFolders.push_back(sf);
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