VirtualBox

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.

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