Changeset 73097 in vbox for trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Timestamp:
- Jul 12, 2018 9:06:33 PM (7 years ago)
- Location:
- trunk/src/VBox/HostServices/SharedOpenGL/crserverlib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/presenter/server_presenter.cpp
r71607 r73097 29 29 //#define CR_SERVER_WITH_CLIENT_CALLOUTS 30 30 31 #define PCR_FBTEX_FROM_TEX(_pTex) ((CR_FBTEX*)((uint8_t*)(_pTex) - RT_ OFFSETOF(CR_FBTEX, Tex)))32 #define PCR_FRAMEBUFFER_FROM_COMPOSITOR(_pCompositor) ((CR_FRAMEBUFFER*)((uint8_t*)(_pCompositor) - RT_ OFFSETOF(CR_FRAMEBUFFER, Compositor)))33 #define PCR_FBENTRY_FROM_ENTRY(_pEntry) ((CR_FRAMEBUFFER_ENTRY*)((uint8_t*)(_pEntry) - RT_ OFFSETOF(CR_FRAMEBUFFER_ENTRY, Entry)))31 #define PCR_FBTEX_FROM_TEX(_pTex) ((CR_FBTEX*)((uint8_t*)(_pTex) - RT_UOFFSETOF(CR_FBTEX, Tex))) 32 #define PCR_FRAMEBUFFER_FROM_COMPOSITOR(_pCompositor) ((CR_FRAMEBUFFER*)((uint8_t*)(_pCompositor) - RT_UOFFSETOF(CR_FRAMEBUFFER, Compositor))) 33 #define PCR_FBENTRY_FROM_ENTRY(_pEntry) ((CR_FRAMEBUFFER_ENTRY*)((uint8_t*)(_pEntry) - RT_UOFFSETOF(CR_FRAMEBUFFER_ENTRY, Entry))) 34 34 35 35 … … 3389 3389 uint32_t cRects; 3390 3390 const VBOXCMDVBVA_RECT *pPRects = pCmd->aRects; 3391 if ((cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_BLT_PRIMARY, aRects)) % sizeof (VBOXCMDVBVA_RECT))3391 if ((cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_BLT_PRIMARY, aRects)) % sizeof (VBOXCMDVBVA_RECT)) 3392 3392 { 3393 3393 WARN(("invalid argument size")); … … 3395 3395 } 3396 3396 3397 cRects = (cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_BLT_PRIMARY, aRects)) / sizeof (VBOXCMDVBVA_RECT);3397 cRects = (cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_BLT_PRIMARY, aRects)) / sizeof (VBOXCMDVBVA_RECT); 3398 3398 3399 3399 RTRECT *pRects = crVBoxServerCrCmdBltRecsUnpack(pPRects, cRects); … … 3650 3650 uint32_t cRects; 3651 3651 const VBOXCMDVBVA_RECT *pPRects = pCmd->aRects; 3652 if ((cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID, aRects)) % sizeof (VBOXCMDVBVA_RECT))3652 if ((cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID, aRects)) % sizeof (VBOXCMDVBVA_RECT)) 3653 3653 { 3654 3654 WARN(("invalid argument size")); … … 3656 3656 } 3657 3657 3658 cRects = (cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID, aRects)) / sizeof (VBOXCMDVBVA_RECT);3658 cRects = (cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_BLT_OFFPRIMSZFMT_OR_ID, aRects)) / sizeof (VBOXCMDVBVA_RECT); 3659 3659 3660 3660 RTRECT *pRects = crVBoxServerCrCmdBltRecsUnpack(pPRects, cRects); … … 3698 3698 uint32_t cRects; 3699 3699 const VBOXCMDVBVA_RECT *pPRects = pCmd->aRects; 3700 if ((cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_BLT_SAMEDIM_A8R8G8B8, aRects)) % sizeof (VBOXCMDVBVA_RECT))3700 if ((cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_BLT_SAMEDIM_A8R8G8B8, aRects)) % sizeof (VBOXCMDVBVA_RECT)) 3701 3701 { 3702 3702 WARN(("invalid argument size")); … … 3704 3704 } 3705 3705 3706 cRects = (cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_BLT_SAMEDIM_A8R8G8B8, aRects)) / sizeof (VBOXCMDVBVA_RECT);3706 cRects = (cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_BLT_SAMEDIM_A8R8G8B8, aRects)) / sizeof (VBOXCMDVBVA_RECT); 3707 3707 3708 3708 RTRECT *pRects = crVBoxServerCrCmdBltRecsUnpack(pPRects, cRects); … … 3767 3767 uint32_t cRects; 3768 3768 const VBOXCMDVBVA_RECT *pPRects = pCmd->aRects; 3769 if ((cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, aRects)) % sizeof (VBOXCMDVBVA_RECT))3769 if ((cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, aRects)) % sizeof (VBOXCMDVBVA_RECT)) 3770 3770 { 3771 3771 WARN(("invalid argument size")); … … 3773 3773 } 3774 3774 3775 cRects = (cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, aRects)) / sizeof (VBOXCMDVBVA_RECT);3775 cRects = (cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_BLT_GENERIC_A8R8G8B8, aRects)) / sizeof (VBOXCMDVBVA_RECT); 3776 3776 3777 3777 RTRECT *pRects = crVBoxServerCrCmdBltRecsUnpack(pPRects, cRects); … … 3862 3862 uint32_t cRects; 3863 3863 const VBOXCMDVBVA_RECT *pPRects = pCmd->aRects; 3864 if ((cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8, aRects)) % sizeof (VBOXCMDVBVA_RECT))3864 if ((cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8, aRects)) % sizeof (VBOXCMDVBVA_RECT)) 3865 3865 { 3866 3866 WARN(("invalid argument size")); … … 3868 3868 } 3869 3869 3870 cRects = (cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8, aRects)) / sizeof (VBOXCMDVBVA_RECT);3870 cRects = (cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_CLRFILL_GENERIC_A8R8G8B8, aRects)) / sizeof (VBOXCMDVBVA_RECT); 3871 3871 3872 3872 RTRECT *pRects = crVBoxServerCrCmdBltRecsUnpack(pPRects, cRects); -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_main.c
r71680 r73097 935 935 CRASSERT(rc == VINF_SUCCESS); 936 936 937 rc = SSMR3PutMem(pSSM, pMI, RT_ OFFSETOF(CRMuralInfo, CreateInfo));937 rc = SSMR3PutMem(pSSM, pMI, RT_UOFFSETOF(CRMuralInfo, CreateInfo)); 938 938 CRASSERT(rc == VINF_SUCCESS); 939 939 … … 1387 1387 } Data; 1388 1388 1389 Assert(sizeof (Data) >= RT_ OFFSETOF(CRFBData, aElements[4]));1389 Assert(sizeof (Data) >= RT_UOFFSETOF(CRFBData, aElements[4])); 1390 1390 1391 1391 pCtxInfo = cr_server.currentCtxInfo; … … 1938 1938 rc = crServerLsrDataGetMem(pReader, &key, sizeof(key)); 1939 1939 AssertLogRelRCReturn(rc, rc); 1940 rc = crServerLsrDataGetMem(pReader, &muralInfo, RT_ OFFSETOF(CRMuralInfo, CreateInfo));1940 rc = crServerLsrDataGetMem(pReader, &muralInfo, RT_UOFFSETOF(CRMuralInfo, CreateInfo)); 1941 1941 AssertLogRelRCReturn(rc, rc); 1942 1942 … … 1952 1952 CR_SERVER_BUGGY_MURAL_DATA Data; 1953 1953 /* need to chak spuWindow, so taking the offset of filed following it*/ 1954 uint8_t au8[RT_ OFFSETOF(CRMuralInfo, screenId)];1954 uint8_t au8[RT_UOFFSETOF(CRMuralInfo, screenId)]; 1955 1955 RTRECT aVisRects[sizeof (CR_SERVER_BUGGY_MURAL_DATA) / sizeof (RTRECT)]; 1956 1956 } LaBuf; … … 2091 2091 } Data; 2092 2092 2093 Assert(sizeof (Data) >= RT_ OFFSETOF(CRFBData, aElements[4]));2093 Assert(sizeof (Data) >= RT_UOFFSETOF(CRFBData, aElements[4])); 2094 2094 2095 2095 if (version >= SHCROGL_SSM_VERSION_WITH_SAVED_DEPTH_STENCIL_BUFFER) … … 2177 2177 if (Data.data.cElements) 2178 2178 { 2179 CRFBData *pLazyData = crAlloc(RT_ OFFSETOF(CRFBData, aElements[Data.data.cElements]));2179 CRFBData *pLazyData = crAlloc(RT_UOFFSETOF_DYN(CRFBData, aElements[Data.data.cElements])); 2180 2180 if (!RT_SUCCESS(rc)) 2181 2181 { … … 2185 2185 } 2186 2186 2187 crMemcpy(pLazyData, &Data.data, RT_ OFFSETOF(CRFBData, aElements[Data.data.cElements]));2187 crMemcpy(pLazyData, &Data.data, RT_UOFFSETOF_DYN(CRFBData, aElements[Data.data.cElements])); 2188 2188 pBuf->pFrontImg = pLazyData; 2189 2189 } … … 2902 2902 cParams = cBuffers-1; 2903 2903 2904 if (cbCmd < RT_ OFFSETOF(VBOXCMDVBVA_CRCMD_CMD, aBuffers[cBuffers]))2904 if (cbCmd < RT_UOFFSETOF_DYN(VBOXCMDVBVA_CRCMD_CMD, aBuffers[cBuffers])) 2905 2905 { 2906 2906 WARN(("invalid buffer size")); … … 3325 3325 VBOXCMDVBVA_3DCTL_CMD RT_UNTRUSTED_VOLATILE_GUEST *p3DCmd 3326 3326 = (VBOXCMDVBVA_3DCTL_CMD RT_UNTRUSTED_VOLATILE_GUEST *)pbCmd; 3327 return crVBoxCrCmdCmd(NULL, &p3DCmd->Cmd, cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_3DCTL_CMD, Cmd));3327 return crVBoxCrCmdCmd(NULL, &p3DCmd->Cmd, cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_3DCTL_CMD, Cmd)); 3328 3328 } 3329 3329 … … 3543 3543 = (VBOXCMDVBVA_CRCMD const RT_UNTRUSTED_VOLATILE_GUEST *)pCmd; 3544 3544 VBOXCMDVBVA_CRCMD_CMD const RT_UNTRUSTED_VOLATILE_GUEST *pCrCmd = &pCrCmdDr->Cmd; 3545 int rc = crVBoxServerCmdVbvaCrCmdProcess(pCrCmd, cbCmd - RT_ OFFSETOF(VBOXCMDVBVA_CRCMD, Cmd));3545 int rc = crVBoxServerCmdVbvaCrCmdProcess(pCrCmd, cbCmd - RT_UOFFSETOF(VBOXCMDVBVA_CRCMD, Cmd)); 3546 3546 ASSERT_GUEST_LOGREL_RC_RETURN(rc, -1); 3547 3547 return 0; -
trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_stream.c
r71468 r73097 433 433 } 434 434 435 pMsg = (CR_SERVER_PENDING_MSG*)RTMemAlloc(cbMsg + RT_ OFFSETOF(CR_SERVER_PENDING_MSG, Msg));435 pMsg = (CR_SERVER_PENDING_MSG*)RTMemAlloc(cbMsg + RT_UOFFSETOF(CR_SERVER_PENDING_MSG, Msg)); 436 436 if (!pMsg) 437 437 { … … 524 524 break; 525 525 526 pMsg = (CR_SERVER_PENDING_MSG*)RTMemAlloc(u32 + RT_ OFFSETOF(CR_SERVER_PENDING_MSG, Msg));526 pMsg = (CR_SERVER_PENDING_MSG*)RTMemAlloc(u32 + RT_UOFFSETOF(CR_SERVER_PENDING_MSG, Msg)); 527 527 if (!pMsg) 528 528 {
Note:
See TracChangeset
for help on using the changeset viewer.