VirtualBox

Ignore:
Timestamp:
Aug 31, 2017 12:09:41 PM (7 years ago)
Author:
vboxsync
Message:

merging vbglioc r117689: Initial VBoxGuest I/O control changes.

File:
1 edited

Legend:

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

    r62521 r68550  
    3030*********************************************************************************************************************************/
    3131#include "VBGLR3Internal.h"
     32#include <iprt/string.h>
    3233
    3334
     
    4142VBGLR3DECL(int) VbglR3MemBalloonRefresh(uint32_t *pcChunks, bool *pfHandleInR3)
    4243{
    43     VBoxGuestCheckBalloonInfo Info;
    44     int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_CHECK_BALLOON, &Info, sizeof(Info));
     44    VBGLIOCCHECKBALLOON Info;
     45    VBGLREQHDR_INIT(&Info.Hdr, CHECK_BALLOON);
     46    int rc = vbglR3DoIOCtl(VBGL_IOCTL_CHECK_BALLOON, &Info.Hdr, sizeof(Info));
    4547    if (RT_SUCCESS(rc))
    4648    {
    47         *pcChunks = Info.cBalloonChunks;
    48         Assert(Info.fHandleInR3 == (uint32_t)false || Info.fHandleInR3 == (uint32_t)true || RT_FAILURE(rc));
    49         *pfHandleInR3 = Info.fHandleInR3 != false;
     49        *pcChunks = Info.u.Out.cBalloonChunks;
     50        *pfHandleInR3 = Info.u.Out.fHandleInR3 != false;
    5051    }
    5152    return rc;
     
    6364VBGLR3DECL(int) VbglR3MemBalloonChange(void *pv, bool fInflate)
    6465{
    65     VBoxGuestChangeBalloonInfo Info;
    66     Info.u64ChunkAddr = (uint64_t)((uintptr_t)pv);
    67     Info.fInflate = fInflate;
    68     return vbglR3DoIOCtl(VBOXGUEST_IOCTL_CHANGE_BALLOON, &Info, sizeof(Info));
     66    VBGLIOCCHANGEBALLOON Info;
     67    VBGLREQHDR_INIT(&Info.Hdr, CHANGE_BALLOON);
     68    Info.u.In.pvChunk  = pv;
     69    Info.u.In.fInflate = fInflate;
     70    RT_ZERO(Info.u.In.abPadding);
     71    return vbglR3DoIOCtl(VBGL_IOCTL_CHANGE_BALLOON, &Info.Hdr, sizeof(Info));
    6972}
    7073
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