VirtualBox

Changeset 52082 in vbox


Ignore:
Timestamp:
Jul 17, 2014 5:18:56 PM (10 years ago)
Author:
vboxsync
Message:

6813 - DisplayImpl using COM Wrappers

Location:
trunk/src/VBox/Main
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestImpl.h

    r51476 r52082  
    1818#define ____H_GUESTIMPL
    1919
     20#include "GuestWrap.h"
    2021#include "VirtualBoxBase.h"
    2122#include <iprt/list.h>
     
    5051
    5152class ATL_NO_VTABLE Guest :
    52     public VirtualBoxBase,
    53     VBOX_SCRIPTABLE_IMPL(IGuest)
     53    public GuestWrap
    5454{
    5555public:
    56     VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(Guest, IGuest)
    57 
    58     DECLARE_NOT_AGGREGATABLE(Guest)
    59 
    60     DECLARE_PROTECT_FINAL_CONSTRUCT()
    61 
    62     BEGIN_COM_MAP(Guest)
    63         VBOX_DEFAULT_INTERFACE_ENTRIES(IGuest)
    64     END_COM_MAP()
    6556
    6657    DECLARE_EMPTY_CTOR_DTOR (Guest)
    6758
    68     HRESULT FinalConstruct(void);
    69     void FinalRelease(void);
     59    HRESULT FinalConstruct();
     60    void FinalRelease();
    7061
    7162    // Public initializer/uninitializer for internal purposes only.
    72     HRESULT init (Console *aParent);
     63    HRESULT init(Console *aParent);
    7364    void uninit();
    7465
    75     // IGuest properties.
    76     STDMETHOD(COMGETTER(OSTypeId))(BSTR *aOSTypeId);
    77     STDMETHOD(COMGETTER(AdditionsRunLevel))(AdditionsRunLevelType_T *aRunLevel);
    78     STDMETHOD(COMGETTER(AdditionsVersion))(BSTR *a_pbstrAdditionsVersion);
    79     STDMETHOD(COMGETTER(AdditionsRevision))(ULONG *a_puAdditionsRevision);
    80     STDMETHOD(COMGETTER(DnDSource))(IGuestDnDSource ** aSource);
    81     STDMETHOD(COMGETTER(DnDTarget))(IGuestDnDTarget ** aTarget);
    82     STDMETHOD(COMGETTER(EventSource))(IEventSource ** aEventSource);
    83     STDMETHOD(COMGETTER(Facilities))(ComSafeArrayOut(IAdditionsFacility *, aFacilities));
    84     STDMETHOD(COMGETTER(Sessions))(ComSafeArrayOut(IGuestSession *, aSessions));
    85     STDMETHOD(COMGETTER(MemoryBalloonSize)) (ULONG *aMemoryBalloonSize);
    86     STDMETHOD(COMSETTER(MemoryBalloonSize)) (ULONG aMemoryBalloonSize);
    87     STDMETHOD(COMGETTER(StatisticsUpdateInterval)) (ULONG *aUpdateInterval);
    88     STDMETHOD(COMSETTER(StatisticsUpdateInterval)) (ULONG aUpdateInterval);
    89     // IGuest methods.
    90     STDMETHOD(GetFacilityStatus)(AdditionsFacilityType_T aType, LONG64 *aTimestamp, AdditionsFacilityStatus_T *aStatus);
    91     STDMETHOD(GetAdditionsStatus)(AdditionsRunLevelType_T aLevel, BOOL *aActive);
    92     STDMETHOD(SetCredentials)(IN_BSTR aUsername, IN_BSTR aPassword,
    93                               IN_BSTR aDomain, BOOL aAllowInteractiveLogon);
    94     // Guest control.
    95     STDMETHOD(CreateSession)(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain, IN_BSTR aSessionName, IGuestSession **aGuestSession);
    96     STDMETHOD(FindSession)(IN_BSTR aSessionName, ComSafeArrayOut(IGuestSession *, aSessions));
    97     // Misc stuff
    98     STDMETHOD(InternalGetStatistics)(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,
    99                                      ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon, ULONG *aMemShared, ULONG *aMemCache,
    100                                      ULONG *aPageTotal, ULONG *aMemAllocTotal, ULONG *aMemFreeTotal, ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal);
    101     STDMETHOD(UpdateGuestAdditions)(IN_BSTR aSource, ComSafeArrayIn(IN_BSTR, aArguments), ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), IProgress **aProgress);
    10266
    10367public:
     
    10670#ifdef VBOX_WITH_GUEST_CONTROL
    10771    /** Static callback for handling guest control notifications. */
    108     static DECLCALLBACK(int) notifyCtrlDispatcher(void *pvExtension, uint32_t u32Function, void *pvData, uint32_t cbData);
    109     static DECLCALLBACK(void) staticUpdateStats(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick);
     72    static DECLCALLBACK(int) i_notifyCtrlDispatcher(void *pvExtension, uint32_t u32Function, void *pvData, uint32_t cbData);
     73    static DECLCALLBACK(void) i_staticUpdateStats(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick);
    11074#endif
    11175    /** @}  */
     
    11478    /** @name Public internal methods.
    11579     * @{ */
    116     void enableVMMStatistics(BOOL aEnable) { mCollectVMMStats = aEnable; };
    117     void setAdditionsInfo(Bstr aInterfaceVersion, VBOXOSTYPE aOsType);
    118     void setAdditionsInfo2(uint32_t a_uFullVersion, const char *a_pszName, uint32_t a_uRevision, uint32_t a_fFeatures);
    119     bool facilityIsActive(VBoxGuestFacilityType enmFacility);
    120     void facilityUpdate(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS);
    121     ComObjPtr<Console> getConsole(void) { return mParent; }
    122     void setAdditionsStatus(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus, uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS);
    123     void onUserStateChange(Bstr aUser, Bstr aDomain, VBoxGuestUserState enmState, const uint8_t *puDetails, uint32_t cbDetails);
    124     void setSupportedFeatures(uint32_t aCaps);
    125     HRESULT setStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal);
    126     BOOL isPageFusionEnabled();
    127     static HRESULT setErrorStatic(HRESULT aResultCode,
    128                                   const Utf8Str &aText)
     80    void i_enableVMMStatistics(BOOL aEnable) { mCollectVMMStats = aEnable; };
     81    void i_setAdditionsInfo(com::Utf8Str aInterfaceVersion, VBOXOSTYPE aOsType);
     82    void i_setAdditionsInfo2(uint32_t a_uFullVersion, const char *a_pszName, uint32_t a_uRevision, uint32_t a_fFeatures);
     83    bool i_facilityIsActive(VBoxGuestFacilityType enmFacility);
     84    void i_facilityUpdate(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus,
     85                          uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS);
     86    ComObjPtr<Console> i_getConsole(void) { return mParent; }
     87    void i_setAdditionsStatus(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus,
     88                              uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS);
     89    void i_onUserStateChange(Bstr aUser, Bstr aDomain, VBoxGuestUserState enmState, const uint8_t *puDetails, uint32_t cbDetails);
     90    void i_setSupportedFeatures(uint32_t aCaps);
     91    HRESULT i_setStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal);
     92    BOOL i_isPageFusionEnabled();
     93    static HRESULT i_setErrorStatic(HRESULT aResultCode, const Utf8Str &aText)
    12994    {
    13095        return setErrorInternal(aResultCode, getStaticClassIID(), getStaticComponentName(), aText, false, true);
    13196    }
    13297#ifdef VBOX_WITH_GUEST_CONTROL
    133     int         dispatchToSession(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
    134     uint32_t    getAdditionsVersion(void) { return mData.mAdditionsVersionFull; }
    135     int         sessionRemove(GuestSession *pSession);
    136     int         sessionCreate(const GuestSessionStartupInfo &ssInfo, const GuestCredentials &guestCreds, ComObjPtr<GuestSession> &pGuestSession);
    137     inline bool sessionExists(uint32_t uSessionID);
     98    int         i_dispatchToSession(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb);
     99    uint32_t    i_getAdditionsVersion(void) { return mData.mAdditionsVersionFull; }
     100    int         i_sessionRemove(GuestSession *pSession);
     101    int         i_sessionCreate(const GuestSessionStartupInfo &ssInfo, const GuestCredentials &guestCreds,
     102                                ComObjPtr<GuestSession> &pGuestSession);
     103    inline bool i_sessionExists(uint32_t uSessionID);
     104
    138105#endif
    139106    /** @}  */
    140107
    141108private:
     109
     110     // wrapped IGuest properties
     111     HRESULT getOSTypeId(com::Utf8Str &aOSTypeId);
     112     HRESULT getAdditionsRunLevel(AdditionsRunLevelType_T *aAdditionsRunLevel);
     113     HRESULT getAdditionsVersion(com::Utf8Str &aAdditionsVersion);
     114     HRESULT getAdditionsRevision(ULONG *aAdditionsRevision);
     115     HRESULT getDnDSource(ComPtr<IGuestDnDSource> &aDnDSource);
     116     HRESULT getDnDTarget(ComPtr<IGuestDnDTarget> &aDnDTarget);
     117     HRESULT getEventSource(ComPtr<IEventSource> &aEventSource);
     118     HRESULT getFacilities(std::vector<ComPtr<IAdditionsFacility> > &aFacilities);
     119     HRESULT getSessions(std::vector<ComPtr<IGuestSession> > &aSessions);
     120     HRESULT getMemoryBalloonSize(ULONG *aMemoryBalloonSize);
     121     HRESULT setMemoryBalloonSize(ULONG aMemoryBalloonSize);
     122     HRESULT getStatisticsUpdateInterval(ULONG *aStatisticsUpdateInterval);
     123     HRESULT setStatisticsUpdateInterval(ULONG aStatisticsUpdateInterval);
     124     HRESULT internalGetStatistics(ULONG *aCpuUser,
     125                                   ULONG *aCpuKernel,
     126                                   ULONG *aCpuIdle,
     127                                   ULONG *aMemTotal,
     128                                   ULONG *aMemFree,
     129                                   ULONG *aMemBalloon,
     130                                   ULONG *aMemShared,
     131                                   ULONG *aMemCache,
     132                                   ULONG *aPagedTotal,
     133                                   ULONG *aMemAllocTotal,
     134                                   ULONG *aMemFreeTotal,
     135                                   ULONG *aMemBalloonTotal,
     136                                   ULONG *aMemSharedTotal);
     137     HRESULT getFacilityStatus(AdditionsFacilityType_T aFacility,
     138                               LONG64 *aTimestamp,
     139                               AdditionsFacilityStatus_T *aStatus);
     140     HRESULT getAdditionsStatus(AdditionsRunLevelType_T aLevel,
     141                                BOOL *aActive);
     142     HRESULT setCredentials(const com::Utf8Str &aUserName,
     143                            const com::Utf8Str &aPassword,
     144                            const com::Utf8Str &aDomain,
     145                            BOOL aAllowInteractiveLogon);
     146
     147     // wrapped IGuest methods
     148     HRESULT createSession(const com::Utf8Str &aUser,
     149                           const com::Utf8Str &aPassword,
     150                           const com::Utf8Str &aDomain,
     151                           const com::Utf8Str &aSessionName,
     152                           ComPtr<IGuestSession> &aGuestSession);
     153
     154     HRESULT findSession(const com::Utf8Str &aSessionName,
     155                         std::vector<ComPtr<IGuestSession> > &aSessions);
     156     HRESULT updateGuestAdditions(const com::Utf8Str &aSource,
     157                                  const std::vector<com::Utf8Str> &aArguments,
     158                                  const std::vector<AdditionsUpdateFlag_T> &aFlags,
     159                                  ComPtr<IProgress> &aProgress);
     160
     161
    142162    /** @name Private internal methods.
    143163     * @{ */
    144     void updateStats(uint64_t iTick);
    145     static int staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
    146                                        STAMVISIBILITY enmVisiblity, const char *pszDesc, void *pvUser);
     164    void i_updateStats(uint64_t iTick);
     165    static int i_staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
     166                                         STAMVISIBILITY enmVisiblity, const char *pszDesc, void *pvUser);
     167
    147168    /** @}  */
    148169
     
    160181        { }
    161182
    162         Bstr                        mOSTypeId;
     183        Utf8Str                     mOSTypeId;
    163184        FacilityMap                 mFacilityMap;
    164185        AdditionsRunLevelType_T     mAdditionsRunLevel;
    165186        uint32_t                    mAdditionsVersionFull;
    166         Bstr                        mAdditionsVersionNew;
     187        Utf8Str                     mAdditionsVersionNew;
    167188        uint32_t                    mAdditionsRevision;
    168189        uint32_t                    mAdditionsFeatures;
    169         Bstr                        mInterfaceVersion;
     190        Utf8Str                     mInterfaceVersion;
    170191        GuestSessions               mGuestSessions;
    171192        uint32_t                    mNextSessionID;
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r52064 r52082  
    32603260    ComObjPtr<IProgress> iProgress;
    32613261    MachineState_T machineState = MachineState_Null;
    3262     HRESULT rc = mControl->DeleteSnapshot((IConsole *)this, Bstr(aId.toString()).raw(), Bstr(aId.toString()).raw(), FALSE /* fDeleteAllChildren */, &machineState, iProgress.asOutParam());
     3262    HRESULT rc = mControl->DeleteSnapshot((IConsole *)this, Bstr(aId.toString()).raw(), Bstr(aId.toString()).raw(),
     3263                                          FALSE /* fDeleteAllChildren */, &machineState, iProgress.asOutParam());
    32633264    if (FAILED(rc)) return rc;
    32643265    iProgress.queryInterfaceTo(aProgress.asOutParam());
     
    32803281    ComObjPtr<IProgress> iProgress;
    32813282    MachineState_T machineState = MachineState_Null;
    3282     HRESULT rc = mControl->DeleteSnapshot((IConsole *)this, Bstr(aId.toString()).raw(), Bstr(aId.toString()).raw(), TRUE /* fDeleteAllChildren */, &machineState, iProgress.asOutParam());
     3283    HRESULT rc = mControl->DeleteSnapshot((IConsole *)this, Bstr(aId.toString()).raw(), Bstr(aId.toString()).raw(),
     3284                                          TRUE /* fDeleteAllChildren */, &machineState, iProgress.asOutParam());
    32833285    if (FAILED(rc)) return rc;
    32843286    iProgress.queryInterfaceTo(aProgress.asOutParam());
     
    32993301    ComObjPtr<IProgress> iProgress;
    33003302    MachineState_T machineState = MachineState_Null;
    3301     HRESULT rc = mControl->DeleteSnapshot((IConsole *)this, Bstr(aStartId.toString()).raw(), Bstr(aEndId.toString()).raw(), FALSE /* fDeleteAllChildren */, &machineState, iProgress.asOutParam());
     3303    HRESULT rc = mControl->DeleteSnapshot((IConsole *)this, Bstr(aStartId.toString()).raw(), Bstr(aEndId.toString()).raw(),
     3304                                          FALSE /* fDeleteAllChildren */, &machineState, iProgress.asOutParam());
    33023305    if (FAILED(rc)) return rc;
    33033306    iProgress.queryInterfaceTo(aProgress.asOutParam());
     
    59976000{
    59986001    if (mGuest)
    5999         mGuest->enableVMMStatistics(aEnable);
     6002        mGuest->i_enableVMMStatistics(aEnable);
    60006003}
    60016004
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r52009 r52082  
    56745674        HGCMSVCEXTHANDLE hDummy;
    56755675        rc = HGCMHostRegisterServiceExtension(&hDummy, "VBoxGuestControlSvc",
    5676                                               &Guest::notifyCtrlDispatcher,
     5676                                              &Guest::i_notifyCtrlDispatcher,
    56775677                                              pConsole->i_getGuest());
    56785678        if (RT_FAILURE(rc))
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r50727 r52082  
    55
    66/*
    7  * Copyright (C) 2006-2013 Oracle Corporation
     7 * Copyright (C) 2006-2014 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6464 */
    6565/* static */
    66 DECLCALLBACK(int) Guest::notifyCtrlDispatcher(void    *pvExtension,
    67                                               uint32_t u32Function,
    68                                               void    *pvData,
    69                                               uint32_t cbData)
     66DECLCALLBACK(int) Guest::i_notifyCtrlDispatcher(void    *pvExtension,
     67                                                uint32_t u32Function,
     68                                                void    *pvData,
     69                                                uint32_t cbData)
    7070{
    7171    using namespace guestControl;
     
    107107
    108108    VBOXGUESTCTRLHOSTCBCTX ctxCb = { u32Function, uContextID };
    109     rc = pGuest->dispatchToSession(&ctxCb, pSvcCb);
     109    rc = pGuest->i_dispatchToSession(&ctxCb, pSvcCb);
    110110
    111111    LogFlowFunc(("Returning rc=%Rrc\n", rc));
     
    114114#endif /* VBOX_WITH_GUEST_CONTROL */
    115115
    116 STDMETHODIMP Guest::UpdateGuestAdditions(IN_BSTR aSource, ComSafeArrayIn(IN_BSTR, aArguments),
    117                                          ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags), IProgress **aProgress)
     116HRESULT Guest::updateGuestAdditions(const com::Utf8Str &aSource, const std::vector<com::Utf8Str> &aArguments,
     117                                    const std::vector<AdditionsUpdateFlag_T> &aFlags, ComPtr<IProgress> &aProgress)
    118118{
    119119#ifndef VBOX_WITH_GUEST_CONTROL
    120120    ReturnComNotImplemented();
    121121#else /* VBOX_WITH_GUEST_CONTROL */
    122     CheckComArgStrNotEmptyOrNull(aSource);
    123     CheckComArgOutPointerValid(aProgress);
    124 
    125     AutoCaller autoCaller(this);
    126     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    127122
    128123    /* Validate flags. */
    129124    uint32_t fFlags = AdditionsUpdateFlag_None;
    130     if (aFlags)
    131     {
    132         com::SafeArray<AdditionsUpdateFlag_T> flags(ComSafeArrayInArg(aFlags));
    133         for (size_t i = 0; i < flags.size(); i++)
    134             fFlags |= flags[i];
    135     }
    136 
    137     if (fFlags)
    138     {
    139         if (!(fFlags & AdditionsUpdateFlag_WaitForUpdateStartOnly))
    140             return setError(E_INVALIDARG, tr("Unknown flags (%#x)"), aFlags);
    141     }
     125    if (aFlags.size())
     126        for (size_t i = 0; i < aFlags.size(); ++i)
     127            fFlags |= aFlags[i];
     128
     129    com::SafeArray<AdditionsUpdateFlag_T> aaFlags;
     130    aaFlags.resize(aFlags.size());
     131    for (size_t i = 0; i < aFlags.size(); ++i)
     132        aaFlags[i] = aFlags[i];
     133
     134    if (fFlags && !(fFlags & AdditionsUpdateFlag_WaitForUpdateStartOnly))
     135        return setError(E_INVALIDARG, tr("Unknown flags (%#x)"), aaFlags);
    142136
    143137    int rc = VINF_SUCCESS;
    144138
    145139    ProcessArguments aArgs;
    146     if (aArguments)
     140    aArgs.resize(0);
     141
     142    if (aArguments.size())
    147143    {
    148144        try
    149145        {
    150             com::SafeArray<IN_BSTR> arguments(ComSafeArrayInArg(aArguments));
    151             for (size_t i = 0; i < arguments.size(); i++)
    152                 aArgs.push_back(Utf8Str(arguments[i]));
     146            for (size_t i = 0; i < aArguments.size(); ++i)
     147                aArgs.push_back(aArguments[i]);
    153148        }
    154149        catch(std::bad_alloc &)
     
    172167    ComObjPtr<GuestSession> pSession;
    173168    if (RT_SUCCESS(rc))
    174         rc = sessionCreate(startupInfo, guestCreds, pSession);
     169        rc = i_sessionCreate(startupInfo, guestCreds, pSession);
    175170    if (RT_FAILURE(rc))
    176171    {
     
    206201                ComObjPtr<Progress> pProgress;
    207202                SessionTaskUpdateAdditions *pTask = new SessionTaskUpdateAdditions(pSession /* GuestSession */,
    208                                                                                    Utf8Str(aSource), aArgs, fFlags);
     203                                                                                   aSource, aArgs, fFlags);
    209204                rc = pSession->i_startTaskAsync(tr("Updating Guest Additions"), pTask, pProgress);
    210205                if (RT_SUCCESS(rc))
    211206                {
    212207                    /* Return progress to the caller. */
    213                     hr = pProgress.queryInterfaceTo(aProgress);
     208                    hr = pProgress.queryInterfaceTo(aProgress.asOutParam());
    214209                }
    215210                else
     
    230225/////////////////////////////////////////////////////////////////////////////
    231226
    232 int Guest::dispatchToSession(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
     227int Guest::i_dispatchToSession(PVBOXGUESTCTRLHOSTCBCTX pCtxCb, PVBOXGUESTCTRLHOSTCALLBACK pSvcCb)
    233228{
    234229    LogFlowFunc(("pCtxCb=%p, pSvcCb=%p\n", pCtxCb, pSvcCb));
     
    345340}
    346341
    347 int Guest::sessionRemove(GuestSession *pSession)
     342int Guest::i_sessionRemove(GuestSession *pSession)
    348343{
    349344    AssertPtrReturn(pSession, VERR_INVALID_POINTER);
     
    393388}
    394389
    395 int Guest::sessionCreate(const GuestSessionStartupInfo &ssInfo,
    396                          const GuestCredentials &guestCreds, ComObjPtr<GuestSession> &pGuestSession)
     390int Guest::i_sessionCreate(const GuestSessionStartupInfo &ssInfo,
     391                           const GuestCredentials &guestCreds, ComObjPtr<GuestSession> &pGuestSession)
    397392{
    398393    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    411406        {
    412407            /* Is the context ID already used? */
    413             if (!sessionExists(uNewSessionID))
     408            if (!i_sessionExists(uNewSessionID))
    414409            {
    415410                rc = VINF_SUCCESS;
     
    474469}
    475470
    476 inline bool Guest::sessionExists(uint32_t uSessionID)
     471inline bool Guest::i_sessionExists(uint32_t uSessionID)
    477472{
    478473    GuestSessions::const_iterator itSessions = mData.mGuestSessions.find(uSessionID);
     
    482477// implementation of public methods
    483478/////////////////////////////////////////////////////////////////////////////
    484 
    485 STDMETHODIMP Guest::CreateSession(IN_BSTR aUser, IN_BSTR aPassword, IN_BSTR aDomain,
    486                                   IN_BSTR aSessionName, IGuestSession **aGuestSession)
     479HRESULT Guest::createSession(const com::Utf8Str &aUser, const com::Utf8Str &aPassword, const com::Utf8Str &aDomain,
     480                             const com::Utf8Str &aSessionName, ComPtr<IGuestSession> &aGuestSession)
     481
    487482{
    488483#ifndef VBOX_WITH_GUEST_CONTROL
     
    493488
    494489    /* Do not allow anonymous sessions (with system rights) with public API. */
    495     if (RT_UNLIKELY((aUser) == NULL || *(aUser) == '\0'))
     490    if (RT_UNLIKELY(!aUser.length()))
    496491        return setError(E_INVALIDARG, tr("No user name specified"));
    497     if (RT_UNLIKELY((aPassword) == NULL)) /* Allow empty passwords. */
    498         return setError(E_INVALIDARG, tr("No password specified"));
    499     CheckComArgOutPointerValid(aGuestSession);
    500     /* Rest is optional. */
    501 
    502     AutoCaller autoCaller(this);
    503     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    504492
    505493    GuestSessionStartupInfo startupInfo;
     
    512500
    513501    ComObjPtr<GuestSession> pSession;
    514     int rc = sessionCreate(startupInfo, guestCreds, pSession);
     502    int rc = i_sessionCreate(startupInfo, guestCreds, pSession);
    515503    if (RT_SUCCESS(rc))
    516504    {
    517505        /* Return guest session to the caller. */
    518         HRESULT hr2 = pSession.queryInterfaceTo(aGuestSession);
     506        HRESULT hr2 = pSession.queryInterfaceTo(aGuestSession.asOutParam());
    519507        if (FAILED(hr2))
    520508            rc = VERR_COM_OBJECT_NOT_FOUND;
     
    522510
    523511    if (RT_SUCCESS(rc))
    524     {
    525512        /* Start (fork) the session asynchronously
    526513         * on the guest. */
    527514        rc = pSession->i_startSessionAsync();
    528     }
    529515
    530516    HRESULT hr = S_OK;
     
    552538}
    553539
    554 STDMETHODIMP Guest::FindSession(IN_BSTR aSessionName, ComSafeArrayOut(IGuestSession *, aSessions))
     540HRESULT Guest::findSession(const com::Utf8Str &aSessionName, std::vector<ComPtr<IGuestSession> > &aSessions)
    555541{
    556542#ifndef VBOX_WITH_GUEST_CONTROL
     
    558544#else /* VBOX_WITH_GUEST_CONTROL */
    559545
    560     CheckComArgOutSafeArrayPointerValid(aSessions);
    561 
    562546    LogFlowFuncEnter();
    563547
     
    575559    }
    576560
    577     LogFlowFunc(("Sessions with \"%ls\" = %RU32\n",
    578                  aSessionName, listSessions.size()));
     561    LogFlowFunc(("Sessions with \"%s\" = %RU32\n",
     562                 aSessionName.c_str(), listSessions.size()));
    579563
    580564    if (listSessions.size())
    581565    {
    582         SafeIfaceArray<IGuestSession> sessionIfacs(listSessions);
    583         sessionIfacs.detachTo(ComSafeArrayOutArg(aSessions));
     566        aSessions.resize(listSessions.size());
     567        size_t i = 0;
     568        for (std::list < ComObjPtr<GuestSession> >::const_iterator it = listSessions.begin(); it != listSessions.end(); ++it, ++i)
     569            (*it).queryInterfaceTo(aSessions[i].asOutParam());
    584570
    585571        return S_OK;
     572
    586573    }
    587574
    588575    return setErrorNoLog(VBOX_E_OBJECT_NOT_FOUND,
    589                          tr("Could not find sessions with name '%ls'"),
    590                          aSessionName);
     576                         tr("Could not find sessions with name '%s'"),
     577                         aSessionName.c_str());
    591578#endif /* VBOX_WITH_GUEST_CONTROL */
    592579}
  • trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp

    r52064 r52082  
    470470    /* For multi-monitor support we need to add shift values to the coordinates
    471471     * (depending on the screen number). */
    472     ComObjPtr<Console> pConsole = m_pGuest->getConsole();
     472    ComObjPtr<Console> pConsole = m_pGuest->i_getConsole();
    473473    ComPtr<IDisplay> pDisplay;
    474474    HRESULT hr = pConsole->COMGETTER(Display)(pDisplay.asOutParam());
     
    498498{
    499499    Assert(!m_pGuest.isNull());
    500     ComObjPtr<Console> pConsole = m_pGuest->getConsole();
     500    ComObjPtr<Console> pConsole = m_pGuest->i_getConsole();
    501501
    502502    /* Forward the information to the VMM device. */
  • trunk/src/VBox/Main/src-client/GuestImpl.cpp

    r51612 r52082  
    106106    mMagic = GUEST_MAGIC;
    107107    int vrc = RTTimerLRCreate(&mStatTimer, 1000 /* ms */,
    108                               &Guest::staticUpdateStats, this);
     108                              &Guest::i_staticUpdateStats, this);
    109109    AssertMsgRC(vrc, ("Failed to create guest statistics update timer (%Rrc)\n", vrc));
    110110
     
    194194
    195195/* static */
    196 DECLCALLBACK(void) Guest::staticUpdateStats(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick)
     196DECLCALLBACK(void) Guest::i_staticUpdateStats(RTTIMERLR hTimerLR, void *pvUser, uint64_t iTick)
    197197{
    198198    AssertReturnVoid(pvUser != NULL);
     
    200200    Assert(guest->mMagic == GUEST_MAGIC);
    201201    if (guest->mMagic == GUEST_MAGIC)
    202         guest->updateStats(iTick);
     202        guest->i_updateStats(iTick);
    203203
    204204    NOREF(hTimerLR);
     
    206206
    207207/* static */
    208 int Guest::staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
    209                                    STAMVISIBILITY enmVisiblity, const char *pszDesc, void *pvUser)
     208int Guest::i_staticEnumStatsCallback(const char *pszName, STAMTYPE enmType, void *pvSample, STAMUNIT enmUnit,
     209                                     STAMVISIBILITY enmVisiblity, const char *pszDesc, void *pvUser)
    210210{
    211211    AssertLogRelMsgReturn(enmType == STAMTYPE_COUNTER, ("Unexpected sample type %d ('%s')\n", enmType, pszName), VINF_SUCCESS);
     
    255255}
    256256
    257 void Guest::updateStats(uint64_t iTick)
     257void Guest::i_updateStats(uint64_t iTick)
    258258{
    259259    uint64_t cbFreeTotal      = 0;
     
    313313        uint64_t uTxPrev = mNetStatTx;
    314314        mNetStatRx = mNetStatTx = 0;
    315         rc = STAMR3Enum(ptrVM.rawUVM(), "/Public/Net/*/Bytes*", staticEnumStatsCallback, this);
     315        rc = STAMR3Enum(ptrVM.rawUVM(), "/Public/Net/*/Bytes*", i_staticEnumStatsCallback, this);
    316316        AssertRC(rc);
    317317
     
    359359/////////////////////////////////////////////////////////////////////////////
    360360
    361 STDMETHODIMP Guest::COMGETTER(OSTypeId)(BSTR *a_pbstrOSTypeId)
    362 {
    363     CheckComArgOutPointerValid(a_pbstrOSTypeId);
    364 
    365     AutoCaller autoCaller(this);
    366     HRESULT hrc = autoCaller.rc();
    367     if (SUCCEEDED(hrc))
    368     {
    369         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    370         if (!mData.mInterfaceVersion.isEmpty())
    371             mData.mOSTypeId.cloneTo(a_pbstrOSTypeId);
     361HRESULT Guest::getOSTypeId(com::Utf8Str &aOSTypeId)
     362{
     363    HRESULT hrc = S_OK;
     364    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     365    if (!mData.mInterfaceVersion.isEmpty())
     366        aOSTypeId = mData.mOSTypeId;
     367    else
     368    {
     369        /* Redirect the call to IMachine if no additions are installed. */
     370        ComPtr<IMachine> ptrMachine(mParent->i_machine());
     371        alock.release();
     372        BSTR bstr;
     373        hrc = ptrMachine->COMGETTER(OSTypeId)(&bstr);
     374        aOSTypeId = bstr;
     375    }
     376    return hrc;
     377}
     378
     379HRESULT Guest::getAdditionsRunLevel(AdditionsRunLevelType_T *aAdditionsRunLevel)
     380{
     381    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     382
     383    *aAdditionsRunLevel = mData.mAdditionsRunLevel;
     384
     385    return S_OK;
     386}
     387
     388HRESULT Guest::getAdditionsVersion(com::Utf8Str &aAdditionsVersion)
     389{
     390    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     391    HRESULT hrc = S_OK;
     392
     393    /*
     394     * Return the ReportGuestInfo2 version info if available.
     395     */
     396    if (   !mData.mAdditionsVersionNew.isEmpty()
     397         || mData.mAdditionsRunLevel <= AdditionsRunLevelType_None)
     398        aAdditionsVersion = mData.mAdditionsVersionNew;
     399    else
     400    {
     401        /*
     402         * If we're running older guest additions (< 3.2.0) try get it from
     403         * the guest properties.  Detected switched around Version and
     404         * Revision in early 3.1.x releases (see r57115).
     405         */
     406        ComPtr<IMachine> ptrMachine = mParent->i_machine();
     407        alock.release(); /* No need to hold this during the IPC fun. */
     408
     409        Bstr bstr;
     410        hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Version").raw(), bstr.asOutParam());
     411        if (   SUCCEEDED(hrc)
     412            && !bstr.isEmpty())
     413        {
     414            Utf8Str str(bstr);
     415            if (str.count('.') == 0)
     416                hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Revision").raw(), bstr.asOutParam());
     417            str = bstr;
     418            if (str.count('.') != 2)
     419                hrc = E_FAIL;
     420        }
     421
     422        if (SUCCEEDED(hrc))
     423            aAdditionsVersion = bstr;
    372424        else
    373425        {
    374             /* Redirect the call to IMachine if no additions are installed. */
    375             ComPtr<IMachine> ptrMachine(mParent->i_machine());
    376             alock.release();
    377             hrc = ptrMachine->COMGETTER(OSTypeId)(a_pbstrOSTypeId);
     426            /* Returning 1.4 is better than nothing. */
     427            alock.acquire();
     428            aAdditionsVersion = mData.mInterfaceVersion;
     429            hrc = S_OK;
    378430        }
    379431    }
     
    381433}
    382434
    383 STDMETHODIMP Guest::COMGETTER(AdditionsRunLevel)(AdditionsRunLevelType_T *aRunLevel)
    384 {
    385     AutoCaller autoCaller(this);
    386     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    387 
    388     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    389 
    390     *aRunLevel = mData.mAdditionsRunLevel;
    391 
    392     return S_OK;
    393 }
    394 
    395 STDMETHODIMP Guest::COMGETTER(AdditionsVersion)(BSTR *a_pbstrAdditionsVersion)
    396 {
    397     CheckComArgOutPointerValid(a_pbstrAdditionsVersion);
    398 
    399     AutoCaller autoCaller(this);
    400     HRESULT hrc = autoCaller.rc();
    401     if (SUCCEEDED(hrc))
    402     {
    403         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    404 
     435HRESULT Guest::getAdditionsRevision(ULONG *aAdditionsRevision)
     436{
     437    HRESULT hrc = S_OK;
     438    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     439
     440    /*
     441     * Return the ReportGuestInfo2 version info if available.
     442     */
     443    if (   !mData.mAdditionsVersionNew.isEmpty()
     444        || mData.mAdditionsRunLevel <= AdditionsRunLevelType_None)
     445        *aAdditionsRevision = mData.mAdditionsRevision;
     446    else
     447    {
    405448        /*
    406          * Return the ReportGuestInfo2 version info if available.
     449         * If we're running older guest additions (< 3.2.0) try get it from
     450         * the guest properties. Detected switched around Version and
     451         * Revision in early 3.1.x releases (see r57115).
    407452         */
    408         if (   !mData.mAdditionsVersionNew.isEmpty()
    409             || mData.mAdditionsRunLevel <= AdditionsRunLevelType_None)
    410             mData.mAdditionsVersionNew.cloneTo(a_pbstrAdditionsVersion);
    411         else
    412         {
    413             /*
    414              * If we're running older guest additions (< 3.2.0) try get it from
    415              * the guest properties.  Detected switched around Version and
    416              * Revision in early 3.1.x releases (see r57115).
    417              */
    418             ComPtr<IMachine> ptrMachine = mParent->i_machine();
    419             alock.release(); /* No need to hold this during the IPC fun. */
    420 
    421             Bstr bstr;
    422             hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Version").raw(), bstr.asOutParam());
    423             if (   SUCCEEDED(hrc)
    424                 && !bstr.isEmpty())
     453        ComPtr<IMachine> ptrMachine = mParent->i_machine();
     454        alock.release(); /* No need to hold this during the IPC fun. */
     455
     456        Bstr bstr;
     457        hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Revision").raw(), bstr.asOutParam());
     458        if (SUCCEEDED(hrc))
     459        {
     460            Utf8Str str(bstr);
     461            uint32_t uRevision;
     462            int vrc = RTStrToUInt32Full(str.c_str(), 0, &uRevision);
     463            if (vrc != VINF_SUCCESS && str.count('.') == 2)
    425464            {
    426                 Utf8Str str(bstr);
    427                 if (str.count('.') == 0)
    428                     hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Revision").raw(), bstr.asOutParam());
    429                 str = bstr;
    430                 if (str.count('.') != 2)
    431                     hrc = E_FAIL;
     465                hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Version").raw(), bstr.asOutParam());
     466                if (SUCCEEDED(hrc))
     467                {
     468                    str = bstr;
     469                    vrc = RTStrToUInt32Full(str.c_str(), 0, &uRevision);
     470                }
    432471            }
    433 
    434             if (SUCCEEDED(hrc))
    435                 bstr.detachTo(a_pbstrAdditionsVersion);
     472            if (vrc == VINF_SUCCESS)
     473                *aAdditionsRevision = uRevision;
    436474            else
    437             {
    438                 /* Returning 1.4 is better than nothing. */
    439                 alock.acquire();
    440                 mData.mInterfaceVersion.cloneTo(a_pbstrAdditionsVersion);
    441                 hrc = S_OK;
    442             }
     475                hrc = VBOX_E_IPRT_ERROR;
     476        }
     477        if (FAILED(hrc))
     478        {
     479            /* Return 0 if we don't know. */
     480            *aAdditionsRevision = 0;
     481            hrc = S_OK;
    443482        }
    444483    }
     
    446485}
    447486
    448 STDMETHODIMP Guest::COMGETTER(AdditionsRevision)(ULONG *a_puAdditionsRevision)
    449 {
    450     CheckComArgOutPointerValid(a_puAdditionsRevision);
    451 
    452     AutoCaller autoCaller(this);
    453     HRESULT hrc = autoCaller.rc();
    454     if (SUCCEEDED(hrc))
    455     {
    456         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    457 
    458         /*
    459          * Return the ReportGuestInfo2 version info if available.
    460          */
    461         if (   !mData.mAdditionsVersionNew.isEmpty()
    462             || mData.mAdditionsRunLevel <= AdditionsRunLevelType_None)
    463             *a_puAdditionsRevision = mData.mAdditionsRevision;
    464         else
    465         {
    466             /*
    467              * If we're running older guest additions (< 3.2.0) try get it from
    468              * the guest properties. Detected switched around Version and
    469              * Revision in early 3.1.x releases (see r57115).
    470              */
    471             ComPtr<IMachine> ptrMachine = mParent->i_machine();
    472             alock.release(); /* No need to hold this during the IPC fun. */
    473 
    474             Bstr bstr;
    475             hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Revision").raw(), bstr.asOutParam());
    476             if (SUCCEEDED(hrc))
    477             {
    478                 Utf8Str str(bstr);
    479                 uint32_t uRevision;
    480                 int vrc = RTStrToUInt32Full(str.c_str(), 0, &uRevision);
    481                 if (vrc != VINF_SUCCESS && str.count('.') == 2)
    482                 {
    483                     hrc = ptrMachine->GetGuestPropertyValue(Bstr("/VirtualBox/GuestAdd/Version").raw(), bstr.asOutParam());
    484                     if (SUCCEEDED(hrc))
    485                     {
    486                         str = bstr;
    487                         vrc = RTStrToUInt32Full(str.c_str(), 0, &uRevision);
    488                     }
    489                 }
    490                 if (vrc == VINF_SUCCESS)
    491                     *a_puAdditionsRevision = uRevision;
    492                 else
    493                     hrc = VBOX_E_IPRT_ERROR;
    494             }
    495             if (FAILED(hrc))
    496             {
    497                 /* Return 0 if we don't know. */
    498                 *a_puAdditionsRevision = 0;
    499                 hrc = S_OK;
    500             }
    501         }
    502     }
    503     return hrc;
    504 }
    505 
    506 STDMETHODIMP Guest::COMGETTER(DnDSource)(IGuestDnDSource ** aSource)
     487HRESULT Guest::getDnDSource(ComPtr<IGuestDnDSource> &aDnDSource)
    507488{
    508489#ifndef VBOX_WITH_DRAG_AND_DROP
     
    511492    LogFlowThisFuncEnter();
    512493
    513     CheckComArgOutPointerValid(aSource);
    514 
    515     AutoCaller autoCaller(this);
    516     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    517 
    518494    /* No need to lock - lifetime constant. */
    519     HRESULT hr = mDnDSource.queryInterfaceTo(aSource);
     495    HRESULT hr = mDnDSource.queryInterfaceTo(aDnDSource.asOutParam());
    520496
    521497    LogFlowFuncLeaveRC(hr);
     
    524500}
    525501
    526 STDMETHODIMP Guest::COMGETTER(DnDTarget)(IGuestDnDTarget ** aTarget)
     502HRESULT Guest::getDnDTarget(ComPtr<IGuestDnDTarget> &aDnDTarget)
    527503{
    528504#ifndef VBOX_WITH_DRAG_AND_DROP
     
    531507    LogFlowThisFuncEnter();
    532508
    533     CheckComArgOutPointerValid(aTarget);
    534 
    535     AutoCaller autoCaller(this);
    536     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    537 
    538509    /* No need to lock - lifetime constant. */
    539     HRESULT hr = mDnDTarget.queryInterfaceTo(aTarget);
     510    HRESULT hr = mDnDTarget.queryInterfaceTo(aDnDTarget.asOutParam());
    540511
    541512    LogFlowFuncLeaveRC(hr);
     
    544515}
    545516
    546 STDMETHODIMP Guest::COMGETTER(EventSource)(IEventSource ** aEventSource)
     517HRESULT Guest::getEventSource(ComPtr<IEventSource> &aEventSource)
    547518{
    548519#ifndef VBOX_WITH_GUEST_CONTROL
     
    551522    LogFlowThisFuncEnter();
    552523
    553     CheckComArgOutPointerValid(aEventSource);
    554 
    555     AutoCaller autoCaller(this);
    556     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    557 
    558524    /* No need to lock - lifetime constant. */
    559     mEventSource.queryInterfaceTo(aEventSource);
     525    mEventSource.queryInterfaceTo(aEventSource.asOutParam());
    560526
    561527    LogFlowFuncLeaveRC(S_OK);
     
    564530}
    565531
    566 STDMETHODIMP Guest::COMGETTER(Facilities)(ComSafeArrayOut(IAdditionsFacility *, aFacilities))
    567 {
    568     CheckComArgOutSafeArrayPointerValid(aFacilities);
    569 
    570     AutoCaller autoCaller(this);
    571     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    572 
    573     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    574 
    575     SafeIfaceArray<IAdditionsFacility> fac(mData.mFacilityMap);
    576     fac.detachTo(ComSafeArrayOutArg(aFacilities));
     532HRESULT Guest::getFacilities(std::vector<ComPtr<IAdditionsFacility> > &aFacilities)
     533{
     534    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     535
     536    aFacilities.resize(mData.mFacilityMap.size());
     537    size_t i = 0;
     538    for (FacilityMapIter it = mData.mFacilityMap.begin(); it != mData.mFacilityMap.end(); ++it, ++i)
     539        it->second.queryInterfaceTo(aFacilities[i].asOutParam());
    577540
    578541    return S_OK;
    579542}
    580543
    581 STDMETHODIMP Guest::COMGETTER(Sessions)(ComSafeArrayOut(IGuestSession *, aSessions))
    582 {
    583     CheckComArgOutSafeArrayPointerValid(aSessions);
    584 
    585     AutoCaller autoCaller(this);
    586     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    587 
    588     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    589 
    590     SafeIfaceArray<IGuestSession> collection(mData.mGuestSessions);
    591     collection.detachTo(ComSafeArrayOutArg(aSessions));
     544HRESULT Guest::getSessions(std::vector<ComPtr<IGuestSession> > &aSessions)
     545{
     546    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     547
     548    aSessions.resize(mData.mGuestSessions.size());
     549    size_t i = 0;
     550    for (GuestSessions::iterator it = mData.mGuestSessions.begin(); it != mData.mGuestSessions.end(); ++it, ++i)
     551        it->second.queryInterfaceTo(aSessions[i].asOutParam());
    592552
    593553    return S_OK;
    594554}
    595555
    596 BOOL Guest::isPageFusionEnabled()
    597 {
    598     AutoCaller autoCaller(this);
    599     if (FAILED(autoCaller.rc())) return false;
    600 
     556BOOL Guest::i_isPageFusionEnabled()
     557{
    601558    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    602559
     
    604561}
    605562
    606 STDMETHODIMP Guest::COMGETTER(MemoryBalloonSize)(ULONG *aMemoryBalloonSize)
    607 {
    608     CheckComArgOutPointerValid(aMemoryBalloonSize);
    609 
    610     AutoCaller autoCaller(this);
    611     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    612 
     563HRESULT Guest::getMemoryBalloonSize(ULONG *aMemoryBalloonSize)
     564{
    613565    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    614566
     
    618570}
    619571
    620 STDMETHODIMP Guest::COMSETTER(MemoryBalloonSize)(ULONG aMemoryBalloonSize)
    621 {
    622     AutoCaller autoCaller(this);
    623     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    624 
     572HRESULT Guest::setMemoryBalloonSize(ULONG aMemoryBalloonSize)
     573{
    625574    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    626575
     
    647596}
    648597
    649 STDMETHODIMP Guest::COMGETTER(StatisticsUpdateInterval)(ULONG *aUpdateInterval)
    650 {
    651     CheckComArgOutPointerValid(aUpdateInterval);
    652 
    653     AutoCaller autoCaller(this);
    654     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    655 
    656     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    657 
    658     *aUpdateInterval = mStatUpdateInterval;
     598HRESULT Guest::getStatisticsUpdateInterval(ULONG *aStatisticsUpdateInterval)
     599{
     600    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     601
     602    *aStatisticsUpdateInterval = mStatUpdateInterval;
    659603    return S_OK;
    660604}
    661605
    662 STDMETHODIMP Guest::COMSETTER(StatisticsUpdateInterval)(ULONG aUpdateInterval)
    663 {
    664     AutoCaller autoCaller(this);
    665     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    666 
     606HRESULT Guest::setStatisticsUpdateInterval(ULONG aStatisticsUpdateInterval)
     607{
    667608    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    668609
    669610    if (mStatUpdateInterval)
    670         if (aUpdateInterval == 0)
     611        if (aStatisticsUpdateInterval == 0)
    671612            RTTimerLRStop(mStatTimer);
    672613        else
    673             RTTimerLRChangeInterval(mStatTimer, aUpdateInterval);
    674     else
    675         if (aUpdateInterval != 0)
    676         {
    677             RTTimerLRChangeInterval(mStatTimer, aUpdateInterval);
     614            RTTimerLRChangeInterval(mStatTimer, aStatisticsUpdateInterval);
     615    else
     616        if (aStatisticsUpdateInterval != 0)
     617        {
     618            RTTimerLRChangeInterval(mStatTimer, aStatisticsUpdateInterval);
    678619            RTTimerLRStart(mStatTimer, 0);
    679620        }
    680     mStatUpdateInterval = aUpdateInterval;
     621    mStatUpdateInterval = aStatisticsUpdateInterval;
    681622    /* forward the information to the VMM device */
    682623    VMMDev *pVMMDev = mParent->i_getVMMDev();
     
    688629        PPDMIVMMDEVPORT pVMMDevPort = pVMMDev->getVMMDevPort();
    689630        if (pVMMDevPort)
    690             pVMMDevPort->pfnSetStatisticsInterval(pVMMDevPort, aUpdateInterval);
     631            pVMMDevPort->pfnSetStatisticsInterval(pVMMDevPort, aStatisticsUpdateInterval);
    691632    }
    692633
     
    694635}
    695636
    696 STDMETHODIMP Guest::InternalGetStatistics(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,
    697                                           ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon,
    698                                           ULONG *aMemShared, ULONG *aMemCache, ULONG *aPageTotal,
    699                                           ULONG *aMemAllocTotal, ULONG *aMemFreeTotal,
    700                                           ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal)
    701 {
    702     CheckComArgOutPointerValid(aCpuUser);
    703     CheckComArgOutPointerValid(aCpuKernel);
    704     CheckComArgOutPointerValid(aCpuIdle);
    705     CheckComArgOutPointerValid(aMemTotal);
    706     CheckComArgOutPointerValid(aMemFree);
    707     CheckComArgOutPointerValid(aMemBalloon);
    708     CheckComArgOutPointerValid(aMemShared);
    709     CheckComArgOutPointerValid(aMemCache);
    710     CheckComArgOutPointerValid(aPageTotal);
    711     CheckComArgOutPointerValid(aMemAllocTotal);
    712     CheckComArgOutPointerValid(aMemFreeTotal);
    713     CheckComArgOutPointerValid(aMemBalloonTotal);
    714     CheckComArgOutPointerValid(aMemSharedTotal);
    715 
    716     AutoCaller autoCaller(this);
    717     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    718 
     637
     638HRESULT Guest::internalGetStatistics(ULONG *aCpuUser, ULONG *aCpuKernel, ULONG *aCpuIdle,
     639                                     ULONG *aMemTotal, ULONG *aMemFree, ULONG *aMemBalloon,
     640                                     ULONG *aMemShared, ULONG *aMemCache, ULONG *aPageTotal,
     641                                     ULONG *aMemAllocTotal, ULONG *aMemFreeTotal,
     642                                     ULONG *aMemBalloonTotal, ULONG *aMemSharedTotal)
     643{
    719644    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    720645
     
    761686}
    762687
    763 HRESULT Guest::setStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal)
     688HRESULT Guest::i_setStatistic(ULONG aCpuId, GUESTSTATTYPE enmType, ULONG aVal)
    764689{
    765690    static ULONG indexToPerfMask[] =
     
    795720 * @param   aTimestamp      Timestamp of last facility status update in ms (optional).
    796721 */
    797 STDMETHODIMP Guest::GetFacilityStatus(AdditionsFacilityType_T aType, LONG64 *aTimestamp, AdditionsFacilityStatus_T *aStatus)
    798 {
    799     AutoCaller autoCaller(this);
    800     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    801 
    802     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    803 
    804     CheckComArgNotNull(aStatus);
     722HRESULT Guest::getFacilityStatus(AdditionsFacilityType_T aFacility, LONG64 *aTimestamp, AdditionsFacilityStatus_T *aStatus)
     723{
     724    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     725
    805726    /* Not checking for aTimestamp is intentional; it's optional. */
    806 
    807     FacilityMapIterConst it = mData.mFacilityMap.find(aType);
     727    FacilityMapIterConst it = mData.mFacilityMap.find(aFacility);
    808728    if (it != mData.mFacilityMap.end())
    809729    {
     
    827747}
    828748
    829 STDMETHODIMP Guest::GetAdditionsStatus(AdditionsRunLevelType_T aLevel, BOOL *aActive)
    830 {
    831     AutoCaller autoCaller(this);
    832     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    833 
     749HRESULT Guest::getAdditionsStatus(AdditionsRunLevelType_T aLevel, BOOL *aActive)
     750{
    834751    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    835752
     
    857774    return rc;
    858775}
    859 
    860 STDMETHODIMP Guest::SetCredentials(IN_BSTR aUserName, IN_BSTR aPassword,
    861                                    IN_BSTR aDomain, BOOL aAllowInteractiveLogon)
    862 {
    863     AutoCaller autoCaller(this);
    864     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    865 
     776HRESULT Guest::setCredentials(const com::Utf8Str &aUserName, const com::Utf8Str &aPassword,
     777                              const com::Utf8Str &aDomain, BOOL aAllowInteractiveLogon)
     778{
    866779    /* Check for magic domain names which are used to pass encryption keys to the disk. */
    867780    if (Utf8Str(aDomain) == "@@disk")
    868         return mParent->i_setDiskEncryptionKeys(Utf8Str(aPassword));
     781        return mParent->i_setDiskEncryptionKeys(aPassword);
    869782    else if (Utf8Str(aDomain) == "@@mem")
    870783    {
     
    886799
    887800                pVMMDevPort->pfnSetCredentials(pVMMDevPort,
    888                                                Utf8Str(aUserName).c_str(),
    889                                                Utf8Str(aPassword).c_str(),
    890                                                Utf8Str(aDomain).c_str(),
     801                                               aUserName.c_str(),
     802                                               aPassword.c_str(),
     803                                               aDomain.c_str(),
    891804                                               u32Flags);
    892805                return S_OK;
     
    910823 * @param aOsType
    911824 */
    912 void Guest::setAdditionsInfo(Bstr aInterfaceVersion, VBOXOSTYPE aOsType)
     825void Guest::i_setAdditionsInfo(com::Utf8Str aInterfaceVersion, VBOXOSTYPE aOsType)
    913826{
    914827    RTTIMESPEC TimeSpecTS;
     
    955868             * interface version.
    956869             */
    957             facilityUpdate(VBoxGuestFacilityType_Graphics, VBoxGuestFacilityStatus_Active,  0 /*fFlags*/, &TimeSpecTS);
     870            i_facilityUpdate(VBoxGuestFacilityType_Graphics, VBoxGuestFacilityStatus_Active,  0 /*fFlags*/, &TimeSpecTS);
    958871        }
    959872    }
     
    975888     * should come in pretty quickly after this update, normally.
    976889     */
    977     facilityUpdate(VBoxGuestFacilityType_Graphics,
    978                    facilityIsActive(VBoxGuestFacilityType_VBoxGuestDriver)
    979                    ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
    980                    0 /*fFlags*/, &TimeSpecTS); /** @todo the timestamp isn't gonna be right here on saved state restore. */
     890    i_facilityUpdate(VBoxGuestFacilityType_Graphics,
     891                     i_facilityIsActive(VBoxGuestFacilityType_VBoxGuestDriver)
     892                     ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
     893                     0 /*fFlags*/, &TimeSpecTS); /** @todo the timestamp isn't gonna be right here on saved state restore. */
    981894
    982895    /*
     
    1007920 * @param   a_fFeatures             See VBoxGuestInfo2::additionsFeatures.
    1008921 */
    1009 void Guest::setAdditionsInfo2(uint32_t a_uFullVersion, const char *a_pszName, uint32_t a_uRevision, uint32_t a_fFeatures)
    1010 {
    1011     AutoCaller autoCaller(this);
    1012     AssertComRCReturnVoid(autoCaller.rc());
    1013 
     922void Guest::i_setAdditionsInfo2(uint32_t a_uFullVersion, const char *a_pszName, uint32_t a_uRevision, uint32_t a_fFeatures)
     923{
    1014924    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    1015925
    1016926    if (a_uFullVersion)
    1017927    {
    1018         mData.mAdditionsVersionNew  = BstrFmt(*a_pszName ? "%u.%u.%u_%s" : "%u.%u.%u",
     928        mData.mAdditionsVersionNew  = Utf8Str(BstrFmt(*a_pszName ? "%u.%u.%u_%s" : "%u.%u.%u",
    1019929                                              VBOX_FULL_VERSION_GET_MAJOR(a_uFullVersion),
    1020930                                              VBOX_FULL_VERSION_GET_MINOR(a_uFullVersion),
    1021931                                              VBOX_FULL_VERSION_GET_BUILD(a_uFullVersion),
    1022                                               a_pszName);
     932                                              a_pszName));
    1023933        mData.mAdditionsVersionFull = a_uFullVersion;
    1024934        mData.mAdditionsRevision    = a_uRevision;
     
    1035945}
    1036946
    1037 bool Guest::facilityIsActive(VBoxGuestFacilityType enmFacility)
     947bool Guest::i_facilityIsActive(VBoxGuestFacilityType enmFacility)
    1038948{
    1039949    Assert(enmFacility < INT32_MAX);
     
    1047957}
    1048958
    1049 void Guest::facilityUpdate(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus,
    1050                            uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)
     959void Guest::i_facilityUpdate(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus,
     960                             uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)
    1051961{
    1052962    AssertReturnVoid(   a_enmFacility < VBoxGuestFacilityType_All
     
    1089999 * @param   cbDetails           Size (in bytes) of state details. Pass 0 if not used.
    10901000 */
    1091 void Guest::onUserStateChange(Bstr aUser, Bstr aDomain, VBoxGuestUserState enmState,
    1092                               const uint8_t *puDetails, uint32_t cbDetails)
     1001void Guest::i_onUserStateChange(Bstr aUser, Bstr aDomain, VBoxGuestUserState enmState,
     1002                                const uint8_t *puDetails, uint32_t cbDetails)
    10931003{
    10941004    LogFlowThisFunc(("\n"));
     
    11181028 * @thread  The emulation thread.
    11191029 */
    1120 void Guest::setAdditionsStatus(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus,
    1121                                uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)
     1030void Guest::i_setAdditionsStatus(VBoxGuestFacilityType a_enmFacility, VBoxGuestFacilityStatus a_enmStatus,
     1031                                 uint32_t a_fFlags, PCRTTIMESPEC a_pTimeSpecTS)
    11221032{
    11231033    Assert(   a_enmFacility > VBoxGuestFacilityType_Unknown
     
    11341044    if (a_enmFacility == VBoxGuestFacilityType_All)
    11351045        for (FacilityMapIter it = mData.mFacilityMap.begin(); it != mData.mFacilityMap.end(); ++it)
    1136             facilityUpdate((VBoxGuestFacilityType)it->first, a_enmStatus, a_fFlags, a_pTimeSpecTS);
     1046            i_facilityUpdate((VBoxGuestFacilityType)it->first, a_enmStatus, a_fFlags, a_pTimeSpecTS);
    11371047    else /* Update one facility only. */
    1138         facilityUpdate(a_enmFacility, a_enmStatus, a_fFlags, a_pTimeSpecTS);
     1048        i_facilityUpdate(a_enmFacility, a_enmStatus, a_fFlags, a_pTimeSpecTS);
    11391049
    11401050    /*
    11411051     * Recalc the runlevel.
    11421052     */
    1143     if (facilityIsActive(VBoxGuestFacilityType_VBoxTrayClient))
     1053    if (i_facilityIsActive(VBoxGuestFacilityType_VBoxTrayClient))
    11441054        mData.mAdditionsRunLevel = AdditionsRunLevelType_Desktop;
    1145     else if (facilityIsActive(VBoxGuestFacilityType_VBoxService))
     1055    else if (i_facilityIsActive(VBoxGuestFacilityType_VBoxService))
    11461056        mData.mAdditionsRunLevel = AdditionsRunLevelType_Userland;
    1147     else if (facilityIsActive(VBoxGuestFacilityType_VBoxGuestDriver))
     1057    else if (i_facilityIsActive(VBoxGuestFacilityType_VBoxGuestDriver))
    11481058        mData.mAdditionsRunLevel = AdditionsRunLevelType_System;
    11491059    else
     
    11561066 * @param   fCaps       Guest capability bit mask (VMMDEV_GUEST_SUPPORTS_XXX).
    11571067 */
    1158 void Guest::setSupportedFeatures(uint32_t aCaps)
     1068void Guest::i_setSupportedFeatures(uint32_t aCaps)
    11591069{
    11601070    AutoCaller autoCaller(this);
     
    11691079    RTTimeNow(&TimeSpecTS);
    11701080
    1171     facilityUpdate(VBoxGuestFacilityType_Seamless,
    1172                    aCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
    1173                    0 /*fFlags*/, &TimeSpecTS);
     1081    i_facilityUpdate(VBoxGuestFacilityType_Seamless,
     1082                     aCaps & VMMDEV_GUEST_SUPPORTS_SEAMLESS ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
     1083                     0 /*fFlags*/, &TimeSpecTS);
    11741084    /** @todo Add VMMDEV_GUEST_SUPPORTS_GUEST_HOST_WINDOW_MAPPING */
    1175     facilityUpdate(VBoxGuestFacilityType_Graphics,
    1176                    aCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
    1177                    0 /*fFlags*/, &TimeSpecTS);
    1178 }
    1179 
     1085    i_facilityUpdate(VBoxGuestFacilityType_Graphics,
     1086                     aCaps & VMMDEV_GUEST_SUPPORTS_GRAPHICS ? VBoxGuestFacilityStatus_Active : VBoxGuestFacilityStatus_Inactive,
     1087                     0 /*fFlags*/, &TimeSpecTS);
     1088}
     1089
  • trunk/src/VBox/Main/src-client/GuestSessionImpl.cpp

    r51612 r52082  
    913913        return VERR_COM_UNEXPECTED;
    914914
    915     Console *pConsole = mParent->getConsole();
     915    Console *pConsole = mParent->i_getConsole();
    916916    AssertPtr(pConsole);
    917917
     
    12891289        return VERR_COM_UNEXPECTED;
    12901290
    1291     Console *pConsole = mParent->getConsole();
     1291    Console *pConsole = mParent->i_getConsole();
    12921292    AssertPtr(pConsole);
    12931293
     
    19291929        return VERR_COM_UNEXPECTED;
    19301930
    1931     rc = pProcess->init(mParent->getConsole() /* Console */, this /* Session */,
     1931    rc = pProcess->init(mParent->i_getConsole() /* Console */, this /* Session */,
    19321932                        uNewProcessID, procInfo);
    19331933    if (RT_FAILURE(rc))
     
    20032003
    20042004#ifndef VBOX_GUESTCTRL_TEST_CASE
    2005     ComObjPtr<Console> pConsole = mParent->getConsole();
     2005    ComObjPtr<Console> pConsole = mParent->i_getConsole();
    20062006    Assert(!pConsole.isNull());
    20072007
     
    21312131    Assert(!pGuest.isNull());
    21322132
    2133     uint32_t uVerAdditions = pGuest->getAdditionsVersion();
     2133    uint32_t uVerAdditions = pGuest->i_getAdditionsVersion();
    21342134    uint32_t uVBoxMajor    = VBOX_FULL_VERSION_GET_MAJOR(uVerAdditions);
    21352135    uint32_t uVBoxMinor    = VBOX_FULL_VERSION_GET_MINOR(uVerAdditions);
     
    23912391
    23922392    /* Remove ourselves from the session list. */
    2393     int rc2 = mParent->sessionRemove(this);
     2393    int rc2 = mParent->i_sessionRemove(this);
    23942394    if (rc2 == VERR_NOT_FOUND) /* Not finding the session anymore isn't critical. */
    23952395        rc2 = VINF_SUCCESS;
  • trunk/src/VBox/Main/src-client/GuestSessionImplTasks.cpp

    r51612 r52082  
    7676                                       const Utf8Str &strPath, Utf8Str &strValue)
    7777{
    78     ComObjPtr<Console> pConsole = pGuest->getConsole();
     78    ComObjPtr<Console> pConsole = pGuest->i_getConsole();
    7979    const ComPtr<IMachine> pMachine = pConsole->i_machine();
    8080
  • trunk/src/VBox/Main/src-client/VMMDevInterface.cpp

    r52064 r52082  
    163163    AssertPtrReturnVoid(guest);
    164164
    165     guest->setAdditionsStatus((VBoxGuestFacilityType)uFacility, (VBoxGuestFacilityStatus)uStatus, fFlags, pTimeSpecTS);
     165    guest->i_setAdditionsStatus((VBoxGuestFacilityType)uFacility, (VBoxGuestFacilityStatus)uStatus, fFlags, pTimeSpecTS);
    166166    pConsole->i_onAdditionsStateChange();
    167167}
     
    185185    AssertPtrReturnVoid(pGuest);
    186186
    187     pGuest->onUserStateChange(Bstr(pszUser), Bstr(pszDomain), (VBoxGuestUserState)uState,
    188                               puDetails, cbDetails);
     187    pGuest->i_onUserStateChange(Bstr(pszUser), Bstr(pszDomain), (VBoxGuestUserState)uState,
     188                                puDetails, cbDetails);
    189189}
    190190
     
    215215        char version[16];
    216216        RTStrPrintf(version, sizeof(version), "%d", guestInfo->interfaceVersion);
    217         guest->setAdditionsInfo(Bstr(version), guestInfo->osType);
     217        guest->i_setAdditionsInfo(Bstr(version), guestInfo->osType);
    218218
    219219        /*
     
    232232         * or driver unload.
    233233         */
    234         guest->setAdditionsInfo(Bstr(), guestInfo->osType); /* Clear interface version + OS type. */
     234        guest->i_setAdditionsInfo(Bstr(), guestInfo->osType); /* Clear interface version + OS type. */
    235235        /** @todo Would be better if GuestImpl.cpp did all this in the above method call
    236236         *        while holding down the. */
    237         guest->setAdditionsInfo2(0, "", 0,  0); /* Clear Guest Additions version. */
     237        guest->i_setAdditionsInfo2(0, "", 0,  0); /* Clear Guest Additions version. */
    238238        RTTIMESPEC TimeSpecTS;
    239239        RTTimeNow(&TimeSpecTS);
    240         guest->setAdditionsStatus(VBoxGuestFacilityType_All, VBoxGuestFacilityStatus_Inactive, 0 /*fFlags*/, &TimeSpecTS);
     240        guest->i_setAdditionsStatus(VBoxGuestFacilityType_All, VBoxGuestFacilityStatus_Inactive, 0 /*fFlags*/, &TimeSpecTS);
    241241        pConsole->i_onAdditionsStateChange();
    242242    }
     
    258258
    259259    /* Just pass it on... */
    260     pGuest->setAdditionsInfo2(uFullVersion, pszName, uRevision, fFeatures);
     260    pGuest->i_setAdditionsInfo2(uFullVersion, pszName, uRevision, fFeatures);
    261261
    262262    /*
     
    289289     * Report our current capabilities (and assume none is active yet).
    290290     */
    291     pGuest->setSupportedFeatures(newCapabilities);
     291    pGuest->i_setSupportedFeatures(newCapabilities);
    292292
    293293    /*
     
    540540    AssertPtrReturn(guest, VERR_GENERAL_FAILURE);
    541541
    542     *pfPageFusionEnabled = !!guest->isPageFusionEnabled();
     542    *pfPageFusionEnabled = !!guest->i_isPageFusionEnabled();
    543543    return VINF_SUCCESS;
    544544}
     
    564564
    565565    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_IDLE)
    566         guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUIDLE, pGuestStats->u32CpuLoad_Idle);
     566        guest->i_setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUIDLE, pGuestStats->u32CpuLoad_Idle);
    567567
    568568    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_KERNEL)
    569         guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUKERNEL, pGuestStats->u32CpuLoad_Kernel);
     569        guest->i_setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUKERNEL, pGuestStats->u32CpuLoad_Kernel);
    570570
    571571    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_CPU_LOAD_USER)
    572         guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUUSER, pGuestStats->u32CpuLoad_User);
     572        guest->i_setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_CPUUSER, pGuestStats->u32CpuLoad_User);
    573573
    574574
     
    577577     *        preCollect().  I might be wrong ofc, this is convoluted code... */
    578578    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_TOTAL)
    579         guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMTOTAL, pGuestStats->u32PhysMemTotal);
     579        guest->i_setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMTOTAL, pGuestStats->u32PhysMemTotal);
    580580
    581581    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_AVAIL)
    582         guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMFREE, pGuestStats->u32PhysMemAvail);
     582        guest->i_setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMFREE, pGuestStats->u32PhysMemAvail);
    583583
    584584    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PHYS_MEM_BALLOON)
    585         guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMBALLOON, pGuestStats->u32PhysMemBalloon);
     585        guest->i_setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMBALLOON, pGuestStats->u32PhysMemBalloon);
    586586
    587587    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_MEM_SYSTEM_CACHE)
    588         guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMCACHE, pGuestStats->u32MemSystemCache);
     588        guest->i_setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_MEMCACHE, pGuestStats->u32MemSystemCache);
    589589
    590590    if (pGuestStats->u32StatCaps & VBOX_GUEST_STAT_PAGE_FILE_SIZE)
    591         guest->setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_PAGETOTAL, pGuestStats->u32PageFileSize);
     591        guest->i_setStatistic(pGuestStats->u32CpuId, GUESTSTATTYPE_PAGETOTAL, pGuestStats->u32PageFileSize);
    592592
    593593    return VINF_SUCCESS;
  • trunk/src/VBox/Main/src-client/xpcom/module.cpp

    r52064 r52082  
    6666
    6767#ifndef VBOX_COM_INPROC_API_CLIENT
    68 NS_DECL_CLASSINFO(Guest)
    69 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Guest, IGuest)
    7068NS_DECL_CLASSINFO(Keyboard)
    7169NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Keyboard, IKeyboard)
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