Changeset 73097 in vbox for trunk/src/VBox/Runtime/common/fs
- Timestamp:
- Jul 12, 2018 9:06:33 PM (7 years ago)
- Location:
- trunk/src/VBox/Runtime/common/fs
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fs/RTFsCmdLs.cpp
r70422 r73097 782 782 { 783 783 default: AssertFailed(); RT_FALL_THRU(); 784 case RTCMDLSTIME_MTIME: offTime = RT_ OFFSETOF(RTCMDLSENTRY, Info.ModificationTime); break;785 case RTCMDLSTIME_BTIME: offTime = RT_ OFFSETOF(RTCMDLSENTRY, Info.BirthTime); break;786 case RTCMDLSTIME_CTIME: offTime = RT_ OFFSETOF(RTCMDLSENTRY, Info.ChangeTime); break;787 case RTCMDLSTIME_ATIME: offTime = RT_ OFFSETOF(RTCMDLSENTRY, Info.AccessTime); break;784 case RTCMDLSTIME_MTIME: offTime = RT_UOFFSETOF(RTCMDLSENTRY, Info.ModificationTime); break; 785 case RTCMDLSTIME_BTIME: offTime = RT_UOFFSETOF(RTCMDLSENTRY, Info.BirthTime); break; 786 case RTCMDLSTIME_CTIME: offTime = RT_UOFFSETOF(RTCMDLSENTRY, Info.ChangeTime); break; 787 case RTCMDLSTIME_ATIME: offTime = RT_UOFFSETOF(RTCMDLSENTRY, Info.AccessTime); break; 788 788 } 789 789 … … 1027 1027 && *pszName) 1028 1028 { 1029 PRTCMDLSCOLLECTION pCollection = (PRTCMDLSCOLLECTION)RTMemAllocZ(RT_ OFFSETOF(RTCMDLSCOLLECTION, szName[1]));1029 PRTCMDLSCOLLECTION pCollection = (PRTCMDLSCOLLECTION)RTMemAllocZ(RT_UOFFSETOF(RTCMDLSCOLLECTION, szName[1])); 1030 1030 if (!pCollection) 1031 1031 { … … 1040 1040 /* Add new collection. */ 1041 1041 size_t cbName = strlen(pszName) + 1; 1042 PRTCMDLSCOLLECTION pCollection = (PRTCMDLSCOLLECTION)RTMemAllocZ(RT_ OFFSETOF(RTCMDLSCOLLECTION, szName[cbName]));1042 PRTCMDLSCOLLECTION pCollection = (PRTCMDLSCOLLECTION)RTMemAllocZ(RT_UOFFSETOF_DYN(RTCMDLSCOLLECTION, szName[cbName])); 1043 1043 if (pCollection) 1044 1044 { … … 1083 1083 size_t const cbGroup = pszGroup ? strlen(pszGroup) + 1 : 0; 1084 1084 size_t const cbTarget = pszTarget ? strlen(pszTarget) + 1 : 0; 1085 size_t const cbEntry = RT_ OFFSETOF(RTCMDLSENTRY, szName[cchEntry + 1 + cbOwner + cbGroup + cbTarget]);1085 size_t const cbEntry = RT_UOFFSETOF_DYN(RTCMDLSENTRY, szName[cchEntry + 1 + cbOwner + cbGroup + cbTarget]); 1086 1086 PRTCMDLSENTRY pEntry = (PRTCMDLSENTRY)RTMemAlloc(cbEntry); 1087 1087 if (pEntry) -
trunk/src/VBox/Runtime/common/fs/ext2vfs.cpp
r69861 r73097 99 99 if (!pBlkGrpDesc) 100 100 { 101 size_t cbBlkDesc = RT_ OFFSETOF(RTFILESYSTEMEXTBLKGRP, abBlockBitmap[cbBlockBitmap]);101 size_t cbBlkDesc = RT_UOFFSETOF_DYN(RTFILESYSTEMEXTBLKGRP, abBlockBitmap[cbBlockBitmap]); 102 102 pBlkGrpDesc = (PRTFILESYSTEMEXTBLKGRP)RTMemAllocZ(cbBlkDesc); 103 103 if (!pBlkGrpDesc) -
trunk/src/VBox/Runtime/common/fs/fatvfs.cpp
r72584 r73097 824 824 */ 825 825 PRTFSFATCLUSTERMAPCACHE pFatCache; 826 pThis->pFatCache = pFatCache = (PRTFSFATCLUSTERMAPCACHE)RTMemAllocZ(RT_OFFSETOF(RTFSFATCLUSTERMAPCACHE, aEntries[cEntries])); 826 pFatCache = (PRTFSFATCLUSTERMAPCACHE)RTMemAllocZ(RT_UOFFSETOF_DYN(RTFSFATCLUSTERMAPCACHE, aEntries[cEntries])); 827 pThis->pFatCache = pFatCache; 827 828 if (!pFatCache) 828 829 return RTErrInfoSet(pErrInfo, VERR_NO_MEMORY, "Failed to allocate FAT cache"); … … 2571 2572 { /* ObjSet */ 2572 2573 RTVFSOBJSETOPS_VERSION, 2573 RT_ OFFSETOF(RTVFSFILEOPS, Stream.Obj) - RT_OFFSETOF(RTVFSFILEOPS, ObjSet),2574 RT_UOFFSETOF(RTVFSFILEOPS, ObjSet) - RT_UOFFSETOF(RTVFSFILEOPS, Stream.Obj), 2574 2575 rtFsFatFile_SetMode, 2575 2576 rtFsFatFile_SetTimes, … … 4412 4413 if (pThis->offDir < 2) 4413 4414 { 4414 size_t cbNeeded = RT_ OFFSETOF(RTDIRENTRYEX, szName[pThis->offDir + 2]);4415 size_t cbNeeded = RT_UOFFSETOF_DYN(RTDIRENTRYEX, szName[pThis->offDir + 2]); 4415 4416 if (cbNeeded < *pcbDirEntry) 4416 4417 *pcbDirEntry = cbNeeded; … … 4554 4555 if (!fLongName) 4555 4556 cchName = rtFsFatDir_CalcUtf8LengthForDirEntry(pShared, &paEntries[iEntry].Entry); 4556 size_t cbNeeded = RT_ OFFSETOF(RTDIRENTRYEX, szName[cchName + 1]);4557 size_t cbNeeded = RT_UOFFSETOF_DYN(RTDIRENTRYEX, szName[cchName + 1]); 4557 4558 if (cbNeeded <= *pcbDirEntry) 4558 4559 *pcbDirEntry = cbNeeded; … … 4626 4627 { /* ObjSet */ 4627 4628 RTVFSOBJSETOPS_VERSION, 4628 RT_ OFFSETOF(RTVFSDIROPS, Obj) - RT_OFFSETOF(RTVFSDIROPS, ObjSet),4629 RT_UOFFSETOF(RTVFSDIROPS, ObjSet) - RT_UOFFSETOF(RTVFSDIROPS, Obj), 4629 4630 rtFsFatDir_SetMode, 4630 4631 rtFsFatDir_SetTimes, … … 5031 5032 Assert(offFirstZero >= RT_UOFFSETOF(FATBOOTSECTOR, Bpb)); 5032 5033 uint32_t const cbZeroPad = RT_MIN(offJump - offFirstZero, 5033 sizeof(pBootSector->Bpb.Bpb20) - (offFirstZero - RT_ OFFSETOF(FATBOOTSECTOR, Bpb)));5034 sizeof(pBootSector->Bpb.Bpb20) - (offFirstZero - RT_UOFFSETOF(FATBOOTSECTOR, Bpb))); 5034 5035 5035 5036 if (!ASMMemIsAllU8((uint8_t const *)pBootSector + offFirstZero, cbZeroPad, 0)) … … 5387 5388 && pBootSector->abJmp[2] <= 0x7f) 5388 5389 offJmp = RT_MIN(127, RT_MAKE_U16(pBootSector->abJmp[1], pBootSector->abJmp[2])); 5389 uint8_t const cbMaxBpb = offJmp - RT_ OFFSETOF(FATBOOTSECTOR, Bpb);5390 uint8_t const cbMaxBpb = offJmp - RT_UOFFSETOF(FATBOOTSECTOR, Bpb); 5390 5391 5391 5392 /* … … 5444 5445 if ( ( sizeof(FAT32EBPB) <= cbMaxBpb 5445 5446 && pBootSector->Bpb.Fat32Ebpb.bExtSignature == FATEBPB_SIGNATURE) 5446 || ( RT_ OFFSETOF(FAT32EBPB, achLabel) <= cbMaxBpb5447 || ( RT_UOFFSETOF(FAT32EBPB, achLabel) <= cbMaxBpb 5447 5448 && pBootSector->Bpb.Fat32Ebpb.bExtSignature == FATEBPB_SIGNATURE_OLD) ) 5448 5449 { … … 5460 5461 if ( ( sizeof(FATEBPB) <= cbMaxBpb 5461 5462 && pBootSector->Bpb.Ebpb.bExtSignature == FATEBPB_SIGNATURE) 5462 || ( RT_ OFFSETOF(FATEBPB, achLabel) <= cbMaxBpb5463 || ( RT_UOFFSETOF(FATEBPB, achLabel) <= cbMaxBpb 5463 5464 && pBootSector->Bpb.Ebpb.bExtSignature == FATEBPB_SIGNATURE_OLD) ) 5464 5465 { -
trunk/src/VBox/Runtime/common/fs/isomaker.cpp
r70155 r73097 99 99 * is the case in rtFsIsoMakerNormalizeNameForNamespace. */ 100 100 #define RTFSISOMAKER_CALC_PATHREC_SIZE(a_cbNameInDirRec) \ 101 ( RT_UOFFSETOF (ISO9660PATHREC, achDirId[(a_cbNameInDirRec) + ((a_cbNameInDirRec) & 1)]) )101 ( RT_UOFFSETOF_DYN(ISO9660PATHREC, achDirId[(a_cbNameInDirRec) + ((a_cbNameInDirRec) & 1)]) ) 102 102 103 103 … … 660 660 } g_aRTFsIsoNamespaces[] = 661 661 { 662 { RTFSISOMAKER_NAMESPACE_ISO_9660, RT_ OFFSETOF(RTFSISOMAKERINT, PrimaryIso), RT_OFFSETOF(RTFSISOMAKEROBJ, pPrimaryName), "iso-9660" },663 { RTFSISOMAKER_NAMESPACE_JOLIET, RT_ OFFSETOF(RTFSISOMAKERINT, Joliet), RT_OFFSETOF(RTFSISOMAKEROBJ, pJolietName), "joliet" },664 { RTFSISOMAKER_NAMESPACE_UDF, RT_ OFFSETOF(RTFSISOMAKERINT, Udf), RT_OFFSETOF(RTFSISOMAKEROBJ, pUdfName), "udf" },665 { RTFSISOMAKER_NAMESPACE_HFS, RT_ OFFSETOF(RTFSISOMAKERINT, Hfs), RT_OFFSETOF(RTFSISOMAKEROBJ, pHfsName), "hfs" },662 { RTFSISOMAKER_NAMESPACE_ISO_9660, RT_UOFFSETOF(RTFSISOMAKERINT, PrimaryIso), RT_UOFFSETOF(RTFSISOMAKEROBJ, pPrimaryName), "iso-9660" }, 663 { RTFSISOMAKER_NAMESPACE_JOLIET, RT_UOFFSETOF(RTFSISOMAKERINT, Joliet), RT_UOFFSETOF(RTFSISOMAKEROBJ, pJolietName), "joliet" }, 664 { RTFSISOMAKER_NAMESPACE_UDF, RT_UOFFSETOF(RTFSISOMAKERINT, Udf), RT_UOFFSETOF(RTFSISOMAKEROBJ, pUdfName), "udf" }, 665 { RTFSISOMAKER_NAMESPACE_HFS, RT_UOFFSETOF(RTFSISOMAKERINT, Hfs), RT_UOFFSETOF(RTFSISOMAKEROBJ, pHfsName), "hfs" }, 666 666 }; 667 667 … … 3611 3611 * Do the adding. 3612 3612 */ 3613 PRTFSISOMAKERSYMLINK pSymlink = (PRTFSISOMAKERSYMLINK)RTMemAllocZ(RT_UOFFSETOF (RTFSISOMAKERSYMLINK, szTarget[cchTarget + 1]));3613 PRTFSISOMAKERSYMLINK pSymlink = (PRTFSISOMAKERSYMLINK)RTMemAllocZ(RT_UOFFSETOF_DYN(RTFSISOMAKERSYMLINK, szTarget[cchTarget + 1])); 3614 3614 AssertReturn(pSymlink, VERR_NO_MEMORY); 3615 3615 int rc = rtFsIsoMakerInitCommonObj(pThis, &pSymlink->Core, RTFSISOMAKEROBJTYPE_SYMLINK, pObjInfo); … … 5882 5882 size_t cchThis = RT_MIN(cchSrc, ISO9660RRIPNM_MAX_NAME_LEN); 5883 5883 PISO9660RRIPNM pNM = (PISO9660RRIPNM)pbSys; 5884 Assert(cbSys >= RT_UOFFSETOF (ISO9660RRIPNM, achName[cchThis]));5884 Assert(cbSys >= RT_UOFFSETOF_DYN(ISO9660RRIPNM, achName[cchThis])); 5885 5885 pNM->Hdr.bSig1 = ISO9660RRIPNM_SIG1; 5886 5886 pNM->Hdr.bSig2 = ISO9660RRIPNM_SIG2; … … 7379 7379 { /* ObjSet */ 7380 7380 RTVFSOBJSETOPS_VERSION, 7381 RT_ OFFSETOF(RTVFSFILEOPS, Stream.Obj) - RT_OFFSETOF(RTVFSFILEOPS, ObjSet),7381 RT_UOFFSETOF(RTVFSFILEOPS, ObjSet) - RT_UOFFSETOF(RTVFSFILEOPS, Stream.Obj), 7382 7382 NULL /*SetMode*/, 7383 7383 NULL /*SetTimes*/, -
trunk/src/VBox/Runtime/common/fs/isomakerimport.cpp
r71013 r73097 732 732 || pUnion->SP.bCheck1 != ISO9660SUSPSP_CHECK1 733 733 || pUnion->SP.bCheck2 != ISO9660SUSPSP_CHECK2 734 || pUnion->SP.cbSkip > UINT8_MAX - RT_ OFFSETOF(ISO9660DIRREC, achFileId[1]))734 || pUnion->SP.cbSkip > UINT8_MAX - RT_UOFFSETOF(ISO9660DIRREC, achFileId[1])) 735 735 LogRel(("rtFsIsoImport/Rock: Malformed 'SP' entry: cbEntry=%#x (vs %#x), bVersion=%#x (vs %#x), bCheck1=%#x (vs %#x), bCheck2=%#x (vs %#x), cbSkip=%#x (vs max %#x)\n", 736 736 pUnion->Hdr.cbEntry, ISO9660SUSPSP_LEN, pUnion->Hdr.bVersion, ISO9660SUSPSP_VER, 737 737 pUnion->SP.bCheck1, ISO9660SUSPSP_CHECK1, pUnion->SP.bCheck2, ISO9660SUSPSP_CHECK2, 738 pUnion->SP.cbSkip, UINT8_MAX - RT_ OFFSETOF(ISO9660DIRREC, achFileId[1]) ));738 pUnion->SP.cbSkip, UINT8_MAX - RT_UOFFSETOF(ISO9660DIRREC, achFileId[1]) )); 739 739 else if (!fIsFirstDirRec) 740 740 LogRel(("rtFsIsoImport/Rock: Ignorining 'SP' entry in non-root directory record\n")); … … 750 750 751 751 case MAKE_SIG(ISO9660SUSPER_SIG1, ISO9660SUSPER_SIG2): /* ER */ 752 if ( pUnion->Hdr.cbEntry > RT_ OFFSETOF(ISO9660SUSPER, achPayload) + (uint32_t)pUnion->ER.cchIdentifier752 if ( pUnion->Hdr.cbEntry > RT_UOFFSETOF(ISO9660SUSPER, achPayload) + (uint32_t)pUnion->ER.cchIdentifier 753 753 + (uint32_t)pUnion->ER.cchDescription + (uint32_t)pUnion->ER.cchSource 754 754 || pUnion->Hdr.bVersion != ISO9660SUSPER_VER) … … 914 914 case MAKE_SIG(ISO9660RRIPSL_SIG1, ISO9660RRIPSL_SIG2): /* SL */ 915 915 if ( pUnion->SL.Hdr.bVersion != ISO9660RRIPSL_VER 916 || pUnion->SL.Hdr.cbEntry < RT_ OFFSETOF(ISO9660RRIPSL, abComponents[2])916 || pUnion->SL.Hdr.cbEntry < RT_UOFFSETOF(ISO9660RRIPSL, abComponents[2]) 917 917 || (pUnion->SL.fFlags & ~ISO9660RRIP_SL_F_CONTINUE) 918 918 || (pUnion->SL.abComponents[0] & ISO9660RRIP_SL_C_RESERVED_MASK) ) 919 919 LogRel(("rtFsIsoImport/Rock: Malformed 'SL' entry: cbEntry=%#x (vs %#x), bVersion=%#x (vs %#x) fFlags=%#x comp[0].fFlags=%#x\n", 920 pUnion->SL.Hdr.cbEntry, RT_ OFFSETOF(ISO9660RRIPSL, abComponents[2]),920 pUnion->SL.Hdr.cbEntry, RT_UOFFSETOF(ISO9660RRIPSL, abComponents[2]), 921 921 pUnion->SL.Hdr.bVersion, ISO9660RRIPSL_VER, pUnion->SL.fFlags, pUnion->SL.abComponents[0])); 922 922 else if (pThis->fSeenLastSL) … … 928 928 size_t offDst = strlen(pThis->szRockSymlinkTargetBuf); 929 929 uint8_t const *pbSrc = &pUnion->SL.abComponents[0]; 930 uint8_t cbSrcLeft = pUnion->SL.Hdr.cbEntry - RT_ OFFSETOF(ISO9660RRIPSL, abComponents);930 uint8_t cbSrcLeft = pUnion->SL.Hdr.cbEntry - RT_UOFFSETOF(ISO9660RRIPSL, abComponents); 931 931 while (cbSrcLeft >= 2) 932 932 { … … 1019 1019 case MAKE_SIG(ISO9660RRIPNM_SIG1, ISO9660RRIPNM_SIG2): /* NM */ 1020 1020 if ( pUnion->NM.Hdr.bVersion != ISO9660RRIPNM_VER 1021 || pUnion->NM.Hdr.cbEntry < RT_ OFFSETOF(ISO9660RRIPNM, achName)1021 || pUnion->NM.Hdr.cbEntry < RT_UOFFSETOF(ISO9660RRIPNM, achName) 1022 1022 || (pUnion->NM.fFlags & ISO9660RRIP_NM_F_RESERVED_MASK) ) 1023 1023 LogRel(("rtFsIsoImport/Rock: Malformed 'NM' entry: cbEntry=%#x (vs %#x), bVersion=%#x (vs %#x) fFlags=%#x %.*Rhxs\n", 1024 pUnion->NM.Hdr.cbEntry, RT_ OFFSETOF(ISO9660RRIPNM, achName),1024 pUnion->NM.Hdr.cbEntry, RT_UOFFSETOF(ISO9660RRIPNM, achName), 1025 1025 pUnion->NM.Hdr.bVersion, ISO9660RRIPNM_VER, pUnion->NM.fFlags, 1026 pUnion->NM.Hdr.cbEntry - RT_MIN(pUnion->NM.Hdr.cbEntry, RT_ OFFSETOF(ISO9660RRIPNM, achName)),1026 pUnion->NM.Hdr.cbEntry - RT_MIN(pUnion->NM.Hdr.cbEntry, RT_UOFFSETOF(ISO9660RRIPNM, achName)), 1027 1027 &pUnion->NM.achName[0] )); 1028 1028 else if (pThis->fSeenLastNM) … … 1032 1032 pThis->fSeenLastNM = !(pUnion->NM.fFlags & ISO9660RRIP_NM_F_CONTINUE); 1033 1033 1034 uint8_t const cchName = pUnion->NM.Hdr.cbEntry - (uint8_t)RT_ OFFSETOF(ISO9660RRIPNM, achName);1034 uint8_t const cchName = pUnion->NM.Hdr.cbEntry - (uint8_t)RT_UOFFSETOF(ISO9660RRIPNM, achName); 1035 1035 if (pUnion->NM.fFlags & (ISO9660RRIP_NM_F_CURRENT | ISO9660RRIP_NM_F_PARENT)) 1036 1036 { … … 1163 1163 ISO9660_GET_ENDIAN(&pDirRec->offExtent), pThis->cBlocksInPrimaryVolumeSpace); 1164 1164 1165 if (pDirRec->cbDirRec < RT_ OFFSETOF(ISO9660DIRREC, achFileId) + pDirRec->bFileIdLength)1165 if (pDirRec->cbDirRec < RT_UOFFSETOF(ISO9660DIRREC, achFileId) + pDirRec->bFileIdLength) 1166 1166 return rtFsIsoImpError(pThis, VERR_ISOMK_IMPORT_BAD_DIR_REC_LENGTH, 1167 1167 "Dir record size is too small: %#x (min %#x)", 1168 pDirRec->cbDirRec, RT_ OFFSETOF(ISO9660DIRREC, achFileId) + pDirRec->bFileIdLength);1168 pDirRec->cbDirRec, RT_UOFFSETOF(ISO9660DIRREC, achFileId) + pDirRec->bFileIdLength); 1169 1169 if (pDirRec->cbDirRec > cbMax) 1170 1170 return rtFsIsoImpError(pThis, VERR_ISOMK_IMPORT_BAD_DIR_REC_LENGTH, … … 1830 1830 ISO9660_GET_ENDIAN(&pDirRec->offExtent), pThis->cBlocksInPrimaryVolumeSpace); 1831 1831 1832 if (pDirRec->cbDirRec < RT_ OFFSETOF(ISO9660DIRREC, achFileId))1832 if (pDirRec->cbDirRec < RT_UOFFSETOF(ISO9660DIRREC, achFileId)) 1833 1833 return rtFsIsoImpError(pThis, VERR_ISOMK_IMPORT_BAD_ROOT_DIR_REC_LENGTH, 1834 1834 "Root dir record size is too small: %#x (min %#x)", 1835 pDirRec->cbDirRec, RT_ OFFSETOF(ISO9660DIRREC, achFileId));1835 pDirRec->cbDirRec, RT_UOFFSETOF(ISO9660DIRREC, achFileId)); 1836 1836 1837 1837 if (!(pDirRec->fFileFlags & ISO9660_FILE_FLAGS_DIRECTORY)) -
trunk/src/VBox/Runtime/common/fs/isovfs.cpp
r69977 r73097 1229 1229 * Basic sanity checking of what we use. 1230 1230 */ 1231 if ( RT_ OFFSETOF(UDFFILEENTRY, abExtAttribs) + pFileEntry->cbExtAttribs + pFileEntry->cbAllocDescs1231 if ( RT_UOFFSETOF(UDFFILEENTRY, abExtAttribs) + pFileEntry->cbExtAttribs + pFileEntry->cbAllocDescs 1232 1232 > pVol->Udf.VolInfo.cbBlock 1233 1233 || (pFileEntry->cbExtAttribs & 3) != 0 … … 1275 1275 idxDefaultPart, 1276 1276 ((uint64_t)pFileEntry->Tag.offTag << pVol->Udf.VolInfo.cShiftBlock) 1277 + RT_ OFFSETOF(UDFFILEENTRY, abExtAttribs) + pFileEntry->cbExtAttribs,1277 + RT_UOFFSETOF(UDFFILEENTRY, abExtAttribs) + pFileEntry->cbExtAttribs, 1278 1278 pVol); 1279 1279 if (RT_SUCCESS(rc)) … … 1381 1381 * Basic sanity checking of what we use. 1382 1382 */ 1383 if ( RT_ OFFSETOF(UDFFILEENTRY, abExtAttribs) + pFileEntry->cbExtAttribs + pFileEntry->cbAllocDescs1383 if ( RT_UOFFSETOF(UDFFILEENTRY, abExtAttribs) + pFileEntry->cbExtAttribs + pFileEntry->cbAllocDescs 1384 1384 > pVol->Udf.VolInfo.cbBlock 1385 1385 || (pFileEntry->cbExtAttribs & 3) != 0 … … 1431 1431 idxDefaultPart, 1432 1432 ((uint64_t)pFileEntry->Tag.offTag << pVol->Udf.VolInfo.cShiftBlock) 1433 + RT_ OFFSETOF(UDFFILEENTRY, abExtAttribs) + pFileEntry->cbExtAttribs,1433 + RT_UOFFSETOF(UDFFILEENTRY, abExtAttribs) + pFileEntry->cbExtAttribs, 1434 1434 pVol); 1435 1435 if (RT_SUCCESS(rc)) … … 2153 2153 { /* ObjSet */ 2154 2154 RTVFSOBJSETOPS_VERSION, 2155 RT_ OFFSETOF(RTVFSFILEOPS, Stream.Obj) - RT_OFFSETOF(RTVFSFILEOPS, ObjSet),2155 RT_UOFFSETOF(RTVFSFILEOPS, ObjSet) - RT_UOFFSETOF(RTVFSFILEOPS, Stream.Obj), 2156 2156 NULL /*SetMode*/, 2157 2157 NULL /*SetTimes*/, … … 3430 3430 { /* ObjSet */ 3431 3431 RTVFSOBJSETOPS_VERSION, 3432 RT_ OFFSETOF(RTVFSDIROPS, Obj) - RT_OFFSETOF(RTVFSDIROPS, ObjSet),3432 RT_UOFFSETOF(RTVFSDIROPS, ObjSet) - RT_UOFFSETOF(RTVFSDIROPS, Obj), 3433 3433 NULL /*SetMode*/, 3434 3434 NULL /*SetTimes*/, … … 3549 3549 wszName)); 3550 3550 3551 uint32_t offSysUse = RT_OFFSETOF(ISO9660DIRREC, achFileId[pDirRec->bFileIdLength]) + !(pDirRec->bFileIdLength & 1); 3551 uint32_t offSysUse = RT_UOFFSETOF_DYN(ISO9660DIRREC, achFileId[pDirRec->bFileIdLength]) 3552 + !(pDirRec->bFileIdLength & 1); 3552 3553 if (offSysUse < pDirRec->cbDirRec) 3553 3554 { … … 3631 3632 { 3632 3633 uint32_t offDesc = 0; 3633 while (offDesc + RT_ OFFSETOF(UDFFILEIDDESC, abImplementationUse) < pThis->cbDir)3634 while (offDesc + RT_UOFFSETOF(UDFFILEIDDESC, abImplementationUse) < pThis->cbDir) 3634 3635 { 3635 3636 PCUDFFILEIDDESC pFid = (PCUDFFILEIDDESC)&pThis->pbDir[offDesc]; … … 5368 5369 Log2(("ISO9660: RootDir.RecTime.bFileIdLength: %RX8\n", pVolDesc->RootDir.DirRec.bFileIdLength)); 5369 5370 Log2(("ISO9660: RootDir.RecTime.achFileId: '%.*s'\n", pVolDesc->RootDir.DirRec.bFileIdLength, pVolDesc->RootDir.DirRec.achFileId)); 5370 uint32_t offSysUse = RT_ OFFSETOF(ISO9660DIRREC, achFileId[pVolDesc->RootDir.DirRec.bFileIdLength])5371 uint32_t offSysUse = RT_UOFFSETOF_DYN(ISO9660DIRREC, achFileId[pVolDesc->RootDir.DirRec.bFileIdLength]) 5371 5372 + !(pVolDesc->RootDir.DirRec.bFileIdLength & 1); 5372 5373 if (offSysUse < pVolDesc->RootDir.DirRec.cbDirRec) … … 5392 5393 PISO9660DIRREC pDstRootDir, PRTERRINFO pErrInfo) 5393 5394 { 5394 if (pRootDir->cbDirRec < RT_ OFFSETOF(ISO9660DIRREC, achFileId))5395 if (pRootDir->cbDirRec < RT_UOFFSETOF(ISO9660DIRREC, achFileId)) 5395 5396 return RTERRINFO_LOG_SET_F(pErrInfo, VERR_VFS_BOGUS_FORMAT, "Root dir record size is too small: %#x (min %#x)", 5396 pRootDir->cbDirRec, RT_ OFFSETOF(ISO9660DIRREC, achFileId));5397 pRootDir->cbDirRec, RT_UOFFSETOF(ISO9660DIRREC, achFileId)); 5397 5398 5398 5399 if (!(pRootDir->fFileFlags & ISO9660_FILE_FLAGS_DIRECTORY)) … … 5494 5495 * ... and the root directory record. 5495 5496 */ 5496 *poffRootDirRec = offVolDesc + RT_ OFFSETOF(ISO9660PRIMARYVOLDESC, RootDir.DirRec);5497 *poffRootDirRec = offVolDesc + RT_UOFFSETOF(ISO9660PRIMARYVOLDESC, RootDir.DirRec); 5497 5498 return rtFsIsoVolHandleRootDir(pThis, &pVolDesc->RootDir.DirRec, pRootDir, pErrInfo); 5498 5499 } … … 5571 5572 if (RT_SUCCESS(rc)) 5572 5573 { 5573 *poffRootDirRec = offVolDesc + RT_ OFFSETOF(ISO9660SUPVOLDESC, RootDir.DirRec);5574 *poffRootDirRec = offVolDesc + RT_UOFFSETOF(ISO9660SUPVOLDESC, RootDir.DirRec); 5574 5575 *pbUcs2Level = pVolDesc->abEscapeSequences[2] == ISO9660_JOLIET_ESC_SEQ_2_LEVEL_1 ? 1 5575 5576 : pVolDesc->abEscapeSequences[2] == ISO9660_JOLIET_ESC_SEQ_2_LEVEL_2 ? 2 : 3; -
trunk/src/VBox/Runtime/common/fs/ntfsvfs.cpp
r72585 r73097 764 764 Log2(("NTFS: cwcFilename %#x\n", pInfo->cwcFilename)); 765 765 Log2(("NTFS: fFilenameType %#x\n", pInfo->fFilenameType)); 766 if (RT_UOFFSETOF (NTFSATFILENAME, wszFilename[pInfo->cwcFilename]) <= cbValue)766 if (RT_UOFFSETOF_DYN(NTFSATFILENAME, wszFilename[pInfo->cwcFilename]) <= cbValue) 767 767 Log2(("NTFS: wszFilename '%.*ls'\n", pInfo->cwcFilename, pInfo->wszFilename )); 768 768 else … … 770 770 } 771 771 else 772 Log2(("NTFS: Error! cbValue=%#x is smaller than expected (%# x) for NTFSATFILENAME!\n",773 cbValue, RT_ OFFSETOF(NTFSATFILENAME, wszFilename) ));772 Log2(("NTFS: Error! cbValue=%#x is smaller than expected (%#zx) for NTFSATFILENAME!\n", 773 cbValue, RT_UOFFSETOF(NTFSATFILENAME, wszFilename) )); 774 774 break; 775 775 } … … 2138 2138 if ( pFilename 2139 2139 && pFilename->cwcFilename >= 4 2140 && RT_UOFFSETOF (NTFSATFILENAME, wszFilename[pFilename->cwcFilename]) <= cbFilename)2140 && RT_UOFFSETOF_DYN(NTFSATFILENAME, wszFilename[pFilename->cwcFilename]) <= cbFilename) 2141 2141 { 2142 2142 PCRTUTF16 pwcExt = &pFilename->wszFilename[pFilename->cwcFilename - 4]; … … 2618 2618 { /* ObjSet */ 2619 2619 RTVFSOBJSETOPS_VERSION, 2620 RT_ OFFSETOF(RTVFSFILEOPS, Stream.Obj) - RT_OFFSETOF(RTVFSFILEOPS, ObjSet),2620 RT_UOFFSETOF(RTVFSFILEOPS, ObjSet) - RT_UOFFSETOF(RTVFSFILEOPS, Stream.Obj), 2621 2621 rtFsNtfsFile_SetMode, 2622 2622 rtFsNtfsFile_SetTimes, … … 2820 2820 Log2(("NTFS: cwcFilename %#x\n", pFilename->cwcFilename)); 2821 2821 Log2(("NTFS: fFilenameType %#x\n", pFilename->fFilenameType)); 2822 if (RT_UOFFSETOF (NTFSATFILENAME, wszFilename[pFilename->cwcFilename]) <= RT_LE2H_U16(pEntryHdr->cbKey))2822 if (RT_UOFFSETOF_DYN(NTFSATFILENAME, wszFilename[pFilename->cwcFilename]) <= RT_LE2H_U16(pEntryHdr->cbKey)) 2823 2823 Log2(("NTFS: wszFilename '%.*ls'\n", pFilename->cwcFilename, pFilename->wszFilename )); 2824 2824 else … … 2980 2980 { 2981 2981 PCNTFSATFILENAME pFilename = (PCNTFSATFILENAME)(pEntryHdr + 1); 2982 if (RT_UOFFSETOF (NTFSATFILENAME, wszFilename[pFilename->cwcFilename]) > cbKey)2982 if (RT_UOFFSETOF_DYN(NTFSATFILENAME, wszFilename[pFilename->cwcFilename]) > cbKey) 2983 2983 return RTERRINFO_LOG_REL_SET_F(pErrInfo, VERR_VFS_BOGUS_FORMAT, 2984 2984 "%s: Entry #%u filename is out of bounds: cwcFilename=%#x -> %#x key, max %#x", 2985 2985 pszWhat, iEntry, pFilename->cwcFilename, 2986 RT_UOFFSETOF (NTFSATFILENAME, wszFilename[pFilename->cwcFilename]), cbKey);2986 RT_UOFFSETOF_DYN(NTFSATFILENAME, wszFilename[pFilename->cwcFilename]), cbKey); 2987 2987 } 2988 2988 … … 4163 4163 { 4164 4164 4165 *pcbDirEntry = RT_UOFFSETOF (RTDIRENTRYEX, szName[pThis->paEnumStack[0].iNext + 2]);4165 *pcbDirEntry = RT_UOFFSETOF_DYN(RTDIRENTRYEX, szName[pThis->paEnumStack[0].iNext + 2]); 4166 4166 if (*pcbDirEntry > cbDirEntry) 4167 4167 return VERR_BUFFER_OVERFLOW; … … 4255 4255 rc, pFilename->cwcFilename * sizeof(RTUTF16), pFilename->wszFilename)); 4256 4256 } 4257 *pcbDirEntry = RT_UOFFSETOF (RTDIRENTRYEX, szName[cchFilename + 1]);4257 *pcbDirEntry = RT_UOFFSETOF_DYN(RTDIRENTRYEX, szName[cchFilename + 1]); 4258 4258 if (*pcbDirEntry > cbDirEntry) 4259 4259 { … … 4403 4403 { /* ObjSet */ 4404 4404 RTVFSOBJSETOPS_VERSION, 4405 RT_ OFFSETOF(RTVFSDIROPS, Obj) - RT_OFFSETOF(RTVFSDIROPS, ObjSet),4405 RT_UOFFSETOF(RTVFSDIROPS, ObjSet) - RT_UOFFSETOF(RTVFSDIROPS, Obj), 4406 4406 rtFsNtfsDir_SetMode, 4407 4407 rtFsNtfsDir_SetTimes,
Note:
See TracChangeset
for help on using the changeset viewer.