Changeset 73097 in vbox for trunk/src/VBox/Additions/common/VBoxGuest/lib
- Timestamp:
- Jul 12, 2018 9:06:33 PM (7 years ago)
- Location:
- trunk/src/VBox/Additions/common/VBoxGuest/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibHGCMInternal.cpp
r72627 r73097 235 235 pPgLst = (HGCMPageListInfo *)((uint8_t *)pCallInfo + off); 236 236 cPages = pPgLst->cPages; 237 u32 = RT_ OFFSETOF(HGCMPageListInfo, aPages[cPages]) + off;237 u32 = RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages[cPages]) + off; 238 238 AssertMsgReturn(u32 <= cbCallInfo, 239 239 ("u32=%#x (cPages=%#x offset=%#x) cbCallInfo=%#x\n", u32, cPages, off, cbCallInfo), … … 254 254 } 255 255 256 *pcbExtra += RT_ OFFSETOF(HGCMPageListInfo, aPages[pPgLst->cPages]);256 *pcbExtra += RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages[pPgLst->cPages]); 257 257 } 258 258 else … … 407 407 { 408 408 size_t const cPages = RTR0MemObjSize(hObj) >> PAGE_SHIFT; 409 *pcbExtra += RT_ OFFSETOF(HGCMPageListInfo, aPages[cPages]);409 *pcbExtra += RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages[cPages]); 410 410 } 411 411 } … … 541 541 pDstPgLst->aPages[iPage] = pSrcPgLst->aPages[iPage]; 542 542 543 offExtra += RT_ OFFSETOF(HGCMPageListInfo, aPages[cPages]);543 offExtra += RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages[cPages]); 544 544 } 545 545 else … … 592 592 } 593 593 594 offExtra += RT_ OFFSETOF(HGCMPageListInfo, aPages[cPages]);594 offExtra += RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages[cPages]); 595 595 } 596 596 else -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR0LibSharedFolders.c
r72627 r73097 325 325 { 326 326 uint32_t cbToRead = *pcbBuffer; 327 uint32_t cbData = (uint32_t)(sizeof(VBoxSFRead) + RT_UOFFSETOF (HGCMPageListInfo, aPages[cPages]));327 uint32_t cbData = (uint32_t)(sizeof(VBoxSFRead) + RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages[cPages])); 328 328 VBoxSFRead *pData = (VBoxSFRead *)RTMemTmpAlloc(cbData); 329 329 HGCMPageListInfo *pPgLst = (HGCMPageListInfo *)(pData + 1); … … 403 403 uint32_t cbToWrite = *pcbBuffer; 404 404 uint32_t cPages = RT_ALIGN_32((PhysBuffer & PAGE_OFFSET_MASK) + cbToWrite, PAGE_SIZE) >> PAGE_SHIFT; 405 uint32_t cbData = (uint32_t)(sizeof(VBoxSFWrite) + RT_UOFFSETOF (HGCMPageListInfo, aPages[cPages]));405 uint32_t cbData = (uint32_t)(sizeof(VBoxSFWrite) + RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages[cPages])); 406 406 VBoxSFWrite *pData = (VBoxSFWrite *)RTMemTmpAlloc(cbData); 407 407 HGCMPageListInfo *pPgLst = (HGCMPageListInfo *)(pData + 1); … … 451 451 { 452 452 uint32_t cbToWrite = *pcbBuffer; 453 uint32_t cbData = (uint32_t)(sizeof(VBoxSFWrite) + RT_UOFFSETOF (HGCMPageListInfo, aPages[cPages]));453 uint32_t cbData = (uint32_t)(sizeof(VBoxSFWrite) + RT_UOFFSETOF_DYN(HGCMPageListInfo, aPages[cPages])); 454 454 VBoxSFWrite *pData = (VBoxSFWrite *)RTMemTmpAlloc(cbData); 455 455 HGCMPageListInfo *pPgLst = (HGCMPageListInfo *)(pData + 1); -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibGuestUser.cpp
r69500 r73097 87 87 * without altering this code. Don't try this at home. 88 88 */ 89 uint32_t cbOffDynamic = RT_ OFFSETOF(VBoxGuestUserStatus, szUser);89 uint32_t cbOffDynamic = RT_UOFFSETOF(VBoxGuestUserStatus, szUser); 90 90 91 91 /* pDynamic marks the beginning for the dynamically allocated areas. */ -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibModule.cpp
r69500 r73097 54 54 AssertReturn(cRegions < VMMDEVSHAREDREGIONDESC_MAX, VERR_INVALID_PARAMETER); 55 55 56 pReq = (VMMDevSharedModuleRegistrationRequest *)RTMemAllocZ(RT_OFFSETOF(VMMDevSharedModuleRegistrationRequest, aRegions[cRegions])); 56 pReq = (VMMDevSharedModuleRegistrationRequest *)RTMemAllocZ(RT_UOFFSETOF_DYN(VMMDevSharedModuleRegistrationRequest, 57 aRegions[cRegions])); 57 58 AssertReturn(pReq, VERR_NO_MEMORY); 58 59 59 60 vmmdevInitRequest(&pReq->header, VMMDevReq_RegisterSharedModule); 60 pReq->header.size = RT_ OFFSETOF(VMMDevSharedModuleRegistrationRequest, aRegions[cRegions]);61 pReq->header.size = RT_UOFFSETOF_DYN(VMMDevSharedModuleRegistrationRequest, aRegions[cRegions]); 61 62 pReq->GCBaseAddr = GCBaseAddr; 62 63 pReq->cbModule = cbModule; -
trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibVideo.cpp
r72354 r73097 102 102 size_t cbReq = vmmdevGetMousePointerReqSize(cx, cy); 103 103 AssertReturn( !pvImg 104 || cbReq == RT_ OFFSETOF(VMMDevReqMousePointer, pointerData) + cbImg,104 || cbReq == RT_UOFFSETOF(VMMDevReqMousePointer, pointerData) + cbImg, 105 105 VERR_INVALID_PARAMETER); 106 106 int rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, cbReq, VMMDevReq_SetPointerShape);
Note:
See TracChangeset
for help on using the changeset viewer.