Changeset 37174 in vbox for trunk/src/VBox/Additions
- Timestamp:
- May 21, 2011 8:49:15 PM (14 years ago)
- Location:
- trunk/src/VBox/Additions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibSeamless.cpp
r31384 r37174 137 137 * to copy our rectangle and header data into a single structure and perform an 138 138 * additional allocation. 139 * @todo Would that really gain us much, given that the rectangles may not 140 * be grouped at all, or in the format we need? Keeping the memory 141 * for our "single structure" around (re-alloc-ing it if necessary) 142 * sounds like a simpler optimisation if we need it. 139 143 */ 140 144 VBGLR3DECL(int) VbglR3SeamlessSendRects(uint32_t cRects, PRTRECT pRects) … … 143 147 int rc; 144 148 145 if (!cRects || !pRects) 146 return VINF_SUCCESS; 149 AssertReturn(pRects || (cRects == 0), VERR_INVALID_PARAMETER); 147 150 rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, 148 sizeof(VMMDevVideoSetVisibleRegion) + (cRects - 1) * sizeof(RTRECT), 151 sizeof(VMMDevVideoSetVisibleRegion) 152 + cRects * sizeof(RTRECT) - sizeof(RTRECT), 149 153 VMMDevReq_VideoSetVisibleRegion); 150 154 if (RT_SUCCESS(rc)) 151 155 { 152 156 pReq->cRect = cRects; 153 memcpy(&pReq->Rect, pRects, cRects * sizeof(RTRECT)); 157 if (cRects) 158 memcpy(&pReq->Rect, pRects, cRects * sizeof(RTRECT)); 159 /* This will fail harmlessly for cRect == 0 and older host code */ 154 160 rc = vbglR3GRPerform(&pReq->header); 161 LogFunc(("Visible region request returned %Rrc, internal %Rrc.\n", 162 rc, pReq->header.rc)); 155 163 if (RT_SUCCESS(rc)) 156 164 rc = pReq->header.rc; 157 165 vbglR3GRFree(&pReq->header); 158 166 } 167 LogFunc(("Sending %u rectangles to the host: %Rrc\n", cRects, rc)); 159 168 return rc; 160 169 } -
trunk/src/VBox/Additions/x11/VBoxClient/seamless-host.cpp
r36806 r37174 137 137 { 138 138 LogRelFlowFunc(("\n")); 139 if ( !pRects) /* Assertion */139 if (cRects && !pRects) /* Assertion */ 140 140 { 141 141 LogRelThisFunc(("ERROR: called with null pointer!\n"));
Note:
See TracChangeset
for help on using the changeset viewer.