VirtualBox

Changeset 49130 in vbox for trunk/src


Ignore:
Timestamp:
Oct 16, 2013 11:57:15 AM (11 years ago)
Author:
vboxsync
Message:

Main/ExtPackManagerImpl: internal method to get the full path of a module.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ExtPackManagerImpl.h

    r48313 r49130  
    149149    HRESULT     checkVrde(void);
    150150    HRESULT     getVrdpLibraryName(Utf8Str *a_pstrVrdeLibrary);
     151    HRESULT     getLibraryName(const char *a_pszModuleName, Utf8Str *a_pstrLibrary);
    151152    bool        wantsToBeDefaultVrde(void) const;
    152153    HRESULT     refresh(bool *pfCanDelete);
     
    232233    HRESULT     checkVrdeExtPack(Utf8Str const *a_pstrExtPack);
    233234    int         getVrdeLibraryPathForExtPack(Utf8Str const *a_pstrExtPack, Utf8Str *a_pstrVrdeLibrary);
     235    HRESULT     getLibraryPathForExtPack(const char *a_pszModuleName, Utf8Str const *a_pstrExtPack, Utf8Str *a_pstrLibrary);
    234236    HRESULT     getDefaultVrdeExtPack(Utf8Str *a_pstrExtPack);
    235237    bool        isExtPackUsable(const char *a_pszExtPack);
  • trunk/src/VBox/Main/src-all/ExtPackManagerImpl.cpp

    r48390 r49130  
    11121112                           m->Desc.strVrdeModule.c_str(), m->Desc.strName.c_str());
    11131113    }
     1114    return hrc;
     1115}
     1116
     1117/**
     1118 * Resolves the path to the module.
     1119 *
     1120 * @returns S_OK or COM error status with error information.
     1121 * @param   a_pszModuleName  The library.
     1122 * @param   a_pstrLibrary  Where to return the path on success.
     1123 *
     1124 * @remarks Caller holds the extension manager lock for reading, no locking
     1125 *          necessary.
     1126 */
     1127HRESULT ExtPack::getLibraryName(const char *a_pszModuleName, Utf8Str *a_pstrLibrary)
     1128{
     1129    HRESULT hrc;
     1130    if (findModule(a_pszModuleName, NULL, VBOXEXTPACKMODKIND_R3,
     1131                   a_pstrLibrary, NULL /*a_pfNative*/, NULL /*a_pObjInfo*/))
     1132        hrc = S_OK;
     1133    else
     1134        hrc = setError(E_FAIL, tr("Failed to locate the module '%s' in extension pack '%s'"),
     1135                       a_pszModuleName, m->Desc.strName.c_str());
    11141136    return hrc;
    11151137}
     
    30793101
    30803102/**
     3103 * Gets the full path to the specified library of the specified extension pack.
     3104 *
     3105 * @returns S_OK if a path is returned, COM error status and message return if
     3106 *          not.
     3107 * @param   a_pszModuleName     The library.
     3108 * @param   a_pstrExtPack       The extension pack.
     3109 * @param   a_pstrVrdeLibrary   Where to return the path.
     3110 */
     3111HRESULT ExtPackManager::getLibraryPathForExtPack(const char *a_pszModuleName, Utf8Str const *a_pstrExtPack, Utf8Str *a_pstrLibrary)
     3112{
     3113    AutoCaller autoCaller(this);
     3114    HRESULT hrc = autoCaller.rc();
     3115    if (SUCCEEDED(hrc))
     3116    {
     3117        AutoReadLock autoLock(this COMMA_LOCKVAL_SRC_POS);
     3118
     3119        ExtPack *pExtPack = findExtPack(a_pstrExtPack->c_str());
     3120        if (pExtPack)
     3121            hrc = pExtPack->getLibraryName(a_pszModuleName, a_pstrLibrary);
     3122        else
     3123            hrc = setError(VBOX_E_OBJECT_NOT_FOUND, tr("No extension pack by the name '%s' was found"), a_pstrExtPack->c_str());
     3124    }
     3125
     3126    return hrc;
     3127}
     3128
     3129/**
    30813130 * Gets the name of the default VRDE extension pack.
    30823131 *
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