VirtualBox

Changeset 6518 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Jan 28, 2008 4:39:32 AM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
27535
Message:

VbglR3SetPointerShape accept image size, and cleanups to vboxutils (x11 video)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibVideo.cpp

    r6510 r6518  
    6868 * @param   cy          Pointer height.
    6969 * @param   pvImg       Pointer to the image data (can be NULL).
    70  * @param   cbReq       The complete size of the request.
     70 * @param   cbImg       Size of the image data pointed to by pvImg.
    7171 */
    72 VBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbReq)
     72VBGLR3DECL(int) VbglR3SetPointerShape(uint32_t fFlags, uint32_t xHot, uint32_t yHot, uint32_t cx, uint32_t cy, const void *pvImg, size_t cbImg)
    7373{
    7474    VMMDevReqMousePointer *pReq;
    75     int rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, cbReq, VMMDevReq_SetPointerShape);
     75    int rc = vbglR3GRAlloc((VMMDevRequestHeader **)&pReq, RT_OFFSETOF(VMMDevReqMousePointer, pointerData) + cbImg, VMMDevReq_SetPointerShape);
    7676    if (RT_SUCCESS(rc))
    7777    {
     
    8282        pReq->height = cy;
    8383        if (pvImg)
    84             memcpy(pReq->pointerData, pvImg, cbReq - sizeof(VMMDevReqMousePointer) + sizeof(pReq->pointerData));
     84            memcpy(pReq->pointerData, pvImg, cbImg);
    8585
    8686        rc = vbglR3GRPerform(&pReq->header);
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