VirtualBox

Changeset 49871 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Dec 10, 2013 4:49:59 PM (11 years ago)
Author:
vboxsync
Message:

6813 - User server side API wrapper code in all interfaces.. stage 4 rev 1

Location:
trunk/src/VBox/Main/src-server
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/AudioAdapterImpl.cpp

    r44528 r49871  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2626#include "AutoCaller.h"
    2727#include "Logging.h"
     28
     29struct AudioAdapter::Data
     30{
     31    Data();
     32        BOOL mEnabled;
     33        AudioDriverType_T mAudioDriver;
     34        AudioControllerType_T mAudioController;
     35};
    2836
    2937// constructor / destructor
     
    180188/////////////////////////////////////////////////////////////////////////////
    181189
    182 STDMETHODIMP AudioAdapter::COMGETTER(Enabled)(BOOL *aEnabled)
    183 {
    184     CheckComArgOutPointerValid(aEnabled);
    185 
    186     AutoCaller autoCaller(this);
    187     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    188 
     190HRESULT AudioAdapter::getEnabled(BOOL *aEnabled)
     191{
    189192    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    190193
     
    194197}
    195198
    196 STDMETHODIMP AudioAdapter::COMSETTER(Enabled)(BOOL aEnabled)
    197 {
    198     AutoCaller autoCaller(this);
    199     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    200 
     199HRESULT AudioAdapter::setEnabled(BOOL aEnabled)
     200{
    201201    /* the machine needs to be mutable */
    202202    AutoMutableStateDependency adep(mParent);
     
    218218}
    219219
    220 STDMETHODIMP AudioAdapter::COMGETTER(AudioDriver)(AudioDriverType_T *aAudioDriver)
    221 {
    222     CheckComArgOutPointerValid(aAudioDriver);
    223 
    224     AutoCaller autoCaller(this);
    225     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    226 
     220HRESULT AudioAdapter::getAudioDriver(AudioDriverType_T *aAudioDriver)
     221{
    227222    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    228223
     
    232227}
    233228
    234 STDMETHODIMP AudioAdapter::COMSETTER(AudioDriver)(AudioDriverType_T aAudioDriver)
    235 {
    236     AutoCaller autoCaller(this);
    237     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     229HRESULT AudioAdapter::setAudioDriver(AudioDriverType_T aAudioDriver)
     230{
    238231
    239232    /* the machine needs to be mutable */
     
    251244            mData.backup();
    252245            mData->mAudioDriver = aAudioDriver;
    253 
    254246            alock.release();
    255247            AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     
    266258}
    267259
    268 STDMETHODIMP AudioAdapter::COMGETTER(AudioController)(AudioControllerType_T *aAudioController)
    269 {
    270     CheckComArgOutPointerValid(aAudioController);
    271 
    272     AutoCaller autoCaller(this);
    273     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    274 
     260HRESULT AudioAdapter::getAudioController(AudioControllerType_T *aAudioController)
     261{
    275262    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    276263
     
    280267}
    281268
    282 STDMETHODIMP AudioAdapter::COMSETTER(AudioController)(AudioControllerType_T aAudioController)
    283 {
    284     AutoCaller autoCaller(this);
    285     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    286 
     269HRESULT AudioAdapter::setAudioController(AudioControllerType_T aAudioController)
     270{
    287271    /* the machine needs to be mutable */
    288272    AutoMutableStateDependency adep(mParent);
     
    306290                mData.backup();
    307291                mData->mAudioController = aAudioController;
    308 
    309292                alock.release();
    310293                AutoWriteLock mlock(mParent COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     
    346329 *  @note Locks this object for writing.
    347330 */
    348 HRESULT AudioAdapter::loadSettings(const settings::AudioAdapter &data)
     331HRESULT AudioAdapter::i_loadSettings(const settings::AudioAdapter &data)
    349332{
    350333    AutoCaller autoCaller(this);
     
    378361 *  @note Locks this object for reading.
    379362 */
    380 HRESULT AudioAdapter::saveSettings(settings::AudioAdapter &data)
     363HRESULT AudioAdapter::i_saveSettings(settings::AudioAdapter &data)
    381364{
    382365    AutoCaller autoCaller(this);
     
    394377 *  @note Locks this object for writing.
    395378 */
    396 void AudioAdapter::rollback()
     379void AudioAdapter::i_rollback()
    397380{
    398381    /* sanity */
     
    409392 *  for writing) if there is one.
    410393 */
    411 void AudioAdapter::commit()
     394void AudioAdapter::i_commit()
    412395{
    413396    /* sanity */
     
    438421 *  represented by @a aThat (locked for reading).
    439422 */
    440 void AudioAdapter::copyFrom(AudioAdapter *aThat)
     423void AudioAdapter::i_copyFrom(AudioAdapter *aThat)
    441424{
    442425    AssertReturnVoid (aThat != NULL);
  • trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp

    r49644 r49871  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4949/////////////////////////////////////////////////////////////////////////////
    5050
     51DEFINE_EMPTY_CTOR_DTOR(BIOSSettings)
     52
    5153HRESULT BIOSSettings::FinalConstruct()
    5254{
     
    182184/////////////////////////////////////////////////////////////////////////////
    183185
    184 STDMETHODIMP BIOSSettings::COMGETTER(LogoFadeIn)(BOOL *enabled)
    185 {
    186     if (!enabled)
    187         return E_POINTER;
    188 
    189     AutoCaller autoCaller(this);
    190     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    191 
     186
     187HRESULT BIOSSettings::getLogoFadeIn(BOOL *enabled)
     188{
    192189    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    193190
     
    197194}
    198195
    199 STDMETHODIMP BIOSSettings::COMSETTER(LogoFadeIn)(BOOL enable)
    200 {
    201     AutoCaller autoCaller(this);
    202     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    203 
     196HRESULT BIOSSettings::setLogoFadeIn(BOOL enable)
     197{
    204198    /* the machine needs to be mutable */
    205199    AutoMutableStateDependency adep(m->pMachine);
     
    218212}
    219213
    220 STDMETHODIMP BIOSSettings::COMGETTER(LogoFadeOut)(BOOL *enabled)
    221 {
    222     if (!enabled)
    223         return E_POINTER;
    224 
    225     AutoCaller autoCaller(this);
    226     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    227 
     214
     215HRESULT BIOSSettings::getLogoFadeOut(BOOL *enabled)
     216{
    228217    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    229218
     
    233222}
    234223
    235 STDMETHODIMP BIOSSettings::COMSETTER(LogoFadeOut)(BOOL enable)
    236 {
    237     AutoCaller autoCaller(this);
    238     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    239 
     224
     225HRESULT BIOSSettings::setLogoFadeOut(BOOL enable)
     226{
    240227    /* the machine needs to be mutable */
    241228    AutoMutableStateDependency adep(m->pMachine);
     
    254241}
    255242
    256 STDMETHODIMP BIOSSettings::COMGETTER(LogoDisplayTime)(ULONG *displayTime)
     243
     244HRESULT BIOSSettings::getLogoDisplayTime(ULONG *displayTime)
    257245{
    258246    if (!displayTime)
    259247        return E_POINTER;
    260248
    261     AutoCaller autoCaller(this);
    262     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    263 
    264249    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    265250
     
    269254}
    270255
    271 STDMETHODIMP BIOSSettings::COMSETTER(LogoDisplayTime)(ULONG displayTime)
    272 {
    273     AutoCaller autoCaller(this);
    274     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    275 
     256
     257HRESULT BIOSSettings::setLogoDisplayTime(ULONG displayTime)
     258{
    276259    /* the machine needs to be mutable */
    277260    AutoMutableStateDependency adep(m->pMachine);
     
    290273}
    291274
    292 STDMETHODIMP BIOSSettings::COMGETTER(LogoImagePath)(BSTR *imagePath)
    293 {
    294     if (!imagePath)
    295         return E_POINTER;
    296 
    297     AutoCaller autoCaller(this);
    298     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    299 
    300     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    301 
    302     m->bd->strLogoImagePath.cloneTo(imagePath);
    303     return S_OK;
    304 }
    305 
    306 STDMETHODIMP BIOSSettings::COMSETTER(LogoImagePath)(IN_BSTR imagePath)
    307 {
    308     /* NULL strings are not allowed */
    309     if (!imagePath)
    310         return E_INVALIDARG;
    311 
    312     AutoCaller autoCaller(this);
    313     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    314 
     275
     276HRESULT BIOSSettings::getLogoImagePath(com::Utf8Str &imagePath)
     277{
     278    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     279
     280    imagePath = m->bd->strLogoImagePath;
     281    return S_OK;
     282}
     283
     284
     285HRESULT BIOSSettings::setLogoImagePath(const com::Utf8Str &imagePath)
     286{
    315287    /* the machine needs to be mutable */
    316288    AutoMutableStateDependency adep(m->pMachine);
     
    329301}
    330302
    331 STDMETHODIMP BIOSSettings::COMGETTER(BootMenuMode)(BIOSBootMenuMode_T *bootMenuMode)
    332 {
    333     if (!bootMenuMode)
    334         return E_POINTER;
    335 
    336     AutoCaller autoCaller(this);
    337     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    338 
     303HRESULT BIOSSettings::getBootMenuMode(BIOSBootMenuMode_T *bootMenuMode)
     304{
    339305    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    340306
     
    343309}
    344310
    345 STDMETHODIMP BIOSSettings::COMSETTER(BootMenuMode)(BIOSBootMenuMode_T bootMenuMode)
    346 {
    347     AutoCaller autoCaller(this);
    348     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    349 
     311
     312HRESULT BIOSSettings::setBootMenuMode(BIOSBootMenuMode_T bootMenuMode)
     313{
    350314    /* the machine needs to be mutable */
    351315    AutoMutableStateDependency adep(m->pMachine);
     
    364328}
    365329
    366 STDMETHODIMP BIOSSettings::COMGETTER(ACPIEnabled)(BOOL *enabled)
    367 {
    368     if (!enabled)
    369         return E_POINTER;
    370 
    371     AutoCaller autoCaller(this);
    372     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    373 
     330
     331HRESULT BIOSSettings::getACPIEnabled(BOOL *enabled)
     332{
    374333    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    375334
     
    379338}
    380339
    381 STDMETHODIMP BIOSSettings::COMSETTER(ACPIEnabled)(BOOL enable)
    382 {
    383     AutoCaller autoCaller(this);
    384     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    385 
     340
     341HRESULT BIOSSettings::setACPIEnabled(BOOL enable)
     342{
    386343    /* the machine needs to be mutable */
    387344    AutoMutableStateDependency adep(m->pMachine);
     
    400357}
    401358
    402 STDMETHODIMP BIOSSettings::COMGETTER(IOAPICEnabled)(BOOL *enabled)
    403 {
    404     if (!enabled)
    405         return E_POINTER;
    406 
    407     AutoCaller autoCaller(this);
    408     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    409 
    410     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    411 
    412     *enabled = m->bd->fIOAPICEnabled;
    413 
    414     return S_OK;
    415 }
    416 
    417 STDMETHODIMP BIOSSettings::COMSETTER(IOAPICEnabled)(BOOL enable)
    418 {
    419     AutoCaller autoCaller(this);
    420     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    421 
    422     /* the machine needs to be mutable */
    423     AutoMutableStateDependency adep(m->pMachine);
    424     if (FAILED(adep.rc())) return adep.rc();
    425 
    426     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    427 
    428     m->bd.backup();
    429     m->bd->fIOAPICEnabled = !!enable;
    430 
    431     alock.release();
    432     AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
    433     m->pMachine->setModified(Machine::IsModified_BIOS);
    434 
    435     return S_OK;
    436 }
    437 
    438 STDMETHODIMP BIOSSettings::COMGETTER(PXEDebugEnabled)(BOOL *enabled)
    439 {
    440     if (!enabled)
    441         return E_POINTER;
    442 
    443     AutoCaller autoCaller(this);
    444     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    445 
     359
     360HRESULT BIOSSettings::getIOAPICEnabled(BOOL *aIOAPICEnabled)
     361{
     362    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     363
     364    *aIOAPICEnabled = m->bd->fIOAPICEnabled;
     365
     366    return S_OK;
     367}
     368
     369
     370HRESULT BIOSSettings::setIOAPICEnabled(BOOL aIOAPICEnabled)
     371{
     372    /* the machine needs to be mutable */
     373    AutoMutableStateDependency adep(m->pMachine);
     374    if (FAILED(adep.rc())) return adep.rc();
     375
     376    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     377
     378    m->bd.backup();
     379
     380    m->bd->fIOAPICEnabled = !!aIOAPICEnabled;
     381    alock.release();
     382    AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);  // mParent is const, needs no locking
     383    m->pMachine->setModified(Machine::IsModified_BIOS);
     384
     385    return S_OK;
     386}
     387
     388
     389HRESULT BIOSSettings::getPXEDebugEnabled(BOOL *enabled)
     390{
    446391    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    447392
     
    451396}
    452397
    453 STDMETHODIMP BIOSSettings::COMSETTER(PXEDebugEnabled)(BOOL enable)
    454 {
    455     AutoCaller autoCaller(this);
    456     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    457 
     398
     399HRESULT BIOSSettings::setPXEDebugEnabled(BOOL enable)
     400{
    458401    /* the machine needs to be mutable */
    459402    AutoMutableStateDependency adep(m->pMachine);
     
    472415}
    473416
    474 STDMETHODIMP BIOSSettings::COMGETTER(TimeOffset)(LONG64 *offset)
    475 {
    476     if (!offset)
    477         return E_POINTER;
    478 
    479     AutoCaller autoCaller(this);
    480     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    481 
     417HRESULT BIOSSettings::getTimeOffset(LONG64 *offset)
     418{
    482419    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    483420
     
    487424}
    488425
    489 STDMETHODIMP BIOSSettings::COMSETTER(TimeOffset)(LONG64 offset)
    490 {
    491     AutoCaller autoCaller(this);
    492     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    493 
     426
     427HRESULT BIOSSettings::setTimeOffset(LONG64 offset)
     428{
    494429    /* the machine needs to be mutable */
    495430    AutoMutableStateDependency adep(m->pMachine);
     
    508443}
    509444
    510 STDMETHODIMP BIOSSettings::COMGETTER(NonVolatileStorageFile)(BSTR *pbstrPath)
    511 {
    512     CheckComArgOutPointerValid(pbstrPath);
    513 
    514     AutoCaller autoCaller(this);
    515     HRESULT hrc = autoCaller.rc();
    516     if (SUCCEEDED(hrc))
    517     {
    518         AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    519         Bstr bstrEmpty("");
    520         hrc = bstrEmpty.cloneToEx(pbstrPath);
    521     }
    522 
    523     return hrc;
     445HRESULT BIOSSettings::getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile)
     446{
     447    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     448
     449    aNonVolatileStorageFile = "";
     450
     451    return S_OK;
    524452}
    525453
     
    540468 *  @note Locks this object for writing.
    541469 */
    542 HRESULT BIOSSettings::loadSettings(const settings::BIOSSettings &data)
     470HRESULT BIOSSettings::i_loadSettings(const settings::BIOSSettings &data)
    543471{
    544472    AutoCaller autoCaller(this);
     
    560488 *  @note Locks this object for reading.
    561489 */
    562 HRESULT BIOSSettings::saveSettings(settings::BIOSSettings &data)
     490HRESULT BIOSSettings::i_saveSettings(settings::BIOSSettings &data)
    563491{
    564492    AutoCaller autoCaller(this);
     
    572500}
    573501
    574 void BIOSSettings::rollback()
     502void BIOSSettings::i_rollback()
    575503{
    576504    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    578506}
    579507
    580 void BIOSSettings::commit()
     508void BIOSSettings::i_commit()
    581509{
    582510    /* sanity */
     
    604532}
    605533
    606 void BIOSSettings::copyFrom (BIOSSettings *aThat)
     534void BIOSSettings::i_copyFrom (BIOSSettings *aThat)
    607535{
    608536    AssertReturnVoid (aThat != NULL);
     
    625553}
    626554
    627 void BIOSSettings::applyDefaults (GuestOSType *aOsType)
     555void BIOSSettings::i_applyDefaults (GuestOSType *aOsType)
    628556{
    629557    AssertReturnVoid (aOsType != NULL);
  • trunk/src/VBox/Main/src-server/HostImpl.cpp

    r49795 r49871  
    29992999        {
    30003000# ifdef VBOX_WITH_RESOURCE_USAGE_API
    3001             (*itOld)->unregisterMetrics(aCollector, this);
     3001            (*itOld)->i_unregisterMetrics(aCollector, this);
    30023002# endif
    30033003        }
     
    30083008     */
    30093009    for (itNew = list.begin(); itNew != list.end(); ++itNew)
    3010         (*itNew)->setVirtualBox(m->pParent);
     3010        (*itNew)->i_setVirtualBox(m->pParent);
    30113011    /* At this point listCopy will contain newly discovered interfaces only. */
    30123012    for (itNew = listCopy.begin(); itNew != listCopy.end(); ++itNew)
     
    30233023        {
    30243024# ifdef VBOX_WITH_RESOURCE_USAGE_API
    3025             (*itNew)->registerMetrics(aCollector, this);
     3025            (*itNew)->i_registerMetrics(aCollector, this);
    30263026# endif
    30273027        }
  • trunk/src/VBox/Main/src-server/HostNetworkInterfaceImpl.cpp

    r49400 r49871  
    1717 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1818 */
    19 
    2019#include "HostNetworkInterfaceImpl.h"
    2120#include "AutoCaller.h"
     
    3332#endif /* RT_OS_FREEBSD */
    3433
     34#include "VirtualBoxImpl.h"
     35
    3536// constructor / destructor
    3637/////////////////////////////////////////////////////////////////////////////
     
    7980
    8081    unconst(mInterfaceName) = aInterfaceName;
    81     unconst(mNetworkName) = composeNetworkName(aShortName);
     82    unconst(mNetworkName) = i_composeNetworkName(aShortName);
    8283    unconst(mShortName) = aShortName;
    8384    unconst(mGuid) = aGuid;
     
    9293#ifdef VBOX_WITH_RESOURCE_USAGE_API
    9394
    94 void HostNetworkInterface::registerMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)
     95void HostNetworkInterface::i_registerMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)
    9596{
    9697    LogFlowThisFunc(("mShortName={%ls}, mInterfaceName={%ls}, mGuid={%s}, mSpeedMbits=%u\n",
     
    137138}
    138139
    139 void HostNetworkInterface::unregisterMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)
     140void HostNetworkInterface::i_unregisterMetrics(PerformanceCollector *aCollector, ComPtr<IUnknown> objptr)
    140141{
    141142    LogFlowThisFunc(("mShortName={%ls}, mInterfaceName={%ls}, mGuid={%s}\n",
     
    175176}
    176177
    177 Bstr HostNetworkInterface::composeNetworkName(const Utf8Str aShortName)
     178Bstr HostNetworkInterface::i_composeNetworkName(const Utf8Str aShortName)
    178179{
    179180    return Utf8Str("HostInterfaceNetworking-").append(aShortName);
     
    203204    if (pIf->szShortName[0])
    204205    {
    205         unconst(mNetworkName) = composeNetworkName(pIf->szShortName);
     206        unconst(mNetworkName) = i_composeNetworkName(pIf->szShortName);
    206207        unconst(mShortName)   = pIf->szShortName;
    207208    }
    208209    else
    209210    {
    210         unconst(mNetworkName) = composeNetworkName(aInterfaceName);
     211        unconst(mNetworkName) = i_composeNetworkName(aInterfaceName);
    211212        unconst(mShortName)   = aInterfaceName;
    212213    }
     
    235236#endif
    236237
    237 // IHostNetworkInterface properties
     238// wrapped IHostNetworkInterface properties
    238239/////////////////////////////////////////////////////////////////////////////
    239 
    240240/**
    241241 * Returns the name of the host network interface.
    242242 *
    243243 * @returns COM status code
    244  * @param   aInterfaceName address of result pointer
    245  */
    246 STDMETHODIMP HostNetworkInterface::COMGETTER(Name)(BSTR *aInterfaceName)
    247 {
    248     CheckComArgOutPointerValid(aInterfaceName);
    249 
    250     AutoCaller autoCaller(this);
    251     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    252 
    253     mInterfaceName.cloneTo(aInterfaceName);
    254 
     244 * @param   aInterfaceName - Interface Name
     245 */
     246
     247HRESULT HostNetworkInterface::getName(com::Utf8Str &aInterfaceName)
     248{
     249    aInterfaceName = mInterfaceName;
    255250    return S_OK;
    256251}
     
    259254 * Returns the short name of the host network interface.
    260255 *
    261  * @returns COM status code
    262  * @param   aShortName address of result pointer
    263  */
    264 STDMETHODIMP HostNetworkInterface::COMGETTER(ShortName)(BSTR *aShortName)
    265 {
    266     CheckComArgOutPointerValid(aShortName);
    267 
    268     AutoCaller autoCaller(this);
    269     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    270 
    271     mShortName.cloneTo(aShortName);
     256 * @returns  COM status code
     257 * @param   aShortName Short Name
     258 */
     259
     260HRESULT HostNetworkInterface::getShortName(com::Utf8Str &aShortName)
     261{
     262    aShortName = mShortName;
    272263
    273264    return S_OK;
     
    278269 *
    279270 * @returns COM status code
    280  * @param   aGuid address of result pointer
    281  */
    282 STDMETHODIMP HostNetworkInterface::COMGETTER(Id)(BSTR *aGuid)
    283 {
    284     CheckComArgOutPointerValid(aGuid);
    285 
    286     AutoCaller autoCaller(this);
    287     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    288 
    289     mGuid.toUtf16().cloneTo(aGuid);
    290 
    291     return S_OK;
    292 }
    293 
    294 STDMETHODIMP HostNetworkInterface::COMGETTER(DHCPEnabled)(BOOL *aDHCPEnabled)
    295 {
    296     CheckComArgOutPointerValid(aDHCPEnabled);
    297 
    298     AutoCaller autoCaller(this);
    299     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    300 
     271 * @param   aGuid GUI Id
     272 */
     273HRESULT HostNetworkInterface::getId(com::Guid &aGuiId)
     274{
     275    aGuiId = mGuid;
     276
     277    return S_OK;
     278}
     279
     280HRESULT HostNetworkInterface::getDHCPEnabled(BOOL *aDHCPEnabled)
     281{
    301282    *aDHCPEnabled = m.dhcpEnabled;
    302283
     
    309290 *
    310291 * @returns COM status code
    311  * @param   aIPAddress address of result pointer
    312  */
    313 STDMETHODIMP HostNetworkInterface::COMGETTER(IPAddress)(BSTR *aIPAddress)
    314 {
    315     CheckComArgOutPointerValid(aIPAddress);
    316 
    317     AutoCaller autoCaller(this);
    318     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    319 
     292 * @param   aIPAddress  Address name
     293 */
     294HRESULT HostNetworkInterface::getIPAddress(com::Utf8Str &aIPAddress)
     295{
    320296    in_addr tmp;
    321297#if defined(RT_OS_WINDOWS)
     
    327303    if (addr)
    328304    {
    329         Bstr(addr).detachTo(aIPAddress);
     305        aIPAddress = addr;
    330306        return S_OK;
    331307    }
     
    338314 *
    339315 * @returns COM status code
    340  * @param   aNetworkMask address of result pointer
    341  */
    342 STDMETHODIMP HostNetworkInterface::COMGETTER(NetworkMask)(BSTR *aNetworkMask)
    343 {
    344     CheckComArgOutPointerValid(aNetworkMask);
    345 
    346     AutoCaller autoCaller(this);
    347     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     316 * @param   aNetworkMask name.
     317 */
     318HRESULT HostNetworkInterface::getNetworkMask(com::Utf8Str &aNetworkMask)
     319{
    348320
    349321    in_addr tmp;
     
    356328    if (addr)
    357329    {
    358         Bstr(addr).detachTo(aNetworkMask);
     330        aNetworkMask = Utf8Str(addr);
    359331        return S_OK;
    360332    }
     
    363335}
    364336
    365 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6Supported)(BOOL *aIPV6Supported)
    366 {
    367     CheckComArgOutPointerValid(aIPV6Supported);
     337HRESULT HostNetworkInterface::getIPV6Supported(BOOL *aIPV6Supported)
     338{
    368339#if defined(RT_OS_WINDOWS)
    369340    *aIPV6Supported = FALSE;
     
    379350 *
    380351 * @returns COM status code
    381  * @param   aIPV6Address address of result pointer
    382  */
    383 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6Address)(BSTR *aIPV6Address)
    384 {
    385     CheckComArgOutPointerValid(aIPV6Address);
    386 
    387     AutoCaller autoCaller(this);
    388     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    389 
    390     m.IPV6Address.cloneTo(aIPV6Address);
    391 
     352 * @param   aIPV6Address
     353 */
     354HRESULT HostNetworkInterface::getIPV6Address(com::Utf8Str &aIPV6Address)
     355{
     356    aIPV6Address = m.IPV6Address;
    392357    return S_OK;
    393358}
     
    399364 * @param   aIPV6Mask address of result pointer
    400365 */
    401 STDMETHODIMP HostNetworkInterface::COMGETTER(IPV6NetworkMaskPrefixLength)(ULONG *aIPV6NetworkMaskPrefixLength)
    402 {
    403     CheckComArgOutPointerValid(aIPV6NetworkMaskPrefixLength);
    404 
    405     AutoCaller autoCaller(this);
    406     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    407 
     366HRESULT HostNetworkInterface::getIPV6NetworkMaskPrefixLength(ULONG *aIPV6NetworkMaskPrefixLength)
     367{
    408368    *aIPV6NetworkMaskPrefixLength = m.IPV6NetworkMaskPrefixLength;
    409369
     
    415375 *
    416376 * @returns COM status code
    417  * @param   aHardwareAddress address of result pointer
    418  */
    419 STDMETHODIMP HostNetworkInterface::COMGETTER(HardwareAddress)(BSTR *aHardwareAddress)
    420 {
    421     CheckComArgOutPointerValid(aHardwareAddress);
    422 
    423     AutoCaller autoCaller(this);
    424     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    425 
    426     m.hardwareAddress.cloneTo(aHardwareAddress);
    427 
     377 * @param   aHardwareAddress hardware address
     378 */
     379HRESULT HostNetworkInterface::getHardwareAddress(com::Utf8Str &aHardwareAddress)
     380{
     381    aHardwareAddress = m.hardwareAddress;
    428382    return S_OK;
    429383}
     
    435389 * @param   aType address of result pointer
    436390 */
    437 STDMETHODIMP HostNetworkInterface::COMGETTER(MediumType)(HostNetworkInterfaceMediumType_T *aType)
    438 {
    439     CheckComArgOutPointerValid(aType);
    440 
    441     AutoCaller autoCaller(this);
    442     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    443 
     391HRESULT HostNetworkInterface::getMediumType(HostNetworkInterfaceMediumType_T *aType)
     392{
    444393    *aType = m.mediumType;
    445394
     
    453402 * @param   aStatus address of result pointer
    454403 */
    455 STDMETHODIMP HostNetworkInterface::COMGETTER(Status)(HostNetworkInterfaceStatus_T *aStatus)
    456 {
    457     CheckComArgOutPointerValid(aStatus);
    458 
    459     AutoCaller autoCaller(this);
    460     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    461 
     404HRESULT HostNetworkInterface::getStatus(HostNetworkInterfaceStatus_T *aStatus)
     405{
    462406    *aStatus = m.status;
    463407
     
    471415 * @param   aType address of result pointer
    472416 */
    473 STDMETHODIMP HostNetworkInterface::COMGETTER(InterfaceType)(HostNetworkInterfaceType_T *aType)
    474 {
    475     CheckComArgOutPointerValid(aType);
    476 
    477     AutoCaller autoCaller(this);
    478     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    479 
     417HRESULT HostNetworkInterface::getInterfaceType(HostNetworkInterfaceType_T *aType)
     418{
    480419    *aType = mIfType;
    481420
     
    484423}
    485424
    486 STDMETHODIMP HostNetworkInterface::COMGETTER(NetworkName)(BSTR *aNetworkName)
    487 {
    488     CheckComArgOutPointerValid(aNetworkName);
    489 
    490     AutoCaller autoCaller(this);
    491     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    492 
    493     mNetworkName.cloneTo(aNetworkName);
    494 
    495     return S_OK;
    496 }
    497 
    498 STDMETHODIMP HostNetworkInterface::EnableStaticIPConfig(IN_BSTR aIPAddress, IN_BSTR aNetMask)
     425HRESULT HostNetworkInterface::getNetworkName(com::Utf8Str &aNetworkName)
     426{
     427    aNetworkName = mNetworkName;
     428
     429    return S_OK;
     430}
     431
     432HRESULT HostNetworkInterface::enableStaticIPConfig(const com::Utf8Str &aIPAddress,
     433                                                   const com::Utf8Str &aNetworkMask)
    499434{
    500435#ifndef VBOX_WITH_HOSTNETIF_API
    501436    return E_NOTIMPL;
    502437#else
    503     AutoCaller autoCaller(this);
    504     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    505 
    506     if (Bstr(aIPAddress).isEmpty())
     438    if (aIPAddress.isEmpty())
    507439    {
    508440        if (m.IPAddress)
     
    524456
    525457    ULONG ip, mask;
    526     ip = inet_addr(Utf8Str(aIPAddress).c_str());
     458    ip = inet_addr(aIPAddress.c_str());
    527459    if (ip != INADDR_NONE)
    528460    {
    529         if (Bstr(aNetMask).isEmpty())
     461        if (aNetworkMask.isEmpty())
    530462            mask = 0xFFFFFF;
    531463        else
    532             mask = inet_addr(Utf8Str(aNetMask).c_str());
     464            mask = inet_addr(aNetworkMask.c_str());
    533465        if (mask != INADDR_NONE)
    534466        {
     
    541473                m.realNetworkMask = mask;
    542474                if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPAddress", mInterfaceName.raw()).raw(),
    543                                                        Bstr(aIPAddress).raw())))
     475                                               Bstr(aIPAddress).raw())))
    544476                    return E_FAIL;
    545477                if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPNetMask", mInterfaceName.raw()).raw(),
    546                                                Bstr(aNetMask).raw())))
     478                                               Bstr(aNetworkMask).raw())))
    547479                    return E_FAIL;
    548480                return S_OK;
     
    560492}
    561493
    562 STDMETHODIMP HostNetworkInterface::EnableStaticIPConfigV6(IN_BSTR aIPV6Address, ULONG aIPV6MaskPrefixLength)
     494HRESULT HostNetworkInterface::enableStaticIPConfigV6(const com::Utf8Str &aIPV6Address,
     495                                                     ULONG aIPV6NetworkMaskPrefixLength)
    563496{
    564497#ifndef VBOX_WITH_HOSTNETIF_API
    565498    return E_NOTIMPL;
    566499#else
    567     if (!aIPV6Address)
     500    if (aIPV6NetworkMaskPrefixLength > 128)
    568501        return E_INVALIDARG;
    569     if (aIPV6MaskPrefixLength > 128)
    570         return E_INVALIDARG;
    571 
    572     AutoCaller autoCaller(this);
    573     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    574502
    575503    int rc = S_OK;
    576     if (m.realIPV6Address != aIPV6Address || m.realIPV6PrefixLength != aIPV6MaskPrefixLength)
    577     {
    578         if (aIPV6MaskPrefixLength == 0)
    579             aIPV6MaskPrefixLength = 64;
    580         rc = NetIfEnableStaticIpConfigV6(mVBox, this, m.IPV6Address.raw(), aIPV6Address, aIPV6MaskPrefixLength);
     504    if (m.realIPV6Address != aIPV6Address || m.realIPV6PrefixLength != aIPV6NetworkMaskPrefixLength)
     505    {
     506        BSTR bstr;
     507        aIPV6Address.cloneTo(&bstr);
     508        if (aIPV6NetworkMaskPrefixLength == 0)
     509            aIPV6NetworkMaskPrefixLength = 64;
     510        rc = NetIfEnableStaticIpConfigV6(mVBox, this, m.IPV6Address.raw(), bstr, aIPV6NetworkMaskPrefixLength);
    581511        if (RT_FAILURE(rc))
    582512        {
     
    587517        {
    588518            m.realIPV6Address = aIPV6Address;
    589             m.realIPV6PrefixLength = aIPV6MaskPrefixLength;
     519            m.realIPV6PrefixLength = aIPV6NetworkMaskPrefixLength;
    590520            if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPV6Address", mInterfaceName.raw()).raw(),
    591521                                           Bstr(aIPV6Address).raw())))
    592522                return E_FAIL;
    593523            if (FAILED(mVBox->SetExtraData(BstrFmt("HostOnly/%ls/IPV6NetMask", mInterfaceName.raw()).raw(),
    594                                            BstrFmt("%u", aIPV6MaskPrefixLength).raw())))
     524                                           BstrFmt("%u", aIPV6NetworkMaskPrefixLength).raw())))
    595525                return E_FAIL;
    596526        }
     
    601531}
    602532
    603 STDMETHODIMP HostNetworkInterface::EnableDynamicIPConfig()
     533HRESULT HostNetworkInterface::HostNetworkInterface::enableDynamicIPConfig()
    604534{
    605535#ifndef VBOX_WITH_HOSTNETIF_API
    606536    return E_NOTIMPL;
    607537#else
    608     AutoCaller autoCaller(this);
    609     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    610 
    611538    int rc = NetIfEnableDynamicIpConfig(mVBox, this);
    612539    if (RT_FAILURE(rc))
     
    619546}
    620547
    621 STDMETHODIMP HostNetworkInterface::DHCPRediscover()
     548HRESULT HostNetworkInterface::dHCPRediscover()
    622549{
    623550#ifndef VBOX_WITH_HOSTNETIF_API
    624551    return E_NOTIMPL;
    625552#else
     553    int rc = NetIfDhcpRediscover(mVBox, this);
     554    if (RT_FAILURE(rc))
     555    {
     556        LogRel(("Failed to DhcpRediscover with rc=%Rrc\n", rc));
     557        return rc == VERR_NOT_IMPLEMENTED ? E_NOTIMPL : E_FAIL;
     558    }
     559    return S_OK;
     560#endif
     561}
     562
     563HRESULT HostNetworkInterface::i_setVirtualBox(VirtualBox *pVBox)
     564{
    626565    AutoCaller autoCaller(this);
    627566    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    628567
    629     int rc = NetIfDhcpRediscover(mVBox, this);
    630     if (RT_FAILURE(rc))
    631     {
    632         LogRel(("Failed to DhcpRediscover with rc=%Rrc\n", rc));
    633         return rc == VERR_NOT_IMPLEMENTED ? E_NOTIMPL : E_FAIL;
    634     }
    635     return S_OK;
    636 #endif
    637 }
    638 
    639 HRESULT HostNetworkInterface::setVirtualBox(VirtualBox *pVBox)
    640 {
    641     AutoCaller autoCaller(this);
    642     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    643568    AssertReturn(mVBox != pVBox, S_OK);
    644569
  • trunk/src/VBox/Main/src-server/MachineImpl.cpp

    r49795 r49871  
    340340
    341341            /* Apply BIOS defaults */
    342             mBIOSSettings->applyDefaults(aOsType);
     342            mBIOSSettings->i_applyDefaults(aOsType);
    343343
    344344            /* Apply network adapters defaults */
     
    40804080                                      aDevice)))
    40814081    {
    4082         Medium *pMedium = pAttachTemp->getMedium();
     4082        Medium *pMedium = pAttachTemp->i_getMedium();
    40834083        if (pMedium)
    40844084        {
     
    41634163
    41644164                /* see if it's the same bus/channel/device */
    4165                 if (pAttachTemp->matches(aControllerName, aControllerPort, aDevice))
     4165                if (pAttachTemp->i_matches(aControllerName, aControllerPort, aDevice))
    41664166                {
    41674167                    /* the simplest case: restore the whole attachment
     
    42444244                    uint32_t level = 0;
    42454245                    MediumAttachment *pAttach = *it;
    4246                     ComObjPtr<Medium> pMedium = pAttach->getMedium();
    4247                     Assert(!pMedium.isNull() || pAttach->getType() != DeviceType_HardDisk);
     4246                    ComObjPtr<Medium> pMedium = pAttach->i_getMedium();
     4247                    Assert(!pMedium.isNull() || pAttach->i_getType() != DeviceType_HardDisk);
    42484248                    if (pMedium.isNull())
    42494249                        continue;
     
    42624262                         * descendant of medium will be used
    42634263                         */
    4264                         if (pAttach->matches(aControllerName, aControllerPort, aDevice))
     4264                        if (pAttach->i_matches(aControllerName, aControllerPort, aDevice))
    42654265                        {
    42664266                            /* the simplest case: restore the whole attachment
     
    43224322                {
    43234323                    /* use the previously attached hard disk */
    4324                     medium = (*foundIt)->getMedium();
     4324                    medium = (*foundIt)->i_getMedium();
    43254325                    mediumCaller.attach(medium);
    43264326                    if (FAILED(mediumCaller.rc())) return mediumCaller.rc();
     
    43584358                {
    43594359                    MediumAttachment *pAttach = *it;
    4360                     ComObjPtr<Medium> pMedium = pAttach->getMedium();
    4361                     Assert(!pMedium.isNull() || pAttach->getType() != DeviceType_HardDisk);
     4360                    ComObjPtr<Medium> pMedium = pAttach->i_getMedium();
     4361                    Assert(!pMedium.isNull() || pAttach->i_getType() != DeviceType_HardDisk);
    43624362                    if (pMedium.isNull())
    43634363                        continue;
     
    43714371                         * descendant of medium will be used
    43724372                         */
    4373                         if (    pAttach->getDevice() == aDevice
    4374                              && pAttach->getPort() == aControllerPort
    4375                              && pAttach->getControllerName() == aControllerName
     4373                        if (    pAttach->i_getDevice() == aDevice
     4374                             && pAttach->i_getPort() == aControllerPort
     4375                             && pAttach->i_getControllerName() == aControllerName
    43764376                           )
    43774377                        {
     
    43914391                if (pAttachFound)
    43924392                {
    4393                     base = pAttachFound->getMedium();
     4393                    base = pAttachFound->i_getMedium();
    43944394                    break;
    43954395                }
     
    46414641                        aDevice, aControllerPort, aControllerName);
    46424642
    4643     if (fHotplug && !pAttach->getHotPluggable())
     4643    if (fHotplug && !pAttach->i_getHotPluggable())
    46444644        return setError(VBOX_E_NOT_SUPPORTED,
    46454645                        tr("The device slot %d on port %d of controller '%ls' does not support hotplugging"),
     
    47064706    AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    47074707
    4708     if (pAttach->getType() != DeviceType_DVD)
     4708    if (pAttach->i_getType() != DeviceType_DVD)
    47094709        return setError(E_INVALIDARG,
    47104710                        tr("Setting passthrough rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"),
    47114711                        aDevice, aControllerPort, aControllerName);
    4712     pAttach->updatePassthrough(!!aPassthrough);
     4712    pAttach->i_updatePassthrough(!!aPassthrough);
    47134713
    47144714    return S_OK;
     
    47464746    AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    47474747
    4748     if (pAttach->getType() != DeviceType_DVD)
     4748    if (pAttach->i_getType() != DeviceType_DVD)
    47494749        return setError(E_INVALIDARG,
    47504750                        tr("Setting temporary eject flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a DVD"),
    47514751                        aDevice, aControllerPort, aControllerName);
    4752     pAttach->updateTempEject(!!aTemporaryEject);
     4752    pAttach->i_updateTempEject(!!aTemporaryEject);
    47534753
    47544754    return S_OK;
     
    47934793    AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    47944794
    4795     if (pAttach->getType() != DeviceType_HardDisk)
     4795    if (pAttach->i_getType() != DeviceType_HardDisk)
    47964796        return setError(E_INVALIDARG,
    47974797                        tr("Setting the non-rotational medium flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a hard disk"),
    47984798                        aDevice, aControllerPort, aControllerName);
    4799     pAttach->updateNonRotational(!!aNonRotational);
     4799    pAttach->i_updateNonRotational(!!aNonRotational);
    48004800
    48014801    return S_OK;
     
    48404840    AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    48414841
    4842     if (pAttach->getType() != DeviceType_HardDisk)
     4842    if (pAttach->i_getType() != DeviceType_HardDisk)
    48434843        return setError(E_INVALIDARG,
    48444844                        tr("Setting the discard medium flag rejected as the device attached to device slot %d on port %d of controller '%ls' is not a hard disk"),
    48454845                        aDevice, aControllerPort, aControllerName);
    4846     pAttach->updateDiscard(!!aDiscard);
     4846    pAttach->i_updateDiscard(!!aDiscard);
    48474847
    48484848    return S_OK;
     
    49034903    AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    49044904
    4905     if (pAttach->getType() == DeviceType_Floppy)
     4905    if (pAttach->i_getType() == DeviceType_Floppy)
    49064906        return setError(E_INVALIDARG,
    49074907                        tr("Setting the hot-pluggable device flag rejected as the device attached to device slot %d on port %d of controller '%ls' is a floppy drive"),
    49084908                        aDevice, aControllerPort, aControllerName);
    4909     pAttach->updateHotPluggable(!!aHotPluggable);
     4909    pAttach->i_updateHotPluggable(!!aHotPluggable);
    49104910
    49114911    return S_OK;
     
    49664966    AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    49674967
    4968     const Utf8Str strBandwidthGroupOld = pAttach->getBandwidthGroup();
     4968    const Utf8Str strBandwidthGroupOld = pAttach->i_getBandwidthGroup();
    49694969    if (strBandwidthGroupOld.isNotEmpty())
    49704970    {
     
    49754975
    49764976        pBandwidthGroupOld->i_release();
    4977         pAttach->updateBandwidthGroup(Utf8Str::Empty);
     4977        pAttach->i_updateBandwidthGroup(Utf8Str::Empty);
    49784978    }
    49794979
     
    49814981    {
    49824982        group->i_reference();
    4983         pAttach->updateBandwidthGroup(group->i_getName());
     4983        pAttach->i_updateBandwidthGroup(group->i_getName());
    49844984    }
    49854985
     
    50515051     * backup is not necessarily the same thing. */
    50525052    ComObjPtr<Medium> oldmedium;
    5053     oldmedium = pAttach->getMedium();
     5053    oldmedium = pAttach->i_getMedium();
    50545054
    50555055    ComObjPtr<Medium> pMedium = static_cast<Medium*>(aMedium);
     
    50635063    if (pMedium)
    50645064    {
    5065         DeviceType_T mediumType = pAttach->getType();
     5065        DeviceType_T mediumType = pAttach->i_getType();
    50665066        switch (mediumType)
    50675067        {
     
    51035103
    51045104        AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    5105         pAttach->updateMedium(pMedium);
     5105        pAttach->i_updateMedium(pMedium);
    51065106    }
    51075107
     
    51295129        if (!oldmedium.isNull())
    51305130            oldmedium->i_addBackReference(mData->mUuid);
    5131         pAttach->updateMedium(oldmedium);
     5131        pAttach->i_updateMedium(oldmedium);
    51325132    }
    51335133
     
    51675167                        aDevice, aControllerPort, aControllerName);
    51685168
    5169     pAttach->getMedium().queryInterfaceTo(aMedium);
     5169    pAttach->i_getMedium().queryInterfaceTo(aMedium);
    51705170
    51715171    return S_OK;
     
    66056605            AutoReadLock local_alock(pAttachTemp COMMA_LOCKVAL_SRC_POS);
    66066606
    6607             if (pAttachTemp->getControllerName() == aName)
     6607            if (pAttachTemp->i_getControllerName() == aName)
    66086608            {
    66096609                rc = detachDevice(pAttachTemp, alock, NULL);
     
    67436743    mUSBControllers.backup();
    67446744
    6745     ctrl->unshare();
     6745    ctrl->i_unshare();
    67466746
    67476747    mUSBControllers->remove(ctrl);
     
    88208820             ++it)
    88218821        {
    8822             ComObjPtr<Medium> pMedium = (*it)->getMedium();
     8822            ComObjPtr<Medium> pMedium = (*it)->i_getMedium();
    88238823            if (pMedium.isNull())
    88248824                continue;
     
    93559355
    93569356        /* BIOS */
    9357         rc = mBIOSSettings->loadSettings(data.biosSettings);
     9357        rc = mBIOSSettings->i_loadSettings(data.biosSettings);
    93589358        if (FAILED(rc)) return rc;
    93599359
     
    94259425
    94269426            AssertBreak(p.ulSlot < RT_ELEMENTS(mParallelPorts));
    9427             rc = mParallelPorts[p.ulSlot]->loadSettings(p);
     9427            rc = mParallelPorts[p.ulSlot]->i_loadSettings(p);
    94289428            if (FAILED(rc)) return rc;
    94299429        }
    94309430
    94319431        /* AudioAdapter */
    9432         rc = mAudioAdapter->loadSettings(data.audioAdapter);
     9432        rc = mAudioAdapter->i_loadSettings(data.audioAdapter);
    94339433        if (FAILED(rc)) return rc;
    94349434
     
    99639963         ++it)
    99649964    {
    9965         if ((*it)->getName() == aName)
     9965        if ((*it)->i_getName() == aName)
    99669966        {
    99679967            aUSBController = (*it);
     
    99909990         ++it)
    99919991    {
    9992         if ((*it)->getControllerType() == enmType)
     9992        if ((*it)->i_getControllerType() == enmType)
    99939993            cCtrls++;
    99949994    }
     
    1002310023        AutoReadLock attLock(pAtt COMMA_LOCKVAL_SRC_POS);
    1002410024
    10025         if (pAtt->getControllerName() == aName)
     10025        if (pAtt->i_getControllerName() == aName)
    1002610026            atts.push_back(pAtt);
    1002710027    }
     
    1040510405 * with it.
    1040610406 *
    10407   Caller must hold the machine lock!
     10407 * Caller must hold the machine lock!
    1040810408 *
    1040910409 * This throws XML errors and HRESULT, so the caller must have a catch block!
     
    1066010660
    1066110661        /* BIOS (required) */
    10662         rc = mBIOSSettings->saveSettings(data.biosSettings);
     10662        rc = mBIOSSettings->i_saveSettings(data.biosSettings);
    1066310663        if (FAILED(rc)) throw rc;
    1066410664
     
    1067110671            settings::USBController settingsCtrl;
    1067210672
    10673             settingsCtrl.strName = ctrl->getName();
    10674             settingsCtrl.enmType = ctrl->getControllerType();
     10673            settingsCtrl.strName = ctrl->i_getName();
     10674            settingsCtrl.enmType = ctrl->i_getControllerType();
    1067510675
    1067610676            data.usbSettings.llUSBControllers.push_back(settingsCtrl);
     
    1072310723            settings::ParallelPort p;
    1072410724            p.ulSlot = slot;
    10725             rc = mParallelPorts[slot]->saveSettings(p);
     10725            rc = mParallelPorts[slot]->i_saveSettings(p);
    1072610726            if (FAILED(rc)) return rc;
    1072710727
     
    1073010730
    1073110731        /* Audio adapter */
    10732         rc = mAudioAdapter->saveSettings(data.audioAdapter);
     10732        rc = mAudioAdapter->i_saveSettings(data.audioAdapter);
    1073310733        if (FAILED(rc)) return rc;
    1073410734
     
    1090510905
    1090610906        MediumAttachment *pAttach = *it;
    10907         Medium *pMedium = pAttach->getMedium();
    10908 
    10909         dev.deviceType = pAttach->getType();
    10910         dev.lPort = pAttach->getPort();
    10911         dev.lDevice = pAttach->getDevice();
    10912         dev.fPassThrough = pAttach->getPassthrough();
    10913         dev.fHotPluggable = pAttach->getHotPluggable();
     10907        Medium *pMedium = pAttach->i_getMedium();
     10908
     10909        dev.deviceType = pAttach->i_getType();
     10910        dev.lPort = pAttach->i_getPort();
     10911        dev.lDevice = pAttach->i_getDevice();
     10912        dev.fPassThrough = pAttach->i_getPassthrough();
     10913        dev.fHotPluggable = pAttach->i_getHotPluggable();
    1091410914        if (pMedium)
    1091510915        {
     
    1091810918            else
    1091910919                dev.uuid = pMedium->i_getId();
    10920             dev.fTempEject = pAttach->getTempEject();
    10921             dev.fNonRotational = pAttach->getNonRotational();
    10922             dev.fDiscard = pAttach->getDiscard();
    10923         }
    10924 
    10925         dev.strBwGroup = pAttach->getBandwidthGroup();
     10920            dev.fTempEject = pAttach->i_getTempEject();
     10921            dev.fNonRotational = pAttach->i_getNonRotational();
     10922            dev.fDiscard = pAttach->i_getDiscard();
     10923        }
     10924
     10925        dev.strBwGroup = pAttach->i_getBandwidthGroup();
    1092610926
    1092710927        data.llAttachedDevices.push_back(dev);
     
    1110611106            {
    1110711107                MediumAttachment* pAtt = *it;
    11108                 if (pAtt->getType() == DeviceType_HardDisk)
     11108                if (pAtt->i_getType() == DeviceType_HardDisk)
    1110911109                {
    11110                     Medium* pMedium = pAtt->getMedium();
     11110                    Medium* pMedium = pAtt->i_getMedium();
    1111111111                    Assert(pMedium);
    1111211112
     
    1115811158            MediumAttachment* pAtt = *it;
    1115911159
    11160             DeviceType_T devType = pAtt->getType();
    11161             Medium* pMedium = pAtt->getMedium();
     11160            DeviceType_T devType = pAtt->i_getType();
     11161            Medium* pMedium = pAtt->i_getMedium();
    1116211162
    1116311163            if (   devType != DeviceType_HardDisk
     
    1124511245            rc = attachment->init(this,
    1124611246                                  diff,
    11247                                   pAtt->getControllerName(),
    11248                                   pAtt->getPort(),
    11249                                   pAtt->getDevice(),
     11247                                  pAtt->i_getControllerName(),
     11248                                  pAtt->i_getPort(),
     11249                                  pAtt->i_getDevice(),
    1125011250                                  DeviceType_HardDisk,
    1125111251                                  true /* aImplicit */,
    1125211252                                  false /* aPassthrough */,
    1125311253                                  false /* aTempEject */,
    11254                                   pAtt->getNonRotational(),
    11255                                   pAtt->getDiscard(),
    11256                                   pAtt->getHotPluggable(),
    11257                                   pAtt->getBandwidthGroup());
     11254                                  pAtt->i_getNonRotational(),
     11255                                  pAtt->i_getDiscard(),
     11256                                  pAtt->i_getHotPluggable(),
     11257                                  pAtt->i_getBandwidthGroup());
    1125811258            if (FAILED(rc)) throw rc;
    1125911259
     
    1130611306    {
    1130711307        const ComObjPtr<MediumAttachment> &pAtt = *it;
    11308         if (pAtt->isImplicit())
     11308        if (pAtt->i_isImplicit())
    1130911309        {
    1131011310            fImplicitDiffs = true;
     
    1135611356            {
    1135711357                MediumAttachment* pAtt = *it;
    11358                 if (pAtt->getType() == DeviceType_HardDisk)
     11358                if (pAtt->i_getType() == DeviceType_HardDisk)
    1135911359                {
    11360                     Medium* pMedium = pAtt->getMedium();
     11360                    Medium* pMedium = pAtt->i_getMedium();
    1136111361                    Assert(pMedium);
    1136211362
     
    1139611396        {
    1139711397            ComObjPtr<MediumAttachment> pAtt = *it;
    11398             ComObjPtr<Medium> pMedium = pAtt->getMedium();
     11398            ComObjPtr<Medium> pMedium = pAtt->i_getMedium();
    1139911399            if (pMedium.isNull())
    1140011400                continue;
    1140111401
    1140211402            // Implicit attachments go on the list for deletion and back references are removed.
    11403             if (pAtt->isImplicit())
     11403            if (pAtt->i_isImplicit())
    1140411404            {
    1140511405                /* Deassociate and mark for deletion */
    11406                 LogFlowThisFunc(("Detaching '%s', pending deletion\n", pAtt->getLogName()));
     11406                LogFlowThisFunc(("Detaching '%s', pending deletion\n", pAtt->i_getLogName()));
    1140711407                rc = pMedium->i_removeBackReference(mData->mUuid);
    1140811408                if (FAILED(rc))
     
    1141611416            {
    1141711417                /* no: de-associate */
    11418                 LogFlowThisFunc(("Detaching '%s', no deletion\n", pAtt->getLogName()));
     11418                LogFlowThisFunc(("Detaching '%s', no deletion\n", pAtt->i_getLogName()));
    1141911419                rc = pMedium->i_removeBackReference(mData->mUuid);
    1142011420                if (FAILED(rc))
     
    1142211422                continue;
    1142311423            }
    11424             LogFlowThisFunc(("Not detaching '%s'\n", pAtt->getLogName()));
     11424            LogFlowThisFunc(("Not detaching '%s'\n", pAtt->i_getLogName()));
    1142511425        }
    1142611426
     
    1145611456                ComObjPtr<MediumAttachment> pAtt = *it;
    1145711457                Assert(pAtt);
    11458                 LogFlowThisFunc(("Deleting '%s'\n", pAtt->getLogName()));
    11459                 ComObjPtr<Medium> pMedium = pAtt->getMedium();
     11458                LogFlowThisFunc(("Deleting '%s'\n", pAtt->i_getLogName()));
     11459                ComObjPtr<Medium> pMedium = pAtt->i_getMedium();
    1146011460                Assert(pMedium);
    1146111461
    1146211462                rc = pMedium->i_deleteStorage(NULL /*aProgress*/, true /*aWait*/);
    1146311463                // continue on delete failure, just collect error messages
    11464                 AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, pAtt->getLogName(), pMedium->i_getLocationFull().c_str() ));
     11464                AssertMsg(SUCCEEDED(rc), ("rc=%Rhrc it=%s hd=%s\n", rc, pAtt->i_getLogName(), pMedium->i_getLocationFull().c_str() ));
    1146511465                mrc = rc;
    1146611466            }
     
    1152411524    {
    1152511525        MediumAttachment *pAttach = *it;
    11526         if (pAttach->matches(aControllerName, aControllerPort, aDevice))
     11526        if (pAttach->i_matches(aControllerName, aControllerPort, aDevice))
    1152711527            return pAttach;
    1152811528    }
     
    1155011550    {
    1155111551        MediumAttachment *pAttach = *it;
    11552         ComObjPtr<Medium> pMediumThis = pAttach->getMedium();
     11552        ComObjPtr<Medium> pMediumThis = pAttach->i_getMedium();
    1155311553        if (pMediumThis == pMedium)
    1155411554            return pAttach;
     
    1157711577    {
    1157811578        MediumAttachment *pAttach = *it;
    11579         ComObjPtr<Medium> pMediumThis = pAttach->getMedium();
     11579        ComObjPtr<Medium> pMediumThis = pAttach->i_getMedium();
    1158011580        if (pMediumThis->i_getId() == id)
    1158111581            return pAttach;
     
    1159811598                              Snapshot *pSnapshot)
    1159911599{
    11600     ComObjPtr<Medium> oldmedium = pAttach->getMedium();
    11601     DeviceType_T mediumType = pAttach->getType();
     11600    ComObjPtr<Medium> oldmedium = pAttach->i_getMedium();
     11601    DeviceType_T mediumType = pAttach->i_getType();
    1160211602
    1160311603    LogFlowThisFunc(("Entering, medium of attachment is %s\n", oldmedium ? oldmedium->i_getLocationFull().c_str() : "NULL"));
    1160411604
    11605     if (pAttach->isImplicit())
     11605    if (pAttach->i_isImplicit())
    1160611606    {
    1160711607        /* attempt to implicitly delete the implicitly created diff */
     
    1168911689    {
    1169011690        ComObjPtr<MediumAttachment> &pAttach = *it;
    11691         ComObjPtr<Medium> pMedium = pAttach->getMedium();
     11691        ComObjPtr<Medium> pMedium = pAttach->i_getMedium();
    1169211692
    1169311693        if (!pMedium.isNull())
     
    1178011780        MediumAttachment *pAttach = *it;
    1178111781
    11782         pAttach->commit();
    11783 
    11784         Medium* pMedium = pAttach->getMedium();
    11785         bool fImplicit = pAttach->isImplicit();
     11782        pAttach->i_commit();
     11783
     11784        Medium* pMedium = pAttach->i_getMedium();
     11785        bool fImplicit = pAttach->i_isImplicit();
    1178611786
    1178711787        LogFlowThisFunc(("Examining current medium '%s' (implicit: %d)\n",
     
    1179411794        {
    1179511795            /* convert implicit attachment to normal */
    11796             pAttach->setImplicit(false);
     11796            pAttach->i_setImplicit(false);
    1179711797
    1179811798            if (    aOnline
    1179911799                 && pMedium
    11800                  && pAttach->getType() == DeviceType_HardDisk
     11800                 && pAttach->i_getType() == DeviceType_HardDisk
    1180111801               )
    1180211802            {
     
    1183511835            {
    1183611836                MediumAttachment *pOldAttach = *oldIt;
    11837                 if (pOldAttach->getMedium() == pMedium)
     11837                if (pOldAttach->i_getMedium() == pMedium)
    1183811838                {
    1183911839                    LogFlowThisFunc(("--> medium '%s' was attached before, will not remove\n", pMedium->i_getName().c_str()));
     
    1185411854    {
    1185511855        MediumAttachment *pAttach = *it;
    11856         Medium* pMedium = pAttach->getMedium();
     11856        Medium* pMedium = pAttach->i_getMedium();
    1185711857
    1185811858        /* Detach only hard disks, since DVD/floppy media is detached
    1185911859         * instantly in MountMedium. */
    11860         if (pAttach->getType() == DeviceType_HardDisk && pMedium)
     11860        if (pAttach->i_getType() == DeviceType_HardDisk && pMedium)
    1186111861        {
    1186211862            LogFlowThisFunc(("detaching medium '%s' from machine\n", pMedium->i_getName().c_str()));
     
    1191911919             ++it)
    1192011920        {
    11921             (*it)->updateParentMachine(mPeer);
     11921            (*it)->i_updateParentMachine(mPeer);
    1192211922        }
    1192311923
     
    1195811958        MediumAttachment *pAttach = *it;
    1195911959        /* Fix up the backrefs for DVD/floppy media. */
    11960         if (pAttach->getType() != DeviceType_HardDisk)
    11961         {
    11962             Medium* pMedium = pAttach->getMedium();
     11960        if (pAttach->i_getType() != DeviceType_HardDisk)
     11961        {
     11962            Medium* pMedium = pAttach->i_getMedium();
    1196311963            if (pMedium)
    1196411964            {
     
    1196811968        }
    1196911969
    11970         (*it)->rollback();
     11970        (*it)->i_rollback();
    1197111971
    1197211972        pAttach = *it;
    1197311973        /* Fix up the backrefs for DVD/floppy media. */
    11974         if (pAttach->getType() != DeviceType_HardDisk)
    11975         {
    11976             Medium* pMedium = pAttach->getMedium();
     11974        if (pAttach->i_getType() != DeviceType_HardDisk)
     11975        {
     11976            Medium* pMedium = pAttach->i_getMedium();
    1197711977            if (pMedium)
    1197811978            {
     
    1209712097            while (it != mUSBControllers->end())
    1209812098            {
    12099                 (*it)->rollback();
     12099                (*it)->i_rollback();
    1210012100                ++it;
    1210112101            }
     
    1211112111
    1211212112    if (mBIOSSettings)
    12113         mBIOSSettings->rollback();
     12113        mBIOSSettings->i_rollback();
    1211412114
    1211512115    if (mVRDEServer && (mData->flModifications & IsModified_VRDEServer))
     
    1211712117
    1211812118    if (mAudioAdapter)
    12119         mAudioAdapter->rollback();
     12119        mAudioAdapter->i_rollback();
    1212012120
    1212112121    if (mUSBDeviceFilters && (mData->flModifications & IsModified_USB))
     
    1215212152        for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
    1215312153            if (    mParallelPorts[slot]
    12154                  && mParallelPorts[slot]->isModified())
     12154                 && mParallelPorts[slot]->i_isModified())
    1215512155            {
    12156                 mParallelPorts[slot]->rollback();
     12156                mParallelPorts[slot]->i_rollback();
    1215712157                parallelPorts[slot] = mParallelPorts[slot];
    1215812158            }
     
    1222212222        commitMedia(Global::IsOnline(mData->mMachineState));
    1222312223
    12224     mBIOSSettings->commit();
     12224    mBIOSSettings->i_commit();
    1222512225    mVRDEServer->i_commit();
    12226     mAudioAdapter->commit();
     12226    mAudioAdapter->i_commit();
    1222712227    mUSBDeviceFilters->commit();
    1222812228    mBandwidthControl->i_commit();
     
    1228212282        mSerialPorts[slot]->i_commit();
    1228312283    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
    12284         mParallelPorts[slot]->commit();
     12284        mParallelPorts[slot]->i_commit();
    1228512285
    1228612286    bool commitStorageControllers = false;
     
    1236912369            while (it != mUSBControllers->end())
    1237012370            {
    12371                 (*it)->commit();
     12371                (*it)->i_commit();
    1237212372
    1237312373                /* look if this controller has a peer device */
    12374                 ComObjPtr<USBController> peer = (*it)->getPeer();
     12374                ComObjPtr<USBController> peer = (*it)->i_getPeer();
    1237512375                if (!peer)
    1237612376                {
     
    1242112421        while (it != mUSBControllers->end())
    1242212422        {
    12423             (*it)->commit();
     12423            (*it)->i_commit();
    1242412424            ++it;
    1242512425        }
     
    1247112471    }
    1247212472
    12473     mBIOSSettings->copyFrom(aThat->mBIOSSettings);
     12473    mBIOSSettings->i_copyFrom(aThat->mBIOSSettings);
    1247412474    mVRDEServer->i_copyFrom(aThat->mVRDEServer);
    12475     mAudioAdapter->copyFrom(aThat->mAudioAdapter);
     12475    mAudioAdapter->i_copyFrom(aThat->mAudioAdapter);
    1247612476    mUSBDeviceFilters->copyFrom(aThat->mUSBDeviceFilters);
    1247712477    mBandwidthControl->i_copyFrom(aThat->mBandwidthControl);
     
    1250912509        mSerialPorts[slot]->i_copyFrom(aThat->mSerialPorts[slot]);
    1251012510    for (ULONG slot = 0; slot < RT_ELEMENTS(mParallelPorts); slot++)
    12511         mParallelPorts[slot]->copyFrom(aThat->mParallelPorts[slot]);
     12511        mParallelPorts[slot]->i_copyFrom(aThat->mParallelPorts[slot]);
    1251212512}
    1251312513
     
    1255512555        AutoReadLock local_alockA(pAttach COMMA_LOCKVAL_SRC_POS);
    1255612556
    12557         if (pAttach->getType() == DeviceType_HardDisk)
    12558             list.push_back(pAttach->getMedium());
     12557        if (pAttach->i_getType() == DeviceType_HardDisk)
     12558            list.push_back(pAttach->i_getMedium());
    1255912559    }
    1256012560}
     
    1396413964        /* Need to query the details first, as the IMediumAttachment reference
    1396513965         * might be to the original settings, which we are going to change. */
    13966         ctrlName = pAttach->getControllerName();
    13967         lPort = pAttach->getPort();
    13968         lDevice = pAttach->getDevice();
    13969         fTempEject = pAttach->getTempEject();
     13966        ctrlName = pAttach->i_getControllerName();
     13967        lPort = pAttach->i_getPort();
     13968        lDevice = pAttach->i_getDevice();
     13969        fTempEject = pAttach->i_getTempEject();
    1397013970    }
    1397113971
     
    1397513975         * backup is not necessarily the same thing. */
    1397613976        ComObjPtr<Medium> oldmedium;
    13977         oldmedium = pAttach->getMedium();
     13977        oldmedium = pAttach->i_getMedium();
    1397813978
    1397913979        setModified(IsModified_Storage);
     
    1399513995                oldmedium->i_removeBackReference(mData->mUuid);
    1399613996
    13997             pAttach->updateMedium(NULL);
    13998             pAttach->updateEjected();
     13997            pAttach->i_updateMedium(NULL);
     13998            pAttach->i_updateEjected();
    1399913999        }
    1400014000
     
    1400514005        {
    1400614006            AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);
    14007             pAttach->updateEjected();
     14007            pAttach->i_updateEjected();
    1400814008        }
    1400914009    }
     
    1471514715    {
    1471614716        MediumAttachment* pAtt = *it;
    14717         DeviceType_T devType = pAtt->getType();
    14718         Medium *pMedium = pAtt->getMedium();
     14717        DeviceType_T devType = pAtt->i_getType();
     14718        Medium *pMedium = pAtt->i_getMedium();
    1471914719
    1472014720        MediumLockList *pMediumLockList(new MediumLockList());
  • trunk/src/VBox/Main/src-server/MediumAttachmentImpl.cpp

    r48880 r49871  
    8686/////////////////////////////////////////////////////////////////////////////
    8787
     88DEFINE_EMPTY_CTOR_DTOR(MediumAttachment)
     89
    8890HRESULT MediumAttachment::FinalConstruct()
    8991{
     
    169171                          m->bd->fImplicit ? ":I" : "");
    170172
    171     LogFlowThisFunc(("LEAVE - %s\n", getLogName()));
     173    LogFlowThisFunc(("LEAVE - %s\n", i_getLogName()));
    172174    return S_OK;
    173175}
     
    209211void MediumAttachment::uninit()
    210212{
    211     LogFlowThisFunc(("ENTER - %s\n", getLogName()));
     213    LogFlowThisFunc(("ENTER - %s\n", i_getLogName()));
    212214
    213215    /* Enclose the state transition Ready->InUninit->NotReady */
     
    229231/////////////////////////////////////////////////////////////////////////////
    230232
    231 STDMETHODIMP MediumAttachment::COMGETTER(Medium)(IMedium **aHardDisk)
    232 {
    233     LogFlowThisFuncEnter();
    234 
    235     CheckComArgOutPointerValid(aHardDisk);
    236 
    237     AutoCaller autoCaller(this);
    238     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     233
     234HRESULT MediumAttachment::getMedium(ComPtr<IMedium> &aHardDisk)
     235{
     236    LogFlowThisFuncEnter();
    239237
    240238    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    241239
    242     m->bd->pMedium.queryInterfaceTo(aHardDisk);
    243 
    244     LogFlowThisFuncLeave();
    245     return S_OK;
    246 }
    247 
    248 STDMETHODIMP MediumAttachment::COMGETTER(Controller)(BSTR *aController)
    249 {
    250     LogFlowThisFuncEnter();
    251 
    252     CheckComArgOutPointerValid(aController);
    253 
    254     AutoCaller autoCaller(this);
    255     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     240    aHardDisk = m->bd->pMedium;
     241
     242    LogFlowThisFuncLeave();
     243    return S_OK;
     244}
     245
     246
     247HRESULT MediumAttachment::getController(com::Utf8Str &aController)
     248{
     249    LogFlowThisFuncEnter();
    256250
    257251    /* m->controller is constant during life time, no need to lock */
    258     m->bd->bstrControllerName.cloneTo(aController);
    259 
    260     LogFlowThisFuncLeave();
    261     return S_OK;
    262 }
    263 
    264 STDMETHODIMP MediumAttachment::COMGETTER(Port)(LONG *aPort)
    265 {
    266     LogFlowThisFuncEnter();
    267 
    268     CheckComArgOutPointerValid(aPort);
    269 
    270     AutoCaller autoCaller(this);
    271     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     252    aController = Utf8Str(m->bd->bstrControllerName);
     253
     254    LogFlowThisFuncLeave();
     255    return S_OK;
     256}
     257
     258
     259HRESULT MediumAttachment::getPort(LONG *aPort)
     260{
     261    LogFlowThisFuncEnter();
    272262
    273263    /* m->bd->port is constant during life time, no need to lock */
     
    278268}
    279269
    280 STDMETHODIMP MediumAttachment::COMGETTER(Device)(LONG *aDevice)
    281 {
    282     LogFlowThisFuncEnter();
    283 
    284     CheckComArgOutPointerValid(aDevice);
    285 
    286     AutoCaller autoCaller(this);
    287     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     270HRESULT  MediumAttachment::getDevice(LONG *aDevice)
     271{
     272    LogFlowThisFuncEnter();
    288273
    289274    /* m->bd->device is constant during life time, no need to lock */
     
    294279}
    295280
    296 STDMETHODIMP MediumAttachment::COMGETTER(Type)(DeviceType_T *aType)
    297 {
    298     LogFlowThisFuncEnter();
    299 
    300     CheckComArgOutPointerValid(aType);
    301 
    302     AutoCaller autoCaller(this);
    303     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     281HRESULT MediumAttachment::getType(DeviceType_T *aType)
     282{
     283    LogFlowThisFuncEnter();
    304284
    305285    /* m->bd->type is constant during life time, no need to lock */
     
    310290}
    311291
    312 STDMETHODIMP MediumAttachment::COMGETTER(Passthrough)(BOOL *aPassthrough)
    313 {
    314     LogFlowThisFuncEnter();
    315 
    316     CheckComArgOutPointerValid(aPassthrough);
    317 
    318     AutoCaller autoCaller(this);
    319     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     292
     293HRESULT MediumAttachment::getPassthrough(BOOL *aPassthrough)
     294{
     295    LogFlowThisFuncEnter();
    320296
    321297    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    327303}
    328304
    329 STDMETHODIMP MediumAttachment::COMGETTER(TemporaryEject)(BOOL *aTemporaryEject)
    330 {
    331     LogFlowThisFuncEnter();
    332 
    333     CheckComArgOutPointerValid(aTemporaryEject);
    334 
    335     AutoCaller autoCaller(this);
    336     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     305
     306HRESULT MediumAttachment::getTemporaryEject(BOOL *aTemporaryEject)
     307{
     308    LogFlowThisFuncEnter();
    337309
    338310    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    344316}
    345317
    346 STDMETHODIMP MediumAttachment::COMGETTER(IsEjected)(BOOL *aEjected)
    347 {
    348     LogFlowThisFuncEnter();
    349 
    350     CheckComArgOutPointerValid(aEjected);
    351 
    352     AutoCaller autoCaller(this);
    353     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     318
     319HRESULT MediumAttachment::getIsEjected(BOOL *aEjected)
     320{
     321    LogFlowThisFuncEnter();
    354322
    355323    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    361329}
    362330
    363 STDMETHODIMP MediumAttachment::COMGETTER(NonRotational)(BOOL *aNonRotational)
    364 {
    365     LogFlowThisFuncEnter();
    366 
    367     CheckComArgOutPointerValid(aNonRotational);
    368 
    369     AutoCaller autoCaller(this);
    370     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     331
     332HRESULT MediumAttachment::getNonRotational(BOOL *aNonRotational)
     333{
     334    LogFlowThisFuncEnter();
    371335
    372336    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    378342}
    379343
    380 STDMETHODIMP MediumAttachment::COMGETTER(Discard)(BOOL *aDiscard)
    381 {
    382     LogFlowThisFuncEnter();
    383 
    384     CheckComArgOutPointerValid(aDiscard);
    385 
    386     AutoCaller autoCaller(this);
    387     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     344HRESULT MediumAttachment::getDiscard(BOOL *aDiscard)
     345{
     346    LogFlowThisFuncEnter();
    388347
    389348    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    395354}
    396355
    397 STDMETHODIMP MediumAttachment::COMGETTER(BandwidthGroup) (IBandwidthGroup **aBwGroup)
    398 {
    399     LogFlowThisFuncEnter();
    400     CheckComArgOutPointerValid(aBwGroup);
    401 
    402     AutoCaller autoCaller(this);
    403     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     356
     357HRESULT MediumAttachment::getBandwidthGroup(ComPtr<IBandwidthGroup> &aBandwidthGroup)
     358{
     359    LogFlowThisFuncEnter();
    404360
    405361    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    414370
    415371        if (SUCCEEDED(hrc))
    416             pBwGroup.queryInterfaceTo(aBwGroup);
     372            pBwGroup.queryInterfaceTo(aBandwidthGroup.asOutParam());
    417373    }
    418374
     
    421377}
    422378
    423 STDMETHODIMP MediumAttachment::COMGETTER(HotPluggable)(BOOL *aHotPluggable)
    424 {
    425     LogFlowThisFuncEnter();
    426 
    427     CheckComArgOutPointerValid(aHotPluggable);
    428 
    429     AutoCaller autoCaller(this);
    430     if (FAILED(autoCaller.rc())) return autoCaller.rc();
     379HRESULT MediumAttachment::getHotPluggable(BOOL *aHotPluggable)
     380{
     381    LogFlowThisFuncEnter();
    431382
    432383    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    441392 *  @note Locks this object for writing.
    442393 */
    443 void MediumAttachment::rollback()
    444 {
    445     LogFlowThisFunc(("ENTER - %s\n", getLogName()));
     394void MediumAttachment::i_rollback()
     395{
     396    LogFlowThisFunc(("ENTER - %s\n", i_getLogName()));
    446397
    447398    /* sanity */
     
    453404    m->bd.rollback();
    454405
    455     LogFlowThisFunc(("LEAVE - %s\n", getLogName()));
     406    LogFlowThisFunc(("LEAVE - %s\n", i_getLogName()));
    456407}
    457408
     
    459410 *  @note Locks this object for writing.
    460411 */
    461 void MediumAttachment::commit()
    462 {
    463     LogFlowThisFunc(("ENTER - %s\n", getLogName()));
     412void MediumAttachment::i_commit()
     413{
     414    LogFlowThisFunc(("ENTER - %s\n", i_getLogName()));
    464415
    465416    /* sanity */
     
    472423        m->bd.commit();
    473424
    474     LogFlowThisFunc(("LEAVE - %s\n", getLogName()));
    475 }
    476 
    477 bool MediumAttachment::isImplicit() const
     425    LogFlowThisFunc(("LEAVE - %s\n", i_getLogName()));
     426}
     427
     428bool MediumAttachment::i_isImplicit() const
    478429{
    479430    return m->bd->fImplicit;
    480431}
    481432
    482 void MediumAttachment::setImplicit(bool aImplicit)
     433void MediumAttachment::i_setImplicit(bool aImplicit)
    483434{
    484435    m->bd->fImplicit = aImplicit;
    485436}
    486437
    487 const ComObjPtr<Medium>& MediumAttachment::getMedium() const
     438const ComObjPtr<Medium>& MediumAttachment::i_getMedium() const
    488439{
    489440    return m->bd->pMedium;
    490441}
    491442
    492 Bstr MediumAttachment::getControllerName() const
     443const Bstr MediumAttachment::i_getControllerName() const
    493444{
    494445    return m->bd->bstrControllerName;
    495446}
    496447
    497 LONG MediumAttachment::getPort() const
     448LONG MediumAttachment::i_getPort() const
    498449{
    499450    return m->bd->lPort;
    500451}
    501452
    502 LONG MediumAttachment::getDevice() const
     453LONG MediumAttachment::i_getDevice() const
    503454{
    504455    return m->bd->lDevice;
    505456}
    506457
    507 DeviceType_T MediumAttachment::getType() const
     458DeviceType_T MediumAttachment::i_getType() const
    508459{
    509460    return m->bd->type;
    510461}
    511462
    512 bool MediumAttachment::getPassthrough() const
     463bool MediumAttachment::i_getPassthrough() const
    513464{
    514465    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    516467}
    517468
    518 bool MediumAttachment::getTempEject() const
     469bool MediumAttachment::i_getTempEject() const
    519470{
    520471    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    522473}
    523474
    524 bool MediumAttachment::getNonRotational() const
     475bool MediumAttachment::i_getNonRotational() const
    525476{
    526477    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    528479}
    529480
    530 bool MediumAttachment::getDiscard() const
     481bool MediumAttachment::i_getDiscard() const
    531482{
    532483    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    534485}
    535486
    536 bool MediumAttachment::getHotPluggable() const
     487bool MediumAttachment::i_getHotPluggable() const
    537488{
    538489    AutoReadLock lock(this COMMA_LOCKVAL_SRC_POS);
     
    540491}
    541492
    542 const Utf8Str& MediumAttachment::getBandwidthGroup() const
     493Utf8Str& MediumAttachment::i_getBandwidthGroup() const
    543494{
    544495    return m->bd->strBandwidthGroup;
    545496}
    546497
    547 bool MediumAttachment::matches(CBSTR aControllerName, LONG aPort, LONG aDevice)
     498bool MediumAttachment::i_matches(CBSTR aControllerName, LONG aPort, LONG aDevice)
    548499{
    549500    return (    aControllerName == m->bd->bstrControllerName
     
    556507 * @param aMedium
    557508 */
    558 void MediumAttachment::updateMedium(const ComObjPtr<Medium> &aMedium)
     509void MediumAttachment::i_updateMedium(const ComObjPtr<Medium> &aMedium)
    559510{
    560511    Assert(isWriteLockOnCurrentThread());
     
    567518
    568519/** Must be called from under this object's write lock. */
    569 void MediumAttachment::updatePassthrough(bool aPassthrough)
     520void MediumAttachment::i_updatePassthrough(bool aPassthrough)
    570521{
    571522    Assert(isWriteLockOnCurrentThread());
     
    576527
    577528/** Must be called from under this object's write lock. */
    578 void MediumAttachment::updateTempEject(bool aTempEject)
     529void MediumAttachment::i_updateTempEject(bool aTempEject)
    579530{
    580531    Assert(isWriteLockOnCurrentThread());
     
    585536
    586537/** Must be called from under this object's write lock. */
    587 void MediumAttachment::updateEjected()
     538void MediumAttachment::i_updateEjected()
    588539{
    589540    Assert(isWriteLockOnCurrentThread());
     
    593544
    594545/** Must be called from under this object's write lock. */
    595 void MediumAttachment::updateNonRotational(bool aNonRotational)
     546void MediumAttachment::i_updateNonRotational(bool aNonRotational)
    596547{
    597548    Assert(isWriteLockOnCurrentThread());
     
    602553
    603554/** Must be called from under this object's write lock. */
    604 void MediumAttachment::updateDiscard(bool aDiscard)
     555void MediumAttachment::i_updateDiscard(bool aDiscard)
    605556{
    606557    Assert(isWriteLockOnCurrentThread());
     
    611562
    612563/** Must be called from under this object's write lock. */
    613 void MediumAttachment::updateHotPluggable(bool aHotPluggable)
     564void MediumAttachment::i_updateHotPluggable(bool aHotPluggable)
    614565{
    615566    Assert(isWriteLockOnCurrentThread());
     
    619570}
    620571
    621 void MediumAttachment::updateBandwidthGroup(const Utf8Str &aBandwidthGroup)
     572void MediumAttachment::i_updateBandwidthGroup(const Utf8Str &aBandwidthGroup)
    622573{
    623574    LogFlowThisFuncEnter();
     
    630581}
    631582
    632 void MediumAttachment::updateParentMachine(Machine * const pMachine)
    633 {
    634     LogFlowThisFunc(("ENTER - %s\n", getLogName()));
    635 
     583void MediumAttachment::i_updateParentMachine(Machine * const pMachine)
     584{
     585    LogFlowThisFunc(("ENTER - %s\n", i_getLogName()));
    636586    /* sanity */
    637587    AutoCaller autoCaller(this);
     
    642592    unconst(m->pMachine) = pMachine;
    643593
    644     LogFlowThisFunc(("LEAVE - %s\n", getLogName()));
    645 }
    646 
     594    LogFlowThisFunc(("LEAVE - %s\n", i_getLogName()));
     595}
     596
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r49866 r49871  
    14741474    /// registries of portable VMs referring to this medium), this will also
    14751475    /// require to add the mRegistered flag to data
    1476 
     1476    NOREF(aDescription);
    14771477    ReturnComNotImplemented();
    14781478}
     
    17041704HRESULT Medium::getAllowedTypes(std::vector<MediumType_T> &aAllowedTypes)
    17051705{
     1706    NOREF(aAllowedTypes);
    17061707    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    17071708
     
    26622663{
    26632664    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     2665    NOREF(aLocation);
     2666    NOREF(aProgress);
    26642667
    26652668    /// @todo NEWMEDIA for file names, add the default extension if no extension
  • trunk/src/VBox/Main/src-server/NATEngineImpl.cpp

    r46820 r49871  
    2929#include <VBox/com/array.h>
    3030
     31struct NATEngine::Data
     32{
     33    Data() : mMtu(0),
     34             mSockRcv(0),
     35             mSockSnd(0),
     36             mTcpRcv(0),
     37             mTcpSnd(0),
     38             mDNSPassDomain(TRUE),
     39             mDNSProxy(FALSE),
     40             mDNSUseHostResolver(FALSE),
     41             mAliasMode(0)
     42    {}
     43
     44    com::Utf8Str mNetwork;
     45    com::Utf8Str mBindIP;
     46    uint32_t mMtu;
     47    uint32_t mSockRcv;
     48    uint32_t mSockSnd;
     49    uint32_t mTcpRcv;
     50    uint32_t mTcpSnd;
     51    /* TFTP service */
     52    Utf8Str mTFTPPrefix;
     53    Utf8Str mTFTPBootFile;
     54    Utf8Str mTFTPNextServer;
     55    /* DNS service */
     56    BOOL mDNSPassDomain;
     57    BOOL mDNSProxy;
     58    BOOL mDNSUseHostResolver;
     59    /* Alias service */
     60    ULONG mAliasMode;
     61};
     62
     63
    3164
    3265// constructor / destructor
     
    3871HRESULT NATEngine::FinalConstruct()
    3972{
    40     return S_OK;
    41 }
     73    return BaseFinalConstruct();
     74}
     75
     76void NATEngine::FinalRelease()
     77{
     78    uninit();
     79    BaseFinalRelease();
     80}
     81
    4282
    4383HRESULT NATEngine::init(Machine *aParent, INetworkAdapter *aAdapter)
     
    106146
    107147
    108 void NATEngine::FinalRelease()
    109 {
    110     uninit();
    111     BaseFinalRelease();
    112 }
    113 
    114148void NATEngine::uninit()
    115149{
     
    124158}
    125159
    126 bool NATEngine::isModified()
     160bool NATEngine::i_isModified()
    127161{
    128162    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    131165}
    132166
    133 bool NATEngine::rollback()
     167bool NATEngine::i_rollback()
    134168{
    135169    AutoCaller autoCaller(this);
     
    149183}
    150184
    151 void NATEngine::commit()
     185void NATEngine::i_commit()
    152186{
    153187    AutoCaller autoCaller(this);
     
    178212}
    179213
    180 STDMETHODIMP
    181 NATEngine::GetNetworkSettings(ULONG *aMtu, ULONG *aSockSnd, ULONG *aSockRcv, ULONG *aTcpWndSnd, ULONG *aTcpWndRcv)
    182 {
    183     AutoCaller autoCaller(this);
    184     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    185 
     214HRESULT NATEngine::getNetworkSettings(ULONG *aMtu, ULONG *aSockSnd, ULONG *aSockRcv, ULONG *aTcpWndSnd, ULONG *aTcpWndRcv)
     215{
    186216    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    187217    if (aMtu)
     
    190220        *aSockSnd = mData->mSockSnd;
    191221    if (aSockRcv)
    192          *aSockRcv = mData->mSockRcv;
     222        *aSockRcv = mData->mSockRcv;
    193223    if (aTcpWndSnd)
    194          *aTcpWndSnd = mData->mTcpSnd;
     224        *aTcpWndSnd = mData->mTcpSnd;
    195225    if (aTcpWndRcv)
    196          *aTcpWndRcv = mData->mTcpRcv;
    197 
    198     return S_OK;
    199 }
    200 
    201 STDMETHODIMP
    202 NATEngine::SetNetworkSettings(ULONG aMtu, ULONG aSockSnd, ULONG aSockRcv, ULONG aTcpWndSnd, ULONG aTcpWndRcv)
    203 {
    204     AutoCaller autoCaller(this);
    205     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    206 
     226        *aTcpWndRcv = mData->mTcpRcv;
     227
     228    return S_OK;
     229}
     230
     231HRESULT NATEngine::setNetworkSettings(ULONG aMtu, ULONG aSockSnd, ULONG aSockRcv, ULONG aTcpWndSnd, ULONG aTcpWndRcv)
     232{
    207233    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    208234    if (   aMtu || aSockSnd || aSockRcv
     
    228254}
    229255
    230 STDMETHODIMP
    231 NATEngine::COMGETTER(Redirects)(ComSafeArrayOut(BSTR , aNatRules))
    232 {
    233     CheckComArgOutSafeArrayPointerValid(aNatRules);
    234 
    235     AutoCaller autoCaller(this);
    236     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    237 
    238     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    239 
    240 
    241     SafeArray<BSTR> sf(mNATRules.size());
     256
     257HRESULT NATEngine::getRedirects(std::vector<com::Utf8Str> &aRedirects)
     258{
     259    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     260
     261    aRedirects.resize(mNATRules.size());
    242262    size_t i = 0;
    243263    NATRuleMap::const_iterator it;
    244     for (it = mNATRules.begin();
    245          it != mNATRules.end(); ++it, ++i)
     264    for (it = mNATRules.begin(); it != mNATRules.end(); ++it, ++i)
    246265    {
    247266        settings::NATRule r = it->second;
    248         BstrFmt bstr("%s,%d,%s,%d,%s,%d",
    249                      r.strName.c_str(),
    250                      r.proto,
    251                      r.strHostIP.c_str(),
    252                      r.u16HostPort,
    253                      r.strGuestIP.c_str(),
    254                      r.u16GuestPort);
    255         bstr.detachTo(&sf[i]);
    256     }
    257     sf.detachTo(ComSafeArrayOutArg(aNatRules));
    258     return S_OK;
    259 }
    260 
    261 
    262 STDMETHODIMP
    263 NATEngine::AddRedirect(IN_BSTR aName, NATProtocol_T aProto, IN_BSTR aBindIp, USHORT aHostPort, IN_BSTR aGuestIP, USHORT aGuestPort)
    264 {
    265 
    266     AutoCaller autoCaller(this);
    267     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    268 
     267        aRedirects[i] = Utf8StrFmt("%s,%d,%s,%d,%s,%d",
     268                                   r.strName.c_str(),
     269                                   r.proto,
     270                                   r.strHostIP.c_str(),
     271                                   r.u16HostPort,
     272                                   r.strGuestIP.c_str(),
     273                                   r.u16GuestPort);
     274    }
     275    return S_OK;
     276}
     277
     278HRESULT NATEngine::addRedirect(const com::Utf8Str &aName, NATProtocol_T aProto, const com::Utf8Str &aHostIP, USHORT aHostPort, const com::Utf8Str &aGuestIP, USHORT aGuestPort)
     279{
    269280    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    270281    Utf8Str name = aName;
     
    292303            return setError(E_INVALIDARG,
    293304                            tr("A NAT rule of this name already exists"));
    294         if (   r.strHostIP == Utf8Str(aBindIp)
     305        if (   r.strHostIP == aHostIP
    295306            && r.u16HostPort == aHostPort
    296307            && r.proto == aProto)
     
    301312    r.strName = name.c_str();
    302313    r.proto = aProto;
    303     r.strHostIP = aBindIp;
     314    r.strHostIP = aHostIP;
    304315    r.u16HostPort = aHostPort;
    305316    r.strGuestIP = aGuestIP;
     
    317328}
    318329
    319 STDMETHODIMP
    320 NATEngine::RemoveRedirect(IN_BSTR aName)
    321 {
    322     AutoCaller autoCaller(this);
    323     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    324 
     330HRESULT NATEngine::removeRedirect(const com::Utf8Str &aName)
     331{
    325332    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    326333    NATRuleMap::iterator it = mNATRules.find(aName);
     
    342349    mData.commit();
    343350    alock.release();
    344     mParent->onNATRedirectRuleChange(ulSlot, TRUE, aName, proto, Bstr(strHostIP).raw(), u16HostPort, Bstr(strGuestIP).raw(), u16GuestPort);
    345     return S_OK;
    346 }
    347 
    348 HRESULT NATEngine::loadSettings(const settings::NAT &data)
     351    mParent->onNATRedirectRuleChange(ulSlot, TRUE, Bstr(aName).raw(), proto, Bstr(strHostIP).raw(), u16HostPort, Bstr(strGuestIP).raw(), u16GuestPort);
     352    return S_OK;
     353}
     354
     355HRESULT NATEngine::i_loadSettings(const settings::NAT &data)
    349356{
    350357    AutoCaller autoCaller(this);
     
    383390
    384391
    385 HRESULT NATEngine::saveSettings(settings::NAT &data)
     392HRESULT NATEngine::i_saveSettings(settings::NAT &data)
    386393{
    387394    AutoCaller autoCaller(this);
     
    417424}
    418425
    419 
    420 STDMETHODIMP
    421 NATEngine::COMSETTER(Network)(IN_BSTR aNetwork)
    422 {
    423     AutoCaller autoCaller(this);
    424     AssertComRCReturnRC(autoCaller.rc());
     426HRESULT NATEngine::setNetwork(const com::Utf8Str &aNetwork)
     427{
    425428    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    426429    if (Bstr(mData->mNetwork) != aNetwork)
     
    434437}
    435438
    436 STDMETHODIMP
    437 NATEngine::COMGETTER(Network)(BSTR *aNetwork)
    438 {
    439     CheckComArgNotNull(aNetwork);
    440     AutoCaller autoCaller(this);
    441     AssertComRCReturnRC(autoCaller.rc());
    442 
     439
     440HRESULT NATEngine::getNetwork(com::Utf8Str &aNetwork)
     441{
    443442    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    444443    if (!mData->mNetwork.isEmpty())
    445444    {
    446         mData->mNetwork.cloneTo(aNetwork);
     445        aNetwork = mData->mNetwork;
    447446        Log(("Getter (this:%p) Network: %s\n", this, mData->mNetwork.c_str()));
    448447    }
     
    450449}
    451450
    452 STDMETHODIMP
    453 NATEngine::COMSETTER(HostIP)(IN_BSTR aBindIP)
    454 {
    455     AutoCaller autoCaller(this);
    456     AssertComRCReturnRC(autoCaller.rc());
    457     AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    458     if (Bstr(mData->mBindIP) != aBindIP)
    459     {
    460         mData.backup();
    461         mData->mBindIP = aBindIP;
    462         mParent->setModified(Machine::IsModified_NetworkAdapters);
    463         m_fModified = true;
    464     }
    465     return S_OK;
    466 }
    467 STDMETHODIMP NATEngine::COMGETTER(HostIP)(BSTR *aBindIP)
    468 {
    469     AutoCaller autoCaller(this);
    470     AssertComRCReturnRC(autoCaller.rc());
    471 
    472     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     451HRESULT NATEngine::setHostIP(const com::Utf8Str &aHostIP)
     452{
     453    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     454    if (Bstr(mData->mBindIP) != aHostIP)
     455    {
     456        mData.backup();
     457        mData->mBindIP = aHostIP;
     458        mParent->setModified(Machine::IsModified_NetworkAdapters);
     459        m_fModified = true;
     460    }
     461    return S_OK;
     462}
     463
     464HRESULT NATEngine::getHostIP(com::Utf8Str &aBindIP)
     465{
     466    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     467
    473468    if (!mData->mBindIP.isEmpty())
    474         mData->mBindIP.cloneTo(aBindIP);
    475     return S_OK;
    476 }
    477 
    478 
    479 STDMETHODIMP
    480 NATEngine::COMSETTER(TFTPPrefix)(IN_BSTR aTFTPPrefix)
    481 {
    482     AutoCaller autoCaller(this);
    483     AssertComRCReturnRC(autoCaller.rc());
     469        aBindIP = mData->mBindIP;
     470    return S_OK;
     471}
     472
     473HRESULT NATEngine::setTFTPPrefix(const com::Utf8Str &aTFTPPrefix)
     474{
    484475    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    485476    if (Bstr(mData->mTFTPPrefix) != aTFTPPrefix)
     
    493484}
    494485
    495 STDMETHODIMP
    496 NATEngine::COMGETTER(TFTPPrefix)(BSTR *aTFTPPrefix)
    497 {
    498     AutoCaller autoCaller(this);
    499     AssertComRCReturnRC(autoCaller.rc());
    500 
    501     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     486
     487HRESULT NATEngine::getTFTPPrefix(com::Utf8Str &aTFTPPrefix)
     488{
     489    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     490
    502491    if (!mData->mTFTPPrefix.isEmpty())
    503492    {
    504         mData->mTFTPPrefix.cloneTo(aTFTPPrefix);
     493        aTFTPPrefix = mData->mTFTPPrefix;
    505494        Log(("Getter (this:%p) TFTPPrefix: %s\n", this, mData->mTFTPPrefix.c_str()));
    506495    }
     
    508497}
    509498
    510 STDMETHODIMP
    511 NATEngine::COMSETTER(TFTPBootFile)(IN_BSTR aTFTPBootFile)
    512 {
    513     AutoCaller autoCaller(this);
    514     AssertComRCReturnRC(autoCaller.rc());
     499HRESULT NATEngine::setTFTPBootFile(const com::Utf8Str &aTFTPBootFile)
     500{
    515501    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    516502    if (Bstr(mData->mTFTPBootFile) != aTFTPBootFile)
     
    524510}
    525511
    526 STDMETHODIMP
    527 NATEngine::COMGETTER(TFTPBootFile)(BSTR *aTFTPBootFile)
    528 {
    529     AutoCaller autoCaller(this);
    530     AssertComRCReturnRC(autoCaller.rc());
    531 
     512
     513HRESULT NATEngine::getTFTPBootFile(com::Utf8Str &aTFTPBootFile)
     514{
    532515    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    533516    if (!mData->mTFTPBootFile.isEmpty())
    534517    {
    535         mData->mTFTPBootFile.cloneTo(aTFTPBootFile);
     518        aTFTPBootFile = mData->mTFTPBootFile;
    536519        Log(("Getter (this:%p) BootFile: %s\n", this, mData->mTFTPBootFile.c_str()));
    537520    }
     
    539522}
    540523
    541 STDMETHODIMP
    542 NATEngine::COMSETTER(TFTPNextServer)(IN_BSTR aTFTPNextServer)
    543 {
    544     AutoCaller autoCaller(this);
    545     AssertComRCReturnRC(autoCaller.rc());
     524
     525HRESULT NATEngine::setTFTPNextServer(const com::Utf8Str &aTFTPNextServer)
     526{
    546527    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    547528    if (Bstr(mData->mTFTPNextServer) != aTFTPNextServer)
     
    555536}
    556537
    557 STDMETHODIMP
    558 NATEngine::COMGETTER(TFTPNextServer)(BSTR *aTFTPNextServer)
    559 {
    560     AutoCaller autoCaller(this);
    561     AssertComRCReturnRC(autoCaller.rc());
    562 
     538HRESULT NATEngine::getTFTPNextServer(com::Utf8Str &aTFTPNextServer)
     539{
    563540    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    564541    if (!mData->mTFTPNextServer.isEmpty())
    565542    {
    566         mData->mTFTPNextServer.cloneTo(aTFTPNextServer);
     543        aTFTPNextServer =  mData->mTFTPNextServer;
    567544        Log(("Getter (this:%p) NextServer: %s\n", this, mData->mTFTPNextServer.c_str()));
    568545    }
    569546    return S_OK;
    570547}
     548
    571549/* DNS */
    572 STDMETHODIMP
    573 NATEngine::COMSETTER(DNSPassDomain) (BOOL aDNSPassDomain)
    574 {
    575     AutoCaller autoCaller(this);
    576     AssertComRCReturnRC(autoCaller.rc());
     550HRESULT NATEngine::setDNSPassDomain(BOOL aDNSPassDomain)
     551{
    577552    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    578553
     
    586561    return S_OK;
    587562}
    588 STDMETHODIMP
    589 NATEngine::COMGETTER(DNSPassDomain)(BOOL *aDNSPassDomain)
    590 {
    591     AutoCaller autoCaller(this);
    592     AssertComRCReturnRC(autoCaller.rc());
    593 
     563
     564HRESULT NATEngine::getDNSPassDomain(BOOL *aDNSPassDomain)
     565{
    594566    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    595567    *aDNSPassDomain = mData->mDNSPassDomain;
    596568    return S_OK;
    597569}
    598 STDMETHODIMP
    599 NATEngine::COMSETTER(DNSProxy)(BOOL aDNSProxy)
    600 {
    601     AutoCaller autoCaller(this);
    602     AssertComRCReturnRC(autoCaller.rc());
     570
     571
     572HRESULT NATEngine::setDNSProxy(BOOL aDNSProxy)
     573{
    603574    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    604575
     
    612583    return S_OK;
    613584}
    614 STDMETHODIMP
    615 NATEngine::COMGETTER(DNSProxy)(BOOL *aDNSProxy)
    616 {
    617     AutoCaller autoCaller(this);
    618     AssertComRCReturnRC(autoCaller.rc());
    619 
     585
     586HRESULT NATEngine::getDNSProxy(BOOL *aDNSProxy)
     587{
    620588    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    621589    *aDNSProxy = mData->mDNSProxy;
    622590    return S_OK;
    623591}
    624 STDMETHODIMP
    625 NATEngine::COMGETTER(DNSUseHostResolver)(BOOL *aDNSUseHostResolver)
    626 {
    627     AutoCaller autoCaller(this);
    628     AssertComRCReturnRC(autoCaller.rc());
     592
     593
     594HRESULT NATEngine::getDNSUseHostResolver(BOOL *aDNSUseHostResolver)
     595{
    629596    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    630597    *aDNSUseHostResolver = mData->mDNSUseHostResolver;
    631598    return S_OK;
    632599}
    633 STDMETHODIMP
    634 NATEngine::COMSETTER(DNSUseHostResolver)(BOOL aDNSUseHostResolver)
    635 {
    636     AutoCaller autoCaller(this);
    637     AssertComRCReturnRC(autoCaller.rc());
    638 
    639     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    640 
     600
     601
     602HRESULT NATEngine::setDNSUseHostResolver(BOOL aDNSUseHostResolver)
     603{
    641604    if (mData->mDNSUseHostResolver != aDNSUseHostResolver)
    642605    {
     
    649612}
    650613
    651 STDMETHODIMP NATEngine::COMSETTER(AliasMode)(ULONG aAliasMode)
    652 {
    653     AutoCaller autoCaller(this);
    654     AssertComRCReturnRC(autoCaller.rc());
    655 
     614HRESULT NATEngine::setAliasMode(ULONG aAliasMode)
     615{
    656616    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    657617
     
    666626}
    667627
    668 STDMETHODIMP NATEngine::COMGETTER(AliasMode)(ULONG *aAliasMode)
    669 {
    670     AutoCaller autoCaller(this);
    671     AssertComRCReturnRC(autoCaller.rc());
     628HRESULT NATEngine::getAliasMode(ULONG *aAliasMode)
     629{
    672630    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    673631    *aAliasMode = mData->mAliasMode;
  • trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp

    r49742 r49871  
    12511251    }
    12521252
    1253     mNATEngine->loadSettings(data.nat);
     1253    mNATEngine->i_loadSettings(data.nat);
    12541254    mData->mBridgedInterface = data.strBridgedName;
    12551255    mData->mInternalNetwork = data.strInternalNetworkName;
     
    13061306    data.mode = mData->mAttachmentType;
    13071307
    1308     mNATEngine->commit();
    1309     mNATEngine->saveSettings(data.nat);
     1308    mNATEngine->i_commit();
     1309    mNATEngine->i_saveSettings(data.nat);
    13101310
    13111311    data.strBridgedName = mData->mBridgedInterface;
     
    13331333    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    13341334    bool fChanged = m_fModified;
    1335     fChanged |= (mData->mAdapterType == NetworkAttachmentType_NAT? mNATEngine->isModified() : false);
     1335    fChanged |= (mData->mAdapterType == NetworkAttachmentType_NAT? mNATEngine->i_isModified() : false);
    13361336    return fChanged;
    13371337}
  • trunk/src/VBox/Main/src-server/ParallelPortImpl.cpp

    r44528 r49871  
    55
    66/*
    7  * Copyright (C) 2006-2011 Oracle Corporation
     7 * Copyright (C) 2006-2013 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    5252// constructor / destructor
    5353/////////////////////////////////////////////////////////////////////////////
     54DEFINE_EMPTY_CTOR_DTOR(ParallelPort)
    5455
    5556HRESULT ParallelPort::FinalConstruct()
     
    194195/////////////////////////////////////////////////////////////////////////////
    195196
    196 STDMETHODIMP ParallelPort::COMGETTER(Enabled) (BOOL *aEnabled)
    197 {
    198     CheckComArgOutPointerValid(aEnabled);
    199 
    200     AutoCaller autoCaller(this);
    201     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    202 
     197HRESULT ParallelPort::getEnabled(BOOL *aEnabled)
     198{
    203199    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    204200
     
    208204}
    209205
    210 STDMETHODIMP ParallelPort::COMSETTER(Enabled) (BOOL aEnabled)
     206HRESULT ParallelPort::setEnabled(BOOL aEnabled)
    211207{
    212208    LogFlowThisFunc(("aEnabled=%RTbool\n", aEnabled));
    213 
    214     AutoCaller autoCaller(this);
    215     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    216 
    217209    /* the machine needs to be mutable */
    218210    AutoMutableStateDependency adep(m->pMachine);
     
    246238}
    247239
    248 STDMETHODIMP ParallelPort::COMGETTER(Slot) (ULONG *aSlot)
    249 {
    250     CheckComArgOutPointerValid(aSlot);
    251 
    252     AutoCaller autoCaller(this);
    253     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    254 
     240HRESULT ParallelPort::getSlot(ULONG *aSlot)
     241{
    255242    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    256243
     
    260247}
    261248
    262 STDMETHODIMP ParallelPort::COMGETTER(IRQ) (ULONG *aIRQ)
    263 {
    264     CheckComArgOutPointerValid(aIRQ);
    265 
    266     AutoCaller autoCaller(this);
    267     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    268 
     249HRESULT ParallelPort::getIRQ(ULONG *aIRQ)
     250{
    269251    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    270252
     
    274256}
    275257
    276 STDMETHODIMP ParallelPort::COMSETTER(IRQ)(ULONG aIRQ)
     258HRESULT ParallelPort::setIRQ(ULONG aIRQ)
    277259{
    278260    /* check IRQ limits
     
    283265                        m->bd->ulSlot, aIRQ, 255);
    284266
    285     AutoCaller autoCaller(this);
    286     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    287 
    288267    /* the machine needs to be mutable */
    289268    AutoMutableStateDependency adep(m->pMachine);
     
    311290}
    312291
    313 STDMETHODIMP ParallelPort::COMGETTER(IOBase) (ULONG *aIOBase)
    314 {
    315     CheckComArgOutPointerValid(aIOBase);
    316 
    317     AutoCaller autoCaller(this);
    318     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    319 
     292HRESULT ParallelPort::getIOBase(ULONG *aIOBase)
     293{
    320294    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    321295
     
    325299}
    326300
    327 STDMETHODIMP ParallelPort::COMSETTER(IOBase)(ULONG aIOBase)
     301HRESULT ParallelPort::setIOBase(ULONG aIOBase)
    328302{
    329303    /* check IOBase limits
     
    334308                        m->bd->ulSlot, aIOBase, 0, 0xFFFF);
    335309
    336     AutoCaller autoCaller(this);
    337     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    338 
    339310    /* the machine needs to be mutable */
    340311    AutoMutableStateDependency adep(m->pMachine);
     
    362333}
    363334
    364 STDMETHODIMP ParallelPort::COMGETTER(Path) (BSTR *aPath)
    365 {
    366     CheckComArgOutPointerValid(aPath);
    367 
    368     AutoCaller autoCaller(this);
    369     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    370 
    371     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    372 
    373     m->bd->strPath.cloneTo(aPath);
    374 
    375     return S_OK;
    376 }
    377 
    378 STDMETHODIMP ParallelPort::COMSETTER(Path) (IN_BSTR aPath)
    379 {
    380     AutoCaller autoCaller(this);
    381     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    382 
     335
     336HRESULT ParallelPort::getPath(com::Utf8Str &aPath)
     337{
     338    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     339    aPath = m->bd->strPath;
     340    return S_OK;
     341}
     342
     343
     344HRESULT ParallelPort::setPath(const com::Utf8Str &aPath)
     345{
    383346    /* the machine needs to be mutable */
    384347    AutoMutableStateDependency adep(m->pMachine);
     
    387350    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    388351
    389     Utf8Str str(aPath);
    390     if (str != m->bd->strPath)
     352    if (aPath != m->bd->strPath)
    391353    {
    392         HRESULT rc = checkSetPath(str);
     354        HRESULT rc = i_checkSetPath(aPath);
    393355        if (FAILED(rc)) return rc;
    394356
    395357        m->bd.backup();
    396         m->bd->strPath = str;
     358        m->bd->strPath = aPath;
    397359
    398360        m->fModified = true;
     361
    399362        // leave the lock before informing callbacks
    400363        alock.release();
     
    421384 *  @note Locks this object for writing.
    422385 */
    423 HRESULT ParallelPort::loadSettings(const settings::ParallelPort &data)
     386HRESULT ParallelPort::i_loadSettings(const settings::ParallelPort &data)
    424387{
    425388    AutoCaller autoCaller(this);
     
    439402 *  Note that the given Port node is completely empty on input.
    440403 *
    441  *  @param aPortNode <Port> node.
     404 *  @param  <data> node.
    442405 *
    443406 *  @note Locks this object for reading.
    444407 */
    445 HRESULT ParallelPort::saveSettings(settings::ParallelPort &data)
     408HRESULT ParallelPort::i_saveSettings(settings::ParallelPort &data)
    446409{
    447410    AutoCaller autoCaller(this);
     
    460423 * @return
    461424 */
    462 bool ParallelPort::isModified()
     425bool ParallelPort::i_isModified()
    463426{
    464427    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     
    469432 *  @note Locks this object for writing.
    470433 */
    471 void ParallelPort::rollback()
     434void ParallelPort::i_rollback()
    472435{
    473436    /* sanity */
     
    484447 *  for writing) if there is one.
    485448 */
    486 void ParallelPort::commit()
     449void ParallelPort::i_commit()
    487450{
    488451    /* sanity */
     
    513476 *  represented by @a aThat (locked for reading).
    514477 */
    515 void ParallelPort::copyFrom(ParallelPort *aThat)
     478void ParallelPort::i_copyFrom(ParallelPort *aThat)
    516479{
    517480    AssertReturnVoid (aThat != NULL);
     
    537500 *  Validates COMSETTER(Path) arguments.
    538501 */
    539 HRESULT ParallelPort::checkSetPath(const Utf8Str &str)
     502HRESULT ParallelPort::i_checkSetPath(const Utf8Str &str)
    540503{
    541504    AssertReturn(isWriteLockOnCurrentThread(), E_FAIL);
  • trunk/src/VBox/Main/src-server/SnapshotImpl.cpp

    r49795 r49871  
    10451045    {
    10461046        MediumAttachment *pAtt = *it;
    1047         Medium *pMedium = pAtt->getMedium();
     1047        Medium *pMedium = pAtt->i_getMedium();
    10481048        if (pMedium) // can be NULL for non-harddisk
    10491049        {
     
    17771777        ComObjPtr<MediumAttachment> &pAttach = *it;
    17781778        AutoReadLock attachLock(pAttach COMMA_LOCKVAL_SRC_POS);
    1779         if (pAttach->getType() == DeviceType_HardDisk)
     1779        if (pAttach->i_getType() == DeviceType_HardDisk)
    17801780        {
    17811781            ++ulOpCount;
    17821782            ++ulTotalWeight;         // assume one MB weight for each differencing hard disk to manage
    1783             Assert(pAttach->getMedium());
    1784             LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pAttach->getMedium()->i_getName().c_str()));
     1783            Assert(pAttach->i_getMedium());
     1784            LogFlowThisFunc(("op %d: considering hard disk attachment %s\n", ulOpCount, pAttach->i_getMedium()->i_getName().c_str()));
    17851785        }
    17861786    }
     
    19641964        {
    19651965            ComObjPtr<MediumAttachment> pAttach = *it;
    1966             ComObjPtr<Medium> pMedium = pAttach->getMedium();
     1966            ComObjPtr<Medium> pMedium = pAttach->i_getMedium();
    19671967
    19681968            /* while the hard disk is attached, the number of children or the
    19691969             * parent cannot change, so no lock */
    19701970            if (    !pMedium.isNull()
    1971                  && pAttach->getType() == DeviceType_HardDisk
     1971                 && pAttach->i_getType() == DeviceType_HardDisk
    19721972                 && !pMedium->i_getParent().isNull()
    19731973                 && pMedium->i_getChildren().size() == 0
     
    20082008        {
    20092009            ComObjPtr<MediumAttachment> pAttach = *it;        // guaranteed to have only attachments where medium != NULL
    2010             ComObjPtr<Medium> pMedium = pAttach->getMedium();
     2010            ComObjPtr<Medium> pMedium = pAttach->i_getMedium();
    20112011
    20122012            AutoWriteLock mlock(pMedium COMMA_LOCKVAL_SRC_POS);
     
    21762176                        mUserData->s.strName.c_str());
    21772177
    2178 
    21792178    /* If the snapshot being deleted is the current one, ensure current
    21802179     * settings are committed and saved.
     
    22142213        ComObjPtr<MediumAttachment> &pAttach = *it;
    22152214        AutoReadLock attachLock(pAttach COMMA_LOCKVAL_SRC_POS);
    2216         if (pAttach->getType() == DeviceType_HardDisk)
    2217         {
    2218             ComObjPtr<Medium> pHD = pAttach->getMedium();
     2215        if (pAttach->i_getType() == DeviceType_HardDisk)
     2216        {
     2217            ComObjPtr<Medium> pHD = pAttach->i_getMedium();
    22192218            Assert(pHD);
    22202219            AutoReadLock mlock(pHD COMMA_LOCKVAL_SRC_POS);
     
    24372436            ComObjPtr<MediumAttachment> &pAttach = *it;
    24382437            AutoReadLock attachLock(pAttach COMMA_LOCKVAL_SRC_POS);
    2439             if (pAttach->getType() != DeviceType_HardDisk)
     2438            if (pAttach->i_getType() != DeviceType_HardDisk)
    24402439                continue;
    24412440
    2442             ComObjPtr<Medium> pHD = pAttach->getMedium();
     2441            ComObjPtr<Medium> pHD = pAttach->i_getMedium();
    24432442            Assert(!pHD.isNull());
    24442443
     
    24792478                pOnlineMediumAttachment =
    24802479                    findAttachment(mMediaData->mAttachments,
    2481                                    pAttach->getControllerName().raw(),
    2482                                    pAttach->getPort(),
    2483                                    pAttach->getDevice());
     2480                                   pAttach->i_getControllerName().raw(),
     2481                                   pAttach->i_getPort(),
     2482                                   pAttach->i_getDevice());
    24842483                if (pOnlineMediumAttachment)
    24852484                {
     
    28732872                {
    28742873                    AutoWriteLock attLock(pAtt COMMA_LOCKVAL_SRC_POS);
    2875                     pAtt->updateMedium(it->mpTarget);
     2874                    pAtt->i_updateMedium(it->mpTarget);
    28762875                    it->mpTarget->i_addBackReference(pMachine->mData->mUuid, childSnapshotId);
    28772876                }
     
    36493648    {
    36503649        AutoWriteLock attLock(pDeleteRec->mpOnlineMediumAttachment COMMA_LOCKVAL_SRC_POS);
    3651         pDeleteRec->mpOnlineMediumAttachment->updateMedium(pDeleteRec->mpTarget);
     3650        pDeleteRec->mpOnlineMediumAttachment->i_updateMedium(pDeleteRec->mpTarget);
    36523651    }
    36533652
  • trunk/src/VBox/Main/src-server/USBControllerImpl.cpp

    r47401 r49871  
    234234
    235235
    236 // IUSBController properties
    237 /////////////////////////////////////////////////////////////////////////////
    238 STDMETHODIMP USBController::COMGETTER(Name) (BSTR *aName)
    239 {
    240     CheckComArgOutPointerValid(aName);
    241 
    242     AutoCaller autoCaller(this);
    243     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    244 
     236// Wrapped IUSBController properties
     237/////////////////////////////////////////////////////////////////////////////
     238HRESULT USBController::getName(com::Utf8Str &aName)
     239{
    245240    /* strName is constant during life time, no need to lock */
    246     m->bd->strName.cloneTo(aName);
    247 
    248     return S_OK;
    249 }
    250 
    251 STDMETHODIMP USBController::COMGETTER(Type)(USBControllerType_T *aType)
    252 {
    253     CheckComArgOutPointerValid(aType);
    254 
    255     AutoCaller autoCaller(this);
    256     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    257 
     241    aName = m->bd->strName;
     242
     243    return S_OK;
     244}
     245
     246HRESULT USBController::getType(USBControllerType_T *aType)
     247{
    258248    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    259249
     
    263253}
    264254
    265 STDMETHODIMP USBController::COMGETTER(USBStandard)(USHORT *aUSBStandard)
    266 {
    267     CheckComArgOutPointerValid(aUSBStandard);
    268 
    269     AutoCaller autoCaller(this);
    270     if (FAILED(autoCaller.rc())) return autoCaller.rc();
    271 
     255HRESULT USBController::getUSBStandard(USHORT *aUSBStandard)
     256{
    272257    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    273258
     
    292277
    293278/** @note Locks objects for writing! */
    294 void USBController::rollback()
     279void USBController::i_rollback()
    295280{
    296281    AutoCaller autoCaller(this);
     
    310295 *  for writing) if there is one.
    311296 */
    312 void USBController::commit()
     297void USBController::i_commit()
    313298{
    314299    /* sanity */
     
    340325 *  represented by @a aThat (locked for reading).
    341326 */
    342 void USBController::copyFrom(USBController *aThat)
     327void USBController::i_copyFrom(USBController *aThat)
    343328{
    344329    AssertReturnVoid(aThat != NULL);
     
    374359 *  represented by @a aThat (locked for reading).
    375360 */
    376 void USBController::unshare()
     361void USBController::i_unshare()
    377362{
    378363    /* sanity */
     
    400385}
    401386
    402 const Utf8Str& USBController::getName() const
     387const Utf8Str &USBController::i_getName() const
    403388{
    404389    return m->bd->strName;
    405390}
    406391
    407 USBControllerType_T USBController::getControllerType() const
     392const USBControllerType_T &USBController::i_getControllerType() const
    408393{
    409394    return m->bd->enmType;
    410395}
    411396
    412 ComObjPtr<USBController> USBController::getPeer()
     397ComObjPtr<USBController> USBController::i_getPeer()
    413398{
    414399    return m->pPeer;
    415400}
    416401
    417 // private methods
    418402/////////////////////////////////////////////////////////////////////////////
    419403/* vi: set tabstop=4 shiftwidth=4 expandtab: */
  • trunk/src/VBox/Main/src-server/VFSExplorerImpl.cpp

    r49644 r49871  
    3636
    3737#include <memory>
     38
     39struct VFSExplorer::Data
     40{
     41    struct DirEntry
     42    {
     43        DirEntry(Utf8Str strName, VFSFileType_T fileType, uint64_t cbSize, uint32_t fMode)
     44           : name(strName)
     45           , type(fileType)
     46           , size(cbSize)
     47           , mode(fMode) {}
     48
     49        Utf8Str name;
     50        VFSFileType_T type;
     51        uint64_t size;
     52        uint32_t mode;
     53    };
     54
     55    VFSType_T storageType;
     56    Utf8Str strUsername;
     57    Utf8Str strPassword;
     58    Utf8Str strHostname;
     59    Utf8Str strPath;
     60    Utf8Str strBucket;
     61    std::list<DirEntry> entryList;
     62};
     63
    3864
    3965VFSExplorer::VFSExplorer()
     
    538564
    539565     if (SUCCEEDED(rc))
    540         /* Return progress to the caller */
    541         progress.queryInterfaceTo(aProgress.asOutParam());
     566         /* Return progress to the caller */
     567         progress.queryInterfaceTo(aProgress.asOutParam());
    542568
    543569    return rc;
  • trunk/src/VBox/Main/src-server/generic/NetIf-generic.cpp

    r49586 r49871  
    266266                            iface.createObject();
    267267                            iface->init(IfName, HostNetworkInterfaceType_HostOnly, pInfo);
    268                             iface->setVirtualBox(pVBox);
     268                            iface->i_setVirtualBox(pVBox);
    269269                            iface.queryInterfaceTo(aHostNetworkInterface);
    270270                        }
  • trunk/src/VBox/Main/src-server/xpcom/server.cpp

    r49795 r49871  
    113113NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Snapshot, ISnapshot)
    114114
    115 NS_DECL_CLASSINFO(MediumAttachment)
    116 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(MediumAttachment, IMediumAttachment)
    117 
    118115NS_DECL_CLASSINFO(Progress)
    119116NS_IMPL_THREADSAFE_ISUPPORTS1_CI(Progress, IProgress)
     
    125122NS_IMPL_THREADSAFE_ISUPPORTS1_CI(SharedFolder, ISharedFolder)
    126123
    127 NS_DECL_CLASSINFO(HostNetworkInterface)
    128 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(HostNetworkInterface, IHostNetworkInterface)
    129 
    130124NS_DECL_CLASSINFO(NetworkAdapter)
    131125NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NetworkAdapter, INetworkAdapter)
    132 
    133 NS_DECL_CLASSINFO(NATEngine)
    134 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(NATEngine, INATEngine)
    135 
    136 NS_DECL_CLASSINFO(ParallelPort)
    137 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(ParallelPort, IParallelPort)
    138 
    139 NS_DECL_CLASSINFO(USBController)
    140 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(USBController, IUSBController)
    141126
    142127NS_DECL_CLASSINFO(USBDeviceFilters)
     
    153138NS_IMPL_THREADSAFE_ISUPPORTS2_CI(HostUSBDeviceFilter, IUSBDeviceFilter, IHostUSBDeviceFilter)
    154139#endif
    155 
    156 NS_DECL_CLASSINFO(AudioAdapter)
    157 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(AudioAdapter, IAudioAdapter)
    158140
    159141NS_DECL_CLASSINFO(SystemProperties)
     
    166148NS_IMPL_THREADSAFE_ISUPPORTS1_CI(PerformanceMetric, IPerformanceMetric)
    167149#endif /* VBOX_WITH_RESOURCE_USAGE_API */
    168 
    169 NS_DECL_CLASSINFO(BIOSSettings)
    170 NS_IMPL_THREADSAFE_ISUPPORTS1_CI(BIOSSettings, IBIOSSettings)
    171150
    172151#ifdef VBOX_WITH_EXTPACK
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