Changeset 67413 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jun 14, 2017 9:25:14 PM (7 years ago)
- Location:
- trunk/src/VBox/Runtime/common/fs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fs/isomaker.cpp
r67412 r67413 87 87 88 88 89 /** Calculates the path table record size given the name length. */ 89 /** Calculates the path table record size given the name length. 90 * @note The root directory length is 1 (name byte is 0x00), we make sure this 91 * is the case in rtFsIsoMakerNormalizeNameForNamespace. */ 90 92 #define RTFSISOMAKER_CALC_PATHREC_SIZE(a_cbNameInDirRec) \ 91 ( RT_UOFFSETOF(ISO9660PATHREC, achDirId[(a_cbNameInDirRec) ]) + ((a_cbNameInDirRec) & 1) )93 ( RT_UOFFSETOF(ISO9660PATHREC, achDirId[(a_cbNameInDirRec) + ((a_cbNameInDirRec) & 1)]) ) 92 94 93 95 … … 1640 1642 /* 1641 1643 * Root special case. 1644 * 1645 * For ISO-9660 and joliet, we enter it with a length of 1 byte. The 1646 * value byte value is zero. The path tables we generate won't be 1647 * accepted by windows unless we do this. 1642 1648 */ 1643 1649 *pszDst = '\0'; 1644 1650 *pcchDst = 0; 1645 *pcbInDirRec = 0;1651 *pcbInDirRec = pNamespace->fNamespace & (RTFSISOMAKER_NAMESPACE_ISO_9660 | RTFSISOMAKER_NAMESPACE_JOLIET) ? 1 : 0; 1646 1652 AssertReturn(!pParent, VERR_INTERNAL_ERROR_3); 1647 1653 return VINF_SUCCESS; … … 1760 1766 if (RT_SUCCESS(rc)) 1761 1767 { 1768 Assert(cbNameInDirRec > 0); 1769 1762 1770 size_t cbName = sizeof(RTFSISOMAKERNAME) 1763 1771 + cchName + 1 … … 2903 2911 2904 2912 int rc; 2905 uint16_t idPathTable = 0;2913 uint16_t idPathTable = 1; 2906 2914 uint32_t cbPathTable = 0; 2907 2915 if (pNamespace->pRoot) … … 3382 3390 pPrimary->cbPathTable.be = RT_H2BE_U32(pThis->PrimaryIsoDirs.cbPathTable); 3383 3391 pPrimary->cbPathTable.le = RT_H2LE_U32(pThis->PrimaryIsoDirs.cbPathTable); 3384 pPrimary->offTypeLPathTable = RT_H2LE_U32(pThis->PrimaryIsoDirs.offPathTableL );3385 pPrimary->offTypeMPathTable = RT_H2BE_U32(pThis->PrimaryIsoDirs.offPathTableM );3392 pPrimary->offTypeLPathTable = RT_H2LE_U32(pThis->PrimaryIsoDirs.offPathTableL / RTFSISOMAKER_SECTOR_SIZE); 3393 pPrimary->offTypeMPathTable = RT_H2BE_U32(pThis->PrimaryIsoDirs.offPathTableM / RTFSISOMAKER_SECTOR_SIZE); 3386 3394 pPrimary->RootDir.DirRec.cbDirRec = sizeof(pPrimary->RootDir); 3387 3395 pPrimary->RootDir.DirRec.cExtAttrBlocks = 0; … … 3408 3416 pJoliet->cbPathTable.be = RT_H2BE_U32(pThis->JolietDirs.cbPathTable); 3409 3417 pJoliet->cbPathTable.le = RT_H2LE_U32(pThis->JolietDirs.cbPathTable); 3410 pJoliet->offTypeLPathTable = RT_H2LE_U32(pThis->JolietDirs.offPathTableL );3411 pJoliet->offTypeMPathTable = RT_H2BE_U32(pThis->JolietDirs.offPathTableM );3418 pJoliet->offTypeLPathTable = RT_H2LE_U32(pThis->JolietDirs.offPathTableL / RTFSISOMAKER_SECTOR_SIZE); 3419 pJoliet->offTypeMPathTable = RT_H2BE_U32(pThis->JolietDirs.offPathTableM / RTFSISOMAKER_SECTOR_SIZE); 3412 3420 pJoliet->RootDir.DirRec.cbDirRec = sizeof(pJoliet->RootDir); 3413 3421 pJoliet->RootDir.DirRec.cExtAttrBlocks = 0; … … 3783 3791 { 3784 3792 pPathRec->offExtent = RT_H2LE_U32(pName->pDir->offDir / RTFSISOMAKER_SECTOR_SIZE); 3785 pPathRec->idParentRec = RT_H2LE_U16(pName->pParent ? pName->pParent->pDir->idPathTable : 0);3793 pPathRec->idParentRec = RT_H2LE_U16(pName->pParent ? pName->pParent->pDir->idPathTable : 1); 3786 3794 } 3787 3795 else 3788 3796 { 3789 3797 pPathRec->offExtent = RT_H2BE_U32(pName->pDir->offDir / RTFSISOMAKER_SECTOR_SIZE); 3790 pPathRec->idParentRec = RT_H2BE_U16(pName->pParent ? pName->pParent->pDir->idPathTable : 0);3798 pPathRec->idParentRec = RT_H2BE_U16(pName->pParent ? pName->pParent->pDir->idPathTable : 1); 3791 3799 } 3792 3800 if (!fUnicode) … … 3803 3811 int rc = RTStrToUtf16BigEx(pName->szName, RTSTR_MAX, &pwszTmp, pName->cbNameInDirRec / sizeof(RTUTF16) + 1, &cwcResult); 3804 3812 AssertRC(rc); 3805 Assert(cwcResult * sizeof(RTUTF16) == pName->cbNameInDirRec); 3813 Assert( cwcResult * sizeof(RTUTF16) == pName->cbNameInDirRec 3814 || (!pName->pParent && cwcResult == 0 && pName->cbNameInDirRec == 1) ); 3815 3806 3816 } 3807 3817 return RTFSISOMAKER_CALC_PATHREC_SIZE(pName->cbNameInDirRec); … … 3985 3995 int rc = RTStrToUtf16BigEx(pName->szName, RTSTR_MAX, &pwszTmp, RT_ELEMENTS(wszTmp), &cwcResult); 3986 3996 AssertRC(rc); 3987 Assert(cwcResult * sizeof(RTUTF16) == pName->cbNameInDirRec); 3997 Assert( cwcResult * sizeof(RTUTF16) == pName->cbNameInDirRec 3998 || (!pName->pParent && cwcResult == 0 && pName->cbNameInDirRec == 1) ); 3988 3999 memcpy(&pDirRec->achFileId[0], pwszTmp, pName->cbNameInDirRec); 3989 4000 pDirRec->achFileId[pName->cbNameInDirRec] = '\0'; -
trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp
r67399 r67413 93 93 RTFSISOMAKERCMD_OPT_RANDOM_OUTPUT_BUFFER_SIZE, 94 94 RTFSISOMAKERCMD_OPT_NAME_SETUP, 95 RTFSISOMAKERCMD_OPT_NO_JOLIET, 95 96 96 97 /* … … 309 310 { "--output-buffer-size", RTFSISOMAKERCMD_OPT_OUTPUT_BUFFER_SIZE, RTGETOPT_REQ_UINT32 }, 310 311 { "--random-output-buffer-size", RTFSISOMAKERCMD_OPT_RANDOM_OUTPUT_BUFFER_SIZE, RTGETOPT_REQ_NOTHING }, 311 { "--name-setup", RTFSISOMAKERCMD_OPT_NAME_SETUP, RTGETOPT_REQ_STRING }, 312 { "--name-setup", RTFSISOMAKERCMD_OPT_NAME_SETUP, RTGETOPT_REQ_STRING }, 313 { "--no-joliet", RTFSISOMAKERCMD_OPT_NO_JOLIET, RTGETOPT_REQ_NOTHING }, 312 314 313 315 … … 1197 1199 rc = rtFsIsoMakerCmdOptNameSetup(&Opts, ValueUnion.psz); 1198 1200 break; 1201 case RTFSISOMAKERCMD_OPT_NO_JOLIET: 1202 rc = RTFsIsoMakerSetJolietUcs2Level(Opts.hIsoMaker, 0); 1203 if (RT_FAILURE(rc)) 1204 rc = rtFsIsoMakerCmdErrorRc(&Opts, rc, "Failed to disable joliet: %Rrc", rc); 1205 break; 1199 1206 1200 1207
Note:
See TracChangeset
for help on using the changeset viewer.