VirtualBox

Changeset 6510 in vbox


Ignore:
Timestamp:
Jan 25, 2008 10:56:25 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27519
Message:

Changed VbglR3SetPointerShape to accept the full request size.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/VBoxGuest.h

    r6507 r6510  
    14221422VBGLR3DECL(int)     VbglR3VideoAccelEnable(bool fEnable);
    14231423VBGLR3DECL(int)     VbglR3VideoAccelFlush(void);
    1424 VBGLR3DECL(int)     VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbImg);
     1424VBGLR3DECL(int)     VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbReq);
    14251425/** @}  */
    14261426
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r6507 r6510  
    6868 * @param   cy          Pointer height.
    6969 * @param   pvImg       Pointer to the image data (can be NULL).
    70  * @param   cbImg       The size of the image data not including the pre-allocated area.
    71  *                      This should be the size of the image data exceeding the size of
    72  *                      the VMMDevReqMousePointer structure.
     70 * @param   cbReq       The complete size of the request.
    7371 */
    74 VBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbImg)
     72VBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbReq)
    7573{
    7674    VMMDevReqMousePointer *pReq;
    77     int rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, sizeof(VMMDevReqMousePointer) + cbImg, VMMDevReq_SetPointerShape);
     75    int rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, cbReq, VMMDevReq_SetPointerShape);
    7876    if (RT_SUCCESS(rc))
    7977    {
     
    8482        pReq->height = cy;
    8583        if (pvImg)
    86             memcpy(pReq->pointerData, pvImg, sizeof(pReq->pointerData) + cbImg);
     84            memcpy(pReq->pointerData, pvImg, cbReq - sizeof(VMMDevReqMousePointer) + sizeof(pReq->pointerData));
    8785
    8886        rc = vbglR3GRPerform(&pReq->header);
  • trunk/src/VBox/Additions/x11/xgraphics/vboxutils-new.c

    r6508 r6510  
    366366    rc = VbglR3SetPointerShape(0, pVBox->reqp->xHot, pVBox->reqp->yHot, pVBox->reqp->width,
    367367                               pVBox->reqp->height, pVBox->reqp->pointerData,
    368                                pVBox->reqp->header.size - pVBox->set_pointer_shape_size);
     368                               pVBox->reqp->header.size);
    369369    if (RT_FAILURE(rc))
    370370        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not hide the virtual mouse pointer.\n");
     
    378378    rc = VbglR3SetPointerShape(VBOX_MOUSE_POINTER_VISIBLE, pVBox->reqp->xHot, pVBox->reqp->yHot,
    379379                               pVBox->reqp->width, pVBox->reqp->height, pVBox->reqp->pointerData,
    380                                pVBox->reqp->header.size - pVBox->set_pointer_shape_size);
     380                               pVBox->reqp->header.size);
    381381    if (RT_FAILURE(rc))
    382382        xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Could not unhide the virtual mouse pointer.\n");
     
    397397
    398398    rc = VbglR3SetPointerShape(reqp->fFlags, reqp->xHot, reqp->yHot, reqp->width, reqp->height,
    399                                reqp->pointerData, reqp->header.size - pVBox->set_pointer_shape_size);
     399                               reqp->pointerData, reqp->header.size);
    400400    if (RT_FAILURE(rc))
    401401        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,  "Unable to set the virtual mouse pointer image.\n");
     
    708708
    709709    VbglR3SetPointerShape(VBOX_MOUSE_POINTER_SHAPE | VBOX_MOUSE_POINTER_ALPHA, bitsp->xhot, bitsp->yhot, w, h,
    710                           pm, reqp->header.size - pVBox->set_pointer_shape_size);
     710                          pm, reqp->header.size);
    711711    xfree(p);
    712712}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette