VirtualBox

儲存庫 vbox 的更動 12343


忽略:
時間撮記:
2008-9-10 上午10:54:02 (16 年 以前)
作者:
vboxsync
訊息:

VBoxHDD-new: Use RTDirReadEx to get type of the entry and use RTPathAppPrivateArch instead of RTPathSharedLibs

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/Storage/VBoxHDD-new.cpp

    r12329 r12343  
    181181        char *pszPluginName;
    182182
    183         rc = RTPathSharedLibs(szSharedLibPath, sizeof(szSharedLibPath));
     183        rc = RTPathAppPrivateArch(szSharedLibPath, sizeof(szSharedLibPath));
    184184        if (RT_FAILURE(rc))
    185185            return rc;
     
    667667        /* Then enumerate plugin backends. */
    668668        char szPath[RTPATH_MAX];
    669         rc = RTPathSharedLibs(szPath, sizeof(szPath));
     669        rc = RTPathAppPrivateArch(szPath, sizeof(szPath));
    670670        if (RT_FAILURE(rc))
    671671            break;
     
    686686            break;
    687687
    688         PRTDIRENTRY pPluginDirEntry = NULL;
     688        PRTDIRENTRYEX pPluginDirEntry = NULL;
    689689        unsigned cbPluginDirEntry = sizeof(RTDIRENTRY);
    690         pPluginDirEntry = (PRTDIRENTRY)RTMemAllocZ(sizeof(RTDIRENTRY));
     690        pPluginDirEntry = (PRTDIRENTRYEX)RTMemAllocZ(sizeof(RTDIRENTRY));
    691691        if (!pPluginDirEntry)
    692692        {
     
    695695        }
    696696
    697         while ((rc = RTDirRead(pPluginDir, pPluginDirEntry, &cbPluginDirEntry)) != VERR_NO_MORE_FILES)
     697        while ((rc = RTDirReadEx(pPluginDir, pPluginDirEntry, &cbPluginDirEntry, RTFSOBJATTRADD_NOTHING)) != VERR_NO_MORE_FILES)
    698698        {
    699699            RTLDRMOD hPlugin = NIL_RTLDRMOD;
     
    706706                /* allocate new buffer. */
    707707                RTMemFree(pPluginDirEntry);
    708                 pPluginDirEntry = (PRTDIRENTRY)RTMemAllocZ(cbPluginDirEntry);
     708                pPluginDirEntry = (PRTDIRENTRYEX)RTMemAllocZ(cbPluginDirEntry);
    709709                /* Retry. */
    710                 rc = RTDirRead(pPluginDir, pPluginDirEntry, &cbPluginDirEntry);
     710                rc = RTDirReadEx(pPluginDir, pPluginDirEntry, &cbPluginDirEntry, RTFSOBJATTRADD_NOTHING);
    711711                if (RT_FAILURE(rc))
    712712                    break;
     
    716716
    717717            /* We got the new entry. */
    718             if (pPluginDirEntry->enmType != RTDIRENTRYTYPE_FILE)
     718            if (!RTFS_IS_FILE(pPluginDirEntry->Info.Attr.fMode))
    719719                continue;
    720720
     
    952952        /* Then check if plugin backends support this file format. */
    953953        char szPath[RTPATH_MAX];
    954         rc = RTPathSharedLibs(szPath, sizeof(szPath));
     954        rc = RTPathAppPrivateArch(szPath, sizeof(szPath));
    955955        if (RT_FAILURE(rc))
    956956            break;
     
    971971            break;
    972972
    973         PRTDIRENTRY pPluginDirEntry = NULL;
     973        PRTDIRENTRYEX pPluginDirEntry = NULL;
    974974        unsigned cbPluginDirEntry = sizeof(RTDIRENTRY);
    975         pPluginDirEntry = (PRTDIRENTRY)RTMemAllocZ(sizeof(RTDIRENTRY));
     975        pPluginDirEntry = (PRTDIRENTRYEX)RTMemAllocZ(sizeof(RTDIRENTRY));
    976976        if (!pPluginDirEntry)
    977977        {
     
    980980        }
    981981
    982         while ((rc = RTDirRead(pPluginDir, pPluginDirEntry, &cbPluginDirEntry)) != VERR_NO_MORE_FILES)
     982        while ((rc = RTDirReadEx(pPluginDir, pPluginDirEntry, &cbPluginDirEntry, RTFSOBJATTRADD_NOTHING)) != VERR_NO_MORE_FILES)
    983983        {
    984984            RTLDRMOD hPlugin = NIL_RTLDRMOD;
     
    991991                /* allocate new buffer. */
    992992                RTMemFree(pPluginDirEntry);
    993                 pPluginDirEntry = (PRTDIRENTRY)RTMemAllocZ(cbPluginDirEntry);
     993                pPluginDirEntry = (PRTDIRENTRYEX)RTMemAllocZ(cbPluginDirEntry);
    994994                /* Retry. */
    995                 rc = RTDirRead(pPluginDir, pPluginDirEntry, &cbPluginDirEntry);
     995                rc = RTDirReadEx(pPluginDir, pPluginDirEntry, &cbPluginDirEntry, RTFSOBJATTRADD_NOTHING);
    996996                if (RT_FAILURE(rc))
    997997                    break;
     
    10011001
    10021002            /* We got the new entry. */
    1003             if (pPluginDirEntry->enmType != RTDIRENTRYTYPE_FILE)
     1003            if (!RTFS_IS_FILE(pPluginDirEntry->Info.Attr.fMode))
    10041004                continue;
    10051005
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette