VirtualBox

儲存庫 vbox 的更動 67600


忽略:
時間撮記:
2017-6-26 上午09:18:41 (7 年 以前)
作者:
vboxsync
訊息:

IPRT: More ISO maker code (import + booting).

位置:
trunk
檔案:
修改 2 筆資料

圖例:

未更動
新增
刪除
  • trunk/include/iprt/formats/iso9660.h

    r67538 r67600  
    901901typedef ISO9660SYSLINUXINFOTABLE const *PCISO9660SYSLINUXINFOTABLE;
    902902
     903/** The file offset of the isolinux boot info table. */
     904#define ISO9660SYSLINUXINFOTABLE_OFFSET     8
     905
    903906/** @} */
    904907
  • trunk/src/VBox/Runtime/common/fs/isomakerimport.cpp

    r67571 r67600  
    126126    AVLU32TREE              Block2FileRoot;
    127127
     128    /** The block offset of the primary volume descriptor. */
     129    uint32_t                offPrimaryVolDesc;
    128130    /** The primary volume space size in blocks. */
    129131    uint32_t                cBlocksInPrimaryVolumeSpace;
     
    13261328
    13271329/**
     1330 * Checks out an El Torito boot image to see if it requires info table patching.
     1331 *
     1332 * @returns IPRT status code (ignored).
     1333 * @param   pThis           The ISO importer instance.
     1334 * @param   idxImageObj     The configuration index of the image.
     1335 * @param   offBootImage    The block offset of the image.
     1336 */
     1337static int rtFsIsoImportProcessElToritoImage(PRTFSISOMKIMPORTER pThis, uint32_t idxImageObj, uint32_t offBootImage)
     1338{
     1339    ISO9660SYSLINUXINFOTABLE InfoTable;
     1340    int rc = RTVfsFileReadAt(pThis->hSrcFile, offBootImage * (uint64_t)ISO9660_SECTOR_SIZE + ISO9660SYSLINUXINFOTABLE_OFFSET,
     1341                             &InfoTable, sizeof(InfoTable), NULL);
     1342    if (RT_SUCCESS(rc))
     1343    {
     1344        if (   RT_LE2H_U32(InfoTable.offBootFile) == offBootImage
     1345            && RT_LE2H_U32(InfoTable.offPrimaryVolDesc) == pThis->offPrimaryVolDesc
     1346            && ASMMemIsAllU8(&InfoTable.auReserved[0], sizeof(InfoTable.auReserved), 0) )
     1347        {
     1348            rc = RTFsIsoMakerObjEnableBootInfoTablePatching(pThis->hIsoMaker, idxImageObj, true /*fEnable*/);
     1349            if (RT_FAILURE(rc))
     1350                return rtFsIsoImpError(pThis, rc, "RTFsIsoMakerObjEnableBootInfoTablePatching failed: %Rrc", rc);
     1351        }
     1352    }
     1353    return VINF_SUCCESS;
     1354}
     1355
     1356
     1357/**
    13281358 * Processes a boot catalog default or section entry.
    13291359 *
     
    15131543                                            pEntry->bSelectionCriteriaType, pbSelCrit, cbSelCrit);
    15141544    if (RT_SUCCESS(rc))
     1545    {
    15151546        pThis->pResults->cBootCatEntries += 1 + *pcSkip;
     1547        rc = rtFsIsoImportProcessElToritoImage(pThis, idxImageObj, offBootImage);
     1548    }
    15161549    else
    15171550        rtFsIsoImpError(pThis, rc, "RTFsIsoMakerBootCatSetSectionEntry failed for entry #%#x: %Rrc", iEntry, rc);
     
    17781811                                cPrimaryVolDescs++;
    17791812                                if (cPrimaryVolDescs == 1)
     1813                                {
     1814                                    pThis->offPrimaryVolDesc = _32K / ISO9660_SECTOR_SIZE + iVolDesc;
    17801815                                    rtFsIsoImportProcessPrimaryDesc(pThis, &pThis->uSectorBuf.PrimVolDesc);
     1816                                }
    17811817                                else
    17821818                                    rtFsIsoImpError(pThis, VERR_ISOMK_IMPORT_MULTIPLE_PRIMARY_VOL_DESCS,
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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