VirtualBox

Ignore:
Timestamp:
Mar 5, 2010 12:49:22 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58404
Message:

VBoxGuestR3LibMisc.cpp,VBoxGuestLib.h: minor adjustments.

File:
1 edited

Legend:

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

    r27023 r27080  
    3939#include "VBGLR3Internal.h"
    4040
     41/** @todo Split this file up so we can drop most of the VBOX_VBGLR3_XFREE86
     42 *        #ifdef'ing. */
    4143
    4244/**
     
    4850 * immediately and return those events.
    4951 *
    50  * @returns IPRT status code
     52 * @returns IPRT status code.
    5153 *
    5254 * @param   fMask       The events we want to wait for, or-ed together.
     
    7476    {
    7577#if !defined(VBOX_VBGLR3_XFREE86) && !defined(RT_OS_WINDOWS)
    76         AssertMsg(waitEvent.u32Result == VBOXGUEST_WAITEVENT_OK, ("%d rc=%d\n", waitEvent.u32Result, rc));
     78        AssertMsg(waitEvent.u32Result == VBOXGUEST_WAITEVENT_OK, ("%d rc=%Rrc\n", waitEvent.u32Result, rc));
    7779#endif
    7880        if (pfEvents)
     
    9395 *
    9496 * Can be used in combination with a termination flag variable for interrupting
    95  * event loops. Avoiding race conditions is the responsibility of the caller.
    96  *
    97  * @returns IPRT status code
     97 * event loops.  Avoiding race conditions is the responsibility of the caller.
     98 *
     99 * @returns IPRT status code.
    98100 */
    99101VBGLR3DECL(int) VbglR3InterruptEventWaits(void)
     
    106108 * Write to the backdoor logger from ring 3 guest code.
    107109 *
    108  * @returns IPRT status code
     110 * @returns IPRT status code.
     111 *
     112 * @param   pch     The string to log.  Does not need to be terminated.
     113 * @param   cb      The number of byte to log.
     114 * @todo    cb -> cch.
    109115 *
    110116 * @remarks This currently does not accept more than 255 bytes of data at
     
    161167 * Change the IRQ filter mask.
    162168 *
    163  * @returns IPRT status code
     169 * @returns IPRT status code.
    164170 * @param   fOr     The OR mask.
    165171 * @param   fNo     The NOT mask.
     
    177183 * Report a change in the capabilities that we support to the host.
    178184 *
    179  * @returns IPRT status value
     185 * @returns IPRT status code.
    180186 * @param   fOr     Capabilities which have been added.
    181187 * @param   fNot    Capabilities which have been removed.
     
    200206}
    201207
    202 /**
    203  * Query the current statistics update interval
    204  *
    205  * @returns IPRT status code
    206  * @param   pu32Interval    Update interval in ms (out)
    207  */
    208 VBGLR3DECL(int) VbglR3StatQueryInterval(uint32_t *pu32Interval)
     208#ifndef VBOX_VBGLR3_XFREE86
     209
     210/**
     211 * Query the current statistics update interval.
     212 *
     213 * @returns IPRT status code.
     214 * @param   pcMsInterval    Update interval in ms (out).
     215 */
     216VBGLR3DECL(int) VbglR3StatQueryInterval(PRTMSINTERVAL pcMsInterval)
    209217{
    210218    VMMDevGetStatisticsChangeRequest Req;
     
    212220    vmmdevInitRequest(&Req.header, VMMDevReq_GetStatisticsChangeRequest);
    213221    Req.eventAck = VMMDEV_EVENT_STATISTICS_INTERVAL_CHANGE_REQUEST;
     222    Req.u32StatInterval = 1;
    214223    int rc = vbglR3GRPerform(&Req.header);
    215224    if (RT_SUCCESS(rc))
    216         *pu32Interval = Req.u32StatInterval * 1000;
    217     return rc;
    218 }
    219 
    220 
    221 /**
    222  * Report guest statistics
    223  *
    224  * @returns IPRT status code
    225  * @param   pReq        Request packet with statistics
     225    {
     226        *pcMsInterval = Req.u32StatInterval * 1000;
     227        if (*pcMsInterval / 1000 != Req.u32StatInterval)
     228            *pcMsInterval = ~(RTMSINTERVAL)0;
     229    }
     230    return rc;
     231}
     232
     233
     234/**
     235 * Report guest statistics.
     236 *
     237 * @returns IPRT status code.
     238 * @param   pReq        Request packet with statistics.
    226239 */
    227240VBGLR3DECL(int) VbglR3StatReport(VMMDevReportGuestStats *pReq)
     
    233246
    234247/**
    235  * Refresh the memory balloon after a change
    236  *
    237  * @returns IPRT status code
    238  * @param   pu32Size    Memory balloon size in MBs (out)
    239  * @param   pfHandleInR3 Allocating of memory in R3 required (out)
     248 * Refresh the memory balloon after a change.
     249 *
     250 * @returns IPRT status code.
     251 * @param   pcChunks        The size of the balloon in chunks of 1MB (out).
     252 * @param   pfHandleInR3    Allocating of memory in R3 required (out).
    240253 */
    241254VBGLR3DECL(int) VbglR3MemBalloonRefresh(uint32_t *pcChunks, bool *pfHandleInR3)
     
    243256    VBoxGuestCheckBalloonInfo Info;
    244257    int rc = vbglR3DoIOCtl(VBOXGUEST_IOCTL_CHECK_BALLOON, &Info, sizeof(Info));
    245     *pcChunks = Info.cBalloonChunks;
    246     *pfHandleInR3 = Info.fHandleInR3;
     258    if (RT_SUCCESS(rc))
     259    {
     260        *pcChunks = Info.cBalloonChunks;
     261        Assert(Info.fHandleInR3 == false || Info.fHandleInR3 == true ||  RT_FAILURE(rc));
     262        *pfHandleInR3 = Info.fHandleInR3 != false;
     263    }
    247264    return rc;
    248265}
     
    252269 * Change the memory by granting/reclaiming memory to/from R0.
    253270 *
    254  * @returns IPRT status code
    255  * @param   pv          Memory chunk (1MB)
    256  * @param   fInflate    true = inflate balloon (grant memory)
    257  *                      false = deflate balloon (reclaim memory)
     271 * @returns IPRT status code.
     272 * @param   pv          Memory chunk (1MB).
     273 * @param   fInflate    true = inflate balloon (grant memory).
     274 *                      false = deflate balloon (reclaim memory).
    258275 */
    259276VBGLR3DECL(int) VbglR3MemBalloonChange(void *pv, bool fInflate)
     
    266283
    267284
    268 #ifndef VBOX_VBGLR3_XFREE86
    269285/**
    270286 * Fallback for vbglR3GetAdditionsVersion.
     
    297313    return VINF_SUCCESS;
    298314}
    299 #endif
    300 
    301315
    302316#ifdef RT_OS_WINDOWS
     
    353367    return RTErrConvertFromWin32(RegCloseKey(hKey));
    354368}
     369
    355370#endif /* RT_OS_WINDOWS */
    356371
    357 
    358 #ifndef VBOX_VBGLR3_XFREE86
    359372/**
    360373 * Retrieves the installed Guest Additions version and/or revision.
     
    451464#endif /* !RT_OS_WINDOWS */
    452465}
    453 #endif /* !VBOX_VBGLR3_XFREE86 */
     466
    454467
    455468/**
     
    506519    return rc;
    507520}
     521
     522#endif /* !VBOX_VBGLR3_XFREE86 */
     523
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